Next Article in Journal
Gamma Irradiation Effect on the Verdet Constant of Standard Single-Mode Ge-Doped Optical Fibre
Next Article in Special Issue
Physics-Prior-Guided Deep Learning for High-Precision Marker Localization Under Saturated Artifacts for Potential Surgical Navigation Applications
Previous Article in Journal
Quantum Criticality of a Periodically Driven Non-Hermitian Su–Schrieffer–Heeger System
Previous Article in Special Issue
Infrared and Visible Multi-Scale Pyramid Cross-Layer Fusion Algorithm Based on Thermal Extended Target Separation
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

SSTNT: A Spatial–Spectral Similarity Guided Transformer-in-Transformer for Hyperspectral Unmixing

College of Electronic and Information Engineering, Changchun University, Changchun 130022, China
*
Author to whom correspondence should be addressed.
Photonics 2026, 13(3), 276; https://doi.org/10.3390/photonics13030276
Submission received: 5 February 2026 / Revised: 3 March 2026 / Accepted: 9 March 2026 / Published: 13 March 2026
(This article belongs to the Special Issue Computational Optical Imaging: Theories, Algorithms, and Applications)

Abstract

Vision Transformers (ViTs), owing to their strong capability in modeling global contextual dependencies, have been widely adopted in hyperspectral image unmixing (HU). However, standard ViTs process images by partitioning them into non-overlapping patches, which disrupts spatial continuity at the pixel level and neglects the fine-grained structural relationships among pixels within local regions. Consequently, effectively capturing the detailed spatial–spectral features required for accurate unmixing remains challenging. Furthermore, the high computational complexity of global self-attention and its sensitivity to noise limit the applicability of conventional Transformers to HU. To address these issues, we propose a spatial–spectral similarity guided Transformer-in-Transformer (SSTNT) framework. The proposed network adopts a modified TNT architecture, in which the inner Transformer employs a linear self-attention (LSA) mechanism to efficiently exploit pixel-level local features within sliding windows, while the outer Transformer preserves global attention to aggregate contextual information, thereby forming a cooperative local–global optimization scheme. Furthermore, a lightweight spatial–spectral similarity module is introduced to enhance the modeling of neighborhood structures. Finally, spectral reconstruction is achieved through a trainable endmember decoder and a normalized abundance estimation module. Extensive experiments conducted on both synthetic and real hyperspectral datasets demonstrate the effectiveness and robustness of the proposed method.

1. Introduction

Hyperspectral imaging systems capture fine spectral responses of materials through optical sensing processes by recording hundreds of contiguous spectral bands for each spatial pixel [1]. Compared with conventional RGB images, hyperspectral images (HSIs) acquire rich and continuous spectral measurements, providing distinctive advantages for fine-grained material identification and quantitative inversion. As a result, HSIs have been widely applied in a variety of fields, including agricultural production [2], mineral exploration [3], land resource investigation [4], environmental monitoring [5], ocean analysis [6], agricultural inspection [7], and military applications [8,9,10]. However, due to limited spatial resolution and mixed-pixel effects inherent in optical imaging systems, each observed pixel often represents a mixture of multiple material signatures (endmembers). Consequently, hyperspectral unmixing (HU) has become a fundamental task that aims to decompose mixed pixels into constituent endmember spectra and their corresponding abundance fractions. The objective of HU is to quantify sub-pixel material proportions or detect sub-pixel targets [11], and its accuracy directly affects the performance of subsequent fine-grained classification and target detection tasks, thereby facilitating the advancement of sub-pixel applications. In practice, HU remains challenging due to spectral variability caused by illumination changes, atmospheric effects, intrinsic material variations, and sensor-related degradations, as well as endmember uncertainty in real scenes, nonlinear mixing effects, and strong spatial heterogeneity across regions. Spectral variability, in particular, may lead to amplitude scaling and spectral shape distortions of the same material across different spatial locations, thereby increasing the difficulty of reliable similarity estimation and abundance reconstruction. Therefore, improving the modeling of spatial–spectral relationships under realistic imaging conditions is essential for enhancing the accuracy and stability of spectral reconstruction in computational optical imaging.
In general, hyperspectral unmixing models can be categorized into linear mixing models (LMMs), nonlinear models, and bilinear models [12]. Among them, the LMM has been the most widely adopted model in hyperspectral unmixing research due to its clear physical interpretability, computational efficiency, and strong adaptability. Classical approaches based on geometry, statistics, and sparse regression, such as Vertex Component Analysis (VCA) [13], Minimum Volume Constrained Nonnegative Matrix Factorization (MVC-NMF) [14], Nonnegative Matrix Factorization (NMF) [15], and Multi-Objective Group Sparse Unmixing (MO-GSU) have achieved favorable performances under specific conditions [16]. However, these methods exhibit inherent limitations when applied to diverse hyperspectral scenarios. For instance, geometric-based methods perform well on images with low noise levels and abundant pure pixels, but their effectiveness degrades significantly in highly mixed scenes. In contrast, statistical error-based and sparse regression-based methods are more capable of handling complex mixtures, yet they usually suffer from high computational costs and strong sensitivity to parameter selection.
To overcome these limitations, the introduction of deep learning techniques has opened up new directions for hyperspectral unmixing. Among them, autoencoder (AE)-based frameworks have attracted considerable attention due to their end-to-end learning capability and powerful feature representation ability, particularly in unsupervised learning, feature extraction, and dimensionality reduction tasks [17]. Wu et al. [18] proposed CHCANet, a cascaded hybrid convolutional autoencoder network for nonlinear unmixing, which exploits convolutional structures to deeply mine spatial–spectral information from hyperspectral data while preserving material details through a self-awareness mechanism. Zhao et al. [19] introduced AE-RED, a hyperspectral unmixing framework that combines deep autoencoders with denoising regularization, achieving strong robustness and accuracy in noisy and complex unsupervised unmixing scenarios. Cao et al. [20] proposed BU-Net, a hyperspectral unmixing method based on the generalized bilinear mixing model (GBM), which adopts a dual-stream stacked autoencoder architecture and 3D convolutions to extract multiscale spatial–spectral features, thereby effectively addressing nonlinear light scattering effects. Despite their effectiveness, most AE-based methods primarily focus on spectral feature extraction while overlooking the importance of spatial contextual information. To incorporate spatial contextual information, Chen et al. [21] proposed a Spatial–Spectral Adaptive Nonlinear Unmixing Network (SSANU-Net), which employs a dual-stream encoder to jointly learn spatial and spectral representations, followed by a dual-stream decoder to model linear and nonlinear photon scattering components. Nevertheless, conventional autoencoder architectures struggle to inherently satisfy the non-negativity and sum-to-one constraints of abundance fractions, and their representational capacity remains limited when dealing with complex nonlinear mixtures, spectral variability, and spatial heterogeneity.
Furthermore, advanced AE variants have been proposed to improve physical interpretability and stability. Gao et al. [22] proposed a cycle-consistency unmixing network (CyCU-Net) by learning cascaded autoencoders, which utilizes a self-perception loss to preserve high-level semantic information. Tao et al. [23] designed an abundance-guided attention network (A2SAN) that directly extracts endmembers from the network and uses estimated abundances to guide spatial–spectral attention, thereby skipping the traditional initialization step. Similarly, Tao et al. [24] introduced a dual-feature fusion network (DFFN) that explicitly computes spectral and spatial similarities to enhance the input HSI, followed by separate modules for abundance and endmember estimation, which reduces the inherent randomness of AE training. More recently, to explicitly tackle the critical challenge of endmember variability, Yang et al. [25] developed a cascaded dual-constrained transformer autoencoder (CDCTA), which incorporates a minimum distance constraint for geometric information and an abundance-weighted spectral angle constraint to determine spectral variations, effectively integrating physical priors into deep representation learning.
With the introduction of convolutional neural networks (CNNs), CNN-based methods have significantly enhanced the capability of spatial feature extraction in hyperspectral images. Early studies extended 1D spectral CNNs to 2D spatial CNNs [26], and later to 3D CNNs [27], enabling joint spatial–spectral learning. Chen et al. [28] introduced a multi-task 3D-CNN-based autoencoder for adaptive feature learning. Nevertheless, using 2D-CNNs alone makes it difficult to capture inter-band relationships unless a more complex network architecture is employed, whilst relying solely on 3D-CNNs often results in high computational complexity and suboptimal unmixing performance when dealing with similar textures across wide spectral bands. To balance these trade-offs, Tao et al. [29] combined 2D-CNNs and 3D-CNNs and proposed the Cross-Convolutional Unmixing Network (CrossCUN). Furthermore, Tulczyjew et al. [30] developed a multi-branch convolutional architecture for hyperspectral unmixing, in which the 1D-CNN and 2D-CNN branches are designed to extract spectral and spatial features, respectively, while the 3D-CNN branch performs early fusion of the features learned from the other two branches.
However, the limited receptive field of CNNs inevitably leads to the loss of abundant contextual information in original hyperspectral images, making it difficult to model long-range dependencies. Transformer architecture, which is capable of capturing global contextual dependencies and recovering missing information, provides a promising solution to this limitation. In recent years, various improvements to Transformer-based architectures have been proposed for hyperspectral image analysis. Ghosh et al. [31] proposed a novel deep neural network-based unmixing model with transformers (DeepTrans). Yang et al. [32] proposed a shifted-window U-shaped Transformer network (UST-Net), which enhances hierarchical feature modeling while reducing computational overhead. Duan et al. [33] introduced a novel dual-aware Transformer named UnDAT, which simultaneously exploits regional homogeneity and spectral correlation in hyperspectral images. Jiang et al. [34] proposed SSLT-Net, a hybrid network that integrates CNNs with Transformers to jointly learn local and global spatial–spectral features. Fazal Hadi et al. [35] developed a dual-branch spatial–spectral feature fusion Transformer (DSSFT) to enhance feature representation through complementary branch interactions. While pure Transformer architectures are capable of modeling long-range dependencies, they often suffer from high computational cost and patch-induced discontinuity. To combine global contextual modeling with local structural preservation, hybrid CNN–Transformer frameworks have been proposed. Subsequently, Chen et al. [36] employed a dual-stream collaborative design to jointly learn spatial–spectral global and local representations. Wang et al. [37] further introduced multiscale spatial aggregation within a Transformer-enhanced framework to adapt to heterogeneous object sizes. Despite their effectiveness, these hybrid methods generally depend on implicit attention fusion and fixed receptive-field designs, which may limit their capability in explicitly preserving spectral similarity and modeling variability under complex mixing conditions. Nevertheless, conventional Vision Transformer (ViT) methods partition images into non-overlapping fixed-size patches, which disrupt pixel-level spatial continuity and weaken local structural relationships. To address this issue, Sun et al. [38] proposed a self-supervised relation-aware Vision Transformer (SRViT). Although SRViT effectively enhances local relationship modeling, its high model complexity and substantial computational cost limit its efficiency when processing hyperspectral images. To further improve efficiency and representation capability, Xu et al. [39] proposed a multi-scale convolutional cross Transformer with convolutional cross-attention (MSCC-ViT). This network extracts multi-scale spatial–spectral features and achieves efficient cross-scale fusion by integrating attention mechanisms with convolutional operations, thereby capturing both local contextual information and non-local dependencies.
Although Transformer-based methods enhance global contextual modeling, several limitations remain in hyperspectral unmixing applications. Fixed non-overlapping patch partitioning weakens pixel-level spatial continuity, which is essential for accurate spatial–spectral representation. In addition, the quadratic computational complexity of global self-attention increases the computational burden when processing large-scale hyperspectral images. Furthermore, the absence of explicit similarity modeling within local neighborhoods limits the effective characterization of spatial–spectral consistency under spectral variability. In particular, most existing Transformer-based unmixing methods rely on implicit attention learning, where spatial–spectral relationships are derived solely from feature similarity in the embedding space without incorporating physically interpretable similarity constraints. As a result, the learned attention weights may not fully reflect intrinsic material consistency, especially under spectral variability and noise interference. Moreover, current approaches rarely introduce explicit spatial–spectral similarity priors to guide hierarchical relationship modeling. Therefore, there remains a need for a physically informed mechanism that can constrain both local and global attention computation while maintaining computational efficiency.
To address these issues, this study proposes a TNT-based unmixing framework guided by spatial–spectral similarity, which integrates similarity priors with TNT [40] for hyperspectral image unmixing. The main contributions of this work are summarized as follows:
(1)
An improved TNT network is proposed and implemented: Based on the original TNT architecture, the inner Transformer employs a linear self-attention (LSA) mechanism to efficiently compute local pixel similarities within a sliding window, while the outer Transformer maintains global self-attention to integrate contextual information across different image patches. This local–global collaborative mechanism significantly reduces computational complexity while enhancing the modeling capability for local spectral variations and spatial consistency.
(2)
A spatial–spectral similarity module is introduced: This module explicitly captures the spectral and spatial similarity within a local neighborhood by computing the cosine similarity and Euclidean distance between each pixel and its four neighboring pixels. By concatenating the resulting similarity tensor with the original spectral information, the input features are further enriched, providing the TNT network with spatial–spectral features that incorporate neighborhood structure. This effectively improves the model’s ability to capture local details and maintain spatial consistency, thereby enhancing the accuracy of endmember extraction and abundance estimation.
(3)
An end-to-end trainable unmixing framework is constructed: The model decodes endmembers through 1 × 1 convolutions and estimates abundances via channel-wise Softmax. During training, the framework simultaneously optimizes reconstruction accuracy and physical interpretability by minimizing loss functions such as MSE and SAD.

2. Related Work

2.1. Linear Mixture Model

The Linear Mixing Model (LMM) is widely adopted in hyperspectral unmixing due to its clear physical interpretation under optical superposition assumptions, making it the most fundamental and commonly used mixing model. Its core assumption is that the spectral response of each pixel can be represented as a linear combination of endmember spectra, with the weights corresponding to the abundance fractions of the respective endmembers in that pixel. According to the LMM, each observed pixel x i R L can be expressed as the weighted sum of endmember spectra and the corresponding abundances, i.e.,
x i = E a i + ε i
where E R L × P is the endmember matrix containing P endmember spectra, a i R P is the abundance vector containing the abundance fractions of each endmember for the i-th pixel, and ε i denotes the noise term representing observation noise in hyperspectral images. The goal of unmixing is to estimate the endmember matrix E and the abundance matrix A from the mixed spectral data X.
To ensure the physical interpretability of the abundance matrix A, it must satisfy the non-negativity constraint (ANC) and the sum-to-one constraint (ASC):
ANC : a i j 0 i , j
ASC : i = 1 P a i j = 1 i , j
Specifically, these constraints guarantee the physical meaning of unmixing: the spectrum of each pixel is a linear combination of multiple endmember spectra, and the abundances of all endmembers within the same pixel sum to one.

2.2. Multi-Head Self-Attention

The self-attention mechanism is the core component of the Transformer architecture and has been widely applied to various tasks. It computes the relational weights between any two elements in an input sequence and aggregates their information through weighted summation. For an input sequence of length N, the computational complexity of the standard self-attention mechanism is O N 2 , which leads to substantial computational overhead when processing large-scale data [41]. The self-attention operation is formulated as follows:
A t t e n t i o n Q , K , V = S o f t max Q K d k V
where Q, K and V denote the query, key, and value matrices, respectively, and d k represents the dimensionality of the keys. By computing the similarity between the query and key matrices, a weight matrix is generated and subsequently applied to the value matrix V to produce the weighted output.
Multi-head self-attention extends this mechanism by projecting the input into multiple subspaces and computing attention independently in each subspace. It is defined as:
Multihead Attention = Concat head 1 , head 2 , , head h W O
Each attention head is computed as:
head i = Attention Q W i Q , K W i K , V W i V
where W i Q , W i K , W i V denote the projection matrices for the i-th head, and WO represent the linear transformation matrix for the final output.

2.3. Foundation Model-Based Hyperspectral Representation Learning

Recently, foundation model paradigms have begun to influence hyperspectral imaging research. A representative work is SpectralGPT, which introduces a large-scale Transformer-based model pre-trained on massive remote sensing data to learn general spectral representations through self-supervised learning [42]. Such approaches aim to improve representation robustness and transferability across downstream tasks. However, foundation models primarily focus on general spectral feature learning rather than explicitly modeling endmember–abundance relationships, physical constraints, or spatial heterogeneity in hyperspectral unmixing. Therefore, task-oriented architectures that incorporate physical interpretability and dedicated unmixing mechanisms remain necessary.

3. Proposed Method

This section provides a detailed description of the proposed hyperspectral unmixing framework, termed SSTNT (Spatial–Spectral Similarity guided Transformer-in-Transformer with Linear Self-Attention). As illustrated in Figure 1, the overall architecture consists of a SCEB module, a TNT encoder, a linear self-attention mechanism, and decoding and constraint modules.

3.1. SCEB Module

Pixels in hyperspectral images often exhibit strong spatial continuity, and adjacent pixels typically share highly similar spectral characteristics. If neighborhood relationships are neglected, the resulting abundance maps are prone to noise artifacts or spatial discontinuities [43]. Cosine similarity is effective for material discrimination based on spectral shape; however, when different materials exhibit highly similar spectral shapes, cosine similarity alone may not provide sufficient discriminative power [44]. In such cases, the Euclidean distance between the input spectrum and the endmember spectrum can effectively reflect amplitude variations induced by intrinsic material properties, facilitating the capture of absolute intensity differences and thereby improving unmixing accuracy [45]. Traditional methods often rely on a single similarity metric, making it difficult to simultaneously account for both spectral shape and intensity information, which limits their ability to distinguish spectrally similar pixels in complex scenes. Therefore, motivated by the two fundamental characteristics of hyperspectral data, spectral shape similarity and amplitude consistency, a similarity module is introduced at the input stage. This module jointly exploits cosine similarity and Euclidean distance to construct a similarity tensor that comprehensively characterizes the spectral relationships among pixels.
Specifically, for a central x i pixel in the input hyperspectral image and its neighboring pixel x j , both the cosine similarity and the Euclidean distance are computed simultaneously:
d c x i , x j = cos x i , x j = x i x j x i 2 x j 2
d e x i , x j = x i x j 2 = k = 1 L x i , k x j , k 2
where 2 denotes the Euclidean norm, and x i , k , x j , k represent the spectral values of pixels x i and x j at the k-th spectral band, respectively. A cosine similarity value closer to 1 indicates higher spectral shape similarity between two pixels, while a smaller Euclidean distance implies a smaller spectral discrepancy. By combining these two complementary similarity measures, a comprehensive spectral similarity between pixels is obtained.
To this end, a weighted formulation is adopted to generate the similarity tensor S i , j , which represents the similarity between pixels x i and x j , defined as:
S i , j = d c ( x i , x j ) + e x p ( - d e ( x i , x j ) σ )
Through this similarity tensor, neighborhood information is constructed for each pixel and introduced as a structural prior, enabling the model to adapt to different regional spectral distributions. In regions with higher similarity, abundance distributions tend to be sparser, whereas in regions with lower similarity, abundance distributions become smoother. This adaptive behavior allows the unmixing process to more accurately capture region-specific characteristics.
The similarity tensor generated by this module is concatenated with the original hyperspectral image along the channel dimension and subsequently fed into the improved Transformer-in-Transformer (TNT) network after dimensionality reduction via a 1 × 1 convolution, followed by batch normalization (BN) and ReLU activation. This design facilitates a deep fusion of spectral and spatial information.

3.2. Linear Self-Attention Mechanism

In the proposed framework, Linear Self-Attention (LSA) serves as the core module of the inner Transformer, aiming to efficiently capture local spatial–spectral dependencies. As illustrated in Figure 2, the input to the LSA module is the fused feature representation X f u s i o n R H × W × C , which is obtained by concatenating the similarity tensor produced by the similarity module with the original hyperspectral image, followed by dimensionality reduction using a 1 × 1 convolution.
First, three 1 × 1 convolutional layers are employed to generate the query, key, and value matrices Q, K, and V, respectively:
Q = H c o n v Q X f u s i o n K = H c o n v K X f u s i o n V = H c o n v V X f u s i o n
where the convolutional operations perform feature projections along the spectral dimension without altering the spatial resolution.
The core computation of LSA is defined as:
A t t e n t i o n Q , K , V = Q S K d V
where S denotes the Softmax function and d is the scaling factor corresponding to the feature dimensionality. The key idea of this formulation lies in reordering the computation sequence: instead of explicitly computing the full attention matrix, S K d V is calculated first, followed by multiplication with Q. This reformulation effectively reduces the computational complexity of conventional self-attention from O N 2 to O N .
As shown in Table 1, when the window size is small (e.g., 4 × 4), the computational cost of LSA is comparable to that of MHSA. However, as the window size increases, the computational burden of MHSA grows rapidly. When the window size reaches 64 × 64 (4096 tokens), MHSA requires 268.42 MFLOPs and 39.80 ms inference time, while LSA requires 67.90 MFLOPs and 0.94 ms. Meanwhile, GPU memory consumption is reduced from 524.38 MB to 278.38 MB. In the proposed SSTNT framework, the window size is set to 5 × 5, which is consistent with the patch size in the inner Transformer.
Finally, the output of the LSA module is reshaped back to the original spatial dimensions:
H L S A X f u s i o n = H r e s h a p e 1 A t t e n t i o n Q , K , V
Through this linear self-attention mechanism, the model not only efficiently captures local spectral similarity and spatial dependencies, but also preserves fine-grained regional details under a computationally tractable cost.

3.3. Modified Transformer-in-Transformer (TNT) Encoder

Transformers exhibit excellent capability in global modeling; however, when applied to high-resolution hyperspectral images (HSIs), they suffer from two major limitations: insufficient capture of local spatial details and high computational complexity of window-based attention. The Transformer-in-Transformer (TNT) framework addresses these issues by introducing a dual-token mechanism, in which interactions between inner tokens and outer tokens enable effective modeling of both local and global information.
In the TNT framework, the input image is first partitioned into a set of patch tokens, and each patch is further subdivided into smaller sub-patches. The outer Transformer operates at the patch level, focusing on global information modeling by capturing long-range dependencies among different patches and integrating global contextual information to maintain overall image coherence. In contrast, the inner Transformer concentrates on fine-grained pixel-level information within each patch, capturing local spectral characteristics and spatial relationships to preserve detailed local structures. Through the interaction between inner and outer tokens, TNT is able to jointly attend to local details and global semantics, thereby achieving multi-scale feature modeling.
Suppose that the input hyperspectral image is uniformly divided into n patches, denoted as:
X = X 1 , X 2 , , X n R n × p × p × C
where X i represents the input feature of the i-th patch, n is the number of patches, p denotes the spatial size of each patch, and C is the number of spectral bands.
Each patch is further subdivided into m sub-patches, denoted as:
X X i , 1 , X i , 2 , X i , m
where X i , j R s × s × C represents the feature of the j-th sub-patch within the i-th patch, and s denotes the spatial size of each sub-patch.
By vectorization and linear projection, the sub-patch features are transformed into a sequence of token embeddings:
Y i = y i , 1 , y i , 2 , , y i , m ,   y i , j = F C V e c x i , j
where Y i denotes the token representation of all sub-patches within the i-th patch, y i , j R c is the token corresponding to the j-th sub-patch, c is the embedding dimension of the sub-patch tokens, FC is a fully connected layer, and V e c denotes the vectorization operator that reshapes a spatial feature map into a one-dimensional vector by flattening its spatial dimensions.
For the sub-patch token sequences, an inner Transformer is employed to model fine-grained local relationships within each patch. The computation of the inner Transformer is given by:
Y i l = Y i l 1 + L S A L N Y i l 1
Y i l = Y i l + M L P ( L N ( Y i l ) )
where l = 1 , 2 , , L denotes the index of the Transformer layer, L is the total number of inner Transformer layers, L S A denotes the linear self-attention mechanism, L N is layer normalization, and M L P represents a feed-forward network. This process aggregates detailed intra-patch information and provides high-quality local semantic representations for subsequent global modeling.
To capture global relationships among patches, the patch-level token sequence is defined as:
Z 0 = Z c l a s s , Z 1 0 , Z 2 0 , , Z n 0 R n + 1 × d
where Z c l a s s is a learnable class token, and Z i 0 denotes the initial token of the i-th patch.
At each layer, the features learned by the inner Transformer from the sub-patches are projected via a linear transformation and added to the corresponding patch-level token representation.
Z i l 1 = Z i l 1 + F C V e c Y i l
where Z i l 1 R d . Through this additive operation, the patch representation effectively integrates both the original structural information and the locally enhanced semantic features.
Subsequently, the outer Transformer updates the patch-level token sequence as follows:
Z l = Z l - 1 + M H S A ( L N ( Z l - 1 ) )
Z l = Z l + M L P ( L N Z l ) )
It is used to capture the long-range dependencies among different patches and achieve global feature modeling.
In summary, a TNT block jointly updates both sub-patch and patch representations, which can be expressed as:
Y l , Z l = T N T Y l 1 , Z l 1
Compared with the conventional Transformer architecture, the TNT framework exhibits significant advantages. First, by employing nested inner and outer Transformers, it enables hierarchical feature extraction, allowing information learning from local to global scales in a more effective manner. Second, TNT reduces computational complexity: compared with the O N 2 complexity of standard Transformers, the TNT complexity is reduced to O N + M 2 , which significantly alleviates the computational burden when processing high-resolution images.
To preserve spatial information, learnable one-dimensional positional embeddings are added to both patch and sub-patch tokens. The patch-level positional encoding is defined as:
Z 0 Z 0 + E patch ,   E patch R n + 1 × d
and the sub-patch positional encoding is defined as:
Y 0 Y i 0 + E subpacth ,   E subpatch R m × c ,   i = 1 , 2 , n
This design preserves global spatial consistency while maintaining local relative positional relationships.
In our implementation, the input hyperspectral image is uniformly partitioned into fixed-size patches of 5 × 5, resulting in 25 sub-patch tokens (pixel-level inner tokens) within each patch. The sub-patch size corresponds to a 1 × 1 pixel, meaning that each pixel inside a patch is treated as an individual inner token for fine-grained local modeling. These structural hyperparameters are kept consistent across all datasets and are not tuned per dataset, ensuring architectural consistency and experimental fairness.

3.4. Decoder

The feature representations output by the TNT module denoted as F T N T = Re s h a p e Z l R H × W × C are first passed through a 3 × 3 convolutional layer to integrate local contextual information and reconstruct the feature maps:
H d e c = C o n v 3 × 3 F T N T
Subsequently, a 1 × 1 convolutional layer is applied to project the channel dimension to the number of endmembers P, thereby generating the abundance maps A R H × W × P :
A = C o n v 1 × 1 H d e c
To satisfy the physical constraints of hyperspectral unmixing, namely non-negativity and the sum-to-one constraint, a Softmax function is applied along the channel dimension to normalize the abundance distribution of each pixel:
A ^ i j = exp A i j P = 1 P exp A i p
After abundance estimation, the model performs linear spectral reconstruction using a trainable endmember matrix E ^ R P × C :
X ^ = A ^ E ^
where X ^ denotes the reconstructed hyperspectral image and E ^ represents the estimated endmember spectra learned by the network.
The endmember matrix is learned in an end-to-end manner without requiring a predefined spectral library, which not only preserves the physical interpretability of the unmixing process but also enables adaptive spectral representation learning.

3.5. Loss Function

To improve the accuracy of endmember extraction and abundance estimation, a joint loss function is designed in this work, which is defined as:
L = L M S E + λ L S A D
where λ is a balancing coefficient that controls the trade-off between spectral amplitude differences and spectral shape discrepancies.
The Mean Squared Error (MSE) loss is employed to minimize the discrepancy between the reconstructed spectra and the ground-truth spectra, and is defined as:
L M S E = 1 N i = 1 N X i X ^ i 2 2
where X i denote the ground-truth and reconstructed spectra of the i-th pixel, respectively, and N is the total number of pixels.
The Spectral Angle Distance (SAD) loss emphasizes spectral shape similarity and is introduced to enhance endmember purity. It is formulated as:
L S A D = 1 N i = 1 N arccos X i X ^ i X i 2 X ^ i 2

4. Experiments

To ensure the validity of the experimental evaluation, experiments were conducted on one synthetic dataset and three real-world datasets, namely Samson, Jasper Ridge, and Apex. The RGB visualizations of these four datasets are shown in Figure 3. The superiority of the proposed method is verified through comprehensive comparisons with eight representative hyperspectral unmixing approaches, including A2SAN [23], DFFN [24], CyCU [22], MAT-Net [37], TCCU [36], CDCTA [25], DeepTrans [31], and MOGNMF [46].

4.1. Datasets

  • Synthetic dataset [47]: The synthetic dataset consists of 60 × 60 pixels with 200 spectral bands covering the spectral range of 0.4–1.4 μm. In this dataset, one material is used as the background, while the remaining four materials are distributed at the four corners of the scene. The abundance values are generated according to a Dirichlet distribution. The dataset includes five endmembers: Asphalt, Conifer, Concrete, Basalt, and Limestone.
  • Samson dataset [48]: The Samson dataset contains 952 × 952 pixels with 156 spectral bands ranging from 401 to 889 nm. A 95 × 95 subregion is extracted starting from pixel location (252, 332). The dataset mainly consists of three endmembers: Soil, Tree, and Water.
  • Jasper Ridge dataset [49]: The Jasper Ridge dataset comprises 512 × 614 pixels with 224 spectral bands covering the spectral range from 380 to 2500 nm. A 100 × 100 subregion is extracted starting from pixel location (105, 269). The final dataset includes four endmembers: Tree, Soil, Water, and Road.
  • Apex dataset [50]: The Apex dataset consists of 110 × 110 pixels with 285 spectral bands ranging from 413 to 2420 nm. This dataset contains four endmembers: Water, Tree, Road, and Roof.

4.2. Evaluation Metrics

In this comparative experiment, three widely used evaluation metrics are adopted to assess the performance of the proposed model: the reconstruction error (RE) between the reconstructed spectra and the original spectra, the root mean square error (RMSE) between the estimated abundances and the ground-truth abundances, and the spectral angle distance (SAD) between the estimated endmembers and the reference endmember signatures. These metrics are defined as follows:
R E X , X ^ = 1 N j = 1 N R E x j , x ^ j
R M S E a ^ j , a j = 1 N j = 1 N a ^ j a j 2
S A D e m , e ^ m = arccos e m e ^ m e m 2 e ^ m 2
where x ^ j , a ^ j , e ^ m denote the estimated spectral image, abundance maps, and endmember signatures, respectively, while x j , a j , e m represent the corresponding ground-truth spectral image, abundance maps, and endmember signatures.

4.3. Experimental Settings and Hyperparameter Analysis

All experiments were conducted on a computer equipped with an Intel(R) Core(TM) i5-10210U CPU and an NVIDIA GeForce MX250 GPU, using Python 3.10 as the software environment. Figure 4, Figure 5 and Figure 6 illustrate the hyperparameter analysis results on different datasets. As shown in Figure 4, the model achieves optimal performance on the Samson dataset when the learning rate is set to 9 × 10−3 and the parameters β and γ are set to 8 × 104 and 1 × 10−2, respectively. Figure 5 demonstrates that on the Jasper Ridge dataset, the best performance is obtained with a learning rate of 5 × 10−4, β = 1 × 102, and γ = 1 × 10−2. As illustrated in Figure 6, for the Apex dataset, the optimal performance is achieved when the learning rate is set to 1 × 10−2, with β = 1 × 102 and γ = 1 × 10−2. In addition, Table 2 provides detailed training parameter configurations.

4.4. Robustness Analysis

To evaluate robustness under noisy conditions, Gaussian noise with SNR levels of 30 dB, 20 dB, and 10 dB were added to the synthetic dataset. The spatial distribution was kept unchanged to ensure a controlled comparison. Table 3 reports the quantitative results under different noise levels. As the SNR decreases, RE, mean RMSE, and mean SAD increase gradually, which is consistent with the expected impact of stronger noise interference. Even under the challenging 10 dB condition, the proposed SSTNT maintains stable reconstruction performance without severe degradation. These results indicate that the proposed framework exhibits reliable robustness under varying noise levels.
Although the above experiments evaluate robustness under additive Gaussian noise, real hyperspectral imaging scenarios may also involve spectral variability induced by illumination changes and environmental conditions. Such variability may influence similarity estimation, especially when spectral responses of identical materials exhibit spatially varying amplitude or shape deviations. In the proposed framework, the joint use of cosine similarity and Gaussian-weighted Euclidean distance provides partial tolerance to moderate variability, while the hierarchical contextual modeling of the Transformer helps mitigate local perturbations. Nevertheless, the current model does not explicitly incorporate variability-aware mixing formulations such as ELMM or ALMM. Exploring such integration constitutes an important direction for future work.

4.5. Experimental Results and Comparisons

(1)
Synthetic dataset: The quantitative experimental results on the Synthetic dataset are reported in Table 4 and Table 5. It can be observed that the proposed SSTNT method achieves the best overall performance in both abundance estimation and endmember extraction. Specifically, SSTNT attains an average RMSE of 0.01011 for abundance estimation. In terms of endmember extraction, SSTNT achieves an average SAD of 0.00843, which is significantly lower than those of the competing methods. Overall, SSTNT demonstrates superior performance in both abundance estimation and endmember extraction on the Synthetic dataset.
(2)
Samson dataset: The quantitative results on the Samson dataset are presented in Table 6 and Table 7. Compared with other methods, SSTNT achieves the lowest average RMSE and average SAD, indicating the best overall performance in abundance estimation. Specifically, SSTNT achieves an average RMSE of 0.038479, which is 0.033164 lower than that of the second-best method, DeepTrans. Moreover, its average SAD is 0.047783, outperforming the second-best method, CDCTA, by 0.002028.
(3)
Jasper Ridge dataset: The quantitative results on the Jasper Ridge dataset are shown in Table 8 and Table 9. SSTNT consistently achieves the lowest average RMSE and average SAD among all compared methods. In abundance estimation, SSTNT obtains an average RMSE of 0.06819, which is 27.5% lower than that of the second-best method, DeepTrans, and demonstrates the best performance in estimating tree abundances. For endmember extraction, SSTNT achieves an average SAD of 0.066903, outperforming the second-best method, MAT-Net, by 8.05%.
(4)
Apex dataset: The quantitative results on the Apex dataset are reported in Table 10 and Table 11. As can be observed, SSTNT achieves the lowest average RMSE and average SAD compared with all competing methods. Specifically, SSTNT obtains an average RMSE of 0.12563 in abundance estimation, which is 2.26% lower than that of the second-best method, DeepTrans, and exhibits the best performance in estimating water abundances. In terms of endmember extraction, SSTNT achieves an average SAD of 0.08356, which is 12.96% lower than that of the second-best method, MOGNMF, demonstrating superior performance in extracting road and water endmembers.

4.6. Visual Analysis

Figure 7 and Figure 8 visually present the estimated endmember signatures and abundance maps obtained by all unmixing methods on the Synthetic dataset. As shown in Figure 7, the abundance maps produced by SSTNT, MAT-Net, and TCCU are closer to the ground truth (GT) compared with other methods. Figure 8 illustrates the endmember estimation results, where the endmembers extracted by SSTNT, MAT-Net, and TCCU are almost identical to the ground-truth signatures.
Figure 9 and Figure 10 further present qualitative comparisons of the abundance maps and endmember spectra of the Samson dataset. As shown in Figure 9, the abundance maps generated by SSTNT are closer to the ground truth and better preserve spatial continuity and the boundary structures of land-cover regions. This consistency can be attributed to SSTNT’s effective modeling of spatial–spectral similarity, which enables the capture of intrinsic relationships among materials across multiple spatial scales, thereby allowing a more accurate characterization of abundance variations in mixed pixels. In contrast, methods such as CDCTA and MOGNMF tend to underestimate the abundances of sand and water, resulting in incomplete local structures or unnecessary detail noise in the corresponding abundance maps. Figure 10 further indicates that the endmember spectra estimated by SSTNT is almost completely consistent with the reference spectra.
Figure 11 and Figure 12 present qualitative comparisons of unmixing results on the Jasper Ridge dataset. The abundance maps and endmember spectra generated by SSTNT exhibit significantly higher consistency with the ground truth than those of other methods. As shown in Figure 11, the abundance distributions produced by SSTNT maintain high consistency with the reference abundance maps (GT) in terms of spatial structure and detail representation, particularly in regions dominated by Tree, Soil, and Road materials, where abundance variations are more continuous and boundaries are more clearly delineated. In contrast, some competing methods exhibit noticeable estimation biases: MAT-Net tends to overestimate water abundance in water-dominated regions while underestimating tree and road abundances to varying degrees; CyCU shows insufficient detail representation in soil abundance maps, leading to excessive smoothing of local structures. Meanwhile, DeepTrans and MOGNMF exhibit varying degrees of underestimation in water abundance, resulting in a loss of critical spatial details. In comparison, SSTNT effectively mitigates these issues and maintains a more reasonable abundance allocation across different land-cover classes. Figure 12 shows the comparison between the estimated endmember spectra and the reference spectra, from which it can be observed that SSTNT achieves a high degree of consistency with the reference endmembers in both overall spectral trends and local band variations.
Figure 13 and Figure 14 present qualitative comparisons of unmixing results on the Apex dataset. The abundance maps and endmember spectra produced by SSTNT show significantly higher agreement with the ground truth than those generated by other methods. As illustrated in Figure 13, the abundance distributions generated by SSTNT maintain high consistency with the reference abundance maps in terms of spatial structure and detail representation, accurately capturing the spatial morphology and boundary information of Road, Tree, and Roof materials. In contrast, several competing methods exhibit varying degrees of estimation bias: A2SAN, DFFN, and MOGNMF generally overestimate water abundance in water-dominated regions while significantly underestimating road and tree abundances, leading to inaccurate spatial representations. MAT-Net and TCCU suffer from insufficient detail representation in roof abundance maps, with over-smoothed local regions that weaken boundary information. Furthermore, A2SAN, DFFN, CDCTA, and DeepTrans still exhibit varying degrees of water overestimation in road-dominated pixels, reducing spatial consistency in road regions. By contrast, SSTNT maintains a more balanced and reasonable abundance distribution across different land-cover classes, effectively alleviating the above issues. As shown in Figure 14, SSTNT achieves high consistency with the reference endmembers in terms of overall spectral trends and key band variations, accurately capturing the main characteristics of the endmember spectra.

4.7. Ablation Experiment

To verify the effectiveness and individual contributions of each component in the proposed SSTNT model, including the similarity module, the TNT framework, and the linear self-attention (LSA) module, comprehensive ablation experiments were conducted on four datasets. The quantitative results in terms of RMSE and SAD under different ablation settings are reported in Table 12. Overall, the complete SSTNT model achieves the best performance across all four datasets in terms of both reconstruction error (RMSE) and spectral angle distance (SAD), demonstrating the effectiveness of the proposed framework. The contributions of individual modules are analyzed as follows:
(1)
Effectiveness of the SCEB module: The introduction of the similarity module that jointly integrates Euclidean distance and cosine similarity leads to a significant performance improvement. After removing the similarity module, the RMSE on the Samson dataset increases from 0.0385 to 0.0680, while the SAD rises from 0.0478 to 0.0764. Similarly, on the Apex dataset, the RMSE increases from 0.1256 to 0.1418. These results indicate that the similarity module effectively captures local spectral consistency among neighboring pixels through the complementary Euclidean–cosine dual-metric fusion mechanism. By explicitly incorporating neighborhood spectral correlations, the model becomes capable of distinguishing subtle differences among highly similar spectra, thereby improving abundance continuity and endmember discriminability.
(2)
Impact of the TNT architecture: The incorporation of the TNT framework substantially enhances the model’s capability for multi-level feature modeling. When the TNT module is replaced with a conventional Transformer, a pronounced performance degradation is observed. Specifically, the RMSE on the Jasper Ridge dataset increases from 0.0682 to 0.1371, and on the Apex dataset from 0.1256 to 0.2311. This clearly demonstrates that the dual-token mechanism of TNT—consisting of inner and outer tokens—plays a critical role in multi-scale feature extraction. In contrast, conventional Transformers rely solely on global attention across patch-level features and lack the ability to model fine-grained pixel relationships within patches, leading to a substantial loss in unmixing accuracy.
(3)
Contribution of linear self-attention (LSA): The adoption of LSA further improves the model’s ability to capture local details. When LSA is replaced with traditional multi-head self-attention (MHSA), the overall performance decreases. On the Jasper Ridge dataset, the RMSE increases from 0.0682 to 0.1145, while on the Apex dataset it rises from 0.1256 to 0.1510. In addition, the SAD values increase to varying degrees across all datasets. These results suggest that the LSA module is more effective in focusing on relevant neighboring pixels, thereby providing higher robustness and accuracy in both endmember extraction and abundance estimation.

5. Conclusions

This paper proposed a spatial–spectral similarity guided Transformer-in-Transformer hyperspectral unmixing framework (SSTNT). The similarity module enhances local spectral consistency by combining cosine similarity and Gaussian-weighted Euclidean distance, providing discriminative spatial–spectral representations. The improved TNT encoder achieves hierarchical feature modeling through inner–outer token interaction, while the linear self-attention mechanism reduces computational complexity and enables efficient global dependency modeling. Experimental results on synthetic and real hyperspectral datasets, including Samson, Jasper Ridge, and Apex, demonstrate that SSTNT achieves superior performance in terms of RMSE and SAD, with improved spatial smoothness and spectral consistency. Despite the promising results, several challenges remain in hyperspectral unmixing. Severe spectral variability may still affect robustness in complex scenes. In addition, integrating task-specific unmixing models with emerging foundation model-based representations could enhance cross-scene generalization. Future work will focus on improving robustness and scalability while exploring hybrid representation learning frameworks.

Author Contributions

Writing—original draft, X.Z.; Writing—review & editing, X.C., A.D. and D.S. All authors have read and agreed to the published version of the manuscript.

Funding

This research was funded by the Science and Technology Research Project of the Education Department of Jilin Province, grant number JJKH20261478KJ. The APC was funded by Changchun University.

Data Availability Statement

The novel findings and original data of this study are incorporated into the main text of the article. For additional information or inquiries, please contact the corresponding authors. All original contributions generated in this research are included within the published article. Should further details be required, correspondence may be addressed to the corresponding authors.

Conflicts of Interest

The authors declare no conflict of interest.

References

  1. Aburaed, N.; Alkhatib, M.Q.; Marshall, S.; Zabalza, J.; Al Ahmad, H. A review of spatial enhancement of hyperspectral remote sensing imaging techniques. IEEE J. Sel. Top. Appl. Earth Obs. Remote Sens. 2023, 16, 2275–2300. [Google Scholar] [CrossRef] [Scilit]
  2. Barma, S.; Damarla, S.; Tiwari, S. K Semi-automated technique for vegetation analysis in Sentinel-2 multi-spectral remote sensing images using python. In Proceedings of the 2020 4th International Conference on Electronics, Communication and Aerospace Technology (ICECA), Coimbatore, India, 5–7 November 2020; pp. 946–953. [Google Scholar]
  3. Ghrefat, H.; Awawdeh, M.; Howari, F.; Al-Rawabdeh, A. Mineral exploration using multispectral and hyperspectral remote sensing data. In Geoinformatics for Geosciences; Elsevier: Amsterdam, The Netherlands, 2023; pp. 197–222. [Google Scholar]
  4. Albarakati, H.M.; Khan, M.A.; Hamza, A.; Khan, F.; Kraiem, N.; Jamel, L.; Alroobaea, R. A novel deep learning architecture for agriculture land cover and land use classification from remote sensing images based on network-level fusion of self-attention architecture. IEEE J. Sel. Top. Appl. Earth Obs. Remote Sens. 2024, 17, 6338–6353. [Google Scholar]
  5. Zeng, H.; He, X.; Bai, Y.; Gong, F.; Wang, D.; Zhang, X. Design and Construction of UAV-Based Measurement System for Water Hyperspectral Remote-Sensing Reflectance. Sensors 2025, 25, 2879. [Google Scholar] [CrossRef] [Scilit]
  6. Gong, Y.; Li, L.; Pawlowicz, R.; Cai, S. Numerical investigation on the generation and evolution of nonlinear internal waves in the southern Strait of Georgia. Prog. Oceanogr. 2023, 215, 103053. [Google Scholar] [CrossRef] [Scilit]
  7. Jeong, S.W.; Lee, I.H.; Kim, Y.G.; Kang, K.S.; Shim, D.; Hurry, V.; Ivanov, A.G.; Park, Y.I. Spectral unmixing of hyperspectral images revealed pine wilt disease sensitive endmembers. Physiol. Plant. 2025, 177, e70090. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  8. Victor-Luca, I. Multispectral, hyperspectral imaging and their military applications. In Proceedings of the Students’ International Conference AFASTUD 2024, Communicating Across Cultures, Braşov, Romania, 29–30 March 2024; pp. 29–37. [Google Scholar]
  9. Zhao, J.; Zhou, B.; Wang, G.; Ying, J.; Liu, J.; Chen, Q. Spectral camouflage characteristics and recognition ability of targets based on visible/near-infrared hyperspectral images. Photonics 2022, 9, 957. [Google Scholar]
  10. Seo, D.; Lee, D.; Park, S.; Oh, S. Hyperspectral Image-Based Identification of Maritime Objects Using Convolutional Neural Networks and Classifier Models. J. Mar. Sci. Eng. 2024, 13, 6. [Google Scholar] [CrossRef] [Scilit]
  11. Zou, J.; Qu, H.; Zhang, P. Conventional to deep learning methods for hyperspectral unmixing: A review. Remote Sens. 2025, 17, 2968. [Google Scholar] [CrossRef] [Scilit]
  12. Gu, J.; Yang, B.; Wang, B. Nonlinear unmixing for hyperspectral images via kernel-transformed bilinear mixing models. IEEE Trans. Geosci. Remote Sens. 2021, 60, 5520313. [Google Scholar] [CrossRef] [Scilit]
  13. Song, D.; Sun, N.; Xu, M.; Wang, B.; Zhang, L. Fast unmixing of noisy hyperspectral images based on vertex component analysis and singular spectrum analysis algorithms. Can. J. Remote Sens. 2020, 46, 34–48. [Google Scholar] [CrossRef] [Scilit]
  14. Stella, A.; Bonnier, F.; Miloudi, L.; Tfayli, A.; Yvergnaux, F.; Munnier, E.; Tauber, C. Minimum volume Constrained non-negative matrix factorization applied to the monitoring of active cosmetic ingredient into the skin in Raman imaging. In Proceedings of the 10th International Conference on Pattern Recognition Systems (ICPRS-2019), Tours, France, 8–10 July 2019; IET: London, UK, 2019; pp. 36–40. [Google Scholar]
  15. Lee, D.D.; Seung, H.S. Learning the parts of objects by non-negative matrix factorization. Nature 1999, 401, 788–791. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  16. Wei, Y.; Xu, X.; Pan, B.; Li, T.; Shi, Z. A multi-objective group sparse hyperspectral unmixing method with high correlation library. IEEE J. Sel. Top. Appl. Earth Obs. Remote Sens. 2022, 15, 7114–7127. [Google Scholar] [CrossRef] [Scilit]
  17. Berahmand, K.; Daneshfar, F.; Salehi, E.S.; Li, Y.; Xu, Y. Autoencoders and their applications in machine learning: A survey. Artif. Intell. Rev. 2024, 57, 28. [Google Scholar] [CrossRef] [Scilit]
  18. Wu, J.; Zhao, J.; Long, H. Cascaded hybrid convolutional autoencoder network for Spatial-Spectral nonlinear hyperspectral unmixing. Int. J. Remote Sens. 2024, 45, 9267–9286. [Google Scholar]
  19. Zhao, M.; Chen, J.; Dobigeon, N. AE-RED: A hyperspectral unmixing framework powered by deep autoencoder and regularization by denoising. IEEE Trans. Geosci. Remote Sens. 2024, 62, 5512115. [Google Scholar] [CrossRef] [Scilit]
  20. Cao, C.; Song, W.; Xiang, H.; Yi, H.; Xiao, F.; Gao, X. A two-stream stacked autoencoder with inter-class separability for bilinear hyperspectral unmixing. IEEE Trans. Comput. Imaging 2024, 10, 357–371. [Google Scholar] [CrossRef] [Scilit]
  21. Chen, X.; Zhang, X.; Ren, M.; Zhou, B.; Feng, Z.; Cheng, J. An improved hyperspectral unmixing approach based on a spatial–spectral adaptive nonlinear unmixing network. IEEE J. Sel. Top. Appl. Earth Obs. Remote Sens. 2023, 16, 9680–9696. [Google Scholar] [CrossRef] [Scilit]
  22. Gao, L.; Han, Z.; Hong, D.; Zhang, B.; Chanussot, J. CyCU-Net: Cycle-consistency unmixing network by learning cascaded autoencoders. IEEE Trans. Geosci. Remote Sens. 2021, 60, 5503914. [Google Scholar] [CrossRef] [Scilit]
  23. Tao, X.; Paoletti, M.E.; Wu, Z.; Haut, J.M.; Ren, P.; Plaza, A. An abundance-guided attention network for hyperspectral unmixing. IEEE Trans. Geosci. Remote Sens. 2024, 62, 5505414. [Google Scholar]
  24. Tao, X.; Koirala, B.; Plaza, A.; Scheunders, P. A new dual-feature fusion network for enhanced hyperspectral unmixing. IEEE Trans. Geosci. Remote Sens. 2024, 62, 5540113. [Google Scholar] [CrossRef] [Scilit]
  25. Yang, Y.; Wang, Y.; Liu, T. CDCTA: Cascaded dual-constrained transformer autoencoder for hyperspectral unmixing with endmember variability and spectral geometry. J. Appl. Remote Sens. 2024, 18, 026502. [Google Scholar] [CrossRef] [Scilit]
  26. Palsson, B.; Ulfarsson, M.O.; Sveinsson, J.R. Convolutional autoencoder for spectral–spatial hyperspectral unmixing. IEEE Trans. Geosci. Remote Sens. 2020, 59, 535–549. [Google Scholar] [CrossRef] [Scilit]
  27. Zhao, M.; Shi, S.; Chen, J.; Dobigeon, N. A 3-D-CNN framework for hyperspectral unmixing with spectral variability. IEEE Trans. Geosci. Remote Sens. 2022, 60, 5521914. [Google Scholar] [CrossRef] [Scilit]
  28. Chen, J.; Gamba, P.; Li, J. MAHUM: A multitasks autoencoder hyperspectral unmixing model. IEEE Trans. Geosci. Remote Sens. 2023, 61, 5519516. [Google Scholar]
  29. Tao, X.; Paoletti, M.E.; Han, L.; Wu, Z.; Ren, P.; Plaza, J.; Plaza, A.; Haut, J.M. A new deep convolutional network for effective hyperspectral unmixing. IEEE J. Sel. Top. Appl. Earth Obs. Remote Sens. 2022, 15, 6999–7012. [Google Scholar]
  30. Tulczyjew, L.; Kawulok, M.; Longépé, N.; Le Saux, B.; Nalepa, J. A multibranch convolutional neural network for hyperspectral unmixing. IEEE Geosci. Remote Sens. Lett. 2022, 19, 6011105. [Google Scholar] [CrossRef] [Scilit]
  31. Ghosh, P.; Roy, S.K.; Koirala, B.; Rasti, B.; Scheunders, P. Hyperspectral unmixing using transformer network. IEEE Trans. Geosci. Remote Sens. 2022, 60, 5535116. [Google Scholar] [CrossRef] [Scilit]
  32. Yang, Z.; Xu, M.; Liu, S.; Sheng, H.; Wan, J. UST-Net: A U-shaped transformer network using shifted windows for hyperspectral unmixing. IEEE Trans. Geosci. Remote Sens. 2023, 61, 5528815. [Google Scholar] [CrossRef] [Scilit]
  33. Duan, Y.; Xu, X.; Li, T.; Pan, B.; Shi, Z. UnDAT: Double-aware transformer for hyperspectral unmixing. IEEE Trans. Geosci. Remote Sens. 2023, 61, 5522012. [Google Scholar] [CrossRef] [Scilit]
  34. Deng, J.; Zhang, G.; Zhang, Z.; Bian, L.; Yang, C. SSLT-Net: A Spatial-Spectral Linear Transformer Unmixing Network for Hyperspectral Image. IEEE Geosci. Remote Sens. Lett. 2024, 22, 5501505. [Google Scholar]
  35. Hadi, F.; Farooque, G.; Shao, Y.; Yang, J.; Xiao, L. DSSFT: Dual branch Spatial-Spectral feature fusion transformer network for hyperspectral image unmixing. Earth Sci. Inform. 2025, 18, 352. [Google Scholar] [CrossRef] [Scilit]
  36. Chen, J.; Yang, C.; Zhang, L.; Yang, L.; Bian, L.; Luo, Z.; Wang, J. TCCU-net: Transformer and CNN collaborative unmixing network for hyperspectral image. IEEE J. Sel. Top. Appl. Earth Obs. Remote Sens. 2024, 17, 8073–8089. [Google Scholar] [CrossRef] [Scilit]
  37. Wang, P.; Liu, R.; Zhang, L. MAT-Net: Multiscale Aggregation Transformer Network for Hyperspectral Unmixing. IEEE Trans. Geosci. Remote Sens. 2024, 62, 5538115. [Google Scholar] [CrossRef] [Scilit]
  38. Su, Y.; Gao, L.; Plaza, A.; Sun, X.; Jiang, M.; Yang, G. SRViT: Self-Supervised Relation-Aware Vision Transformer for Hyperspectral Unmixing. IEEE Trans. Neural Netw. Learn. Syst. 2025, 36, 17585–17598. [Google Scholar] [CrossRef] [Scilit]
  39. Xu, C.; Ye, F.; Kong, F.; Li, Y.; Lv, Z. MSCC-ViT: A Multiscale Visual-Transformer Network Using Convolution Crossing Attention for Hyperspectral Unmixing. IEEE J. Sel. Top. Appl. Earth Obs. Remote Sens. 2024, 17, 18070–18082. [Google Scholar] [CrossRef] [Scilit]
  40. Han, K.; Xiao, A.; Wu, E.; Guo, J.; Xu, C.; Wang, Y. Transformer in transformer. Adv. Neural Inf. Process. Syst. 2021, 34, 15908–15919. [Google Scholar]
  41. Bhatt, J.S.; Joshi, M.V. Deep learning in hyperspectral unmixing: A review. In Proceedings of the IGARSS 2020—2020 IEEE International Geoscience and Remote Sensing Symposium, Waikoloa, HI, USA, 26 September–2 October 2020; pp. 2189–2192. [Google Scholar]
  42. Hong, D.; Zhang, B.; Li, X.; Li, Y.; Li, C.; Yao, J.; Yokoya, N.; Li, H.; Ghamisi, P.; Jia, X.; et al. SpectralGPT: Spectral remote sensing foundation model. IEEE Trans. Pattern Anal. Mach. Intell. 2024, 46, 5227–5244. [Google Scholar] [CrossRef] [Scilit]
  43. Gao, W.; Zhang, Y.; Akoudad, Y.; Chen, J. MSSF-Net: A Multimodal Spatial-Spectral Feature Fusion Network for Hyperspectral Unmixing. IEEE Trans. Geosci. Remote Sens. 2025, 63, 5511515. [Google Scholar] [CrossRef] [Scilit]
  44. Feng, X.R.; Li, H.C.; Wang, R.; Du, Q.; Jia, X.; Plaza, A. Hyperspectral unmixing based on nonnegative matrix factorization: A comprehensive review. IEEE J. Sel. Top. Appl. Earth Obs. Remote Sens. 2022, 15, 4414–4436. [Google Scholar] [CrossRef] [Scilit]
  45. Das, S.; Chakravortty, S. Efficient entropy-based spatial fuzzy c-means method for spectral unmixing of hyperspectral image. Soft Comput. 2021, 25, 7379–7397. [Google Scholar] [CrossRef] [Scilit]
  46. Chen, H.; Liu, L.; Xiu, X.; Liu, W. Adaptive Multi-Order Graph Regularized NMF with Dual Sparsity for Hyperspectral Unmixing. IEEE J. Sel. Top. Appl. Earth Obs. Remote Sens. 2025, 18, 22121–22136. [Google Scholar] [CrossRef] [Scilit]
  47. Asner, G.P.; Heidebrecht, K.B. Spectral unmixing of vegetation, soil and dry carbon cover in arid regions: Comparing multispectral and hyperspectral observations. Int. J. Remote Sens. 2002, 23, 3939–3958. [Google Scholar] [CrossRef] [Scilit]
  48. Palsson, B.; Sveinsson, J.R.; Ulfarsson, M.O. Spatial-Spectral hyperspectral unmixing using multitask learning. IEEE Access 2019, 7, 148861–148872. [Google Scholar] [CrossRef] [Scilit]
  49. Bioucas-Dias, J.M.; Figueiredo, M.A.T. Alternating direction algorithms for constrained sparse regression: Application to hyperspectral unmixing. In Proceedings of the 2010 2nd Workshop on Hyperspectral Image and Signal Processing: Evolution in Remote Sensing, Reykjavik, Iceland, 14–16 June 2010; pp. 1–4. [Google Scholar]
  50. Schaepman, M.E.; Jehle, M.; Hueni, A.; D’Odorico, P.; Damm, A.; Weyermann, J.; Schneider, F.D.; Laurent, V.; Popp, C.; Seidel, F.C.; et al. Advanced radiometry measurements and Earth science applications with the Airborne Prism Experiment (APEX). Remote Sens. Environ. 2015, 158, 207–219. [Google Scholar] [CrossRef] [Scilit]
Figure 1. Overall architecture of SSTNT.
Figure 1. Overall architecture of SSTNT.
Photonics 13 00276 g001
Figure 2. Architecture of the LSA.
Figure 2. Architecture of the LSA.
Photonics 13 00276 g002
Figure 3. True color images of experimental datasets.
Figure 3. True color images of experimental datasets.
Photonics 13 00276 g003
Figure 4. Hyperparameter analysis on the Samson dataset by varying: (a) learning rate, (b) beta, (c) gamma.
Figure 4. Hyperparameter analysis on the Samson dataset by varying: (a) learning rate, (b) beta, (c) gamma.
Photonics 13 00276 g004
Figure 5. Hyperparameter analysis on the Jasper Ridge dataset by varying: (a) learning rate, (b) beta, (c) gamma.
Figure 5. Hyperparameter analysis on the Jasper Ridge dataset by varying: (a) learning rate, (b) beta, (c) gamma.
Photonics 13 00276 g005
Figure 6. Hyperparameter analysis on the Apex dataset by varying: (a) learning rate, (b) beta, (c) gamma.
Figure 6. Hyperparameter analysis on the Apex dataset by varying: (a) learning rate, (b) beta, (c) gamma.
Photonics 13 00276 g006
Figure 7. Abundance maps estimated by different unmixing methods on the Synthetic dataset. The GT column shows the GT abundance maps.
Figure 7. Abundance maps estimated by different unmixing methods on the Synthetic dataset. The GT column shows the GT abundance maps.
Photonics 13 00276 g007
Figure 8. Reference signatures (red) and estimated endmember signatures (blue) by different unmixing methods on the Synthetic dataset.
Figure 8. Reference signatures (red) and estimated endmember signatures (blue) by different unmixing methods on the Synthetic dataset.
Photonics 13 00276 g008
Figure 9. Abundance maps estimated by different unmixing methods on the Samson dataset. The GT column shows the GT abundance maps.
Figure 9. Abundance maps estimated by different unmixing methods on the Samson dataset. The GT column shows the GT abundance maps.
Photonics 13 00276 g009
Figure 10. Reference signatures (red) and estimated endmember signatures (blue) by different unmixing methods on the Samson dataset.
Figure 10. Reference signatures (red) and estimated endmember signatures (blue) by different unmixing methods on the Samson dataset.
Photonics 13 00276 g010
Figure 11. Abundance maps estimated by different unmixing methods on the Jasper Ridge dataset. The GT column shows the GT abundance maps.
Figure 11. Abundance maps estimated by different unmixing methods on the Jasper Ridge dataset. The GT column shows the GT abundance maps.
Photonics 13 00276 g011
Figure 12. Reference signatures (red) and estimated endmember signatures (blue) by different unmixing methods on the Jasper Ridge dataset.
Figure 12. Reference signatures (red) and estimated endmember signatures (blue) by different unmixing methods on the Jasper Ridge dataset.
Photonics 13 00276 g012
Figure 13. Abundance maps estimated by different unmixing methods on the Apex dataset. The GT column shows the GT abundance maps.
Figure 13. Abundance maps estimated by different unmixing methods on the Apex dataset. The GT column shows the GT abundance maps.
Photonics 13 00276 g013
Figure 14. Reference signatures (red) and estimated endmember signatures (blue) by different unmixing methods on the Apex dataset.
Figure 14. Reference signatures (red) and estimated endmember signatures (blue) by different unmixing methods on the Apex dataset.
Photonics 13 00276 g014
Table 1. Quantitative evaluation of computational complexity for MHSA and LSA.
Table 1. Quantitative evaluation of computational complexity for MHSA and LSA.
Window SizeMHSA FLOPs (MFLOPs)LSA FLOPs (MFLOPs)MHSA Time (ms)LSA Time (ms)MHSA Memory (MB)LSA Memory (MB)
4 × 40.270.270.4580.4809.289.31
5 × 50.420.410.5200.5309.439.35
8 × 81.101.060.4800.5709.549.52
16 × 164.984.240.4580.51010.6311.07
24 × 2413.429.550.9800.65019.0716.28
32 × 3229.3616.972.6100.51041.2528.51
64 × 64268.4267.9038.8040.936524.38278.38
Table 2. Network hyperparameter settings.
Table 2. Network hyperparameter settings.
ParametersSyntheticSamsonJasper RidgeApex
Learning rate1 × 10−39 × 10−35 × 10−41 × 10−2
β9 × 1049 × 1041 × 1021 × 102
γ1 × 10−21 × 10−21 × 10−21 × 10−3
Epoch600200200200
Weight decay5 × 10−54 × 10−51 × 10−53 × 10−5
Dim200300200200
Table 3. Quantitative evaluation under varying SNR conditions on the synthetic dataset.
Table 3. Quantitative evaluation under varying SNR conditions on the synthetic dataset.
SNR (dB)REMean RMSEMean SAD
100.033317650.063543880.02985694
200.011051960.019403810.00706320
300.004811800.017529500.00400321
Table 4. Average RMSE results on the Synthetic dataset. The best performances are shown in bold.
Table 4. Average RMSE results on the Synthetic dataset. The best performances are shown in bold.
A2SANDFFNCyCUMAT-NetTCCUCDCTADeepTransMOGNMFProposed
Asphalt0.0705640.0217010.2122670.0198360.1780950.1247310.0777190.3014190.018146
Conifer0.0373450.0324380.0751950.0107160.0454520.0444070.022660.21170.006401
Concrete0.0252440.0125060.2025460.0114720.0862410.0638090.0391330.1644750.010372
Basalt0.0225750.0203980.060190.0053720.029250.1153530.0121150.157070.004079
Limestone0.0242460.0457570.0786780.0105040.0519270.0991830.0255270.2167330.004084
Mean RMSE0.0359950.026560.125780.011580 0.0946290.0945990.0421510.2165020.010111
Table 5. Average SAD results on the Synthetic dataset. The best performances are shown in bold.
Table 5. Average SAD results on the Synthetic dataset. The best performances are shown in bold.
A2SANDFFNCyCUMAT-NetTCCUCDCTADeepTransMOGNMFProposed
Asphalt0.0178530.0254430.0385160.0102760.1068380.0128360.0137160.0979350.005699
Conifer0.0289570.0181640.023660.0073370.0029660.0086210.0147730.0036650.003032
Concrete0.0156230.0130120.0370790.0066730.0159780.0162850.0202740.0059390.010160
Basalt0.0073430.0118460.027620.0042310.0142220.0189390.0094750.0076110.003109
Limestone0.0140510.0105550.0238480.0058500.0042440.0057960.0051810.0022060.002154
Mean SAD0.0167650.0158040.030150.0068730.0288490.0124950.0126840.0234710.004830
Table 6. Average RMSE results on the Samson dataset. The best performances are shown in bold.
Table 6. Average RMSE results on the Samson dataset. The best performances are shown in bold.
A2SANDFFNCyCUMAT-NetTCCUCDCTADeepTransMOGNMFProposed
Soil0.2933960.1705570.0949990.1318510.0703890.1161320.0668720.1335770.048273
Tree0.1789380.2803040.0919810.1240310.0890770.0614040.0687530.1342660.040824
Water0.1560540.1665060.1140730.2091230.0605030.111850.0787360.1970470.021098
Mean RMSE0.2094630.2057890.100350.1550020.0742740.0996110.0716430.1577950.038479
Table 7. Average SAD results on the Samson dataset. The best performances are shown in bold.
Table 7. Average SAD results on the Samson dataset. The best performances are shown in bold.
A2SANDFFNCyCUMAT-NetTCCUCDCTADeepTransMOGNMFProposed
Soil0.0990420.0112320.0258980.0175770.0187250.0255160.0087880.0590.019794
Tree0.0610590.0852420.095760.0940660.0879180.0769290.0555240.0796120.057404
Water0.0578950.0774550.1553530.0524640.1280330.0469880.0882040.112550.066152
Mean SAD0.0726650.0579770.092340.0547020.0782250.0498110.0508380.083720.047783
Table 8. Average RMSE results on the Jasper Ridge dataset. The best performances are shown in bold.
Table 8. Average RMSE results on the Jasper Ridge dataset. The best performances are shown in bold.
A2SANDFFNCyCUMAT-NetTCCUCDCTADeepTransMOGNMFProposed
Tree0.1178210.0915050.1464110.0925190.1418190.2074040.0984070.136360.062798
Water0.0976160.127640.2391430.0925930.1101870.1062930.1065930.0363760.069435
Soil0.1431710.0228270.1422670.0928020.1403650.2790790.0758270.1557730.075738
Road0.124550.0590340.2886080.0794960.1153880.2449310.0589470.1054360.064028
Mean RMSE0.120790 0.0752520.204110.0893520.127740 0.2191980.0869920.1175790.068192
Table 9. Average SAD results on the Jasper Ridge dataset. The best performances are shown in bold.
Table 9. Average SAD results on the Jasper Ridge dataset. The best performances are shown in bold.
A2SANDFFNCyCUMAT-NetTCCUCDCTADeepTransMOGNMFProposed
Tree0.1265830.0450670.0901070.0904090.1457680.0443380.1015410.1404610.089083
Water0.1132320.0844530.0900610.0821930.1215770.1490580.1570140.1141260.089702
Soil0.0839070.0887830.1165420.0624170.1090880.2096060.0320760.0824220.048761
Road0.1116190.0775290.1481420.054140 0.0486360.1227410.0236320.0436740.040064
Mean SAD0.1088350.0739580.111210.072290 0.1062670.1314360.0785660.0951710.066903
Table 10. Average RMSE results on the Apex dataset. The best performances are shown in bold.
Table 10. Average RMSE results on the Apex dataset. The best performances are shown in bold.
A2SANDFFNCyCUMAT-NetTCCUCDCTADeepTransMOGNMFProposed
Road0.1105420.2153690.2727440.4596120.1966480.2138740.1635740.1768490.176605
Roof0.168990.1868810.1852870.3097140.1566180.1285690.0972460.135050.101329
Tree0.1511740.1701920.1686760.2234680.1325090.1413330.12770.1152420.125194
Water0.1346180.1272420.115440.1802420.1278590.1092060.1162250.1112440.077475
Mean RMSE0.1413310.1749210.185540.2932590.1558090.1534380.128480.1370850.125631
Table 11. Average SAD results on the Apex dataset. The best performances are shown in bold.
Table 11. Average SAD results on the Apex dataset. The best performances are shown in bold.
A2SANDFFNCyCUMAT-NetTCCUCDCTADeepTransMOGNMFProposed
Road0.0965380.3939080.6855280.6914650.0975910.1613110.1292560.1164890.075274
Roof0.0516640.5730770.2308150.2243420.1322610.1428870.1322410.13955060.132443
Tree0.1074190.051170.1223340.1162030.0891090.1924420.0966670.0823430.083194
Water0.128747 0.1383220.5081180.23100070.0586090.0371160.0462940.0524720.043344
Mean SAD0.0960920.2891190.38670.3157520.0943920.1334390.1011140.0977140.08356
Table 12. Ablation experiment on our proposed SSTNT with varying information enhancement on different datasets. Best results are shown in bold. Note: √ denotes that the corresponding module is enabled, and × denotes that the module is disabled.
Table 12. Ablation experiment on our proposed SSTNT with varying information enhancement on different datasets. Best results are shown in bold. Note: √ denotes that the corresponding module is enabled, and × denotes that the module is disabled.
ModuleSyntheticSamsonJasper RidgeApex
SimilarityTNTLSARMSESADRMSESADRMSESADRMSESAD
0.0101110.0048300.0384790.0477830.0681920.0669030.1256310.08356
×0.0316940.006110.0680310.0763510.0690220.08082690.1418210.224915
×0.0290980.0089790.1371130.09701390.0762890.08696030.2310610.297907
×0.0128530.0061530.0399270.0676110.1144660.0767290.1509660.129573
××0.0193370.0067410.0471740.06000010.0751910.0750280.12758020.113233
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

Cui, X.; Zhang, X.; Dai, A.; Sun, D. SSTNT: A Spatial–Spectral Similarity Guided Transformer-in-Transformer for Hyperspectral Unmixing. Photonics 2026, 13, 276. https://doi.org/10.3390/photonics13030276

AMA Style

Cui X, Zhang X, Dai A, Sun D. SSTNT: A Spatial–Spectral Similarity Guided Transformer-in-Transformer for Hyperspectral Unmixing. Photonics. 2026; 13(3):276. https://doi.org/10.3390/photonics13030276

Chicago/Turabian Style

Cui, Xinyu, Xinyue Zhang, Aoran Dai, and Da Sun. 2026. "SSTNT: A Spatial–Spectral Similarity Guided Transformer-in-Transformer for Hyperspectral Unmixing" Photonics 13, no. 3: 276. https://doi.org/10.3390/photonics13030276

APA Style

Cui, X., Zhang, X., Dai, A., & Sun, D. (2026). SSTNT: A Spatial–Spectral Similarity Guided Transformer-in-Transformer for Hyperspectral Unmixing. Photonics, 13(3), 276. https://doi.org/10.3390/photonics13030276

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