Locality-Aware Hyperspectral Classification

Fangqin Zhou, Mert Kilickaya, Joaquin VanschorenBMVC 2023 · DOI

Abstract

Hyperspectral Imaging (HSI) provides dense spectral data across hundreds of narrow bands, enabling precise material identification. However, standard Vision Transformer (ViT) architectures often suffer from "tunnel vision," prioritizing spectral signatures while neglecting the spatial context of neighboring pixels. This paper introduces HyLITE (Hyperspectral Locality-aware Image TransformEr), a novel architecture designed to integrate local spatial attention with spectral analysis. By employing a dual-attention mechanism and a unique local-global regularization loss, HyLITE addresses the phenomenon of "attentional divergence" and achieves state-of-the-art performance across multiple benchmarks, particularly in scenarios with limited training data.

Introduction

Hyperspectral Imaging (HSI) captures a wide range of light wavelengths for every pixel in an image, creating a detailed "spectral signature" for the materials observed. This technology is critical for high-stakes applications such as precision agriculture, environmental monitoring, and urban planning. Despite the richness of this data, classifying HSI remains challenging. Traditional Convolutional Neural Networks (CNNs) are limited by small receptive fields, while modern Vision Transformers (ViTs) often focus too heavily on individual spectral signatures, ignoring the spatial relationships between adjacent pixels.

This spatial neglect is problematic because many distinct materials—such as different types of soil or crop varieties—may possess nearly identical spectral signatures. In these cases, the spatial arrangement and texture of the surrounding area serve as the necessary "tie-breaker" for accurate classification. HyLITE was developed to bridge this gap by explicitly modeling both spectral and local spatial dependencies.

The HyLITE Architecture

The HyLITE model processes hyperspectral data through a specialized pipeline designed to balance global spectral features with local spatial context. The architecture is built upon three primary innovations:

1. Dual-Attention Blocks

Unlike standard Transformers that use a single Multi-Head Attention (MHA) layer, HyLITE utilizes two distinct layers within each block:

  • Spectral MHA: This layer learns the complex relationships between different light wavelengths, capturing the core identity of the material.
  • Local MHA: This layer focuses on the relationships between neighboring pixels within a spatial patch, providing the context necessary to distinguish between spectrally similar classes.

2. Feature-Level Fusion

The model employs a specific sequence for processing: spectral information is analyzed first, followed by spatial information. This allows the local context to effectively "disambiguate" the spectral data, ensuring that the final classification is informed by both the material's composition and its surroundings.

3. Local-Global Regularization

A significant contribution of this work is the identification of "attentional divergence," where spectral tokens begin to ignore the global context as the model deepens. To counteract this, the authors introduced a novel regularization function. This loss ensures the "global" classifier token remains mathematically close to the average of all spectral tokens, tethering the model’s internal representations and maintaining a cohesive "big picture" view of the image patch.

Experimental Results

HyLITE was evaluated against three gold-standard HSI benchmarks: Indian Pines, Houston2013, and Pavia University. The model established a new state-of-the-art (SOTA) across all datasets, demonstrating significant improvements over previous models like SpectralFormer and MAEST.

  • Indian Pines: This dataset is notoriously difficult due to its small training set. HyLITE achieved an 89.80% Overall Accuracy (OA), representing a massive 10.83% jump over the previous SOTA.
  • Pavia University: The model reached 91.28% OA, a 6.64% improvement.
  • Houston2013: HyLITE achieved 88.49% OA, an increase of 3.41%.

Sample Efficiency

One of the most practical findings was HyLITE's performance under data constraints. When training data was reduced to only 10% of the original set, HyLITE maintained a significant lead over its competitors. This suggests that the model's "inductive biases"—specifically its focus on locality—allow it to learn more effectively from fewer examples than models that rely on massive pre-training or pure scale.

Discussion and Insights

The success of HyLITE highlights several key principles for HSI classification. First, locality is a critical component of the classification process; spatial context provides the clues needed when spectral signatures are ambiguous. Second, the order of operations matters—analyzing the spectrum before the spatial neighborhood yielded superior results. Finally, the discovery of attentional divergence suggests that simply adding more layers to a Transformer is not a guaranteed path to better performance; architectural constraints like the proposed local-global regularization are necessary to keep high-dimensional representations cohesive.

Conclusion and Future Work

HyLITE represents a significant advancement in hyperspectral image classification by successfully integrating local spatial awareness into a Transformer framework. While the model sets new benchmarks for accuracy and sample efficiency, future research is needed to explore the computational overhead of dual-attention mechanisms. Additionally, scaling the architecture to perform full-scene classification without the redundancy of overlapping patches remains an area for further development. The identification of attentional divergence may also have broader implications for Transformer architectures in other domains beyond hyperspectral imaging.

Summary updated

BibTeX
@misc{zhou2023locality,
  author = {Fangqin Zhou and Mert Kilickaya and Joaquin Vanschoren},
  title = {{Locality-Aware Hyperspectral Classification}},
  year = {2023},
  eprint = {2309.01561},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2309.01561},
}
Figure