HyperTTA: Test-Time Adaptation for Hyperspectral Image Classification under Distribution Shifts

Xia Yue, Anfeng Liu, Ning Chen, Chenjia Huang, Hui Liu, Zhou Huang, Leyuan FangarXiv 2025 · DOI

Abstract

Hyperspectral image (HSI) classification models are highly susceptible to performance degradation when encountering real-world distribution shifts, such as atmospheric fog, sensor noise, or hardware failures. While traditional domain adaptation methods require access to target data during training, Test-Time Adaptation (TTA) offers a more flexible approach by refining models during inference. This paper presents HyperTTA, a framework specifically designed for HSI TTA. HyperTTA combines a multi-scale Transformer backbone (SSTC) with a lightweight, confidence-aware adaptation strategy (CELA) that updates only LayerNorm parameters. Experiments on a newly established HSI TTA benchmark demonstrate that HyperTTA significantly outperforms existing state-of-the-art TTA methods, maintaining high accuracy even under severe degradation.

Introduction

Hyperspectral imaging (HSI) provides rich spectral information, enabling the identification of materials with similar visual appearances. Despite their potential, HSI classification models are notoriously fragile when faced with distribution shifts—discrepancies between the training (source) and testing (target) data distributions. These shifts can be caused by varying weather conditions, sensor aging, or compression artifacts.

Standard Domain Adaptation (DA) techniques often require simultaneous access to both source and target data, which is frequently impossible in real-time remote sensing applications. Test-Time Adaptation (TTA) addresses this by adapting the model using only unlabeled test data at inference time. However, most TTA research focuses on low-dimensional RGB images. HyperTTA is introduced to bridge this gap, providing a robust solution tailored for the high-dimensional complexity of hyperspectral data.

Methodology

The HyperTTA framework consists of three integrated components: a degradation simulator, a robust backbone, and an efficient adaptation mechanism.

1. Multi-Degradation Simulator (MDS)

To evaluate model robustness, the authors developed a benchmark simulating nine representative HSI degradations, including various types of noise (Gaussian, Poisson, Salt-and-Pepper, stripe), sensor failures (deadlines), blur, and fog. This allows for a comprehensive assessment of how models handle real-world sensor and environmental artifacts.

2. Spectral-Spatial Transformer Classifier (SSTC)

The SSTC backbone utilizes a Multi-level Receptive Field (MRF) mechanism to capture spatial-spectral features across multiple scales simultaneously. During training, Label Smoothing Regularization (LSL) is employed to prevent the model from becoming overconfident, which preserves the flexibility required for effective test-time adaptation.

3. Confidence-aware Entropy-minimized LayerNorm Adapter (CELA)

CELA performs the actual adaptation during inference. Instead of retraining the entire network, it updates only the affine parameters ($\gamma$ and $\beta$) of the LayerNorm layers. This is achieved by minimizing the Shannon entropy of the model's predictions. To ensure stability and prevent the model from learning from its own errors, CELA employs a confidence-aware filter, adapting only on the top 30% of samples with the highest prediction confidence.

Experimental Results

HyperTTA was evaluated on two major HSI datasets: Pavia University (PU) and WHU-Hi-LongKou (WHLK), augmented by the MDS benchmark.

Performance Comparison

The results show that HyperTTA consistently achieves superior performance compared to existing TTA methods like Tent, CoTTA, and SoTTA. On the WHLK dataset, HyperTTA reached an average Overall Accuracy (OA) of 87.40% across all degradation types, whereas the next best method, SoTTA, achieved 77.99%. Notably, in extreme cases such as sensor deadlines (missing data columns), HyperTTA maintained a 73.24% OA on the PU dataset, while other methods often dropped into the 30-40% range.

Qualitative Analysis

Visual classification maps indicate that HyperTTA produces cleaner and more spatially coherent results. While other methods often introduce "salt-and-pepper" artifacts under heavy noise, HyperTTA preserves the underlying structures of the scene, demonstrating its ability to successfully shift internal feature distributions back to a recognizable range for the classifier.

Conclusion

HyperTTA represents a significant advancement in robust HSI classification. By focusing on lightweight LayerNorm adaptation and confidence-based filtering, it achieves state-of-the-art results on a comprehensive new benchmark without requiring access to source data. Future research will focus on extending this framework to dynamic streaming scenarios where environmental conditions change continuously during flight.

Summary updated

BibTeX
@misc{yue2025hypertta,
  author = {Xia Yue and Anfeng Liu and Ning Chen and Chenjia Huang and Hui Liu and Zhou Huang and Leyuan Fang},
  title = {{HyperTTA: Test-Time Adaptation for Hyperspectral Image Classification under Distribution Shifts}},
  year = {2025},
  eprint = {2509.08436},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2509.08436},
}
Figure