NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

SpectralDiff: A Generative Framework for Hyperspectral Image Classification with Diffusion Models

Ning Chen, Jun Yue, Leyuan Fang, Shaobo XiaarXiv 2023 · DOI

TL;DR

SpectralDiff is the first framework to apply generative diffusion models to hyperspectral image (HSI) classification. By learning to reconstruct HSI data through an iterative denoising process, the model captures complex spectral-spatial distributions and cross-sample relationships, significantly outperforming current state-of-the-art discriminative methods.

What Problem Does This Paper Address?

Hyperspectral images (HSIs) provide a wealth of information, capturing hundreds of narrow spectral bands for every pixel. This high dimensionality is a double-edged sword: while it allows for precise material identification, it also introduces massive data redundancy and complex spatial-spectral relationships that are difficult to model.

Current deep learning approaches, such as CNNs and Transformers, often struggle to capture the global context or require manually designed graph structures (in the case of Graph Neural Networks) to understand relationships between different samples. These methods are primarily discriminative—they focus solely on finding the boundary between classes. The authors argue that a generative approach, which learns the underlying distribution of the data itself, can extract more robust and contextually aware features for classification.

Methods

The authors propose SpectralDiff, a two-stage framework consisting of a spectral-spatial diffusion module and an attention-based classification module.

Fig. 1: Overview of the proposed SpectralDiff. (a) The architecture of the generative framework with diffusion process. H0 and Ht represent hyperspectral images of timestep 0 and timestep T, respectively. P(·|·) and Q(·|·) represent the forward and reverse spectral-spatial diffusion processes, respectively. (b) Structure of Convolutional Tokenization. (c) Structure of Transformer Encoders.

1. Spectral-Spatial Diffusion Module (SSDM)

This module treats HSI classification as a generative task. It follows the standard Denoising Diffusion Probabilistic Model (DDPM) paradigm but adapts it for 3D hyperspectral data:

  • Forward Process: Gradually adds Gaussian noise to HSI patches over multiple timesteps until they become pure white noise.
  • Reverse Process: A Spectral-Spatial Denoising Network (a 3D U-Net variant) is trained to predict and remove the noise at each step. By learning to reconstruct the original HSI from noise, the network implicitly learns the complex joint distribution of spectral and spatial features.
Fig. 2: Structure of the Spectral-Spatial Denoising Network. (a) The original HSI data is processed through a forward diffusion process to obtain image data with added Gaussian noise. Subsequently, the data is passed through an encoder-decoder structure and finally output as a tensor with the same shape as the original HSI data. This output represents the network’s prediction for the initial noise ϵ added. (b) The details of the 3-D down-sampling block. (c) The details of the 3-D up-sampling block.

2. Attention-based Classification Module (ACM)

Once the diffusion model is trained, its intermediate activations (the "diffusion features") are extracted. These features are then fed into a hybrid classifier:

  • CNN Tokenization: A 2D convolutional layer converts the spatial features into a sequence of tokens.
  • Transformer Encoder: A standard Transformer architecture processes these tokens to capture deep semantic features and long-range dependencies.
  • MLP Head: The final output is mapped to specific land-cover classes (e.g., "Alfalfa," "Woods," "Soybean").

Datasets

The framework was evaluated on three widely used public HSI benchmarks:

  • Indian Pines (IP): 145×145 pixels, 200 spectral bands, 16 classes.
  • Pavia University (PU): 610×340 pixels, 103 spectral bands, 9 classes.
  • Salinas (SA): 512×217 pixels, 204 spectral bands, 16 classes.

Key Insights and Ideas

  • Generative Feature Extraction: The "aha moment" is that the features learned to reconstruct a signal are often more descriptive than those learned just to label it. The diffusion process acts as a powerful unsupervised feature extractor that understands the "essence" of the HSI data.
  • Implicit Relationship Modeling: Unlike GNNs, which require a pre-defined graph structure to model sample relationships, SpectralDiff learns these relationships adaptively through the denoising process.
  • Feature Robustness: Ablation studies showed that using diffusion features as input to the classifier consistently outperformed using raw spectral bands, with improvements in Overall Accuracy (OA) ranging from ~0.8% to nearly 6% depending on the dataset.
  • Timestamp Sensitivity: The authors found that features from earlier denoising steps (smaller timestamps) generally perform better, likely because they are closer to the original image manifold and contain less residual noise.

Key Results

SpectralDiff achieved new state-of-the-art performance across all three datasets:

  • Indian Pines: 93.15% Overall Accuracy (OA), surpassing the previous best (SSGRN) by 0.81%.
  • Pavia University: 94.78% OA, an improvement of 0.93% over the second-best model.
  • Salinas: 98.97% OA, a significant 1.97% jump over existing methods.

Qualitatively, the classification maps produced by SpectralDiff are much "cleaner," with fewer isolated misclassified pixels (noise) and better-defined boundaries between land-cover types compared to traditional CNN or GNN approaches.

Limitations and Future Work

  • Overfitting on Small Samples: When training samples are extremely limited (e.g., only 10 samples per class), the high dimensionality of the diffusion features can lead to overfitting, causing performance to dip below simpler models.
  • Computational Cost: As a two-stage framework involving iterative denoising, SpectralDiff is computationally heavier than simple 1D or 2D CNNs, though it remains comparable to other complex SOTA models like SSRN.
  • Future Directions: The authors suggest exploring diffusion models for out-of-distribution (OOD) detection, helping remote sensing systems identify new or unknown land-cover types that weren't present in the training data.

Summary updated

BibTeX
@misc{chen2023spectraldiff,
  author = {Ning Chen and Jun Yue and Leyuan Fang and Shaobo Xia},
  title = {{SpectralDiff: A Generative Framework for Hyperspectral Image Classification with Diffusion Models}},
  year = {2023},
  eprint = {2304.05961},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2304.05961},
}
Figure