A hyperspectral image classification method based on long-short distance cross attention
By constructing a hyperspectral image classification network based on long and short distance cross-attention, the problem of insufficient extraction of spectral band correlation information is solved, and the accurate classification and generalization ability of hyperspectral images are improved.
Patent Information
- Application Number
- CN202310816540.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-04
- Publication Date
- 2026-01-06
- Estimated Expiration
- 2043-07-04
AI Technical Summary
Existing hyperspectral image classification methods cannot effectively extract correlation information between spectral bands, resulting in information loss and affecting classification accuracy.
A hyperspectral image classification method based on long and short distance cross attention is adopted. By constructing a hyperspectral classification network including a shallow feature extraction module, a spatial feature enhancement module, and a long and short distance spectral cross attention module, the training and classification are carried out without disclosing the information of the training set and the test set.
It improves the accuracy and generalization ability of hyperspectral image classification, especially showing a significant improvement in the recognition rate of difficult-to-classify categories.
Smart Images

Figure CN116778252B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of hyperspectral image classification technology, and in particular to a hyperspectral image classification method based on long and short distance cross-attention. Background Technology
[0002] Each hyperspectral image (HSI) contains hundreds of continuous narrow spectral bands, which allows for more accurate identification than panchromatic and multispectral remote sensing images by leveraging the uniformity and wide wavelength range of hyperspectral data. This has led to its widespread application in natural resource exploration and natural disaster assessment. The goal of HSI classification is to automatically identify the target categories contained within the HSI by mining discriminative features from spatial and spectral information. With the development of deep learning technology, feature extraction methods for HSI classification have evolved from traditional manually designed feature extraction to automatic feature extraction based on deep learning frameworks.
[0003] Since HSI is a sequence data with hundreds of spectral bands, and CNN, RNN, and GAN cannot extract the long correlation between spectral bands, Transformer is needed to extract the correlation information between spectral bands. However, the problem is that Transformer does not extract enough information for each spectral band and there will be information loss.
[0004] Therefore, a hyperspectral image classification method is needed that can both fully extract information from spectral bands and enhance the correlation between each spectral band. Summary of the Invention
[0005] To address the technical problems existing in the background art, this invention proposes a hyperspectral image classification method based on long and short distance cross attention.
[0006] This invention proposes a hyperspectral image classification method based on long and short distance cross-attention, comprising:
[0007] Acquire hyperspectral images with land cover category label information;
[0008] The hyperspectral image is divided into multiple image blocks based on the land cover category label information;
[0009] Construct training and testing sets based on multiple image patches;
[0010] Construct a hyperspectral classification network based on long and short distance cross-attention;
[0011] The hyperspectral classification network is trained using the training set to obtain a well-trained hyperspectral classification network.
[0012] The trained hyperspectral classification network is used to predict the classification results of the test set.
[0013] Preferably, the hyperspectral classification network includes a shallow feature extraction module, a spatial feature enhancement module, and a long- and short-range spectral cross-attention module connected in sequence;
[0014] The shallow feature extraction module is used to extract shallow features from the input original feature map to obtain a shallow feature map;
[0015] The spatial feature enhancement module is used to enhance the spatial features of the shallow feature map to obtain a second enhanced feature map.
[0016] The long- and short-range spectral cross-attention module includes a short-range spectral attention module and a long-range spectral attention module. The short-range spectral attention module is used to obtain a short-range spectral feature map based on the second enhancement feature map; the long-range spectral attention module is used to obtain a long-range spectral feature map based on the short-range spectral feature map.
[0017] Preferably, the shallow feature extraction module includes a first three-dimensional convolutional layer, a first batch normalization (BN) layer, a first ReLU activation layer, a second two-dimensional convolutional layer, a second batch normalization (BN) layer, and a second ReLU activation layer.
[0018] The input of the first 3D convolutional layer is the training set, and the output of the first 3D convolutional layer is connected to the input of the first batch normalization layer. The output of the first batch normalization layer is connected to the input of the first ReLU activation layer. The output of the first ReLU activation layer is used as the input of the second 2D convolutional layer, and the output of the second 2D convolutional layer is connected to the input of the second batch normalization layer. The output of the second batch normalization layer is connected to the input of the second ReLU activation layer.
[0019] Preferably, the spatial feature enhancement module has a preset position weight matrix. The spatial feature enhancement module is used to weight the position weight matrix with the input shallow feature map to obtain a first enhanced feature map, and to add the first enhanced feature map with the shallow feature map pixel by pixel to obtain a second enhanced feature map.
[0020] Preferably, the short-range spectral attention module includes a first spectral band grouping submodule and a first self-attention submodule;
[0021] The spectral band grouping submodule is used to group the second enhanced feature map into spectral bands to obtain multiple short-range spectral band groups; the first self-attention submodule is used to apply self-attention to each short-range spectral band group to obtain a short-range spectral feature map.
[0022] Preferably, the first self-attention submodule includes a first LN layer normalization layer, a first self-attention layer, a second LN layer normalization layer, and a first multilayer perceptron (MLP) layer;
[0023] The input of the first LN layer normalization layer is a short-range spectral band group. The output of the first LN layer normalization layer and the position embedding of the short-range spectral band group are simultaneously connected to the input of the first self-attention layer. The output of the first self-attention layer is connected to the input of the second LN layer normalization layer. The output of the second LN layer normalization layer is connected to the first multilayer perceptron (MLP) layer.
[0024] Preferably, the long-range spectral attention module includes: a second spectral band grouping submodule and a second self-attention submodule;
[0025] The second spectral band grouping submodule is used to sample the short-range spectral feature map at equal intervals to obtain multiple long-range spectral band groups; the second self-attention submodule is used to apply self-attention to each long-range spectral band group to obtain a long-range spectral feature map.
[0026] Preferably, the second self-attention submodule includes a third LN layer normalization layer, a second self-attention layer, a fourth LN layer normalization layer, and a second multilayer perceptron (MLP) layer;
[0027] The input of the third LN layer normalization layer is a long-range spectral band group. The output of the third LN layer normalization layer and the position embedding of the long-range spectral band group are simultaneously connected to the input of the second self-attention layer. The output of the second self-attention layer is connected to the input of the fourth LN layer normalization layer. The output of the fourth LN layer normalization layer is connected to the second multilayer perceptron (MLP) layer.
[0028] Preferably, a training set and a test set are constructed based on multiple image patches, specifically including:
[0029] A dataset was built based on multiple image patches;
[0030] The dataset is processed to obtain a dataset that does not leak information;
[0031] Based on a dataset that does not disclose information, construct training and test sets.
[0032] Preferably, the dataset is processed to obtain a dataset that does not disclose information, specifically including:
[0033] Randomly select a pixel and use that pixel as the center pixel of the image block it belongs to;
[0034] If information leakage occurs in the image block divided by the selected center pixel, then the center pixel that caused the information leakage is removed.
[0035] Continue randomly selecting pixels until the number of center pixels for each land cover category reaches the preset number;
[0036] The preset number of center pixels for each land cover category is:
[0037]
[0038] In the formula, S j This represents the preset number of center pixels in the j-th feature category after excluding information leakage, j = 1, 2, ..., k, where k represents the number of feature categories; W and H represent the width and height of the image patch, respectively; m j This represents the number of pixels in the j-th land cover category excluding background pixels; t represents the size of the image patch.
[0039] Preferably, training and test sets are constructed based on a dataset that does not disclose information, specifically including:
[0040] A certain number of image patches containing the center pixels of each land cover category are randomly selected as the training set, and the remaining image patches containing the center pixels of each land cover category are used as the test set.
[0041] Preferably, after constructing the training and test sets based on a dataset that does not disclose information, the method further includes:
[0042] Data augmentation was performed on both the training and test sets.
[0043] The proposed hyperspectral image classification method based on long and short distance cross-attention in this invention classifies hyperspectral images by constructing, training, and utilizing the long and short distance cross-attention hyperspectral classification network LSDC. Since the long and short distance cross-attention hyperspectral classification network LSDC can obtain local changes between spectral neighborhoods and long-distance relationships with contextual information, this invention has good classification performance and good generalization ability. Attached Figure Description
[0044] Figure 1 This is a flowchart illustrating a hyperspectral image classification method based on long and short distance cross-attention proposed in this invention.
[0045] Figure 2 This is a schematic diagram of an image block that exhibits information leakage in one embodiment of the present invention.
[0046] Figure 3 This is a schematic diagram illustrating the division of the training set and test set in one embodiment of the present invention.
[0047] Figure 4 This is a schematic diagram of the space reinforcement module in one embodiment of the present invention.
[0048] Figure 5 This is a schematic diagram of the structure of the long and short distance spectral cross-attention module in one embodiment of the present invention.
[0049] Figure 6 This is a schematic diagram of the overall structure of a hyperspectral classification network based on long and short distance cross-attention in one embodiment of the present invention. Detailed Implementation
[0050] It should be noted that, unless otherwise specified, the embodiments and features described in the present invention can be combined with each other. The present invention will now be described in detail with reference to the accompanying drawings and embodiments.
[0051] Reference Figure 1 This invention proposes a hyperspectral image classification method based on long and short distance cross-attention, comprising:
[0052] Acquire hyperspectral images with land cover category label information;
[0053] The hyperspectral image is divided into multiple image blocks based on the land cover category label information;
[0054] Construct training and testing sets based on multiple image patches;
[0055] Construct a hyperspectral classification network based on long and short distance cross-attention;
[0056] The hyperspectral classification network is trained using the training set to obtain a well-trained hyperspectral classification network.
[0057] The trained hyperspectral classification network is used to predict the classification results of the test set.
[0058] In this invention, a hyperspectral classification network LSDC based on long and short distance cross attention is constructed, trained, and used to classify hyperspectral images. Since the hyperspectral classification network LSDC based on long and short distance cross attention can obtain local changes between spectral neighborhoods and long-distance relationships with contextual information, this invention has good classification performance and good generalization ability.
[0059] The size of the image patch is W×H×C; where W and H represent the width and height of the image patch, respectively, and C represents the number of spectral bands.
[0060] like Figure 2 As shown, assuming that image patch 1, i.e. Patch1, is selected as the training set, according to the previous partitioning method, image patch 2, which overlaps with Patch1, may be selected as the test set. There is an overlap between the two, which will lead to the leakage of information between the training set and the test set. This will cause the trained samples to be sent into the network as the test set again, which will make the classification model overly optimistic in the test.
[0061] To address this issue, in a further embodiment, a training set and a test set are constructed based on multiple image patches, specifically including:
[0062] A dataset was built based on multiple image patches;
[0063] The dataset is processed to obtain a dataset that does not leak information;
[0064] Based on a dataset that does not disclose information, construct training and test sets.
[0065] In a further embodiment, the dataset is processed to obtain a dataset that does not disclose information, specifically including:
[0066] Randomly select a pixel and use that pixel as the center pixel of the image block it belongs to;
[0067] If information leakage occurs in the image block divided by the selected center pixel, then the center pixel that caused the information leakage is removed.
[0068] Continue randomly selecting pixels until the number of center pixels for each land cover category reaches the preset number;
[0069] The preset number of center pixels for each land cover category is:
[0070]
[0071] In the formula, S j This represents the preset number of center pixels in the j-th feature category after excluding information leakage, j = 1, 2, ..., k, where k represents the number of feature categories; W and H represent the width and height of the image patch, respectively; m j represents the number of pixels in the j-th land cover category excluding background pixels, and t represents the size of the image patch.
[0072] This setup ensures that the data is not leaked.
[0073] In a further specific embodiment, a training set and a test set are constructed based on a dataset that does not disclose information, specifically including:
[0074] A certain number of image patches containing the center pixels of each land cover category are randomly selected as the training set, and the remaining image patches containing the center pixels of each land cover category are used as the test set. Specifically, as follows: Figure 3 As shown.
[0075] Specifically, in this embodiment, the training set and the test set follow a 3:7 ratio.
[0076] Since the partitioning process is random, there is an imbalance in the number of different land cover categories in the training and test sets. To address this issue, in a further embodiment, after constructing the training and test sets based on a non-disclosure dataset, the following steps are also included:
[0077] Data augmentation was performed on both the training and test sets.
[0078] Specifically, data augmentation methods such as rotation and cropping are used to augment the training and test sets respectively.
[0079] like Figure 5 and Figure 6 As shown, in this embodiment, the hyperspectral classification network includes a shallow feature extraction module, a spatial feature enhancement module, and a long- and short-range spectral cross-attention module connected in sequence.
[0080] The shallow feature extraction module is used to extract shallow features from the input original feature map to obtain a shallow feature map;
[0081] The spatial feature enhancement module is used to enhance the spatial features of the shallow feature map to obtain a second enhanced feature map.
[0082] The long- and short-range spectral cross-attention module includes a short-range spectral attention module and a long-range spectral attention module. The short-range spectral attention module is used to obtain a short-range spectral feature map based on the second enhancement feature map; the long-range spectral attention module is used to obtain a long-range spectral feature map based on the short-range spectral feature map.
[0083] Thus, the hyperspectral classification network can use the shallow feature extraction module to extract shallow feature maps with shallow spatial-spectral joint features and spatial features, and use the spatial feature enhancement module to enhance the spatial features of the shallow feature maps, highlighting the central features and retaining secondary features. Furthermore, it utilizes the short-range spectral attention module in the long and short-range spectral cross-attention module to obtain local changes between spectral neighborhoods and the long-range spectral attention module to obtain long-range relationships with contextual information. The network structure is relatively simple, with good classification performance and good generalization ability.
[0084] In this embodiment, the shallow feature extraction module includes a first three-dimensional convolutional layer, a first batch normalization (BN) layer, a first ReLU activation layer, a second two-dimensional convolutional layer, a second batch normalization (BN) layer, and a second ReLU activation layer.
[0085] Specifically, the input of the first three-dimensional convolutional layer is the training set X1, the output of the first three-dimensional convolutional layer is connected to the input of the first batch normalization layer, the output of the first batch normalization layer is connected to the input of the first ReLU activation layer; the output of the first ReLU activation layer is used as the input of the second two-dimensional convolutional layer, the output of the second two-dimensional convolutional layer is connected to the input of the second batch normalization layer, and the output of the second batch normalization layer is connected to the input of the second ReLU activation layer.
[0086] Thus, shallow spatial-spectral joint features and spatial features can be extracted using one 3D convolution and one 2D convolution, respectively.
[0087] Specifically, the kernel size of the first three-dimensional convolutional layer is 3×3×3, and the number of kernels is 8; the kernel size of the second two-dimensional convolutional layer is 3×3, and the number of kernels is 64.
[0088] like Figure 4 As shown in this embodiment, the spatial feature enhancement module has a preset position weight matrix. The spatial feature enhancement module is used to weight the position weight matrix with the input shallow feature map to obtain a first enhanced feature map, and to add the first enhanced feature map and the shallow feature map pixel by pixel to obtain a second enhanced feature map.
[0089] In this way, the first enhanced feature map is obtained by weighting the position weight matrix with the shallow feature map extracted from the shallow feature map in the spatial feature enhancement, which highlights the central feature. Then, the first enhanced feature map and the shallow feature map are added pixel by pixel to retain the secondary features.
[0090] Specifically, the output of the second ReLU activation layer is weighted by the position weight matrix to obtain the first enhanced feature map; the first enhanced feature map is pixel-wise added to the output of the second ReLU activation layer to obtain the second enhanced feature map.
[0091] In this embodiment, the short-range spectral attention module includes a first spectral band grouping submodule and a first self-attention submodule;
[0092] The spectral band grouping submodule is used to group the second enhanced feature map into spectral bands to obtain multiple short-range spectral band groups; the first self-attention submodule is used to apply self-attention to each short-range spectral band group to obtain a short-range spectral feature map.
[0093] In this way, short-range spectral attention can be used to capture local variations between spectral neighborhoods.
[0094] Specifically, the short-range spectral attention submodule is used to divide the spectral bands into four short-range spectral band groups.
[0095] In order to obtain local variations between spectral neighborhoods, in a further embodiment, the first self-attention submodule includes a first LN layer normalization layer, a first self-attention layer, a second LN layer normalization layer, and a first multilayer perceptron (MLP) layer.
[0096] The input of the first LN layer normalization layer is a short-range spectral band group. The output of the first LN layer normalization layer and the position embedding of the short-range spectral band group are simultaneously connected to the input of the first self-attention layer. The output of the first self-attention layer is connected to the input of the second LN layer normalization layer. The output of the second LN layer normalization layer is connected to the first multilayer perceptron (MLP) layer.
[0097] In this embodiment, the long-range spectral attention module includes: a second spectral band grouping submodule and a second self-attention submodule;
[0098] The second spectral band grouping submodule is used to sample the short-range spectral feature map at equal intervals to obtain multiple long-range spectral band groups; the second self-attention submodule is used to apply self-attention to each long-range spectral band group to obtain a long-range spectral feature map.
[0099] In this way, long-range spectral attention can be used to obtain long-range relationships with contextual information.
[0100] Specifically, the second spectral band grouping submodule samples the short-distance spectral feature map at equal intervals of 4 to obtain four long-distance spectral band groups.
[0101] In order to obtain long-distance relationships with contextual information, in a further embodiment, the second self-attention submodule includes a third LN layer normalization layer, a second self-attention layer, a fourth LN layer normalization layer, and a second multilayer perceptron (MLP) layer.
[0102] The input of the third LN layer normalization layer is a long-range spectral band group. The output of the third LN layer normalization layer and the position embedding of the long-range spectral band group are simultaneously connected to the input of the second self-attention layer. The output of the second self-attention layer is connected to the input of the fourth LN layer normalization layer. The output of the fourth LN layer normalization layer is connected to the second multilayer perceptron (MLP) layer.
[0103] The effects of the present invention can be further illustrated by the following comparative examples and embodiments:
[0104] Comparative Example 1
[0105] In this embodiment, the Pavia University dataset is selected as the dataset for hyperspectral images. Several existing methods are used to classify the Pavia University dataset. These methods include 3DCNN (Convolutional Neural Network), DSP (Digital Pyramid Network), and SSFTT (Structured Strato-Fractal Transformer). The evaluation metrics for the classification results of these existing methods on the Pavia University dataset are shown in Table 1.
[0106] Example 1
[0107] In this embodiment, the Pavia University dataset, which is information-non-disclosure (P) as proposed in this invention, is selected as the dataset for hyperspectral images. Various methods in the prior art are used to classify the information-non-disclosure (P) Pavia University dataset. These methods include 3DCNN convolutional network models, DSP pyramid network models, and SSFTT network models in Transformers. The evaluation metrics for the classification results of the information-non-disclosure (P) Pavia University dataset using these methods are shown in Table 1.
[0108] Example 2
[0109] In this embodiment, the Pavia University dataset, which is information-non-disclosure (P) proposed in this invention, is selected as the dataset for hyperspectral images. The Pavia University dataset, which is information-non-disclosure (P), is classified using the hyperspectral image classification method LSDC based on long and short distance cross-attention proposed in this invention. The evaluation metrics of the classification results are shown in Table 2.
[0110] Table 1. Evaluation metrics for classifying information leakage versus non-leakage (P) using various methods on the Pavia University dataset.
[0111]
[0112] As can be observed from Table 1, compared with the classification of the Pavia University dataset using existing techniques, when classifying the Pavia University dataset with information non-disclosure (P) proposed in this invention using existing techniques, the overall accuracy OA of the classic convolutional network model 3DCNN decreases by 32.98%, the overall accuracy OA of the classic pyramid network model DSP decreases by 6%, and the overall accuracy OA of the SSFTT network model in Transformer decreases by 7.66%.
[0113] Table 2. Evaluation metrics of prior art and this invention for classifying the Pavia University dataset for information non-disclosure (P).
[0114]
[0115] As shown in Table 2, compared with existing technologies, the hyperspectral image classification network LSDC based on long-short distance cross-attention proposed in this invention achieves the highest overall accuracy OA, average accuracy AA, and Kappa coefficient k for the information-non-disclosure (P) Pavia University dataset. Specifically, the overall accuracy is improved by 0.7% compared to the highest-accurate existing SSFTT model, the average accuracy is improved by 2.26%, and the Kappa coefficient is improved by 0.87%. In particular, it achieves an accuracy of 71.43% for category 7, the most difficult category to classify in the Pavia University dataset. This fully demonstrates that this method effectively improves the discriminability of features.
[0116] The above description is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any equivalent substitutions or modifications made by those skilled in the art within the scope of the technology disclosed in the present invention, based on the technical solution and inventive concept of the present invention, should be covered within the scope of protection of the present invention.
Claims
1. A hyperspectral image classification method based on long-short distance cross attention, characterized in that, The method comprises the following steps: acquire a hyperspectral image with ground object category label information; divide the hyperspectral image into multiple image blocks according to the ground object category label information; construct a training set and a test set according to the multiple image blocks; construct a hyperspectral classification network based on long and short distance cross attention; train the hyperspectral classification network using the training set to obtain a trained hyperspectral classification network; predict the classification results of the test set using the trained hyperspectral classification network; The hyperspectral classification network comprises a shallow feature extraction module, a spatial feature enhancement module and a long and short distance spectral cross attention module connected in sequence; the shallow feature extraction module is used for shallow feature extraction on the input original feature map to obtain a shallow feature map; the spatial feature enhancement module is used for spatial feature enhancement on the shallow feature map to obtain a second enhanced feature map. The long and short distance spectral cross attention module comprises a short distance spectral attention module and a long distance spectral attention module; the short distance spectral attention module comprises a first spectral band grouping submodule and a first self-attention submodule; the spectral band grouping submodule is used for spectral band grouping on the second enhanced feature map to obtain multiple short distance spectral band groups; the first self-attention submodule is used for self-attention on each short distance spectral band group to obtain a short distance spectral feature map; the long distance spectral attention module comprises a second spectral band grouping submodule and a second self-attention submodule; the second spectral band grouping submodule is used for equidistant sampling on the short distance spectral feature map to obtain multiple long distance spectral band groups; the second self-attention submodule is used for self-attention on each long distance spectral band group to obtain a long distance spectral feature map.
2. The hyperspectral image classification method based on long-short distance cross attention according to claim 1, characterized in that, The shallow feature extraction module comprises a first three-dimensional convolution layer, a first BN batch normalization layer, a first RELU activation layer, a second two-dimensional convolution layer, a second BN batch normalization layer and a second RELU activation layer. The input of the first three-dimensional convolution layer is the training set; the output of the first three-dimensional convolution layer is connected to the input of the first BN batch normalization layer; the output of the first BN batch normalization layer is connected to the input of the first RELU activation layer; the output of the first RELU activation layer is used as the input of the second two-dimensional convolution layer; the output of the second two-dimensional convolution layer is connected to the input of the second BN batch normalization layer; the output of the second BN batch normalization layer is connected to the input of the second RELU activation layer.
3. The hyperspectral image classification method based on long-short distance cross attention of claim 1, wherein, A position weight matrix is preset in the spatial feature enhancement module; the spatial feature enhancement module is used for weighting the position weight matrix and the shallow feature map to obtain a first enhanced feature map, and adding the first enhanced feature map and the shallow feature map pixel by pixel to obtain a second enhanced feature map.
4. The hyperspectral image classification method based on long-short distance cross attention of claim 1, wherein, The first self-attention submodule comprises a first LN layer normalization layer, a first self-attention layer, a second LN layer normalization layer and a first multi-layer perceptron (MLP) layer. The input of the first LN layer normalization layer is a short-distance spectral band group, the output of the first LN layer normalization layer is connected to the input of the first self-attention layer together with the position embedding of the short-distance spectral band group, the output of the first self-attention layer is connected to the input of the second LN layer normalization layer, and the output of the second LN layer normalization layer is connected to the first multi-layer perception (MLP) layer.
5. The hyperspectral image classification method based on long-short distance cross attention of claim 1, wherein, The second self-attention sub-module comprises a third LN layer normalization layer, a second self-attention layer, a fourth LN layer normalization layer and a second multi-layer perception (MLP) layer. The input of the third LN layer normalization layer is a long-distance spectral band group, the output of the third LN layer normalization layer is connected to the input of the second self-attention layer together with the position embedding of the long-distance spectral band group, the output of the second self-attention layer is connected to the input of the fourth LN layer normalization layer, and the output of the fourth LN layer normalization layer is connected to the second multi-layer perception (MLP) layer.
6. The hyperspectral image classification method based on long-short distance cross attention according to any one of claims 1-5, characterized in that, According to the plurality of image blocks, a training set and a test set are constructed, specifically comprising: Based on the plurality of image blocks, a data set is established; The data set is processed to obtain a data set without information leakage; According to the data set without information leakage, a training set and a test set are constructed.
7. The hyperspectral image classification method based on long-short distance cross attention of claim 6, wherein, The data set is processed to obtain a data set without information leakage, specifically comprising: Randomly selecting a pixel point and taking the pixel point as the center pixel of the image block; If the image block divided by the selected center pixel has information leakage, the center pixel with information leakage is removed; Continue to randomly select a pixel point until the number of center pixels of each ground object category reaches a preset number; The preset number of center pixels of each ground object category is In the formula, S j represents the preset number of the center pixel in the jth ground object category after excluding information leakage, j = 1, 2, …, or k, k represents the number of ground object categories; W and H respectively represent the width and height of the image block; m j represents the pixel number of the jth ground object category excluding the background pixel; t represents the size of the image block.
8. The hyperspectral image classification method based on long-short distance cross attention of claim 6, wherein, According to the data set without information leakage, a training set and a test set are constructed, specifically comprising: From each ground object category, a certain number of image blocks with center pixels are randomly selected as a training set, and the remaining image blocks with center pixels in each ground object category are all used as a test set.
9. The hyperspectral image classification method based on long-short distance cross attention of claim 8, wherein, After constructing the training set and the test set according to the data set without information leakage, it further comprises: Respectively, the training set and the test set are data enhanced.
Citation Information
Patent Citations
Global learning device and method for hyperspectral image classification
CN114898157A
Hyperspectral image classification method based on mixed spectral network and multi-head self-attention mechanism
CN115222994A