Next Article in Journal
Fly High or Fly Low? Selecting Time-Efficient UAV Search Strategies for High-Recall Aerial Detection
Previous Article in Journal
Dual-Space Knowledge Distillation with Cross-Geometric Feature Interaction for Hyperspectral Image Classification
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Dual-Stream Spatial–Spectral Network with Nested Attention for Hyperspectral Image Classification

1
China Jiliang University, Hangzhou 310018, China
2
School of Physics and Optoelectronic Engineering, Hangzhou Institute for Advanced Study, University of Chinese Academy of Sciences, Hangzhou 310024, China
3
Zhejiang Tuogan Technology Co., Ltd., Haining 314400, China
*
Author to whom correspondence should be addressed.
Remote Sens. 2026, 18(18), 3126; https://doi.org/10.3390/rs18183126
Submission received: 27 July 2026 / Revised: 5 September 2026 / Accepted: 9 September 2026 / Published: 11 September 2026
(This article belongs to the Section Remote Sensing Image Processing)

Highlights

What are the main findings?
  • The DSSN obtains overall accuracies of 98.11%%, 99.88% and 99.82% on Indian Pines, Pavia University and Salinas, respectively, exceeding the tested CNN, Transformer and hybrid baselines.
  • The ablation results demonstrate that all three components of the DSSN, the 3D-CNN stream, the nested Transformer branch, and the adaptive fusion module, contribute to improving the final classification performance.
What are the implications of the main findings?
  • Separating local spectral–spatial extraction from contextual modelling helps reduce spectral confusion and fragmented predictions in benchmark HSI scenes.
  • Channel-wise adaptive fusion offers a practical way to combine CNN-derived local details with Transformer-derived spatial context.

Abstract

Hyperspectral image classification (HSI) requires a model to distinguish subtle spectral differences while preserving the spatial structure of land-cover regions. CNN-based methods are effective for local spectral–spatial extraction, but their limited receptive fields can weaken broader context modelling. Transformer-based methods improve long-range dependency modelling, yet fixed patch partitioning may reduce their sensitivity to fine local structures. To address these limitations, this study proposes the Dual-Stream Spatial–Spectral Network with Nested Attention (DSSN), which separates local spectral–spatial feature extraction from multi-scale spatial-context modelling before adaptive fusion. The DSSN combines a cascaded 3D-CNN spectral stream, a nested Transformer spatial stream with pixel-level and patch-level interactions, and a channel-attention-based adaptive fusion module. Experiments on Indian Pines, Pavia University and Salinas show DSSN achieves overall accuracies of 98.11%%, 99.88% and 99.82%, respectively, outperforming other baselines. The ablation experiments confirm that each major component contributes to the final performance. Although the model requires more parameters and longer inference time than several compared baselines, its inference time remains at the millisecond level. These results suggest that decoupled spatial–spectral representation and adaptive multi-scale fusion can improve hyperspectral image classification under the evaluated benchmark settings.

1. Introduction

Hyperspectral imaging (HSI) records dense spectral responses for each spatial location, allowing materials with similar visual appearances to be distinguished more effectively than in RGB or multispectral imagery [1,2]. Compared with multispectral or RGB imaging, HSI provides many narrow spectral bands that can reveal subtle material differences. This capability has enabled important applications in precision agriculture [3,4,5], geological exploration [6], environmental monitoring [7], and urban planning [8]. Early HSI classification methods mainly relied on handcrafted features and shallow classifiers; these approaches are often insufficient for complex scenes because they have limited ability to learn nonlinear spectral–spatial representations [9,10]. Deep learning methods improved this situation by learning features directly from data; 1D-CNN models strengthened spectral modelling but treated pixels largely independently [11]; 2D-CNN models improved spatial texture extraction after dimensionality reduction, although part of the original spectral information could be lost [12]; 3D-CNN models further exploited the cube structure of HSI data by jointly processing adjacent spectral bands and neighboring pixels [13,14]. Later, contextual, recurrent and hybrid CNN models showed that spectral information and spatial context should be learned together rather than handled in isolation [15,16,17]. Since Transformers were introduced into computer vision, self-attention has been used to model long-range dependencies in HSI classification [18]. SpectralFormer was among the first Transformer backbones designed specifically for HSI, using grouped spectral embedding to model non-local spectral interactions [19]. However, it emphasizes global spectral correlations and pays less attention to fine-grained local spatial textures. To combine CNN-based local perception with Transformer-based global modelling, Sun et al. proposed SSFTT, a serial hybrid architecture that uses CNNs for feature extraction and Transformers for association modelling [20]. Although this design improves spatial–spectral complementarity, serial propagation can mix spatial and spectral information in ways that weaken subtle spectral cues. In addition, most ViT-based Transformers rely on fixed patch partitions, which limits their ability to represent multi-scale land-cover patterns [21].
These limitations motivate a model in which local spectral–spatial evidence and broader spatial context are learned as complementary representations. We therefore propose the Dual-Stream Spatial–Spectral Network with Nested Attention (DSSN). The spectral stream uses cascaded 3D-CNN layers to learn short-range spectral correlations and local micro-textures. The spatial stream uses a nested Transformer to connect pixel-level and patch-level contextual information. A block aggregation mechanism transfers local details into a wider spatial representation, and an adaptive fusion module (AFM) adjusts the contribution of the two streams through channel attention. In this way, DSSN does not simply stack convolution and self-attention, but assigns them different roles before adaptive fusion.

2. Materials and Methods

2.1. Proposed DSSN Architecture

This section presents the structure of the DSSN and the role of each branch. The DSSN is organized around three core components, a 3D-CNN spectral stream for local spectral–spatial feature extraction, a nested Transformer spatial stream for multi-scale contextual modelling, and an AFM for dynamic feature integration. Given an input hyperspectral patch, the two streams learn complementary representations from different receptive-field ranges. The AFM then recalibrates and fuses these representations before the final classification layer. The spectral stream is designed to preserve short-range spectral correlations and local spectral–spatial structures. Hyperspectral data are naturally represented as volumetric cubes, and 3D convolutions are suitable for jointly processing neighboring spatial pixels and adjacent spectral bands. Therefore, this stream is built from cascaded 3D convolutional layers, as shown in Figure 1a.
Let the input feature map of the l 1 t h layer be V l 1 , with the dimensions of the feature maps being H l 1 × W l 1 × D l 1 ; this layer contains N l 3D convolutional kernels, K i ˙ j l , with indexing the current feature map and j indexing the connected feature map from the previous layer. The activation of the i t h feature map at spatial–spectral position x , y , z in layer l , denoted as v l , i x , y , z , is computed as follows [22]:
v l , i x , y , z = ϕ j = 0 N l 1 1 p = 0 P l 1 q = 0 Q l 1 r = 0 R l 1 w l , i , j p , q , r v l 1 , j x + p y + q z + r + b l , i
In this equation, ϕ ( ) represents the nonlinear activation function. N l 1 is the number of feature maps in the previous layer. P l , Q l , R l denote the height, width and spectral depth of the 3D convolution kernel, respectively. The kernel parameter is denoted by w , and b is the bias term. The indices p , q , r specify positions inside the convolutional kernel, while j indexes the connected feature map from the previous layer. Then, the spectral stream feature F s p e c is obtained with the shape B , C 1 , H C , W c .
In DSSN, the spectral stream contains three 3D convolutional layers. To avoid excessive compression along the spectral dimension, the network uses valid padding spectrally and same padding spatially; this design progressively aggregates spectral information and produces a feature cube enriched with spectral features. Although the spectral stream captures local spectral–spatial patterns, its convolutional receptive field is limited. DSSN therefore introduces a nested Transformer spatial stream to model broader contextual dependencies. The module contains an inner pixel-level loop for fine local interactions and an outer patch-level loop for broader spatial relationships, allowing local details and global context to be represented within the same nested attention structure.
Assume the input to the DSSN is the preprocessed hyperspectral data cube X ϵ R B × D × H × W , where B, D, H, and W represent the batch size, the number of spectral bands, the input height, and the input width, respectively. When necessary, the input is padded along the bottom and right boundaries so that the padded height, H , and width, W′, are divisible by P. The outer-patch grid is defined as G h = H / P and G w = W / P , and the number of outer patch tokens is N pat . Each outer patch contains N pix = P / p 2 pixel-level tokens. The input X is mapped into two separate embedding spaces using the following formulas:
U p i x = Unfold k = p , s = p X outer R B × N p a t × N pix × D p 2
Z p i x 0 = U pix W pix + b pix + E p o s p i x R B × N p a t × N pix × C pix
U p a t = Flatten X outer R B × N p a t × D P 2
Z p a t 0 = U p a t W p a t + b p a t + E p o s p a t R B × N p a t × C p a t
The pixel-level branch applies a non-overlapping unfold operation within each outer patch. The resulting token sequence, U pix , has N pix tokens per outer patch, and each token contains the spectral values from a p × p spatial subregion. Therefore, the unprojected token dimension is D p 2 . A learnable linear projection maps each token to the pixel-level embedding dimension, C pix , producing Z pix 0 . In parallel, the patch-level branch flattens each outer patch into a single patch token. Each outer patch contains D p 2 values before projection, and the resulting patch-level sequence contains N pat tokens. The projected patch-level representation is denoted by Z pat 0 . This step establishes two parallel yet interconnected sequences: Z p i x for capturing local details and Z p a t for carrying global information.
In the l t h nested attention block, Multi-Head Self-Attention (MSA) [22,23] is applied to model the local correlations between the pixels. The formula is as follows:
Z ^ p i x l = Z p i x l 1 + MSA L N Z p i x l 1
where Z p i x l 1 denotes the pixel-level feature entering the l t h layer, and Z ^ p i x l denotes the attention-updated intermediate representation. Subsequently, the DRNet is used in the feedforward block instead of a conventional Multi-Layer Perceptron (MLP) [24] to improve nonlinear feature extraction, as shown in Figure 1b, yielding the refined pixel features, Z p i x l , output by the inner loop. The formula is as follows:
Z p i x l = Z ^ p i x l + DRNet L N Z ^ p i x l
As illustrated in Figure 1b, DRNet reshapes the input feature and then feeds it into two consecutive dual-branch blocks. Each block consists of two parallel branches, both comprising a convolutional layer, a batch normalization layer, and an ReLU activation function. The upper branch employs a 3 × 3 convolution to capture local spatial information, whereas the lower branch uses a 1 × 1 convolution to perform channel-wise feature transformation. The outputs of the two branches are fused through element-wise addition. After the two dual-branch blocks, the resulting feature is further refined by a 3 × 3 convolution followed by a PReLU activation. A long residual connection adds the original reshaped feature to the refined feature, facilitating information preservation and stable feature learning. Finally, the fused feature is reshaped to produce the output. The primary purpose of DRNet is to refine the input features by combining local spatial feature extraction, channel-wise feature transformation, and residual learning. This design enhances feature representation while preserving the original information and improving the stability of network optimization.
To pass inner-loop details into the outer layer, the network aggregates pixel-level information along the spatial dimension to obtain an aggregated vector, v a g g l . This operation is defined as follows:
v a g g l = W 1 N i = 1 N Z p i x l i
Here, Z p i x l ( i ) represents the pixel feature and W (   ) is a learnable linear projection matrix used to align the feature dimensions from C p i x to C p a t .
The aggregated local representation, Z p a t l 1 , is then added to the patch-level feature to obtain an enhanced patch feature, U p a t l , which integrates local details and serves as the input for the outer loop. The formula is as follows:
U p a t l = Z p a t l 1 + v a g g l
After obtaining the feature U p a t l , a standard Transformer structure is utilized in the outer loop to model global contextual relationships, yielding the final patch feature, Z p a t l , output by the l t h nested block. This operation is defined as follows:
Z ^ p a t l = U p a t l + MSA L N U p a t l
Z p a t l = Z ^ p a t l + MLP L N Z p a t l
where the intermediate Z ^ p a t l denotes the features after the attention mechanism. The number of nested attention layers and attention heads in the MSA modules used in Equations (6) and (10) are specified in Table 1.
After processing through L layers of nested blocks, the final patch sequence output is obtained. To align the final patch sequence with the spatial feature map generated by the 3D-CNN stream, a spatial reconstruction operation is performed. The resulting feature map, F s p a t , is used as the output feature of the spatial stream, using the following formula:
F s p a t = T L N Z p a t L R B × C 2 × H s × W s
Here, Z pat l denotes the final patch token sequence produced by the nested Transformer blocks. The operator T ( ) rearranges the sequence into the two-dimensional outer-patch grid of size H s × W s , yielding F s p a t B , C 2 , H s , W s . After channel projection using 1 × 1 convolutions, the spatial stream feature, F s p a t , is bilinearly interpolated to match the spectral stream feature, F s p e c . When the input dimensions are not divisible by the outer-patch size, boundary padding is used only to construct a complete token grid; a valid-region mask is generated simultaneously to distinguish the original input pixels from padded positions; the mask is propagated to the pixel-level aggregation and patch-level attention operations; therefore, the padded positions do not contribute to the aggregated representation or attention computation. After spatial interpolation, the valid-region mask is also applied before feature fusion, ensuring that the final prediction is determined only by the original input region.
After the spectral stream feature, F s p e c , and the spatial stream feature, F s p a t , are obtained, with shapes B , C 1 , H C , W c and B , C 2 , H C , W c , respectively, the DSSN uses a channel-attention-based AFM to integrate them. The AFM is inspired by the squeeze-and-excitation mechanism, but is used here to recalibrate the relative contribution of the spectral and spatial streams during dual-stream fusion [25]. Figure 2 shows the AFM workflow; the spectral and spatial feature maps are joined along the channel axis to obtain a mixed feature map, U , with the shape B , C t o t a l , H C , W c . This operation is defined as follows:
U = C o n c a t ( [ F s p e c , F s p a t ] )
C t o t a l = C 1 + C 2
where Concat (   ) denotes the channel-wise joining of the two branch outputs.
To determine the importance of each channel, the representation is simplified. Instead of computing the value of every pixel, this part only requires the overall response intensity of the entire channel. Therefore, this network averages across the H C × W c spatial dimensions to obtain the global channel feature z , with a shape of B , C t o t a l , 1 , 1 ; this vector represents the global distribution of the current sample across all feature channels, and the formula is as follows:
z = G l o b a l A v g P o o l U
Next, a small MLP is used to learn the dependencies between channels; the MLP reduces the number of channels to form a bottleneck representation and then restores the channel dimension. After restoring the channel count to C t o t a l , the output values are mapped between 0 and 1 to obtain the attention weight vector, s , with a shape of B , C t o t a l , 1 , 1 , using the following formula:
s = σ W 2 δ W 1 z
where σ (   ) represents the Sigmoid activation function, δ (   ) represents the ReLU activation function, W 1 is the weight matrix of the first dimensionality reduction layer, and W 2 is the weight matrix of the second dimensionality reduction layer.
The generated weights are multiplied channel-by-channel with the original concatenated features to yield a new mixed feature map, U ; important feature channels are enhanced, while unimportant or noisy channels are suppressed, using the following formula:
U = U s
Finally, these filtered features are blended using a 1 × 1 convolution via linear combination, allowing the two streams to interact across channels; this operation compresses the fused channels, resulting in a more compact spatial output feature, F o u t , using the following formula:
F o u t = C o n v 1 × 1 U
the final feature, F o u t , is mapped to the category space through fully connected layers, followed by a softmax function that outputs the class–probability distribution. The detailed implementation of the forward propagation of DSSN is presented in Algorithm 1.
Algorithm 1 Forward propagation of DSSN.
Input: Hyperspectral patch X ∈ RB×D×H×W
Output: Predicted class yhat
1: S ← X//B × D × H × W
2: S ← Conv3D(S)//3D convolution
3: S ← BN(S); S ← ReLU(S)//Spectral stream
4: S ← Conv3D(S)//3D convolution
5: S ← BN(S); S ← ReLU(S)
6: S ← Conv3D(S)//3D convolution
7: S ← BN(S); S ← ReLU(S)//Spectral feature
8: Xp ← DivideIntoPatches(X, P)//Patch size P × P
9: Q ← PixelEmbedding(Xp, p)//Pixel window p × p
10: K ← PatchEmbedding(Xp)//Patch representation
11: for l = 1, …, L do//L nested blocks
12:     Q ← PixelTransformer(Q)//Inner Transformer
13:     Q ← DRNet(Q)//Local feature refinement
14:     K ← K + Aggregate(Q)//Local-to-patch aggregation
15:     K ← PatchTransformer(K)//Outer Transformer
16: end for
17: R ← SpatialReconstruction(K)//Spatial feature map
18: R ← Resize (R, size(S))//Match S and R
19: F ← Concatenate (S, R)//Dual-stream feature
20: F ← AFM(F)//Adaptive feature fusion
21: F ← AveragePooling(F)//Global average pooling
22: F ← Dropout (F, r)//Dropout rate r
23: F ← FC1(F)//Fully connected layer
24: F ← FC2(F)//Fully connected layer
25: y ← Softmax(F)//K class probabilities
26: yhat ← Argmax(y)//Predicted class
27: return yhat

2.2. Experimental Datasets

Indian Pines [26], Pavia University [27], and Salinas Valley [28] were used to test the model under different agricultural and urban scene conditions. To prevent spatial information leakage caused by overlapping neighborhoods, the labeled pixels were divided into spatially disjoint regions before neighborhood extraction. Of the labeled samples, 10% were used for training, and the remaining labeled samples were used for testing. A buffer zone corresponding to the neighborhood radius was retained between the training and testing regions.
  • Indian Pines [26] was collected by the AVIRIS sensor (NASA Jet Propulsion Laboratory, Pasadena, United States) over an agricultural area in Indiana, USA, in June 1992. The scene contains 145 × 145 pixels and 220 spectral bands from 400 to 2500 nm. After removing 20 water absorption bands, 200 bands are retained. The reference map contains 16 land-cover categories, listed in Table 2. Figure 3 shows the false-color image, grayscale representation and ground-truth map of the scene.
  • The Pavia University dataset [27] was acquired by the ROSIS sensor (German Aerospace Center, Cologne, Germany) over Pavia, Northern Italy. It covers the 430–860 nm spectral range with a spatial resolution of 1.3 m. The image size is 610 × 340 pixels, and 103 spectral bands are used for training. The scene contains nine land-cover categories, as summarized in Table 3. To complement the class statistics in Table 2, Figure 4 illustrates the Pavia University scene through its false-color image, grayscale representation, and ground-truth map.
  • Salinas Valley [28] was captured by the AVIRIS sensor (NASA Jet Propulsion Laboratory, Pasadena, United States) over Salinas Valley, California. The scene has 512 × 217 pixels and a spatial resolution of 3.7 m. Of the original 224 bands, 204 remain after removing 20 water absorption bands. Sixteen land-cover classes are used, as shown in Table 4. Figure 5 gives the false-color image, grayscale representation and ground-truth map.

2.3. Experimental Setup

All experiments were implemented in PyTorch 2024.3.4 and conducted on a workstation equipped with an Intel Core i5-12400F CPU (Intel Corporation, Santa Clara, CA, USA), 16 GB RAM, and an NVIDIA GeForce GTX 1660 Ti GPU (NVIDIA Corporation, Santa Clara, CA, USA); the implementation used CUDA acceleration when available. To reduce the influence of random initialization and data partitioning, the random seeds of Python 3.9, NumPy 1.23.5, and PyTorch 2024.3.4 were fixed during training, and the cuDNN 8.9 backend was set to deterministic mode. For each hyperspectral dataset, the raw hyperspectral cube and its corresponding ground-truth map were loaded from mat files, only labeled pixels were used for training and testing, while background pixels with label value 0 were excluded from metric calculation. In the current implementation, each hyperspectral scene is first divided into a training region and a test region, after which normalization and patch extraction are performed. Specifically, the original hyperspectral scene is represented as H × W × B ; after the data split, the training region is reshaped into H t r a i n W t r a i n × B , and the minimum and maximum values are computed independently for each spectral band. The complete hyperspectral scene is then min–max-normalized using the statistics obtained exclusively from the training region, and the normalized data are reshaped back into the H × W × B format. Then, fixed-size spatial–spectral patches are extracted from the normalized scene around the labeled center pixels in the original ground-truth map; these patches are assigned to the training or test set according to the partition to which their center pixels belong. The spatial patch size was set to 12 × 12, and the number of spectral channels depended on the dataset: 200 bands for Indian Pines, 103 bands for Pavia University, and 204 bands for Salinas. To ensure that pixels located at the image boundaries receive a fixed-size spatial neighborhood, we applied reflection padding to the two spatial dimensions of the normalized hyperspectral image before patch extraction. No padding was applied along the spectral dimension, and reflection padding mirrors the true pixels adjacent to the image boundaries to complete the missing neighborhood and does not introduce zero-valued or constant spectral vectors. For a labeled center pixel located at an image edge or corner, both its spatial coordinate and ground-truth label were retained from the original image; only the portion of its spatial neighborhood extending beyond the original image boundaries was supplemented with reflected values. Consequently, boundary pixels could be inferred using the same input size and model as interior pixels. Importantly, reflected pixels were not treated as additional training or testing samples, center coordinates were selected from the original ground-truth map using the condition gt > 0, and the train–test split was performed exclusively among these original labeled center pixels. The input of DSSN was constructed as a 12 × 12 spatial–spectral patch centered on each labeled pixel. Within each local input patch, the Transformer stream partitions the patch into non-overlapping 6 × 6 outer patches. Each outer patch is further divided into non-overlapping 3 × 3 pixel-level subregions. Therefore, a 12 × 12 input patch produces a 2 × 2 outer-patch grid containing four patch-level tokens, while each outer patch contains four pixel-level tokens; for input dimensions that are not divisible by the outer patch size, reflection padding is applied before tokenization.
Therefore, each input sample retained both the local neighborhood structure and the complete spectral signature of the center pixel. To avoid overlap between training and testing neighborhoods, the image was partitioned into spatial blocks before sample extraction. Different blocks were assigned exclusively to the training or testing partition, and a buffer zone of at least 6 pixels was introduced along the partition boundary, corresponding to the radius of the 12 × 12 neighborhood. Labeled center pixels falling within this buffer zone were excluded from both partitions. Thus, no raw image pixel was shared by any training patch and testing patch. The labeled samples of each dataset were split in a class-wise manner; for every land-cover class, 10 percent of the samples in the designated training region were randomly selected for training, with at least 10 training samples retained per class. The remaining labeled samples were used for testing; this class-wise sampling strategy prevents large classes from dominating the split and ensures that small classes with very few samples still contribute to the training process.
During training, simple spatial data augmentation was applied to the training patches, this included random horizontal flipping, random vertical flipping, and random rotations by multiples of 90 degrees; these operations preserve the spectral identity of the land-cover categories while increasing the spatial diversity of local neighborhoods. Such augmentation is particularly suitable for hyperspectral image classification because many land-cover classes are not sensitive to absolute orientation, but the model still needs to recognize them under different local spatial arrangements. The proposed DSSN was trained for 200 epochs with a batch size of 64; AdamW was used as the optimizer, with an initial learning rate of 1 × 10−3 and a weight decay of 1 × 10−4. To make the early training stage more stable, a warm-up strategy was adopted for the first 10% of the total epochs, after which a cosine annealing learning rate schedule was used, with the minimum learning rate set to 1 × 10−6. Cross-entropy loss with label smoothing was used for classification, and the label-smoothing factor was set to 0.1; the dropout rate in the final classifier was set to 0.5 to reduce overfitting; automatic mixed precision training was enabled to improve the computational efficiency of the GPU; gradient clipping with a maximum norm of 1.0 was applied to avoid the unstable updates caused by occasional large gradients; the model checkpoint was saved according to the monitored training loss and early stopping was used to prevent unnecessary training after convergence. The early stopping patience was set to 20 epochs in the main DSSN implementation. For repeated comparative experiments in the project records, each model dataset setting was run five times using different random seeds, and the mean and standard deviation were calculated from cycle runs; training data, including loss and training accuracy, were saved after training for convergence analysis; prediction maps were generated by applying the trained model to all labeled pixels in the scene, using the same patch extraction and reflection padding strategy as in training.

3. Experimental Results

3.1. Comparison with Baseline Methods

In the comparative experiments, the DSSN was evaluated against four representative HSI classification methods, 3D-CNN [14], HybridSN [17], SpectralFormer [19], SSFTT [20] and DSFormer [29]. These baselines cover convolutional, Transformer-based and hybrid spatial–spectral architectures. To ensure reproducibility, we used the publicly released code for each competing method to obtain the reported results.
  • 3D-CNN [14] takes 5 × 5 × L spectral–spatial patches as input and is trained using the softmax loss and stochastic gradient descent with momentum. The momentum coefficient is set to 0.9, the weight decay coefficient to 5 × 10−4, and the batch size to 20.
  • SpectralFormer [19] is optimized with Adam using minibatches of 64 samples. The learning rate starts at 5 × 10−4 and is reduced by a factor of 0.9 at every 10% interval of the total training epochs.
  • SSFTT [20] reduces the hyperspectral data to 30 principal components using PCA and uses 13 × 13 × 30 patches as input. It is trained with the Adam optimizer using an initial learning rate of 1 × 10−3, a batch size of 64, and 100 training epochs.
  • HybridSN [17] was processed using 3D input patches with a spatial size of 25 × 25 in all datasets, while the spectral dimensions were set to 30 for IP and 15 for UP and SA.
  • DSFormer [29] was trained for 500 epochs using the AdamW optimizer, with an initial learning rate of 1 × 10−4 and a weight decay of 1 × 10−5. For all datasets, the input patch cubes were sized as 10 × 10 , the transformer patch size was set to 2, and the embedding dimension was fixed at 128.
Classification performance is evaluated using overall accuracy (OA), average accuracy (AA), and the Kappa coefficient (KA). Higher values indicate better classification performance. All methods were evaluated under the same dataset split and preprocessing protocol to ensure fair comparison.
On the Indian Pines dataset, as shown in Table 5, DSSN achieved an OA of 98.11%, an AA of 97.89%, and a Kappa coefficient of 97.84%, obtaining the highest values among all compared methods; compared with the strongest baseline, DSFormer, the DSSN improved OA, AA, and Kappa by 0.25, 1.59, and 0.28 percentage points, respectively. The relatively larger improvement in AA indicates that the DSSN provides more balanced recognition performance across different land-cover categories, rather than improving only the dominant classes. Although DSFormer achieved slightly higher accuracy for several individual classes, the DSSN produced the best overall performance and maintained relatively stable results across repeated experiments, as reflected by its small standard deviations for OA, AA, and Kappa. The visual comparison in Figure 6 further shows that the DSSN reduces isolated misclassified pixels and better preserves the spatial continuity of agricultural parcels, which is consistent with the improvements in the quantitative evaluation.
As shown in Table 6, DSSN achieved an OA of 99.88%, an AA of 99.81%, and a Kappa coefficient of 99.84% on the Pavia University dataset. Relative to the strongest baseline, HybridSN, DSSN improved OA, AA, and Kappa by 1.63, 1.76, and 2.17 percentage points, respectively. Pavia University contains complex urban structures, including roads, buildings, bare soil, and elongated object boundaries. The strong gains in all three aggregate metrics suggest that the dual-stream architecture effectively combines local spectral–spatial feature extraction with broader contextual modelling. As illustrated in Figure 6, the DSSN generates more spatially coherent classification maps, reduces fragmented predictions around object boundaries, and better maintains the continuity of road- and building-related regions.
As shown in Table 7, the DSSN also achieved a strong performance on Salinas, with an OA of 99.82%, an AA of 99.80% and a KA of 99.80%. Salinas is a high-accuracy benchmark on which several methods already perform well, making further improvements difficult. Compared with the strongest baseline, HybridSN, the DSSN improved OA by 1.63 percentage points; the improvement is especially relevant for visually and spectrally similar agricultural categories, including lettuce- and vineyard-related classes. The visual comparison in Figure 6 shows that the DSSN reduces within-field noise and better separates neighboring agricultural categories. This improvement is particularly relevant for Salinas, where several crop classes have similar spectral responses and many baseline methods already achieve high overall accuracy.
Figure 7 shows the accuracy and loss curves over 200 training epochs on the Pavia University dataset; the training loss and accuracy curves are similar to those of the other two datasets. The DSSN converges rapidly during the early epochs and then enters a stable optimization stage. The loss curve flattens after approximately 100 epochs, while the accuracy approaches saturation, indicating that the proposed dual-stream architecture does not introduce obvious training instability.
The ROC analysis further supports the performance of the DSSN across the three datasets, as shown in Figure 8. The DSSN achieves an AUC of 0.9999 on Indian Pines, Pavia University and Salinas, indicating that its predictions provide near-perfect ranking of positive and negative samples under the evaluated test conditions. On Indian Pines, the DSSN yields a higher AUC than 3D-CNN, DSFormer, HybridSN, SpectralFormer and SSFTT, whose AUC values are 0.9971, 0.9997, 0.9897, 0.9835 and 0.9966, respectively. The advantage is particularly evident over SpectralFormer and HybridSN, whereas the difference from DSFormer is small. Similar results are observed on Pavia University and Salinas, where the DSSN exceeds the strongest competing methods by 0.0007 and 0.0002 AUC units, respectively. These results suggest that the combination of local spectral–spatial modelling, nested spatial-context extraction and adaptive feature fusion enables DSSN to maintain strong class separability across agricultural and urban hyperspectral scenes.

3.2. Computational Complexity Analysis

The computational cost of DSSN was evaluated using both model-level and component-level analysis. Table 8 compares DSSN with the baseline methods, and Figure 8 decomposes the FLOPs of the proposed architecture.
Table 8 compares the computational complexity of the DSSN with five representative models, including 3D-CNN, SpectralFormer, SSFTT, HybridSN and DSFormer; the comparison is conducted on the Indian Pines, Pavia University and Salinas Valley datasets in terms of the number of parameters, average single-sample inference time and average training time. The DSSN contains 1.327 M, 1.1057 M and 1.340 M parameters on the three datasets, respectively; its average parameter size is approximately 1.26 M, which is higher than that of the other compared models. This increase is mainly caused by the simultaneous use of the 3D-CNN spectral stream, the nested Transformer spatial stream and the adaptive fusion module. The average inference times of the DSSN are 5.5657 ms, 6.4070 ms and 6.0038 ms on Indian Pines, Pavia University and Salinas Valley, respectively. The DSSN is slower than most competing methods, due to its dual-stream architecture and nested attention operations. In terms of training time, the DSSN requires 10.67 min, 28.33 min and 32.33 min on Indian Pines, Pavia University and Salinas Valley, respectively. The longer training time is mainly related to the larger model size and the additional Transformer-based spatial-context modelling; thanks to the early-stopping mechanism, although its training time is longer than the other models, it is comparable to that of SpectralFormer. Overall, the results show that DSSN achieves improved representation capability at the cost of increased parameters, inference time and training time.
Figure 9 further decomposes the FLOPs of DSSN at the component level: Figure 9a compares different component configurations on Indian Pines, Pavia University and Salinas, showing that the relative FLOPs pattern remains consistent across datasets despite their different spectral dimensions. Figure 9b summarizes the mean FLOPs across the three datasets, where the full DSSN model reaches 0.2640 G, which is only 0.0072 G higher than the CNN-only configuration and 0.0003 G higher than the simple-fusion configuration. Figure 9c further shows the incremental cost of each component: the CNN branch accounts for most of the FLOPs, the Transformer branch adds a small increment, and AFM contributes only 0.0003 G additional FLOPs. These results indicate that the additional computational burden of the DSSN mainly comes from maintaining the dual-stream representation, not from the adaptive fusion operation itself.

3.3. Ablation Experiments

Ablation Experiments were used to examine the role of each DSSN module on the three datasets; four components were examined, namely the 3D-CNN spectral stream, DRNet, the nested Transformer module and the AFM. It is worth noting that, when both DRNet and the nested Transformer are removed, the nested Transformer is replaced with a standard Transformer. When AFM is removed, a simple fusion strategy is used instead. The OA results for each configuration are summarized in Table 9.
Table 9 reports the ablation results of the main components of the DSSN, including the 3D-CNN spectral stream, DRNet, the nested Transformer and the AFM. The configuration without the main components obtains OA of 96.91%, 96.75% and 97.37% on Indian Pines, Pavia University and Salinas Valley, respectively. After incorporating the complete DSSN architecture, the OA increases to 98.11%, 99.88% and 99.82%, corresponding to improvements of 1.20, 3.13 and 2.45 percentage points, respectively. The intermediate configurations also provide useful evidence for analyzing the contribution of each component. On the Indian Pines dataset, the OA values of these configurations range from 97.06% to 97.77%, on the Pavia University dataset, the range is from 96.23% to 98.92%, and on the Salinas Valley dataset, the range is from 96.14% to 99.05%. These results indicate that the performance improvement is not driven by a single module but rather stems from the synergistic effects of local spectral–spatial feature extraction, spatial-context modeling, and adaptive feature fusion.

3.4. Parameter Sensitivity Analysis

Table 10 evaluates the influence of the input spatial window size on DSSN. Three window sizes were compared on the Indian Pines, Pavia University and Salinas Valley datasets. The results show that increasing the spatial window size consistently improves the classification performance on all three datasets. When the window size increases from 6 × 6 to 12 × 12, the OA improves from 97.94% to 98.11% on Indian Pines, from 99.81% to 99.88% on Pavia University, and from 99.75% to 99.82% on Salinas Valley. Thus, the corresponding improvements are 0.17, 0.07 and 0.07 percentage points, respectively. This result indicates that a larger spatial window provides the DSSN with more surrounding contextual information, which benefits both the local spectral–spatial extraction of the 3D-CNN stream and the multi-scale spatial modelling of the nested Transformer stream. The additional context is particularly useful for distinguishing neighboring land-cover categories and maintaining spatial continuity near object boundaries.
Table 11 investigates the influence of the channel compression ratio in the AFM; three compression ratios were evaluated on the three datasets, and the results demonstrate that the compression ratio has a relatively limited influence on the final OA when moderate compression is applied. For Indian Pines, the model achieves the highest OA of 98.13% with a compression ratio of 2, for Pavia University, the highest OA is 99.85% with a ratio of 4, while the best result on Salinas Valley is 99.79% with a ratio of 2; the performance obtained with compression ratios of 2 and 4 is highly comparable. These results suggest that a moderate compression ratio provides a suitable balance between channel interaction and feature compactness.

4. Discussion

The DSSN addresses the challenge of simultaneously preserving locally discriminative spectral information and large-scale spatial context in hyperspectral image classification. It employs a dual-stream framework consisting of a 3D-CNN branch, a nested Transformer branch and an AFM. By exploiting local connectivity and weight sharing, the 3D-CNN branch jointly processes the spectral and spatial dimensions, preserving local spectral–spatial evidence from adjacent bands, neighboring pixels and fine-grained textures. In parallel, the nested Transformer branch performs pixel-level interaction, local information aggregation and patch-level context modelling. This design progressively propagates fine-grained local features into broader spatial representations and enables hierarchical contextual reasoning from local to global scales. The AFM generates channel-wise weights from the joint responses of each input sample and dynamically adjusts the contributions of local and contextual features before classification. Thus, the three modules form a complete information-processing pipeline based on local joint representation learning, hierarchical context modelling and sample-conditioned feature fusion. Consistent with this design, the DSSN achieves OAs of 98.11%, 99.88% and 99.82% on the Indian Pines, Pavia University and Salinas Valley datasets, respectively, demonstrating stable performance across different agricultural and urban hyperspectral scenes.
The DSSN differs from previous methods, not only by combining CNNs with Transformers, but also through its representational specialization and information-flow topology. Pure 3D-CNNs enlarge their receptive fields through repeated local convolutions, meaning that long-range spatial relationships are established only indirectly. Pure Transformer and SpectralFormer-like methods model non-local dependencies, but fixed-scale token representations may weaken local spectral continuity and fine-grained spatial textures. Serial CNN–Transformer methods, such as SSFTT, apply Transformer-based modelling to features that have already undergone convolutional projection, making it difficult for local and contextual information to be propagated independently. Conventional dual-stream classifiers generally divide the network into separate spectral and spatial branches and fuse their outputs through direct addition, feature concatenation or fixed-form weighting. In contrast, DSSN divides feature learning according to the effective range of information. The 3D-CNN branch learns local joint spectral–spatial features, whereas the nested Transformer branch captures hierarchical contexts from pixel-level interactions to patch-level representations. The two pathways are preserved during their respective feature-learning processes and interact only during the fusion stage, thereby reducing premature mixing at shallow layers. The ablation results in Table 9 support the contribution of this information-flow design. The minimum configuration obtains OAs of 96.91%, 96.75% and 97.37% on Indian Pines, Pavia University and Salinas Valley, whereas the complete DSSN achieves 98.11%, 99.88% and 99.82%, respectively. The corresponding improvements are 1.20, 3.13 and 2.45 percentage points, indicating that the 3D-CNN stream, DRNet, nested Transformer and AFM provide complementary benefits. The 3D-CNN stream preserves local spectral–spatial evidence, DRNet enhances nonlinear pixel-level feature transformation, the nested Transformer establishes local-to-global spatial relationships, and the AFM adaptively recalibrates the channel-wise contributions of the two streams. Therefore, the gain of the DSSN arises from the interaction among these modules rather than from the isolated effect of a single component. The parameter sensitivity experiments further support the selected design settings. As shown in Table 10, increasing the input spatial window from 6 × 6 to 12 × 12 improves the OA from 97.94% to 98.11% on Indian Pines, from 99.81% to 99.88% on Pavia University and from 99.75% to 99.82% on Salinas Valley. The 12 × 12 window is therefore selected because it provides a broader contextual range and achieves the best performance on all three datasets. Table 11 shows that compression ratios of 2 and 4 produce nearly identical classification accuracy, whereas a ratio of 8 causes a performance decrease on all datasets. Although a ratio of 2 achieves slightly higher accuracy on some datasets, it retains a larger intermediate channel dimension and introduces greater computational cost. Considering both accuracy and efficiency, a compression ratio of 4 is selected for the AFM. The improvement pattern differs across datasets. On Indian Pines and Pavia University, the DSSN provides modest but consistent gains over HybridSN, with OA improvements of 0.46 and 0.47 percentage points, respectively. On Salinas, the improvement is more pronounced, reaching 2.22 percentage points over HybridSN. This pattern suggests that nested contextual modelling and adaptive fusion are particularly useful when fine agricultural class discrimination is required, while still providing stable gains in fragmented agricultural and urban scenes. The ablation experiments support this interpretation. The 3D-CNN stream improves performance by preserving local spectral–spatial information, the nested Transformer contributes broader contextual modelling, and AFM further improves performance by recalibrating the contribution of the two streams. These findings suggest that the observed performance gain arises from the interaction between decoupled representation learning and adaptive fusion, rather than from any single module alone.
The computational results reveal the practical trade-offs associated with the proposed architecture: DSSN contains 1.327 M, 1.1057 M and 1.340 M parameters on the Indian Pines, Pavia University and Salinas Valley datasets, respectively; its single-sample inference times are 5.5657 ms, 6.4070 ms and 6.0038 ms, with corresponding training times are 10.67 min, 28.33 min and 32.33 min; the increased computational cost is mainly attributable to the dual-stream architecture and the nested attention operations. Therefore, future work will investigate strategies for reducing the computational cost of the DSSN. In addition, real-world hyperspectral images are often affected by Gaussian noise, impulse noise, stripe noise and mixed noise. The robustness of the network is therefore particularly important under noisy hyperspectral conditions. In future work, we will systematically investigate the effects of Gaussian, impulse, stripe and mixed noise on hyperspectral image classification [30,31], as well as seeking to develop effective methods for suppressing and removing hyperspectral noise.

5. Conclusions

This study proposed the Dual-Stream Spatial–Spectral Network with Nested Attention (DSSN) for hyperspectral image classification. By combining a cascaded 3D-CNN spectral stream, a nested Transformer spatial stream and an adaptive fusion module, the DSSN separates local spectral–spatial feature extraction from multi-scale contextual modelling and adaptively integrates the resulting representations. Experiments on Indian Pines, Pavia University and Salinas showed that the DSSN outperformed representative CNN-, Transformer- and hybrid-based baselines, achieving 98.11%%, 99.88% and 99.82% OA, respectively. Ablation experiments further confirmed that the 3D-CNN stream, nested Transformer and AFM each contributed to the final performance. These findings suggest that decoupled spatial–spectral learning with adaptive multi-scale fusion is effective for HSI classification, particularly in scenes requiring fine spectral discrimination and spatial boundary preservation. However, the increased computational cost and the potential impact of noise should be carefully considered when deploying the DSSN in real-world hyperspectral image classification scenarios.

Author Contributions

Conceptualization, all authors; methodology, J.W. and F.L.; investigation, all authors; writing—original draft preparation, J.W. and F.L.; writing—review and editing, all authors; supervision, L.C., S.L. and L.J.; funding acquisition, F.L. and L.C. All authors have read and agreed to the published version of the manuscript.

Funding

Generous financial support by the Zhejiang Provincial “Jianbing” and “Lingyan” R&D Programs under Grant 2026C02A1230, Grant 2024C01126, Natural Science Foundation of Hangzhou City under Grant 2024SZRYBF050001.

Data Availability Statement

All datasets analyzed during the current study are publicly available benchmark hyperspectral remote sensing datasets. The Indian Pines, Salinas, and Pavia University datasets are available from https://ieee-dataport.org/documents/hyperspectral-remote-sensing-datasets-indian-pines-pavia-university-botswana-and-salinas (accessed on 8 April 2026). The source code used in this study is openly available at the GitHub repository: https://github.com/yimoaaa/DSSN (accessed on 22 July 2026).

Conflicts of Interest

Author Chuanjie Zhang was employed by the company Zhejiang Tuogan Technology Co., Ltd. The remaining authors declare that the research was conducted in the absence of any commercial or financial relationships that could be construed as a potential conflict of interest.

References

  1. Chang, C.-I. Hyperspectral Imaging: Techniques for Spectral Detection and Classification; Springer Science & Business Media: Berlin/Heidelberg, Germany, 2003. [Google Scholar]
  2. Ghamisi, P.; Yokoya, N.; Li, J.; Liao, W.; Liu, S.; Plaza, J.; Rasti, B.; Plaza, A. Advances in Hyperspectral Image and Signal Processing: A Comprehensive Overview of the State of the Art. IEEE Geosci. Remote Sens. Mag. 2018, 5, 37–78. [Google Scholar] [CrossRef] [Scilit]
  3. Guo, X.; Yin, J.; Yang, J. Fine classification of crops based on an inductive transfer learning method with compact polarimetric SAR images. GISci. Remote Sens. 2024, 61, 2319939. [Google Scholar] [CrossRef] [Scilit]
  4. Liny, L.; Seok, L.H.; Rupesh, T.; Amit, G.; Suk, C.Y.; Youngnam, Y.; Yoonha, K. Evaluation of Soybean Wildfire Prediction via Hyperspectral Imaging. Plants 2023, 12, 901. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  5. Qushtom, H.; Hasasneh, A.; Masri, S. Enhanced Wheat Disease Detection Using Deep Learning and Explainable AI Techniques. Comput. Mater. Contin. 2025, 84, 1379–1395. [Google Scholar] [CrossRef] [Scilit]
  6. Li, X.; Qiu, H.; Fan, P. Soil carbon, nitrogen and phosphorus contents prediction based on hyperspectral images combined with attention mechanism multi-scale dual-branch network. Microchem. J. 2026, 220, 116380. [Google Scholar] [CrossRef] [Scilit]
  7. P, P.; Nidamanuri, R.R. Water quality mapping using airborne and satellite hyperspectral imagery across the selected coastal waters of India. Mar. Pollut. Bull. 2025, 221, 118515. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  8. Saba, M.; Ortíz, C.C.; Martínez, D.V.; Hernández, O.E.C.; LeCompte, C.B. Analysis of asbestos-cement roof classification in urban areas: Supervised and unsupervised methods with multispectral and hyperspectral remote sensing. Remote Sens. Appl. Soc. Environ. 2025, 37, 101464. [Google Scholar] [CrossRef] [Scilit]
  9. Paoletti, M.E.; Haut, J.M.; Plaza, J.; Plaza, A. Deep learning classifiers for hyperspectral imaging: A review. ISPRS J. Photogramm. Remote Sens. 2019, 158, 279–317. [Google Scholar] [CrossRef] [Scilit]
  10. Li, S.; Song, W.; Fang, L.; Chen, Y.; Ghamisi, P.; Benediktsson, J.A. Deep Learning for Hyperspectral Image Classification: An Overview. IEEE Trans. Geosci. Remote Sens. 2019, 57, 6690–6709. [Google Scholar] [CrossRef] [Scilit]
  11. Hu, W.; Huang, Y.; Wei, L.; Zhang, F.; Li, H. Deep Convolutional Neural Networks for Hyperspectral Image Classification. J. Sens. 2015, 2015, 258619. [Google Scholar] [CrossRef] [Scilit]
  12. Makantasis, K.; Karantzalos, K.; Doulamis, A.; Doulamis, N. Deep supervised learning for hyperspectral data classification through convolutional neural networks. In Proceedings of the 2015 IEEE International Geoscience and Remote Sensing Symposium (IGARSS), Milan, Italy, 26–31 July 2015; IEEE: New York, NY, USA, 2015. [Google Scholar]
  13. Chen, Y.; Jiang, H.; Li, C.; Jia, X.; Ghamisi, P. Deep Feature Extraction and Classification of Hyperspectral Images Based on Convolutional Neural Networks. IEEE Trans. Geosci. Remote Sens. 2016, 54, 6232–6251. [Google Scholar] [CrossRef] [Scilit]
  14. Li, Y.; Zhang, H.; Shen, Q. Spectral–Spatial Classification of Hyperspectral Imagery with 3D Convolutional Neural Network. Remote Sens. 2017, 9, 67. [Google Scholar] [CrossRef] [Scilit]
  15. Lee, H.; Kwon, H. Going Deeper with Contextual CNN for Hyperspectral Image Classification. IEEE Trans. Image Process. 2016, 26, 4843–4855. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  16. Hang, R.; Liu, Q.; Hong, D.; Ghamisi, P. Cascaded Recurrent Neural Networks for Hyperspectral Image Classification. IEEE Trans. Geosci. Remote Sens. 2017, 57, 5384–5394. [Google Scholar] [CrossRef] [Scilit]
  17. Roy, S.K.; Krishna, G.; Dubey, S.R.; Chaudhuri, B.B. HybridSN: Exploring 3D-2D CNN Feature Hierarchy for Hyperspectral Image Classification. IEEE Geosci. Remote Sens. Lett. 2020, 17, 277–281. [Google Scholar] [CrossRef] [Scilit]
  18. Vaswani, A.; Shazeer, N.; Parmar, N.; Uszkoreit, J.; Jones, L.; Gomez, A.N.; Kaiser, L.; Polosukhin, I. Attention Is All You Need. In Proceedings of the Advances in Neural Information Processing Systems, Long Beach, CA, USA, 4–9 December 2017. [Google Scholar]
  19. Hong, D.; Han, Z.; Yao, J.; Gao, L.; Zhang, B.; Plaza, A.; Chanussot, J. SpectralFormer: Rethinking Hyperspectral Image Classification with Transformers. IEEE Trans. Geosci. Remote Sens. 2021, 60, 5518615. [Google Scholar] [CrossRef] [Scilit]
  20. Sun, L.; Zhao, G.; Zheng, Y.; Wu, Z. Spectral–Spatial Feature Tokenization Transformer for Hyperspectral Image Classification. IEEE Trans. Geosci. Remote Sens. 2022, 60, 5522214. [Google Scholar] [CrossRef] [Scilit]
  21. Dosovitskiy, A.; Beyer, L.; Kolesnikov, A.; Weissenborn, D.; Zhai, X.; Unterthiner, T.; Dehghani, M.; Minderer, M.; Heigold, G.; Gelly, S. An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale. arXiv 2021, arXiv:2010.11929. [Google Scholar]
  22. Xi, X.; Dianyan, Z.; Guangwu, H.; Yong, J.; Shutao, X. CNN-MHSA: A Convolutional Neural Network and multi-head self-attention combined approach for detecting phishing websites. Neural Netw. 2020, 125, 303–312. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  23. Zhang, Y.; Gong, Y.; Zhu, H.; Bai, X.; Tang, W. Multi-head enhanced self-attention network for novelty detection. Pattern Recognit. 2020, 107, 107486. [Google Scholar] [CrossRef] [Scilit]
  24. Tolstikhin, I.; Houlsby, N.; Kolesnikov, A.; Beyer, L.; Dosovitskiy, A. MLP-Mixer: An all-MLP Architecture for Vision. Adv. Neural Inf. Process. Syst. 2021, 34, 24261–24272. [Google Scholar]
  25. Hu, J.; Shen, L.; Sun, G. Squeeze-and-Excitation Networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, Honolulu, HI, USA, 21–26 July 2017; IEEE: New York, NY, USA, 2017; pp. 7132–7141. [Google Scholar]
  26. Baumgardner, M.F.; Biehl, L.L.; Landgrebe, D.A. 220 Band AVIRIS Hyperspectral Image Data Set: June 12, 1992 Indian Pine Test Site 3. 2015. Available online: https://cir.nii.ac.jp/crid/1880302167582781568 (accessed on 8 April 2026).
  27. Licciardi, G.; Pacifici, F.; Tuia, D.; Prasad, S.; West, T.; Giacco, F.; Thiel, C.; Inglada, J.; Christophe, E.; Chanussot, J.; et al. Decision Fusion for the Classification of Hyperspectral Data: Outcome of the 2008 GRS-S Data Fusion Contest. IEEE Trans. Geosci. Remote Sens. 2009, 47, 3857–3865. [Google Scholar] [CrossRef] [Scilit]
  28. Xu, Y.; Du, B.; Zhang, L. Beyond the Patchwise Classification: Spectral-Spatial Fully Convolutional Networks for Hyperspectral Image Classification. IEEE Trans. Big Data 2019, 6, 492–506. [Google Scholar] [CrossRef] [Scilit]
  29. Jiang, H.; Piao, S.; Gao, C.; Yu, L.; Chen, L. DSFormer: A Dual-Scale Cross-Learning Transformer for Visual Place Recognition. IEEE Robot. Autom. Lett. 2025, 10, 10799–10806. [Google Scholar] [CrossRef] [Scilit]
  30. Zhao, B.; Ulfarsson, M.O.; Sveinsson, J.R.; Chanussot, J. Hyperspectral Image Denoising Using Spectral-Spatial Transform-Based Sparse and Low-Rank Representations. IEEE Trans. Geosci. Remote Sens. 2022, 60, 5522125. [Google Scholar] [CrossRef] [Scilit]
  31. Zhang, H.; Zhao, B.; Ma, X.; Han, L.; Yang, M.; Ulfarsson, M.O.; Sigurdsson, J.; Benediktsson, J.A. Hyperspectral Image Mixed Noise Removal Based on Sparsity Constraint and Low-Rank Approximation. IEEE J. Sel. Top. Appl. Earth Obs. Remote Sens. 2026, 19, 17694–17714. [Google Scholar] [CrossRef] [Scilit]
Figure 1. Overall architecture of the proposed DSSN. (a) Dual-stream spatial–spectral architecture, integrating the 3D-CNN spectral stream, the nested Transformer spatial stream and the adaptive fusion module for hyperspectral image classification. (b) DRNet structure used in the feedforward network.
Figure 1. Overall architecture of the proposed DSSN. (a) Dual-stream spatial–spectral architecture, integrating the 3D-CNN spectral stream, the nested Transformer spatial stream and the adaptive fusion module for hyperspectral image classification. (b) DRNet structure used in the feedforward network.
Remotesensing 18 03126 g001
Figure 2. Structure of the adaptive fusion module. The module concatenates spectral stream and spatial stream features, estimates channel-wise attention weights, and recalibrates the fused representation before classification.
Figure 2. Structure of the adaptive fusion module. The module concatenates spectral stream and spatial stream features, estimates channel-wise attention weights, and recalibrates the fused representation before classification.
Remotesensing 18 03126 g002
Figure 3. Overview of the Indian Pines dataset. (a) False-color hyperspectral image. (b) Grayscale representation of the hyperspectral image. (c) Ground-truth class map.
Figure 3. Overview of the Indian Pines dataset. (a) False-color hyperspectral image. (b) Grayscale representation of the hyperspectral image. (c) Ground-truth class map.
Remotesensing 18 03126 g003
Figure 4. Overview of the Pavia University dataset. (a) False-color hyperspectral image. (b) Grayscale representation of the hyperspectral image. (c) Ground-truth class map.
Figure 4. Overview of the Pavia University dataset. (a) False-color hyperspectral image. (b) Grayscale representation of the hyperspectral image. (c) Ground-truth class map.
Remotesensing 18 03126 g004
Figure 5. Overview of the Salinas Valley dataset. (a) False-color hyperspectral image. (b) Grayscale representation of the hyperspectral image. (c) Ground-truth class map.
Figure 5. Overview of the Salinas Valley dataset. (a) False-color hyperspectral image. (b) Grayscale representation of the hyperspectral image. (c) Ground-truth class map.
Remotesensing 18 03126 g005
Figure 6. Visual comparison of classification results on the three benchmark hyperspectral datasets. Rows correspond to Indian Pines, Pavia University and Salinas, respectively, and columns show the ground-truth map and the classification maps produced by different methods, including 3D-CNN, HybridSN, SpectralFormer, SSFTT, DSFormer and the proposed DSSN. Class colors follow the corresponding ground-truth labels. Compared with the baseline methods, DSSN produces more spatially coherent classification maps, with fewer isolated misclassified pixels and better preservation of region boundaries. These visual results are consistent with the quantitative improvements in OA, AA and Kappa reported in Table 4, Table 5 and Table 6.
Figure 6. Visual comparison of classification results on the three benchmark hyperspectral datasets. Rows correspond to Indian Pines, Pavia University and Salinas, respectively, and columns show the ground-truth map and the classification maps produced by different methods, including 3D-CNN, HybridSN, SpectralFormer, SSFTT, DSFormer and the proposed DSSN. Class colors follow the corresponding ground-truth labels. Compared with the baseline methods, DSSN produces more spatially coherent classification maps, with fewer isolated misclassified pixels and better preservation of region boundaries. These visual results are consistent with the quantitative improvements in OA, AA and Kappa reported in Table 4, Table 5 and Table 6.
Remotesensing 18 03126 g006
Figure 7. Training loss and accuracy curves of DSSN on the Pavia University dataset over 200 epochs. (a) Loss curve. (b) Accuracy curve. The loss decreases rapidly during the early training stage and then gradually stabilizes, while the accuracy rises quickly and approaches saturation without obvious oscillation.
Figure 7. Training loss and accuracy curves of DSSN on the Pavia University dataset over 200 epochs. (a) Loss curve. (b) Accuracy curve. The loss decreases rapidly during the early training stage and then gradually stabilizes, while the accuracy rises quickly and approaches saturation without obvious oscillation.
Remotesensing 18 03126 g007
Figure 8. ROC curves and AUC values of the compared methods on three datasets. (a) Indian Pines, (b) Pavia University and (c) Salinas. The curves correspond to 3D-CNN, DSFormer, DSSN, HybridSN, SpectralFormer and SSFTT. The false-positive rate (FPR) is plotted on the horizontal axis and the true-positive rate (TPR) on the vertical axis.
Figure 8. ROC curves and AUC values of the compared methods on three datasets. (a) Indian Pines, (b) Pavia University and (c) Salinas. The curves correspond to 3D-CNN, DSFormer, DSSN, HybridSN, SpectralFormer and SSFTT. The false-positive rate (FPR) is plotted on the horizontal axis and the true-positive rate (TPR) on the vertical axis.
Remotesensing 18 03126 g008
Figure 9. Component-level FLOPs analysis of DSSN. (a) Dataset-specific FLOPs of different component configurations on Indian Pines, Pavia University and Salinas. (b) Mean FLOPs across the three datasets for each configuration. (c) Mean incremental FLOPs introduced by the CNN baseline, the Transformer branch with simple fusion and the adaptive fusion module.
Figure 9. Component-level FLOPs analysis of DSSN. (a) Dataset-specific FLOPs of different component configurations on Indian Pines, Pavia University and Salinas. (b) Mean FLOPs across the three datasets for each configuration. (c) Mean incremental FLOPs introduced by the CNN baseline, the Transformer branch with simple fusion and the adaptive fusion module.
Remotesensing 18 03126 g009
Table 1. Parameters of the Multi-Head Self-Attention modules.
Table 1. Parameters of the Multi-Head Self-Attention modules.
ComponentThe Nested AttentionPatch-Level MSAPixel-Level MSA
Value384
Table 2. Classes and sample counts in the Indian Pines dataset.
Table 2. Classes and sample counts in the Indian Pines dataset.
#ClassSamples
1Alfalfa46
2Corn-notill1428
3Corn-mintill830
4Corn237
5Grass-pasture483
6Grass-trees730
7Grass-pasture-mowed28
8Hay-windrowed478
9Oats20
10Soybean-notill972
11Soybean-mintill2455
12Soybean-clean593
13Wheat205
14Woods1265
15Buildings-Grass-Trees-Drives386
16Stone-Steel-Towers93
Table 3. Classes and sample counts in the Pavia University dataset.
Table 3. Classes and sample counts in the Pavia University dataset.
#ClassSamples
1Asphalt6631
2Meadows18,649
3Gravel2099
4Trees3064
5Painted metal sheets1345
6Bare Soil5029
7Bitumen1330
8Self-Blocking Bricks3682
9Shadows947
Table 4. Classes and sample counts in the Salinas Valley dataset.
Table 4. Classes and sample counts in the Salinas Valley dataset.
#ClassSamples
1Brocoli_green_weeds_12009
2Brocoli_green_weeds_23726
3Fallow1976
4Fallow_rough_plow1394
5Fallow_smooth2678
6Stubble3959
7Celery3579
8Grapes_untrained11,271
9Soil_vinyard_develop6203
10Corn_senesced_green_weeds3278
11Lettuce_romaine_4wk1068
12Lettuce_romaine_5wk1927
13Lettuce_romaine_6wk916
14Lettuce_romaine_7wk1070
15Vinyard_untrained7268
16Vinyard_vertical_trellis1807
Table 5. Classification results of different methods on the Indian Pines.
Table 5. Classification results of different methods on the Indian Pines.
#3D-CNN [14]SpectralFormer [19]SSFTT [20]HybridSN [17]DSFormer [29]DSSN
Class1100.0091.61 ± 7.0796.10 ± 3.2796.67 ± 3.0493.17 ± 7.62100.00
Class291.13 ± 2.5374.16 ± 2.8094.89 ± 2.9894.70 ± 5.6597.14 ± 1.2998.32 ± 0.40
Class389.38 ± 7.9360.87± 6.4293.22 ± 3.8993.86 ± 4.0198.55 ± 0.7897.48 ± 1.01
Class477.27 ± 19.1484.81± 5.3285.60 ± 1.7680.93 ± 20.0297.28 ± 2.5896.64 ± 1.90
Class582.08 ± 14.8385.68 ± 4.4293.94 ± 5.4890.18 ± 10.4698.11 ± 1.8096.28 ± 2.24
Class695.03 ± 5.3688.91 ± 4.9698.16 ± 1.2998.82 ± 1.3199.21 ± 0.2299.70 ± 0.30
Class798.89 ± 2.4889.23 ± 4.2186.40 ± 1.43100.0090.40 ± 12.02100.00
Class894.09 ± 7.1496.68 ± 1.8999.69 ± 0.4398.79 ± 1.85100.00100.00
Class9100.0096.00 ± 8.9482.22 ± 4.02100.0081.11 ± 15.15100.00
Class1090.73 ± 7.3674.88 ± 3.9591.16 ± 6.1196.15 ± 2.8497.19 ± 1.7996.80 ± 1.58
Class1193.57 ± 1.5573.55 ± 4.9294.69 ± 3.0197.15 ± 1.2297.23 ± 1.1198.62 ± 0.64
Class1275.72 ± 15.7168.66 ± 9.2584.62 ± 9.3290.78 ± 6.4095.17 ± 3.0693.82 ± 4.65
Class1394.67 ± 5.0198.45 ± 0.7497.54 ± 2.6995.91 ± 3.6299.24 ± 0.2598.27 ± 1.49
Class1497.84 ± 1.6478.93 ± 6.0297.94 ± 2.0999.07 ± 0.7999.68 ± 0.1999.70 ± 0.21
Class1580.16 ± 13.4279.16 ± 3.7288.77 ± 7.7788.83 ± 5.8298.73 ± 1.5599.14 ± 0.75
Class1694.69 ± 3.2697.67 ± 1.6490.24 ± 5.5285.30 ± 9.2798.57 ± 1.9091.54 ± 4.59
OA (%)90.88 ± 3.1076.86 ± 1.6194.07 ± 2.3495.36 ± 0.0397.86 ± 0.2598.11 ± 0.37
AA (%)90.95 ± 4.3383.70 ± 1.5892.20 ± 5.1894.19 ± 0.0496.30 ± 1.1297.89 ± 0.46
KA (%)89.59 ± 3.5673.62 ± 0.0293.24 ± 2.7294.71 ± 0.0397.56 ± 0.2997.84 ± 0.42
Table 6. Classification results of different methods on the Pavia University dataset.
Table 6. Classification results of different methods on the Pavia University dataset.
#3D-CNN [14]Spectral Former [19]SSFTT [20]HybridSN [17]DSFormer [29]DSSN
Class191.39 ± 6.1993.28 ± 1.5690.62 ± 5.0197.44 ± 1.2695.87 ± 1.1399.83 ± 0.16
Class294.19 ± 4.1995.85 ± 2.0796.56 ± 2.7799.28 ± 0.6297.60 ± 1.1999.98 ± 0.02
Class392.14 ± 4.8085.73 ± 1.9090.72 ± 3.6397.10 ± 1.7594.46 ± 2.7099.97 ± 0.05
Class495.02 ± 1.8688.02 ± 3.0591.42 ± 8.1099.26 ± 1.3597.57 ± 1.1099.25 ± 0.32
Class599.88 ± 0.2899.27 ± 0.2699.30 ± 0.77100.0099.97 ± 0.06100.00
Class697.89 ± 1.7788.95 ± 1.7496.44 ± 3.3798.68 ± 2.5798.24 ± 0.75100.00
Class799.72 ± 0.3983.64 ± 2.4498.85 ± 1.1599.79 ± 0.3599.82 ± 0.2299.93 ± 0.11
Class890.46 ± 2.9978.46 ± 4.0390.33 ± 2.0294.73 ± 4.4395.01 ± 3.0399.79 ± 0.13
Class997.90 ± 1.4299.93 ± 0.1098.54 ± 1.1599.27 ± 0.4899.21 ± 0.6899.55 ± 0.37
OA (%)94.25 ± 2.0591.91 ± 0.9994.63 ± 1.7698.25 ± 0.7497.21 ± 0.5799.88 ± 0.04
AA (%)95.40 ± 1.2590.35 ± 0.5894.75 ± 1.7098.05 ± 0.9197.53 ± 0.3299.81 ± 0.06
KA (%)92.46 ± 2.6489.27 ± 1.2892.92 ± 2.3197.67 ± 0.9996.31 ± 0.7499.84 ± 0.05
Table 7. Classification results of different methods on the Salinas Valley dataset.
Table 7. Classification results of different methods on the Salinas Valley dataset.
#3D-CNN [14]Spectral Former [19]SSFTT [20]HybridSN [17]DSFormer [29]DSSN
Class199.92 ± 0.1899.87 ± 0.1499.98 ± 0.02100.00100.00100.00
Class299.81 ± 0.2598.03 ± 1.8399.92 ± 0.1799.81 ± 0.42100.00100.00
Class399.56 ± 0.4098.99 ± 0.26100.0099.98 ± 0.0299.93 ± 0.1099.67 ± 0.58
Class499.56 ± 0.5199.47 ± 0.2699.18 ± 0.7199.88 ± 0.1799.38 ± 0.4999.41 ± 0.75
Class597.95 ± 1.9398.43 ± 0.8499.36 ± 0.7298.05 ± 1.5498.56 ± 1.3099.96 ± 0.05
Class699.66 ± 0.7199.86 ± 0.0799.97 ± 0.04100.00100.0099.97 ± 0.06
Class799.76 ± 0.3499.59 ± 0.1499.92 ± 0.1599.91 ± 0.1399.86 ± 0.16100.00
Class886.93 ± 4.2089.49 ± 1.5988.08 ± 1.7595.74 ± 1.2586.18 ± 5.1199.74 ± 0.13
Class999.88 ± 0.2699.84 ± 0.11100.0099.99 ± 0.0199.98 ± 0.02100.00
Class1098.22 ± 1.2194.30 ± 1.2197.64 ± 1.3099.06 ± 0.6797.31 ± 1.3799.70 ± 0.36
Class1199.57 ± 0.3597.92 ± 0.9699.94 ± 0.08100.00100.0099.56 ± 0.81
Class12100.0098.47 ± 1.3099.70 ± 0.3199.97 ± 0.0499.98 ± 0.02100.00
Class1399.97 ± 0.0597.31 ± 2.1799.75 ± 0.3699.98 ± 0.05100.0099.42 ± 0.69
Class1499.59 ± 0.3195.29 ± 2.4898.87 ± 1.2699.86 ± 0.2799.85 ± 0.1399.85 ± 0.14
Class1594.29 ± 2.0958.12 ± 6.3494.35 ± 2.3594.79 ± 3.8194.81 ± 2.3599.61 ± 0.32
Class1699.36 ± 0.3898.31 ± 0.8199.05 ± 0.8199.39 ± 0.5299.79 ± 0.1699.90 ± 0.09
OA (%)96.13 ± 0.1191.23 ± 0.5696.46 ± 0.4998.19 ± 0.4496.13 ± 0.9799.82 ± 0.08
AA (%)98.38 ± 0.4895.21 ± 0.3398.48 ± 0.2799.15 ± 0.3298.48 ± 0.3399.80 ± 0.09
KA (%)95.69 ± 0.1290.21 ± 0.0196.07 ± 0.5597.97 ± 0.4995.70 ± 1.0799.80 ± 0.09
Table 8. Computational complexity comparison of different models.
Table 8. Computational complexity comparison of different models.
DatasetMethodParameters (M)Inference Time (ms)Training Time (min)
Indian Pines3D-CNN0.47932.80367.30
SpectralFormer0.34643.91569.18
SSFTT0.67522.48704.63
HybridSN0.82563.45508.45
DSFormer0.79023.64208.94
DSSN1.3275.565710.67
Pavia University3D-CNN0.33153.05369.60
SpectralFormer0.16194.389634.07
SSFTT0.35322.533010.91
HybridSN0.64673.744519.29
DSFormer0.67793.727413.10
DSSN1.10576.407028.33
Salinas Valley3D-CNN0.45433.432511.49
SpectralFormer0.35634.622138.40
SSFTT0.48372.487213.44
HybridSN0.83293.736622.97
DSFormer0.78573.815618.67
DSSN1.3406.003832.33
Table 9. Ablation results of the main DSSN components on the three datasets.
Table 9. Ablation results of the main DSSN components on the three datasets.
CNNDRNetNested TransAFMIndian PinesPavia UniversitySalinas Valley
× *√ *96.9196.7597.37
×97.7798.4298.92
×97.0697.6497.69
××96.2396.8396.14
×97.4898.8999.05
98.1199.8899.82
* √ indicates the corresponding module is included, whereas × indicates it is excluded
Table 10. Impact of the input spatial window size on DSSN.
Table 10. Impact of the input spatial window size on DSSN.
Window SizeIndian PinesPavia UniversitySalinas Valley
6 × 697.9499.8199.75
9 × 997.9699.8599.78
12 × 1298.1199.8899.82
Table 11. Impact of the channel compression ratio of the AFM on DSSN.
Table 11. Impact of the channel compression ratio of the AFM on DSSN.
RatioIndian PinesPavia UniversitySalinas Valley
298.1399.8499.79
498.1199.8599.78
897.9599.7399.73
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Wang, J.; Li, F.; Chen, L.; Liu, S.; Zhang, W.; Jiang, L.; Zhang, C. Dual-Stream Spatial–Spectral Network with Nested Attention for Hyperspectral Image Classification. Remote Sens. 2026, 18, 3126. https://doi.org/10.3390/rs18183126

AMA Style

Wang J, Li F, Chen L, Liu S, Zhang W, Jiang L, Zhang C. Dual-Stream Spatial–Spectral Network with Nested Attention for Hyperspectral Image Classification. Remote Sensing. 2026; 18(18):3126. https://doi.org/10.3390/rs18183126

Chicago/Turabian Style

Wang, Jianing, Fanghao Li, Liang Chen, Shijie Liu, Wanjiao Zhang, Lijun Jiang, and Chuanjie Zhang. 2026. "Dual-Stream Spatial–Spectral Network with Nested Attention for Hyperspectral Image Classification" Remote Sensing 18, no. 18: 3126. https://doi.org/10.3390/rs18183126

APA Style

Wang, J., Li, F., Chen, L., Liu, S., Zhang, W., Jiang, L., & Zhang, C. (2026). Dual-Stream Spatial–Spectral Network with Nested Attention for Hyperspectral Image Classification. Remote Sensing, 18(18), 3126. https://doi.org/10.3390/rs18183126

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop