Semi-supervised hyperspectral image classification method based on regularized mask automatic encoder

By designing a semi-supervised method based on regularized mask auto-encoder in hyperspectral image classification, and using Induced Transformer and ViT encoder for encoding and reconstruction, the problem of insufficient independent learning ability and pseudo-label accuracy in the existing technology is solved. , achieving efficient hyperspectral image classification.

CN118799647APending Publication Date: 2024-10-18DALIAN NATIONALITIES UNIVERSITY

Patent Information

Application Number
CN202411084412.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-08
Publication Date
2024-10-18

AI Technical Summary

Technical Problem

The existing semi-supervised hyperspectral image classification methods based on deep neural networks have problems such as insufficient self-learning discriminative representation capabilities, unreliable pseudo-label accuracy, uncertainty in graph construction, and mode collapse, making it difficult to effectively utilize unlabeled samples for efficient classification. Classification.

Method used

A semi-supervised hyperspectral image classification method based on regularized mask autoencoder (RMAE) is designed. By pre-training the original hyperspectral images, using the Induced Transformer structure and ViT encoder for encoding and reconstruction, combined with the mask Membrane reconstruction and induced reconstruction losses are optimized, and fully connected layers are tuned in labeled samples to obtain a classification model.

Benefits of technology

RMAE can independently learn highly discriminable representations, obtain high-precision classification results from a large number of unlabeled samples, and obtain satisfactory classification performance by tuning a small number of labeled samples, which is significantly better than existing methods.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118799647A_ABST
    Figure CN118799647A_ABST
Patent Text Reader

Abstract

The invention discloses a semi-supervised hyperspectral image classification method based on a regularized mask automatic encoder, and the method comprises the steps: obtaining an original hyperspectral image, and obtaining an original pre-training sample based on the original hyperspectral image; dividing the original pre-training sample into grids with different scales to obtain a first image block and a second image block, reconstructing the first image block and the second image block through a regularization mask automatic encoder, and obtaining a pre-trained regularization mask automatic encoder for the regularization mask automatic encoder according to a reconstruction result; a full connection layer is added behind an encoder of a pre-trained regularized mask automatic encoder, a decoder added with the full connection layer is trained and optimized through a labeled sample, a classification model is obtained, a to-be-classified hyperspectral image is classified through the classification model, and a hyperspectral image classification result is obtained. According to the method, a discriminable mode can be learned from a large number of label-free samples, and a high-performance classification result can be obtained.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of hyperspectral remote sensing image classification, and in particular relates to a semi-supervised hyperspectral image classification method based on a regularized mask autoencoder. Background Art

[0002] Hyperspectral images have rich spectral spatial information. As a basic task, hyperspectral image classification plays an irreplaceable role in agricultural monitoring, mineral exploration, environmental monitoring and other fields. The rapid development of deep learning technology provides a steady stream of new technical support for hyperspectral image classification. However, it is well known that deep models are data hungry, and sample labeling is very time-consuming and labor-intensive. Therefore, when there are a limited number of labeled samples, it is necessary to develop an effective and efficient semi-supervised classification model to make full use of a large number of unlabeled samples to obtain satisfactory classification results.

[0003] Existing semi-supervised classification methods based on deep neural networks mainly include: autoencoder-based, pseudo-label-based, graph-based, and generative adversarial network-based methods. However, these methods have more or less shortcomings: semi-supervised classification methods based on autoencoders cannot autonomously learn discriminable representations; semi-supervised classification methods based on pseudo-labels cannot guarantee the accuracy of pseudo-labels and cannot evaluate the contribution of samples assigned pseudo-labels to the improvement of model performance; semi-supervised classification methods based on graphs cannot avoid the impact of uncertainty on graph construction; semi-supervised classification methods based on generative adversarial networks are often troubled by mode collapse.

[0004] Recently, scholars at home and abroad have applied Masked Auto-Encoder (MAE) to the semi-supervised hyperspectral image classification task and obtained high-precision classification results. MAE is a self-supervised representation learning model that not only takes less pre-training time, but also has excellent tunability. At present, most of the work on improving MAE is still at the application level. It is necessary to design a more robust semi-supervised classification model based on MAE from the working principle, with stronger representation learning ability, so as to effectively classify hyperspectral images. Summary of the invention

[0005] In order to solve the above technical problems, the present invention proposes a semi-supervised hyperspectral image classification method based on a regularized mask autoencoder to solve the problems existing in the above prior art.

[0006] To achieve the above object, the present invention provides a semi-supervised hyperspectral image classification method based on a regularized mask autoencoder, comprising:

[0007] Obtaining an original hyperspectral image, and obtaining an original pre-training sample based on the original hyperspectral image;

[0008] Dividing the original pre-training sample into grids of different scales to obtain a first image block and a second image block, wherein the size of the first image block is smaller than that of the second image block;

[0009] Processing and randomly masking the first image block to obtain a pre-coded image block embedding and a masked image block embedding;

[0010] Construct a regularized mask autoencoder, where the regularized mask autoencoder includes an encoder, a decoder, and an Induced Transformer structure;

[0011] The pre-encoded image block is embedded and encoded by an encoder to obtain encoding features. Based on the encoding features, the second image block is reconstructed by an Induced Transformer to obtain an induced reconstruction result.

[0012] Based on the coding features, the masked image block is embedded and reconstructed through a decoder to obtain a mask reconstruction result;

[0013] Calculating a loss function for the regularized mask autoencoder according to the induced reconstruction result and the mask reconstruction result to obtain a loss value, optimizing the regularized mask autoencoder according to the loss value to obtain a pre-trained regularized mask autoencoder;

[0014] A fully connected layer is added after the encoder of the pre-trained regularized mask autoencoder, and the decoder with the fully connected layer is trained and optimized with labeled samples to obtain a classification model.

[0015] The hyperspectral image to be classified is obtained, and the hyperspectral image to be classified is classified through the classification model to obtain the hyperspectral image classification result.

[0016] Optionally, the process of obtaining the original pre-training samples includes:

[0017] The original hyperspectral image is reduced in dimension by principal component analysis to obtain the original pre-training samples.

[0018] Optionally, the process of processing the first image block includes:

[0019] The first image block is processed by a convolutional layer to generate a block embedding of the first image block, wherein a fixed position embedding is added to the block embedding to provide spatial position information.

[0020] Optionally, the first image block is randomly masked with a masking rate of 75%.

[0021] Optionally, the process of encoding the pre-encoded image block by the encoder is:

[0022] x′=LayerNorm(Encoder(x)),

[0023] in, represents the embedding of the 6 smaller image patches that are retained, Represents the output embedding of the ViT encoder, where Encoder() represents the decoder processing and LayerNorm represents the normalization processing.

[0024] Optionally, the InducedTransformer structure includes a multi-head attention module, a normalization layer and a multi-layer perceptron connected in sequence, the multi-layer perceptron output is the second image block embedding, the input of the multi-head attention layer is the induced embedding of the encoding feature and the normalization processing, and the induced embedding is:

[0025] H=I.repeat(N,9,1)+p1

[0026] Wherein, let I represent the trainable induced token, p1 represents the fixed position embedding in the InducedTransformer structure, repeat() represents the repeated operation on the tensor, and H represents the embedded feature of the second image block.

[0027] Optionally, in the regularized mask autoencoder, the encoder is a ViT encoder using 12 ViT blocks, each ViT block in the encoder uses 8-head attention, and the decoder is a ViT decoder using 8 ViT blocks, and each 8 ViT blocks in the decoder use 8-head attention.

[0028] Optionally, the loss function is:

[0029] L=L mr +L ir

[0030] Among them, L mr represents the mask reconstruction loss, L ir The induced reconstruction loss is also called the regularization loss, L mr The mean square error between the mask reconstruction result and the masked image block is calculated, L ir The mean square error between the induced reconstructed structure and the second image patch is calculated.

[0031] Optionally, the regularized mask autoencoder is optimized by an Adam optimizer.

[0032] Compared with the prior art, the present invention has the following advantages and technical effects:

[0033] The present invention designs a semi-supervised hyperspectral image classification method based on Regularized Masked Auto-Encoder (RMAE). The method uses a large number of unlabeled samples (also called pre-training samples) to pre-train the entire RMAE model for 400 rounds. After the pre-training is completed, two fully connected layers for completing the classification task are added after the ViT encoder, and a small number of labeled samples are used to tune the last block and two fully connected layers of the ViT encoder. After the tuning is completed, the final classification result is obtained.

[0034] The regularized mask autoencoder designed in the present invention for semi-supervised classification of hyperspectral images can autonomously learn highly discriminable representations and obtain satisfactory classification results. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] The drawings constituting a part of the present application are used to provide a further understanding of the present application. The illustrative embodiments and descriptions of the present application are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0036] Figure 1 A schematic diagram of a process of a semi-supervised hyperspectral image classification method based on a regularized mask autoencoder according to an embodiment of the present invention;

[0037] Figure 2 RMAE block diagram of a semi-supervised hyperspectral image classification method based on a regularized mask autoencoder according to an embodiment of the present invention;

[0038] Figure 3 The Induced Transformer module of the semi-supervised hyperspectral image classification method based on regularized mask autoencoder according to an embodiment of the present invention; DETAILED DESCRIPTION

[0039] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

[0040] It should be noted that the steps shown in the flowcharts of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and that, although a logical order is shown in the flowcharts, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0041] The present invention discloses a semi-supervised hyperspectral image classification method based on regularized mask auto-encoding, using randomly selected sample blocks centered on foreground pixels and with a spatial size of 15×15 as pre-training samples; using 5×5 and 3×3 grids to divide the pre-training samples into 25 smaller image blocks, namely the first image blocks, and 9 larger image blocks, namely the second image blocks; in the first image block, 19 smaller image blocks are randomly masked as masked image blocks, and the reserved image blocks are used as pre-encoded image blocks; the pre-encoded image blocks are encoded using a ViT encoder; the encoding features output by the ViT encoder are sent to an Induced Transformer to reconstruct the second image block; the masked image blocks are reconstructed using a ViT decoder; all pre-training samples are used to train the entire RMAE model for 400 rounds; and limited labeled samples are used for tuning and classification. The semi-supervised hyperspectral image classification method based on regularized mask auto-encoder designed by the present invention can learn discriminable patterns from a large number of unlabeled samples and obtain high-performance classification results.

[0042] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, the present application is further described in detail below in conjunction with the accompanying drawings and specific implementation methods.

[0043] In this embodiment, if Figure 1-2 As shown in FIG. 1 , a semi-supervised hyperspectral image classification method based on a regularized mask autoencoder includes:

[0044] S1. Use principal component analysis (PCA) to reduce the dimension of the original hyperspectral image to 15 bands. The formula is:

[0045] X′=PCA(X) (1)

[0046] in, represents the original hyperspectral image, represents the data after dimensionality reduction, B represents the number of original bands, H×W represents the spatial size of the hyperspectral image, and PCA() represents the analysis and calculation by principal component analysis. Represents the field of real numbers.

[0047] S2, use randomly selected sample blocks centered on foreground pixels and with a spatial size of 15×15 as pre-training samples, expressed as Where M represents the number of all pre-training samples. For datasets with a low percentage of labeled pixels (e.g., less than 25%), all sample blocks centered on foreground pixels and with a spatial size of 15×15 are used as pre-training samples; for datasets with a high percentage of labeled pixels (e.g., more than 25%), a certain percentage of sample blocks centered on foreground pixels and with a spatial size of 15×15 are randomly selected as pre-training samples.

[0048] S3, using 5×5 and 3×3 grids to divide the sample into 25 smaller image blocks, namely the first image blocks, and 9 larger image blocks, namely the second image blocks. All first image blocks are fed into a 2-D convolutional layer to obtain the block embedding of the first image blocks. The process can be expressed as:

[0049] x=Reshape(Conv2d(15, 128, 3, 3)(s)) (2)

[0050] in, represents batch training samples, N represents the batch size, represents the embedding of all 25 first image blocks, with an embedding dimension of 128. Before performing the random masking operation, the first image block embedding x is added with a fixed position embedding To include spatial location information.

[0051] S4. Randomly mask out 19 smaller image blocks as masked image blocks; use a masking rate of 75% to perform a random masking operation on the 25 first image blocks, 19 masked image blocks are masked out, and only 6 smaller image blocks are retained as pre-coded image blocks for embedding.

[0052] S5. Use the ViT encoder to encode the retained 6 pre-encoded image block embeddings. The formula is:

[0053] x′=LayerNorm(Encoder(x)) (3)

[0054] in, represents the embedding of the 6 retained pre-encoded image blocks, The output embedding of the ViT encoder is the encoded feature. The ViT encoder uses 12 ViT blocks, and each block uses 8 attention heads.

[0055] S6, such as Figure 3 As shown in , the encoded features are fed into the Induced Transformer structure to reconstruct the 9 second image blocks; wherein the embedding dimension of the second image block is 128. represents a trainable induced token, then the fixed position embedding in the Induced Transformer structure can be expressed as Perform a repeat operation on I. At this time, x′ is the input G of the Induced Transformer structure, and the input H of the Induced Transformer structure can be expressed as:

[0056] H=I.repeat(N, 9, 1)+p1 (4)

[0057] Specifically, the embedding of the 9 second image blocks It is obtained through aggregate learning. First, the induced embedding H is sent to the layer normalization layer LayerNorm:

[0058]

[0059] In the Multi-Head Attention (MHA) module, the query value The induced embedding after normalization h different projections (multi-head projections) on are obtained:

[0060]

[0061] The key value and value They are obtained by h different projections on the input G of the Induced Transformer structure:

[0062] K=Project(G) (7)

[0063] V=Project(G) (8)

[0064] Among them, d represents the projection dimension of each projection, its default value is 16, the default value of h is 4, and Project represents a linear projection operation. Next, a multi-head attention result is calculated:

[0065]

[0066] Among them, softmax() represents the normalized exponential function, that is, the softmax function calculation. Finally, the multi-head attention result is obtained Cascade h different projections to get the cascade result And use a linear layer to adjust its dimension to match the embedding dimension 128 of the input H. Let H′ denote the output of the multi-head attention module MHA, then the embedding of the final output 9 second image blocks can be expressed as:

[0067] Y=(H+H′)+MLP(LayerNorm(H+H′)) (10)

[0068] Where MLP stands for Multi-Layer Perceptron. To complete the reconstruction task, the output of the InducedTransformer module is fed into a Linear layer:

[0069] IR=Linear(128, 5×5×15)(Y) (11)

[0070] in, It represents the final induced reconstruction result.

[0071] S7, use the ViT decoder to reconstruct the 19 masked image blocks. First, the encoding feature It is fed into a linear layer to resize its embedding dimension to the ViT decoder embedding dimension 64:

[0072] x′=Linear(128, 64)(x′) (12)

[0073] at this time, Next, the trainable mask tokens In the second dimension it is repeated 19 times (i.e. ), and concatenated with x′ in the second dimension:

[0074] x″=Concat([x′, M], dim=1) (13)

[0075] at this time, In its second dimension, the first embedding represents the category token, and the 25 embeddings following the category token are reordered in the order of the original image block. Before being fed into the ViT decoder, the reordered x″ is added with a fixed position embedding To include spatial location information:

[0076] x″=x″+p2 (14)

[0077] Next, x″ is fed into the ViT decoder to obtain the decoder embedding and finally a linear layer is used to reconstruct the 19 masked smaller image patches. The process can be expressed as:

[0078] MR=Linear(64, 3×3×15)(LayerNorm(Decoder(x″))) (15)

[0079] in, Denotes the mask reconstruction result, and Decoder denotes the decoder processing. The ViT decoder uses 8 ViTblocks, and each block uses 8 attention heads.

[0080] S8. Use all pre-training samples to pre-train the entire RMAE model for 400 rounds. The loss function of the entire RMAE model can be expressed as:

[0081] L=L mr +L ir (16)

[0082] Among them, L mrrepresents the mask reconstruction loss, L ir The induced reconstruction loss is also called the regularization loss. mr The mean square error between the masked reconstruction structure and the 19 masked image blocks is calculated, L ir The mean square error between the induced reconstructed structure and the 9 second image patches is calculated. RMAE uses the Adam optimizer during pre-training, with an initial learning rate of 0.001 and an exponentially decayed learning rate schedule with a decay factor of 0.99.

[0083] S9. After pre-training, discard the Induced Transformer structure and ViT decoder and add two fully connected layers after the ViT encoder to complete the classification task; use limited labeled samples to tune the last ViT block and two fully connected layers of the ViT encoder; during the tuning stage, all first image blocks are used as input to the ViT encoder. RMAE also uses the Adam optimizer during the tuning process, with an initial learning rate of 0.001, an exponentially decayed learning rate schedule with a decay factor of 0.99, and the tuning rounds are set to 100 rounds.

[0084] The hyperspectral image to be classified is obtained, and the hyperspectral image to be classified is classified through the classification model to obtain the hyperspectral image classification result.

[0085] The technical solution provided by the present invention is verified by combining relevant experimental data:

[0086] In order to illustrate the effectiveness of the present invention, the following experimental demonstration is carried out. The most advanced classification models compared include supervised classification models DMCN (Deep Matrix Capsule Network), SpctralFormer (Spectral Transformer), CapsViT (Capsule Vision Transformer), SSFTT (Spectral-Spatial Feature Tokenization Network) and semi-supervised classification model MAE. The evaluation indicators used in the experiment include overall classification accuracy (OA, OverallAccuracy), average classification accuracy (AA, AverageAccuracy) and Kappa coefficient.

[0087] The first set of experiments uses the Hanchuan dataset, which has 274 spectral bands, a wavelength range of 400 to 1000 nanometers, a spatial size of 1217×303, a spatial resolution of 0.109 meters, and contains 16 types of objects. For the semi-supervised classification models MAE and RMAE, since the proportion of labeled pixels in this dataset is very high, one-fifth of the samples (a total of 51,506 samples) are randomly selected and used as pre-training samples. In addition, 10 labeled samples randomly selected from each category are used as training (tuning) samples, and the remaining samples are used as test samples. Since the random selection of tuning samples will inevitably have a great impact on the performance of the model, in order to comprehensively evaluate the performance of each model on this dataset, each model is repeated 10 times to report the average accuracy and standard deviation. The first set of classification results is shown in Table 1.

[0088] Table 1

[0089]

[0090] The second set of experiments uses the Salinas dataset, which contains 204 spectral bands with wavelengths ranging from 400 to 2500 nanometers, a spatial size of 512×217, a spatial resolution of 3.7 meters, and a total of 16 complex ground object types. For this dataset, MAE and RMAE use half of the randomly selected samples as pre-training sets. 10 samples in each class are randomly selected as training (tuning) samples, and the remaining samples are used as test samples. The second set of classification results is shown in Table 2.

[0091] Table 2

[0092]

[0093] In both the first and second experiments, RMAE achieved the best classification results, fully demonstrating its effectiveness and superiority. Compared with supervised classification models, RMAE can learn discriminable representations from a large number of unlabeled samples, and can obtain satisfactory classification results by tuning only a small number of labeled samples. Compared with MAE, in Tables 1 and 2, RMAE has significant improvements in all three indicators, proving that RMAE has a more robust self-supervised representation learning capability.

[0094] The above are only preferred specific implementations of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed in the present application should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A semi-supervised hyperspectral image classification method based on regularized mask autoencoder, characterized in that: include: Obtaining an original hyperspectral image, and obtaining an original pre-training sample based on the original hyperspectral image; Dividing the original pre-training sample into grids of different scales to obtain a first image block and a second image block, wherein the size of the first image block is smaller than that of the second image block; Processing and randomly masking the first image block to obtain a pre-coded image block embedding and a masked image block embedding; Construct a regularized mask autoencoder, where the regularized mask autoencoder includes an encoder, a decoder, and an Induced Transformer structure; The pre-encoded image block is embedded and encoded by an encoder to obtain encoding features. Based on the encoding features, the second image block is reconstructed by an Induced Transformer to obtain an induced reconstruction result. Based on the coding features, the masked image block is embedded and reconstructed through a decoder to obtain a mask reconstruction result; Calculating a loss function for the regularized mask autoencoder according to the induced reconstruction result and the mask reconstruction result to obtain a loss value, optimizing the regularized mask autoencoder according to the loss value to obtain a pre-trained regularized mask autoencoder; A fully connected layer is added after the encoder of the pre-trained regularized mask autoencoder, and the decoder with the fully connected layer is trained and optimized with labeled samples to obtain a classification model. The hyperspectral image to be classified is obtained, and the hyperspectral image to be classified is classified through the classification model to obtain the hyperspectral image classification result.

2. The method according to claim 1, characterized in that The process of obtaining the original pre-training samples includes: The original hyperspectral image is reduced in dimension by principal component analysis to obtain the original pre-training samples.

3. The method according to claim 1, characterized in that The process of processing the first image block includes: The first image block is processed by a convolutional layer to generate a block embedding of the first image block, wherein a fixed position embedding is added to the block embedding to provide spatial position information.

4. The method according to claim 1, characterized in that The first image block is randomly masked with a masking rate of 75%.

5. The method according to claim 1, characterized in that The process of encoding the pre-encoded image block by the encoder is: x′=LayerNorm(Encoder(x)), in, represents the embedding of the 6 smaller image patches that are retained, Represents the output embedding of the ViT encoder, where Encoder() represents the decoder processing and LayerNorm represents the normalization processing.

6. The method according to claim 1, characterized in that The InducedTransformer structure includes a multi-head attention module, a normalization layer and a multi-layer perceptron connected in sequence, the output of the multi-layer perceptron is the second image block embedding, the input of the multi-head attention module is the induced embedding of the encoding feature and the normalization processing, and the induced embedding is: H=I.repeat(N,9,1)+p1 Wherein, let I represent the trainable induced token, p1 represents the fixed position embedding in the InducedTransformer structure, repeat() represents the repeated operation on the tensor, and H represents the embedded feature of the second image block.

7. The method according to claim 1, characterized in that In the regularized mask autoencoder, the encoder is a ViT encoder using 12 ViT blocks, each ViT block in the encoder uses 8-head attention, and the decoder is a ViT decoder using 8 ViT blocks, and each 8 ViT blocks in the decoder uses 8-head attention.

8. The method according to claim 1, characterized in that The loss function is: L=L mr +L ir Among them, L mr represents the mask reconstruction loss, L ir The induced reconstruction loss is also called the regularization loss, L mr The mean square error between the mask reconstruction result and the masked image block is calculated, L ir The mean square error between the induced reconstructed structure and the second image patch is calculated.

9. The method according to claim 1, characterized in that: The regularized mask autoencoder is optimized by the Adam optimizer.

Citation Information

Patent Citations

  • Hyperspectral image classification method based on adaptive classification network model

    CN114419417A

  • Hyperspectral image multi-classification change detection method and system based on spectrum guided Transform network model

    CN117710805A

  • Weak illumination scene self-supervision depth estimation method and system based on structure regularization

    CN118314186A

  • Multi-level variational autoencoder-based hyperspectral image feature extraction method

    WO2023125456A1

Cited By

  • Construction method of low-altitude unmanned aerial vehicle hyperspectral remote sensing basic large model

    CN119006719A

  • Method for constructing a large basic model for low-altitude UAV hyperspectral remote sensing

    CN119006719B