Hyperspectral image classification method, system, equipment and medium
By using a dual-branch, multi-level spectral spatial feature fusion network, the problems of low utilization of spectral information and insufficient feature fusion in hyperspectral image classification are solved, achieving efficient collaborative modeling of spectral and spatial features, and improving classification accuracy and robustness.
Patent Information
- Application Number
- CN202511795142.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-02
- Publication Date
- 2026-03-06
AI Technical Summary
Existing hyperspectral image classification methods suffer from low utilization of spectral information, underutilization of the intrinsic correlation between spectrum and space, and inability of feature fusion methods to effectively integrate the potential correlation between spectral and spatial features, resulting in information interference and insufficient classification accuracy.
A dual-branch, multi-level spectral spatial feature fusion network is adopted. Multi-scale spectral features are extracted through convolutional kernels with multiple receptive fields, and weighted fusion is achieved by channel attention mechanism. Spectral feature interaction is carried out by combining local block attention and inter-block attention mechanisms. Sliding windows of different sizes are used to capture spatial features. Finally, deep weighted fusion of spectral and spatial features is achieved through cross-attention recalibration.
It improves the classification accuracy and robustness of hyperspectral image classification in complex scenarios, enhances local-global feature representation and multi-scale information integration, and dynamically balances spectral-spatial correlation, significantly improving the model's ability to distinguish complex ground features.
Smart Images

Figure CN121616962A_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of hyperspectral image processing technology. Background Technology
[0002] With the rapid development and widespread application of remote sensing technology, hyperspectral image classification, as a key component, has demonstrated enormous application potential. The core advantage of hyperspectral images lies in their rich spectral information: each object exhibits unique reflection and absorption characteristics at different wavelengths, forming a distinct "spectral fingerprint." In recent years, hyperspectral image classification has provided strong technical support for the development of fields such as agricultural and ecological monitoring, natural resource management, and disaster monitoring and emergency response, thereby promoting progress in precise monitoring, data analysis, and informed decision-making across various industries.
[0003] Currently, to jointly capture global dependencies and local spatial details, the local feature extraction of CNNs is integrated with the spectral sequence modeling capabilities of Transformers. To achieve pixel-level spectral spatial feature interaction, a local encoder is further embedded in the Transformer architecture. Considering the importance of multi-scale feature representation, spatial multi-scale features are integrated with global spectral representation. To further explore the intrinsic relationships between dimensions, a Swin transform is introduced, sliding one-dimensionally along the spatial-spectral dimension from two angles to learn local and hierarchical spatial-spectral relationships, thereby fully utilizing the dependencies between spatial-spectral features. However, these methods still have significant limitations in handling noise. To address this, a multi-head differential attention mechanism is introduced, eliminating interfering noise within spectral spatial feature blocks through differential feature extraction and redundancy information suppression. Nevertheless, the global attention mechanism in Transformers still struggles to achieve an effective balance between enhancing local details and suppressing noise. Furthermore, it is insensitive to local spectral changes and lacks sufficient joint modeling of local spectral spatial details and global correlations. Summary of the Invention
[0004] This application aims to address the problems of low utilization of spectral information, underutilization of the intrinsic correlation between spectrum and space, and the inability of existing feature fusion methods to effectively integrate the potential correlation between spectral and spatial features, thus causing information interference. It provides a hyperspectral image classification method based on a dual-branch multi-level spectral and spatial feature fusion attention network, which aims to achieve efficient collaborative modeling of spectral and spatial features and improve classification accuracy and robustness in complex scenes.
[0005] The first aspect of this application provides a hyperspectral image classification method, including:
[0006] Multi-scale spectral features of the hyperspectral image to be classified are extracted in parallel by using multiple convolutional kernels with different receptive fields, and the multi-scale spectral features are weighted and fused using a channel attention mechanism.
[0007] The weighted fused spectral features are divided into multiple sub-blocks along the spectral depth. A local block attention mechanism is applied within each sub-block, and an inter-block attention mechanism is applied between adjacent blocks. Then, the inter-block features are dynamically fused to realize information interaction between sub-blocks and obtain spectral features.
[0008] Three convolutional kernels of different sizes are used to extract multi-scale shallow spatial features from the weighted fused spectral features, and then sliding windows of different sizes are used to capture global spatial features.
[0009] Cross-attention recalibration is performed on the spectral features and the global spatial features. A fusion strategy is used to integrate the spectral features and the global spatial features to generate fusion weights. The fusion weights are then used to perform deep weighted fusion of the calibrated spectral features and the global spatial features to obtain fused features.
[0010] The fused features are subjected to global average pooling, and class prediction is achieved through a fully connected layer and a Softmax classifier.
[0011] In one possible design, the weighted fusion of the multi-scale spectral features using a channel attention mechanism includes:
[0012] The multi-scale spectral features are stitched together along the channel dimension;
[0013] Channel weights are generated using a 1×1×1 convolution;
[0014] The channel weights are processed using the ReLU function and another 1×1×1 convolution to reduce the channel dimension;
[0015] Apply the Sigmoid activation function to generate normalized attention weights;
[0016] The spliced spectral features are multiplied element by element with the attention weights output by the Sigmoid activation function to achieve weighted fusion of the multi-scale spectral features.
[0017] In one possible design, the application of a local block attention mechanism within each sub-block includes:
[0018] The local block attention mechanism is implemented using the following formula:
[0019] ,
[0020] in, Indicates the first Local block attention output for each sub-block. For learnable projection weights, Represents convolution. , and They represent the first Queries, keys, and values for local block attention within each sub-block.
[0021] In one possible design, the application of the inter-block attention mechanism between adjacent blocks includes:
[0022] The inter-block attention mechanism is implemented using the following formula:
[0023] ,
[0024] ,
[0025]
[0026] in, Inter-block attention weight and They are respectively with the first The keys and values of adjacent blocks of each sub-block. For the first Inter-block attention output for each sub-block For the first Attention output after a sub-block is merged with its neighboring blocks.
[0027] In one possible design, the use of sliding windows of different sizes to capture global spatial features includes:
[0028] The sliding window strategy is used to group multi-scale shallow spatial features along the channel dimension, and the sliding window size is increased in stages to capture global spatial features.
[0029] In one possible design, the integration of the spectral features and the global spatial features using a fusion strategy to generate fusion weights includes:
[0030] The fusion weights are generated using the following formula:
[0031] ,
[0032] in, To integrate weights, and These are spectral features and global spatial features, respectively. The fusion coefficient is... Indicates a fully connected layer. Global average pooling.
[0033] In one possible design, the deep weighted fusion of the calibrated spectral features and global spatial features using the fusion weights to obtain fused features includes:
[0034] The fusion features are obtained using the following formula:
[0035]
[0036] in, As a feature of fusion, and These are the calibrated spectral features and global spatial features, respectively. Represents a 1×1 convolution. Indicates splicing.
[0037] The second aspect of this application provides a hyperspectral image classification system, including:
[0038] The pyramid cross-scale attention module is used to extract multi-scale spectral features of the hyperspectral image to be classified in parallel through multiple convolutional kernels with different receptive fields, and to perform weighted fusion of the multi-scale spectral features using a channel attention mechanism.
[0039] The grouped cross-block interactive self-attention branch is used to divide the weighted fused spectral features into multiple sub-blocks along the spectral depth. A local block attention mechanism is applied within each sub-block, and an inter-block attention mechanism is applied between adjacent blocks. Then, the inter-block features are dynamically fused to realize information interaction between sub-blocks and obtain spectral features.
[0040] The multi-layer sliding window spatial feature enhancement branch is used to extract multi-scale shallow spatial features from the weighted fused spectral features using three convolutional kernels of different sizes, and then captures multi-scale spatial features using sliding windows of different sizes.
[0041] A fast deep fusion module is used to perform cross-attention recalibration on the spectral features and the spatial features, integrate the spectral features and the spatial features using a fusion strategy to generate fusion weights, and use the fusion weights to perform deep weighted fusion on the calibrated spectral features and the spatial features to obtain fused features;
[0042] The prediction module is used to perform global average pooling on the fused features and to achieve category prediction through a fully connected layer and a Softmax classifier.
[0043] A third aspect of this application provides a hyperspectral image classification device, the hyperspectral image classification device including a processor and a memory, the memory storing at least one instruction, the at least one instruction being loaded and executed by the processor to implement the hyperspectral image classification method as described above.
[0044] A fourth aspect of this application provides a computer storage medium storing at least one instruction, which is loaded and executed by a processor to implement the hyperspectral image classification method described above.
[0045] The beneficial effects of this application are:
[0046] To simultaneously enhance local-global feature representation, multi-scale information integration, and dynamic spectral-spatial correlation trade-offs, this application proposes a dual-branch, multi-level spectral spatial feature fusion network. This network fully leverages the advantages of CNNs in extracting local features and the ability of Transformers to capture long-range correlations, combining the two to extract multi-level spatial features and globally correlated local spectral information. By integrating local-global context modeling, multi-scale feature aggregation, and a dynamic spectral-spatial attention mechanism, it effectively improves the model's ability to discriminate complex ground features, demonstrating significant technological advancements and application value. Attached Figure Description
[0047] Figure 1 This is a flowchart of a hyperspectral image classification method based on a dual-branch, multi-level spectral spatial feature fusion attention network;
[0048] Figure 2 A diagram of the architecture model for hyperspectral image classification;
[0049] Figure 3 A schematic diagram of the pyramid-shaped cross-scale attention module;
[0050] Figure 4 A schematic diagram of cross-block interactive self-attention branches for grouping;
[0051] Figure 5 This is a schematic diagram of a multi-layer sliding window spatial feature enhancement branch, where (a) represents the shallow spatial feature extraction module and (b) represents the Swing block;
[0052] Figure 6 The diagram shows the fast deep fusion module, where (a) represents the overall structure of the fast deep fusion module and (b) represents the depth perception weighting module. Detailed Implementation
[0053] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application. It should be noted that, unless otherwise specified, the embodiments and features in the embodiments of this application can be combined with each other.
[0054] Specific implementation method one: Refer to Figures 1 to 6 This embodiment specifically describes the hyperspectral image classification method, which includes:
[0055] S1: Obtain hyperspectral images and use them to divide the dataset into training, validation, and test sets. Specifically, this includes:
[0056] First, a hyperspectral image dataset needs to be acquired, either from publicly available resources such as Pavia University and Houston 2013 or through custom acquisition. Ensure the data undergoes necessary preprocessing, such as radiometric and atmospheric correction, and is converted to a format suitable for analysis. Next, the data in the hyperspectral image dataset is labeled based on land cover categories, ensuring that each pixel in the hyperspectral image data corresponds to a specific land cover category. Then, a stratified sampling method is used to divide the hyperspectral image dataset into training, validation, and test sets, ensuring that the proportion of each category within each subset is consistent with the original data. This process provides a solid data foundation for subsequent model training, validation, and testing.
[0057] S2: Construct a pyramid-shaped cross-scale attention module, which extracts multi-scale spectral features from hyperspectral images in parallel using convolutional kernels with multiple receptive fields, and outputs weighted fused features using a channel attention mechanism. Specifically, this includes:
[0058] A pyramid-shaped cross-scale attention module is constructed, employing four convolutional kernels with different receptive fields (1×1×3, 1×1×7, 1×1×11, and 1×1×15) along the spectral dimension to capture spectral features at multiple scales in hyperspectral images and extract spectral information from different spectral resolutions. Each convolution operation is followed by BatchNorm3D and ReLU6 activation functions to ensure training stability and improve nonlinear representation capabilities. The obtained multi-scale spectral features are concatenated along the channel dimension and channel weights are generated through a 1×1×1 convolution. Channel weights are processed using a ReLU function (including REU activation and BatchNorm3D) and another 1×1×1 convolution to reduce channel dimensionality. A Sigmoid activation function is applied to generate normalized attention weights. The concatenated features along the channel dimension are then multiplied element-wise with the attention weights output by the Sigmoid activation function to achieve weighted fusion.
[0059] The pyramid cross-scale attention module can adaptively focus on the features with the most information while suppressing redundant information, thereby enhancing its ability to classify complex images.
[0060] S3: Constructing a grouped cross-block interactive self-attention branch uses the output of the pyramid cross-scale attention module as its input. The grouped cross-block interactive self-attention branch divides the input spectral features along the spectral depth into... Each sub-block is assigned a local block attention mechanism, and information exchange between sub-blocks is achieved through cross-block dynamic fusion and cross-block attention. This dynamic inter-block fusion adaptively adjusts the feature weights between adjacent blocks to achieve finer-grained extraction of global spectral information. Specifically, this includes:
[0061] First, input spectral features Along spectral depth Divided into Each sub-block. This process can be represented mathematically as:
[0062] ,
[0063] in, , The depth of each sub-block, For batch size, For the number of channels, and These represent the height and width of the feature map, respectively. Indicates the first A small block, .
[0064] Applying local block attention within each sub-block is represented as follows:
[0065] ,
[0066] in, Indicates the first Local block attention output for each sub-block. For learnable projection weights, Represents convolution. , and They represent the first Queries, keys, and values for local block attention within each sub-block.
[0067] Intra-block local attention mechanisms construct self-attention relationships within the divided spectral sub-blocks, fully capturing local spectral correlations within the sub-blocks and enhancing the model's ability to perceive fine spectral patterns. However, this mechanism is limited to within sub-blocks and struggles to model long-distance spectral dependencies across sub-blocks, resulting in a representation bottleneck when dealing with complex land features with wide spectral bands and multi-peak distributions. Furthermore, local attention under fixed partitioning easily leads to information silos, limiting the integration of global context. To effectively address these shortcomings, an inter-block attention mechanism is introduced, comprising two parts: dynamic block fusion and cross-block attention. The inter-block attention mechanism adaptively adjusts the inter-block feature weights by calculating the similarity between adjacent spectral sub-blocks, achieving selective fusion of cross-block information. Its dynamic weighting strategy can highlight key spectral response regions, suppress interference from redundant or noisy bands, and significantly improve the model's sensitivity to discriminative bands. Specifically, queries from the current block... Compare the keys and values with those of neighboring blocks. Calculate inter-block attention weights based on their similarity. And perform weighted aggregation to capture long-distance dependencies. The computation of inter-block attention can be expressed as:
[0068] ,
[0069] ,
[0070] in, and They are respectively with the first The keys and values of adjacent blocks of each sub-block. Indicates the first Inter-block attention output for each sub-block.
[0071] Finally, the attention outputs between blocks are fused to produce refined feature representations, resulting in the final inter-block attention output. :
[0072] .
[0073] By synergistically integrating intra-block local attention with inter-block dynamic fusion mechanisms, the generated spectral attention weights not only enhance the expression of local features but also more effectively model global spectral dependencies, achieving fine-grained fusion of local and global spectral information. This significantly improves the model's feature extraction capabilities and classification generalization performance in complex hyperspectral scenarios. The overall output of the cross-block interactive self-attention branch is shown below. Represented as:
[0074] ,
[0075] in, Indicates splicing, This indicates regularization.
[0076] In this step, the cross-block interactive self-attention branch enhances model generalization by selectively emphasizing informational spectral regions based on inter-block similarity, unlike traditional stacked convolutional layers that apply fixed local operations. By dynamically fusing features across blocks, not only are complex hyperspectral features captured, but local and global contextual information is seamlessly integrated. Furthermore, this process helps distinguish subtle spectral differences between different categories and reduces confusion between spectrally similar categories in the global context.
[0077] S4: Construct a multi-layer sliding window spatial feature enhancement branch. Initial spatial features are extracted using a shallow spatial feature extraction module combined with multi-scale convolutional kernels. After residual connection, these features are fed into a shift window transformer (Swin Transformer, also known as a Swing block). Sliding windows of different sizes are used to capture fine-grained local spatial information. By fusing global spectral variations, spatial changes at multiple scales are captured, thereby enhancing the global representation capability of spatial features. Specifically, this includes:
[0078] like Figure 5 As shown in (a), the shallow spatial feature extraction module uses three convolutional kernels of different sizes to extract shallow spatial features at multiple scales. This captures multi-scale spatial structure information with local receptive fields from the original input, effectively enhancing the model's ability to express detailed features such as edges and textures. Batch normalization is used to stabilize the training process.
[0079] However, shallow spatial feature extraction modules are limited by the locality of convolution operations, making it difficult to model long-distance spatial dependencies, and fixed-weight convolution kernels have limited adaptability to complex scenes. To overcome these limitations, a sliding window mechanism based on SwinTransformer is introduced, dividing the feature map into non-overlapping windows along the spatial dimension and performing self-attention computation within each window to achieve fine-grained modeling of local context. More importantly, before each slide, global average pooling along the spectral dimension is performed to compress spectral redundancy and highlight key channel responses, significantly expanding the model's effective receptive field. Finally, through the synergistic effect of multi-scale convolution and sliding window self-attention, this branch not only preserves rich local details but also gradually aggregates global spatial context information across regions, achieving efficient enhancement of multi-level spatial features from local to global, significantly improving the model's ability to represent complex terrain structures and boundary regions. Specifically:
[0080] like Figure 5 As shown in (b), a sliding window strategy is used to group the input features along the channel dimension, and the sliding window size is increased step by step to capture spatial features at different scales from local to global. Furthermore, a self-attention mechanism is applied within each window to emphasize informational features. The multi-scale shallow spatial features output by the shallow spatial feature extraction module are processed through a Swing block. ,in, Indicates the first Feature blocks output by a window For the first Input characteristics of each window Indicates the window number. This indicates the window size. Within each window, a self-attention mechanism is applied to emphasize key informational features.
[0081] Before each sliding operation, global average pooling along the spectral dimension is performed to compress features and expand the receptive field, effectively enhancing the model's ability to capture long-range spectral correlations. This is represented as follows:
[0082] ,
[0083] in, This is the result of global average pooling. Indicates global average pooling. Indicates the size of the convolution kernel. Indicates the step size.
[0084] By progressively increasing the window size and step size, the Swin block captures spatial features across spectral bands, ranging from local to global scales. This process includes... Divide the data into multiple local windows and calculate the query Q and key K for each window:
[0085] ,
[0086] in, Indicates the weight of attention. This is the scaling factor for the channel dimension.
[0087] Apply attention to generate weighted features:
[0088] ,
[0089] in, This represents the self-attention result computed between feature blocks. This represents a trilinear interpolation function.
[0090] Finally, to reduce information loss during training and improve model convergence and stability, residual connections were used to obtain the output of the multi-layer sliding window spatial feature enhancement branch:
[0091] ,
[0092] in, Indicates the first Phase 2 Feature blocks output by a window Indicates the total number of windows. This represents the spliced features obtained through a multi-scale attention mechanism, i.e., the global spatial features finally output by the multi-layer sliding window spatial feature enhancement branch.
[0093] S5: To address the limitations of existing static, inflexible fusion methods that cannot dynamically adjust feature importance and weights, a fast deep fusion module is constructed. This module captures the potential correlation between spectral and spatial features by performing cross-attention recalibration on the features of the two branches. Then, adaptive fusion weights are generated based on the depth information of the input features, achieving deep weighted fusion of spectral and spatial features. For example... Figure 6 As shown in (a), it specifically includes:
[0094] By using parallel channel attention and spatial attention structures, spectral features and spatial features are adaptively reweighted respectively: channel attention focuses on capturing the dependencies between different bands and strengthening the response of key spectral bands; spatial attention highlights salient regions and suppresses background noise, thereby effectively modeling the potential correlation between spectral and spatial modes.
[0095] Traditional splicing or additive fusion methods easily introduce intermodal information interference and lack adaptability to contextual changes. Fusion strategies can more effectively integrate spectral and spatial information, enabling models to better capture complex hyperspectral features and improve the classification performance of hyperspectral image analysis. For example... Figure 6As shown in (b), the fast deep fusion module uses a fusion strategy to integrate the spectral features and the global spatial features to generate fusion weights, which can be expressed as:
[0096] ,
[0097] ,
[0098] in, The fusion weights generated for the depth perception weighting module The fusion coefficient is... Indicates a fully connected layer. Global average pooling, and They are respectively and Results enhanced by channel attention and spatial attention The fusion features output by the rapid deep fusion module, This represents a 1×1 convolutional layer that outputs the final fused feature map.
[0099] The fast deep fusion module automatically learns and generates a set of context-aware fusion weights based on the input bimodal features, achieving weighted adaptive fusion of spectral and spatial features. This mechanism can dynamically adjust the contribution ratio of different modalities according to the specific input content, preserving complementary information and suppressing redundant interference. Finally, through the synergistic effect of feature calibration and deep weighted fusion, this module achieves efficient, flexible, and discriminative multimodal fusion, significantly improving the model's ability to represent complex hyperspectral structures and its classification robustness while reducing computational overhead.
[0100] S6: Features after fusion Global average pooling is performed, and the final scene category prediction is completed through a fully connected layer and a Softmax classifier. Specifically, this includes:
[0101] After feature fusion, to further extract high-level semantic information and reduce dimensionality, global average pooling is first performed on the fused high-dimensional feature map. This operation generates a fixed-length feature vector by averaging the spatial dimensions of each feature channel. This not only effectively preserves the discriminative information between channels but also significantly reduces the number of parameters, enhancing the model's resistance to overfitting. Subsequently, this feature vector is input into a fully connected layer to further learn the nonlinear mapping relationship between categories. Finally, a Softmax classifier converts the output into probability distributions for each category, achieving accurate prediction of the scene category to which each pixel or image patch in the hyperspectral image belongs. The entire process realizes an end-to-end mapping from deep feature fusion to the final classification result, balancing classification accuracy and computational efficiency, and is suitable for fast and accurate remote sensing scene recognition tasks.
[0102] This implementation method constructs a network architecture with multi-scale perception, dual-branch heterogeneous feature extraction and dynamic fusion capabilities, realizing hierarchical feature modeling from local to global and from spectral to spatial perspectives. This significantly enhances the model's ability to distinguish subtle differences in ground features in hyperspectral images, and has good application prospects and promotional value.
[0103] Specific Implementation Method Two: The hyperspectral image classification system described in this implementation method includes:
[0104] The pyramid cross-scale attention module is used to extract multi-scale spectral features of the hyperspectral image to be classified in parallel through multiple convolutional kernels with different receptive fields, and to perform weighted fusion of the multi-scale spectral features using a channel attention mechanism.
[0105] The grouped cross-block interactive self-attention branch is used to divide the weighted fused spectral features into multiple sub-blocks along the spectral depth. A local block attention mechanism is applied within each sub-block, and an inter-block attention mechanism is applied between adjacent blocks. Then, the inter-block features are dynamically fused to realize information interaction between sub-blocks and obtain spectral features.
[0106] The multi-layer sliding window spatial feature enhancement branch is used to extract multi-scale shallow spatial features from the weighted fused spectral features using three convolutional kernels of different sizes, and then captures multi-scale spatial features using sliding windows of different sizes.
[0107] A fast deep fusion module is used to perform cross-attention recalibration on the spectral features and the spatial features, integrate the spectral features and the spatial features using a fusion strategy to generate fusion weights, and use the fusion weights to perform deep weighted fusion on the calibrated spectral features and the spatial features to obtain fused features;
[0108] The prediction module is used to perform global average pooling on the fused features and to achieve category prediction through a fully connected layer and a Softmax classifier.
[0109] Specific Implementation Method 3: The hyperspectral image classification device described in this embodiment is characterized in that the hyperspectral image classification device 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 hyperspectral image classification method as described in Specific Implementation Method 1.
[0110] Specific Implementation Method Four: A computer storage medium according to this embodiment is characterized in that the computer storage medium stores at least one instruction, which is loaded and executed by a processor to implement the hyperspectral image classification method as described in Specific Implementation Method One.
[0111] While specific embodiments of this application have been described herein with reference to them, it should be understood that these embodiments are merely examples of the principles and applications of this application. Therefore, it should be understood that many modifications can be made to the exemplary embodiments, and other arrangements can be designed without departing from the spirit and scope of this application as defined by the appended claims. It should be understood that different dependent claims and features described herein can be combined in ways different from those described in the original claims. It is also understood that features described in conjunction with individual embodiments can be used in other described embodiments.
Claims
1. A method of hyperspectral image classification, characterized in that, The method comprises the steps of: extracting multi-scale spectral features of a hyperspectral image to be classified in parallel through convolution kernels of multiple different receptive fields, and performing weighted fusion on the multi-scale spectral features by using a channel attention mechanism; dividing the weighted and fused spectral features along the spectral depth into multiple sub-blocks, applying a local block attention mechanism in each sub-block, applying an inter-block attention mechanism between adjacent blocks, then performing dynamic fusion of inter-block features to realize information interaction between sub-blocks, and obtaining spectral features; extracting multi-scale shallow spatial features from the weighted and fused spectral features by using three different size convolution kernels, and then capturing global spatial features by using different size sliding windows; performing cross-attention recalibration on the spectral features and the global spatial features, integrating the spectral features and the global spatial features by using a fusion strategy to generate fusion weights, and performing deep weighted fusion on the recalibrated spectral features and global spatial features by using the fusion weights to obtain fusion features; performing global average pooling on the fusion features, and realizing class prediction through a fully connected layer and a Softmax classifier.
2. The method of claim 1, wherein, The step of performing weighted fusion on the multi-scale spectral features by using a channel attention mechanism comprises the steps of: splicing the multi-scale spectral features along the channel dimension; generating channel weights through a 1x1x1 convolution; processing the channel weights through a ReLU function and another 1x1x1 convolution to reduce the channel dimension; applying a Sigmoid activation function to generate normalized attention weights; multiplying the spliced spectral features and the attention weight output by the Sigmoid activation function element by element to realize weighted fusion of the multi-scale spectral features.
3. The method of claim 1, wherein, The step of applying a local block attention mechanism in each sub-block comprises the steps of: applying a local block attention mechanism by using the following formula: , wherein, denotes the local block attention output for the th sub-block, are learnable projection weights, denotes a convolution, , and denote the query, key and value of the local block attention in the th sub-block, respectively.
4. The method of claim 3, wherein, The step of applying an inter-block attention mechanism between adjacent blocks comprises the steps of: applying an inter-block attention mechanism by using the following formula: , , wherein, is the inter-block attention weight and are the key and value of the neighboring block of the th sub-block, respectively, is the inter-block attention output of the th sub-block, is the attention output after the fusion of the th sub-block and the neighboring block.
5. The method of claim 1, wherein, The step of capturing global spatial features by using different size sliding windows comprises the steps of: grouping the multi-scale shallow spatial features along the channel dimension by using a sliding window strategy, and increasing the size of the sliding window stage by stage to capture global spatial features.
6. The method of claim 1, wherein, The step of integrating the spectral features and the global spatial features by using a fusion strategy to generate fusion weights comprises the steps of: generating fusion weights by using the following formula: , wherein, is a fusion weight, and are spectral features and global spatial features, respectively, is a fusion coefficient, denotes a fully connected layer, global average pooling.
7. The method of hyperspectral image classification according to claim 6, characterized in that, The step of performing deep weighted fusion on the recalibrated spectral features and global spatial features by using the fusion weights to obtain fusion features comprises the steps of: obtaining fusion features by using the following formula: wherein, is a fused feature, and are a calibrated spectral feature and a global spatial feature, respectively, denotes a 1 x 1 convolution, denotes concatenation.
8. A hyperspectral image classification system, characterized by The method comprises the steps of: a pyramid cross-scale attention module is used to extract multi-scale spectral features of a hyperspectral image to be classified in parallel through convolution kernels of multiple different receptive fields, and perform weighted fusion on the multi-scale spectral features by using a channel attention mechanism; a grouping cross-block interactive self-attention branch is used to divide the weighted and fused spectral features along the spectral depth into multiple sub-blocks, apply a local block attention mechanism in each sub-block, apply an inter-block attention mechanism between adjacent blocks, then perform dynamic fusion of inter-block features to realize information interaction between sub-blocks, and obtain spectral features; The multi-layer sliding window spatial feature enhancement branch is configured to perform multi-scale shallow layer spatial feature extraction on the weighted fused spectral features by using three different sizes of convolution kernels, and then capture multi-scale spatial features by using different sizes of sliding windows; The fast deep fusion module is configured to cross attention recalibrate the spectral features and the spatial features, integrate the spectral features and the spatial features by using a fusion strategy, generate fusion weights, and perform deep weighted fusion on the recalibrated spectral features and spatial features by using the fusion weights to obtain fusion features. The prediction module is configured to perform global average pooling on the fusion features, and realize class prediction by a fully connected layer and a Softmax classifier.
9. Hyperspectral image classification device, characterized in that The hyperspectral image classification device includes a processor and a memory, and the memory stores at least one instruction, which is loaded and executed by the processor to implement the hyperspectral image classification method according to any one of claims 1 to 7.
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 hyperspectral image classification method according to any one of claims 1 to 7.