Abstract
Self-supervised learning (SSL) has become a cornerstone of remote sensing (RS) and earth observation research, enabling the training of robust models on vast quantities of unlabeled satellite imagery. However, a persistent gap remains: most SSL methods optimize for either global semantic separability or local spatial perceptibility, but rarely both. This study introduces Contrastive Mask Image Distillation (CMID), a unified SSL framework designed to bridge this gap. By integrating contrastive learning (CL) with masked image modeling (MIM) through a self-distillation mechanism, CMID learns representations that are both semantically rich and spatially precise. Our framework is architecture-agnostic, performing effectively with both Convolutional Neural Networks (CNNs) and Vision Transformers (ViTs). Experimental results across four diverse downstream tasks—scene classification, semantic segmentation, object detection, and change detection—demonstrate that CMID consistently outperforms existing state-of-the-art SSL methods.
Introduction
The proliferation of remote sensing data provides an unprecedented opportunity for Earth observation, yet the bottleneck remains the high cost of expert annotation. Self-supervised learning offers a pathway to leverage unlabeled data by pre-training models on "pretext" tasks. In the RS domain, these tasks generally fall into two categories: Contrastive Learning (CL), which emphasizes distinguishing between different images to learn global semantics, and Masked Image Modeling (MIM), which focuses on reconstructing missing image patches to learn local spatial structures.
While CL is highly effective for scene classification, it often fails to capture the fine-grained details necessary for object detection or segmentation. Conversely, MIM excels at spatial perception but often lacks the semantic discriminative power required to distinguish between similar land-cover classes. We argue that for RS applications, a unified approach is necessary. CMID addresses this by combining these two paradigms into a single, cohesive distillation framework.
The CMID Framework
CMID utilizes a Teacher-Student self-distillation architecture. During training, a student network receives a masked version of an image, while a teacher network processes the full, augmented version. The framework is defined by three specialized learning branches:
1. Masked Image Modeling (MIM) Branch
The student network is tasked with reconstructing masked patches. Unlike standard MIM, which focuses solely on pixel-wise reconstruction, CMID incorporates a Focal Frequency Loss. By reconstructing the image in both the spatial and frequency domains, the model is forced to pay closer attention to high-frequency details such as edges and fine textures, which are critical for identifying man-made structures in satellite imagery.
2. Global Contrastive Branch
To maintain semantic separability, the global branch aligns the high-level feature representations of the teacher and student. Using a MoCo-style queue, this branch ensures that the model can distinguish between different scenes, providing the "semantic punch" necessary for classification tasks.
3. Local Semantic Branch
A common failure of MIM in remote sensing is "semantic incompleteness," where masking might entirely obscure a small object (e.g., a vehicle). CMID introduces a local branch that aligns feature vectors between the teacher and student using Position Matching. These features are mapped to a set of learnable "prototypes," ensuring the student learns the underlying semantic concepts of local areas even when those areas are partially hidden.
Experimental Evaluation
We pre-trained CMID on the MillionAID dataset, which contains over one million non-overlapping RS images. To evaluate the versatility of the learned representations, we conducted experiments on several benchmark datasets:
- Scene Classification: On the UC Merced (UCM) dataset, CMID-ResNet50 achieved an accuracy of 99.22%, surpassing models pre-trained on the much larger ImageNet dataset.
- Semantic Segmentation: On the ISPRS Potsdam dataset, the framework reached 87.35% mIoU, demonstrating superior performance in dense mapping tasks compared to pure CL or MIM methods.
- Object Detection: Using the DOTA dataset for oriented object detection, CMID-Swin-B achieved a mAP of 77.36, proving its ability to localize small, rotated objects in complex environments.
- Change Detection: Evaluations on the CDD dataset confirmed that CMID's features are highly effective for bi-temporal image analysis.
Discussion and Key Insights
Our findings suggest that CL and MIM are fundamentally complementary. CL provides the "what" (the identity of the scene), while MIM provides the "where" (the spatial arrangement). By unifying them, CMID achieves a level of data efficiency that is particularly valuable in RS; the model showed remarkable "few-shot" performance, outperforming competitors even when only 1% of labeled data was available for fine-tuning.
Furthermore, CMID’s architecture-agnostic nature allows it to be deployed with ResNet-based pipelines or modern Swin-Transformer architectures, making it a flexible tool for the broader RS community.
Conclusion
CMID represents a significant step toward a universal representation learner for remote sensing. By reconciling the global-local trade-off through self-distillation, it provides a robust foundation for a wide array of Earth observation tasks. Future work will focus on improving the computational efficiency of the MIM branch and exploring sparse convolutions to further optimize the framework for CNN architectures.
Summary updated