Test-Time Training for Hyperspectral Image Super-Resolution

Ke Li, Luc Van Gool, Dengxin Dai

TL;DR

This paper introduces a novel test-time training (TTT) framework for hyperspectral image super-resolution (HSI SR) to combat the chronic shortage of large-scale training data. By processing spectral bands independently to avoid information entanglement, using a teacher-student loop with a clever downsampling trick to generate stable pseudo-labels, and applying a novel "Spectral Mixup" data augmentation, the method significantly boosts the performance of pre-trained models on unseen data during inference.

What Problem Does This Paper Address?

Hyperspectral images (HSIs) capture dozens or hundreds of narrow spectral bands, providing a rich "fingerprint" for material identification, medical diagnosis, and remote sensing. However, high-resolution HSI cameras are expensive, bulky, and slow. Consequently, deep learning models for HSI super-resolution (SR) suffer from a severe lack of large-scale training data, leading to poor generalization when deployed on new, unseen scenes.

While test-time training (adapting a model to a specific test sample during inference) has succeeded in high-level tasks like image classification, it fails out-of-the-box for regression tasks like super-resolution. Naively training a model on its own prediction yields zero gradient updates. Furthermore, trying to model the complex interactions between hundreds of spectral bands simultaneously often causes models to diverge or become unstable when fine-tuned on a single test image.

Methods

The authors tackle these challenges through three core contributions:

  1. Self-Training with the Downsampling Trick: To make test-time training work for regression, the authors use a weight-averaged teacher model to predict a high-resolution (HR) image from the test input. Crucially, instead of mapping the test input to this prediction, they downsample the teacher's HR prediction to create a synthetic low-resolution (LR) counterpart. Training the student model on this synthetic LR-HR pair ensures a mathematically perfect degradation relationship, providing a stable and effective gradient signal.
  2. Single-Channel Grouped Architecture: Counter-intuitively, the authors argue against jointly modeling spatial and spectral dimensions during test-time adaptation. They propose a network that processes each spectral band completely independently using shared weights (grouped convolutions with a group size of 1). This prevents spectral bands from becoming entangled, simplifying the optimization landscape during test-time training.
  3. Spectral Mixup Data Augmentation: Standard data augmentations (like spatial mixup) destroy the delicate spatial structures required for super-resolution. The authors introduce Spectral Mixup, which creates augmented virtual training samples by taking random convex combinations across the spectral bands of the same image. This increases data diversity at test time without altering spatial details.

Datasets

The method was evaluated on three natural HSI datasets:

  • CAVE: A standard benchmark containing 32 images with 31 spectral bands.
  • Harvard: A standard benchmark containing 50 images with 31 spectral bands.
  • Spectral World (New): A diverse dataset collected by the authors using a mobile hyperspectral camera. It contains 216 high-resolution images across 204 spectral bands (400–1000 nm), featuring indoor and outdoor scenes ranging from food to vegetation and materials.
Exemplar samples from the newly introduced SpectralWorld Dataset.

Key Insights and Ideas

  • Less is More with Spectral Modeling: One of the most surprising findings is that treating HSI SR as a single-channel problem with shared weights actually outperforms complex architectures designed to model cross-channel interactions (like Restormer). Joint upsampling entangles the bands, forcing the network to spend its capacity disentangling them rather than focusing on spatial enhancement.
  • Perfecting the Degradation Loop: The "aha moment" for the test-time training loop is realizing that while the model's absolute prediction might contain errors, the relationship between a predicted HR image and its downsampled LR version is perfectly accurate. Leveraging this synthetic pair prevents the model from diverging during single-sample optimization.

Key Results

The proposed test-time training framework consistently improved the performance of multiple baseline architectures (including LIIF, HSIwRGB, and SwinIR) across all datasets.

  • Quantitative Gains: For a $\times2$ scaling factor on the CAVE dataset, the proposed framework boosted the baseline single-channel model's Mean Peak Signal-to-Noise Ratio (MPSNR) from 39.84 dB to 41.87 dB.
  • Comparison to Alternatives: The method significantly outperformed existing test-time adaptation methods adapted from classification tasks (such as TTT, TTT-MAE, and TTAPS), which often corrupted the delicate weights needed for super-resolution.
  • Qualitative Improvements: Visual results demonstrate that the test-time trained model excels at recovering subtle textures and sharp boundaries, such as the calyx of a strawberry or the distinctive layers of a croissant.
Visual comparison on the Spectral World dataset ($\times4$ scale) showing sharper texture recovery using the proposed test-time training method.

Limitations and Future Work

While independent band processing stabilizes test-time training, the authors acknowledge that effectively modeling spectral band interactions could still yield better results if a smarter learning mechanism or significantly larger datasets become available. Additionally, because test-time training requires running optimization steps (20 epochs in their setup) for every single test image, it introduces a computational overhead during inference that might limit its use in strict real-time applications.

Summary updated

BibTeX
@article{li2025test,
  author = {Ke Li and Luc Van Gool and Dengxin Dai},
  title = {{Test-Time Training for Hyperspectral Image Super-Resolution}},
  journal = {IEEE Trans. Pattern Anal. Mach. Intell.},
  year = {2025},
  doi = {10.1109/tpami.2024.3461807},
}
Figure