Contrasting Contrastive Self-Supervised Representation Learning Models

Klemen Kotar, Gabriel Ilharco, Ludwig Schmidt, Kiana Ehsani, Roozbeh Mottaghi

Abstract

In the past few years, we have witnessed remarkable breakthroughs in self-supervised representation learning. Despite the success and adoption of representations learned through this paradigm, much is yet to be understood about how different training methods and datasets influence performance on downstream tasks. In this paper, we analyze contrastive approaches as one of the most successful and popular variants of self-supervised representation learning. We perform this analysis from the perspective of the training algorithms, pre-training datasets and end tasks. We examine over 700 training experiments including 30 encoders, 4 pre-training datasets and 20 diverse downstream tasks. Our experiments address various questions regarding the performance of self-supervised models compared to their supervised counterparts, current benchmarks used for evaluation, and the effect of the pre-training data on end task performance. Our Visual Representation Benchmark (ViRB) is available at: https://github.com/allenai/virb.

Introduction

Self-supervised representation learning (SSL) has reached a pivotal point where models can learn from unlabeled data to achieve performance levels near supervised learning. However, the field has largely relied on a narrow evaluation protocol: pre-training on ImageNet and testing on ImageNet classification. This creates a "blind spot" in our understanding of model generalization. Because ImageNet is object-centric and semantic, it remains unclear if these learned representations generalize to "structural" tasks involving geometry or motion, or if they are simply overfitting to ImageNet-like features.

Methodology

To systematically evaluate the state of SSL, we introduce the Visual Representation Benchmark (ViRB). This framework allows us to analyze the interplay between three main variables:

  1. Training Algorithms: We compare four state-of-the-art methods: PIRL, MoCov1, MoCov2, and SwAV.
  2. Pre-training Datasets: Models are tested on ImageNet (object-centric), Places (scene-centric), Taskonomy (indoor scenes), and Kinetics (action-centric).
  3. End Tasks: We evaluate performance across 20 diverse tasks, categorized by their output (image-level vs. pixel-wise) and nature (semantic vs. structural).
Overview of the ViRB benchmark, illustrating the interplay between training algorithms, pre-training datasets, and diverse end tasks.

To ensure a fair comparison and isolate the quality of the learned representation, we fix the backbone architecture to a standard ResNet-50 and keep it frozen during downstream task training, only learning small task-specific "heads."

Key Insights and Analysis

Our large-scale empirical study reveals several critical findings that challenge standard evaluation metrics:

  • ImageNet Accuracy is Not Universal: While ImageNet performance correlates well with other semantic image-level tasks, it has a weak or even negative correlation with structural tasks. A model optimized for object recognition may perform poorly on depth estimation or optical flow.
  • Algorithm Specialization: Different SSL algorithms capture different types of information. MoCov2 tends to perform better on pixel-wise structural tasks, suggesting it retains more low-level spatial detail. In contrast, SwAV excels at semantic classification, likely because its clustering-based approach learns higher-level abstractions.
  • Robustness to Imbalance: Surprisingly, training on highly unbalanced datasets (mimicking real-world long-tailed distributions) resulted in representations as effective as those learned from perfectly balanced data.

Results

Self-supervised encoders demonstrated remarkable versatility, outperforming the supervised ImageNet baseline on 17 out of 20 tasks. The only exceptions were tasks extremely similar to ImageNet classification itself.

Relative performance improvement of the best self-supervised model over the supervised baseline across 20 downstream tasks.

Structural tasks saw the most significant relative improvements. For instance, on KITTI Optical Flow and CLEVR object counting, SSL models improved performance by over 30% relative to the supervised baseline. These results suggest that SSL models serve as more robust, general-purpose encoders than their supervised counterparts.

Conclusion

This study highlights that the current reliance on ImageNet classification as a primary metric for SSL is insufficient. While SSL models show great promise as general-purpose encoders, their performance is highly dependent on the alignment between the pre-training objective and the requirements of the downstream task. Future work should explore the impact of different network architectures, such as Vision Transformers, and the effects of fine-tuning the backbone on these diverse tasks.

Summary updated

BibTeX
@inproceedings{kotar2021contrasting,
  author = {Klemen Kotar and Gabriel Ilharco and Ludwig Schmidt and Kiana Ehsani and Roozbeh Mottaghi},
  title = {{Contrasting Contrastive Self-Supervised Representation Learning Models}},
  booktitle = {IEEE/CVF International Conference on Computer Vision},
  year = {2021},
  url = {https://openreview.net/forum?id=gqd6daS2pEk},
}
Figure