[25.01.23] An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale (ViT) - Paper-Reading-Study/2025 GitHub Wiki

Paper Reading Study Notes

General Information

  • Paper 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
  • Published In: ICLR
  • Year: 2021
  • Link: https://arxiv.org/pdf/2010.11929.pdf
  • Date of Discussion: 2025-01-23

Summary

  • Research Problem: The paper addresses the application of Transformer architectures, which are dominant in natural language processing (NLP), to computer vision tasks, specifically image classification. It aims to demonstrate that a pure Transformer, without convolutional neural networks (CNNs), can perform well on image recognition when applied directly to sequences of image patches.
  • Key Contributions: The main contribution is the introduction of the Vision Transformer (ViT), a model that applies a standard Transformer architecture directly to images by treating image patches as tokens. ViT achieves excellent results compared to state-of-the-art CNNs on multiple image recognition benchmarks when pre-trained on large datasets, while requiring fewer computational resources to train.
  • Methodology/Approach: The ViT model splits an image into fixed-size patches, linearly embeds each patch, adds position embeddings, and feeds the resulting sequence to a standard Transformer encoder. The model is pre-trained on large datasets (ImageNet-21k or JFT-300M) and fine-tuned on smaller datasets.
  • Results: ViT attains state-of-the-art or competitive results on various image recognition benchmarks, including ImageNet, CIFAR-100, and VTAB. The best model achieves 88.55% accuracy on ImageNet, demonstrating the effectiveness of large-scale pre-training for Transformers in vision tasks.

Discussion Points

  • Strengths: The paper presents a simple and effective way to apply Transformers to image recognition, achieving strong performance with reduced computational cost. The approach is innovative in its direct application of a pure Transformer to image patches without relying on CNNs. The scalability of the model with increased dataset size is also a significant strength.
  • Weaknesses: The model's performance is weaker when trained on smaller datasets without strong regularization, indicating a reliance on large-scale pre-training. The discussion also questioned the necessity of the class token and the meaningfulness of position embeddings when changing image resolutions during fine-tuning.
  • Key Questions:
    • Why was a class token used in the encoder, and is it necessary?
    • How does the model handle different image resolutions during fine-tuning, especially concerning the meaningfulness of position embeddings?
    • What is the rationale behind the specific method of dividing images into patches?
    • How does the model's performance compare when using relative positional embeddings instead of absolute ones?
  • Applications: The research has potential applications in various computer vision tasks beyond image classification, such as object detection and segmentation. It also opens possibilities for developing more efficient and scalable vision models.
  • Connections: The paper relates to other work on applying Transformers to vision tasks and builds upon the success of Transformers in NLP. It also connects to the broader trend of using self-attention mechanisms in various domains. The discussion also touched upon related models like CLIP and Segment Anything, highlighting the potential for further exploration in multi-modal learning and image segmentation.

Notes and Reflections

  • Interesting Insights: The observation that large-scale training trumps inductive biases inherent in CNNs is particularly interesting. The discussion also highlighted the potential of using relative positional embeddings and the connection between the model's attention mechanism and image segmentation tasks.
  • Lessons Learned: The study session underscored the importance of large-scale pre-training for Transformers in vision and the potential of a pure Transformer architecture to achieve state-of-the-art results in image recognition. It also emphasized the need to carefully consider the design choices, such as the use of class tokens and position embeddings.
  • Future Directions: Further research could explore the application of ViT to other vision tasks, investigate the use of self-supervised pre-training, and analyze the impact of different positional embedding schemes. Exploring the connection to models like CLIP and Segment Anything could also lead to advancements in multi-modal learning and image segmentation. The discussion also mentioned the potential of studying the "bidever" model from Alibaba for video processing and multi-modal learning.