A hyperspectral and sar image joint classification method based on context-aware mamba
By employing the context-aware Mamba method, which utilizes HSI feature self-attention and state-space parameter modulation of SAR features, cross-modal information fusion of hyperspectral and SAR images is achieved, solving the problem of insufficient classification accuracy in existing technologies and improving the accuracy of ground cover classification.
Patent Information
- Application Number
- CN202611684674.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-10-29
- Publication Date
- 2026-11-24
AI Technical Summary
In existing methods for joint classification of hyperspectral and synthetic aperture radar images, direct stitching or simple weighting is insufficient to effectively integrate the differences between the two types of data, resulting in insufficient accuracy in ground feature classification and making it difficult to meet the requirements for high-precision identification.
A context-aware Mamba-based approach is adopted, which uses the attention weights obtained by HSI feature self-attention calculation to modulate the keys and values of SAR features, and modulates the state space parameters of SAR features through the state space parameters of HSI features, thereby achieving cross-modal information fusion and enhancement.
It improves the accuracy of land cover classification, compensates for the insufficient semantic discrimination capability of SAR, preserves scattering structure information, and enhances semantic alignment in two-dimensional state space calculation, thereby improving the accuracy of land cover classification.
Smart Images

Figure CN123160976A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of remote sensing image processing technology, specifically relating to a joint classification method for hyperspectral and SAR images based on context-aware Mamba. Background Technology
[0002] Hyperspectral images (HSI) can record ground object reflectance information across continuous and dense spectral bands, possessing strong material discrimination capabilities. However, they are susceptible to factors such as spectral redundancy, heterospectral similarity between objects, heterospectral similarity between different objects, and limited spatial resolution. Synthetic Aperture Radar (SAR) employs active microwave imaging, enabling all-weather, all-day observation. It can provide information on ground object scattering intensity, geometry, surface roughness, and texture. However, it suffers from issues such as speckle noise, local scattering instability, and relatively limited semantic discrimination capabilities.
[0003] Since HSI and SAR focus on spectral properties and scattering structure respectively, they are highly complementary. Using registered HSI and SAR together for ground cover classification can generate a more complete scene description than a single sensor.
[0004] In the prior art, a typical HSI and SAR joint classification method includes the following steps: acquiring and registering HSI and SAR images, normalizing each modality and cropping local sample blocks; extracting HSI and SAR features using two convolutional, Transformer, or Mamba branches with the same or similar structures respectively; directly concatenating, summing, or inputting the two features into a cross-attention module to obtain fused features; inputting the fused features into a fully connected classifier or convolutional classifier head to output the land cover category.
[0005] However, the imaging mechanisms, statistical distributions, number of channels, dynamic ranges, and spatial responses of the two types of data differ significantly. Direct stitching or simple weighting usually fails to obtain a stable joint representation, resulting in insufficient accuracy in land cover classification and making it difficult to meet the application requirements of high-precision land cover identification. Summary of the Invention
[0006] The purpose of this invention is to provide a joint classification method for hyperspectral and SAR images based on context-aware Mamba. This method uses attention weights calculated from the self-attention of HSI features to modulate the keys and values of the first and second SAR features, and uses the state-space parameters of the HSI features to modulate the state-space parameters of the first and second SAR features, thereby improving the accuracy of ground feature classification.
[0007] The present invention adopts the following technical solution: A context-aware Mamba-based joint classification method for hyperspectral and SAR images includes: Acquire HSI and SAR images of the region to be classified; Extract the HSI features from the HSI image, and the first SAR features and second SAR features from the SAR image; Self-attention calculation is performed on HSI features to obtain attention weights and self-attention output features; based on the attention weights, the keys and values of the first SAR feature and the second SAR feature are modulated respectively; the first SAR feature and the second SAR feature are cross-attention calculated based on their respective modulated keys and values to obtain the first cross feature and the second cross feature. Two-dimensional state space calculations are performed on the self-attention output features, the first cross features, and the second cross features to obtain the HSI deep features, the first SAR deep features, and the second SAR deep features. The state space parameters of the first cross features and the second cross features are modulated using the state space parameters of the self-attention output features, and the first cross features and the second cross features are respectively calculated in two-dimensional state space using their modulated state space parameters. The deep features of HSI, the first SAR, and the second SAR are fused, and the land cover category of the area to be classified is output based on the fused features.
[0008] The beneficial effects of this invention are as follows: This invention utilizes the attention weights obtained from HSI feature self-attention calculation to modulate the keys and values of the first and second SAR features. Since these attention weights reflect the spectral context correlation within the HSI features, injecting them into the keys and values of the first and second SAR features allows the first and second SAR features to fuse the spectral context information of the HSI during cross-attention calculation. This enhances semantic discriminative ability while preserving scattering structure information, compensating for the relatively limited semantic discriminative ability of SAR. Then, the state space parameters of the self-attention output features are used to modulate the state space parameters of the first and second cross features. Since the state space parameters determine… The fixed-state-space computation method for memorizing and retrieving input information, after modulation, encodes long-range dependency information along the spectral semantic direction guided by HSI in the two-dimensional state-space computation, suppressing the influence of interference, thereby obtaining the first and second SAR deep features semantically aligned with the HSI deep features, bridging the modal differences between HSI and SAR; all the above modulation is carried out unidirectionally guided by HSI, preventing noise carried by the SAR mode from being transmitted back into the HSI mode, so that the HSI deep features and the two SAR deep features can achieve deep semantic alignment while maintaining their respective modal advantages, improving the ground cover separability of the fused features, and thus improving the accuracy of ground cover classification. Attached Figure Description
[0009] Figure 1 This is a flowchart of the method of the present invention; Figure 2 This is a schematic diagram of the spectral Mamba encoder in this invention; Figure 3 This is a schematic diagram of the dual-modal spatial-texture Mamba encoder in this invention; Figure 4 A comparison chart of the classification results of various methods on the Berlin dataset; Figure 5 This is a comparison chart of the classification results of various methods on the Augsburg dataset. Detailed Implementation
[0010] The present invention will now be described in detail with reference to the accompanying drawings and embodiments.
[0011] In one embodiment, a context-aware Mamba-based joint classification method for hyperspectral and SAR images is provided, such as... Figure 1 As shown, it includes: Step 1: Obtain the original HSI image and the original SAR image of the region to be classified, and crop the original HSI image and the original SAR image to obtain the HSI image and the SAR image.
[0012] Step 2: Perform logarithmic gradient fusion on the SAR image to obtain a texture-enhanced SAR image.
[0013] Step 3: Input the HSI image, SAR image and texture-enhanced SAR image into the multi-source Mamba encoder for feature extraction to obtain HSI features, first SAR features and second SAR features.
[0014] Step 4: Perform channel synchronization and adaptive weighting on HSI features, first SAR features, and second SAR features.
[0015] Step 5: Input the weighted HSI features, the first SAR features, and the second SAR features into the context-aware multimodal fusion module. Through asymmetric context extraction, cross-modal key value injection, two-dimensional state parameter exchange, and dual-space attention modulation, the fused features are obtained.
[0016] Step 6: Based on the fused features, output the land cover categories of the area to be classified and generate a land cover classification map.
[0017] In another embodiment, step 1 specifically includes: Acquire spatially registered HSI and SAR raw images. The HSI raw image has a spatial spectral structure with three dimensions: spatial height, spatial width, and number of spectral bands; the SAR raw image has a spatial channel structure with three dimensions: spatial height, spatial width, and number of channels. The preferred number of channels is 4, corresponding to four polarization or derived channels.
[0018] For each pixel or region to be classified, a local sample block centered on the pixel or region to be classified is cropped from the original HSI image and the original SAR image, respectively, to obtain the HSI image and the SAR image. In this invention, the HSI image, SAR image, and texture-enhanced SAR image all refer to the aforementioned local sample block.
[0019] Preferably, HSI images can use a larger cropping window size, while SAR images and texture-enhanced SAR images can use a smaller cropping window size; alternatively, the same cropping window size can be set according to resolution, registration error, and target scale.
[0020] Optionally, before inputting the data into the network, local sample blocks can be standardized, normalized to maximum and minimum, selected by band selection, preprocessed by principal components, or have missing values repaired.
[0021] In this embodiment, since the original HSI image and the original SAR image have different dimensions, dynamic range and number of channels, only by completing spatial registration, local cropping and intramodal normalization can we ensure that local sample blocks at the same location have spatial correspondence, form a unified local sample block that can be processed by the subsequent modal-specific encoder, and reduce the impact of sensor dimension differences on training stability.
[0022] In another embodiment, step 2 specifically involves: First, calculate the horizontal and vertical gradients for each channel of the SAR image, and use the square root of the sum of the squares of the horizontal and vertical gradients as the gradient magnitude of that channel; the gradient operator can be a difference, Sobel, Scharr, Prewitt, or a learnable convolution kernel.
[0023] Then, considering the multiplicative noise and large dynamic range generated by SAR coherent imaging, a logarithmic transformation is performed on each channel of the SAR image to obtain the logarithmic domain intensity.
[0024] Finally, the gradient magnitude and logarithmic domain intensity are fused intra-channel according to the balance coefficient to obtain a texture-enhanced SAR image, represented as: in, For the channel values of texture-enhanced SAR images, For the strength of the logarithmic field, For gradient magnitude, For balance coefficient, The value ranges from 0 to 1, and can be a fixed hyperparameter, a parameter set by channel, a parameter dynamically predicted by sample, or a trainable parameter.
[0025] Optionally, the logarithmic domain strength and gradient magnitude can be normalized separately before fusion.
[0026] In this embodiment, logarithmic transformation is used to compress the dynamic range of strong scattering points in SAR images and reduce the influence of multiplicative speckle. Gradient magnitude is used to express edges, orientation changes and local structures. The fusion of the two can avoid the excessive amplification of noise when only gradient enhancement is performed, and generate a texture enhancement representation that is complementary to the SAR image without significantly increasing the number of network parameters.
[0027] In another embodiment, step 3 specifically involves: Multi-source Mamba encoders include spectral Mamba encoders and bimodal spatial-texture Mamba encoders. Both spectral Mamba encoders and bimodal spatial-texture Mamba encoders are composed of several repeatedly stacked selective state space units, but their sequence organization, local convolution directions, and cross-branch interaction methods differ. Mamba is a sequence modeling architecture based on a selective state space model, which efficiently models long sequences through a selective scanning mechanism.
[0028] The spectral Mamba encoder is used to extract HSI features from HSI images, and its structure is as follows: Figure 2 As shown, the extraction process includes: First, the HSI image is spectrally rearranged, organizing each spectral band into a sequence along the spectral dimension, while preserving or aggregating spatial neighborhood information.
[0029] Then, the rearranged sequence is input into a normalization layer for processing. The normalized sequence is then input into the main branch and the gated branch respectively. The main branch consists of a linear layer, a convolutional layer, a nonlinear activation layer, and a selective state space unit connected in sequence. The gated branch consists of a linear layer and a nonlinear activation layer connected in sequence. The convolutional layer performs local convolution operations.
[0030] In the main branch, convolutional layers are used to capture short-range changes between adjacent bands, selective state space units are used to model long-range dependencies across multiple non-adjacent bands with approximately linear complexity, nonlinear activation layers can use activation functions such as SiLU, GELU, and ReLU, and gated branches are used to control information propagation based on the content of the current local sample block.
[0031] Finally, the output of the main branch is multiplied element-wise with the output of the gated branch, normalized, and then concatenated with the rearranged sequence residual to obtain the HSI feature. Figure 2middle, For element-wise multiplication, This is a residual connection.
[0032] The above-mentioned HSI feature extraction process can be stacked in multiple layers to enhance the ability to model spectral dependence.
[0033] Since the discrimination information of different ground objects often manifests as absorption, reflection and continuous variation relationships on the entire spectral curve, it is difficult to fully utilize the correlation of long-distance bands by relying solely on the limited convolutional receptive field. Therefore, the combination of spectral rearrangement and two-dimensional state space calculation in this embodiment enhances the modeling of global spectral dependence, reduces redundancy and category spectral confusion in high-dimensional bands, and avoids the computational overhead of standard self-attention that increases with the square of the sequence length.
[0034] A dual-modal spatial-textured Mamba encoder is used to extract the first SAR features of a SAR image and the second SAR features of a texture-enhanced SAR image. Its structure is as follows: Figure 3 As shown, the extraction process includes: First, the SAR image is input into the spatial structure branch, and the texture-enhanced SAR image is input into the spatial texture branch. Both the spatial structure branch and the spatial texture branch consist of a normalization layer, a linear layer, a convolutional layer, a nonlinear activation layer, and a selective state space unit connected in sequence. The spatial structure branch is used to model the scattering structure of the SAR image, obtaining the structure branch output features; the spatial texture branch is used to model the edges and local variations of the texture-enhanced SAR image, obtaining the texture branch output features, wherein the convolutional layer performs local convolution operations.
[0035] Then, to achieve bidirectional collaboration between structure and texture, the features output by the normalized layer in the spatial texture branch are sequentially input into the linear layer and the nonlinear activation layer to obtain the first gating coefficient; the features output by the normalized layer in the spatial structure branch are sequentially input into the linear layer and the nonlinear activation layer to obtain the second gating coefficient; gating activation can be Sigmoid, SiLU, etc.
[0036] Finally, the structural branch output features are multiplied element-wise by the first gating coefficient, normalized, and then concatenated with the SAR image residual to obtain the first SAR feature; the texture branch output features are multiplied element-wise by the second gating coefficient, normalized, and then concatenated with the texture-enhanced SAR image residual to obtain the second SAR feature. Figure 3 middle, For element-wise multiplication, This is a residual connection.
[0037] Optionally, two-dimensional state space computation can employ bidirectional scanning, four-directional scanning, serpentine scanning, window scanning, or other two-dimensional serialization methods to enable selective state space units to simultaneously cover horizontal, vertical, or multi-directional spatial dependencies.
[0038] Since SAR images are better suited for representing stable scattering structures, and texture-enhanced SAR images are better suited for representing edges and local variations, this embodiment uses independent modeling in two branches followed by cross-gating to avoid information interference caused by direct mixing at the input. Simultaneously, the spatial structure branch guides the spatial texture branch to focus on key scattering regions, while the spatial texture branch in turn supplements fine-grained boundaries and local textures, enabling the SAR representation to encompass both large-scale structural relationships and small-scale details.
[0039] In another embodiment, step 4 specifically involves: First, the HSI features, the first SAR features, and the second SAR features are projected and mapped to have the same number of channels and compatible spatial dimensions.
[0040] Then, the projected HSI features, first SAR features, and second SAR features are stitched together. The stitched features are then input into the linear layers corresponding to the HSI features, first SAR features, and second SAR features respectively for linear transformation. The outputs of the three linear layers are then normalized using Softmax to obtain the normalized weights of the HSI features, first SAR features, and second SAR features.
[0041] The calculation process for normalized weights can be expressed as follows: in, Features Normalized weights, Features The corresponding weight matrix of the linear layer, Features The corresponding weight matrix of the linear layer, Features after splicing It is an exponential function with the following characteristics. These are HSI features, first SAR features, or second SAR features. It can be HSI feature, first SAR feature, or second SAR feature.
[0042] Finally, normalized weights are used to modulate the projected HSI features, the first SAR features, and the second SAR features, respectively. The modulated HSI features, the first SAR features, and the second SAR features are then retained and used for subsequent interactions.
[0043] In one implementation, the modulated HSI features, the first SAR features, and the second SAR features can be summed to form an auxiliary joint feature, which can be used as input to the residual or classification auxiliary head, or as global guidance for the fusion module.
[0044] Since local sample blocks of different land cover categories have different degrees of dependence on spectrum, scattering structure and texture, and different regions may have sensor quality degradation or occlusion, this embodiment adaptively adjusts the contributions of HSI features, first SAR features and second SAR features according to the content of local sample blocks, avoids fixed ratio fusion, and provides a unified dimension of input for subsequent cross-modal interaction.
[0045] In another embodiment, step 5 specifically involves: The context-aware multimodal fusion module includes an asymmetric context feature extraction submodule and a cross-modal fusion submodule. In this embodiment, HSI features are set as the core modality, and the first SAR features and the second SAR features are set as auxiliary modalities. The core modality uses a larger context window, while the auxiliary modalities use a smaller context window, in order to enhance global semantics and fine-grained local structure, respectively.
[0046] The asymmetric context feature extraction submodule in this embodiment performs the following operations: Self-attention calculation is performed on HSI features to obtain attention weights and self-attention output features; based on the attention weights, the keys and values of the first SAR feature and the second SAR feature are modulated respectively; the first SAR feature and the second SAR feature are cross-attention calculated based on their respective modulated keys and values to obtain the first cross feature and the second cross feature.
[0047] Two-dimensional state space calculations are performed on the self-attention output features, the first cross features, and the second cross features respectively; wherein, the state space parameters of the first cross features and the second cross features are modulated using the state space parameters of the self-attention output features respectively, and the first cross features and the second cross features are respectively calculated in two-dimensional state space using their respective modulated state space parameters to obtain the HSI deep features, the first SAR deep features, and the second SAR deep features.
[0048] Specifically, when performing attention calculations on the HSI features, first SAR features, and second SAR features of the input asymmetric context feature extraction submodule, each feature is first windowed, and then a linear transformation is performed on the windowed features to obtain the query, key, and value. Specifically, when performing self-attention calculations on the HSI features, a first context window is used to window the HSI features; when performing cross-attention calculations on the first SAR features and second SAR features, a second context window is used to window the first SAR features and second SAR features; the size of the first context window is larger than the size of the second context window.
[0049] When performing self-attention computation on HSI features, attention weights are obtained by scaling and Softmax normalization of the dot product of query and key, and the values are weighted and summed using attention weights to obtain self-attention output features.
[0050] Subsequently, the attention weights are used to modulate the keys and values of the first SAR feature and the second SAR feature respectively. Specifically, the attention weights are superimposed on the keys and values of the first SAR feature and the second SAR feature after linear mapping, convolution or channel swapping transformation to obtain the modulated keys and values.
[0051] The first SAR feature and the second SAR feature are cross-attention calculated based on their respective modulated keys and values to obtain the first cross feature and the second cross feature.
[0052] The above attention weight calculation and key-value modulation process can be expressed as: , , in, For attention weights, For HSI feature queries, The transpose of the HSI characteristic bond. The dimension of the key in the HSI feature. The modulated key. The key to the feature to be modulated. A function that maps attention weights to modulation amounts of keys can be implemented using convolution, linear mapping, channel swapping, or a combination thereof. The feature to be modulated, The modulated value, The value of the feature to be modulated. The function that maps attention weights to modulation values can be implemented by convolution, linear mapping, channel swapping, or a combination thereof. The modulated feature in the key-value modulation process is either the first SAR feature or the second SAR feature.
[0053] The self-attention output features, the first cross features, and the second cross features are respectively input into the selective state space unit for two-dimensional state space calculation.
[0054] Specifically, the state space parameters of the first cross feature and the second cross feature are modulated using the state space parameters of the self-attention output feature. The state space parameters include an input matrix and an output matrix. The state space parameters of the self-attention output feature are transformed by a learnable mask and scaling factors and then used to modulate the state space parameters of the first cross feature and the second cross feature. The learnable mask can be a channel-level mask, a spatial-level mask, or a sample-level mask. The scaling factors can be fixed constants or learnable parameters.
[0055] The state space parameters of the self-attention output feature itself can be left unchanged. The first cross feature and the second cross feature are respectively calculated in two-dimensional state space using the modulated state space parameters to obtain the HSI deep feature, the first SAR deep feature and the second SAR deep feature.
[0056] The above state parameter exchange process can be represented as: , , in, The modulated input matrix, The input matrix is the feature to be modulated. For the input matrix, either a fixed constant or a learnable scaling factor. A learnable mask for the input matrix. The input matrix is the self-attention output feature matrix. The modulated output matrix, The output matrix of the feature to be modulated. This is a fixed constant or a learnable scaling factor for the output matrix. A learnable mask for the output matrix. The output matrix of the self-attention output features. For element-wise multiplication, the modulated feature in the state parameter exchange process is either the first cross feature or the second cross feature.
[0057] The cross-modal fusion submodule in this embodiment performs the following operations: The operations in the cross-modal fusion submodule are divided into three parallel branches.
[0058] In the first branch, the HSI deep features and the first SAR deep features are concatenated along the channel dimension, and then a first spatial attention map is generated by 1×1 convolution and sigmoid activation. Simultaneously, the first SAR deep features are first subjected to 1×1 convolution, and then element-wise multiplied and weighted using the first spatial attention map. The values of the first spatial attention map are between 0 and 1, reflecting the complementary regions of the HSI deep features and the first SAR deep features.
[0059] In the second branch, the HSI deep features and the second SAR deep features are concatenated along the channel dimension, and then a second spatial attention map is generated by 1×1 convolution and sigmoid activation. Simultaneously, the second SAR deep features are first convolved with 1×1, and then element-wise multiplied and weighted using the second spatial attention map. The values of the second spatial attention map are between 0 and 1, reflecting the complementary regions of the HSI and second SAR deep features.
[0060] In the third branch, the deep features of HSI are first convolved with 1×1, and then the first spatial attention map and the second spatial attention map are multiplied element by element and then weighted.
[0061] The weighted HSI deep features, first SAR deep features, and second SAR deep features are all passed through normalization and feedforward networks in sequence, and then summed, spliced, and convolved or gated aggregated to obtain the fused features.
[0062] In this embodiment, HSI features provide stable category semantics and a wide-ranging spectral context, while the first and second SAR deep features focus on representing ground structure and local texture. Through two-stage guidance—attention key-value injection and state parameter exchange—the two SAR deep features absorb the context of HSI features at the attention representation layer, while simultaneously introducing long-range dependency information of HSI features at the state propagation layer, mitigating cross-modal semantic misalignment. HSI features are configured with a larger context window to enhance global semantics, while the two SAR deep features are configured with smaller context windows to preserve fine-grained local structures, ensuring that cross-modal interaction balances global semantics and local details. In the cross-modal fusion stage, two spatial weight maps represent the complementary correlation between HSI features and the two SAR deep features, respectively. The first and second SAR deep features retain local discriminative information based on their corresponding weights, while the HSI features fuse the context of the two SAR deep features using the joint weights of the two weight maps, ultimately resulting in a fused feature that simultaneously includes global spectral semantics, scattering structure, and fine-grained texture.
[0063] In another embodiment, step 6 specifically involves: After flattening, global average pooling, center pixel reading or region pooling of the fused features, the data is input into a linear classifier, multilayer perceptron or convolution classifier head, and the predicted probabilities of the land cover categories of the pixels or regions to be classified are output. The prediction results of each location are restored according to the spatial coordinates to generate a land cover classification map.
[0064] Cross-entropy loss can be used during the training phase; for imbalanced classes, weighted cross-entropy, focus loss, Dice loss, or a combination thereof can be used. Network parameters can be optimized using Adam, AdamW, or stochastic gradient descent.
[0065] In this embodiment, the fused features have integrated multi-source discriminative information. The classification head only needs to complete the mapping from features to categories, and can also choose pixel-level or region-level output according to task requirements. This invention can learn the mapping relationship from multi-source input images to classification results end-to-end, adapting to different numbers of categories, sample sizes, and deployment platforms.
[0066] The effects of the present invention will be further illustrated below with simulation experiments.
[0067] 1. Dataset selection: To verify the effectiveness of the method of this invention, simulation experiments were conducted using two widely used benchmark datasets for HSI and SAR joint classification: the Berlin dataset and the Augsburg dataset.
[0068] The Berlin dataset contains a hyperspectral image with a spatial resolution of 30 m, a size of 797×220 pixels, 244 bands, and a spectral range covering 0.40–2.50 μm. It is registered and aligned with a Sentinel-1 SAR image with a resolution of 13.89 m (a size of 1723×476 pixels).
[0069] The Augsburg dataset contains seven land cover types, with hyperspectral images measuring 332×485 pixels and comprising 180 bands, covering a spectral range of 0.40–2.50 μm. It has the same size and resolution as the Sentinel-1 SAR images.
[0070] 2. Experimental Environment: The simulation experiments were conducted using the PyTorch deep learning framework on an NVIDIA RTX 4090 GPU equipped with 24GB of video memory.
[0071] 3. Parameter settings: The network was trained using the Adam optimizer for 200 epochs, with an initial learning rate of 0.005, which was then decayed to 10 using cosine annealing. -5 .
[0072] The batch sizes for the Berlin and Augsburg datasets were set to 80 and 40, respectively.
[0073] The balance coefficient for log-gradient fusion is set to a fixed hyperparameter of 0.5, and the scaling factor for state space parameter exchange is... , All are set to a fixed constant of 0.1.
[0074] The cropping window size for the sample block is set to (8, 16, 24).
[0075] The evaluation metrics used were overall accuracy (OA), average accuracy (AA), and the Kappa coefficient. The results of each experiment were the mean ± standard deviation of ten independent runs.
[0076] 4. Experiment 1: Comparison Experiment with Existing Methods: To verify the overall classification performance of the method of this invention, it is compared with representative HSI-SAR fusion classification methods such as ExViT, MIFNet, MACN, HCT, AsyFFNet, GCFNet, PICNet, HL-Mamba, and MSFMamba. These methods cover typical fusion schemes based on Transformer, convolutional neural networks, and Mamba. Tables 1 and 2 show the classification results of each method on the Berlin and Augsburg datasets, respectively. Figure 4 and Figure 5 The following are comparison charts of the corresponding classification results.
[0077] Table 1. Comparison of classification accuracy of various methods on the Berlin dataset. Table 2 Comparison of overall classification metrics for each method on the Berlin dataset. Table 3 Comparison of classification accuracy of various methods on the Augsburg dataset Table 4 Comparison of overall classification metrics for each method on the Augsburg dataset As shown in Tables 2 and 4, the method of this invention achieves the highest overall accuracy, average accuracy, and Kappa coefficient on both the Berlin and Augsburg datasets, at 79.85%, 76.51%, and 70.80% (Berlin dataset) and 92.88%, 81.11%, and 90.33% (Augsburg dataset), respectively. Furthermore, the standard deviations of all indicators are relatively small, indicating that the method of this invention achieves high classification accuracy while maintaining good stability. These results demonstrate that this invention, by combining modality-specific Mamba feature extraction with context-aware cross-modal interaction, can effectively utilize the complementary information of HSI and SAR to improve the accuracy of ground cover classification.
[0078] Figure 4This image compares the classification results of various methods on the Berlin dataset. It consists of 11 sub-images, including the ground truth image and the classification results of each method. From left to right, they are: ground truth image, ExViT, MIFNet, MACN, HCT, AsyFFNet, GCFNet, PICNet, HL-Mamba, MSFMamba, and the classification results of the method presented in this invention. The first row shows the complete image, and the second row shows magnified views of the areas within the red boxes in the complete images. Different colored blocks represent different land cover categories, totaling eight categories: forest, residential area, industrial area, low vegetation, soil, small plots of farmland, commercial area, and water body. Each sub-image uses the same legend coloring, and the same category has the same color across different sub-images. The closer the color block distribution is to the ground truth image, the more accurate the classification result of the method.
[0079] Depend on Figure 4 As shown in Table 1, the classification result map of the method of the present invention is closest to the truth map overall. In areas where the comparison method shows large areas of misclassification, the method of the present invention maintains consistency with the truth map. Figure 1 The color distribution is consistent. In categories where the classification accuracy of comparison methods is generally low, such as industrial areas, small plots of farmland, and water bodies, the category accuracy of the method of this invention (0.7000, 0.7644, and 0.9621) is significantly higher than that of each comparison method (the highest accuracy of each comparison method in the above three categories is 0.5558, 0.7268, and 0.9347, respectively), indicating that the method of this invention can effectively suppress misclassification and maintain the integrity of land feature areas and boundaries.
[0080] Figure 5 This is a comparison chart of the classification results of various methods on the Augsburg dataset, consisting of 11 sub-plots including a ground truth plot and the classification results plots of each method. Different colored blocks represent different land cover categories, totaling 7 categories: forest, residential area, industrial area, low vegetation, small plots of farmland, commercial area, and water body.
[0081] Depend on Figure 5 As shown in Table 3, the classification results map of the method of the present invention are closest to the truth map overall. In the categories of small farmland and commercial areas, the classification accuracy of the method of the present invention (0.9605 and 0.7011) is significantly higher than that of the comparative methods (the highest accuracy of the comparative methods in the above two categories are 0.7377 and 0.6116, respectively), indicating that the method of the present invention has a stronger ability to distinguish features that are difficult to differentiate.
[0082] 5. Experiment 2: Modal and Fusion Module Ablation Experiment: To verify the contribution of each input modality and main module in the method of the present invention, ablation experiments were conducted by removing the corresponding modalities or modules while keeping the other training settings unchanged. The results are shown in Table 5.
[0083] Table 5 Ablation experimental results for different modalities and modules on the Berlin and Augsburg datasets. Table 5 shows that the classification accuracy is relatively limited when using only HSI or only SAR. The classification accuracy is improved after directly fusing HSI and SAR, indicating that HSI and SAR have strong complementarity. The classification accuracy is further improved after performing log-gradient fusion on SAR images. The classification accuracy is further improved when HSI, SAR and texture-enhanced SAR images are used together. The classification accuracy decreases significantly after removing the two modality-specific Mamba encoders or removing the context-aware multimodal fusion module in the complete method. The overall accuracy on both datasets is highest when the complete method is used.
[0084] The above results demonstrate that this invention, through modality-specific feature extraction, log-gradient fusion, context-aware cross-modal interaction, and multi-source information fusion, can fully utilize the complementary information of HSI and SAR to effectively improve the accuracy of ground cover classification.
[0085] 6. Experiment 3: Ablation Experiment of Context-Aware Multimodal Fusion Module: To verify the contributions of each component in the context-aware multimodal fusion module, asymmetric context extraction and cross-modal key-value injection, self-attention and cross-attention, two-dimensional state space computation, channel exchange and state space parameter exchange were introduced step by step on the Berlin and Augsburg datasets. The results are shown in Table 6.
[0086] Table 6 Ablation Experiment Results of Context-Aware Multimodal Fusion Module As shown in Table 6, with the gradual introduction of asymmetric context extraction and cross-modal key-value injection, self-attention and cross-attention, two-dimensional state space computation, channel exchange, and state space parameter exchange, the classification accuracy gradually improves on both datasets. Among them, the introduction of state space parameter exchange enables the model to achieve the best classification accuracy.
[0087] The above results show that the present invention uses the attention weights obtained by HSI feature self-attention calculation to modulate the keys and values of the first SAR feature and the second SAR feature, and uses the state space parameters of HSI feature to modulate the state space parameters of the first SAR feature and the second SAR feature, which can effectively enhance cross-modal interaction and improve the accuracy of ground cover classification.
[0088] In summary, this invention utilizes a spectral Mamba encoder and a dual-modal spatial-texture Mamba encoder to extract HSI features, first SAR features, and second SAR features. After channel synchronization and adaptive weighting, these features are fused by a context-aware multimodal fusion module to output the land cover category. During the fusion process, attention weights calculated from the self-attention of HSI features are used to modulate the keys and values of the first and second SAR features. Furthermore, the state-space parameters of the first and second SAR features are modulated using the state-space parameters of the HSI features. Guided by HSI, unidirectional cross-modal interaction is performed, enabling the two SAR features to aggregate long-range dependency information along the spectral semantic direction guided by HSI, suppressing noise interference, bridging modal differences, and thus improving the accuracy of land cover classification.
Claims
1. A method for joint classification of hyperspectral and SAR images based on context-aware Mamba, characterized in that, include: Acquire HSI and SAR images of the region to be classified; Extract the HSI features of the HSI image, and the first SAR features and the second SAR features of the SAR image; Self-attention calculation is performed on the HSI features to obtain attention weights and self-attention output features; based on the attention weights, the keys and values of the first SAR features and the second SAR features are modulated respectively; the first SAR features and the second SAR features are cross-attention calculated based on their respective modulated keys and values to obtain the first cross feature and the second cross feature; Two-dimensional state space calculations are performed on the self-attention output feature, the first cross feature, and the second cross feature to obtain HSI deep features, first SAR deep features, and second SAR deep features; wherein, the state space parameters of the first cross feature and the second cross feature are modulated using the state space parameters of the self-attention output feature, and the first cross feature and the second cross feature are respectively used to perform two-dimensional state space calculations using their respective modulated state space parameters. The HSI deep features, the first SAR deep features, and the second SAR deep features are fused together, and the land cover category of the area to be classified is output based on the fused features.
2. The joint classification method for hyperspectral and SAR images based on context-aware Mamba as described in claim 1, characterized in that, After acquiring the HSI and SAR images of the region to be classified, the following steps are also included: Calculate the horizontal and vertical gradients for each channel of the SAR image to obtain the gradient magnitude; Perform a logarithmic transformation on each channel of the SAR image to obtain the logarithmic domain intensity; The gradient magnitude and logarithmic domain intensity are fused within a channel to obtain a texture-enhanced SAR image.
3. The joint classification method for hyperspectral and SAR images based on context-aware Mamba as described in claim 1, characterized in that, Extracting the HSI features of the HSI image includes: The HSI image is spectrally rearranged, and each spectral band is organized into a sequence along the spectral dimension; The rearranged sequence is normalized, and the normalized sequence is input into the main branch and the gated branch respectively. The main branch includes a linear layer, a convolutional layer, a nonlinear activation layer and a selective state space unit connected in sequence. The gated branch includes a linear layer and a nonlinear activation layer connected in sequence. The output of the main branch is multiplied element-wise with the output of the gated branch, and after normalization, it is concatenated with the rearranged sequence residual to obtain the HSI feature.
4. The joint classification method for hyperspectral and SAR images based on context-aware Mamba according to claim 2, characterized in that, The first SAR feature is extracted based on SAR image, and the second SAR feature is extracted based on texture-enhanced SAR image.
5. The joint classification method for hyperspectral and SAR images based on context-aware Mamba according to claim 4, characterized in that, The extraction process of the first SAR feature and the second SAR feature includes: The SAR image is input into the spatial structure branch to obtain the output features of the structure branch; the spatial structure branch includes a normalization layer, a linear layer, a convolutional layer, a nonlinear activation layer, and a selective state space unit connected in sequence. The texture-enhanced SAR image is input into the spatial texture branch to obtain the texture branch output features; the spatial texture branch includes a normalization layer, a linear layer, a convolutional layer, a nonlinear activation layer, and a selective state space unit connected in sequence. The features output by the normalization layer in the spatial texture branch are sequentially input into the linear layer and the nonlinear activation layer to obtain the first gating coefficient. The features output by the normalized layer in the spatial structure branch are sequentially input into the linear layer and the nonlinear activation layer to obtain the second gating coefficients; The structural branch output feature is multiplied element-wise by the first gating coefficient, normalized, and then concatenated with the SAR image residual to obtain the first SAR feature; The texture branch output feature is multiplied element-wise by the second gating coefficient, normalized, and then concatenated with the texture-enhanced SAR image residual to obtain the second SAR feature.
6. The joint classification method for hyperspectral and SAR images based on context-aware Mamba according to claim 1, characterized in that, After extracting the HSI features of the HSI image and the first SAR features and second SAR features of the SAR image, the method further includes: The HSI feature, the first SAR feature, and the second SAR feature are respectively projected and mapped to have the same number of channels; The HSI feature, the first SAR feature and the second SAR feature after projection are stitched together. The stitched features are then input into the linear layers corresponding to the HSI feature, the first SAR feature and the second SAR feature respectively. The output of each linear layer is normalized by Softmax to obtain the normalized weights of the HSI feature, the first SAR feature and the second SAR feature respectively. The normalized weights are used to modulate the projected HSI features, the first SAR features, and the second SAR features, respectively.
7. The joint classification method for hyperspectral and SAR images based on context-aware Mamba according to claim 1, characterized in that, The state space parameters include an input matrix and an output matrix; The state space parameters of the self-attention output feature, after being transformed by a learnable mask and scaling factors, are used to modulate the state space parameters of the first cross feature and the second cross feature. The learnable mask can be a channel-level mask, a spatial-level mask, or a sample-level mask. The scaling factor is either a fixed constant or a learnable parameter.
8. The joint classification method for hyperspectral and SAR images based on context-aware Mamba according to claim 1, characterized in that, Modulating the keys and values of the first SAR feature and the second SAR feature respectively, including: The attention weights are then superimposed onto the keys and values of the first and second SAR features after undergoing linear mapping, convolution, or channel swapping transformation.
9. The joint classification method for hyperspectral and SAR images based on context-aware Mamba according to claim 1, characterized in that, The fusion of the HSI deep features, the first SAR deep features, and the second SAR deep features includes: A first spatial attention map is generated based on the HSI deep features and the first SAR deep features, and a second spatial attention map is generated based on the HSI deep features and the second SAR deep features. The first spatial attention map is used to weight the first SAR deep features, the second spatial attention map is used to weight the second SAR deep features, and the first spatial attention map and the second spatial attention map are used to weight the HSI deep features. The weighted HSI deep features, the first SAR deep features, and the second SAR deep features are then fused.
10. The joint classification method for hyperspectral and SAR images based on context-aware Mamba according to claim 1, characterized in that, When performing self-attention calculation on the HSI features, the HSI features are windowed using a first context window; When performing cross-attention calculation on the first SAR feature and the second SAR feature, a second context window is used to window the first SAR feature and the second SAR feature; The size of the first context window is larger than the size of the second context window.
