Abstract
Hyperspectral image classification is the process of identifying ground objects within hyperspectral images at the pixel level. While many CNN-based methods have been successfully used in this field, they often struggle to effectively extract inter-spectral information due to the high spectral dimensions of hyperspectral images. Recently, the transformer model has been introduced to capture the interdependence between spectral data, but it may lose the ability to capture local context features. In order to address the limitations of CNN and Transformer models, we propose a novel approach that integrates the advantages of both models. Specifically, we use CNN to extract spatial information and Transformer to extract spectral information, which is then fused before being fed into the MLP framework for classification. Additionally, we introduce a sparse strategy to eliminate the impact of redundant frequency bands on the transformer’s performance. Our method fully utilizes the spatial and spectral information in hyperspectral image data and has achieved excellent performance on hyperspectral datasets. By leveraging both CNN and transformer models, we can effectively capture both spatial and spectral features, providing a powerful tool for hyperspectral image classification.
Introduction
Hyperspectral Imaging (HSI) provides a rich "spectral signature" for every pixel by capturing hundreds of narrow spectral bands. This high-dimensional data allows for precise material identification but introduces significant classification challenges. Traditionally, researchers have faced a trade-off: Convolutional Neural Networks (CNNs) excel at capturing local spatial context but struggle with long-range spectral dependencies, while Transformers model spectral relationships effectively but lack the inductive bias for local spatial textures. Furthermore, HSI data often contains redundant or noisy bands that can degrade model performance.
To bridge this gap, we introduce the Spatial-Spectral FusionNet (SSFN). SSFN utilizes a dual-stream architecture to simultaneously extract spatial and spectral features, employing a novel sparse attention strategy to filter out noise and achieve state-of-the-art accuracy.
Methodology
The SSFN architecture consists of two distinct streams designed to process HSI data in parallel before fusing the extracted features for final classification.
Stream 1: Spatial Feature Extraction
This branch focuses on the spatial relationships between neighboring pixels. It begins with Principal Component Analysis (PCA) to reduce dimensionality, followed by the extraction of 2D patches. These patches are processed through a ResNet backbone enhanced with a Squeeze-and-Excitation (SE) module. The SE module acts as a channel attention mechanism, allowing the network to prioritize the most informative spatial features.
Stream 2: Spectral Feature Extraction and the Sparse Strategy
The spectral stream treats the bands of a single pixel as a sequence, utilizing a Vision Transformer (ViT) encoder to model long-range dependencies between wavelengths. A key innovation in this stream is the replacement of the standard softmax attention mechanism with entmax. Unlike softmax, which assigns at least a minimal weight to every input, entmax can assign exactly zero weight to irrelevant or redundant spectral bands. This sparse strategy effectively filters noise and focuses the model on the most discriminative spectral data.
Feature Fusion
The outputs from both streams are concatenated and passed through a Multi-Layer Perceptron (MLP). The authors found that concatenation outperformed other fusion methods (like addition or multiplication), as it preserves the distinct feature sets from both domains, allowing the MLP to learn complex interactions between them.
Experimental Results
The SSFN model was evaluated on three benchmark HSI datasets: Indian Pines, Pavia University, and Salinas. The model consistently outperformed traditional SVM methods and single-architecture deep learning models.
- Indian Pines: Achieved an Overall Accuracy (OA) of 99.28%, compared to 94.82% for a standard ResNet.
- Pavia University: Achieved an OA of 98.98%.
- Salinas: Achieved an OA of 99.30%.
Ablation studies highlighted the importance of the dual-stream approach. On the Indian Pines dataset, the spatial stream alone achieved ~98.9% accuracy, while the spectral stream alone reached only ~82.5%. The fusion of both, combined with the sparse entmax strategy, pushed performance to the final peak of 99.28%.
Conclusion
SSFN demonstrates that the integration of CNNs and Transformers, supported by a sparse attention mechanism, provides a robust solution for HSI classification. By effectively managing spectral redundancy and leveraging complementary spatial-spectral features, SSFN sets a new standard for accuracy in the field. Future work will focus on reducing the computational overhead of the Transformer components and exploring dynamic dimensionality reduction techniques.
Summary updated