SwiMDiff: Scene-Wide Matching Contrastive Learning With Diffusion Constraint for Remote Sensing Image

Jiayuan Tian, Jie Lei, Jiaqing Zhang, Weiying Xie, Yunsong Li

TL;DR

SwiMDiff is a novel self-supervised learning framework for remote sensing that fixes two major flaws in standard contrastive learning: "sample confusion" caused by geographical proximity and the loss of fine-grained textural details. By combining a scene-wide matching strategy with an auxiliary diffusion model constraint, it forces the encoder to capture both global semantics and pixel-level structures, setting new state-of-the-art benchmarks for change detection and land-cover classification.

What Problem Does This Paper Address?

Remote Sensing Image (RSI) analysis is critical for everything from disaster prevention to urban planning, but labeling these images requires expensive specialist knowledge. Self-supervised learning (SSL)—specifically Contrastive Learning (CL)—has emerged as a way to train models on massive unlabeled datasets. However, standard CL struggles with two "RSI-specific" problems:

  1. The Geography Problem (False Negatives): Standard CL assumes any two different image crops are "negatives" (dissimilar). But the "First Law of Geography" tells us that things close to each other are usually similar. If a model is told that two adjacent patches of the same forest are "opposites," it becomes confused and fails to learn stable semantic features.
  2. The Detail Problem: CL is an instance-level task; it excels at identifying "this is a city" vs. "this is a field." However, RSI tasks like change detection require pixel-level precision. Standard CL often discards fine-grained textures and edges as "noise" in favor of global patterns.

Methods

The authors introduce SwiMDiff, which bifurcates the learning process into two synergistic components:

  • Scene-wide Matching (SwiM): Instead of treating all other images in a batch as hard negatives, SwiM identifies samples coming from the same geographical scene. It uses an adaptive soft mechanism to recalibrate labels. If a "negative" sample is highly similar to the anchor and from the same scene, it is treated as a "soft positive," preventing the model from being penalized for recognizing inherent similarities.
  • Auxiliary Diffusion Constraint (Diff): The framework integrates a Denoising Diffusion Probabilistic Model (DDPM) as a secondary task. While the CL branch looks at the "big picture," the diffusion branch forces the encoder to help reconstruct a noisy image. Because denoising requires a deep understanding of local structures (like the edge of a building or the texture of a road), the encoder is forced to preserve high-frequency, fine-grained details that standard CL would ignore.

The final model is trained using a joint loss function that balances the contrastive loss ($L_C$) and the diffusion reconstruction loss ($L_D$).

Datasets

The researchers evaluated SwiMDiff across several standard remote sensing benchmarks:

  • Pre-training: A 10,000-sample subset of the Sen12MS dataset (Sentinel-2 RGB images).
  • Change Detection: OSCD (Onera Satellite Change Detection) and LEVIR-CD (a high-resolution dataset focused on building changes).
  • Land-Cover Classification: BigEarthNet (multi-label) and EuroSAT (single-label).

Key Insights and Ideas

  • Diffusion as a Feature Enhancer: Traditionally, diffusion models are used for image generation. Here, the "aha moment" is using diffusion as a regularizer for representation learning. It acts as a "pixel-level supervisor" that ensures the encoder doesn't lose the trees for the forest.
  • Correcting the "Negative" Bias: By acknowledging that images from the same scene aren't truly negatives, the authors resolve "sample confusion." This makes the contrastive signal much cleaner and more geologically sound.
  • High-Frequency Preservation: Qualitative results (Figure 4 in the paper) show that features from SwiMDiff look significantly more like detailed edge maps compared to standard CL features, which appear blurry. This explains why the model performs so well on change detection, where boundaries are everything.

Key Results

SwiMDiff consistently outperformed baseline methods (like MoCo-v2) and other specialized SSL methods (like DiRA and tri-SimCLR):

  • Change Detection: On the OSCD dataset, SwiMDiff achieved an F1 score of 49.6%, a significant jump over the MoCo-v2 baseline (45.6%). On LEVIR-CD, it reached 80.9% F1.
  • Classification: On BigEarthNet, SwiMDiff achieved 69.9% mAP in linear probing, outperforming the next best method (DiRA) by 0.2% and the baseline by 1.3%.
  • Ablation Success: The study showed that adding the diffusion constraint alone to a standard baseline improved the F1 score on change detection by 3.0%, proving that pixel-level constraints are vital for RSI.

Limitations and Future Work

The primary limitation acknowledged by the authors is computational efficiency. Diffusion models require iterative denoising steps, which are resource-intensive and slow down the pre-training phase.

Future Work will focus on:

  1. Model Compression: Reducing the size of the integrated framework.
  2. Acceleration: Optimizing the diffusion branch to make the training process more practical for even larger-scale datasets.

Summary updated

BibTeX
@article{tian2024swimdiff,
  author = {Jiayuan Tian and Jie Lei and Jiaqing Zhang and Weiying Xie and Yunsong Li},
  title = {{SwiMDiff: Scene-Wide Matching Contrastive Learning With Diffusion Constraint for Remote Sensing Image}},
  journal = {IEEE Trans. Geosci. Remote. Sens.},
  year = {2024},
  url = {https://openreview.net/forum?id=lNBSNK4EiV},
}
Figure