An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
Alexey Dosovitskiy∗,†, Lucas Beyer∗, Alexander Kolesnikov∗, Dirk Weissenborn∗, Xiaohua Zhai∗, Thomas Unterthiner, Mostafa Dehghani, Matthias Minderer, Georg Heigold, Sylvain Gelly, Jakob Uszkoreit, Neil Houlsby∗,† ∗equal technical contribution, †equal advising Google Research, Brain Team {adosovitskiy,
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.111Fine-tuning code and pre-trained models are available at https://github.com/google-research/vision_transformer
中文速览
卷积神经网络(CNN)长期垄断计算机视觉任务,但研究者想知道:如果把自然语言处理中大放异彩的纯Transformer架构直接搬到图像上,能不能同样奏效?这篇论文提出了视觉Transformer(Vision Transformer,ViT),做法相当直接——把一张图切成固定大小的小块(patch),像处理文字序列一样把这些小块排成一列输入标准Transformer,不借助任何卷积结构。实验发现,如果只用中等规模数据集训练,ViT确实不如CNN,因为它缺乏CNN内置的局部性和平移不变性等先验知识;但一旦在超大规模数据集(如包含3亿张图的JFT-300M)上预训练,再迁移到下游任务,ViT就能达到甚至超过顶尖CNN的水平,在ImageNet上达到88.55%、CIFAR-100上达到94.55%,且所需训练算力显著更少。这项工作证明了"大数据可以弥补归纳偏置的不足",为后续计算机视觉领域全面拥抱Transformer奠定了基础。
原文 arXiv:2010.11929;中英对照 + 大白话阅读 https://aha.fim.ai/paper/2010.11929v2