# MoCo (2019)

> Built a large, consistent queue of negative keys with a slowly moving momentum encoder so unsupervised pretraining beat supervised ImageNet on transfer.

Page: https://mralbu.github.io/ai-datasets/p/moco

## Key facts

- Title: Momentum Contrast for Unsupervised Visual Representation Learning
- Authors: Kaiming He, Haoqi Fan, Yuxin Wu, Saining Xie, Ross Girshick
- Venue: CVPR 2020
- Category: Vision
- Paper: https://www.alphaxiv.org/abs/1911.05722

## Why it matters

For years, self-supervised vision features trailed supervised ImageNet pretraining whenever transferred to real downstream tasks. MoCo was the turning point showing that contrastive pretraining on unlabeled photos could surpass supervised pretraining on detection and segmentation, and its momentum encoder became a fixture across later SSL methods.

## The idea

Frame contrastive learning as matching two crops of the same image against a large dictionary of other images. Keep the dictionary as a rolling queue of 65,536 past embeddings—decoupling its size from the GPU batch size—and encode the keys with an exponential moving average of the query network so old keys stay consistent with new ones.

## The result

60.6% linear top-1 on ImageNet with ResNet-50 (68.6% with ResNet-50 4×) and stronger transfer than supervised ImageNet pretraining on seven detection and segmentation benchmarks across PASCAL VOC, COCO and Cityscapes.

## The data

- [ImageNet (ILSVRC) (2009)](https://mralbu.github.io/ai-datasets/d/imagenet.md): 1.28 million photos across 1,000 classes, the dataset behind the deep learning boom.
- [PASCAL VOC (2005)](https://mralbu.github.io/ai-datasets/d/pascal-voc.md): The 20-class object-detection challenge that ran every year from 2005 to 2012.
- [MS COCO (2014)](https://mralbu.github.io/ai-datasets/d/coco.md): 330k everyday scenes with 1.5M labeled objects in 80 categories.
- [Cityscapes (2016)](https://mralbu.github.io/ai-datasets/d/cityscapes.md): 5,000 street photos from 50 cities, every pixel labeled as road, car, person, sky and so on.

## Builds on

- [ResNet (2015)](https://mralbu.github.io/ai-datasets/p/resnet.md)

## Led to

- [BYOL (2020)](https://mralbu.github.io/ai-datasets/p/byol.md)
- [SimCLR (2020)](https://mralbu.github.io/ai-datasets/p/simclr.md)
- [MAE (2021)](https://mralbu.github.io/ai-datasets/p/mae.md)

## Part of

- [Self-supervised vision](https://mralbu.github.io/ai-datasets/t/self-supervised-vision.md) (step 1 of 6)
