# SimCLR: Strong augmentation, a projection head and large batches

> SimCLR treats two augmentations of an image as positives and others as negatives with NT-Xent. Ablations establish augmentation composition, nonlinear projection and batch size as central design choices.

- URL: https://dmxsf.com/en/blog/simclr-a-simple-framework-for-contrastive-learning-of-visual-representations/
- [DMXSF](https://dmxsf.com/en/about/)
- Published: 2020-02-23
- Updated: 2026-11-13
- Paper notes
- Paper: [A Simple Framework for Contrastive Learning of Visual Representations](https://arxiv.org/abs/2002.05709) (Ting Chen, Simon Kornblith, Mohammad Norouzi, et al. · ICML 2020, 2020)

SimCLR simplifies self-supervised vision without a memory bank or special architecture. Two transformed views pass through an encoder and a projection head.

## How it works

NT-Xent uses cosine similarity and temperature. Crop plus color distortion is especially important, the projection head protects backbone features, and large batches supply more in-batch negatives.

## What the evidence shows

ImageNet linear evaluation and fine-tuning approach contemporary supervised results with strong label efficiency. Large batches cost compute, and augmentations suited to natural images may destroy semantics in other domains.

## A reproducible check

This snippet checks a public formula or configuration; it does not reproduce full training.

```python
import math
def cosine(a,b):
    dot=sum(x*y for x,y in zip(a,b))
    return dot/(math.sqrt(sum(x*x for x in a))*math.sqrt(sum(y*y for y in b)))
print("positive cosine =", cosine([1,0],[0.8,0.2]))
print("negative cosine =", cosine([1,0],[-0.8,0.2]))
```

```text
positive cosine = 0.9701425001453318
negative cosine = -0.9701425001453318
```

The arithmetic is reproducible, but model quality still depends on the full experiments in the paper.

## Limitations and common misreadings

Learned invariances depend on augmentation. False negatives can belong to the same class, and linear-probe quality does not guarantee every downstream capability.

## The key takeaway

SimCLR’s contribution is the demonstrated interaction among augmentations, projection space and negative-sample scale, not the loss alone.

## Further reading

- [A Simple Framework for Contrastive Learning of Visual Representations](https://arxiv.org/abs/2002.05709)
- [CLIP](https://dmxsf.com/en/blog/clip-learning-transferable-visual-models/)
- [ViT](https://dmxsf.com/en/blog/vit-an-image-is-worth-16x16-words/)

## FAQ

### Where do positives come from?

Two independently augmented views of the same image.

### Why use a projection head?

It separates contrastive training from backbone representations and improves downstream quality.

### Why crop and color augmentation?

Together they define useful invariances and outperform either alone in the ablations.
