Introduction
Hyperspectral image (HSI) classification is a critical task in remote sensing, enabling the identification of materials based on their unique spectral signatures. However, the field has long been constrained by three primary challenges: the prevalence of small, custom-built "pocket models" that fail to leverage modern vision backbones; unrealistic evaluation protocols using random pixel-wise sampling that lead to spatial data leakage; and the high cost of expert labeling.
To address these issues, we present KnowCL (Knowledge Embedded Contrastive Learning), a unified framework that bridges the gap between specialized HSI models and standard vision architectures like Vision Transformers (ViT) and ResNets, while ensuring robust generalization through realistic data partitioning.
The KnowCL Framework
KnowCL integrates supervised, unsupervised, and semi-supervised learning into a single, scalable architecture. The framework is designed to extract invariant representations from unlabeled data while simultaneously utilizing task-specific knowledge from labeled samples.
Core Components
- Realistic Data Pipeline: KnowCL employs a disjoint sampling strategy to ensure training and test sets are spatially separated, preventing inflated accuracy scores. It also utilizes spectral grouping and PCA for efficient dimensionality reduction.
- Dual-Head Encoder: A shared backbone (e.g., ViT or ResNet) feeds into two distinct heads: a supervised head for classification and a contrastive head for learning robust features from augmented views of the data.
- Adaptive Multi-Task Loss: Instead of manual hyperparameter tuning, the framework uses a learnable weighting scheme to balance supervised and unsupervised losses dynamically during training.
- Domain-Specific Augmentation: Standard augmentations like cropping, flipping, and Gaussian blur are adapted for HSI to help the contrastive head learn features invariant to spatial and spectral noise.
Experimental Results and Discussion
The framework was evaluated on four major HSI benchmarks: University of Pavia (UP), Salinas, Dioni, and DFC2018. In all cases, KnowCL consistently outperformed state-of-the-art (SOTA) methods, particularly in semi-supervised settings where labeled data is scarce.
Scaling with Standard Backbones
A key insight from our study is that HSI classification does not require specialized "pocket" architectures. When trained within the KnowCL framework, standard vision backbones demonstrate superior performance and clear scalability.
As shown in the figure above, KnowCL-hsi (using a ViT backbone) achieves higher accuracy than traditional models like DFFN and SPNR while maintaining a competitive parameter count. Furthermore, the framework exhibits a positive scaling trend; as the backbone size increases (from ViT-tiny to ViT-hsi), the classification performance improves, a behavior often absent in custom HSI models.
Key Performance Metrics
- Supervised Learning: On the UP dataset, KnowCL achieved 86.27% Overall Accuracy (OA) under disjoint sampling.
- Semi-Supervised Learning: KnowCL reached 91.36% OA on UP and 93.62% OA on Salinas, significantly outperforming recent Graph Neural Network (GNN) approaches.
- Efficiency: The framework is highly efficient, reaching SOTA performance on the Dioni dataset in under 18 seconds of training time.
Conclusion
KnowCL demonstrates that by embedding task-specific knowledge into a contrastive learning framework, we can move away from fragile, specialized HSI models toward robust, general-purpose vision backbones. This shift not only improves classification accuracy but also paves the way for the development of HSI foundation models pre-trained on massive, unlabeled satellite datasets.
Summary updated