Small sample hyperspectral image classification method and device based on sample expansion and space-spectrum attention mechanism and medium
The small-sample hyperspectral image classification method based on sample expansion and spatial-spectral attention mechanism solves the problem of insufficient samples in hyperspectral image classification, improves the classification accuracy and generalization ability of the model, and is suitable for applications such as agricultural remote sensing and ecological monitoring.
Patent Information
- Application Number
- CN202510814842.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-18
- Publication Date
- 2025-09-12
AI Technical Summary
There is a problem of insufficient samples in hyperspectral image classification, which leads to model overfitting and decreased generalization ability. Existing technologies find it difficult to effectively improve sample diversity and spatial-spectral joint feature expression capabilities without relying on external large-scale data support.
A small-sample hyperspectral image classification method based on sample expansion and spatial-spectral attention mechanism is adopted. New training samples are generated through the spectral similarity adaptive enhancement module, and multi-scale features are extracted by combining the spectral and spatial attention modules to construct an adaptive classification model.
Under limited sample conditions, the classification accuracy and generalization ability of the model are significantly improved, making it suitable for hyperspectral image processing scenarios such as agricultural remote sensing and ecological monitoring.
Smart Images

Figure CN120635586A_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the technical field of computer vision and hyperspectral image processing. Background Art
[0002] Hyperspectral imagery fuses spatial and spectral information, recording the reflectance characteristics of target objects at different wavelengths across multiple continuous bands. Its high-dimensional and fine-grained nature makes it widely used in agricultural monitoring, ecological and environmental assessments, and natural disaster warnings. Its high spectral resolution allows for precise identification of compositional differences between different objects or materials.
[0003] However, in practical applications, the labeling process for hyperspectral images is complex and costly, and manually obtaining labeled samples is time-consuming and labor-intensive, resulting in a limited number of available labeled samples. The small sample size problem has become a core bottleneck restricting the performance of hyperspectral image classification. With the widespread application of deep learning in remote sensing scenarios, despite the models' strong feature learning capabilities, they are prone to overfitting and reduced generalization ability when insufficient samples are available, seriously affecting classification accuracy and model practicality. Summary of the Invention
[0004] This application aims to solve the problem of insufficient samples in hyperspectral image classification, and now provides a small sample hyperspectral image classification method, device and medium based on sample expansion and spatial-spectral attention mechanism.
[0005] The first aspect of the present application provides a small sample hyperspectral image classification method based on sample expansion and spatial-spectral attention mechanism, comprising:
[0006] The spectral features are extracted from the hyperspectral image using the spectral attention module, and the feature blocks of the enhanced spectral features are obtained. The spatial attention module is used to calculate the spatial-spectral joint features based on the feature blocks of the enhanced spectral features. The spatial-spectral joint features are input into the classifier to realize the classification of the hyperspectral image.
[0007] In one possible design, the spectral attention module is used to extract spectral features from the hyperspectral image and obtain a feature block that enhances the spectral features, including:
[0008] The spectral attention module includes a global feature extraction branch and a spectral feature extraction branch; the spectral feature extraction branch sequentially subjects the hyperspectral image to global average pooling, a first fully connected network, a ReLU activation function, a second fully connected network, and a Sigmoid activation function to obtain a spectral attention weight; the global feature extraction branch includes three layers of two-dimensional convolutional layers connected in series, and each two-dimensional convolutional layer sequentially subjects the hyperspectral image to convolution processing, batch normalization processing, and a ReLU activation function to obtain a global attention weight; the product of the hyperspectral image, the global attention weight, and the spectral attention weight is added to the hyperspectral image to obtain a feature block with enhanced spectral features.
[0009] In one possible design, the spatial attention module is used to calculate the spatial-spectral joint feature based on the feature block of the enhanced spectral feature, including:
[0010] The spatial attention weights in the width and height directions are calculated for the feature block of the enhanced spectral feature respectively; the spatial attention weights in the width and height directions are multiplied with the feature block of the enhanced spectral feature to obtain the spatial-spectral joint feature.
[0011] In one possible design, respectively calculating the width and height direction spatial attention weights for the feature block of the enhanced spectral feature along its width and height directions includes:
[0012] The feature blocks of the enhanced spectral features are sequentially subjected to mLSTM processing, average pooling processing in the width direction, one-dimensional convolution processing, group normalization processing and Sigmoid activation function processing to obtain the width direction spatial attention weight; the feature blocks of the enhanced spectral features are sequentially subjected to mLSTM processing, average pooling processing in the height direction, one-dimensional convolution processing, group normalization processing and Sigmoid activation function processing to obtain the height direction spatial attention weight.
[0013] In one possible design, the classifier training method includes:
[0014] An initial training set is constructed using a small sample of hyperspectral images with labeled pixel features; the samples in the training set are enhanced to enhance the features of the samples, and the samples with enhanced features are merged with the initial samples to form an enhanced training set; a spectral attention module is used to extract spectral features from the samples in the enhanced training set, and feature blocks of enhanced spectral features are obtained; a spatial attention module is used to calculate spatial-spectral joint features based on the feature blocks of the enhanced spectral features; the spatial-spectral joint features are used as input to a classifier to train the classifier.
[0015] In a possible design, the initial training set is constructed using a small sample of hyperspectral images with labeled pixel features, including:
[0016] The small sample hyperspectral image with pixel features marked is represented as three-dimensional cube data, wherein the three dimensions of the three-dimensional cube data are the height, width and number of bands of the small sample hyperspectral image; the three-dimensional cube data is divided into several dimensions of to obtain a plurality of cubic sub-blocks; and processing the plurality of cubic sub-blocks to obtain an initial training set, wherein the processing includes one or more of standardization and normalization.
[0017] In one possible design, performing enhancement processing on the samples in the training set to enhance the features of the samples, and merging the samples with enhanced features and the initial samples into an enhanced training set includes:
[0018] Calculate the sum of the Euclidean distances between the central pixel of each cube sub-block and its neighboring pixels in all spectral channels ; The sum of the mean and standard deviation of the sum of the Euclidean distances is used as the threshold ;when When , the Euclidean distance inverse weighting mechanism is used to enhance the neighboring pixels. When the number of neighbors is less than 1, a random perturbation method is used to perform disturbance enhancement on the neighborhood pixels; the weighting factor of each neighborhood pixel under each enhancement method is calculated, and the weighting factors of all neighborhood pixels are normalized to obtain the normalized weights of the neighborhood pixels; the center pixel is enhanced using the normalized weights of the neighborhood pixels to complete the enhancement processing of the sample.
[0019] In one possible design, enhancing the central pixel by using the normalized weights of the neighborhood pixels includes:
[0020] The spectral differences between the neighborhood pixels and the central pixel are weighted and summed, and the expression is as follows:
[0021] ,
[0022] in, is the enhanced center pixel value, is the center pixel value, is the normalized weight of the neighborhood pixels, Neighborhood pixels The spectral value of is the set of neighborhood pixels.
[0023] A second aspect of the present application provides a small-sample hyperspectral image classification device based on sample augmentation and spatial-spectral attention mechanism. The small-sample hyperspectral image classification device based on sample augmentation and spatial-spectral attention mechanism includes a processor and a memory. The memory stores at least one instruction, and the at least one instruction is loaded and executed by the processor to implement the small-sample hyperspectral image classification method based on sample augmentation and spatial-spectral attention mechanism as described above.
[0024] A third aspect of the present application provides a computer storage medium, characterized in that at least one instruction is stored in the computer storage medium, and the at least one instruction is loaded and executed by a processor to implement the small sample hyperspectral image classification method based on sample expansion and spatial-spectral attention mechanism as described above.
[0025] Beneficial effects of this application:
[0026] This application expands the distribution diversity of training samples and enhances the generalization ability of the model by constructing an adaptive sample enhancement module without relying on additional large-scale unlabeled data. At the same time, by combining the spectral attention mechanism and the spatial attention mechanism, multi-scale feature modeling is performed on the input data to improve the model's response to key spectral information and spatial structure. The method proposed in this application is suitable for small sample classification tasks of hyperspectral images. It can effectively improve classification accuracy under conditions of limited training samples and is suitable for various hyperspectral image processing scenarios such as agricultural remote sensing, ecological monitoring, and target recognition. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] Figure 1 This is a flowchart of the small-sample hyperspectral image classification method based on sample expansion and spatial-spectral attention mechanism described in the first embodiment.
[0028] Figure 2 Figure 2 is the structural diagram of the sample enhancement module based on spectral similarity.
[0029] Figure 3 This is the structural diagram of the spectral attention module.
[0030] Figure 4 This is the structural diagram of the spatial attention module.
[0031] Figure 5 This is a diagram of the overall model architecture of the small-sample hyperspectral image classification method based on sample expansion and spatial spectral attention mechanism described in the first specific implementation method. DETAILED DESCRIPTION
[0032] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application. It should be noted that, in the absence of conflict, the embodiments in the present application and the features in the embodiments can be combined with each other.
[0033] To address the small sample size problem encountered in hyperspectral image classification, previous studies have proposed data augmentation methods based on generative models, such as generative adversarial networks and variational autoencoders. These methods generate new samples by learning from the initial data distribution to increase the size of the training set and improve model robustness. However, these methods generally rely on large-scale unlabeled samples or pre-trained models. Their training stability and generation quality are limited by the abundance of prior data, making them difficult to apply in resource-constrained scenarios and their generalization effect is limited.
[0034] On the other hand, the high-dimensional feature structure of hyperspectral images also poses a challenge to the model's feature extraction capabilities. To improve the model's discriminative performance, some studies have introduced spatial and spectral attention mechanisms, attempting to enhance classification-related information from different dimensions. Spatial attention is used to extract spatial regions associated with the target category, while spectral attention aims to highlight key band features. However, most existing attention mechanisms operate independently in the spatial or spectral domain, making it difficult to model high-order interactions between the two. This is particularly true when samples are limited and high-dimensional and sparse, resulting in insufficient feature learning capabilities.
[0035] Therefore, when dealing with small-sample hyperspectral image classification tasks, existing technologies still face problems such as strong dependence on sample generation and weak expression ability of attention mechanism. There is an urgent need for a new method that can effectively improve sample diversity and spatial-spectral joint feature expression capabilities without relying on external big data support.
[0036] In view of this, the embodiment of the present application provides a small sample hyperspectral image classification method based on sample expansion and spatial-spectral attention mechanism to solve the above problems. Figures 1 to 5 , the scheme of the implementation method of this application is described in detail.
[0037] Specific implementation method 1: refer to Figure 1 Specifically describe this embodiment. Figure 1 This paper provides a small sample hyperspectral image classification method based on sample expansion and spatial-spectral attention mechanism, including S1 to S5. The numbering of each step does not necessarily limit the order of their execution. The following is a detailed description of each step:
[0038] A small-sample hyperspectral image classification method based on sample expansion and spatial-spectral attention mechanism includes the following steps:
[0039] S1: Obtain a small sample of hyperspectral images with labeled pixel features. Extract pixels from the small sample of hyperspectral images to form a dataset. Preprocess the dataset, including normalization and slicing. Then, divide the data into training, validation, and test sets for subsequent modeling and evaluation.
[0040] The details are as follows:
[0041] Obtain a small sample of hyperspectral images with labeled pixel features and represent them as 3D cube data ,in 、 and Represent the height, width and number of bands of the small sample hyperspectral image respectively. In order to enhance the model’s ability to perceive local structural information, the three-dimensional cube data The height and width planes are divided into several sizes: Subgraphs, each subgraph corresponds to a cube block As a local sample unit, it is used for subsequent training and enhancement processing.
[0042] Afterwards, the small sample hyperspectral images undergo one or more of the following processing operations: standardization and normalization to eliminate the impact of scale differences between bands on model training. The processed data is then divided into training, validation, and test sets according to preset ratios, which are used for model training, parameter tuning, and performance evaluation, respectively.
[0043] S2: The training set is fed into the spectral similarity-based sample augmentation module for augmentation. This module adaptively assigns perturbation weights based on the spectral similarity between the center pixel and its neighboring pixels to enhance the representation of boundaries or low-sample areas, thereby generating new augmented samples. The augmented samples are then fused with samples from the training set to construct the expanded training set.
[0044] The details are as follows:
[0045] This implementation introduces a spectrally guided sample enhancement strategy for small-sample hyperspectral image classification tasks. This strategy aims to adaptively expand training samples by modeling local spectral similarity structures, without requiring external large-scale data support, and improve the model's ability to discriminate in boundary regions. Unlike existing image enhancement methods such as random noise addition and rotation, this enhancement strategy leverages the inherent characteristics of hyperspectral images: the consistency and local variation of spectral distribution within a spatial neighborhood.
[0046] For each cube sub-block The central pixel of the cube is predefined as a fixed-size neighborhood, and the sum of the Euclidean distances between the central pixel of each cube sub-block and its neighboring pixels in all spectral channels is calculated. , which is used to measure the spectral similarity between the central pixel and the neighboring pixels.
[0047] The sum of the Euclidean distances of all spectral channels The expression is:
[0048] ,
[0049] in, is the neighborhood pixel set, Neighborhood pixels No. spectral channel values, is the spectral channel value of the center pixel, is the number of spectral channels.
[0050] In order to effectively distinguish whether the neighborhood pixels are in the boundary or non-boundary area, the sum of the Euclidean distances of all spectral channels is used. Average value and standard deviation To determine the threshold , and then according to Adaptively assign weighting factors.
[0051] The threshold The expression is as follows:
[0052] .
[0053] like , then determine the pixel In the boundary area, the inverse Euclidean distance weighting mechanism is used to perturb and enhance the neighboring pixels to strengthen their boundary feature expression. The calculation is as follows:
[0054] ,
[0055] in, Pixels The Euclidean distance to the center pixel, A constant to prevent division by zero.
[0056] like , then determine the pixel In the non-boundary area, random perturbation is used to enhance the neighboring pixels to increase data diversity. The weighting factor at this time is The calculation is as follows:
[0057] .
[0058] Then, all weighting factors are normalized to ensure numerical stability:
[0059] ,
[0060] in, Pixels The weight of is the normalized weight of the neighborhood pixels, when ,but is the normalized Euclidean distance weight, when ,but is the normalized random weight, The first The weight of the pixels.
[0061] Then, using the normalized weighting factor The central pixel value is enhanced by weighted summing of the spectral differences between the neighboring pixels and the central pixel, and finally the enhanced sample is obtained.
[0062] ,
[0063] in, is the center pixel value, is the spectral value of the neighborhood pixel, is the center pixel value after enhancement.
[0064] Finally, the generated enhanced samples are merged with the training samples to form an extended training set for subsequent feature extraction and classification tasks.
[0065] S3: After the training set is expanded, a spectral attention module is introduced to enhance the model's responsiveness to key spectral channels and improve its ability to discriminate features in the spectral dimension. The spectral attention mechanism module consists of a global feature extraction branch and a spectral feature extraction branch. The two branches work together. The global branch extracts channel-dependent information through pooling and full connectivity, while the spectral branch extracts local spectral features through convolution. The spectral branch then fuses these branches to generate an enhanced spectral feature representation.
[0066] The details are as follows:
[0067] In the spectral feature extraction branch, the samples in the extended training set are pooled by global average pooling. Perform dimensionality reduction on the channel dimension to obtain channel-level statistical features. Then, pass through two layers of full connection The network and ReLU activation function perform nonlinear feature transformation, and finally the spectral attention weight is calculated through the Sigmoid activation function. , the calculation formula is as follows:
[0068] ,
[0069] in, represents the global average pooling operation, Represents the Sigmoid activation function.
[0070] In the global feature extraction branch, the sample Pass through three layers of two-dimensional convolutional layers in sequence , each layer is equipped with batch normalization With the ReLU activation function, we can gradually extract the local patterns and nonlinear relationships in the spectral dimension and obtain the global attention weight. .
[0071] The corresponding intermediate processing formula is:
[0072] ,
[0073] ,
[0074] .
[0075] Finally, Sigmoid activation is used to generate the final global attention weight. , global attention weight and samples Perform element-wise multiplication to adjust the samples The weight distribution of Add together to get the feature block with enhanced spectral features , and used for subsequent model training.
[0076] .
[0077] S4: Feature blocks that will enhance spectral features The input is sent to the spatial attention module. This module combines average pooling, one-dimensional convolution, group normalization, and Sigmoid activation function to calculate spatial position weights. At the same time, it introduces mLSTM units to capture long-range spatial dependencies, and finally achieves spatial feature enhancement through weight adjustment.
[0078] The details are as follows:
[0079] Output of the spectral attention module It is processed by mLSTM module and then Average pooling is performed along both width and height to extract global spatial features, and one-dimensional convolution is used for feature enhancement. Subsequently, group normalization and sigmoid activation functions are applied in each direction to calculate position weights, thereby adjusting the feature representation of different regions.
[0080] The calculation process along the width direction is:
[0081] First process it through mLSTM , then perform average pooling in the width direction, and then apply one-dimensional convolution, group normalization and Sigmoid activation function to calculate the width direction spatial attention weight :
[0082] ,
[0083] ,
[0084] in, represents mLSTM processing, represents the average pooling process in the width direction, It represents convolution processing, Indicates group normalization processing.
[0085] The calculation process along the height direction is:
[0086] First process it through mLSTM , then perform average pooling in the height direction, and then apply one-dimensional convolution, group normalization and Sigmoid activation function to calculate the height direction spatial attention weight :
[0087] ,
[0088] .
[0089] Finally, the calculated weight and and Perform element-by-element multiplication to generate the space-spectrum joint feature , and used for subsequent model training.
[0090] .
[0091] S5: Combine the empty spectrum features Input the classifier to make category predictions. The classifier can use a fully connected network structure and perform iterative optimization using the cross entropy loss function to obtain the final classification model.
[0092] The details are as follows:
[0093] The spatial-spectral joint features processed by the spectral attention module and the spatial attention module are As input, it is sent to the classifier composed of a fully connected layer, which calculates the probability distribution of each pixel to each category based on the Softmax function and outputs its corresponding predicted category.
[0094] The cross-entropy loss function is used to calculate the error between the predicted results and the true labels of the training set, and backpropagation is used for iterative optimization. The training process continues until the loss value is less than a set threshold or the maximum number of iterations is reached. Finally, the stable model weight parameters are recorded.
[0095] After the model training is completed, the test set is input into the trained model for inference prediction, the predicted category of each pixel is obtained, and it is compared with the true label to evaluate the classification accuracy of the model on the test set.
[0096] The entire hyperspectral image is fed into the final trained model for classification prediction, all pixel prediction results are spliced according to position, and finally the final visualization image is obtained according to the classification prediction results.
[0097] This embodiment provides a small-sample hyperspectral image classification method based on sample augmentation and spatial-spectral attention mechanisms. By introducing a sample augmentation strategy based on spectral similarity, it effectively improves the diversity and boundary sensitivity of training samples. A spectral attention module is used to achieve global-local feature fusion in the channel dimension, avoiding the loss of key band information. Combined with a spatial attention module, the model's ability to model long-range spatial structures is enhanced. These modules work together to significantly improve the model's accuracy, robustness, and generalization in small-sample hyperspectral image classification tasks.
[0098] Specific embodiment 2: The small sample hyperspectral image classification device based on sample expansion and spatial-spectral attention mechanism described in this embodiment includes a processor and a memory, and the memory stores at least one instruction. The at least one instruction is loaded and executed by the processor to implement the small sample hyperspectral image classification method based on sample expansion and spatial-spectral attention mechanism as described in specific embodiment 1.
[0099] Specific embodiment three: A computer storage medium described in this embodiment stores at least one instruction, and the at least one instruction is loaded and executed by a processor to implement the small sample hyperspectral image classification method based on sample expansion and spatial-spectral attention mechanism as described in specific embodiment one.
[0100] Although the present application is described herein with reference to specific embodiments, it should be understood that these embodiments are merely illustrative of the principles and applications of the present application. It should therefore be understood that many modifications may be made to the illustrative embodiments, and that other arrangements may be devised, without departing from the spirit and scope of the present application as defined by the appended claims. It should be understood that the various dependent claims and features described herein may be combined in ways other than those described in the initial claims. It should also be understood that features described in conjunction with individual embodiments may be used in other described embodiments.
Claims
1. A small sample hyperspectral image classification method based on sample expansion and spatial-spectral attention mechanism, characterized by: include: The spectral attention module is used to extract spectral features in hyperspectral images and obtain feature blocks that enhance spectral features; Utilizing a spatial attention module to calculate a spatial-spectral joint feature based on the feature blocks of the enhanced spectral features; The spatial-spectral joint features are input into a classifier to achieve classification of the hyperspectral image.
2. The small sample hyperspectral image classification method based on sample expansion and spatial-spectral attention mechanism according to claim 1 is characterized in that: The method of extracting spectral features from a hyperspectral image using a spectral attention module and obtaining a feature block that enhances the spectral features includes: The spectral attention module includes a global feature extraction branch and a spectral feature extraction branch; The spectral feature extraction branch sequentially processes the hyperspectral image through global average pooling, a first fully connected network, a ReLU activation function, a second fully connected network, and a Sigmoid activation function to obtain the spectral attention weight; The global feature extraction branch includes three layers of two-dimensional convolutional layers connected in series, and each layer of two-dimensional convolutional layer performs convolution processing, batch normalization processing and ReLU activation function on the hyperspectral image in sequence to obtain global attention weights; The product of the hyperspectral image, the global attention weight and the spectral attention weight is added to the hyperspectral image to obtain a feature block with enhanced spectral features.
3. The small sample hyperspectral image classification method based on sample expansion and spatial-spectral attention mechanism according to claim 1 is characterized in that The calculating of the spatial-spectral joint feature using the spatial attention module according to the feature block of the enhanced spectral feature includes: Calculating the spatial attention weights in width and height directions for the feature block of the enhanced spectral feature along its width and height directions respectively; The spatial attention weights in the width and height directions and the feature blocks of the enhanced spectral features are multiplied to obtain the spatial-spectral joint features.
4. The small sample hyperspectral image classification method based on sample expansion and spatial-spectral attention mechanism according to claim 3 is characterized in that The calculating of the width and height direction spatial attention weights of the feature block of the enhanced spectral feature along its width and height directions respectively includes: The feature blocks of the enhanced spectral features are sequentially subjected to mLSTM processing, width-wise average pooling processing, one-dimensional convolution processing, group normalization processing, and Sigmoid activation function processing to obtain width-wise spatial attention weights; The feature blocks of the enhanced spectral features are sequentially subjected to mLSTM processing, height-direction average pooling processing, one-dimensional convolution processing, group normalization processing, and Sigmoid activation function processing to obtain the height-direction spatial attention weight.
5. The small sample hyperspectral image classification method based on sample expansion and spatial-spectral attention mechanism according to claim 1 is characterized in that The training method of the classifier includes: Construct an initial training set using a small sample of hyperspectral images with labeled pixel features; Performing enhancement processing on the samples in the training set to enhance the features of the samples, and merging the samples with enhanced features and the initial samples into an enhanced training set; The spectral attention module is used to extract spectral features from samples in the enhanced training set and obtain feature blocks of enhanced spectral features; Utilizing a spatial attention module to calculate a spatial-spectral joint feature based on the feature blocks of the enhanced spectral features; The spatial-spectral joint features are used as input of a classifier, and the classifier is then trained.
6. The small sample hyperspectral image classification method based on sample expansion and spatial-spectral attention mechanism according to claim 5 is characterized in that The initial training set is constructed using a small sample of hyperspectral images with labeled pixel features, including: Representing the small sample hyperspectral image with pixel features marked as three-dimensional cube data, wherein the three dimensions of the three-dimensional cube data are the height, width and number of bands of the small sample hyperspectral image respectively; The three-dimensional cube data is divided into several dimensions in the height and width planes. Subgraph of, obtain multiple cube sub-blocks; The plurality of cube sub-blocks are processed to obtain an initial training set, wherein the processing includes one or more of standardization and normalization.
7. The small sample hyperspectral image classification method based on sample expansion and spatial-spectral attention mechanism according to claim 6 is characterized in that The enhancing process is performed on the samples in the training set to enhance the features of the samples, and the samples with enhanced features are combined with the initial samples to form an enhanced training set, including: Calculate the sum of the Euclidean distances between the central pixel of each cube sub-block and its neighboring pixels in all spectral channels ; The sum of the mean and standard deviation of the sum of the Euclidean distances is used as the threshold ; when When , the inverse Euclidean distance weighting mechanism is used to perturb and enhance the neighborhood pixels. when When , random perturbation is used to enhance the neighboring pixels; Calculate the weighted factors of each neighborhood pixel under each enhancement method, and normalize the weighted factors of all neighborhood pixels to obtain the normalized weights of the neighborhood pixels; The center pixel is enhanced using the normalized weights of the neighborhood pixels to complete the enhancement processing of the sample.
8. The small sample hyperspectral image classification method based on sample expansion and spatial-spectral attention mechanism according to claim 7 is characterized in that: The enhancing the central pixel by using the normalized weights of the neighborhood pixels includes: The spectral differences between the neighborhood pixels and the central pixel are weighted and summed, and the expression is as follows: , in, is the center pixel value after enhancement, is the center pixel value, is the normalized weight of the neighborhood pixels, Neighborhood pixels The spectral value of is the set of neighborhood pixels.
9. A small sample size hyperspectral image classification device based on sample expansion and spatial-spectral attention mechanism, characterized in that: The small-sample hyperspectral image classification device based on sample augmentation and spatial-spectral attention mechanism includes a processor and a memory, wherein the memory stores at least one instruction, and the at least one instruction is loaded and executed by the processor to implement the small-sample hyperspectral image classification method based on sample augmentation and spatial-spectral attention mechanism according to one of claims 1 to 8.
10. A computer storage medium, characterized in that The computer storage medium stores at least one instruction, which is loaded and executed by the processor to implement the small-sample hyperspectral image classification method based on sample expansion and spatial-spectral attention mechanism as described in any one of claims 1 to 8.
Citation Information
Cited By
Hyperspectral image sparse small target data enhancement and background fusion method
CN122116037A
