An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale

Alexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn, Xiaohua Zhai +7 more
10/22/2020
cs.CVcs.AIcs.LG

Official code: google-research/vision_transformer (12,757 stars, Apache-2.0, last commit 2026-10-01).

Abstract

While the Transformer architecture has become the de-facto standard for natural language processing tasks, its applications to computer vision remain limited. In vision, attention is either applied in conjunction with convolutional networks, or used to replace certain components of convolutional networks while keeping their overall structure in place. We show that this reliance on CNNs is not necessary and a pure transformer applied directly to sequences of image patches can perform very well on image classification tasks. When pre-trained on large amounts of data and transferred to multiple mid-sized or small image recognition benchmarks (ImageNet, CIFAR-100, VTAB, etc.), Vision Transformer (ViT) attains excellent results compared to state-of-the-art convolutional networks while requiring substantially fewer computational resources to train.

View on arXivView PDF

Code Implementations(1)

Apache-2.0
12,7571,480Python, Jupyter NotebookOct 21, 20202 weeks agoApache-2.0

Cite this paper

@article{dosovitskiy2020image,
  title  = {An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale},
  author = {Alexey Dosovitskiy and Lucas Beyer and Alexander Kolesnikov and Dirk Weissenborn and Xiaohua Zhai and Thomas Unterthiner and Mostafa Dehghani and Matthias Minderer and Georg Heigold and Sylvain Gelly and Jakob Uszkoreit and Neil Houlsby},
  year   = {2020},
  eprint = {2010.11929},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2010.11929}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2010.11929.svg)](https://codeofpaper.com/paper/2010.11929)

Discussion