Abstract
Masked Image Modeling (MIM) has emerged as a powerful self-supervised alternative to supervised pre-training in computer vision, yet the underlying reasons for its success have remained elusive. This paper investigates the representational differences between MIM and supervised models, identifying a persistent "locality inductive bias" and high attention-head diversity as key drivers of MIM's performance. Our analysis reveals that while supervised models prioritize global semantic information, MIM's focus on local pixel reconstruction makes it exceptionally well-suited for geometric and motion-oriented tasks, such as pose estimation and depth sensing.
Introduction
For years, supervised pre-training on ImageNet was the gold standard for computer vision. Recently, Masked Image Modeling (MIM)—where a model predicts missing parts of an image—has emerged as a dominant self-supervised alternative, mirroring the success of BERT in natural language processing. However, the "why" behind its effectiveness remained a mystery. Researchers did not fully understand the representational differences between a model trained to classify a whole object (supervised) versus one trained to reconstruct missing patches (MIM). This study bridges that gap by comparing these paradigms through visualization and rigorous cross-task experimentation.
Methodology
The authors compare three types of pre-training: Supervised (DeiT/Swin), Contrastive Learning (MoCo v3), and MIM (specifically the SimMIM framework). They analyze these models using several sophisticated diagnostic tools:
- Attention Distance: Measuring how "local" or "global" a model's focus is across layers.
- Attention Entropy: Checking if attention is concentrated on a few tokens or spread broadly.
- KL Divergence: Measuring the diversity among different attention heads within the same layer.
- Centered Kernel Alignment (CKA): A metric to determine the similarity of feature representations between different layers.
Key Insights: The Nature of MIM Representations
The Locality Inductive Bias
A primary finding is that MIM forces the model to focus on nearby pixels across all layers. In contrast, supervised models typically start with local focus but quickly transition to global focus in deeper layers. This persistent locality helps Vision Transformers (ViTs)—which have a naturally massive receptive field—optimize more effectively during the early stages of training.
Head Diversity and Layer Uniformity
In supervised models, the diversity between attention heads often collapses in the final layers as they all converge on the same global features. MIM maintains high diversity throughout, which is beneficial for fine-tuning on downstream tasks. Furthermore, CKA analysis shows that MIM layers are surprisingly similar to one another, suggesting a more uniform representation from bottom to top compared to the hierarchical structure of supervised models.
Performance on Downstream Tasks
Because MIM focuses on pixel-level reconstruction rather than high-level category labels, it is significantly better at tasks requiring precise localization (geometric and motion-based) than supervised models.
- Pose Estimation: A standard SwinV2-L pre-trained with MIM achieved state-of-the-art results on COCO (78.9 AP) and CrowdPose (78.0 AP).
- Depth Estimation: MIM models outperformed specialized methods like BinsFormer on the NYUv2 and KITTI benchmarks.
- Object Detection: On COCO, MIM models helped localization tasks converge faster than supervised counterparts, although supervised models still hold an edge in pure classification when categories overlap heavily with the pre-training data.
Conclusion
While MIM is highly competitive, supervised pre-training remains superior for datasets where categories are very similar to the pre-training data. However, the high similarity between MIM layers suggests these models may be over-parameterized, offering opportunities for model pruning. Future work will focus on developing new pre-training tasks that better balance semantic and geometric learning based on these insights.
Summary updated