AI Datasets
Esc

    ↑↓ move↵ open/ search from any page

    Papers / Vision

    ViT (2020)

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

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

    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.

    First page of “An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale”

    The first page, as published. Read the full paper, with summaries and discussion, on alphaxiv.org.

    Year
    2020
    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
    Data
    ImageNet (ILSVRC), CIFAR-10

    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.

    patch 1patch 2patch 103patch 104patch 105patch 106patch 107patch 108patch 109
    [class]12…103104105106107108109… 196→ Transformer encoder
    An ImageNet validation photo (a black swan), cropped to the central 224×224 pixels as in evaluation and cut into 14×14 = 196 patches of 16×16. ViT flattens each patch into a vector and reads them in order, row by row, like the words of a sentence, after a learned [class] token whose output is the prediction. Outlined: the first two patches and part of row 8.

    The data

    ImageNet (ILSVRC)

    2009

    1.28 million photos across 1,000 classes, the dataset behind the deep learning boom. (11 years earlier)

    CIFAR-10

    2009

    60,000 tiny 32×32 color images in 10 classes. (11 years earlier)

    Builds on

    • Transformer (2017): A translation model built only from attention, and the architecture behind every large language model since.
    • ResNet (2015): Skip connections that let networks grow from about 20 layers to more than 150.

    Led to

    • CLIP (2021): Learn images from 400 million captions found on the web, then classify anything you can name.
    • DINO (2021): Applied label-free student–teacher self-distillation to Vision Transformers and uncovered emergent object segmentation in their attention maps.
    • MAE (2021): Masked 75% of an image's patches and trained a Vision Transformer to reconstruct the missing pixels using an asymmetric encoder–decoder.
    • SegFormer (2021): Paired a hierarchical, position-free Vision Transformer encoder with a tiny all-MLP decoder.
    • Swin (2021): A Transformer that attends within small windows and merges patches as it goes deeper, so it can replace the ConvNet backbone in detection and segmentation.
    • PatchTST (2022): Cut each series into patches and treat them like words, and Transformers forecast better than the linear models that had just beaten them.
    • DINOv2 (2023): Combined image-level self-distillation with patch-level masked modeling on 142 million automatically curated images to produce frozen all-purpose vision features.
    • SAM (2023): A model that cuts out whatever you point at, in any image, trained on a billion masks.
    • Qwen2-VL (2024): Replaced fixed square crops and patch grids with Naive Dynamic Resolution and Multimodal RoPE so one ViT+LLM reads images and video at their native sizes.