# ViT (2020)

> Cut an image into 16×16 patches, treat them as words, and a plain Transformer matches the best convolutional networks.

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

## Key facts

- Title: An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
- Authors: Alexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn, Xiaohua Zhai, Thomas Unterthiner, Mostafa Dehghani, Matthias Minderer, Georg Heigold, Sylvain Gelly, Jakob Uszkoreit, Neil Houlsby
- Venue: ICLR 2021
- Category: Vision
- Paper: https://www.alphaxiv.org/abs/2010.11929

## Why it matters

ViT showed that the architecture behind language models works for images too, given enough data. That made it possible to use one kind of model for text, images and their combination, and most large vision and multimodal models since, from CLIP to today's vision-language models, use it.

## The idea

Flatten each 16×16 patch into a vector, add a position embedding, and feed the sequence to a standard Transformer encoder with no convolutions at all. Without the built-in assumptions of a convolutional network it needs more data, so it is pretrained on very large datasets first.

## The result

Pretrained on 300 million images, ViT-H/14 reached 88.55% top-1 on ImageNet. Trained on ImageNet alone, it fell behind comparable ResNets.

## 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.
- [CIFAR-10 (2009)](https://mralbu.github.io/ai-datasets/d/cifar10.md): 60,000 tiny 32×32 color images in 10 classes.

## Builds on

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

## Led to

- [CLIP (2021)](https://mralbu.github.io/ai-datasets/p/clip.md)
- [DINO (2021)](https://mralbu.github.io/ai-datasets/p/dino.md)
- [MAE (2021)](https://mralbu.github.io/ai-datasets/p/mae.md)
- [SegFormer (2021)](https://mralbu.github.io/ai-datasets/p/segformer.md)
- [Swin (2021)](https://mralbu.github.io/ai-datasets/p/swin.md)
- [PatchTST (2022)](https://mralbu.github.io/ai-datasets/p/patchtst.md)
- [DINOv2 (2023)](https://mralbu.github.io/ai-datasets/p/dinov2.md)
- [SAM (2023)](https://mralbu.github.io/ai-datasets/p/sam.md)
- [Qwen2-VL (2024)](https://mralbu.github.io/ai-datasets/p/qwen2-vl.md)

## Part of

- [Vision backbones](https://mralbu.github.io/ai-datasets/t/vision-backbones.md) (step 4 of 6)
