1. Introduction
Hyperspectral image (HSI) classification is one of the core tasks in remote sensing image analysis and understanding, as well as a fundamental component of object recognition and environmental perception. Hyperspectral imaging technology acquires surface reflectance information across tens to hundreds of continuous and narrow spectral bands, providing each pixel with rich spectral and spatial features, which makes different ground objects separable in the spectral space [
1]. Owing to this advantage, hyperspectral images are widely utilized in agricultural monitoring, environmental assessment, mineral exploration, land use mapping, and other fields [
2,
3,
4].
Early research on hyperspectral image classification mainly relied on traditional machine learning methods, such as Support Vector Machine (SVM) [
5], Random Forest (RF) [
6], and K-Nearest Neighbor (KNN) [
7]. These methods typically depend on handcrafted features to reduce data dimensionality and mitigate the “curse of dimensionality” [
8] but struggle to effectively capture the complex spatial–spectral coupling relationships in hyperspectral data within low-dimensional feature space. Their limited feature representation capability results in constrained classification accuracy and generalization performance in complex scenes.
With the rapid development of deep learning, various neural network architectures have been proposed for improved HSI classification, each with its own advantages and disadvantages. Convolutional neural networks (CNNs) excel at local feature extraction but struggle with long-range dependencies due to their limited receptive fields [
9,
10,
11,
12,
13,
14,
15]; recurrent neural networks (RNNs) can model spectral sequences but suffer from gradient vanishing and feature dilution [
16,
17,
18]; and Transformer-based methods capture global dependencies via self-attention, yet their quadratic computational complexity restricts deployment on large-scale HSI scenes [
19,
20,
21,
22,
23,
24,
25,
26].
To mitigate the aforementioned limitations of CNNs, RNNs, and Transformers, various state-space model (SSM)-based methods have recently been explored for hyperspectral image classification [
27]. Mamba-based architectures leverage the linear sequence modeling mechanism of state-space models to achieve efficient long-range dependency modeling, significantly reducing computational complexity and memory consumption compared with Transformers [
28]. Despite these advantages, existing Mamba-based HSI classification methods still suffer from several limitations that restrict further performance improvement. Firstly, redundant channel compression remains a challenge: existing methods, such as MambaHSI and SpectralMamba, commonly employ simple
convolution operations for channel dimensionality reduction, which may limit the preservation of discriminative spectral structures in high-dimensional hyperspectral data [
22,
23]. Secondly, existing spatial–spectral fusion strategies mainly rely on fixed weighting schemes or simple additive operations, lacking the adaptive capability to dynamically adjust fusion weights according to input features [
29].
To address aforemetioned two issues, in this paper, we build upon the existing application of the Mamba architecture [
27] in hyperspectral image modeling and propose an improved spatial–spectral dual-branch Mamba architecture for hyperspectral image classification, termed DualFusionMamba (DFMamba). The proposed model employs parallel spatial and spectral Mamba branches and integrates their complementary representations using a unified softmax-normalized learnable weighted fusion mechanism with residual scaling. By leveraging the efficient sequence modeling capability of state-space models, DFMamba achieves effective long-range dependency modeling while maintaining low computational complexity and memory consumption. Furthermore, the proposed framework improves feature fusion and spectral redundancy suppression, providing an effective solution for high-accuracy and high-efficiency hyperspectral image classification.
The three main contributions of this work are as follows: (1) A Hyperspectral Spatial Attention Embed (HSAE) module is presented, which integrates adaptive group convolution, depth-wise separable convolution, and spatial attention for efficient channel compression and feature extraction. (2) An EnhancedBothMamba module is constructed, which separately models long-range dependencies along the spatial and spectral dimensions and integrates the resulting features using softmax-normalized learnable global scalar weights and a learnable residual scaling factor
. (3) An improved classification head (ClsHead) is proposed, which adopts a multi-scale branch fusion strategy combining local details and global semantics for fine-grained pixel-wise classification.
Table 1 systematically compares the technical differences between our method and existing Mamba-based HSI classification methods.
The remainder of this paper is organized as follows:
Section 2 reviews related work on HSI classification and state-space models.
Section 3 details the proposed DFMamba architecture.
Section 4 presents our experimental results, including comparisons, ablation studies, efficiency analysis, and visualizations.
Section 5 discusses this study’s limitations and future directions.
Section 6 concludes the paper.
4. Experiments
4.1. Experimental Setup
4.1.1. Datasets
To comprehensively evaluate the proposed DFMamba model, experiments were conducted on four hyperspectral remote sensing datasets: HanChuan, HongHu, Houston, and Pavia University (UP). These datasets represent diverse Earth observation scenarios (agricultural monitoring, urban land cover analysis, and ecosystem mapping) and serve as widely adopted benchmarks in hyperspectral remote sensing studies. Thus, they are able to provide a thorough validation of the model’s generalization and robustness.
The Pavia University dataset was acquired by the ROSIS sensor and contains 610 × 340 pixels and 103 valid spectral bands covering nine typical urban land cover classes, including asphalt, grass, gravel, trees, bare soil, bricks, and shadows, with a spatial resolution of 1.3 m. The HanChuan dataset was collected by a Headwall Nano-Hyperspec sensor mounted on an unmanned aerial vehicle on 17 June 2016, in Hanchuan, China. It contains 1217 × 307 pixels and 274 spectral bands (400–1000 nm) covering 16 land cover classes, including multiple crop types and mixed urban–rural regions, with a spatial resolution of 0.109 m. The HongHu dataset, also acquired by the Headwall Nano-Hyperspec sensor, on 20 November 2017, in Honghu, China, has an image size of 940 × 475, 270 spectral bands, and 22 land cover classes, mainly farmland, wetlands, buildings, and water bodies, with a spatial resolution of 0.043 m. The Houston dataset was collected by the ITRES CASI 1500 sensor in the University of Houston area, Texas, USA, and comprises 349 × 1905 pixels and 144 bands (380–1050 nm) with 15 land cover classes and a spatial resolution of approximately 2.5 m. The significant differences in spatial and spectral characteristics across these datasets allow a thorough evaluation of model robustness and generalization capability.
Prior to training and evaluation, the official ground-truth annotations provided with each dataset were adopted. Pixels annotated as background or unlabeled regions were assigned an ignore label and therefore did not contribute to the loss computation or quantitative evaluation. During both training and inference, however, the complete hyperspectral image was processed in an end-to-end manner without removing background regions or cropping image patches. This strategy preserves the spatial continuity of the scene while ensuring that only valid semantic classes contribute to model optimization and accuracy assessment.
4.1.2. Evaluation Metrics and Comparison Methods
First, model performance was quantitatively evaluated using Overall Accuracy (OA), Average Accuracy (AA), and the Kappa coefficient. OA reflects the overall classification accuracy, AA measures the average classification performance across classes, and the Kappa coefficient eliminates the influence of random agreement, providing a more objective assessment of model performance.
To demonstrate the superiority of DFMamba, several representative comparison methods were selected, including traditional machine learning approaches (SVM, RF), graph convolution-based methods (DMSGer, GiGCN), convolutional neural network-based methods covering different convolution paradigms (2D convolution-based FullyContNet and CLOLN, hybrid 2D-3D convolution-based HybridSN, 3D residual convolution-based SSRN), and Transformer-based methods (SpectralFormer, GSC-ViT). To guarantee a fair comparison, all comparative models follow the unified pixel sampling rule: 30 training pixels and 10 validation pixels are randomly extracted from each land-cover class, all leftover labeled pixels form the test set, and the whole sampling procedure is reproduced 10 times with different random seeds to obtain stable statistical results. These methods cover the main development pathways in hyperspectral image classification from traditional machine learning to deep learning and state-space models, thus comprehensively reflecting the differences in spatial–spectral feature modeling.
4.1.3. Implementation Details and Sampling Strategy
All experiments were implemented in the PyTorch framework on a workstation equipped with an NVIDIA RTX 3090 GPU (24 GB VRAM), an Intel Xeon Gold 6226R CPU, and 256 GB RAM. To ensure a strictly fair comparison, the sampling configuration strictly follows the baseline MambaHSI [
26]: 30 training samples and 10 validation samples per class, with the remaining pixels used for testing. Addressing the potential sampling bias inherent in such few-shot settings, the specific 30 training samples and 10 validation samples for each class were independently and randomly redrawn for every single one of the 10 experimental runs. This rigorous cross-validation strategy, rather than a one-time split, guarantees that the reported averages and the low standard deviations reflect the model’s true learning capability under extreme label scarcity, rather than artifacts of a favorable data split. The model was optimized using the Adam optimizer with an initial learning rate of 0.0003 and a batch size of 1. Since the proposed framework adopts an end-to-end full-scene input strategy, each training sample corresponds to an entire hyperspectral image. Owing to the high memory consumption of full-scene feature extraction on the GPU, the batch size is set to be 1 to satisfy the available GPU memory constraints.The Mamba module parameters were set to follow the original reference [
26] to ensure fair comparison. Ground-truth pixels labeled as background or unlabeled regions were assigned an ignore label during training. Consequently, they were excluded from loss computation and quantitative evaluation but remained in the input image during the forward pass, enabling end-to-end dense prediction over the complete hyperspectral scene.Unless otherwise specified, the channel compression factor of the proposed HSAE module was set to
throughout all experiments. The rationale for selecting this value, together with its sensitivity analysis and computational complexity comparison, is presented in
Section 4.2.
4.2. Channel Compression Factor Selection and Sensitivity Analysis
The proposed HSAE module introduces the channel compression factor N, which determines the feature dimensionality before the spatial–spectral Mamba encoder. Since N directly influences both feature representation capability and computational complexity, its value was determined through sensitivity analysis rather than exhaustive grid search. A smaller N may excessively compress spectral information, whereas a larger N increases computational cost without necessarily providing consistent accuracy improvements. Therefore, both classification performance and computational efficiency should be considered when selecting N.
To investigate the influence of
N, four representative settings,
, were evaluated on the UP, HanChuan, HongHu, and Houston datasets. The corresponding OA and AA results are reported in
Table 3. The highest accuracy varies across datasets and evaluation metrics, indicating that no single value of
N is uniformly optimal. To provide an overall comparison, an average-rank analysis was additionally conducted. For each dataset, the four settings were ranked separately according to OA and AA, and the resulting eight ranks were averaged to obtain the mean accuracy rank. As summarized in
Table 4,
achieves the lowest mean accuracy rank (1.625), followed by
(2.125),
(2.250), and
(4.000), suggesting comparatively consistent classification performance across the evaluated datasets. The mean accuracy rank is calculated from the OA and AA rankings, while parameter count and FLOPs are reported separately as computational complexity measures.
Table 4 further shows that increasing
N from 28 to 32 raises the average parameter count from 144.13 K to 179.77 K and the average FLOPs from 25.01 G to 30.20 G, corresponding to increases of approximately 24.7% and 20.8%, respectively. Increasing
N to 48 further raises the average parameter count to 318.50 K and the average FLOPs to 56.28 G, representing increases of approximately 121.0% and 125.0%, respectively. Although
requires the lowest computational cost, it exhibits the poorest overall classification performance. In contrast, the substantially higher computational cost of
and
does not lead to a better mean accuracy rank than
.
Therefore, although is not the best-performing setting for every individual dataset or evaluation metric, it achieves the lowest cross-dataset mean accuracy rank while requiring substantially lower computational cost than the larger settings. Accordingly, was adopted as the default channel compression factor in all subsequent experiments.
4.3. Comparison with State-of-the-Art Methods
As shown in
Table 5, the proposed DFMamba method achieved the best or near-best classification performance on all four datasets. On the UP dataset, our method reached an OA of 97.41%, which is 1.67 percentage points higher than the baseline MambaHSI and 2.44, 2.94, 4.76, 6.31, 7.21, and 9.08 percentage points higher than other state-of-the-art methods CLOLN (94.97%), GiGCN (94.47%), GSC-ViT (92.65%), SpectralFormer (91.10%), HybridSN (90.20%), and SSRN (88.33%), respectively. In terms of AA and the Kappa coefficient, our method also performed excellently, achieving 97.74% and 97.00%, with higher mean values than other compared methods. Traditional machine learning methods SVM and RF achieved relatively poor performance on the UP dataset, with OAs of 71.31% and 70.68%, respectively, confirming the advantage of deep learning-based Mamba architectures for hyperspectral image classification even under the constraint of only 30 training samples per class.
On the HanChuan dataset, DFMamba also demonstrated outstanding performance, with an OA of 92.25%. This represents an improvement of 2.04 percentage points over the baseline MambaHSI, and improvements of 1.82, 5.47, 4.00, 7.11, 7.86, and 9.26 percentage points over SSRN (90.43%), GiGCN (86.78%), HybridSN (88.25%), CLOLN (85.14%), DMSGer (84.39%), and SpectralFormer (82.99%), respectively. The HanChuan dataset has a notably large spatial size (1217 × 307 pixels) and many spectral bands (274). Crucially, even with such a sparse training set covering a wide spatial extent, DFMamba maintains robust feature extraction, validating its effectiveness for large-scale hyperspectral images where dense annotation is impractical.
On the HongHu dataset, our method achieved 95.12%OA, which was higher than that of the baseline MambaHSI by 0.54 percentage points and achieving higher mean OA than FullyContNet (92.19%), CLOLN (87.93%), GiGCN (87.22%), HybridSN (88.89%), and SSRN (92.53%). The HongHu dataset contains 22 land cover classes, the most among the four datasets, demonstrating the strong capability of our method for multi-class classification tasks.
On the Houston dataset, DFMamba reached 94.98%OA, an improvement of 0.52 percentage points over the baseline MambaHSI, and improvements of 3.13, 3.20, 4.62, 4.67, 5.85, and 6.40 percentage points over GSC-ViT (91.85%), HybridSN (91.78%), DMSGer (90.36%), CLOLN (90.31%), SpectralFormer (89.13%), and SSRN (88.58%), respectively. The Houston dataset has a large spatial size (349 × 1905 pixels), and thus our method’s performance demonstrates its capability to handle large-scale images.
From a stability perspective, our method achieved low standard deviations on all datasets, e.g., 0.74%OA on UP and 0.89%on Houston, indicating good stability and reproducibility. In contrast, some methods showed significant performance fluctuations, such as FullyContNet, which exhibited a standard deviation of 9.36%on the UP dataset, and HybridSN, which showed a standard deviation of 1.31%on the HanChuan dataset. The relatively small standard deviations indicate limited run-to-run variability under the adopted sampling protocol.
Overall, across the four datasets, DFMamba achieved an average OA improvement of 25–30 percentage points over traditional machine learning methods (SVM, RF), 5–8 percentage points over graph convolution-based methods (DMSGer, GiGCN), 3–6 percentage points over Transformer-based methods (SpectralFormer, GSC-ViT), and 2–5 percentage points over contrastive learning-based methods (FullyContNet, CLOLN). Furthermore, DFMamba consistently outperformed 3D-CNN-based approaches (HybridSN and SSRN) by margins ranging from 3% to 9%. These results highlight that the linear sequential modeling of DFMamba is inherently more effective at extracting discriminative features from limited training pixels than local cubic convolutions or quadratic attention mechanisms. These improvements are mainly attributable to the following key innovations: the HSAE module performs more effective channel compression and feature extraction via adaptive grouped convolution, depth-wise separable convolution, and spatial attention; the EnhancedBothMamba module adaptively integrates spatial–spectral features through spatial attention fusion; the multi-scale progressive architecture captures features hierarchically from local details to global semantics; and the improved ClsHead module fuses local and global features to achieve fine-grained pixel-level classification. Together, these innovations enable DFMamba to significantly enhance classification accuracy and robustness while maintaining computational efficiency.
4.4. Ablation Study
To comprehensively investigate the contribution of each component in DFMamba, ablation experiments were conducted from three perspectives: overall component analysis, internal component analysis of HSAE, and branch analysis of ClsHead. It should be noted that the SpaMamba and SpeMamba branches are directly inherited from the baseline MambaHSI without architectural modification. Therefore, their individual contributions have already been investigated in the original MambaHSI framework and are not repeated in this work. Instead, this study focuses on the newly introduced components of DFMamba, including the HSAE module, the dual-branch ClsHead, and the proposed fusion strategy. The effectiveness of the EnhancedBothMamba fusion mechanism, including the learnable fusion strategy and residual scaling factor , is further analyzed in the Fusion Mechanism Comparison section.
Firstly, the contributions of the major newly introduced components were evaluated by removing HSAE and ClsHead separately. As shown in
Table 6, removing either HSAE or ClsHead resulted in performance degradation, verifying the effectiveness of these modules in the proposed framework.
On the HanChuan dataset, removing HSAE and ClsHead resulted in OA decreases of 2.70 and 11.33 percentage points, respectively. In particular, removing ClsHead caused a substantial decrease of 10.60 percentage points in the Kappa coefficient, indicating that the proposed classification head plays an important role in improving classification consistency.
On the HongHu dataset, removing HSAE caused a relatively small OA decrease of 0.45 percentage points, whereas removing ClsHead resulted in a significant OA reduction of 19.52 percentage points. Since HongHu contains 22 land-cover categories, this large performance degradation demonstrates the importance of the dual-branch ClsHead in distinguishing complex categories. The full DFMamba achieves the best performance by jointly exploiting feature representation and classification refinement.
On the Houston dataset, removing ClsHead reduced the OA by 2.92 percentage points. Although the Kappa standard deviation slightly increased from 2.10% to 2.12%, this difference is very small and mainly reflects run-to-run variability rather than a meaningful stability change.
On the UP dataset, removing HSAE decreased the OA by 0.92 percentage points, while removing ClsHead resulted in a larger degradation of 6.34 percentage points. These results indicate that ClsHead has a more significant influence on classification performance, whereas HSAE mainly contributes to discriminative feature representation.
The computational efficiency comparison is presented in
Table 7. Removing HSAE generally increases the overall training and testing time on most datasets, indicating that the proposed HSAE design provides an effective balance between feature representation and computational efficiency. In contrast, removing ClsHead causes only marginal runtime variations. For example, on the Houston dataset, removing ClsHead slightly increases the testing time by 0.25%. This counter-intuitive variation does not indicate that ClsHead introduces additional efficiency advantages, but is mainly caused by runtime fluctuations related to GPU execution scheduling, memory access patterns, and measurement noise. Therefore, the computational overhead introduced by ClsHead is considered negligible.
To further analyze the internal design of HSAE, several simplified variants were constructed by retaining only one feature extraction branch or replacing the grouped convolution operation. The results are reported in
Table 8.
The complete HSAE consistently achieves the highest classification accuracy across all four datasets, demonstrating that the depth-wise feature extraction branch and the spatial attention branch provide complementary information. Removing either branch leads to performance degradation, indicating that the dual-branch design is beneficial for capturing different aspects of hyperspectral spatial–spectral features.
Among the single-branch variants, Depth-wise Branch Only generally achieves better performance than Attention Branch Only. This suggests that local spatial–spectral feature extraction provides fundamental information for pixel-level classification. Meanwhile, the spatial attention branch further improves feature discrimination by emphasizing informative regions and suppressing less relevant responses.
The w/o GroupConv variant also exhibits performance degradation compared with the complete HSAE, demonstrating that grouped convolution contributes to effective spectral feature compression and preservation of useful channel information. Overall, these results verify that the three components of HSAE play complementary roles, and their combination provides the best classification performance.
Finally, the effectiveness of the proposed dual-branch ClsHead was investigated by retaining only the local branch or the global branch. The corresponding results are shown in
Table 9.
The complete ClsHead consistently outperforms both single-branch variants on all datasets, confirming the effectiveness of jointly modeling local spatial details and global semantic information. The Local Branch Only variant generally performs better than the Global Branch Only variant, especially on datasets with complex spatial structures, indicating that local spatial patterns are critical for hyperspectral image classification.
However, neither branch alone can achieve the performance of the complete dual-branch design. The performance improvements obtained by combining the two branches demonstrate that local and global representations are complementary and jointly enhance the robustness of the final classification.
Overall, the ablation experiments validate the effectiveness of the newly introduced components in DFMamba. The overall component analysis demonstrates that HSAE and ClsHead are both essential for achieving high classification accuracy. The HSAE analysis further verifies that grouped convolution, depth-wise feature extraction, and spatial attention jointly contribute to effective spatial–spectral representation learning. Meanwhile, the ClsHead analysis confirms that integrating local and global information is superior to using either branch independently. The effectiveness of the EnhancedBothMamba fusion mechanism is further verified through dedicated fusion strategy comparisons in the following section.
4.5. Fusion Mechanism Comparison
The learnable residual scaling factor
introduced in Equation (
8) controls the contribution of the input shortcut. In contrast, an ordinary residual connection uses a fixed unit coefficient. In contrast, standard (ordinary) residual connections—which are always present in all variants as the default skip connection—use a fixed identity path. Therefore, disabling
does not remove the residual connection but fixes its scaling coefficient to one. To demonstrate the contribution of
, we provide details for six variants in
Table 10: (1) the full DFMamba (learnable weighted fusion + learnable residual scaling
); (2) learnable weighted fusion without
(i.e., ordinary residual only); (3) attention fusion without
(ordinary residual); (4) attention fusion with
(learnable residual scaling); (5) convolutional fusion without
(ordinary residual); and (6) convolutional fusion with
(learnable residual scaling).
On all four datasets, the full DFMamba achieved the highest OA and AA and provided the best overall performance, albeit with modest improvements. Adding to attention fusion yielded a slight gain of approximately 0.5–0.9 percentage points in OA over the ordinary residual attention version (e.g., on HanChuan: 91.10% vs. 90.24%; on UP: 96.95% vs. 96.46%). Similarly, adding to convolutional fusion brought a small boost of approximately 0.4–0.9 percentage points. These steady, albeit modest, enhancements demonstrate that contributes positively to model performance. In contrast, the enhanced variants still fell short of learnable weighted fusion without , and even further behind the full DFMamba. For instance, on HongHu, learnable weighted fusion without achieved 94.67% OA, attention + reached 94.96%, and conv + reached 94.70%, while DFMamba obtained 95.12%. On Houston, the large standard deviation of conv fusion without (% Kappa) was substantially reduced when was added (% Kappa), demonstrating that the learnable residual scaling factor also helps stabilize training.
These results indicate that (i) the learnable weighted fusion mechanism is more effective than attention-based or convolutional fusion, and (ii) the learnable residual scaling factor provides a small yet consistent improvement in both accuracy and robustness. Therefore, our final model DFMamba employs both learnable weighted fusion and learnable residual scaling .
4.6. Computational Complexity and Efficiency Analysis
As shown in
Table 11, the improved model significantly reduced the number of parameters and computational load (FLOPs) compared to the baseline across all datasets. On the UP dataset, the improved model cut parameters by 70.0% and FLOPs by 70.0% relative to the baseline. Similar sharp reductions were observed across other datasets: for example, the number of parameters of the improved model on the HanChuan dataset dropped by 71.2% and the number of FLOPs decreased by 74.4% compared to the baseline. In terms of training and inference efficiency, the improved model achieved substantial time savings. On the UP dataset, training time was reduced by 43.7% and inference time by 36.5% versus the baseline. These efficiency gains are primarily attributable to the proposed HSAE module. With its distinct design (incorporating grouped convolution, depth-wise separable convolution, and spatial attention), this module enables more precise feature extraction and fusion even with fewer network layers or a shallower overall architecture. Thus, while the HSAE module itself may introduce marginal computational overhead per operation, its strong feature representation capability allows for the simplification of the overall network structure, ultimately significantly cutting down the model’s total parameter count and computational load (FLOPs) and translating to notable reductions in training and inference time, as mentioned above.It should be noted that the parameter and FLOP statistics of the baseline model on the Houston dataset are reported as N/A because the additional memory overhead introduced by the profiling procedure exceeded the available GPU memory. This limitation only affected parameter/FLOP profiling and did not prevent normal model training or inference. Therefore, the corresponding training and inference times are still reported for reference, since they were measured independently under the standard execution setting without profiling.
Overall, the improved model achieved a significant performance boost. Rather than incurring extra computational complexity, the model realized substantial reductions in both parameter count and FLOPs across datasets, with training and inference time being cut by approximately 36–47% and 40–50%, respectively. Even with the incorporation of grouped convolution, depth-wise separable convolution, and spatial attention mechanisms, the enhanced feature extraction and fusion capability of these modules allowed the overall network architecture to be simplified. This balance between performance and efficiency enhances its practical applicability and deployability.
4.7. Visualization Analysis
To evaluate the training dynamics and convergence characteristics of DFMamba using the HanChuan dataset as a representative case, prediction results at different training stages were systematically recorded in the validation set. As shown in the visualization sequence in
Figure 2, the model progressively improved in classification accuracy and spatial consistency throughout training. At the early stage (epoch 50), predicted maps still had coarse boundaries and some misclassified regions, indicating that the model was primarily learning basic discriminative features. By epoch 100, classification boundaries became clearer, and misclassification areas were reduced. By epoch 150, the model produced accurate classification results with significantly improved spatial consistency. At epoch 200, the model achieved stable and consistent predictions, with clear boundaries and minimal misclassification artifacts, indicating successful convergence. Comparing predictions at different epochs with the ground truth shows that the model effectively learns hierarchical spectral–spatial features for precise pixel-level classification while maintaining spatial consistency among adjacent regions.
To further illustrate the contributions of key components using the Pavia University dataset as a representative example,
Figure 3 presents classification maps generated by different model variants, all displayed after applying the official background mask. From the visual results, it can be seen that the complete improved model (
Figure 3b) significantly outperformed the baseline (
Figure 3c) in boundary precision and spatial consistency, especially in areas with complex land cover distributions. In contrast, removing the HSAE module (
Figure 3d) resulted in blurred boundaries and increased misclassification, validating its importance in feature extraction and channel compression. Variants using only attention fusion (
Figure 3e), convolutional fusion (
Figure 3f), or dynamic weight fusion (
Figure 3g) produced relatively reasonable results but were inferior to the full model in boundary precision and spatial consistency, demonstrating the necessity of component synergy for optimal performance. Variants with gated fusion (
Figure 3h) or removal of the improved classification head (
Figure 3i) also showed performance degradation, further confirming the effectiveness of the proposed architectural design.
4.8. Inference Scalability with Spectral Sequence Length
To further evaluate the computational scalability of the proposed method, we investigate how inference latency varies with the spectral sequence length. Let denote the spectral sequence length, where C is the number of input spectral bands. Specifically, C is gradually increased from 20 to 200 while the spatial resolution is fixed at . Three representative models are compared: the Transformer-based SpectralFormer, the Mamba-based baseline MambaHSI, and the proposed DFMamba. This experiment focuses on the practical scaling behavior of different sequence modeling mechanisms with respect to the spectral dimension.
For a fair comparison, all models are evaluated with a batch size of 1 in evaluation mode, with gradient computation disabled. Before timing, 10 warm-up iterations are performed to reduce initialization and CUDA startup overhead, followed by 50 consecutive forward passes. The median inference latency is reported, and all methods follow the same input configuration and timing protocol. The results are shown in
Figure 4. The complexity annotations in the figure indicate the theoretical complexity classes of the corresponding sequence modeling mechanisms rather than fitted empirical growth functions.
As shown in
Figure 4, SpectralFormer exhibits the steepest latency-growth trend, increasing from 1.16 ms at
to 3.72 ms at
, corresponding to an increase of approximately
. Although practical GPU execution may introduce deviations from ideal theoretical behavior, the overall trend is consistent with the expected
complexity of self-attention. This result indicates that the computational cost of Transformer-based spectral modeling becomes increasingly significant as the spectral sequence length grows.
For MambaHSI, the inference latency increases from 0.63 ms at to 1.57 ms at , corresponding to an increase of approximately . Its overall latency-growth trend is considerably smoother than that of SpectralFormer and is consistent with the expected complexity of state-space sequence modeling. Moreover, the latency ratio between SpectralFormer and MambaHSI increases from approximately at to at , indicating that the computational advantage of linear sequence modeling becomes more evident for longer spectral inputs.
It should be noted that the present experiment compares inference latency under fixed network configurations rather than equivalent classification accuracy. DFMamba introduces additional feature extraction components, including HSAE and the enhanced classification head, to strengthen spatial–spectral representation before and after sequence modeling. These additional convolutional, attention, and multi-branch operations inevitably introduce extra computational overhead, resulting in higher absolute inference latency than MambaHSI. Therefore, the observed latency difference should be interpreted as the computational cost of the enhanced representation capability rather than a change in the linear scalability of the underlying Mamba sequence modeling mechanism.
The inference latency of DFMamba increases from 1.30 ms at to 2.13 ms at , corresponding to an endpoint ratio of approximately . Although its absolute latency is higher than that of MambaHSI, the relative increase across the evaluated sequence-length range is the smallest among the three compared methods. This result indicates that DFMamba is less sensitive to increasing spectral sequence length than SpectralFormer.
The favorable scaling behavior of DFMamba is also consistent with the design of HSAE, which compresses an arbitrary number of input spectral bands into a fixed latent representation of channels before the subsequent Mamba blocks. Consequently, the feature dimensionality processed by the main Mamba backbone does not increase proportionally with the original number of spectral bands. The additional modules therefore mainly contribute a relatively stable computational overhead, while the dependence of the backbone computation on the spectral sequence length remains consistent with linear-complexity sequence modeling.
Minor non-monotonic variations can be observed at several intermediate sequence lengths. These fluctuations are attributable to normal GPU runtime variability, including CUDA kernel scheduling, cache behavior, memory-access patterns, and hardware-level parallel execution. Their influence is reduced by applying the same warm-up and timing procedure to all methods and reporting the median latency over 50 forward passes. Therefore, the results are interpreted primarily according to the overall scaling trend rather than isolated differences between adjacent sequence lengths.
At , DFMamba requires 2.13 ms for one forward pass, whereas SpectralFormer requires 3.72 ms, corresponding to an inference-time ratio of approximately in favor of DFMamba. Meanwhile, MambaHSI remains the fastest model in terms of absolute inference latency. These results show that the additional modules introduced in DFMamba incur a moderate computational cost, but do not produce the rapidly increasing latency associated with quadratic self-attention.
Overall, the empirical observations are consistent with the theoretical complexity characteristics of the compared sequence modeling mechanisms. SpectralFormer exhibits substantially faster latency growth because of quadratic self-attention, whereas MambaHSI and DFMamba show overall trends consistent with linear-complexity state-space modeling. Although DFMamba has higher absolute inference latency than MambaHSI owing to its additional feature extraction and classification modules, these components mainly introduce a relatively stable computational overhead. As a result, DFMamba preserves the favorable scalability of Mamba-based sequence modeling and remains substantially less sensitive to increasing spectral sequence length than the Transformer-based baseline.
5. Discussion
5.1. Interpretation of Key Results
The experimental results in
Section 4 demonstrate that the proposed DFMamba model consistently achieved competitive classification accuracy and computational efficiency across four benchmark hyperspectral datasets. The HSAE module, which combines adaptive group convolution, depth-wise separable convolution, and spatial attention, was the primary driver of parameter reduction (approximately 70%) and FLOPs reduction (approximately 70–74%) while maintaining or improving accuracy. This is because HSAE effectively compresses highly redundant spectral channels without losing discriminative information, while its spatial-attention operation selectively enhances informative regions. The model without HSAE exhibited consistent OA degradation, including decreases of 0.92 percentage points on UP and 2.70 percentage points on HanChuan, confirming its contribution.
The EnhancedBothMamba module inherits the spatial–spectral dual-branch design from the baseline MambaHSI, where the effectiveness of separately modeling spatial and spectral dependencies has already been demonstrated [
26]. Therefore, this study does not repeat the branch-level ablation of SpaMamba and SpeMamba, but instead focuses on evaluating the proposed improvements over the original dual-branch framework. The experimental results demonstrate that the proposed learnable weighted fusion strategy provides more effective feature integration than the compared convolutional fusion and spatial-attention fusion alternatives. This improvement can be attributed to the ability of the learnable fusion weights to optimize the relative contribution of spatial and spectral representations during end-to-end training. Specifically, the fusion coefficients are global model parameters shared across samples, channels, and spatial positions, rather than input-dependent adaptive weights. In addition, the learnable residual factor
further adjusts the contribution of shortcut information, improving feature propagation and contributing to the overall robustness of the network.
The improved ClsHead has a substantial impact on complex datasets. For example, on HongHu, which contains 22 classes, removing ClsHead reduced OA by 19.52 percentage points. The dual-branch design of ClsHead, consisting of a local convolution for spatial details and a global convolution for channel-wise semantics, is essential for separating fine-grained categories such as different crop types. The local branch enhances subtle spatial structures such as field boundaries and texture variations, whereas the global branch refines channel-wise semantic responses by integrating complementary spectral information. Their combination enables more discriminative feature representations for categories with high inter-class similarity. Without this module, the model loses local discriminative cues and relies excessively on global feature maps, leading to severe misclassification, especially for land-cover classes that exhibit similar spectral signatures but differ in fine spatial patterns.
Another important implementation choice is that background or unlabeled pixels are retained during forward propagation but excluded from optimization and quantitative evaluation using the predefined ignore label. This strategy enables dense end-to-end prediction over complete hyperspectral scenes while preventing invalid annotations from affecting parameter optimization. Consequently, the proposed framework simultaneously preserves spatial continuity and ensures a fair evaluation on annotated semantic classes.
5.2. Limitations
Despite its strong performance, DFMamba has several limitations. First, the training setting uses only 30 labeled samples per class, which may not fully exploit the representation capability of state-space models. In extremely low-sample scenarios (e.g., 5–10 samples per class), the model may suffer from overfitting due to insufficient supervision. Second, the model does not incorporate explicit class-rebalancing mechanisms. Although balanced sampling is adopted during training, extremely long-tailed class distributions may still result in biased predictions toward majority classes, and dedicated loss functions or adaptive sampling strategies may be required for highly imbalanced datasets.
Third, although DFMamba achieves linear time complexity, memory consumption still increases with input image size. For instance, on the Houston dataset (349 × 1905 pixels), training required approximately 8 GB of GPU memory. Therefore, patch-based inference or image tiling strategies may still be necessary for processing extremely large-scale hyperspectral scenes.
Fourth, the current model has not been extensively validated under complex real-world conditions. In noisy scenarios, such as images affected by sensor noise or atmospheric interference, classification performance may degrade because the spectral branch relies on fine-grained spectral signatures that can be corrupted by noise. Moreover, cross-domain generalization remains challenging. When hyperspectral images are collected from different sensors, geographical regions, or acquisition conditions, variations in spectral responses and spatial resolutions may introduce domain shifts, limiting the direct transferability of the trained model.
5.3. Future Work
Based on these findings, several promising directions can be explored in future work. Firstly, integrating DFMamba with active learning could reduce the annotation burden by selectively labeling the most informative pixels, which is particularly valuable for hyperspectral applications with limited labeled samples. Secondly, further model compression through knowledge distillation or quantization could improve the deployment capability of DFMamba on resource-constrained platforms such as drones or satellites.
Thirdly, extending the dual-branch architecture to hyperspectral unmixing and change detection is another possible direction, as the spectral branch’s long-range dependency modeling may benefit endmember extraction and temporal spectral analysis. Fourth, to improve cross-scene hyperspectral image classification capability, future research could incorporate domain adaptation techniques, such as adversarial domain adaptation, feature alignment, or meta-learning, to reduce distribution discrepancies between different sensors and geographical regions. In addition, noise-robust training strategies, including spectral denoising modules and noise-aware optimization, could be investigated to enhance model reliability under degraded imaging conditions. Finally, self-supervised pre-training on large-scale unlabeled hyperspectral datasets may provide more robust spatial–spectral representations and further improve the model’s generalization ability in unseen scenarios.
6. Conclusions
In this study, we proposed the DFMamba model for hyperspectral image classification, building on the baseline MambaHSI architecture. The core innovations of the model can be summarized as follows: First, we designed the channel-optimized spatial–spectral module (HSAE), which leverages the synergy of adaptive grouped convolution, depth-wise separable convolution, and spatial attention mechanisms to enhance feature discriminability while reducing parameter count, effectively addressing the high dimensionality and redundancy challenges inherent in hyperspectral data. Secondly, within the inherited spatial–spectral dual-branch Mamba framework, we introduced softmax-normalized learnable global weights and a learnable residual scaling factor to combine the SpaMamba and SpeMamba outputs. Convolutional fusion and spatial-attention fusion were evaluated only as comparison variants. Finally, we constructed an improved classification head, ClsHead, which combines local spatial details and channel-semantic features through a dual-branch aggregation strategy. The model retains the linear-complexity property of Mamba-based sequence modeling, in contrast to the quadratic complexity of standard self-attention.
Experimental results on four standard hyperspectral datasets—Pavia University, Houston, HanChuan, and HongHu—demonstrated that DFMamba achieved competitive performance compared with methods based on traditional machine learning (SVM, RF), graph convolutional networks (DMSGer, GiGCN), convolutional neural networks (FullyContNet, CLOLN), and Transformer architectures (SpectralFormer, GSC-ViT). Moreover, the model retained the favorable linear-complexity characteristics of Mamba-based sequence modeling while achieving efficient computation, supporting the practical potential of the proposed approach. This study demonstrates the applicability of state-space-based Mamba architectures to hyperspectral image classification and provides a promising approach for balancing classification performance and computational efficiency. It also offers useful references for future research in hyperspectral image analysis.