Harmony: A Joint Self-Supervised and Weakly-Supervised Framework for Learning General Purpose Visual Representations

Mohammed Baharoon, Jonathan Klein, Dominik L. Michels · DOI

Introduction

The development of general-purpose visual representations has traditionally followed two distinct paths: Weakly-Supervised Learning (WSL) and Self-Supervised Learning (SSL). WSL frameworks, such as CLIP, leverage large-scale image-caption pairs to achieve impressive zero-shot classification capabilities but often lack the spatial awareness required for dense prediction tasks like object detection and semantic segmentation. Conversely, SSL methods like MAE and iBOT excel at learning localized features through reconstruction or distillation but lack broad semantic alignment.

Harmony addresses this dichotomy by introducing a unified pre-training framework that optimizes five distinct objectives simultaneously. By integrating discriminative and generative SSL with language supervision, Harmony produces representations that are both semantically rich and spatially precise.

Methodology: Five-Part Supervision

The Harmony framework utilizes a Vision Transformer (ViT) architecture trained on uncurated web data (e.g., CC3M and CC12M). Its core innovation lies in a multi-task objective function comprising five components:

  1. Soft-Target Contrastive Learning: Unlike standard CLIP, which assumes a strict one-to-one mapping between images and captions, Harmony employs an Exponential Moving Average (EMA) teacher model to generate "soft" targets. This accounts for the inherent noise in web-scraped data, where a single image may relate to multiple captions in a batch.
  2. Feature Self-distillation: Inspired by iBOT, this objective matches patch-level embeddings between student and teacher models to capture local structures.
  3. Pixel Reconstruction: Following the MAE approach, the model reconstructs masked image patches, forcing an understanding of geometry and texture.
  4. Masked Language Modeling (MLM): A BERT-style objective is applied to the text encoder to enhance linguistic understanding.
  5. Text Self-distillation: A novel application of iBOT-style distillation to the text encoder, further refining cross-modal alignment.

Experimental Results

Harmony was evaluated across a wide range of benchmarks, including ImageNet-1k for classification, ADE20K for semantic segmentation, and MS-COCO for object detection.

Performance comparison of Harmony against baseline models across classification, segmentation, and detection tasks.

As shown in the figure above, Harmony consistently outperforms baseline models such as CLIP, SLIP, MaskCLIP, DetailCLIP, and SILC across all evaluated tasks. Notably, the performance gap between Harmony and its competitors widens as the model scales from ViT-Small to ViT-Base. For instance, in ImageNet-1k zero-shot classification, Harmony (ViT-B) achieved 23.3% accuracy, a significant improvement over CLIP’s 19.0%. In dense prediction tasks, Harmony reached 48.1 mAP on MS-COCO object detection, compared to 42.5 for CLIP.

Discussion and Conclusion

The success of Harmony underscores the synergy between discriminative and generative self-supervision when paired with language-based weak supervision. By "softening" contrastive labels, the model becomes more robust to the noise prevalent in web-scale datasets. While Harmony requires approximately 2.5x more compute than standard CLIP, its superior data efficiency and scalability make it a compelling framework for next-generation visual representation learning. Future work will focus on further scaling the dataset and exploring comparisons with other large-scale SSL methods like DINOv2.

Summary updated

BibTeX
@article{baharoon2025harmony,
  author = {Mohammed Baharoon and Jonathan Klein and Dominik L. Michels},
  title = {{Harmony: A Joint Self-Supervised and Weakly-Supervised Framework for Learning General Purpose Visual Representations}},
  journal = {Accepted by TMLR},
  year = {2025},
  url = {https://openreview.net/forum?id=IcOBCufqFO},
}
Figure