Self Supervised Learning for Few Shot Hyperspectral Image Classification

Nassim Ait Ali Braham, Lichao Mou, Jocelyn Chanussot, Julien Mairal, Xiao Xiang Zhu

Abstract

Hyperspectral Image (HSI) classification is a critical task for environmental monitoring and remote sensing, yet its progress is often hindered by the high cost and domain expertise required for data labeling. This paper explores the application of Self-Supervised Learning (SSL)—specifically the Barlow-Twins algorithm—to mitigate this "labeling bottleneck." By pre-training an encoder on unlabeled pixels using a combination of spatial-aware sampling and spectral augmentations, the researchers demonstrate that high-accuracy classification is possible with as few as five labeled samples per class. The results show that SSL significantly outperforms traditional supervised methods in few-shot scenarios, offering a robust path forward for label-efficient remote sensing.

Introduction: The Labeling Bottleneck in HSI

Hyperspectral images capture hundreds of narrow spectral bands for every pixel, providing a rich data source for identifying materials and land-cover types. However, the complexity of this data is a double-edged sword. Training deep learning models typically requires thousands of manually labeled pixels, a process that is tedious, expensive, and requires significant domain expertise. This creates a "few-shot" problem: how can we build powerful models when only a handful of labels are available?

This research addresses this challenge by shifting the heavy lifting of feature learning from the supervised stage to a self-supervised pre-training stage. By learning the underlying structure of the data from the unlabeled pixels themselves, the model enters the classification phase with a sophisticated understanding of the HSI domain.

Methodology: Barlow-Twins and Spatial-Aware SSL

The proposed framework utilizes a two-stage pipeline consisting of self-supervised pre-training followed by a classification task.

1. Pre-training with Barlow-Twins

At the heart of the pre-training stage is the Barlow-Twins algorithm. Unlike contrastive learning methods that rely on comparing "positive" and "negative" pairs, Barlow-Twins focuses on redundancy minimization. It works by making the cross-correlation matrix of two different "views" of the same input as close to the identity matrix as possible. This objective forces the model to learn essential, invariant features while discarding redundant information that does not contribute to the representation.

2. Spatial-Aware Views and Spectral Augmentations

A key innovation in this study is the method of generating the two "views" for the SSL algorithm. Rather than simply augmenting a single patch, the authors sample two overlapping patches from the scene. This incorporates a "spatial regularity" prior—the fundamental remote sensing principle that neighboring areas likely belong to the same class.

To ensure the model is robust to noise and sensor variations, the authors apply two types of transforms:

  • Spatial Transforms: Standard operations like flipping and rotation.
  • Spectral Transforms: Domain-specific augmentations including Gaussian noise, band dropping, and band swapping. These are critical for teaching the model to ignore noise in specific wavelengths.

3. Classification Stage

Once the encoder is trained, it is evaluated using two protocols:

  • Linear Protocol: The encoder weights are frozen, and a simple linear classifier is trained on top. This tests the quality of the learned representations.
  • Finetuning: The pre-trained weights serve as an initialization for a full model training session.

Experimental Results

The approach was evaluated on standard HSI benchmarks, including the Pavia University and Houston University datasets. The results highlight a massive leap in performance for few-shot scenarios:

  • Pavia University (5 labels/class): The SSL approach achieved 80.6% Overall Accuracy (OA), a stark improvement over the 61.2% achieved by a standard supervised CNN.
  • Houston University (5 labels/class): SSL reached 74.4% OA, while the supervised baseline lagged at 60.0%.
  • Label Efficiency: Even in scenarios where labels were abundant (using DASE Training Maps), the SSL-pre-trained models consistently outperformed purely supervised models, suggesting that SSL provides a superior initialization that helps the model generalize and avoid overfitting.

Discussion: The Power of Representation

One of the most significant findings is the effectiveness of the Linear Protocol. In many tests, the frozen encoder performed nearly as well as the finetuned model. This suggests that the self-supervised pre-training successfully captures the physical and structural essence of the hyperspectral data. Furthermore, the method proved versatile, working effectively for both 2D CNNs (patch-based) and 1D CNNs (pixel-level spectra).

Conclusion and Future Work

This research demonstrates that Self-Supervised Learning can drastically reduce the dependency on labeled data in HSI classification. By leveraging spatial inductive priors and spectral augmentations, the Barlow-Twins approach enables high-performance remote sensing even in data-scarce environments.

Future work may explore data-driven view generation to automate the selection of augmentations and investigate ways to reduce the computational overhead of the SSL pre-training stage. Additionally, optimizing neighborhood sizes for different sensor resolutions remains a key area for refining pixel-level (1D) classification results.

Summary updated

Abstract

Deep learning has proven to be a very effective approach for Hyperspectral Image (HSI) classification. However, deep neural networks require large annotated datasets to generalize well. This limits the applicability of deep learning for HSI classification, where manually labelling thousands of pixels for every scene is impractical. In this paper, we propose to leverage Self Supervised Learning (SSL) for HSI classification. We show that by pre-training an encoder on unlabeled pixels using Barlow-Twins, a state-of-the-art SSL algorithm, we can obtain accurate models with a handful of labels. Experimental results demonstrate that this approach significantly outperforms vanilla supervised learning.
BibTeX
@inproceedings{braham2022self,
  author = {Nassim Ait Ali Braham and Lichao Mou and Jocelyn Chanussot and Julien Mairal and Xiao Xiang Zhu},
  title = {{Self Supervised Learning for Few Shot Hyperspectral Image Classification}},
  booktitle = {IGARSS},
  year = {2022},
  url = {https://openreview.net/forum?id=oYNBL7MHv6},
}
Figure