arXiv:2611.02364eess.IVNov 2026

Manuscript Offprint

arXiv:2611.02364

Spectral-spatial vision test-time training for hyperspectral image classification

Xiang Zhao

Xiang Zhao a,∗^{a,*}

a^{a}College of Mathematical Sciences, Harbin Engineering University, 145 Nantong Street, Nangang District, Harbin 150001, China

Abstract. Hyperspectral image (HSI) classification requires the representation of contiguous spectral signatures and spatial context under limited labeled supervision. Vision test-time training (TTT) offers an alternative to fixed-weight token mixing by performing self-supervised inner-model updates on the input sequence, but its application to center-pixel HSI classification remains insufficiently characterized. We present ViTTT-HSI, a spectral–spatial adaptation of the vision test-time training (ViT 3^{3}) architecture. A spectral-aware embedding stem extracts ordered-band information using spectral convolution and forms spatial tokens without reducing their spatial resolution. Two ViT 3^{3}-based TTT encoder blocks perform patch-conditioned token mixing, followed by the fusion of center-pixel and neighborhood-average features for classification. We evaluate the framework on Indian Pines, Pavia University, Salinas, and Houston 2013 using ten random seeds and dataset-specific training fractions of 1% or 5%. The mean overall accuracies are 97.6390%, 98.8753%, 99.3292%, and 98.4283%, respectively. Ablations reveal a substantial contribution from the TTT inner update on Indian Pines and a smaller positive contribution on Pavia University, while the relative benefits of the spectral stem and feature fusion depend on the dataset. The results demonstrate the feasibility of using patch-conditioned vision TTT for spectral–spatial HSI classification and highlight the role of the inner adaptation mechanism.

Keywords: hyperspectral image classification, test-time training, spectral–spatial representation, center-pixel classification, remote sensing.

*Corresponding author: Xiang Zhao, 2021241331@hrbeu.edu.cn‾\underline{\text{2021241331@hrbeu.edu.cn}}

1 Introduction

Hyperspectral images (HSIs) record a dense sequence of spectral measurements for each spatial location, providing discriminative signatures for identifying vegetation, built surfaces, and other land-cover materials. Their classification is a fundamental step in remote sensing applications such as agricultural monitoring, environmental assessment, and urban mapping. Compared with conventional three-channel images, HSI cubes contain substantially more spectral channels and often exhibit pronounced correlations between neighboring bands. At the same time, reliable pixel annotations can be costly to obtain, making accurate classification under limited supervision a persistent research challenge. 1,2^{1,2}

A classifier based solely on the spectrum of a target pixel may be sensitive to local spectral variation and similarities between distinct materials. Incorporating neighboring pixels provides complementary spatial evidence, but also requires the model to accommodate boundaries and heterogeneous patches. Deep convolutional networks have addressed this issue by learning local spectral and spatial features through 3-D and 2-D operators. 3,4^{3,4} More recently, Transformers have offered flexible sequence-level interactions for spectral and spatial feature learning, as illustrated by SpectralFormer and the spectral–spatial feature tokenization Transformer (SSFTT). 5,6^{5,6} Selective state-space models have also been used for hyperspectral representation learning, with S 2^{2}Mamba combining spatial and spectral sequence processing. 7^{7}

These advances offer increasingly expressive spectral–spatial encoders. A complementary question is whether the token-mixing operation itself can adapt to the particular neighborhood being classified. Test-time training (TTT) addresses sequence modeling through temporary, input-dependent inner-model updates: features from the current sequence form key-value training pairs, the inner model is updated by an unlabeled objective, and the adapted model then processes query features.⁸ In vision, Han et al. developed ViT³ and studied how inner-training objectives, optimization settings, gated units, and depthwise convolutional inner models affect visual token mixing.⁹ This approach provides a patch-conditioned representation without requiring class labels at inference.

Applying a visual TTT architecture to HSI center-pixel recognition requires changes at the input and prediction interfaces. First, the spectral axis carries a meaningful band ordering that is absent from standard red, green, and blue (RGB) patch embeddings. Second, the target is the label of the center pixel rather than a single label for the entire image. Third, spatial positions should remain explicitly associated with their original neighborhoods so that center information can be recovered after token interaction. These requirements motivate a spectral-aware embedding and a center-oriented prediction head around a ViT³-based spatial encoder.

In this work, we construct ViTTT-HSI, a spectral–spatial adaptation of vision TTT for HSI center-pixel classification. A spectral convolutional stem first extracts ordered-band responses and creates one token per spatial position. Two encoder blocks then apply patch-conditioned TTT mixing while retaining the complete spatial token grid. Finally, the normalized center token is combined with an average representation of the neighborhood for the class prediction. The TTT inner models and their update rules follow ViT³,⁹ the hyperspectral embedding, token organization, and center–global prediction pathway form the task-specific adaptation studied here.

The main contributions are summarized as follows. (1) We establish a vision TTT-based spectral–spatial framework for HSI center-pixel classification, maintaining spatial correspondence throughout the token-processing stages. (2) We introduce a spectral-aware embedding pathway that exploits local spectral continuity while generating spatially aligned features suitable for ViT³ mixing. (3) We evaluate the framework across four public HSI datasets and ten random seeds, and examine the roles of the TTT inner update, input embedding, center–global feature aggregation, spatial context size, and spatially separated sampling. The controlled inner-update comparisons provide a direct assessment of the patch-conditioned learning mechanism.