Back to paper library
arXiv 2020NeurIPS 2020Contrastive learningPaper notes

SimCLR v2

Big Models Matter

Original paper

Big Self-Supervised Models are Strong Semi-Supervised Learners

Paper authors

Ting Chen · Simon Kornblith · Kevin Swersky · Mohammad Norouzi · Geoffrey Hinton

Publication
NeurIPS 2020Conference
First submitted to arXiv
arXiv:2006.10029
Cite this paper · BibTeX

The citation identifies the linked source version. It cites the original paper and its authors.

@misc{contrastivelearningsimclrv22020,
  title = {{Big Self-Supervised Models are Strong Semi-Supervised Learners}},
  author = {Ting Chen and Simon Kornblith and Kevin Swersky and Mohammad Norouzi and Geoffrey Hinton},
  year = {2020},
  eprint = {2006.10029},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2006.10029}
}
On this page

FAIR showcased some muscle with their MoCo v2 paper, claiming that if you don’t have enough computational resources, their "momentum memory" solution can yield better results.

The SimCLR authors (Google Research), however, seem uninterested in continuing that debate. Instead, they turn their attention in another direction:

Let’s set aside the issue of computational resources and see what sparks can fly when a "self-supervised" contrastive learning framework is applied to large models.

Defining the Problem

At this point, the well-known GPT-3 paper has already been published on arXiv.

NLP already widely used unlabeled pretraining followed by supervised fine-tuning. GPT-3, however, specifically emphasized in-context few-shot learning without parameter updates, so it is not an example of fine-tuning on a small labeled set.

But in the CV field, why doesn’t this seem to be as popular?

Thus, the authors aimed to introduce "large-scale" unlabeled data for pre-training a model based on the SimCLR contrastive learning framework, and use a "small" amount of labeled data for supervised fine-tuning.

The experimental results were impressive, so it was named SimCLR v2.

Solving the Problem

This figure shows the architecture of SimCLR v2. The entire framework is divided into three main stages.

  1. Unsupervised Pretraining:

    In this stage, the model learns general visual features through contrastive learning.

    The basic method follows SimCLR: each image undergoes different augmentations to produce two views, and the model learns representations with the NT-Xent loss. SimCLR v2 also tests deeper and wider ResNets with selective kernels (SK), deeper projection heads, and a MoCo-inspired momentum network with a memory of negative examples.

    At this stage, the downstream task is not used to guide training: the model sees no labels. This is a task-agnostic use of the unlabeled images.

The formula above reviews the basic batch NT-Xent loss; SimCLR v2's memory mechanism also supplies stored negatives during pretraining.

  1. Supervised Fine-tuning:

    In this stage, the authors fine-tune the model with a small amount of labeled data to adapt the model to a specific classification task.

    Unlike SimCLR v1, which discards the entire MLP projection head, SimCLR v2 can retain its first few layers, attach the task classifier to an intermediate output, and fine-tune them together.

  1. Knowledge Distillation:

    In this stage, the authors apply knowledge distillation, where the student model learns from the teacher model to improve performance and compress model size. This process minimizes the difference in outputs between the student and teacher models using a distillation loss function.

    The mathematical expression is:

    Ldistill=−∑xi∈D∑yPT(y∣xi;τ)log⁡PS(y∣xi;τ)L_{\text{distill}} = - \sum_{x_i \in D} \sum_{y} P_T(y | x_i; \tau) \log P_S(y | x_i; \tau)

    Where:

    P(y∣xi)=exp⁡(ftask(xi)[y]/τ)∑y′exp⁡(ftask(xi)[y′]/τ)P(y | x_i) = \frac{\exp(f_{\text{task}}(x_i)[y] / \tau)}{\sum_{y'} \exp(f_{\text{task}}(x_i)[y'] / \tau)}
    • τ\tau is the distillation temperature, which adjusts the teacher and student output distributions. It belongs to a different training stage from the NT-Xent temperature above.

    When some labeled data is available, a weighted combination of the cross-entropy loss from the real labels and the distillation loss can be used:

    L=−(1−α)∑(xi,yi)∈DLlog⁡PS(yi∣xi)−α∑xi∈D∑yPT(y∣xi;τ)log⁡PS(y∣xi;τ)L = -(1 - \alpha) \sum_{(x_i, y_i) \in D_L} \log P_S(y_i | x_i) - \alpha \sum_{x_i \in D} \sum_{y} P_T(y | x_i; \tau) \log P_S(y | x_i; \tau)

    Where:

    • DLD_L is the labeled dataset.
    • α\alpha is the weighting factor, adjusting the ratio of real labels to distillation.

Discussion

Bigger Models Are More Label-Efficient

The authors first explore the impact of different sizes of ResNet models (changing network depth and width) on semi-supervised learning:

  • Smallest model: Standard ResNet-50.
  • Largest model: ResNet-152 (3× + SK).

In the table, the smallest and largest models reach 76.6% and 80.5% Top-1 accuracy under fully labeled supervised training, a 3.9-percentage-point gap. After self-supervised pretraining, linear evaluation gives 71.7% and 79.8%, an 8.1-point gap. Fine-tuning with 1% of the labels gives 57.9% and 74.9%, a 17.0-point gap.

Finally, when comparing ResNet-152 (3× + SK) with ResNet-152 (2× + SK), the number of model parameters nearly doubles, but the performance gain is not significant, suggesting that the benefits of increasing model width may have reached a bottleneck.

The following graph illustrates how model size and labeled data fraction affect model performance, exploring whether larger models are better at leveraging limited labeled data.

The graph shows accuracy improving with model size under both supervised and semi-supervised training. It compares only ResNet-50/101/152 at 1×/2× width without SK; under these settings, the gain from a larger semi-supervised model becomes more pronounced as labels become scarcer.

When labels are limited, the advantage of larger models is particularly clear. Table 1 also shows that with only 1% or 10% labeled data, a fine-tuned ResNet-152 (3×+SK) exceeds the standard ResNet-50; this SK model is not included in the graph above.

Although larger models perform better overall, certain architectures (such as Selective Kernel, SK) can achieve similar performance with fewer parameters, suggesting that exploring better model architectures is still a valuable direction, not just blindly increasing model size.

Deeper Projection Heads Perform Better

This section mainly investigates the impact of the MLP projection head in SimCLR v2 pretraining and fine-tuning.

  • Figure (a): Compares 2- to 4-layer projection heads after fine-tuning from the best intermediate layer in each setting. Under scarce labels, the deeper head usually performs better.
  • Figure (b): Compares the effect of fine-tuning starting from different layers. The results show that the best fine-tuning layer is usually the first layer of the projection head, rather than the input layer, especially when labeled data is sparse.

Finally, the authors observe in the appendix that when both the ResNet and projection head are wider, the extra benefit of more head layers is smaller. That comparison is not shown directly in the figure above.

Knowledge Distillation Effect

The above figure presents experimental results showing that knowledge distillation brings two main advantages:

  1. When the student model is smaller than the teacher model: Distillation transfers the teacher's task predictions to a smaller model; at a given student parameter count, the result shown is higher than direct fine-tuning.
  2. When the student and teacher have the same architecture (self-distillation): Even with the same ResNet architecture, the self-distilled result in the figure exceeds direct fine-tuning. The student here does not retain the teacher's MLP projection head.

Therefore, to obtain the best ResNet-50 model, the following strategy can be used:

  • Step 1: First self-distill the fine-tuned large ResNet-152 to improve its performance.
  • Step 2: Distill this teacher's task predictions into a smaller ResNet-50. The small models in Table 3 use a self-distilled ResNet-152 (3×+SK) teacher.

Comparison with Other Methods

In the table, the distilled SimCLR v2 ResNet-50 reaches 73.9%/77.5% Top-1 accuracy with 1%/10% labels; the self-distilled ResNet-152 (3×+SK) reaches 76.6%/80.9%. The compared methods have different backbones and ways of using unlabeled data, so these results are not a single-factor ablation.

This demonstrates that combining knowledge distillation with unlabeled data is an effective semi-supervised learning strategy, not only improving model accuracy but also allowing smaller models to maintain high performance.

Conclusion

The main research direction of SimCLR v2 is to explore "model performance with limited labeled data" and "the benefits of knowledge distillation."

Let’s summarize the semi-supervised learning framework proposed by the authors, which consists of three steps:

  1. Unsupervised Pretraining: Learn general image features through self-supervised learning.
  2. Supervised Fine-tuning: Adapt to a specific classification task using limited labeled data.
  3. Knowledge Distillation: Use unlabeled data and the teacher model’s soft labels to further enhance the student model’s performance.

This approach, while already common in NLP, remains an underexplored baseline in the CV domain. The authors' experimental results show that this method significantly outperforms existing SOTA methods on ImageNet.

The power of large models in CV is becoming increasingly evident.