Next Article in Journal
Quantitative Assessment of the Computing Performance for the Parallel Implementation of a Time-Domain Airborne SAR Raw Data Focusing Procedure
Previous Article in Journal
CNN-GCN Coordinated Multimodal Frequency Network for Hyperspectral Image and LiDAR Classification
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

A2Former: An Airborne Hyperspectral Crop Classification Framework Based on a Fully Attention-Based Mechanism

School of Resources and Environmental Engineering, Wuhan University of Technology, Wuhan 430070, China
*
Author to whom correspondence should be addressed.
Remote Sens. 2026, 18(2), 220; https://doi.org/10.3390/rs18020220
Submission received: 24 November 2025 / Revised: 31 December 2025 / Accepted: 3 January 2026 / Published: 9 January 2026
(This article belongs to the Section Remote Sensing in Agriculture and Vegetation)

Highlights

What are the main findings?
  • We proposed a fully attention-based framework for hyperspectral crop classification, offering a fundamental alternative to traditional patch-based methods.
  • We designed a checkerboard sampling strategy is to effectively mitigate the widespread issue of information leakage in hyperspectral image classification.
What are the implications of the main findings?
  • The method markedly improves classification accuracy and computational efficiency in complex scenarios while ensuring objective and reliable model evaluation.
  • It establishes a new technical paradigm for hyperspectral image classification and extends its potential to broader agricultural monitoring applications.

Abstract

Crop classification of farmland is of great significance for crop monitoring and yield estimation. Airborne hyperspectral systems can provide large-format hyperspectral farmland images. However, traditional machine learning-based classification methods rely heavily on handcrafted feature design, resulting in limited representation capability and poor computational efficiency when processing large-format data. Meanwhile, mainstream deep-learning-based hyperspectral image (HSI) classification methods primarily rely on patch-based input methods, where a label is assigned to each patch, limiting the full utilization of hyperspectral datasets in agricultural applications. In contrast, this paper focuses on the semantic segmentation task in the field of computer vision and proposes a novel HSI crop classification framework named All-Attention Transformer (A2Former), which combines CNN and Transformer based on a fully attention-based mechanism. First, a CNN-based encoder consisting of two blocks, the overlap-downsample and the spectral–spatial attention weights block (SSWB) is constructed to extract multi-scale spectral–spatial features effectively. Second, we propose a lightweight C-VIT block to enhance high-dimensional features while reducing parameter count and computational cost. Third, a Transformer-based decoder block with gated-style weighted fusion and interaction attention (WIAB), along with a fused segmentation head (FH), is developed to precisely model global and local features and align semantic information across multi-scale features, thereby enabling accurate segmentation. Finally, a checkerboard-style sampling strategy is proposed to avoid information leakage and ensure the objectivity and accuracy of model performance evaluation. Experimental results on two public HSI datasets demonstrate the accuracy and efficiency of the proposed A2Former framework, outperforming several well-known patch-free and patch-based methods on two public HSI datasets.

1. Introduction

Abundant agricultural resources are a crucial foundation for the survival and development of human society [1,2]. Against the backdrop of accelerating urbanization, maintaining agricultural resources to meet the growing demands of society is facing significant challenges [3,4]. In this context, achieving crop type identification has become a crucial task in agricultural remote sensing [5]. Remote sensing crop mapping aims to utilize remote sensing data to characterize the spatial distribution of different crop types, providing critical support for agricultural applications such as crop growth monitoring, yield estimation, and disaster loss assessment [6]. Therefore, how to achieve high-precision crop classification using remote sensing imagery has been one of the core research issues in the field of agricultural remote sensing.
Hyperspectral image (HSI), with its coverage of hundreds to thousands of continuous narrow bands and high spatial resolution, can more comprehensively reflect the spectral characteristics of objects, demonstrating significant advantages over traditional multispectral or optical remote sensing imagery [7,8]. Crop classification using HSI is essentially a hyperspectral image classification task, aiming to assign a semantic label to each pixel in the image [9]. However, in real agricultural scenes, different crop types often exhibit pronounced spatial heterogeneity and complex structural distributions, making robust discrimination difficult when relying solely on pixel-wise spectral information. This limitation has gradually driven research toward the joint modeling of spectral and spatial information. In practice, spatially adjacent pixels tend to share similar spectral characteristics and are more likely to belong to the same semantic category. Appropriately incorporating spatial constraints can therefore reduce classification uncertainty and effectively suppress salt-and-pepper noise. As a result, the joint exploitation of spectral and spatial information in hyperspectral imagery is widely regarded as a prerequisite for improving classification performance [10,11].
Early research on hyperspectral image (HSI) classification was primarily based on traditional machine learning methods, such as k-nearest neighbors (kNNs) [12], Bayesian estimation [13], multinomial logistic regression [14,15], and support vector machines (SVMs) [16,17,18,19]. These approaches achieved reasonable performance in spectral feature discrimination and were further extended to incorporate spatial information in order to improve classification accuracy. For example, Zhao [20] developed a robust spectral–spatial crop mapping method based on conditional random fields (SCRFs), in which spectrally weighted kernels were employed to learn crop-sensitive spectral information, while spatial interactions among neighboring pixels were exploited to enhance classification performance. Yang [21] proposed a kernel tensor sparse coding model for fine-grained crop classification, which leverages kernel tensor representations to improve linear separability while preserving spectral–spatial structural information. These studies clearly demonstrate the long-standing value of spectral–spatial joint modeling in hyperspectral crop classification. However, such methods typically rely on manually designed spatial constraints or shallow feature fusion mechanisms [22]. When applied to large-format, high-dimensional HSI data, they often suffer from low computational efficiency, heavy dependence on handcrafted features, and limited generalization capability [23]. Moreover, the joint modeling of spectral and spatial information in these approaches is relatively complex and lacks adaptability, making it difficult to meet the practical requirements of complex agricultural application scenarios.
In recent years, with the remarkable advances of deep learning in the field of computer vision, its application to hyperspectral image (HSI) classification has also increased substantially [24]. As one of the earliest deep learning paradigms introduced for HSI classification, patch-based classification models incorporate neighborhood information by exploiting local pixel contexts. Representative approaches include 3D convolutional neural networks (3D-CNNs) and two-stream networks. The former is widely regarded as the most natural architecture for modeling spectral–spatial information, as it employs three-dimensional convolutional kernels that slide directly over the hyperspectral data cube, simultaneously capturing correlations along the spectral dimension and structural information in the spatial domain, without the need for handcrafted feature design as required by traditional methods.In contrast, two-stream networks are designed with two independent branches to separately extract spectral features (e.g., using 1D-CNNs or recurrent neural networks) and spatial features (e.g., using 2D-CNNs), which are subsequently fused at the fully connected layer [25]. These methods demonstrate strong capability in modeling local spectral–spatial features. For instance, approaches such as SSRN [26] and S3AM [27] effectively extract hierarchical representations through 2D or 3D convolutional operations.
However, although the aforementioned deep models enhance spectral–spatial feature modeling to a certain extent, in crop hyperspectral classification scenarios, these CNN-based strategies implicitly treat all spatial locations and spectral channels equally. For hyperspectral imagery, there is no explicit mechanism to emphasize more informative spectral bands or spatial positions. Consequently, their feature extraction capability largely depends on network depth and convolutional kernel size, making it difficult to adaptively learn which spectral bands or pixel locations are more discriminative [28].
The attention mechanism (AM) was originally proposed [29] to emulate the human visual perception process, enabling models to focus on critical components within the feature space while suppressing irrelevant information. With the rapid development of attention mechanisms, an increasing number of hyperspectral image (HSI) classification models have incorporated AM-based designs. For example, SSFTT [30], SSTN [31], and the spatial–spectral feature extraction network with a patch attention module (PASSNet) [32] have demonstrated the effectiveness of attention mechanisms, which is closely related to their strong capability in feature representation learning. They adaptively recalibrate feature responses across spectral channels or spatial locations, thereby emphasizing information-rich features while suppressing less informative ones. This substantially enhances the exploitation of spectral–spatial information, leading to improved classification accuracy.
However, most of the aforementioned methods are built upon the patch-based input methods discussed earlier, which is inherently analogous to image classification approaches in computer vision. Patch-based input methods are fundamentally similar to image classification methods in computer vision. These methods draw inspiration from the fundamental principles of image classification in computer vision. Their core idea is: during training and inference, a hyperspectral image of size H × W is divided into several fixed-size subregions of size S × S. Each subregion is treated as an independent sample, fed into the classification network to extract features and perform category discrimination. Compared to traditional pixel-wise classification methods, this strategy leverages spatial structural information within each pixel neighborhood to enhance classification accuracy. However, in patch-based classification methods, there is an inherent trade-off between the model’s implicit receptive field and the effectiveness of model performance evaluation. Specifically, the method’s ability to capture long-range spatial dependencies is directly constrained by the input patch size S. To alleviate this problem, researchers tend to adopt larger S values. However, while this strategy increases the model’s perceptual range, it also systematically increases the correlation between training and test samples. This, in turn, leads to information leakage and violates the basic assumptions of supervised learning [33,34], making it difficult to objectively evaluate model performance and generalization ability [35].
With the widespread application of advanced airborne platforms and drones equipped with high-resolution hyperspectral sensors, large-format hyperspectral image data has become increasingly prevalent in recent years [36]. However, traditional patch-based methods face significant bottlenecks when addressing large-format classification tasks. Therefore, some researchers have enhanced traditional semantic segmentation models (such as U-Net and fully convolutional networks (FCNs)) to address the challenges of large-format hyperspectral image classification. These improvements aim to enhance computational efficiency and achieve higher accuracy [37]. Leveraging the end-to-end pixel-level prediction capabilities of semantic segmentation models, each pixel in the input image can be efficiently classified and annotated. For instance, the FPGA framework extracts global spatial context information from the entire image using an encoder based on spectral attention and a lightweight decoder structure, it obtains different gradients from hierarchical samples to ensure convergence [38]. HSI-TransUnet employs a CNN network with spectral attention and a residual connection Transformer to extract global contextual features, yielding outstanding performance in HSI crop classification [39].
However, most current works still heavily rely on convolutional neural networks (CNNs) in their overall architecture or key blocks. For example, some methods still employ a fully CNN-based structure for encoding and decoding, which results in significant dimensional redundancy in their rich spectral features. Relying solely on local convolutions makes it difficult to exploit their potential discriminative features fully. While some fusion models incorporate Transformer blocks into the encoder to enhance global context modeling capabilities, their decoders remain entirely CNN-based, primarily achieving spatial restoration and classification through layer-wise convolutions and upsampling, thereby inevitably increasing the model’s parameter count and computational burden. Additionally, many image categories are rich, and spatial information is complex. When restoring resolution, semantic segmentation models often need to reconstruct both complete ground target boundaries and fine-grained targets, which requires balancing the reconstruction of local and global features. Furthermore, regarding data sampling strategies, existing methods use the entire HSI as input for both training and testing. Even when employing label masking strategies, they face inherent data leakage challenges between training and evaluation datasets, which compromises the reliability of accuracy assessments [40]. Additionally, using the entire HSI as input leads to high memory consumption and batch size limitations, significantly reducing training speed.
Although spectral–spatial joint modeling has been extensively studied, how to further improve the exploitation of spectral–spatial information in crop hyperspectral classification remains an open and challenging problem. Specifically, it is not sufficient to merely introduce spatial information into the model; more importantly, a well-designed modeling mechanism is required to dynamically adjust the relative importance of spectral and spatial information across multiple levels of feature representation. However, most existing works based on semantic segmentation paradigms still heavily rely on convolutional neural networks (CNNs) in either the overall architecture or key modules. For example, some methods adopt fully CNN-based encoder–decoder structures, which often result in significant dimensional redundancy in spectral–spatial features, making it difficult for local convolutions alone to fully exploit their latent discriminative characteristics. Other hybrid approaches incorporate Transformer modules into the encoder to enhance global context modeling, while retaining CNN-based decoders that rely primarily on successive convolutions and upsampling operations for spatial recovery and classification. This design inevitably leads to suboptimal feature reconstruction performance. In practice, hyperspectral images often contain diverse land-cover categories and complex spatial structures. During resolution recovery, semantic segmentation models are required to reconstruct complete object boundaries and fine-grained details, which necessitates a careful balance between local feature refinement and global contextual reconstruction. Furthermore, regarding data sampling strategies, existing patch-based approaches that treat the entire HSI as input for training and testing still suffer from inherent data leakage between training and evaluation sets, thereby compromising the reliability of accuracy assessment [40]. In addition, using full HSI data as model input incurs high memory consumption and imposes strict limitations on batch size, significantly reducing training efficiency.
Overall, current research primarily focuses on addressing the following challenges:
  • HSI simultaneously contains rich spectral information about objects and complex spatial structural information. Designing a feature extraction paradigm that can effectively fuse the two and deeply explore their intrinsic correlations to learn more discriminative spectral–spatial joint features is a prerequisite for achieving precise object classification.
  • Accurate classification requires models to capture pixel-level local textures and boundary details (local features) while also understanding the layout of large-format scenes and long-range dependencies between objects (global features) to ensure semantic consistency. Balancing different model architectures (such as CNNs’ local inductive biases and Transformers’ global modeling capabilities) to achieve efficient, synergistic modeling of multi-scale features is a critical architectural design challenge.
  • The high dimensionality of HSI poses notable computational and memory challenges. In addition, patch-based training may suffer from information leakage caused by overlapping patches, leading to biased performance evaluation.
To address the above issues, we propose a fusion network based on a fully attention mechanism that combines CNN and Transformer, named A2Former (All-Attention Transformer) for HSI classification. A2Former effectively extracts and enhances deep spatial–spectral features using an efficient and lightweight spectral–spatial attention weights block (SSWB) and a convolutional vision transformer block (C-VIT). It also employs a Transformer-based decoder with a gated-style weighted fusion and interaction attention block (WIAB) and a fused head (FH) that fuses spectral–spatial attention to efficiently model local and global features, achieving precise segmentation. Additionally, we propose a checkerboard-style sampling strategy that prevents information leakage, ensuring the objective evaluation of the proposed model’s performance. The main contributions of this study are as follows:
  • We propose the A2Former framework to address the synergistic utilization of spectral and spatial features as well as the efficient modeling of local and global information. The proposed model adopts a hybrid architecture that integrates CNNs and Transformers, enabling efficient exploitation of spectral–spatial characteristics while simultaneously capturing fine-grained local textures and modeling global contextual layouts, thereby producing more robust joint feature representations.
  • To address the long-standing challenges of computational overhead and information leakage in model evaluation, we design a novel checkerboard-style sampling strategy. By partitioning the hyperspectral data into several strictly non-overlapping groups and balancing the classes as much as possible, we mitigate the inherent information leakage risks associated with traditional patch-based input methods, thereby making model performance evaluation more objective and reliable.
The primary objective of this study is to develop a novel semantic segmentation-based framework for the accurate and efficient classification of large-format airborne hyperspectral imagery of croplands, while ensuring the reliability of classification accuracy through a carefully designed sampling strategy.
The rest of this paper is organized as follows. Section 2 provides an in-depth examination of the proposed A2Former framework. Section 3 presents experimental results on two datasets and further analyzes the proposed blocks. Finally, Section 4 and Section 5 provide a summary of the paper and present further discussions.

2. Methods

As shown in Figure 1, the overall architecture of A2Former consists of four main blocks that integrate various attention mechanisms: an encoder with overlap-downsample and spectral–spatial attention weights (SSWB), a convolutional vision transformer block (C-VIT), a decoder with gated-style weighted fusion and interactive attention (WIAB), and a fused head (FH).
Specifically, A2Former takes fixed-size image patches as input, first extracting multi-scale local spatial–spectral features via the SSWB. These multi-scale features are then fed into the decoder, where the gating mechanism dynamically adjusts the feature fusion weights transmitted from the previous decoding layer via skip connections, enabling more effective multi-level feature integration and reconstruction. Additionally, the C-VIT block is embedded before the decoding path to enhance the spatial–spectral representation capabilities of deep features. Finally, the reconstructed original-resolution feature map is fed into the FH to generate the final segmentation prediction results. Furthermore, the auxiliary head (AH) outputs an auxiliary segmentation map based on the intermediate features fused by three WIAB blocks, which guides the optimization of the main features to further improve segmentation accuracy and boundary detail restoration capabilities.

2.1. Encoder with Spectral–Spatial Attention Weights

To effectively extract the rich spectral features in HSI while also considering spatial features, we introduce the Overlap-Down block [41]. Additionally, the encoder in A2Former follows a modular design, consisting of the Overlap-Down block and the spectral–spatial attention weighting block (SSWB) stacked together.
The Overlap-Down block employs a 4 × 4 kernel size and a stride of 2 for convolution operations, along with group normalization (GN) and the ReLU activation function, allowing for the extraction of continuous and rich local detail features while performing spatial downsampling. Compared to commonly used downsampling methods (such as 3 × 3 max pooling with a stride of 2 or 3 × 3 dilated convolution with a dilation rate of 2), this block maintains the actual receptive field while compressing the feature map size through overlapping convolution, effectively enhancing the expression of spatial contextual information. Its output features not only exhibit stronger structural continuity but also provide the subsequent decoder with more complete and scalable spatial semantic information [41].
As shown in Figure 1A, in any layer of the proposed block, given the original HSI data X = X 1 , X 2 , , X C R C × H × W , where H, W and C denote height, width, and spectral dimension, respectively. We first calculate the downsampled tensor X R C × H 2 × W 2 , where C denotes the dimension of the downsampled feature map
X = RE GN X 1 , , X i , , X C
X i = V i X = m = 1 C V i m X m
where V = V 1 , , V i , , V C denotes a set of learnable convolution kernels, when V i = V i 1 , V i 2 , , V i C acts on the input tensor X, ∗ denotes the convolution operation, RE denotes the RELU activation function, and GN denotes the group normalization function.
To highlight more important feature maps and suppress less useful ones, we designed a Spectral Spatial Weighting Block (SSWB), as shown in Figure 1B. First, the transformed input feature maps are processed by two MLP layers to model inter-channel dependencies. The first layer reduces the channel dimension to one-quarter with an ReLU activation, while the second restores it to the original size. After an inverse transformation, a Sigmoid activation function is applied to produce the channel attention map [42].
X C = σ MLP RE MLP Permute X X
where X C is the enhanced feature map, σ is the Sigmoid function, ⊙ denotes element-wise multiplication, and X is the original input feature map.
Second, to further mix and share information, a channel shuffling [43] operation is applied. The enhanced feature map is divided into N groups, each containing C N channels. The grouped feature maps are transposed to scramble the order of channels within each group. Subsequently, the scrambled feature maps are restored to their original shape C × H × W . This method better mixes feature information and enhances feature expression capabilities.
Finally, in the spatial attention subblock, the input feature map passes through a 7 × 7 convolution layer, reducing the number of channels to 1/4 of the original, following the design in [44]. Then, it undergoes batch normalization and nonlinear transformation via the ReLU activation function. Next, a second 7 × 7 convolution layer restores the number of channels to the original dimension C, followed by another batch normalization layer.
Y = σ Conv BN RE Conv ( CS ( X C ) ) CS ( X C )
where CS denotes channel shuffle, and Conv denotes a 7 × 7 convolution layer.

2.2. Convolutional Vision Transformer Block

To further enhance the high-dimensional feature representations generated by the SSWB, we innovatively introduced and improved the MSCB block in the field of hyperspectral classification [45]. It first expands the number of channels through a (1 × 1) convolutional layer EConv, followed by a batch normalization layer BN and an ReLU activation function layer. Next, we employ a multi-scale deep separable convolution block (MSDC) to extract multi-resolution information from different receptive fields by concurrently performing depth-wise convolution operations at multiple scales, thereby achieving global dependency modeling capabilities comparable to VIT. Additionally, we utilize channel shuffle [43] to effectively enhance inter-channel dependencies and feature diversity, thereby further strengthening the synergistic representation between spatial and spectral features.
Subsequently, we use another (1 × 1) convolutional layer RConv and a BN layer to map the features back to the original number of channels and further encode the dependencies between channels. Finally, the structure of C-VIT is shown in Figure 1C and mathematically expressed in the following formula:
C - VIT ( x ) = BN ( RConv ( CS ( MSDC ( RE ( BN ( EConv ( x ) ) ) ) ) ) )
The parallel multi-scale deep convolutional block (MSDC) can be expressed by the following formula:
MSDC ( x ) = k s K S DWCB k s ( x )
DWCB k s ( x ) = RE ( BN ( DWC k s ( x ) ) )
where DWC k s x is a depth-wise convolution with a kernel size of k s , while BN and RE denote batch normalization and the RELU activation function, respectively.
In addition, to further improve nonlinear modeling capabilities and feature expression stability, we introduce a recursive residual connection mechanism in MSDC, where the input x is added to the previous DWCB k s x through a residual connection. This means that MSDC is stackable, enabling deep feature fusion and stronger regularization capabilities:
x = x + DWCB k s x

2.3. Decoder with the Gated-Style Weighted Fusion and Interaction Attention

Our proposed decoder consists of two parts: an interactive attention Transformer block and a gated weighted fusion block. A detailed description is provided below: The interactive attention Transformer block consists of an interactive attention mechanism, a multi-layer perceptron (MLP), two batch normalization layers, two batch normalization layers, and two additional operations, as shown in Figure 2I. The configurations of other blocks are consistent with the standard Transformer decoder, with the core being the proposed interactive attention mechanism: while global features hold core value in semantic segmentation, preserving fine-grained spatial details still relies on the effective expression and modeling of local features. To address this challenge, we propose an interaction attention mechanism that constructs two parallel branches to extract global and local context, as shown in Figure 2a,b. The local branch consists of two parallel convolutional layers with kernel sizes of 3 × 3 and 1 × 1, respectively, with two BN layers added before summation to extract local context. The global branch employs a window-based multi-head self-attention mechanism. Specifically, the input two-dimensional feature map (dimensions B × C × H × W) is first expanded by a dilated convolution to triple the number of channels, followed by window partitioning to convert the feature representation into sequences of query (Q), key (K), and value (V) vectors. Considering the high dimensionality of HSI, the number of channels C is set to 256, and the window size w and head count h are both set to 8. This mechanism is inspired by the implementation of local self-attention in the Swin Transformer [46].
In this paper, inspired by UNnetFormer [47], we propose an axial attention context interaction block to capture cross-window relationships efficiently. As shown in Figure 2d, the cross-shaped window context interaction block fuses two feature maps generated by horizontal and vertical axial attention layers to capture the global context. The horizontal axial attention layer establishes horizontal relationships between windows. For any point P 1 m , n within a window, its global relationships depend not only on point P 1 m + i , n within the same window but also on point P 2 m + w , n in the adjacent horizontal window. The dependency modeling of P 1 m , n can be expressed by the following formula:
P 1 ( m , n ) = i = 0 w m 1 D i P 1 ( m , n ) + j = 0 m D j P 2 ( m + w , n ) w
where D denotes self-attention computation, which can model the dependencies between pixel pairs within a local window. w denotes the window size. Similarly, the vertical attention layer models vertical relationships between windows. The overall process can be described as follows: First, the horizontal and vertical dependencies of Win1 are modeled as: W i n 1 = H ( W i n 2 ) and W i n 1 = V ( W i n 3 ) . Similarly, Win4 is modeled in the same manner as Win1. Finally, the relationship between Win1 and Win4 is modeled as W i n 1 = V ( H ( W i n 4 ) ) + H ( V ( W i n 4 ) ) . By introducing more intermediate windows (e.g., Win2 and Win3), the model can simulate long-range dependencies between arbitrary window pairs. Therefore, the axial attention context interaction block effectively models window-based long-range dependencies, enabling global context capture.
Then, use the gate-weighted fusion block to aggregate the semantic features generated by the encoder with the features generated by the decoder. To learn more generalized fusion features, as shown in Figure 2e, this block selectively weights the two features based on their contributions to segmentation accuracy. The formula can be expressed as follows:
X c = β · X e + 1 β · X d
where X c denotes the fused feature map, X l denotes the feature map sent by the skip connection, X d denotes the feature map output by the previous decoder, and β denotes a variable weight used to regulate the fusion ratio between the two feature maps.

2.4. Fused Head

The shallow features extracted by the first SSWB retain rich spatial details but exhibit limited semantic expressiveness. In contrast, deep features provide stronger semantic representations but suffer from reduced spatial resolution. To address this issue, we propose a spectral–spatial fusion head that bridges the semantic gap between shallow and deep features, thereby improving classification accuracy. As illustrated in Figure 1D, we adopt a spectral–spatial dual-branch modeling approach to enhance feature representation in both channel and spatial dimensions. Specifically, the spectral branch employs a two-layer MLP to model inter-channel correlations: the first layer compresses the channel dimension to one-fourth of its original size with ReLU activation, and the second layer restores it. The spatial branch applies depth-wise convolution to generate a spatial attention map X a R H × W × 1 where H and W denote the height and width of the feature map, respectively, thereby capturing spatial positional information. The attention features from both branches are fused via element-wise addition, followed by a 1 × 1 convolution for integration, ultimately producing the segmentation output. To mitigate performance degradation, a residual connection is incorporated into the structure.

2.5. Loss Fuction

During training, in addition to the fused head, an auxiliary head is designed to jointly optimize the interaction attention Transformer block, as shown in Figure 1. Prior research has demonstrated that such multi-branch segmentation architectures significantly enhance model performance [48]. Based on this multi-head design, we introduce a joint training mechanism of principal loss and auxiliary loss for the entire network. The principal loss function comprises Dice loss and cross-entropy loss, defined as follows:
L ce = 1 N n = 1 N k = 1 K y k ( n ) log y ^ k ( n )
L dice = 1 2 N n = 1 N k = 1 K y ^ k ( n ) y k ( n ) y ^ k ( n ) + y k ( n )
L p = L ce + L dice
where N and K denote the number of samples and the number of classes, respectively. y ( n ) and y ^ ( n ) denote the one-hot encoding of the true semantic label and the corresponding softmax output of the network, respectively, where n [ 1 , , N ] . y ^ k ( n ) is the confidence that sample n belongs to class k.
To better balance the contributions of the principal and auxiliary losses, we introduce a scaling factor α , which is applied to the auxiliary loss and added to the total loss. The overall loss function is defined as follows:
L = L p + α × L aux
By default, the hyperparameter α is set to 0.4.

3. Experiments

In this section, we systematically evaluate the effectiveness of the proposed A2Former framework through a series of comprehensive experiments. First, we present the experimental setup, detailing the two benchmark datasets used, the proposed checkerboard sampling strategy, and the specific dataset partitioning scheme. To validate the necessity and contribution of each key component within A2Former, we conducted a series of detailed ablation experiments. Finally, to comprehensively evaluate the overall performance of A2Former, we conducted both quantitative and qualitative comparisons with a range of existing methods.

3.1. Datasets

As shown in Figure 3, the two datasets are described in detail as follows:
(1)
Xiongan dataset: The Xiongan hyperspectral image (HSI) dataset serves as another benchmark for evaluating fine-grained vegetation classification performance. The dataset was acquired in 2017 in the Xiongan New Area of China using the AMMIS VNIR block and has 256 spectral bands. The original image contains 3750 × 1580 pixels, with a spatial resolution of 0.5 m. A 1492 × 1580 pixel area in the central region was selected as the study area, containing 16 categories, including negative samples. This area was chosen due to its diverse crop types and pronounced intra-class variability, mainly caused by differences in vegetation growth stages and shadows cast by street trees, which present challenges for accurate HSI classification [49].
(2)
HSI-CROP dataset: The study area is located in Shenzhou City, Hebei Province, China, and consists of two sub-regions: the Majiakou Village site (MJK) and the Xijingmeng Village site (XJM). Hyperspectral data were acquired using a UAV on 18 September 2019. The UAV was equipped with a Pika L hyperspectral imager (Resonon Inc.), covering a spectral range of 385–1024 nm with 200 spectral bands. The flight altitude was 100 m, and the spatial resolution was 0.1 m. A total of 30 categories, including negative samples, were identified. The hyperspectral data were preprocessed using Spectronon and ENVI software, including radiometric calibration, geometric correction, image stitching, and atmospheric correction. Additionally, the image size of Study Area A is 2332 × 959 pixels, while Study Area B measures 864 pixels in width and 1618 pixels in height [39]. This dataset was due to its greater diversity compared to the Xiongan dataset, as it contains 30 classes, including negative samples. Furthermore, the images are characterized by a high prevalence of fine-grained targets and mixed-pixel challenges.

3.2. Experimental Setup

(1)
Evaluation metrics: The performance of the proposed A2Former model was evaluated using four standard metrics: classification accuracy (CA), overall accuracy (OA), mean intersection over union (mIoU), and the Kappa coefficient. CA is defined as the proportion of correctly classified samples within each category. OA denotes the proportion of correctly classified samples out of the total number of samples. The mIoU metric, crucial for semantic segmentation tasks, quantifies the average overlap between the predicted regions and the ground truth annotations. Consequently, it provides a holistic assessment of the model’s segmentation performance across all classes. The Kappa coefficient is a robust accuracy metric derived from the confusion matrix. It provides a more reliable evaluation than OA, particularly in scenarios with class imbalance, because it accounts for the possibility of correct classification occurring by chance.
(2)
Sampling Strategy: To address the information leakage problem discussed in the Introduction. Based on the four fundamental principles of effective sampling strategy design proposed in [40], we designed a checkerboard-style leak-free balanced sampling strategy, as shown in Figure 4. The process unfolds in several stages. Initially, the hyperspectral image (HSI) and its corresponding ground truth map are partitioned into a grid of non-overlapping S × S blocks. To systematically eliminate information leakage from spatial adjacency, a periodic grouping mechanism is then introduced. Specifically, all blocks are assigned to one of five spatially disjoint groups based on their row index in a repeating five-row cycle, creating an interleaved, checkerboard-like distribution. Subsequently, these groups are randomly partitioned into training and test sets. This group-level allocation ensures complete spatial decoupling. Finally, a fine-tuning step addresses class imbalance: a minimal number of blocks are strategically transferred between subsets to correct distributional biases. This systematic approach not only prevents information leakage but also guarantees a balanced class distribution as much as possible, thereby laying a solid foundation for reliable model training and fair performance evaluation.
To mitigate overfitting, we employed a data augmentation strategy encompassing both spatial transformations and spectral perturbations. Specifically, the spatial augmentations included random rotations, as well as horizontal and vertical flips. For spectral and photometric augmentations, we introduced Gaussian noise and applied random adjustments to both brightness and contrast. Collectively, these operations simulate real-world variations in remote sensing imagery—such as those arising from differing sensor characteristics, illumination, and atmospheric conditions—thereby enhancing the model’s generalization and robustness.
In this experiment, the comparison section of the patch-based image classification method employed the sampling method mentioned in [31] and referenced the settings in [36] to extract 1000 samples from each feature category in the HSI-CROP and Xiongan datasets. The remaining labeled pixels were used as the validation set. Furthermore, for each sample, a 9 × 9 pixel patch was extracted, centered on the corresponding labeled pixel, to serve as the model input. This ensured that the comparison models could perform optimally and maintained the fairness of the comparison.
It should be noted that the adopted sampling strategy still has certain limitations. Specifically, due to the relatively large and fixed input sizes of the two datasets (e.g., 48 × 48 for HSI-CROP and 24 × 24 for Xiongan), and the fact that pixels of some rare classes are highly concentrated within individual input samples, severe imbalances between the training and testing splits may persist even after applying the checkerboard sampling strategy. As a result, certain rare classes, such as Classes 7 and 29 in the HSI-CROP dataset, contain no samples in the test set. This inevitably leads to zero classification accuracy for these classes in subsequent experimental evaluations.
(3)
Implementation Details: In the experiment, the dataset was constructed based on the sampling strategy described in (2), with a training-to-test set ratio of 4:1, the results are shown in Table 1 and Table 2. To ensure that the experimental results do not depend on specific initialization or data partitioning, we reported the average performance and standard deviation of all experiments to verify the robustness and stability of the model. All experiments were conducted on a computer equipped with an Intel(R) Xeon(R) Gold 5218 2.30 GHz CPU, 256 GB of memory, and two NVIDIA GeForce A100 GPUs, and implemented using the PyTorch 1.7.1 deep-learning framework.
(4)
Parameter settings: To achieve rapid convergence, we deployed the AdamW optimizer to train all models in the experiment. The learning rate is adjusted using a cosine learning strategy. Additionally, we set the relevant optimal parameters based on the experiment: the number of training epochs is set to 500, the learning rate for the Xiongan dataset is set to 0.0001, while the HSI-CROP dataset is set to 0.001, and the batch size is uniformly set to 64.

3.3. Ablation Study

In this section, the symbol “✔” indicates the use of the component in the experiment, whereas “-” indicates its absence. In addition, results in bold indicate the best performance.
(1)
Ablation experiment of the encoder: By comparing the impact of the three encoder structures: ResNet-50 [50], ConvNextV2 [51], and the aforementioned encoder on classification performance, the effectiveness of our encoder was further validated, with the remaining network structures remaining consistent. ResNet-50 was selected as it constitutes the backbone of our baseline model. ConvNeXtV2 was included as a representative state-of-the-art (SOTA) architecture, which is recognized for its high performance, albeit with greater model complexity. As detailed in Table 3, Experiment A serves as the baseline using ResNet-50 as the encoder. Experiment B adopts the proposed SSWB encoder, while Experiment C replaces it with ConvNeXtV2-Base. Compared with the proposed encoder, ConvNeXtV2-Base yields an OA improvement of 0.61% on HSI-CROP and 0.83% on Xiongan. This gain, however, was accompanied by a substantial increase in model complexity and the number of parameters. Additionally, compared to ResNet-50, our encoder achieves higher mIoU performance, particularly on the HSI-CROP and Xiongan datasets, where mIoU improves by 0.99% and 0.76%, respectively. These findings suggest that for large-format HSI semantic segmentation, a lightweight yet powerful encoder, such as the one proposed, offers a compelling trade-off between computational efficiency and performance.
(2)
Ablation experiments on the C-VIT block: Similar to the ablation analysis of the encoder block, this paper compares the impact of the three VITs on classification performance to validate the performance and efficiency of the final C-VIT block. VIT-B was selected as it represents the baseline configuration, whereas RTB was included as a contemporary, lightweight hybrid architecture that integrates convolutional principles. The OA results for each of the three configurations are presented in Table 4. Experiment A represents the baseline, which employs the original ViT-B as the low-level feature enhancement module. Experiment B replaces ViT-B with the RTB proposed in the literature, while Experiment C further substitutes RTB with the proposed C-ViT module.
Specifically, compared to the VIT-B and RTB blocks, the proposed C-VIT block performs better, demonstrating stronger spatial structure modeling capabilities. Moreover, the channel shuffling and reshuffling mechanisms effectively capture and represent the intrinsic, high-dimensional spectral features, addressing the limitations of depthwise separable convolutions in modeling inter-channel correlations. These design choices enable C-VIT to efficiently capture complex spectral–spatial joint features, leading to improved classification performance. In terms of computational efficiency, the C-VIT block replaces certain linear operations with convolutions, removes positional encoding, and significantly reduces parameter count, resulting in a simpler and more robust structure. Overall, C-VIT strikes a balance between lightweight design and expressive capacity, substantially reducing computational overhead while enhancing accuracy, making it an efficient solution for hyperspectral image semantic segmentation.
(3)
Other ablation experiments: By combining different components across two datasets and conducting ablation experiments, we conducted a comprehensive analysis of the contributions of the four key blocks in the A2Former model. Table 5 shows the changes in model performance (evaluated by OA) across the five possible combinations of these four blocks. Specifically, Experiment A represents the baseline model without any enhanced blocks, exhibiting the lowest classification performance among all experiments. Results from Experiment B indicate that the proposed encoder effectively extracts discriminative features, thereby improving classification accuracy. In Experiment C, classification accuracy decreases slightly due to the lack of a suitable decoder to effectively utilize semantically rich high-dimensional features, leading to noticeable feature redundancy. Nevertheless, it remains higher than the baseline. Experiment D demonstrates that introducing the proposed decoder significantly enhances model performance, indicating its superior ability to utilize multi-scale features compared to the baseline, thereby contributing positively to hyperspectral image classification. The accuracy improvement is even more pronounced in Experiment E, where the auxiliary segmentation head effectively guides the reconstruction of deep high-dimensional features, enabling better feature utilization and achieving optimal performance.
In summary, the experimental results fully validate the effectiveness of each block and demonstrate that their combination brings significant improvements in overall classification performance.

3.4. Comparison with Other Methods

To validate the effectiveness of the proposed A2Former model, this paper selected five representative algorithms as comparison methods, covering CNN–Transformer-based models (TransUnet [52], HSI-TransUnet [39]), hyperspectral classification-based models (SSTN [31], PASSNet [32]) and Transformer-based models (VIT [53]).
Among the CNN–Transformer hybrid models, TransUnet combines the global modeling capabilities of Transformers with the fine-grained localization advantages of U-Net, achieving a balance between global perception and local detail in medical image segmentation. We introduce it into the hyperspectral image classification task for comparison. HSI-TransUnet designs a spectral feature attention block to aggregate spectral features in the encoder and employs a series of Transformer layers with residual connections to learn global contextual features, enabling precise segmentation of hyperspectral images. These two models, which belong to the same category of semantic segmentation-based methods as A2Former, are selected to evaluate the superior performance of our model. As a pure Transformer model, VIT represents a pioneering effort in applying Transformers to image recognition tasks. In patch-based models, SSTN is a novel spectral–spatial Transformer network composed of a spatial attention block and a spectral correlation block to overcome the limitations of convolutional kernels and achieve stronger spectral–spatial feature modeling. PASSNet similarly combines the local modeling capabilities of CNNs with the global modeling advantages of Transformers, proposing the PAM block and lightweight PConv block to effectively enhance high-spectral image classification performance. These two models, which fuse CNN and Transformer architectures and are based on different principles, are selected to evaluate the computational efficiency and classification accuracy of this model under conditions of no information leakage.
To ensure the fairness of the comparative experiments, all models strictly followed the network architecture described in their respective original papers to optimize their performance. The specific quantitative and qualitative results are as follows.
(1)
Results for the Xiongan dataset: For the Xiongan hyperspectral dataset, the quantitative evaluation results of the A2Former framework and other comparative algorithms are shown in Table 6, with the highest accuracy in bold and the second-highest underlined. The experimental results show that the proposed A2Former framework delivers superior performance, achieving an OA of 90.65%, a Kappa coefficient of 0.954, and an mIoU of 0.739. Specifically, compared to the top-performing patch-based method, PASSNet, A2Former improves OA by 2.44%, mIoU by 3.45%, and Kappa by 3.06%. Compared to other patch-free models, the A2Former framework also exhibits substantial performance gains. Compared to HSI-TransUnet, A2Former improves OA by 3.74%, mIoU by 10.97%, and Kappa by 5.07%. Overall, the proposed A2Former framework excels in fine-grained object classification tasks, particularly showing a distinct advantage in crop classification.
Figure 5 shows the overall and local classification results generated by different methods in several typical areas of the Xiongan dataset, facilitating an intuitive comparison of the model’s performance on different types of land features. As shown in Figure 5, the A2Former framework demonstrates significantly superior visual performance compared to other methods. Unlike image classification-based models such as PASSNet and SSTN, A2Former effectively reduces salt-and-pepper noise, better preserves the integrity of feature internal structures, and is less susceptible to interference from negative samples. It accurately delineates boundaries and maintains an accuracy rate above 85% across all 12 categories, particularly excelling in the rose and white wax categories.
From the local magnification results (Figure 6), in the first row, A2Former can accurately identify more complex local areas, with the most precise recognition of Maize, Pear trees, Sophora japonica, and grasslands; in the second and third rows, all models accurately identify positive samples but some models (such as SSTN and PASSNet) fail to reduce salt-and-pepper noise, resulting in poor visualization effects, while A2Former produces the least noise; in the fourth row, among all models exhibiting severe boundary fusion phenomena, A2Former performs the most precise boundary delineation, with strong spatial consistency in classification results.
(2)
Results for the HSI-CROP dataset: Although A2Former demonstrated excellent performance on the Xiongan dataset, given that the Xiongan dataset features relatively regular landforms and a limited number of categories, we selected the HSI-CROP dataset to validate the model’s generalization ability further. thereby, This dataset includes 30 categories (including negative samples) and features more complex spatial distributions of landforms, with numerous small objects, further increasing the classification difficulty.
Figure 7 and Figure 8 shows the visualization classification maps of each model on the HSI-CROP dataset. As observed in the figure, patch-based methods exhibit noticeable salt-and-pepper noise in the classification maps, particularly on this high-resolution dataset, due to their pixel-wise prediction approach. In contrast, semantic segmentation-based methods (especially the proposed A2Former) generate smoother classification maps with more consistent and aesthetically pleasing visual effects.
Similarly, from the local magnification results (Figure 9), in the first and second rows, A2Former demonstrates superior classification accuracy in regions with highly similar spectra and textures, accurately identifying dominant crops such as Millet, Chinese cabbage, cotton, corn, and beans. In the third row, for strip-shaped small target crop categories such as carrot and sesame, A2Former still achieves the highest accuracy with sound visualization effects. In the fourth, fifth, and sixth rows, A2Former produces almost no noise and performs precise boundary delineation, with strong spatial consistency in classification results.
Table 7 shows the classification results of each comparison method on the HSI-CROP hyperspectral image (HSI) dataset. Overall, the proposed A2Former framework performs the best, significantly outperforming other methods. Quantitative evaluation results show that A2Former achieves an OA of 87.63%, a Kappa coefficient of 85.28, and an average intersection-over-union (mIoU) of 42.36 on this dataset. Among them, PASSNet, as a typical patch-based method, also achieves a high classification accuracy, ranking second.
Additionally, due to the complex distribution of the HSI-CROP dataset, TransUnet, whose encoder structure relies solely on spatial contextual information, fails to fully utilize the rich spectral information in the data, resulting in poor classification accuracy. HSI-TransUnet utilizes a spectral information utilization block, similar to channel attention, which significantly improves classification accuracy for dominant categories. However, due to the designed loss function and data sampling strategy, it fails to effectively address the long-tail phenomenon, resulting in overall metrics that are slightly below those of TransUnet. Additionally, in patch-based methods, PASSNet and SSTN exhibit noticeable noise phenomena, attributed to their pixel-wise prediction approach.In the classification of categories such as Green bean and Spinach, the classification accuracy of most patch-free methods is generally far lower than that of patch-based methods. This difference is primarily attributed to the extreme scarcity of samples in these categories, which are represented by only a single training image. Additionally, the model tends to learn dominant category features during training, significantly limiting the performance of the A2Former semantic segmentation model in these categories.
In summary, the A2Former framework achieves optimal performance in both visualization quality and OA by effectively utilizing spectral space features while efficiently leveraging local–global context interactions to reconstruct features. This method effectively mitigates common issues such as salt-and-pepper noise and checkerboard effects, significantly improving the accuracy and visual consistency of classification results.

4. Discussion

4.1. Complexity and Inference Efficiency Analysis

Table 8 provides a comparative analysis of computational efficiency across various methods, evaluated through three key metrics: model parameter count, computational complexity (FLOPs), and inference time. Hyperspectral image classification methods for semantic segmentation tasks generally exhibit higher parameter counts and FLOPs compared to patch-based methods. This difference arises from their distinct approaches. Semantic segmentation methods capture both global context and local details of a large image in a single forward pass, producing precise pixel-level classifications while restoring the original resolution. In contrast, patch-based methods process smaller image patches and predict only the central pixel’s category.
Specifically, semantic segmentation methods capture both global contextual information and fine-grained local details from a larger input image in a single forward pass, producing accurate pixel-level classifications while restoring the original spatial resolution. In contrast, patch-based methods operate on smaller image patches and predict only the category of the central pixel. For example, patch-free models are able to process an entire image (e.g., 48 × 48 or larger) in a single inference step, whereas patch-based methods typically use much smaller patches (e.g., 9 × 9), generating predictions solely for the central pixel. As discussed in the introduction, this strategy inevitably leads to repeated computations for non-central pixels across overlapping patches, which substantially increases inference time. Consequently, despite optimizations for GPU parallel processing, although semantic segmentation methods incur significantly higher per-pass FLOPs due to their larger input size, the elimination of redundant computations enables a considerable reduction in overall inference time. For instance, on the HSI-CROP dataset, the proposed A2Former framework completes inference, including data loading, in just 16.3 s, whereas the fastest patch-based method, SSTN, requires 183.11 s.
In summary, while delivering classification accuracy comparable to or exceeding that of patch-based methods, the proposed patch-free model significantly enhances computational efficiency.

4.2. Quantitative Assessment via Confusion Matrix

Based on the analysis results of the confusion matrix for the Xiongan dataset in Figure 10a, it can be seen that the classification accuracy of soybean and sparse forest is significantly lower. Specifically, soybean is frequently misclassified as a negative sample, and pear tree, while sparse forest also exhibits significant confusion, primarily being misclassified as pear tree. The primary cause of these issues lies in the fact that these categories have extremely scarce samples across the entire dataset, and in real-world non-ideal conditions, the spatial distribution of various sample categories is often not entirely random, making it difficult for existing sampling strategies to achieve complete balance between categories. For example, soybeans account for only 1% of the samples in the test set, which greatly increases the risk of misclassification.
For sparse forests, due to the high similarity of their spectral curves with pear trees, coupled with the fact that they account for only 11% of the samples in the test set, which is below the predefined 20% threshold, the model ultimately exhibits severe misclassification, thereby lowering the classification accuracy for this category.
Further analysis of the confusion matrix for the HSI-CROP dataset (Figure 10b) reveals that the classification accuracy for Green bean, Spinach, Bok choy, Sorghum, Mulched field, and Okra is zero. Based on the category distribution and classification accuracy statistics, Except for Spinach and Mulched field, the remaining categories also suffered from severe data imbalance, which was the primary factor contributing to their poor classification performance. As for the excluded two categories, their misclassification can be attributed to other causes. Taking Spinach as an example, it was frequently misclassified as the dominant category Bare soil & Weed. This is largely due to the fact that the number of pixels for Bare soil & Weed in the training set was nearly 600 times that of Spinach, which significantly biased the model’s prediction tendency toward the dominant class.
Furthermore, categories such as Daikon, Eggplant, Sichuan peppercorn, Cauliflower, and Pumpkin also exhibited low classification accuracy, primarily due to a severe imbalance in the number of training samples. This further highlights the critical role of sampling strategies in enhancing classification performance. The issue is particularly pronounced in large-format models that adopt a patch-free input scheme for entire images. In such cases, achieving a relatively balanced class distribution while preventing information leakage has become an urgent research focus in the field.

4.3. Uncertainties and Limitations

Although the proposed method achieves state-of-the-art performance in terms of both classification accuracy and computational efficiency, several limitations remain. First, from the perspective of data sources, this study relies solely on single-temporal hyperspectral imagery. However, multi-temporal observations can provide valuable phenological information of different crops, which is beneficial for enhancing inter-class separability. Therefore, as hyperspectral imagery becomes increasingly available, future work could incorporate multi-temporal hyperspectral data to further improve crop mapping accuracy.
Second, from a methodological perspective, the proposed model adopts a patch-free semantic segmentation paradigm. While this design improves computational efficiency compared with patch-based approaches, it inevitably introduces a more complex encoder–decoder architecture. Despite efforts to employ lightweight module designs, this complexity leads to an increase in model parameters and per-inference FLOPs, particularly in the Transformer-based decoder. Future research may explore more lightweight encoder designs to further reduce model complexity.
Finally, from the training perspective, the proposed chessboard sampling strategy effectively prevents information leakage and improves the balance between training and test sets. Nevertheless, due to the relatively fixed input size, severe imbalance between training and test samples still exists for certain rare classes. Moreover, the fixed loss function assigns uniform importance to all classes during training, which may limit the model’s ability to adequately learn rare categories. Future work will investigate the trade-off between variable input sizes and sampling strategies to better balance class distributions, as well as the adoption of loss functions or data augmentation techniques specifically designed for rare classes.

5. Conclusions

This paper proposes A2Former, a fully attention-based semantic segmentation framework tailored for hyperspectral image classification, aiming to balance classification accuracy and computational efficiency. By reformulating crop classification as a patch-free semantic segmentation task and adopting a chessboard sampling strategy, the proposed method effectively avoids redundant computation and information leakage inherent in patch-based approaches. Extensive experiments on the HSI-CROP and Xiongan datasets demonstrate that A2Former consistently outperforms existing hyperspectral classification methods in both accuracy and inference efficiency. Our model achieves stronger spatial consistency with OA gains of 2.44% and 2.63%. Furthermore, A2Former demonstrates superior computational efficiency by achieving the fastest inference speeds on both datasets (25.21 s and 16.3 s), significantly outperforming other Transformer-based and CNN models. The superior performance can be attributed to the joint design of an overlap-downsampling encoder with spectral–spatial attention, a lightweight C-ViT block that significantly reduces model parameters while maintaining strong representation capability, and an interactive attention decoder with gated fusion for effective multi-scale feature aggregation. In addition, the fusion segmentation head and auxiliary loss function help preserve fine-grained details such as object boundaries and small-category regions. Although encouraging results have been achieved, future work will continue to explore the potential and feasibility of the proposed framework in broader geospatial vision tasks.

Author Contributions

Conceptualization, A.K.; Methodology, A.K.; Software, A.K.; Validation, A.K.; Formal analysis, A.K.; Investigation, G.L.; Resources, H.L.; Data curation, J.L.; Writing—original draft, A.K.; Writing—review & editing, H.L.; Visualization, A.K.; Supervision, Z.Y. All authors have read and agreed to the published version of the manuscript.

Funding

This study was supported in part by the Natural Science Foundation of Hubei Province (Grant No. 2024AFA032) and by the National Natural Science Foundation of China (Grant No. 42171415).

Data Availability Statement

Data available in a publicly accessible repository. HSI-CROP Dataset, Name: ScienceDB (URL: https://www.scidb.cn/detail?dataSetId=6de15e4ec9b74dacab12e29cb557f041, accessed on 28 November 2025); Xiongan Dataset, Name: Paddle AI Studio (URL: https://aistudio.baidu.com/datasetdetail/100218, accessed on 28 November 2025).

Acknowledgments

The authors are grateful to the creators of the HSI-CROP dataset and the Xiongan dataset for their generosity in providing publicly available hyperspectral remotesensing data.

Conflicts of Interest

The authors declare no conflicts of interest.

References

  1. Guerri, M.F.; Distante, C.; Spagnolo, P.; Bougourzi, F.; Taleb-Ahmed, A. Deep learning techniques for hyperspectral image analysis in agriculture: A review. ISPRS Open J. Photogramm. Remote Sens. 2024, 12, 100062. [Google Scholar] [CrossRef] [Scilit]
  2. Wang, S.; Azzari, G.; Lobell, D.B. Crop type mapping without field-level labels: Random forest transfer and unsupervised clustering techniques. Remote Sens. Environ. 2019, 222, 303–317. [Google Scholar] [CrossRef] [Scilit]
  3. Liu, J.; Liu, M.; Tian, H.; Zhuang, D.; Zhang, Z.; Zhang, W.; Tang, X.; Deng, X. Spatial and temporal patterns of China’s cropland during 1990–2000: An analysis based on Landsat TM data. Remote Sens. Environ. 2005, 98, 442–456. [Google Scholar] [CrossRef] [Scilit]
  4. Ozdogan, M. The spatial distribution of crop types from MODIS data: Temporal unmixing using Independent Component Analysis. Remote Sens. Environ. 2010, 114, 1190–1204. [Google Scholar] [CrossRef] [Scilit]
  5. Zhang, H.; Feng, S.; Wu, D.; Zhao, C.; Liu, X.; Zhou, Y.; Wang, S.; Deng, H.; Zheng, S. Hyperspectral image classification on large-scale agricultural crops: The heilongjiang benchmark dataset, validation procedure, and baseline results. Remote Sens. 2024, 16, 478. [Google Scholar] [CrossRef] [Scilit]
  6. Feng, Q.; Yang, J.; Liu, Y.; Ou, C.; Zhu, D.; Niu, B.; Liu, J.; Li, B. Multi-temporal unmanned aerial vehicle remote sensing for vegetable mapping using an attention-based recurrent convolutional neural network. Remote Sens. 2020, 12, 1668. [Google Scholar] [CrossRef] [Scilit]
  7. 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]
  8. Sun, W.; Zhang, L.; Du, B.; Li, W.; Lai, Y.M. Band selection using improved sparse subspace clustering for hyperspectral imagery classification. IEEE J. Sel. Top. Appl. Earth Obs. Remote Sens. 2015, 8, 2784–2797. [Google Scholar] [CrossRef] [Scilit]
  9. Bioucas-Dias, J.M.; Plaza, A.; Camps-Valls, G.; Scheunders, P.; Nasrabadi, N.; Chanussot, J. Hyperspectral remote sensing data analysis and future challenges. IEEE Geosci. Remote Sens. Mag. 2013, 1, 6–36. [Google Scholar] [CrossRef] [Scilit]
  10. Willett, R.M.; Duarte, M.F.; Davenport, M.A.; Baraniuk, R.G. Sparsity and structure in hyperspectral imaging: Sensing, reconstruction, and target detection. IEEE Signal Process. Mag. 2013, 31, 116–126. [Google Scholar] [CrossRef] [Scilit]
  11. Ghamisi, P.; Benediktsson, J.A.; Sveinsson, J.R. Automatic spectral–spatial classification framework based on attribute profiles and supervised feature extraction. IEEE Trans. Geosci. Remote Sens. 2013, 52, 5771–5782. [Google Scholar] [CrossRef] [Scilit]
  12. Cariou, C.; Chehdi, K. A new k-nearest neighbor density-based clustering method and its application to hyperspectral images. In Proceedings of the 2016 IEEE International Geoscience and Remote Sensing Symposium (IGARSS), Beijing, China, 10–15 July 2016; IEEE: New York, NY, USA, 2016; pp. 6161–6164. [Google Scholar]
  13. Sahin, Y.E.; Arisoy, S.; Kayabol, K. Anomaly detection with Bayesian Gauss background model in hyperspectral images. In Proceedings of the 2018 26th Signal Processing and Communications Applications Conference (SIU), Izmir, Turkey, 2–5 May 2018; IEEE: New York, NY, USA, 2018; pp. 1–4. [Google Scholar]
  14. Haut, J.; Paoletti, M.; Paz-Gallardo, A.; Plaza, J.; Plaza, A.; Vigo-Aguiar, J. Cloud implementation of logistic regression for hyperspectral image classification. In Proceedings of the 17th International Conference on Computational and Mathematical Methods in Science and Engineering (CMMSE), Cádiz, Spain, 4–8 July 2017; Volume 3, pp. 1063–2321. [Google Scholar]
  15. Li, J.; Bioucas-Dias, J.M.; Plaza, A. Spectral–spatial hyperspectral image segmentation using subspace multinomial logistic regression and Markov random fields. IEEE Trans. Geosci. Remote Sens. 2011, 50, 809–823. [Google Scholar] [CrossRef] [Scilit]
  16. Chen, Y.N.; Thaipisutikul, T.; Han, C.C.; Liu, T.J.; Fan, K.C. Feature line embedding based on support vector machine for hyperspectral image classification. Remote Sens. 2021, 13, 130. [Google Scholar] [CrossRef] [Scilit]
  17. Melgani, F.; Bruzzone, L. Classification of hyperspectral remote sensing images with support vector machines. IEEE Trans. Geosci. Remote Sens. 2004, 42, 1778–1790. [Google Scholar] [CrossRef] [Scilit]
  18. Ye, Q.; Huang, P.; Zhang, Z.; Zheng, Y.; Fu, L.; Yang, W. Multiview learning with robust double-sided twin SVM. IEEE Trans. Cybern. 2021, 52, 12745–12758. [Google Scholar] [CrossRef] [Scilit]
  19. Ye, Q.; Zhao, H.; Li, Z.; Yang, X.; Gao, S.; Yin, T.; Ye, N. L1-norm distance minimization-based fast robust twin support vector k-plane clustering. IEEE Trans. Neural Netw. Learn. Syst. 2017, 29, 4494–4503. [Google Scholar] [CrossRef] [Scilit]
  20. Zhao, J.; Zhong, Y.; Hu, X.; Wei, L.; Zhang, L. A robust spectral-spatial approach to identifying heterogeneous crops using remote sensing imagery with high spectral and spatial resolutions. Remote Sens. Environ. 2020, 239, 111605. [Google Scholar] [CrossRef] [Scilit]
  21. Yang, L.; Zhang, R.; Bao, Y.; Yang, S.; Jiao, L. Kernel tensor sparse coding model for precise crop classification of UAV hyperspectral image. IEEE Geosci. Remote Sens. Lett. 2023, 20, 5511405. [Google Scholar] [CrossRef] [Scilit]
  22. Han, X.; Zhong, Y.; Zhang, L. Spatial-spectral unsupervised convolutional sparse auto-encoder classifier for hyperspectral imagery. Photogramm. Eng. Remote Sens. 2017, 83, 195–206. [Google Scholar] [CrossRef] [Scilit]
  23. Zhang, X.; Su, Y.; Gao, L.; Bruzzone, L.; Gu, X.; Tian, Q. A lightweight transformer network for hyperspectral image classification. IEEE Trans. Geosci. Remote Sens. 2023, 61, 5517617. [Google Scholar] [CrossRef] [Scilit]
  24. 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]
  25. He, L.; Li, J.; Liu, C.; Li, S. Recent advances on spectral–spatial hyperspectral image classification: An overview and new guidelines. IEEE Trans. Geosci. Remote Sens. 2017, 56, 1579–1597. [Google Scholar] [CrossRef] [Scilit]
  26. Zhong, Z.; Li, J.; Luo, Z.; Chapman, M. Spectral–spatial residual network for hyperspectral image classification: A 3-D deep learning framework. IEEE Trans. Geosci. Remote Sens. 2017, 56, 847–858. [Google Scholar] [CrossRef] [Scilit]
  27. Li, N.; Wang, Z.; Cheikh, F.A.; Ullah, M. S3AM: A spectral-similarity-based spatial attention module for hyperspectral image classification. IEEE J. Sel. Top. Appl. Earth Obs. Remote Sens. 2022, 15, 5984–5998. [Google Scholar] [CrossRef] [Scilit]
  28. Li, Z.; Cui, X.; Wang, L.; Zhang, H.; Zhu, X.; Zhang, Y. Spectral and spatial global context attention for hyperspectral image classification. Remote Sens. 2021, 13, 771. [Google Scholar] [CrossRef] [Scilit]
  29. Bahdanau, D. Neural machine translation by jointly learning to align and translate. arXiv 2014, arXiv:1409.0473. [Google Scholar]
  30. 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]
  31. Zhong, Z.; Li, Y.; Ma, L.; Li, J.; Zheng, W.S. Spectral–spatial transformer network for hyperspectral image classification: A factorized architecture search framework. IEEE Trans. Geosci. Remote Sens. 2021, 60, 5514715. [Google Scholar] [CrossRef] [Scilit]
  32. Ji, R.; Tan, K.; Wang, X.; Pan, C.; Xin, L. PASSNet: A spatial–spectral feature extraction network with patch attention module for hyperspectral image classification. IEEE Geosci. Remote Sens. Lett. 2023, 20, 5510405. [Google Scholar] [CrossRef] [Scilit]
  33. Decker, K.T.; Borghetti, B.J. A Survey of Sampling Methods for Hyperspectral Remote Sensing: Addressing Bias Induced by Random Sampling. Remote Sens. 2025, 17, 1373. [Google Scholar] [CrossRef] [Scilit]
  34. Feng, H.; Wang, Y.; Li, Z.; Zhang, N.; Zhang, Y.; Gao, Y. Information leakage in deep learning-based hyperspectral image classification: A survey. Remote Sens. 2023, 15, 3793. [Google Scholar] [CrossRef] [Scilit]
  35. Liang, J.; Zhou, J.; Qian, Y.; Wen, L.; Bai, X.; Gao, Y. On the sampling strategy for evaluation of spectral-spatial methods in hyperspectral image classification. IEEE Trans. Geosci. Remote Sens. 2016, 55, 862–880. [Google Scholar] [CrossRef] [Scilit]
  36. Ji, R.; Tan, K.; Wang, X.; Tang, S.; Sun, J.; Niu, C.; Pan, C. PatchOut: A novel patch-free approach based on a transformer-CNN hybrid framework for fine-grained land-cover classification on large-scale airborne hyperspectral images. Int. J. Appl. Earth Obs. Geoinf. 2025, 138, 104457. [Google Scholar] [CrossRef] [Scilit]
  37. Zhu, Q.; Deng, W.; Zheng, Z.; Zhong, Y.; Guan, Q.; Lin, W.; Zhang, L.; Li, D. A spectral-spatial-dependent global learning framework for insufficient and imbalanced hyperspectral image classification. IEEE Trans. Cybern. 2021, 52, 11709–11723. [Google Scholar] [CrossRef] [Scilit]
  38. Zheng, Z.; Zhong, Y.; Ma, A.; Zhang, L. FPGA: Fast patch-free global learning framework for fully end-to-end hyperspectral image classification. IEEE Trans. Geosci. Remote Sens. 2020, 58, 5612–5626. [Google Scholar] [CrossRef] [Scilit]
  39. Niu, B.; Feng, Q.; Chen, B.; Ou, C.; Liu, Y.; Yang, J. HSI-TransUNet: A transformer based semantic segmentation model for crop mapping from UAV hyperspectral imagery. Comput. Electron. Agric. 2022, 201, 107297. [Google Scholar] [CrossRef] [Scilit]
  40. Zhang, X.; Yan, J.; Tian, J.; Li, W.; Gu, X.; Tian, Q. Objective evaluation-based efficient learning framework for hyperspectral image classification. GIScience Remote Sens. 2023, 60, 2225273. [Google Scholar] [CrossRef] [Scilit]
  41. Xu, A.; Xue, Z.; Li, Z.; Cheng, S.; Su, H.; Xia, J. UM2Former: U-Shaped Multi-Mixed TransFormer Network for Large-Scale Hyperspectral Image Semantic Segmentation. IEEE Trans. Geosci. Remote Sens. 2025, 63, 5506221. [Google Scholar] [CrossRef] [Scilit]
  42. Hu, J.; Shen, L.; Sun, G. Squeeze-and-excitation networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), Salt Lake City, UT, USA, 18–22 June 2018; pp. 7132–7141. [Google Scholar]
  43. Zhang, X.; Zhou, X.; Lin, M.; Sun, J. Shufflenet: An extremely efficient convolutional neural network for mobile devices. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), Salt Lake City, UT, USA, 18–22 June 2018; pp. 6848–6856. [Google Scholar]
  44. Woo, S.; Park, J.; Lee, J.Y.; Kweon, I.S. CBAM: Convolutional block attention module. In Proceedings of the European Conference on Computer Vision (ECCV), Munich, Germany, 8–14 September 2018; pp. 3–19. [Google Scholar]
  45. Rahman, M.M.; Munir, M.; Marculescu, R. Emcad: Efficient multi-scale convolutional attention decoding for medical image segmentation. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), Seattle, WA, USA, 16–22 June 2024; pp. 11769–11779. [Google Scholar]
  46. Liu, Z.; Lin, Y.; Cao, Y.; Hu, H.; Wei, Y.; Zhang, Z.; Lin, S.; Guo, B. Swin transformer: Hierarchical vision transformer using shifted windows. In Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV), Montreal, QC, Canada, 11–17 October 2021; pp. 10012–10022. [Google Scholar]
  47. Wang, L.; Li, R.; Zhang, C.; Fang, S.; Duan, C.; Meng, X.; Atkinson, P.M. UNetFormer: A UNet-like transformer for efficient semantic segmentation of remote sensing urban scene imagery. ISPRS J. Photogramm. Remote Sens. 2022, 190, 196–214. [Google Scholar] [CrossRef] [Scilit]
  48. Yu, C.; Gao, C.; Wang, J.; Yu, G.; Shen, C.; Sang, N. Bisenet v2: Bilateral network with guided aggregation for real-time semantic segmentation. Int. J. Comput. Vis. 2021, 129, 3051–3068. [Google Scholar] [CrossRef] [Scilit]
  49. Jia, J.; Chen, J.; Zheng, X.; Wang, Y.; Guo, S.; Sun, H.; Jiang, C.; Karjalainen, M.; Karila, K.; Duan, Z. Tradeoffs in the spatial and spectral resolution of airborne hyperspectral imaging systems: A crop identification case study. IEEE Trans. Geosci. Remote Sens. 2021, 60, 5510918. [Google Scholar] [CrossRef] [Scilit]
  50. He, K.; Zhang, X.; Ren, S.; Sun, J. Deep residual learning for image recognition. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), Las Vegas, NV, USA, 27–30 June 2016; pp. 770–778. [Google Scholar]
  51. Woo, S.; Debnath, S.; Hu, R.; Chen, X.; Liu, Z.; Kweon, I.S.; Xie, S. ConvNeXt v2: Co-designing and scaling convnets with masked autoencoders. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), Vancouver, BC, Canada, 17–24 June 2023; pp. 16133–16142. [Google Scholar]
  52. Chen, J.; Lu, Y.; Yu, Q.; Luo, X.; Adeli, E.; Wang, Y.; Lu, L.; Yuille, A.L.; Zhou, Y. TransUNet: Transformers make strong encoders for medical image segmentation. arXiv 2021, arXiv:2102.04306. [Google Scholar] [CrossRef] [Scilit]
  53. 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 2020, arXiv:2010.11929. [Google Scholar]
Figure 1. Graphical illustration of the proposed A2Former.
Figure 1. Graphical illustration of the proposed A2Former.
Remotesensing 18 00220 g001aRemotesensing 18 00220 g001b
Figure 2. Graphical illustration of the proposed decoder. (a) Local branch; (b) Global branch; (c) Fusion mechanism of global and local branch; (d) Axial attention context interaction block; (e) Detailed explanation of gate-weighted fusion block; (I) Interactive attention Transformer block; (II) Gate-weighted fusion block.
Figure 2. Graphical illustration of the proposed decoder. (a) Local branch; (b) Global branch; (c) Fusion mechanism of global and local branch; (d) Axial attention context interaction block; (e) Detailed explanation of gate-weighted fusion block; (I) Interactive attention Transformer block; (II) Gate-weighted fusion block.
Remotesensing 18 00220 g002
Figure 3. True color images and ground-truth labels of the two datasets. (a) HSI-CROP (MJK) (b) HSI-CROP (XJM) (c) Xiongan.
Figure 3. True color images and ground-truth labels of the two datasets. (a) HSI-CROP (MJK) (b) HSI-CROP (XJM) (c) Xiongan.
Remotesensing 18 00220 g003
Figure 4. Graphical illustration of the proposed checkerboard-style sampling strategy.
Figure 4. Graphical illustration of the proposed checkerboard-style sampling strategy.
Remotesensing 18 00220 g004
Figure 5. Classification maps obtained by the different methods on the Xiongan dataset. (a) True-color images. (b) Labels. (c) TransUnet. (d) HSI-TransUnet. (e) VIT. (f) SSTN. (g) PASSNet. (h) A2Former.
Figure 5. Classification maps obtained by the different methods on the Xiongan dataset. (a) True-color images. (b) Labels. (c) TransUnet. (d) HSI-TransUnet. (e) VIT. (f) SSTN. (g) PASSNet. (h) A2Former.
Remotesensing 18 00220 g005
Figure 6. Local classification maps obtained by the different methods on the Xiongan dataset. (a) True-color images. (b) Labels. (c) TransUnet. (d) HSI-TransUnet. (e) VIT. (f) SSTN. (g) PASSNet. (h) A2Former.
Figure 6. Local classification maps obtained by the different methods on the Xiongan dataset. (a) True-color images. (b) Labels. (c) TransUnet. (d) HSI-TransUnet. (e) VIT. (f) SSTN. (g) PASSNet. (h) A2Former.
Remotesensing 18 00220 g006
Figure 7. Classification maps obtained by the different methods on the HSI-CROP dataset(MJK). (a) True-color images. (b) Labels. (c) TransUnet. (d) HSI-TransUnet. (e) VIT. (f) SSTN. (g) PASSNet. (h) A2Former.
Figure 7. Classification maps obtained by the different methods on the HSI-CROP dataset(MJK). (a) True-color images. (b) Labels. (c) TransUnet. (d) HSI-TransUnet. (e) VIT. (f) SSTN. (g) PASSNet. (h) A2Former.
Remotesensing 18 00220 g007
Figure 8. Classification maps obtained by the different methods on the HSI-CROP dataset (XJM). (a) True-color images. (b) Labels. (c) TransUnet. (d) HSI-TransUnet. (e) VIT. (f) SSTN. (g) PASSNet. (h) A2Former.
Figure 8. Classification maps obtained by the different methods on the HSI-CROP dataset (XJM). (a) True-color images. (b) Labels. (c) TransUnet. (d) HSI-TransUnet. (e) VIT. (f) SSTN. (g) PASSNet. (h) A2Former.
Remotesensing 18 00220 g008
Figure 9. Local classification maps obtained by the different methods on the HSI-CROP dataset. (a) True-color images. (b) Labels. (c) TransUnet. (d) HSI-TransUnet. (e) VIT. (f) SSTN. (g) PASSNet. (h) A2Former.
Figure 9. Local classification maps obtained by the different methods on the HSI-CROP dataset. (a) True-color images. (b) Labels. (c) TransUnet. (d) HSI-TransUnet. (e) VIT. (f) SSTN. (g) PASSNet. (h) A2Former.
Remotesensing 18 00220 g009
Figure 10. Confusion matrix on two datasets. (a) Xiongan. (b) HSI-CROP.
Figure 10. Confusion matrix on two datasets. (a) Xiongan. (b) HSI-CROP.
Remotesensing 18 00220 g010
Table 1. Train–Test Distribution of Samples for the HSI-CROP Dataset.
Table 1. Train–Test Distribution of Samples for the HSI-CROP Dataset.
ClassClass NameTrainTestTrain_RatioTest_Ratio
0NULL272,65895,24274.11%25.89%
1Bare soil & Weed1,013,240233,98281.24%18.76%
2Chinese cabbage560,354136,16380.45%19.55%
3Millet288,29767,98880.92%19.08%
4Leaf mustard28,190733979.34%20.66%
5Green bean34805598.44%1.56%
6Spinach46537955.09%44.91%
7Bok Choy6880100.00%0.00%
8Turnip62,03928,46168.55%31.45%
9Cotton22,995119895.05%4.95%
10Corn363,26773,96283.08%16.92%
11Carrot35,780816181.43%18.57%
12Sorghum457213397.17%2.83%
13Pumpkin883786091.13%8.87%
14Kohlrabi3885138573.72%26.28%
15Scallion60,03212,47882.79%17.21%
16Sweet potato114,83731,31778.57%21.43%
17Peanut11,370585965.99%34.01%
18Sesame5284307263.24%36.76%
19Beans182,53359,35875.46%24.54%
20Road23,703692777.38%22.62%
21Tobacco2970161064.85%35.15%
22Holly29,498475386.12%13.88%
23Cauliflower183618490.89%9.11%
24Eggplant883386091.13%8.87%
25Daikon10,645213783.28%16.72%
26Sichuan peppercorn385829292.96%7.04%
27Mulched field89979653.04%46.96%
28Tree65,69214,53781.88%18.12%
29Okra3030100.00%0.00%
Table 2. Train–Test Distribution of Samples for the Xiongan Dataset.
Table 2. Train–Test Distribution of Samples for the Xiongan Dataset.
ClassClass NameTrainTestTrain_RatioTest_Ratio
0Unclassified671,936161,07980.66%19.34%
1Maple leaf8360302773.42%26.58%
2Paddy116,46838,01475.39%24.61%
3Sophora japonica71,59215,28382.41%17.59%
4White wax58,73914,89879.77%20.23%
5Water area106,44624,83981.08%18.92%
6Rose4599101381.95%18.05%
7Maize31,161966276.33%23.67%
8Pear tree617,413153,42180.10%19.90%
9Soybean12871698.77%1.23%
10Poplar29,606780279.14%20.86%
11Vegetable field20,173378384.21%15.79%
12Sparse forest132617088.64%11.36%
13Grassland43,34210,62380.32%19.69%
14Peach tree21,073880170.54%29.46%
15Buildings24,703491383.41%16.59%
Table 3. Ablation Study Results on the Encoder.
Table 3. Ablation Study Results on the Encoder.
ComponentABC
Our CNN-based-encoder--
Resnet-50--
Convnextv2-Base--
HSI-CROP81.14%82.13%82.74%
Xiongan84.89%85.65%86.48%
params1.63 M4.62 M60.28 M
Table 4. Ablation Study Results on Different VIT Blocks.
Table 4. Ablation Study Results on Different VIT Blocks.
ComponentABC
RTB--
VIT-B--
C-VIT--
HSI-CROP82.27%80.88%81.38%
Xiongan85.65%83.75%84.95%
params85.06 M7.37 M3.31 M
Table 5. Ablation Study Results on other Component.
Table 5. Ablation Study Results on other Component.
ComponentABCDE
CNN-based-encoder-
C-VIT--
Trans-based-decoder + FH----
Trans-based-decoder + FH + AH---
HSI-CROP (%)81.1482.1381.3883.8785.28
Xiongan (%)84.8985.6584.9586.4987.54
Table 6. Classification Accuracies of the Different Methods on the Xiongan Dataset. The highest and second-highest accuracies are indicated in bold and underline.
Table 6. Classification Accuracies of the Different Methods on the Xiongan Dataset. The highest and second-highest accuracies are indicated in bold and underline.
CLASSTransUnetHSI-TransUnetVITSSTNPASSNetA2Former
085.41 ± 0.00485.22 ± 0.00484.87 ± 0.01375.74 ± 0.0378.41 ± 0.0488.21 ± 0.018
187.29 ± 0.01582.44 ± 0.01586.04 ± 0.01199.68 ± 0.04999.97 ± 0.04792.74 ± 0.029
295.98 ± 0.00795.41 ± 0.01796.23 ± 0.00599.46 ± 0.04699.4 ± 0.04797.71 ± 0.004
394.55 ± 0.01595.14 ± 0.0195.57 ± 0.01797.67 ± 0.03898.95 ± 0.03495.41 ± 0.013
497.74 ± 0.00698.08 ± 0.00596.11 ± 0.02197.45 ± 0.01697.69 ± 0.01598.76 ± 0.003
591.2 ± 0.00489.66 ± 0.0089.69 ± 0.00398.24 ± 0.02498.27 ± 0.0292.00 ± 0.006
687.34 ± 0.1178.97 ± 0.00492.99 ± 0.08296.92 ± 0.0197.72 ± 0.0198.08 ± 0.033
786.09 ± 0.02482.87 ± 0.04184.47 ± 0.06298.64 ± 0.0599.07 ± 0.04887.17 ± 0.049
890.74 ± 0.00289.53 ± 0.00791.49 ± 0.00285.31 ± 0.0689.79 ± 0.05692.1 ± 0.007
90.00 ± 0.000.00 ± 0.000.00 ± 0.0097.1 ± 0.04296.78 ± 0.0420.00 ± 0.00
1070.3 ± 0.05567.78 ± 0.03965.02 ± 0.01997.31 ± 0.01295.36 ± 0.01284.64 ± 0.045
1165.45 ± 0.06547.38 ± 0.02257.89 ± 0.08597.46 ± 0.06698.79 ± 0.06172.81 ± 0.069
1211.03 ± 0.19127.35 ± 0.0740.2 ± 0.00396.97 ± 0.04198.76 ± 0.04412.94 ± 0.144
1366.46 ± 0.03771.4 ± 0.01672.21 ± 0.02695.68 ± 0.02395.98 ± 0.02886.8 ± 0.025
1484.69 ± 0.0273.71 ± 0.02389.96 ± 0.03798.12 ± 0.01998.95 ± 0.01688.48 ± 0.038
1562.88 ± 0.03953.76 ± 0.01762.45 ± 0.03996.5 ± 0.02698.56 ± 0.02266.4 ± 0.052
MIOU63.86 ± 0.01162.96 ± 0.00563.89 ± 0.00564.36 ± 0.00770.48 ± 0.00473.93 ± 0.012
KAPPA83.95 ± 0.00482.47 ± 0.00183.98 ± 0.00581.23 ± 0.00384.48 ± 0.00387.54 ± 0.005
OA87.98 ± 0.00386.91 ± 0.00188 ± 0.00485.64 ± 0.00188.21 ± 0.00590.65 ± 0.004
Table 7. Classification Accuracies of the Different Methods on the HSI-CROP Dataset. The highest and second-highest accuracies are indicated in bold and underline.
Table 7. Classification Accuracies of the Different Methods on the HSI-CROP Dataset. The highest and second-highest accuracies are indicated in bold and underline.
CLASSTransUnetHSI-TransUnetVITSSTNPASSNetA2Former
095.07 ± 0.00895.52 ± 0.00196.06 ± 0.00298.68 ± 0.02999.2 ± 0.02496.14 ± 0.006
192.12 ± 0.00191.03 ± 0.01386.59 ± 0.01178.77 ± 0.08881.7 ± 0.04992.72 ± 0.004
286.56 ± 0.01388.94 ± 0.02281.87 ± 0.00778.46 ± 0.07484.12 ± 0.03991.42 ± 0.008
388.29 ± 0.02391.25 ± 084.45 ± 0.01693.65 ± 0.0593.11 ± 0.06990.17 ± 0.006
430.28 ± 0.06723.89 ± 0.1660 ± 076.6 ± 0.02579.73 ± 0.02346.04 ± 0.06
50 ± 00 ± 00 ± 095.63 ± 0.02398.3 ± 0.0210 ± 0
60 ± 00 ± 00 ± 095.25 ± 0.01698.57 ± 0.0340 ± 0
70 ± 00 ± 00 ± 093.86 ± 0.06397.37 ± 0.0320 ± 0
840.99 ± 0.06747.63 ± 0.07213.61 ± 0.07271.38 ± 0.05977.27 ± 0.02752.33 ± 0.067
921.9 ± 0.2597.65 ± 0.0090 ± 092.23 ± 0.06395.08 ± 0.05357.8 ± 0.348
1090.88 ± 0.02593.89 ± 0.00786.85 ± 0.01689.54 ± 0.01293.14 ± 0.01590.18 ± 0.015
1155.1 ± 0.08349.21 ± 0.0123.8 ± 0.06188.97 ± 0.08791.34 ± 0.05160.78 ± 0.042
120 ± 00 ± 00 ± 098.63 ± 0.0599.45 ± 0.030 ± 0
1313.88 ± 0.0336.98 ± 0.04920.74 ± 0.08888.47 ± 0.0390.73 ± 0.06615.61 ± 0.092
1426.43 ± 0.08311.74 ± 0.0680 ± 091.25 ± 0.02692.26 ± 0.02223.19 ± 0.068
1546.67 ± 0.00652.3 ± 0.01425.21 ± 0.04282.66 ± 0.02987.92 ± 0.0160.52 ± 0.062
1684.47 ± 0.02688.47 ± 0.04474.15 ± 0.05287.71 ± 0.03390.35 ± 0.07788.49 ± 0.022
1776.71 ± 0.01875.76 ± 077.28 ± 0.01390.64 ± 0.05693.28 ± 0.08482.56 ± 0.011
1870.33 ± 0.1214.01 ± 0.0990 ± 094.07 ± 0.04295.17 ± 0.07469.34 ± 0.089
1982.12 ± 0.00971.25 ± 0.04973.05 ± 0.02584.6 ± 0.03886.22 ± 0.03684.8 ± 0.05
2090.92 ± 0.02391.21 ± 0.00489.61 ± 0.0297.62 ± 0.04498.62 ± 0.04391.34 ± 0.008
2156.21 ± 0.09862.65 ± 0.44363.23 ± 0.23395.28 ± 0.02196.26 ± 0.04861.27 ± 0.177
2274.63 ± 0.04750.98 ± 0.22567.41 ± 0.08292.48 ± 0.03596.91 ± 0.03894.3 ± 0.055
230 ± 00 ± 00 ± 097.31 ± 0.03397.31 ± 0.04814.67 ± 0.164
2431.94 ± 0.13511.24 ± 0.0790.47 ± 0.00784.01 ± 0.04992.83 ± 0.05723.31 ± 0.015
2526.49 ± 0.0398.42 ± 0.066.01 ± 0.06383.26 ± 0.08286.21 ± 0.04924.26 ± 0.138
268.33 ± 0.1110 ± 00 ± 092.04 ± 0.02694.37 ± 0.0463.6 ± 0.048
272.26 ± 0.0320 ± 00 ± 097.69 ± 0.03699.28 ± 0.0180 ± 0
2862.35 ± 0.10643.49 ± 0.07345.66 ± 0.09586.07 ± 0.06491.05 ± 0.08669.59 ± 0.036
290 ± 00 ± 00 ± 097.35 ± 0.01577.48 ± 0.0670 ± 0
MIOU37.97 ± 0.0132.91 ± 0.02927.68 ± 0.01535.03 ± 0.00940.68 ± 0.05142.36 ± 0.009
KAPPA82.01 ± 0.00881.29 ± 0.00873.83 ± 0.0179.19 ± 0.00882.21 ± 0.06585.28 ± 0.008
OA84.89 ± 0.00684.3 ± 0.00678.13 ± 0.00882.76 ± 0.01785 ± 0.02887.63 ± 0.007
Table 8. Complexity of Different Methods on Two Datasets. The results in bold indicate the best performance.
Table 8. Complexity of Different Methods on Two Datasets. The results in bold indicate the best performance.
ComplexityTransUnetHSI-TransUnetVITSSTNPassnetA2Former
XionganParams (M)89.8393.2389.610.120.2411.38
FLOPS218.11 G231.87 G61.89 G0.98 M14.85 M47.49 G
Inference time (s)92.299.7543.95108.31142.3825.21
HSI-CROPParams (M)89.8495.689.150.140.2913.1
FLOPS271.68 G332.48 G262.72 G1.173 M17.59 M175.55 G
Inference time (s)41.5342.7822.25183.11240.7116.3
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

Kang, A.; Li, H.; Luo, G.; Li, J.; Yin, Z. A2Former: An Airborne Hyperspectral Crop Classification Framework Based on a Fully Attention-Based Mechanism. Remote Sens. 2026, 18, 220. https://doi.org/10.3390/rs18020220

AMA Style

Kang A, Li H, Luo G, Li J, Yin Z. A2Former: An Airborne Hyperspectral Crop Classification Framework Based on a Fully Attention-Based Mechanism. Remote Sensing. 2026; 18(2):220. https://doi.org/10.3390/rs18020220

Chicago/Turabian Style

Kang, Anqi, Hua Li, Guanghao Luo, Jingyu Li, and Zhangcai Yin. 2026. "A2Former: An Airborne Hyperspectral Crop Classification Framework Based on a Fully Attention-Based Mechanism" Remote Sensing 18, no. 2: 220. https://doi.org/10.3390/rs18020220

APA Style

Kang, A., Li, H., Luo, G., Li, J., & Yin, Z. (2026). A2Former: An Airborne Hyperspectral Crop Classification Framework Based on a Fully Attention-Based Mechanism. Remote Sensing, 18(2), 220. https://doi.org/10.3390/rs18020220

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