Abstract
Vision-language contrastive learning frameworks such as CLIP enable learning representations from natural language supervision and provide strong zero-shot classification capabilities. However, due to the nature of the supervisory signal in these paradigms, they lack the ability to learn localized features, leading to degraded performance on dense prediction tasks such as segmentation and detection. On the other hand, self-supervised learning methods have shown the ability to learn granular representations, complementing the high-level features in vision-language training. In this work, we present Harmony, a framework that combines vision-language training with discriminative and generative self-supervision to learn visual features that can be generalized across different downstream vision tasks. Our framework is specifically designed to work on web-scraped data by not relying on negative examples in the self-supervised learning path and addressing the one-to-one correspondence issue using soft CLIP targets generated by an EMA model. Moreover, Harmony optimizes for five different objectives simultaneously, efficiently utilizing the supervision in each data example, making it even more suited in data-constrained settings. We comprehensively evaluate Harmony across various vision downstream tasks and find that it significantly outperforms the baseline CLIP and outperforms the previously leading joint self- and weakly supervised methods, SLIP, MaskCLIP, and DetailCLIP. Specifically, when compared against these methods, Harmony shows superior performance in linear-probing, fine-tuning, and zero-shot classification on ImageNet-1k, semantic segmentation on ADE20K, and both object detection and instance segmentation on MS-COCO, when pre-training a ViT-B on CC3M. We also show that Harmony outperforms SILC on detection, linear and fine-tuning classification, and outperforms other self-supervised learning methods like iBOT and MAE across all tasks evaluated.
Introduction
In the current computer vision landscape, two dominant paradigms exist: Vision-Language Models (VLMs) like CLIP, which excel at high-level semantic understanding and zero-shot classification, and Self-Supervised Learning (SSL) methods like MAE or iBOT, which are masters of spatial structure and local detail. However, VLMs are often "blind" to spatial localization, leading to poor performance on dense tasks like object detection, while SSL methods lack the broad semantic labels needed for zero-shot reasoning.
Harmony bridges this gap by introducing a multi-objective pre-training framework that coordinates five distinct vision and language objectives. By simultaneously optimizing for global semantics and local spatial awareness, it produces a general-purpose visual backbone that outperforms specialized models across a wide variety of tasks.
Methodology: The Harmony Framework
Harmony utilizes a "more is more" approach to training objectives, coordinating five different losses to ensure the model learns both high-level concepts and granular details:
- Soft-Target Contrastive Learning: Unlike standard CLIP, which assumes a strict one-to-one correspondence between images and captions, Harmony uses an Exponential Moving Average (EMA) teacher model to generate "soft" targets. This allows the model to recognize that an image may be semantically related to multiple captions in a batch, which is essential for noisy web-scraped data.
- Feature Self-Distillation: The model learns to match features across different "views" (crops) of the same image, fostering robust, invariant representations.
- Pixel Reconstruction: By forcing the model to reconstruct missing parts of an image (MAE-style), Harmony bakes in an understanding of spatial geometry and local texture.
- Masked Language Modeling (MLM): This objective improves the text encoder by predicting missing words in captions.
- Text Self-Distillation: Similar to the image side, the text encoder learns to match different views of the same caption.
Crucially, Harmony avoids using negative examples in its self-supervised path, making it more stable and effective when training on uncurated web data.
Key Results and Discussion
Harmony was pre-trained on the CC3M and CC12M datasets and evaluated across major benchmarks including ImageNet-1k, ADE20K (segmentation), and MS-COCO (detection). The framework consistently outperformed its predecessors across the board.
As shown in the figure above, Harmony (teal) achieves superior performance in Image Classification, Semantic Segmentation, and Object Detection compared to CLIP and other joint methods like SLIP, MaskCLIP, and SILC. Notable achievements include:
- Zero-Shot Mastery: Harmony (ViT-B) achieved 23.3% zero-shot accuracy on ImageNet-1k, significantly beating CLIP’s 19.0%.
- Dense Task Superiority: In object detection on MS-COCO, Harmony reached a box AP of 48.1, compared to CLIP’s 42.5.
- Scaling Efficiency: The performance gap between Harmony and CLIP actually widens as the Vision Transformer (ViT) size increases, suggesting that Harmony better utilizes the capacity of larger models.
Conclusion
While Harmony delivers state-of-the-art performance, it involves a trade-off in computational cost, requiring approximately 2.5x more memory and 4.2x more training time than a standard CLIP baseline. Future work will explore maintaining this performance lead on massive datasets like LAION-5B while optimizing the architecture to reduce training overhead.
The code for Harmony is publicly available at https://github.com/MohammedSB/Harmony.
Summary updated