Abstract
Self-supervised learning has made significant strides in computer vision, yet achieving zero-shot semantic understanding remains a challenge. We present Masked Momentum Contrastive Learning (MMC), a novel pretraining method that enables Vision Transformers (ViTs) to perform zero-shot object segmentation through visual prompting. MMC harmonizes global semantic consistency with local structural awareness by combining Masked Image Modeling (MIM), global contrastive learning, and momentum-based self-distillation. Our approach achieves state-of-the-art performance on zero-shot segmentation benchmarks, including a 38.4% mIoU on COCO, demonstrating superior semantic discrimination compared to existing self-supervised models.
Introduction
In Natural Language Processing (NLP), large-scale models like GPT-4 have demonstrated remarkable "zero-shot" capabilities, performing complex tasks via simple prompting without task-specific fine-tuning. Conversely, Computer Vision (CV) has traditionally relied on expensive fine-tuning or linear probes to adapt pretrained models to downstream tasks. As vision models scale toward trillions of parameters, the computational cost of fine-tuning becomes prohibitive.
The central challenge in self-supervised CV is creating a model that understands objects well enough to recognize and segment them "out of the box." Current methods often face a trade-off: some capture global semantics but fail at pixel-level localization, while others excel at local reconstruction but lack the semantic coherence to distinguish between distinct objects. MMC addresses this by bridging the gap between global and local representations.
Methodology
MMC integrates three distinct learning strategies to produce a robust, semantically-aware visual representation:
- Masked Image Modeling (MIM): The model is tasked with reconstructing missing image patches, forcing it to learn internal object structures and local textures.
- Global Contrastive Learning: By matching different views of the same image while distancing them from different images, the model anchors high-level semantic meaning in the
CLStoken. - Momentum-based Self-Distillation: This serves as the critical bridge, transferring high-level semantic knowledge from the global
CLStoken down to individual local patches, ensuring that local features are semantically consistent with the whole object.
The Zero-Shot Protocol
To evaluate the model's semantic understanding without fine-tuning, we propose a "prompting patch" evaluation. In this protocol, a user selects a single patch (a visual "click") on a target object. The model then calculates the cosine similarity between the feature vector of that patch and all other patches in the image. By applying a simple threshold to the resulting similarity map, the model generates a zero-shot segmentation mask.
Experimental Results
MMC was pretrained on ImageNet-1K and evaluated across several benchmarks for zero-shot and linear performance.
- Zero-shot Segmentation: On the COCO dataset, MMC achieved a 38.4% mIoU, significantly outperforming DINO (35.1%) and iBOT (36.2%).
- Video Object Segmentation: On the DAVIS-2017 benchmark, MMC (ViT-B) reached 63.8% J&Fm, demonstrating superior temporal consistency and object tracking compared to standard supervised and self-supervised baselines.
- Linear Probing: When evaluated via a linear layer for semantic segmentation, MMC outperformed iBOT by 2.3% on ADE20K and 1.9% on Cityscapes, indicating that its features are more linearly separable and task-ready.
Key Insights
The Discrimination Gap
Analysis of standard reconstruction-based models (like MAE) revealed a high "inter-object similarity," where models struggle to distinguish object patches from background patches. MMC mitigates this by "painting" semantic meaning onto local patches through momentum distillation, effectively reducing the discrimination gap.
Layer-wise Specialization
Visualization of the reconstruction process indicates that different layers of the ViT specialize in distinct tasks. For instance, Layer 10 typically handles coarse structure and filling large gaps, while Layers 11 and 12 focus on refining fine details and object boundaries.
Conclusion and Future Work
MMC demonstrates that combining global contrastive objectives with local reconstruction and distillation can unlock zero-shot capabilities in vision models. Currently, the model's resolution is limited by its 16x16 patch size, leading to occasionally "blocky" masks. Future research will explore hierarchical Vision Transformers to achieve finer, pixel-perfect segmentation and expand the prompting interface to include multi-point and bounding box inputs.
Summary updated