Sea fog hyperspectral remote sensing image recognition method and system based on Mama
Through the Mamba-based sea fog hyperspectral remote sensing image recognition method, the Mamba model is constructed and trained, and the existing Transformer model is solved, and efficient and accurate sea fog image recognition is achieved, which is suitable for the field of sea fog monitoring and analysis.
Patent Information
- Application Number
- CN202411892980.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-20
- Publication Date
- 2025-04-11
AI Technical Summary
The existing Transformer model has high computational complexity in hyperspectral remote sensing image classification, long training time and large memory usage, especially poor performance when processing long-sequence data.
The sea fog image recognition model is obtained by using Mamba-based hyperspectral remote sensing image recognition method, and by constructing the Mamba model and combining the hyperspectral data set for training and optimization. This method exhibits excellent performance and low computational complexity on long-sequence tasks.
It improves the accuracy, efficiency and generalization ability of sea fog image recognition, reduces the computational complexity and memory usage, and is suitable for multiple fields involving sea fog monitoring and analysis.
Smart Images

Figure CN119810662A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the technical field of image processing, and in particular to a method and system for recognizing sea fog hyperspectral remote sensing images based on Mamba. Background Art
[0002] At present, in the field of hyperspectral remote sensing image classification, the traditional Transformer has indeed demonstrated powerful representation capabilities, but its self-attention mechanism has certain limitations. Specifically, when performing calculations, the mechanism needs to process global dependencies, which makes the structure of the model complicated, and thus greatly increases its computational complexity.
[0003] Therefore, not only will the training time of the model be prolonged, but the memory usage during operation will also be quite large, especially when faced with long sequence data, these problems become more prominent. In view of this situation, there is an urgent need for a model that can show excellent performance in long sequence tasks while having low computational complexity, so as to better cope with the many challenges in hyperspectral remote sensing image classification. Summary of the invention
[0004] In order to solve the problems existing in the above-mentioned prior art, the purpose of the present disclosure is to provide a method and system for sea fog hyperspectral remote sensing image recognition based on Mamba. The sea fog hyperspectral remote sensing image recognition method based on Mamba gives full play to the advantages of hyperspectral data and Mamba model, forming a complete and efficient system, and the Mamba model has excellent performance and low computational complexity in long sequence tasks, which helps to improve the accuracy and efficiency of sea fog image recognition and the generalization ability of the model, and has important application value in many fields involving sea fog monitoring and analysis.
[0005] The present invention discloses a method and system for recognizing sea fog hyperspectral remote sensing images based on Mamba, comprising the following steps:
[0006] S1, obtain hyperspectral image data and corresponding label data, perform data analysis and processing, and construct a hyperspectral dataset for training;
[0007] S2. constructing a Mamba model, and training and optimizing the Mamba model in combination with the hyperspectral dataset to obtain a sea fog image recognition model;
[0008] S3. Acquire a target sea fog image to be identified, identify and classify the target sea fog image using the sea fog image recognition model, and obtain an identification and classification result of the target sea fog image.
[0009] Preferably, in step S1, the data analysis process includes:
[0010] Acquire hyperspectral image data and corresponding label data, wherein the hyperspectral image data includes image samples having sea fog features and non-sea fog features, wherein the label corresponding to the sea fog feature in the label data is 1, and the label corresponding to the non-sea fog feature in the label data is 0;
[0011] Acquire three-dimensional array information (H, W, B) of the hyperspectral image data, wherein H represents height, W represents width, B represents the number of bands, and Z=H*W represents the total number of elements in each band;
[0012] The minimum-maximum normalization method is used to map the data of B bands in the hyperspectral data to the interval [0, 1], and the data of each band is normalized to obtain the normalized band data. The normalized value X is calculated according to the following formula: i'norm :
[0013]
[0014] Among them, i' takes the value of 1, 2, ..., B, indicating the i'th band; X i',j' represents the j'th value in the i'th band, where j' is 1, 2, ..., Z; X i'min represents the minimum value in the i'th band; X i'max represents the maximum value in the i'th band;
[0015] According to the band data, a principal component analysis method is used to perform a principal component analysis on the hyperspectral image data to obtain a principal component cumulative variance contribution rate of each band;
[0016] The principal component cumulative variance contribution rate threshold is set to A, and the band with the principal component cumulative variance contribution rate ≥ A is selected as the specific band.
[0017] Preferably, step S1 further includes:
[0018] After completing the data analysis process, the hyperspectral image data and the corresponding label data are divided into a training set and a test set, and the training set and the test set constitute a hyperspectral data set for training. The division formula is as follows:
[0019] X train =X*P
[0020] X test =X*(1-P)
[0021] Y train =Y*P
[0022] Y test =Y*(1-P)
[0023] Wherein, X represents the total amount of the hyperspectral image data; X train represents the number of hyperspectral images in the training set; train represents the number of hyperspectral images in the test set; X test Indicates the number of labels in the training set; Y test represents the number of labels in the test set; P and 1-P represent the division ratio of the training set and the test set respectively, satisfying P<1.
[0024] Preferably, step S2 specifically includes the following steps:
[0025] S201, constructing a Mamba model, and adjusting the Mamba model to obtain an initial Mamba model;
[0026] S202, training the initial Mamba model in combination with the training set to obtain a trained Mamba model, and testing the trained Mamba model in combination with the test set to obtain a test result;
[0027] S203, evaluating the test results to obtain evaluation test results, optimizing the Mamba model according to the evaluation test results to obtain a sea fog image recognition model.
[0028] Preferably, step S201 specifically includes:
[0029] Initializing the Mamba model configuration parameters by setting the model dimension, number of layers, state dimension, expansion factor, and convolution kernel size;
[0030] Adding a Residua l Block module to the Mamba model, wherein the Residua l Block module includes a mixing layer and a normalization layer;
[0031] The hybrid layer includes an input projection layer, a one-dimensional convolution layer, a state space model layer, and a time scale projection layer;
[0032] Set the input dimension of the input projection layer to d_mode 1 and the output dimension to 2×d_inner;
[0033] Set the input and output dimensions of the one-dimensional convolutional layer to d_inner, and configure the convolution kernel size to d_conv value;
[0034] The input dimension of the state space model layer is set to d_inner and the output dimension is set to d_trank+2×d_state;
[0035] Set the input dimension of the time scale projection layer to d_trank and the output dimension to d_inner;
[0036] A time scale dt is generated within a set initialization range [dt_min, dt_max], the inverse inv_dt of the time scale dt is calculated, and the time scale parameters are initialized according to the architecture and data characteristics of the Mamba model.
[0037] Preferably, step S201 further includes:
[0038] The Mamba model is subjected to hyperparameter tuning, wherein the hyperparameter tuning includes setting the initial learning rate α to 1e -3 ~1e -5 , select the batch size as 32 or 64, and adjust the number of layers in the Mamba model between 4 and 10;
[0039] Focal Loss is used to adjust the loss function of the Mamba model, and the following formula is set to calculate the loss value of the Focal Loss:
[0040]
[0041] Among them, L focal Represents the focus loss value; α t represents the weight of the corresponding category; γ represents the focusing parameter; represents the probability value of the corresponding category; t represents the category, and t takes values of 0 and 1, t=0 represents the category of the non-sea fog feature, and t=1 represents the category of the sea fog feature;
[0042] Regularization technology is applied to the Mamba model, an L2 regularization term is added to the loss function, a Dropout layer is added to the Residua l Block module, and the probability P of the Dropout layer is set to 0.3-0.5, and the L2 regularization term is added according to the following formula:
[0043]
[0044] Among them, L total Indicates the total loss value; L focal represents the focus loss value; λ represents the regularization strength; ω i” represents the i-th model weight; N represents the total number of model weights; i" = 1, 2, ..., N.
[0045] Preferably, step S202 specifically includes:
[0046] Adopting the Adam optimizer, training the Mamba model in combination with the training set, and setting the number of training rounds to Q;
[0047] According to the training rounds, the training set is forward propagated in sequence to obtain prediction results, and the loss value is calculated by the focal loss;
[0048] Back-propagation is performed by the Adam optimizer according to the gradient corresponding to the calculated loss value to update the weight parameters of the Mamba model;
[0049] Perform Q iterations of training to obtain the trained Mamba model;
[0050] The trained Mamba model is tested in combination with the test set, and the prediction result of each image sample in the test set is obtained through the forward propagation of the Mamba model. The prediction result is compared with the label corresponding to each image sample in the test set one by one to obtain the recognition result of each image sample.
[0051] Preferably, step S203 specifically includes:
[0052] According to the recognition results, the performance of the Mamba model is judged by constructing a confusion matrix CM and calculating the overall classification accuracy OA, the average classification accuracy AA and the statistical coefficient Kappa;
[0053] The confusion matrix CM is:
[0054]
[0055] The overall classification accuracy OA is:
[0056]
[0057] The average classification accuracy AA is:
[0058]
[0059] The statistical coefficient Kappa is:
[0060]
[0061] Among them, m 1,1 Indicates the number of correct predictions of the sea fog characteristics; m 1,2 represents the number of sea fog feature prediction errors; m 2,1 represents the number of prediction errors of the non-sea fog feature; m 2,2represents the number of correct predictions of the non-sea fog features; n represents the number of feature categories, and the value of n is: n=1, 2; the values of i and j are: i=1, 2, j=1, 2; m i,i represents the number of the i-th row and i-th column in the confusion matrix CM; m i,j represents the number of the i-th row and j-th column in the confusion matrix CM; N represents the total number of images with the sea fog feature and the non-sea fog feature in the test set; N i represents the total number of features of the i-th category, where N1 when i=1 represents the total number of images with the sea fog feature in the test set, and N2 when i=2 represents the total number of images with the non-sea fog feature in the test set;
[0062] The model performance coefficient S is calculated based on the calculated overall classification accuracy OA, the average classification accuracy AA and the statistical coefficient Kappa. E :
[0063] S E =b1*OA+b2*AA+b3*Kappa
[0064] Wherein, b1, b2 and b3 are adjustment coefficients and satisfy b1+b2+b3=1;
[0065] If S E ≥0.85, the performance of the Mamba model is judged to be qualified, and the Mamba model is used as the sea fog image recognition model;
[0066] If S E <0.85, the performance of the Mamba model is judged to be unqualified, and the Mamba model is adjusted and optimized, and retrained, tested and evaluated until S is met. E ≥0.85.
[0067] Preferably, step S3 specifically includes:
[0068] A target sea fog image to be identified is obtained, the target sea fog image is identified and classified by the sea fog image recognition model, an identification and classification result including the sea fog features and the non-sea fog features is obtained, and the identification and classification result is visualized.
[0069] The present disclosure also provides a sea fog hyperspectral remote sensing image recognition system based on Mamba, comprising:
[0070] A hyperspectral dataset construction module is used to obtain hyperspectral image data and corresponding label data, perform data analysis and processing, and construct a hyperspectral dataset for training;
[0071] A model building module, used for building a Mamba model, and training and optimizing the Mamba model in combination with the hyperspectral dataset;
[0072] The sea fog image recognition module is used to obtain a target sea fog image to be recognized, and to recognize and classify the target sea fog image.
[0073] The advantages of the Mamba-based sea fog hyperspectral remote sensing image recognition method and system disclosed in the present invention are:
[0074] 1. A sea fog hyperspectral remote sensing image recognition method based on Mamba disclosed in the present invention comprises the following steps: S1, obtaining hyperspectral image data and corresponding label data, performing data analysis and processing, and constructing a hyperspectral data set for training; S2, constructing a Mamba model, and training and optimizing the Mamba model in combination with the hyperspectral data set to obtain a sea fog image recognition model; S3, obtaining a target sea fog image to be identified, identifying and classifying the target sea fog image through the sea fog image recognition model, and obtaining an identification and classification result of the target sea fog image. By acquiring hyperspectral images and corresponding label data and processing them to construct a hyperspectral dataset for training, we can not only accurately capture the characteristics of sea fog based on the rich spectral information of the hyperspectral, but also ensure data quality and standard format through preprocessing. We can also help the model to effectively learn, verify and evaluate by reasonably dividing the dataset, laying a solid foundation for subsequent work. Through the unique architecture of the Mamba model, the multi-dimensional characteristics of hyperspectral data are mined, and combined with training optimization methods, the model can master the characteristics of sea fog and improve its generalization ability, so that it can stably and accurately cope with various sea fog image recognition tasks. Using the trained model to identify and classify the target sea fog image can not only output the results efficiently and accurately, but also avoid interference from human factors. The sea fog hyperspectral remote sensing image recognition method based on Mamba gives full play to the advantages of hyperspectral data and the Mamba model, forming a complete and efficient system. The Mamba model has excellent performance and low computational complexity in long sequence tasks, which helps to improve the accuracy and efficiency of sea fog image recognition and the generalization ability of the model, and has important application value in many fields involving sea fog monitoring and analysis.
[0075] 2. A sea fog hyperspectral remote sensing image recognition system based on Mamba disclosed in the present invention includes a hyperspectral data set construction module, which is used to obtain hyperspectral image data and corresponding label data, perform data analysis and processing, and construct a hyperspectral data set for training; a model construction module, which is used to construct a Mamba model, and train and optimize the Mamba model in combination with a hyperspectral data set; a sea fog image recognition module, which is used to obtain a target sea fog image to be identified, and identify and classify the target sea fog image. By analyzing and processing the acquired hyperspectral image data and label data, the noise and redundant information in the data can be effectively reduced; a Mamba model is constructed for the sea fog hyperspectral remote sensing image recognition task, and each layer in the Mamba model can gradually extract and integrate the features of the sea fog image in different bands and spatial positions, which is more adaptable to the complex needs of sea fog recognition than the general model; the sea fog image recognition module can directly obtain the target sea fog image to be identified and identify and classify it, providing a convenient interface for practical applications, and can quickly process a large number of target sea fog images, output the classification results of sea fog features and non-sea fog features, and meet the timeliness requirements for sea fog recognition in the fields of ocean monitoring and weather forecasting. BRIEF DESCRIPTION OF THE DRAWINGS
[0076] Figure 1 is a flow chart of a method for recognizing sea fog hyperspectral remote sensing images based on Mamba described in the present disclosure;
[0077] Figure 2 is a flowchart of the steps of a method for recognizing sea fog hyperspectral remote sensing images based on Mamba described in the present disclosure;
[0078] Figure 3 It is an architecture diagram of the Mamba model in the Mamba-based sea fog hyperspectral remote sensing image recognition method described in the present invention. DETAILED DESCRIPTION
[0079] like Figure 1 - Figure 3 As shown, the sea fog hyperspectral remote sensing image recognition method based on Mamba described in the present disclosure includes the following steps:
[0080] S1, obtain hyperspectral image data and corresponding label data, perform data analysis and processing, and construct a hyperspectral dataset for training;
[0081] S2, constructing the Mamba model, and training and optimizing the Mamba model in combination with the hyperspectral dataset to obtain a sea fog image recognition model;
[0082] S3. Obtain a target sea fog image to be identified, identify and classify the target sea fog image through a sea fog image recognition model, and obtain a recognition and classification result of the target sea fog image.
[0083] Furthermore, in this embodiment, in step S1, the data analysis process includes:
[0084] Acquire hyperspectral image data and corresponding label data, the hyperspectral image data including image samples with sea fog features and non-sea fog features, the label corresponding to the sea fog feature in the label data is 1, and the label corresponding to the non-sea fog feature in the label data is 0;
[0085] Obtain three-dimensional array information (H, W, B) of hyperspectral image data, where H represents height, W represents width, B represents the number of bands, and Z = H*W represents the total number of elements in each band;
[0086] The minimum-maximum normalization method is used to map the data of B bands in the hyperspectral data to the interval [0, 1], and the data of each band is normalized to obtain the normalized band data. The normalized value X is calculated according to the following formula: i'norm :
[0087]
[0088] Among them, i' takes the value of 1, 2, ..., B, indicating the i'th band; X i',j' represents the j'th value in the i'th band, where j' is 1, 2, ..., Z; X i'min represents the minimum value in the i'th band; X i'max represents the maximum value in the i'th band;
[0089] According to the band data, the principal component analysis method is used to perform principal component analysis on the hyperspectral image data to obtain the cumulative variance contribution rate of the principal component of each band;
[0090] Set the principal component cumulative variance contribution rate threshold as A, and select the band with principal component cumulative variance contribution rate ≥ A as the specific band;
[0091] Here is an example:
[0092] Get a set of hyperspectral image data, whose dimension information is (100, 100, 20), where the height H is 100, the width W is 100, and the number of bands B is 20, including 20 different bands from band 1 to band 20. Each band is a 100×100 two-dimensional array, corresponding to image information in different spectral ranges, and the labels of image samples have been marked. The label value of the pixel point in the area with sea fog characteristics is 1, and the label value of the pixel point in the area without sea fog characteristics is 0;
[0093] The minimum-maximum normalization operation is performed on this set of hyperspectral image data. Taking the fifth band (i'=5) as an example, the total number of elements in the fifth band is 10000 (ie Z=10000), and the minimum value X in the fifth band is 5min is 10, the maximum value X 5max is 200.
[0094] For the 300th value in the 5th band (j'=300), its original value X 5,300 is 50, and the normalized value X is calculated according to the normalization formula 5norm :
[0095]
[0096] According to the same method as above, the above normalization calculation is performed on each value in the band (i.e. j' from 1 to 10000), and all the normalized data of the fifth band can be obtained;
[0097] By analogy, the above normalization operation is performed on all 20 bands (i' from 1 to 20), and the normalization of the entire hyperspectral image data can be completed, so that the data of each band is mapped to the interval [0,1];
[0098] After normalization, the principal component analysis method is then used to process the hyperspectral image data. This can be achieved by using professional data analysis software or related libraries in programming languages, such as the scikit-learn library in Python.
[0099] After principal component analysis, the cumulative variance contribution rates of the principal components of the 20 bands are as follows:
[0100] The first band is 30%, the second band is 55%, the third band is 40%, the fourth band is 25%, the fifth band is 45%, the sixth band is 48%, the seventh band is 38%, the eighth band is 50%, the ninth band is 42%, the tenth band is 62%, the eleventh band is 65%, the twelfth band is 78%, the thirteenth band is 80%, the fourteenth band is 77%, the fifteenth band is 68%, the sixteenth band is 58%, the seventeenth band is 49%, the eighteenth band is 35%, the nineteenth band is 43%, and the twentieth band is 37%;
[0101] The threshold value A of the principal component cumulative variance contribution rate is set to 60%, and the 10th, 11th, 12th, 13th, 14th and 15th bands whose principal component cumulative variance contribution rates are ≥ 60% are selected as specific bands, and the specific bands are extracted by the following formula:
[0102] B selected =B i for i∈(10,11,12,13,14,15)
[0103] Among them, B selected Indicates the extracted band; B i Represents the band index.
[0104] Furthermore, in this embodiment, step S1 further includes:
[0105] After completing the data analysis and processing, the hyperspectral image data and the corresponding label data are divided into a training set and a test set, and the training set and the test set constitute a hyperspectral data set for training. The division formula is as follows:
[0106] X train =X*P
[0107] X test =X*(1-P)
[0108] Y train =Y*P
[0109] Y test =Y*(1-P)
[0110] Where X represents the total amount of hyperspectral image data; X train represents the number of hyperspectral images in the training set; Y train represents the number of hyperspectral images in the test set; X test Indicates the number of labels in the training set; Y test represents the number of labels in the test set; P and 1-P represent the division ratio of the training set and the test set, respectively, satisfying P < 1;
[0111] Here is an example:
[0112] Obtain hyperspectral image data after data analysis and processing, the total number of which is X = 5000, and the corresponding label data is 5000 groups, each group of labels corresponds to a hyperspectral image, which is used to identify whether the image is a sea fog feature or a non-sea fog feature;
[0113] Set the training set division ratio P = 0.8 and the test set division ratio to 1-P = 0.2, that is, 80% of the data is divided into the training set and 20% of the data is divided into the test set;
[0114] According to the set division ratio, the number of hyperspectral images and the corresponding number of labels contained in the training set and test set are calculated according to the formula:
[0115] Number of training sets X train :
[0116] X train =5000*0.8=4000
[0117] Therefore, the training set contains 4000 hyperspectral images;
[0118] The number of labels in the training set is X test :
[0119] X test =5000*0.8=4000
[0120] Therefore, there are 4000 sets of labels corresponding to the training set, which correspond one-to-one to the 4000 hyperspectral images in the training set;
[0121] The number of test sets Y train :
[0122] Y train =5000*0.2=1000
[0123] The test set contains 1000 hyperspectral images;
[0124] The number of labels in the test set Y test :
[0125] Y test =5000*0.2=1000
[0126] That is, there are 1000 sets of labels corresponding to the test set, which correspond one-to-one to the 1000 hyperspectral images in the test set;
[0127] Therefore, the 5,000 hyperspectral images and their corresponding 5,000 sets of label data were divided into a training set containing 4,000 images and 4,000 sets of labels, and a test set containing 1,000 images and 1,000 sets of labels. The training set and the test set together constitute the hyperspectral dataset used for training.
[0128] Furthermore, in this embodiment, step S2 specifically includes the following steps:
[0129] S201, constructing a Mamba model, and adjusting the Mamba model to obtain an initial Mamba model;
[0130] S202, training the initial Mamba model by combining the training set to obtain a trained Mamba model, and testing the trained Mamba model by combining the test set to obtain a test result;
[0131] S203, evaluating the test results to obtain evaluation test results, optimizing the Mamba model according to the evaluation test results, and obtaining a sea fog image recognition model.
[0132] Furthermore, in this embodiment, step S201 specifically includes:
[0133] Initialize the Mamba model configuration parameters by setting the model dimension, number of layers, state dimension, expansion factor, and convolution kernel size;
[0134] Add the Result Block module to the Mamba model. The Result Block module includes a mixing layer and a normalization layer.
[0135] The hybrid layer includes an input projection layer, a one-dimensional convolution layer, a state-space model layer, and a time-scale projection layer;
[0136] Set the input dimension of the input projection layer to d_mode l and the output dimension to 2×d_inner;
[0137] Set the input and output dimensions of the one-dimensional convolution layer to d_inner, and configure the convolution kernel size to d_conv value;
[0138] Set the input dimension of the state space model layer to d_inner and the output dimension to d_trank+2×d_state;
[0139] Set the input dimension of the time scale projection layer to d_trank and the output dimension to d_inner;
[0140] Generate the time scale dt within the set initialization range [dt_min, dt_max], calculate the inverse of the time scale dt inv_dt, and initialize the time scale parameters according to the architecture and data characteristics of the Mamba model;
[0141] Here is an example:
[0142] Set the model dimension, number of layers, state dimension, expansion factor, and convolution kernel size as follows:
[0143] Model dimension (d_mode l): Based on the hyperspectral image data processed and the experience of processing similar projects, the model dimension is set to 128;
[0144] This means that when the model first receives the hyperspectral image data, it will process the rich spectral information contained in these hyperspectral image data in the form of a 128-dimensional feature representation;
[0145] Number of layers (num_layers): Set the number of layers to 3;
[0146] This three-layer structure is similar to building a three-layer "information processing tower". Each layer will perform different degrees of feature extraction on the input data, starting from the spectral characteristics and gradually going deeper into the characteristic level of the unique properties of sea fog;
[0147] State dimension (d_state): set to 32;
[0148] The size of this state dimension determines the degree of detail of the model's internal description of the data state. For sea fog recognition in hyperspectral images, the 32-dimensional state space can help the model carefully capture the various state changes of sea fog in different bands and regions.
[0149] Expansion factor (expans ion_factor): set its value to 4;
[0150] The expansion factor plays an important role in the feature processing of some intermediate layers of the model. For example, in a specific feature transformation link, the input feature dimension will be enlarged according to certain rules based on this factor;
[0151] Convolution kernel size (d_conv): Set the convolution kernel size to 5;
[0152] The band data of the hyperspectral image is similar to a long "ribbon". The convolution kernel is similar to a "small slider" with a length of 5, sliding along the "ribbon", covering 5 adjacent bands each time. The unique features of these local bands are extracted through convolution operations, such as the high and low variation patterns of specific spectral reflectance in the sea fog area in several consecutive bands, which provides valuable local feature basis for the subsequent accurate judgment of the presence of sea fog.
[0153] For the time scale dt, set its initialization range to [0.05, 0.2];
[0154] After setting the above parameters, add the Res idua l Block module to the Mamba model. The Res idua lBlock module includes a mixing layer and a normalization layer;
[0155] The hybrid layer includes an input projection layer, a one-dimensional convolution layer, a state space model layer, and a time scale projection layer, which are set as follows:
[0156] Input projection layer (Linear(d_mode l, 2×d_inner)): Assume d_mode l is 128 and d_inner is 64, so the input dimension of the input projection layer is 128 and the output dimension is 2×64=128;
[0157] The input projection layer is similar to a "feature conversion bridge", which receives the hyperspectral image feature data from the previous layer or the initial input, and then transforms the feature representation of these data from the original 128-dimensional space to another 128-dimensional space with different feature combinations through specific linear transformation rules. In this process, the band features that are more critical in the subsequent judgment of sea fog will be highlighted, and some relatively unimportant features will be weakened, so that the data features are more in line with the processing requirements of the subsequent layers;
[0158] One-dimensional convolution layer (Conv1d(d_inner,d_inner,kernel_size=d_conv)): the input and output dimensions are both 64, and the convolution kernel size is 5;
[0159] The one-dimensional convolution layer is similar to a "feature scanner", which performs a scanning convolution operation along the band dimension of the hyperspectral image data (the data of different bands are regarded as arranged in sequence). Each convolution kernel covers 5 adjacent bands, and the features related to each other between local bands are extracted by calculating the weighted combination and other convolution operations between them.
[0160] State-space model layer (Linear(d_inner,d_trank+2×d_state)): d_trank is set to 16, the input dimension d_inner of the state-space model layer is 64, and the output dimension is 16+2×32=80;
[0161] The state space model layer is similar to a "feature mapping master". It converts the 64-dimensional feature data obtained after processing by the one-dimensional convolution layer into an 80-dimensional space related to the state space through a specific linear mapping relationship. In this process, it can dig out the intrinsic correlation features hidden in different bands, different spatial positions and different times of the hyperspectral image data, such as the characteristic performance corresponding to the state changes of sea fog at different times and in different regions, and the relationship between the increase and decrease of sea fog concentration over time and the changes of characteristics in different bands.
[0162] Time scale projection layer (Linear(d_trank,d_inner)): d_trank is set to 16 and d_inner is set to 64, so the input dimension of the time scale projection layer is 16 and the output dimension is 64;
[0163] The time scale projection layer is similar to a "feature integration hub". It re-integrates and projects the features processed by the state space model layer on the dimensions related to the time scale, and converts the feature dimension from the 16-dimensional part related to the time scale in the 80-dimensional (output dimension of the state space model layer) back to 64 dimensions (i.e., d_inner), which is convenient for subsequent fusion with features of other layers and smooth transmission and integration of information in the entire Res idua l Block module, ensuring that features between different layers can cooperate with each other and jointly assist in the extraction and identification of sea fog features;
[0164] The time scale dt is generated within the set initialization range [0.05, 0.2]. For example, a dt value of 0.1 is generated, and then its inverse inv_dt is calculated to be 10. Then, according to the overall architecture of the Mamba model and the characteristics of the hyperspectral image data, the time scale parameters are initialized and integrated into the calculation of the relevant layers of the model, so that when the model processes hyperspectral image data with time series characteristics, it can reasonably capture the temporal characteristics of sea fog based on this time scale.
[0165] Furthermore, in this embodiment, step S201 further includes:
[0166] Perform hyperparameter tuning on the Mamba model, including setting the initial learning rate α to 1e -3 ~1e -5 , select batch size as 32 or 64, and adjust the number of layers in the Mamba model between 4 and 10;
[0167] Focal Loss is used to adjust the loss function of the Mamba model, and the following formula is set to calculate the loss value of Focal Loss:
[0168]
[0169] Among them, L focal Represents the focus loss value; α t represents the weight of the corresponding category; γ represents the focusing parameter; represents the probability value of the corresponding category; t represents the category, and t takes values of 0 and 1. When t=0, it represents the category of non-sea fog features, and when t=1, it represents the category of sea fog features;
[0170] Regularization technology is applied to the Mamba model. L2 regularization terms are added to the loss function and Dropout layers are added to the Residua lBlock module. The probability P of the Dropout layer is set to 0.3-0.5. The L2 regularization term is added according to the following formula:
[0171]
[0172] Among them, L total Indicates the total loss value; L focal represents the focus loss value; λ represents the regularization strength; ω i” represents the weight of the i-th model; N represents the total number of model weights; i" = 1, 2, ..., N;
[0173] Here is an example:
[0174] Perform hyperparameter tuning on the Mamba model and set the initial learning rate α to 1e -4 , select the batch size as 64, and adjust the number of layers in the Mamba model to 5;
[0175] When using Focal Loss to adjust the loss function of the Mamba model, the loss value is calculated according to the given formula;
[0176] For example, suppose in one of the training batches, there is a hyperspectral image, and the model predicts that it belongs to the sea fog feature category (t = 1) with a probability value is 0.7, then the probability value of belonging to the non-sea fog feature category (t = 0) That is 0.3;
[0177] Set the category weight α t , α1 = 0.7 for the sea fog category (t = 1), α0 = 0.3 for the non-sea fog category (t = 0), and the focusing parameter γ is set to 2;
[0178] Calculate the focusing loss value L corresponding to the sea fog category (t=1) focal-1 :
[0179] L focal-1 =-0.7*(1-0.7) 2 log(0.7)=0.0097;
[0180] Calculate the focusing loss value L corresponding to the non-sea fog category (t = 0) focal-0 :
[0181] L focal-0 =-0.3*(1-0.3) 2 log(0.3)=0.0768;
[0182] The total focus loss value of the sample is L focal It's L focal-1 With L focal-0 sum;
[0183] That is L focal =0.0097+0.0768=0.0865;
[0184] In the entire training batch, the focus loss value of each sample is calculated in the same way, and then the average value is the focus loss value corresponding to the batch of data;
[0185] Add L2 regularization term to the loss function. The current five-layer Mamba model has a total of 2000 trainable model weights (i.e. N = 2000), and set the regularization strength λ to 0.001;
[0186] The focus loss value L calculated by the above FocalLoss for the current training batch focal is 0.0865, and the weight parameter of the model is ω i represents (i=1,2,…,2000), for example, ω1 represents the first weight value;
[0187] According to the calculation formula of the L2 regularization term, for example, the sum of 2000 weight parameters is 30, that is,
[0188] Then the total loss value after adding the L2 regularization term is L total for:
[0189] L total =0.0865+0.001*30=0.1165;
[0190] In the loss calculation of each training batch, the corresponding L2 regularization term must be added. The regularization strength λ is used to control the strength of regularization to prevent the model from overfitting. This not only reduces the classification loss measured by Focal Loss during the training process, but also ensures that the weight parameters are not too large, so that the complexity of the model is reasonably controlled, thereby improving the generalization ability of the model.
[0191] A Dropout layer is added to the Res idua l Block module, and the probability P of the Dropout layer is set to 0.4. That is, during the model training process, whenever the data passes through the Res idua l Block module with the Dropout layer, the layer will randomly set the outputs of some neurons to 0 with a probability of 0.4. For example, there are 128 neurons in one of the Res idua l Block modules. When passing through the Dropout layer, the outputs of approximately 128×0.4=51.2 (approximately 51, actually randomly determined by probability) neurons will be randomly set to 0, and then the outputs of the remaining neurons will be passed to the next layer for subsequent feature processing and other operations. The purpose of this is to avoid the model from relying too much on certain specific neuronal connections to learn features, force the model to learn more diverse and robust feature representations, reduce the co-adaptation relationship between neurons, and thus alleviate the overfitting phenomenon.
[0192] Furthermore, in this embodiment, step S202 specifically includes:
[0193] The Adam optimizer is used to train the Mamba model with the training set, and the number of training rounds is set to Q;
[0194] According to the training rounds, the training set is forward propagated in sequence to obtain the prediction results, and the loss value is calculated by focal loss;
[0195] The Adam optimizer is used to perform back propagation based on the gradient corresponding to the calculated loss value to update the weight parameters of the Mamba model.
[0196] Perform Q iterations of training to obtain the trained Mamba model;
[0197] The trained Mamba model is tested with the test set. The prediction result of each image sample in the test set is obtained through the forward propagation of the Mamba model. The prediction result is compared with the label corresponding to each image sample in the test set one by one to obtain the recognition result of each image sample.
[0198] Here is an example:
[0199] Set the training round Q = 1000, the training set has 8000 image samples, and the batches are divided into batches of size 64, so the number of batches is 8000 / 64 = 125 batches;
[0200] In each round, for each batch (taking the first batch as an example), 64 hyperspectral images and their corresponding label data are sent to the Mamba model for forward propagation. The input data is processed by the 6-layer structure of the model. In each Residua l Block module, the input features are transformed in dimension through the input projection layer, the one-dimensional convolution layer extracts the local band correlation features, the state space model layer mines the deep state-related features, and the time scale projection layer performs feature integration and dimensionality recovery operations, etc., continuously extracting, transforming and integrating the features of the image data;
[0201] For example, for a certain hyperspectral image in the batch, after the forward propagation of the model, the output probability value of it belonging to the sea fog feature category (set as category 1) is 0.62, then the probability value of it belonging to the non-sea fog feature category (set as category 0) is 0.38. In this way, the prediction operation is performed on the 64 images of the entire batch, and the prediction results of this batch are obtained;
[0202] Use Focal Loss to calculate the loss value:
[0203] After obtaining the prediction results of each batch, the loss value of the batch data is calculated by the Focal Loss function based on the obtained prediction results and the corresponding true labels;
[0204] Taking an image in the first batch as an example, the probability value of its prediction belonging to the sea fog feature category (t=1) is The probability value is 0.62, which belongs to the non-sea fog feature category (t = 0). It is 0.38. According to the calculation formula of Focal Loss, the loss values corresponding to the two categories are calculated respectively:
[0205] Set the category weight α t , α1 = 0.7 for the sea fog category (t = 1), α0 = 0.3 for the non-sea fog category (t = 0), and the focusing parameter γ is set to 2;
[0206] Calculate the focusing loss value L corresponding to the sea fog category (t=1) focal-1 :
[0207] L focal-1 =-0.7*(1-0.62) 2 log(0.62)=0.0209;
[0208] Calculate the focusing loss value L corresponding to the non-sea fog category (t = 0) focal-0 :
[0209] L focal-0 =-0.3*(1-0.38) 2log(0.38)=0.0484;
[0210] The total focus loss value of the sample is L focal It's L focal-1 With L focal-0 sum;
[0211] That is L focal =0.0209+0.0484=0.0693;
[0212] In the same way, the focus loss value of each image in the batch is calculated, and then the average value is calculated. The average value is the focal loss value corresponding to this batch of data. The above loss value calculation operation is performed on all 125 batches in turn to obtain the loss value of this round of training based on the entire training set data;
[0213] After calculating the loss value based on the training set data in each round, the weight parameters of the Mamba model are updated through the Adam optimizer according to the gradient information corresponding to the loss value. The Adam optimizer automatically calculates the gradient of the loss value with respect to each weight parameter of the model based on the current loss value through the back propagation algorithm.
[0214] The above-mentioned gradient calculation and weight update operations are performed on all trainable weight parameters in the model, and a round of model parameter update is completed;
[0215] After 1,000 such iterative trainings, as the number of rounds increases, the model's weight parameters will continue to be optimized, and its ability to recognize the sea fog features in the training set will gradually increase, and finally the Mamba model that has been trained for 1,000 rounds will be obtained;
[0216] The 2000 hyperspectral images in the test set are divided into batches according to the batch size of 64, and the number of batches is 2000 / 64=31.25, which is rounded to 32 batches;
[0217] For each batch of data, the trained Mamba model is used to perform forward propagation operations to obtain the predicted probability values of each image in the batch belonging to the sea fog feature category and the non-sea fog feature category. The operation method is consistent with the forward propagation in the training process.
[0218] The model's prediction results for each image in the test set are compared with the true label corresponding to the image one by one to determine the recognition result of each image sample. For example, the judgment threshold is set to 0.5. If the true label of an image is sea fog feature (category 1), and the model predicts that the probability value of its belonging to the sea fog feature category is 0.85 (the probability value is greater than 0.5), then the recognition result of this image is correctly classified; conversely, if the model predicts that the probability of its belonging to the non-sea fog feature category is less than 0.5, it is misclassified.
[0219] Furthermore, in this embodiment, step S203 specifically includes:
[0220] According to the recognition results, the performance of the Mamba model is judged by constructing the confusion matrix CM and calculating the overall classification accuracy OA, the average classification accuracy AA and the statistical coefficient Kappa;
[0221] The confusion matrix CM is:
[0222]
[0223] The overall classification accuracy OA is:
[0224]
[0225] The average classification accuracy AA is:
[0226]
[0227] The statistical coefficient Kappa is:
[0228]
[0229] Among them, m 1,1 Indicates the number of correct predictions of sea fog characteristics; m 1,2 represents the number of sea fog feature prediction errors; m 2,1 represents the number of non-sea fog feature prediction errors; m 2,2 represents the number of correct predictions of non-sea fog features; n represents the number of feature categories, and the value of n is: n = 1, 2; the values of i and j are: i = 1, 2, j = 1, 2; m i,i Represents the number of the i-th row and i-th column in the confusion matrix CM; m i,j represents the number of the i-th row and j-th column in the confusion matrix CM; N represents the total number of images with sea fog features and non-sea fog features in the test set; N i represents the total number of features of the i-th category, with N1 when i=1 representing the total number of images with sea fog features in the test set, and N2 when i=2 representing the total number of images with non-sea fog features in the test set;
[0230] According to the calculated overall classification accuracy OA, average classification accuracy AA and statistical coefficient Kappa, the model performance coefficient S is calculated. E :
[0231] S E =b1*OA+b2*AA+b3*Kappa
[0232] Wherein, b1, b2 and b3 are adjustment coefficients and satisfy b1+b2+b3=1;
[0233] If S E ≥0.85, the performance of the Mamba model is considered qualified, and the Mamba model is used as the sea fog image recognition model;
[0234] If S E If the Mamba model is less than 0.85, the performance of the Mamba model is judged to be unqualified, and the Mamba model is adjusted and optimized, and retrained, tested and evaluated until the S E ≥0.85;
[0235] Here is an example:
[0236] According to the recognition structure, the recognition result is:
[0237] The number of correct predictions of sea fog characteristics m 1,1 is 800, which means that the model accurately judges 800 images that actually have sea fog features as having sea fog features;
[0238] The number of sea fog feature prediction errors m 1,2 is 200, that is, 200 images with sea fog features are misjudged as non-sea fog features by the model;
[0239] The number of non-sea fog feature prediction errors m 2,1 is 100, which means that 100 images without sea fog features are misjudged as having sea fog features by the model;
[0240] The number of correct predictions of non-sea fog features m 2,2 is 900, which means that the model accurately identified 900 images that actually have no sea fog features;
[0241] So the confusion matrix CM is:
[0242]
[0243] N=2000, N1=1000, N2=1000;
[0244] The overall classification accuracy OA is:
[0245]
[0246] The average classification accuracy AA is:
[0247]
[0248] The statistical coefficient Kappa is:
[0249]
[0250] b1=0.3, b2=0.3, b3=0.4;
[0251] Then S E =0.3*0.85+0.3*0.85+0.4*0.73=0.887;
[0252] S E >0.85, the performance of the Mamba model is judged to be qualified and the Mamba model is used as the sea fog image recognition model.
[0253] Furthermore, in this embodiment, step S3 specifically includes:
[0254] Obtain a target sea fog image to be identified, identify and classify the target sea fog image through a sea fog image recognition model, obtain identification and classification results including sea fog features and non-sea fog features, and visualize the identification and classification results;
[0255] Here is an example:
[0256] A group of target sea fog images to be identified is obtained, and the group of images has 50 images in total. The 50 target sea fog images to be identified are sequentially sent to the sea fog image recognition model for identification and classification;
[0257] Taking one of the images as an example, the sea fog image recognition model extracts, analyzes and judges the hyperspectral data of the image. After processing by each layer inside the model, it outputs the probability value of each pixel in the image belonging to the sea fog feature category (set as category 1) and the non-sea fog feature category (set as category 0);
[0258] For example, for a certain pixel in the image, the sea fog image recognition model outputs a probability value of 0.78 that it belongs to the sea fog feature category. The corresponding category is determined according to the set probability. For example, if the set probability is greater than 0.5, the pixel is determined to be a sea fog feature category.
[0259] According to the above method, each pixel of the entire image is judged, and finally a complete recognition and classification result of the image is obtained;
[0260] This operation is performed on the 50 target images in turn, and the recognition and classification results of sea fog features and non-sea fog features of all images are obtained;
[0261] Visual display can choose pseudo-color image display. The principle of generating pseudo-color images is: the sea fog feature category is represented by one color (such as red), and the non-sea fog feature category is represented by another color (such as blue). For each target image, according to its recognition and classification results, the pixels belonging to the sea fog feature are filled with red, and the pixels belonging to the non-sea fog feature are filled with blue. In this way, a pseudo-color image is generated, from which the distribution of sea fog in the image can be clearly seen;
[0262] For example, in a visualized pseudo-color image, a large red area can be seen covering the upper and middle part of the image, which means that the model has determined that there are sea fog features in this area; while the lower part of the image is mainly blue, indicating that the model believes that this area is not a sea fog feature area. Through such a pseudo-color image, both professional meteorological and ocean researchers and relevant decision makers can quickly and intuitively understand the distribution of sea fog in the image.
[0263] The present disclosure also provides a Mamba-based sea fog hyperspectral remote sensing image recognition system, which is characterized by comprising:
[0264] A hyperspectral dataset construction module is used to obtain hyperspectral image data and corresponding label data, perform data analysis and processing, and construct a hyperspectral dataset for training;
[0265] Model building module, used to build the Mamba model and train and optimize the Mamba model in combination with the hyperspectral dataset;
[0266] The sea fog image recognition module is used to obtain the target sea fog image to be identified, and to identify and classify the target sea fog image.
[0267] In the description of the present disclosure, it is necessary to understand that the directions or positional relationships indicated by directional words such as "front, back, up, down, left, right", "lateral, vertical, horizontal" and "top, bottom" are usually based on the directions or positional relationships shown in the drawings, and are only for the convenience of describing the present disclosure and simplifying the description. Unless otherwise specified, these directional words do not indicate or imply that the device or element referred to must have a specific orientation or be constructed and operated in a specific orientation, and therefore cannot be understood as limiting the scope of protection of the present disclosure.
[0268] For those skilled in the art, various other corresponding changes and deformations can be made according to the technical solutions and concepts described above, and all of these changes and deformations should fall within the protection scope of the claims of the present disclosure.
Claims
1. A sea fog hyperspectral remote sensing image recognition method based on Mamba, characterized in that: The following steps are involved: S1, obtain hyperspectral image data and corresponding label data, perform data analysis and processing, and construct a hyperspectral dataset for training; S2. constructing a Mamba model, and training and optimizing the Mamba model in combination with the hyperspectral dataset to obtain a sea fog image recognition model; S3. Acquire a target sea fog image to be identified, identify and classify the target sea fog image using the sea fog image recognition model, and obtain an identification and classification result of the target sea fog image.
2. The sea fog hyperspectral remote sensing image recognition method based on Mamba according to claim 1, characterized in that: In step S1, the data analysis process includes: Acquire hyperspectral image data and corresponding label data, wherein the hyperspectral image data includes image samples having sea fog features and non-sea fog features, wherein the label corresponding to the sea fog feature in the label data is 1, and the label corresponding to the non-sea fog feature in the label data is 0; Acquire three-dimensional array information (H, W, B) of the hyperspectral image data, wherein H represents height, W represents width, B represents the number of bands, and Z=H*W represents the total number of elements in each band; The minimum-maximum normalization method is used to map the data of B bands in the hyperspectral data to the interval [0, 1], and the data of each band is normalized to obtain the normalized band data. The normalized value X is calculated according to the following formula: i'norm : Among them, i' takes the value of 1, 2, ..., B, indicating the i'th band; X i',j' represents the j'th value in the i'th band, where j' is 1, 2, ..., Z; X i'min represents the minimum value in the i'th band; X i'max represents the maximum value in the i'th band; According to the band data, a principal component analysis method is used to perform a principal component analysis on the hyperspectral image data to obtain a principal component cumulative variance contribution rate of each band; The principal component cumulative variance contribution rate threshold is set to A, and the band with the principal component cumulative variance contribution rate ≥ A is selected as the specific band.
3. The sea fog hyperspectral remote sensing image recognition method based on Mamba according to claim 2 is characterized in that: Step S1 also includes: After completing the data analysis process, the hyperspectral image data and the corresponding label data are divided into a training set and a test set, and the training set and the test set constitute a hyperspectral data set for training. The division formula is as follows: X train =X*P X test =X*(1-P) AND train =Y*P AND test =Y*(1-P) Wherein, X represents the total amount of the hyperspectral image data; X train represents the number of hyperspectral images in the training set; train represents the number of hyperspectral images in the test set; X test Indicates the number of labels in the training set; Y test represents the number of labels in the test set; P and 1-P represent the division ratio of the training set and the test set respectively, satisfying P<1.
4. The sea fog hyperspectral remote sensing image recognition method based on Mamba according to claim 3 is characterized in that: Step S2 specifically includes the following steps: S201, constructing a Mamba model, and adjusting the Mamba model to obtain an initial Mamba model; S202, training the initial Mamba model in combination with the training set to obtain a trained Mamba model, and testing the trained Mamba model in combination with the test set to obtain a test result; S203, evaluating the test results to obtain evaluation test results, optimizing the Mamba model according to the evaluation test results to obtain a sea fog image recognition model.
5. The sea fog hyperspectral remote sensing image recognition method based on Mamba according to claim 4 is characterized in that: Step S201 specifically includes: Initializing the Mamba model configuration parameters by setting the model dimension, number of layers, state dimension, expansion factor, and convolution kernel size; Adding a ResidualBlock module to the Mamba model, wherein the ResidualBlock module includes a mixing layer and a normalization layer; The hybrid layer includes an input projection layer, a one-dimensional convolution layer, a state space model layer, and a time scale projection layer; Set the input dimension of the input projection layer to d_model and the output dimension to 2×d_inner; Set the input and output dimensions of the one-dimensional convolutional layer to d_inner, and configure the convolution kernel size to d_conv value; The input dimension of the state space model layer is set to d_inner and the output dimension is set to d_trank+2×d_state; Set the input dimension of the time scale projection layer to d_trank and the output dimension to d_inner; A time scale dt is generated within a set initialization range [dt_min, dt_max], the inverse inv_dt of the time scale dt is calculated, and the time scale parameters are initialized according to the architecture and data characteristics of the Mamba model.
6. The sea fog hyperspectral remote sensing image recognition method based on Mamba according to claim 5 is characterized in that: Step S201 also includes: The Mamba model is subjected to hyperparameter tuning, wherein the hyperparameter tuning includes setting the initial learning rate α to 1e -3 ~1e -5 , select the batch size as 32 or 64, and adjust the number of layers in the Mamba model between 4 and 10; FocalLoss is used to adjust the loss function of the Mamba model, and the following formula is set to calculate the loss value of the FocalLoss: Among them, L focal Represents the focus loss value; α t represents the weight of the corresponding category; γ represents the focusing parameter; represents the probability value of the corresponding category; t represents the category, and t takes values of 0 and 1, t=0 represents the category of the non-sea fog feature, and t=1 represents the category of the sea fog feature; Regularization technology is applied to the Mamba model, an L2 regularization term is added to the loss function, a Dropout layer is added to the ResidualBlock module, and the probability P of the Dropout layer is set to 0.3-0.
5. The L2 regularization term is added according to the following formula: Among them, L total Indicates the total loss value; L focal represents the focus loss value; λ represents the regularization strength; ω i” represents the i-th model weight; N represents the total number of model weights; i" = 1, 2, ..., N.
7. The sea fog hyperspectral remote sensing image recognition method based on Mamba according to claim 6, characterized in that: Step S202 specifically includes: Adopting the Adam optimizer, training the Mamba model in combination with the training set, and setting the number of training rounds to Q; According to the training rounds, the training set is forward propagated in sequence to obtain prediction results, and the loss value is calculated by the FocalLoss; Back-propagation is performed by the Adam optimizer according to the gradient corresponding to the calculated loss value to update the weight parameters of the Mamba model; Perform Q iterations of training to obtain the trained Mamba model; The trained Mamba model is tested in combination with the test set, and the prediction result of each image sample in the test set is obtained through the forward propagation of the Mamba model. The prediction result is compared with the label corresponding to each image sample in the test set one by one to obtain the recognition result of each image sample.
8. The sea fog hyperspectral remote sensing image recognition method based on Mamba according to claim 7, characterized in that: Step S203 specifically includes: According to the recognition results, the performance of the Mamba model is judged by constructing a confusion matrix CM and calculating the overall classification accuracy OA, the average classification accuracy AA and the statistical coefficient Kappa; The confusion matrix CM is: The overall classification accuracy OA is: The average classification accuracy AA is: The statistical coefficient Kappa is: Among them, m 1,1 Indicates the number of correct predictions of the sea fog characteristics; m 1,2 represents the number of sea fog feature prediction errors; m 2,1 represents the number of prediction errors of the non-sea fog feature; m 2,2 represents the number of correct predictions of the non-sea fog features; n represents the number of feature categories, and the value of n is: n=1, 2; the values of i and j are: i=1, 2, j=1, 2; m i,i represents the number of the i-th row and i-th column in the confusion matrix CM; m i,j represents the number of the i-th row and j-th column in the confusion matrix CM; N represents the total number of images with the sea fog feature and the non-sea fog feature in the test set; N i represents the total number of features of the i-th category, where N1 when i=1 represents the total number of images with the sea fog feature in the test set, and N2 when i=2 represents the total number of images with the non-sea fog feature in the test set; The model performance coefficient S is calculated based on the calculated overall classification accuracy OA, the average classification accuracy AA and the statistical coefficient Kappa. E : <h2 style=";text-align:left;direction:ltr">S<h2 style=";text-align:left;direction:ltr"> E <h2 style=";text-align:left;direction:ltr"> =b1*OA+b2*AA+b3*Kappa Wherein, b1, b2 and b3 are adjustment coefficients and satisfy b1+b2+b3=1; If S E ≥0.85, the performance of the Mamba model is judged to be qualified, and the Mamba model is used as the sea fog image recognition model; If S E <0.85, the performance of the Mamba model is judged to be unqualified, and the Mamba model is adjusted and optimized, and retrained, tested and evaluated until S is met. E ≥0.
85.
9. The sea fog hyperspectral remote sensing image recognition method based on Mamba according to claim 8, characterized in that: Step S3 specifically includes: A target sea fog image to be identified is obtained, the target sea fog image is identified and classified by the sea fog image recognition model, an identification and classification result including the sea fog features and the non-sea fog features is obtained, and the identification and classification result is visualized.
10. A sea fog hyperspectral remote sensing image recognition system based on Mamba, characterized in that: include: A hyperspectral dataset construction module is used to obtain hyperspectral image data and corresponding label data, perform data analysis and processing, and construct a hyperspectral dataset for training; A model building module, used for building a Mamba model, and training and optimizing the Mamba model in combination with the hyperspectral dataset; The sea fog image recognition module is used to obtain a target sea fog image to be recognized, and to recognize and classify the target sea fog image.
Citation Information
Patent Citations
Unmanned aerial vehicle integrated navigation system and method based on Mama image recognition
CN118836871A
Multimode self-supervised mixed Mangbar hyperspectral image classification method
CN119007024A