CLIP (Contrastive Language-Image Pre-training) is a model that uses 400 million images and their captions collected from the internet to jointly train an image encoder and a text encoder with contrastive learning that predicts which image goes with which text. It was published in 2021 by Radford et al. at OpenAI. After training, it can classify a dataset's images without ever training on them, simply by turning class names into sentences and passing them through the text encoder (zero-shot classification).
Earlier image recognition models were trained to predict a fixed list of classes, such as the 1000 classes of ImageNet. With this kind of supervision, labeled data must be collected again every time a new kind of object needs to be recognized. Meanwhile, the internet holds huge amounts of images paired with captions, and text can express far broader concepts than "one of 1000 classes."
CLIP carried out this text-supervised learning at large scale. There are three key points.
- A dataset of 400 million pairs (WIT): image-text pairs were collected using 500,000 search queries derived from sources such as English Wikipedia, capped at 20,000 pairs per query to reduce imbalance.
- A contrastive objective: instead of generating the caption word by word, the model only has to predict which text in the mini-batch goes with which image. In the paper's comparison, this learns several times more efficiently than predicting the text.
- Zero-shot classification: after training, a sentence such as "A photo of a {class name}." is created for each class and passed through the text encoder, and the result serves directly as the weights of a classifier.
The largest model (ViT-L/14@336px) reached 76.2% accuracy on ImageNet without using a single ImageNet training image, matching the original ResNet-50 trained on 1.28 million labeled images. It was also shown to be far more robust than ImageNet-trained models on images that look different from ImageNet, such as paintings and sketches.

