Ground feature recognition and classification method based on improved SpectralFormer algorithm

By combining the improved SpectralFormer algorithm with the U-Net framework, using the multi-head channel attention mechanism and the Cross-layer adaptive fusion module, the problem of small scale and high similarity of ground objects in remote sensing images is solved, and high-performance pixel-level image classification is achieved. , which improves the accuracy of image processing and feature extraction capabilities.

CN118657984APending Publication Date: 2024-09-17GUANGXI UNIVERSITY OF TECHNOLOGY +2
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410695492.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-31
Publication Date
2024-09-17

AI Technical Summary

Technical Problem

In semantic segmentation of remote sensing images, the small scale, high similarity, and mutual occlusion of ground objects make it difficult to extract features and distinguish different semantic categories. In addition, existing CNN models are prone to losing small-scale features during the feature downsampling process, resulting in classification accuracy. Not high.

Method used

Using the improved SpectralFormer algorithm combined with the U-Net framework, through the multi-head channel attention mechanism and Cross-layer adaptive fusion module, it captures cross-channel, direction-aware and position-aware information, and enhances feature extraction and semantic segmentation capabilities.

Benefits of technology

It improves the accuracy and feature extraction capabilities of image processing, enables more accurate positioning and identification of targets of interest, achieves high-performance pixel-level image classification, and enhances the training speed and classification performance of the model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure FT_1
    Figure FT_1
  • Figure FT_2
    Figure FT_2
  • Figure FT_3
    Figure FT_3
Patent Text Reader

Abstract

The invention aims to provide a ground feature recognition and classification method based on an improved SpectralFormer algorithm, and the method comprises the following steps: A, constructing a U-Net frame network which comprises a plurality of hidden layers, a linearization module, and a SpectralFormer frame; b, the improved U-Net framework network is trained, and a trained U-Net framework network is obtained; and C, obtaining 12 wave band data from the satellite remote sensing image, taking characteristic wave band information generated by nesting the 12 wave band data as an input result, inputting the input result into the trained U-Net framework network, and completing pixel-level remote sensing land coverage classification after processing of the U-Net framework network. According to the method, not only can cross-channel information be captured, but also direction perception and position perception information can be captured, and high-performance pixel-level image classification is better realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image processing, and in particular to a ground object recognition and classification method based on an improved SpectralFormer algorithm. Background Art

[0002] Spectral data information can be used for object recognition and classification. Object recognition and classification based on remote sensing images rely on image classification. With the rapid advancement of aerospace technology and sensor technology, researchers can easily obtain a large number of high-quality remote sensing images that reflect the status of the ecological environment and signs of human activities. Effectively learning and extracting the information contained in these images has become a key task for intelligent interpretation of remote sensing images. Semantic segmentation has attracted much attention as a feasible solution, and its core goal is to identify the semantic category of each pixel in the image. Remote sensing image semantic segmentation has been widely used in many practical scenarios, such as urban planning, disaster assessment, and agricultural production.

[0003] However, the particularity of objects (such as small scale, high similarity, and mutual occlusion) poses new challenges to the semantic segmentation of remote sensing images. CNN-based models usually perform feature downsampling during feature extraction to reduce the amount of computation, but this can easily lead to the loss of small-scale features. In addition, objects of different semantic categories may have similar size, material, and spectral characteristics, making them difficult to distinguish. Occlusion problems also often lead to semantic ambiguity. Therefore, in order to address these challenges, more global context information and refined spatial features are needed as clues for semantic reasoning.

[0004] In summary, land object identification and classification technology based on multispectral data has higher accuracy and reliability, and provides more useful surface information, which makes it an important tool for modern land management and environmental monitoring, and further research is necessary. Summary of the invention

[0005] The present invention aims to provide a method for object recognition and classification based on an improved SpectralFormer algorithm, which can not only capture cross-channel information, but also capture direction perception and position perception information, thereby better realizing high-performance pixel-level image classification.

[0006] The technical solution of the present invention is as follows:

[0007] The ground object recognition and classification method based on the improved SpectralFormer algorithm comprises the following steps:

[0008] A. Build the U-Net framework network. The improved U-Net framework network includes:

[0009] Multiple hidden layers, linearization module, SpectralFormer framework;

[0010] B. Train the improved U-Net framework network to obtain a trained U-Net framework network;

[0011] C. Obtain 12 bands of data from satellite remote sensing images, perform semi-grouped spectral nesting on the 12 bands of data, and input the characteristic band information generated by the nesting into the trained U-Net framework network as the input result. The input result is downsampled four times in turn, and each downsampling reduces the resolution to 1 / 2 of the previous one. The fourth downsampling result is input into the first hidden layer, and after being processed by the first hidden layer, it is input into the linearization module for linear mapping, and then input into the SpectralFormer framework. After being processed by the SpectralFormer framework, it is input into the second hidden layer for processing. The result is processed by the reshape module, and then processed by 3*3 convolution. Then, it is upsampled to a resolution consistent with the fourth downsampling result, and then spliced ​​with the fourth downsampling result to obtain the first splicing result.

[0012] After the first splicing result is processed by 3*3 convolution, it is upsampled to a resolution consistent with the third downsampling result, and then spliced ​​with the third downsampling result to obtain the second splicing result;

[0013] The second stitching result is processed by 3*3 convolution, upsampled to a resolution consistent with the second downsampling result, and then stitched with the second downsampling result to obtain a third stitching result;

[0014] The third splicing result is processed by 3*3 convolution, upsampled to a resolution consistent with the first downsampling result, and then spliced ​​with the first downsampling result to obtain a fourth splicing result;

[0015] The fourth stitching result is processed by 3*3 convolution and upsampled to a resolution consistent with the input result. Finally, it is output by the segmentation head for semantic segmentation to complete the pixel-level remote sensing land cover classification.

[0016] The SpectralFormer framework includes an Encoder module and a Cross-layer adaptive fusion module connected in sequence, and the input result is processed by the Encoder module and the Cross-layer adaptive fusion module in sequence to obtain the output result.

[0017] The processing process in the Encoder module is as follows:

[0018] The input result is first processed by the Norm function and then by the multi-head channel attention mechanism. The multi-head channel attention mechanism processing result and the input result are added to obtain the first addition result. The first addition result is processed by the Norm function and then by the multi-head attention module. The multi-head attention module processing result is added to the first addition result to obtain the second addition result. The second addition result is processed by the Norm function and then by the MLP network. The MLP network processing is added to the second addition result to obtain the output result.

[0019] The processing process of the multi-channel attention mechanism is as follows:

[0020] The input results are divided into two paths, one is processed by maximum pooling, and the other is processed by average pooling. The maximum pooling processing results and the average pooling processing results are respectively input into the same shareMLP network for processing. The two processing results are added and processed by the Sigmoid activation function. After channel attention processing, they are fused with the input results to obtain the output result after multiplication and fusion.

[0021] The Cross-layer adaptive fusion module includes a plurality of groups of sequentially connected unit modules, each unit module includes an Encoder1 module, an Encoder2 module, an Encoder3 module, and an Encoder4 module that are sequentially connected;

[0022] The input result is first processed by the Encoder1 module to obtain the processing result of the Encoder1 module, the processing result of the Encoder1 module is input into the Encoder2 module, and the processing result of the Encoder2 module is input into the Encoder3 module;

[0023] The processing result of the Encoder1 module and the processing structure of the Encoder3 module are fused with multi-scale features, and then concatenated with the processing result of the Encoder3 module through the Concat function and input into the Encoder4 module;

[0024] The processing results of the Encoder4 module and the Encoder2 module are fused with multi-scale features, and then concatenated with the processing results of the Encoder4 module through the Concat function and input into the next unit module.

[0025] The Encoder1 module, Encoder2 module, Encoder3 module and Encoder3 module have the same structure as the Encoder module.

[0026] The hidden layer contains 128 nodes.

[0027] The beneficial effects of the present invention are as follows:

[0028] The present invention has excellent feature extraction capabilities in image processing through the U-Net network, and performs well in natural language processing by utilizing the improved SpectralFormer framework. Combining them to give full play to the strengths of both can not only capture cross-channel information, but also capture direction perception and position perception information, which can help the model more accurately locate and identify targets of interest, allow word semantic features to have richer expressions, better realize high-performance pixel-level image classification, further improve the accuracy of image processing, and obtain better feature extraction capabilities.

[0029] The SpectralFormer framework of the present invention adds a multi-channel attention mechanism to process sequence data, thereby improving the processing speed. After being integrated into the U-Net network, it can better capture different features in the image, thereby speeding up the training speed of the model.

[0030] The present invention combines the advantages of both the SpectralFormer network and the U-Net framework, so the model can achieve high-performance HS image classification tasks under the same accuracy compared to using the MLP network or the Transformer framework alone.

[0031] The present invention solves the problem of semantic ambiguity in small-scale feature extraction and proposes a new pixel-by-pixel classification network framework for hyperspectral images. It can adaptively learn cross-layer feature fusion from the details better, so that it can not only capture cross-channel information, but also capture direction-aware and position-aware information. This can help the model locate and identify targets of interest more accurately, and achieve pixel-level image classification with higher performance. BRIEF DESCRIPTION OF THE DRAWINGS

[0032] Figure 1 It is a structural diagram of the ground object recognition and classification model of Example 1;

[0033] Figure 2 This is a processing flow chart of the channel attention mechanism of Example 1;

[0034] Figure 3 This is a comparison chart of the classification results of different classification methods on the Heshan District 2021 dataset. DETAILED DESCRIPTION

[0035] The present invention is described in detail below with reference to the accompanying drawings and embodiments.

[0036] Example 1

[0037] The ground object recognition and classification method based on the improved SpectralFormer algorithm of this embodiment includes the following steps:

[0038] The ground object recognition and classification method based on the improved SpectralFormer algorithm comprises the following steps:

[0039] A. Build the U-Net framework network, such as Figure 1 As shown, the improved U-Net framework network includes:

[0040] Multiple hidden layers, linearization module, SpectralFormer framework;

[0041] B. Train the improved U-Net framework network to obtain a trained U-Net framework network;

[0042] C. Obtain 12 bands of data from satellite remote sensing images, perform semi-grouped spectral nesting on the 12 bands of data, and input the characteristic band information generated by the nesting into the trained U-Net framework network as the input result. The input result is downsampled four times in turn, and each downsampling reduces the resolution to 1 / 2 of the previous one. The fourth downsampling result is input into the first hidden layer, and after being processed by the first hidden layer, it is input into the linearization module for linear mapping, and then input into the SpectralFormer framework. After being processed by the SpectralFormer framework, it is input into the second hidden layer for processing. The result is processed by the reshape module, and then processed by 3*3 convolution. Then, it is upsampled to a resolution consistent with the fourth downsampling result, and then spliced ​​with the fourth downsampling result to obtain the first splicing result.

[0043] After the first splicing result is processed by 3*3 convolution, it is upsampled to a resolution consistent with the third downsampling result, and then spliced ​​with the third downsampling result to obtain the second splicing result;

[0044] The second stitching result is processed by 3*3 convolution, upsampled to a resolution consistent with the second downsampling result, and then stitched with the second downsampling result to obtain a third stitching result;

[0045] The third splicing result is processed by 3*3 convolution, upsampled to a resolution consistent with the first downsampling result, and then spliced ​​with the first downsampling result to obtain a fourth splicing result;

[0046] The fourth stitching result is processed by 3*3 convolution and upsampled to a resolution consistent with the input result. Finally, it is output by the segmentation head for semantic segmentation to complete the pixel-level remote sensing land cover classification.

[0047] The SpectralFormer framework includes an Encoder module and a Cross-layer adaptive fusion module connected in sequence, and the input result is processed by the Encoder module and the Cross-layer adaptive fusion module in sequence to obtain the output result.

[0048] The processing process in the Encoder module is as follows:

[0049] The input result is first processed by the Norm function and then by the multi-head channel attention mechanism. The multi-head channel attention mechanism processing result and the input result are added to obtain the first addition result. The first addition result is processed by the Norm function and then by the multi-head attention module. The multi-head attention module processing result is added to the first addition result to obtain the second addition result. The second addition result is processed by the Norm function and then by the MLP network. The MLP network processing is added to the second addition result to obtain the output result.

[0050] like Figure 2 As shown, the processing process of the multi-head channel attention mechanism is as follows:

[0051] The input results are divided into two paths, one is processed by maximum pooling, and the other is processed by average pooling. The maximum pooling processing results and the average pooling processing results are respectively input into the same shareMLP network for processing. The two processing results are added and processed by the Sigmoid activation function. After channel attention processing, they are fused with the input results to obtain the output result after multiplication and fusion.

[0052] The Cross-layer adaptive fusion module includes a plurality of groups of sequentially connected unit modules, each unit module includes an Encoder1 module, an Encoder2 module, an Encoder3 module, and an Encoder4 module that are sequentially connected;

[0053] The input result is first processed by the Encoder1 module to obtain the processing result of the Encoder1 module, the processing result of the Encoder1 module is input into the Encoder2 module, and the processing result of the Encoder2 module is input into the Encoder3 module;

[0054] The processing result of the Encoder1 module and the processing structure of the Encoder3 module are fused with multi-scale features, and then concatenated with the processing result of the Encoder3 module through the Concat function and input into the Encoder4 module;

[0055] The processing results of the Encoder4 module and the Encoder2 module are fused with multi-scale features, and then concatenated with the processing results of the Encoder4 module through the Concat function and input into the next unit module.

[0056] The Encoder1 module, Encoder2 module, Encoder3 module and Encoder3 module have the same structure as the Encoder module.

[0057] The hidden layer contains 128 nodes.

[0058] Example 2

[0059] The method of Example 1 is used to classify multispectral pixels, and three evaluation indicators based on confusion matrix are used to evaluate the classification ability, including Overall Accuracy, Precision and Kappa. The pixel-level evaluation indicators such as Accuracy, Precision and Kappa are mainly used to evaluate the accurate classification ability of the method of Example 1.

[0060] 1) Accuracy: The ratio of the number of correct predictions to the number of all predictions.

[0061]

[0062] Among them, TP is True Positive, FP is False Positive, TN is True Negative, and FN is False Negative. TP+TN represents the total number of correctly classified samples. Generally speaking, the higher the OA value, the better the classification performance of the network framework. However, in some cases, due to the imbalanced distribution of ground object category data, the OA indicator may not be suitable as the only criterion. For example, the proportion of samples in a certain category is very small, resulting in the algorithm framework only needing to predict all samples of this category as another category to obtain a very high OA value. Therefore, in this case, other indicators are needed to comprehensively evaluate the performance of the model.

[0063] 2) Precision: The proportion of samples that are actually positive among all samples predicted by the model to be positive. The calculation formula is as follows.

[0064]

[0065] 3) Kappa coefficient: Kappa is an indicator to measure the accuracy of a classifier or evaluation system, also known as Cohen's kappa coefficient, which evaluates the consistency between the classification model and its prediction results in actual tests. The Kappa coefficient divides the errors generated by the algorithm into two types: one is a random error, which is equivalent to blind guessing; the other is a classification error, that is, the sample should belong to a certain category but is misclassified as another category. The Kappa coefficient ranges from [-1,1]. Its calculation formula is as follows:

[0066]

[0067] P 0 It indicates the exact match of the observed data, that is, the proportion of samples whose actual predictions by the classifier are exactly the same as the actual situation. It is the probability that the classifier predicts the classification and the actual situation is consistent.

[0068] The satellite remote sensing training sample construction in the remote sensing image database selects Sentinel 2, which contains a remote sensing image data sample set of Heshan District, Yiyang City, Hunan Province. The data set samples are divided into 70% training set and 30% test set. The training set is used to train the SF-UNet model for the task of land object recognition and classification, the validation set is used to adjust the parameters of the network model, and the test set is used to test whether the network model is accurate.

[0069] The test results are shown in Table 1 and Figure 3 As shown:

[0070] Table 1 Comparison of classification results of different classification methods on the Heshan District 2021 dataset

[0071]

[0072] The quantitative classification results of the three comprehensive indicators OA, AA, and kappa of the Heshan District study area data set and the accuracy of each category are shown in Table 1. CNN has the worst overall effect. OA, AA, and Kappa are all lower than other models. The accuracy rates for Building and Wetland are only 58.04% and 52.56%, respectively. This is probably because multispectral images have fewer bands and only use individual bands, which is not conducive to CNN learning features. Hyperspectral images have hundreds of band information and may be more suitable for the CNN framework. The OA of traditional classifiers SVM, RF, KNN, and U-Net are 64.96%, 85.69%, 81.04%, and 80.06%, respectively, achieving relatively good results. SVM has poor classification ability for Pond. Transformer, SpectralFormer, and the method in Example 1 (SF-UNet in the table) are all spectral sequence classification methods based on deep learning. The performance of the four models is relatively similar, which proves the advantage of deep learning in sequence data processing. Figure 3 The SVM treats most of the wetland as water, which obviously causes confusion. The CNN classification results for the entire study area are poor, and it is difficult to distinguish categories with small differences within the group. The overall classification results of Transformer (ViT), SpectralFormer and Example 1 are good, but the results of Example 1 are better locally. The method in Example 1 can better distinguish between Wetland and Water with small differences within the group, and will not misclassify Vegetable. It can be clearly seen that the method in Example 1 is clearer than other algorithms.

Claims

1. A method for identifying and classifying objects based on an improved SpectralFormer algorithm, characterized in that: The following steps are involved: A. Build the U-Net framework network. The improved U-Net framework network includes: Multiple hidden layers, linearization module, SpectralFormer framework; B. Train the improved U-Net framework network to obtain a trained U-Net framework network; C. Obtain 12 bands of data from satellite remote sensing images, perform semi-grouped spectral nesting on the 12 bands of data, and input the characteristic band information generated by the nesting into the trained U-Net framework network as the input result. The input result is downsampled four times in turn, and each downsampling reduces the resolution to 1 / 2 of the previous one. The fourth downsampling result is input into the first hidden layer, and after being processed by the first hidden layer, it is input into the linearization module for linear mapping, and then input into the SpectralFormer framework. After being processed by the SpectralFormer framework, it is input into the second hidden layer for processing. The result is processed by the reshape module, and then processed by 3*3 convolution. Then, it is upsampled to a resolution consistent with the fourth downsampling result, and then spliced ​​with the fourth downsampling result to obtain the first splicing result. After the first splicing result is processed by 3*3 convolution, it is upsampled to a resolution consistent with the third downsampling result, and then spliced ​​with the third downsampling result to obtain the second splicing result; The second stitching result is processed by 3*3 convolution, upsampled to a resolution consistent with the second downsampling result, and then stitched with the second downsampling result to obtain a third stitching result; The third splicing result is processed by 3*3 convolution, upsampled to a resolution consistent with the first downsampling result, and then spliced ​​with the first downsampling result to obtain a fourth splicing result; The fourth stitching result is processed by 3*3 convolution and upsampled to a resolution consistent with the input result. Finally, it is output by the segmentation head for semantic segmentation to complete the pixel-level remote sensing land cover classification.

2. The method for identifying and classifying ground objects based on the improved SpectralFormer algorithm according to claim 1, characterized in that: The SpectralFormer framework includes an Encoder module and a Cross-layer adaptive fusion module connected in sequence, and the input result is processed by the Encoder module and the Cross-layer adaptive fusion module in sequence to obtain the output result.

3. The method for identifying and classifying land objects based on the improved SpectralFormer algorithm according to claim 2, characterized in that: The processing process in the Encoder module is as follows: The input result is first processed by the Norm function and then by the multi-head channel attention mechanism. The multi-head channel attention mechanism processing result and the input result are added to obtain the first addition result. The first addition result is processed by the Norm function and then by the multi-head attention module. The multi-head attention module processing result is added to the first addition result to obtain the second addition result. The second addition result is processed by the Norm function and then by the MLP network. The MLP network processing is added to the second addition result to obtain the output result.

4. The method for identifying and classifying ground objects based on the improved SpectralFormer algorithm according to claim 3, characterized in that: The processing process of the multi-channel attention mechanism is as follows: The input results are divided into two paths, one is processed by maximum pooling, and the other is processed by average pooling. The maximum pooling processing results and the average pooling processing results are respectively input into the same shareMLP network for processing. The two processing results are added and processed by the Sigmoid activation function. After channel attention processing, they are fused with the input results to obtain the output result after multiplication and fusion.

5. The method for identifying and classifying ground objects based on the improved SpectralFormer algorithm according to claim 2, characterized in that: The Cross-layer adaptive fusion module includes more than one group of sequentially connected unit modules, each unit module includes an Encoder1 module, an Encoder2 module, an Encoder3 module, and an Encoder4 module that are sequentially connected. The input result is first processed by the Encoder1 module to obtain the processing result of the Encoder1 module, the processing result of the Encoder1 module is input into the Encoder2 module, and the processing result of the Encoder2 module is input into the Encoder3 module; The processing result of the Encoder1 module and the processing structure of the Encoder3 module are fused with multi-scale features, and then concatenated with the processing result of the Encoder3 module through the Concat function and input into the Encoder4 module; The processing results of the Encoder4 module and the Encoder2 module are fused with multi-scale features, and then concatenated with the processing results of the Encoder4 module through the Concat function and input into the next unit module.

6. The method for identifying and classifying ground objects based on the improved SpectralFormer algorithm according to claim 5, characterized in that: The Encoder1 module, Encoder2 module, Encoder3 module and Encoder3 module have the same structure as the Encoder module.

7. The method for identifying and classifying ground objects based on the improved SpectralFormer algorithm according to claim 1, characterized in that: The hidden layer contains 128 nodes.