Tokens-to-Token ViT: Training Vision Transformers from Scratch on ImageNet
Open accessAbstract
Transformers, which are popular for language modeling, have been explored for solving vision tasks recently, e.g., the Vision Transformer (ViT) for image classification. The ViT model splits each image into a sequence of tokens with fixed length and then applies multiple Transformer layers to model their global relation for classification. However, ViT achieves inferior performance to CNNs when trained from scratch on a midsize dataset like ImageNet. We find it is because: 1) the simple tokenization of input images fails to model the important local structure such as edges and lines among neighboring pixels, leading to low training sample efficiency; 2) the redundant attention backbone design of ViT leads to limited feature richness for fixed computation budgets and limited training samples. To overcome such limitations, we propose a new Tokens-To-Token Vision Transformer (T2T-ViT), which incorporates 1) a layer-wise Tokens-to-Token (T2T) transformation to progressively structurize the image to tokens by recursively aggregating neighboring Tokens into one Token (Tokens-to-Token), such that local structure represented by surrounding tokens can be modeled and tokens length can be reduced; 2) an efficient backbone with a deep-narrow structure for vision transformer motivated by CNN architecture design after empirical study. Notably, T2T-ViT reduces the parameter count and MACs of vanilla ViT by half, while achieving more than 3.0\% improvement when trained from scratch on ImageNet. It also outperforms ResNets and achieves comparable performance with MobileNets by directly training on ImageNet. For example, T2T-ViT with comparable size to ResNet50 (21.5M parameters) can achieve 83.3\% top1 accuracy in image resolution 384$\times$384 on ImageNet. (Code: https://github.com/yitu-opensource/T2T-ViT)
The claims and statistics of this paper haven’t been checked yet.
Run the check — free, no account needed. It reads the open-access text and checks the sources it cites.
Integrity signals
Registry
Cites
Statistics
Claims the paper makes
The claims and statistics of this paper haven’t been checked yet.
Run the check — free, no account needed. It reads the open-access text and checks the sources it cites.
Self-check
Percentages, sums and reported differences re-computed from the paper’s own numbers.
The self-check needs the paper’s full text.
No citation lists for this paper
No citation lists for this paper yet — checked again daily.
References 66 · Cited by 2,415
Research works printed but not linked: 59
- I. Bello, B. Zoph, A. Vaswani, J. Shlens, and Q. V. Le. At- tention augmented convolutional networks. In Proceedings of the IEEE International Conference on Computer Vision, pages 3286-3295, 2019.
- T. B. Brown, B. Mann, N. Ryder, M. Subbiah, J. Kaplan, P. Dhariwal, A. Neelakantan, P. Shyam, G. Sastry, A. Askell, et al. Language models are few-shot learners. arXiv preprint arXiv:2005.14165, 2020. · arXiv
- N. Carion, F. Massa, G. Synnaeve, N. Usunier, A. Kirillov, and S. Zagoruyko. End-to-end object detection with trans- formers. arXiv preprint arXiv:2005.12872, 2020. · arXiv
- H. Chen, Y. Wang, T. Guo, C. Xu, Y. Deng, Z. Liu, S. Ma, C. Xu, C. Xu, and W. Gao. Pre-trained image processing transformer. arXiv preprint arXiv:2012.00364, 2020. · arXiv
- M. Chen, A. Radford, R. Child, J. Wu, H. Jun, D. Luan, and I. Sutskever. Generative pretraining from pixels. In Interna- tional Conference on Machine Learning, pages 1691-1703. PMLR, 2020.
- Y. Chen, Y. Kalantidis, J. Li, S. Yan, and J. Feng. Aˆ2-nets: Double attention networks. In Advances in neural informa- tion processing systems, pages 352-361, 2018.
- K. Choromanski, V. Likhosherstov, D. Dohan, X. Song, A. Gane, T. Sarlos, P. Hawkins, J. Davis, A. Mohiuddin, L. Kaiser, et al. Rethinking attention with performers. arXiv preprint arXiv:2009.14794, 2020. · arXiv
- Z. Dai, B. Cai, Y. Lin, and J. Chen. Up-detr: Unsupervised pre-training for object detection with transformers. arXiv preprint arXiv:2011.09094, 2020. · arXiv
- J. Deng, W. Dong, R. Socher, L.-J. Li, K. Li, and L. Fei- Fei. Imagenet: A large-scale hierarchical image database. In 2009 IEEE conference on computer vision and pattern recognition, pages 248-255. Ieee, 2009.
- J. Devlin, M.-W. Chang, K. Lee, and K. Toutanova. Bert: Pre-training of deep bidirectional transformers for language understanding. arXiv preprint arXiv:1810.04805, 2018. · arXiv
- T. DeVries and G. W. Taylor. Improved regularization of convolutional neural networks with cutout. arXiv preprint arXiv:1708.04552, 2017. · arXiv
- A. Dosovitskiy, L. Beyer, A. Kolesnikov, D. Weissenborn, X. Zhai, T. Unterthiner, M. Dehghani, M. Minderer, G. Heigold, S. Gelly, et al. An image is worth 16x16 words: Transformers for image recognition at scale. arXiv preprint arXiv:2010.11929, 2020. · arXiv
- J. Fu, J. Liu, H. Tian, Y. Li, Y. Bao, Z. Fang, and H. Lu. Dual attention network for scene segmentation. In Proceed- ings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 3146-3154, 2019.
- K. Han, Y. Wang, Q. Tian, J. Guo, C. Xu, and C. Xu. Ghost- net: More features from cheap operations. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 1580-1589, 2020.
- K. He, X. Zhang, S. Ren, and J. Sun. Deep residual learn- ing for image recognition. In Proceedings of the IEEE con- ference on computer vision and pattern recognition, pages 770-778, 2016.
- G. Hinton, O. Vinyals, and J. Dean. Distilling the knowledge in a neural network. arXiv preprint arXiv:1503.02531, 2015. · arXiv
- A. G. Howard, M. Zhu, B. Chen, D. Kalenichenko, W. Wang, T. Weyand, M. Andreetto, and H. Adam. Mobilenets: Effi- cient convolutional neural networks for mobile vision appli- cations. arXiv preprint arXiv:1704.04861, 2017. · arXiv
- H. Hu, Z. Zhang, Z. Xie, and S. Lin. Local relation networks for image recognition. In Proceedings of the IEEE Inter- national Conference on Computer Vision, pages 3464-3473, 2019.
- J. Hu, L. Shen, S. Albanie, G. Sun, and A. Vedaldi. Gather- excite: Exploiting feature context in convolutional neural networks. Advances in neural information processing sys- tems, 31:9401-9411, 2018.
- J. Hu, L. Shen, and G. Sun. Squeeze-and-excitation net- works. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 7132-7141, 2018.
- G. Huang, Z. Liu, L. Van Der Maaten, and K. Q. Wein- berger. Densely connected convolutional networks. In Pro- ceedings of the IEEE conference on computer vision and pat- tern recognition, pages 4700-4708, 2017.
- A. Krizhevsky, I. Sutskever, and G. E. Hinton. Imagenet clas- sification with deep convolutional neural networks. Commu- nications of the ACM, 60(6):84-90, 2017.
- Y. Liu, M. Ott, N. Goyal, J. Du, M. Joshi, D. Chen, O. Levy, M. Lewis, L. Zettlemoyer, and V. Stoyanov. Roberta: A ro- bustly optimized bert pretraining approach. arXiv preprint arXiv:1907.11692, 2019. · arXiv
- I. Loshchilov and F. Hutter. Sgdr: Stochastic gradient de- scent with warm restarts. arXiv preprint arXiv:1608.03983, 2016. · arXiv
- I. Loshchilov and F. Hutter. Decoupled weight decay regu- larization. arXiv preprint arXiv:1711.05101, 2017. · arXiv
- T. Mikolov, K. Chen, G. Corrado, and J. Dean. Efficient estimation of word representations in vector space. arXiv preprint arXiv:1301.3781, 2013. · arXiv
- N. Parmar, A. Vaswani, J. Uszkoreit, Ł. Kaiser, N. Shazeer, A. Ku, and D. Tran. Image transformer. arXiv preprint arXiv:1802.05751, 2018. · arXiv
- A. Paszke, S. Gross, F. Massa, A. Lerer, J. Bradbury, G. Chanan, T. Killeen, Z. Lin, N. Gimelshein, L. Antiga, et al. Pytorch: An imperative style, high-performance deep learning library. In Advances in neural information process- ing systems, pages 8026-8037, 2019.
- M. E. Peters, M. Neumann, R. L. Logan IV, R. Schwartz, V. Joshi, S. Singh, and N. A. Smith. Knowledge en- hanced contextual word representations. arXiv preprint arXiv:1909.04164, 2019. · arXiv
- P. Ramachandran, N. Parmar, A. Vaswani, I. Bello, A. Lev- skaya, and J. Shlens. Stand-alone self-attention in vision models. arXiv preprint arXiv:1906.05909, 2019. · arXiv
- M. Sandler, A. Howard, M. Zhu, A. Zhmoginov, and L.-C. Chen. Mobilenetv2: Inverted residuals and linear bottle- necks. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 4510-4520, 2018.
- K. Simonyan and A. Zisserman. Very deep convolutional networks for large-scale image recognition. arXiv preprint arXiv:1409.1556, 2014. · arXiv
- Z. Sun, S. Cao, Y. Yang, and K. Kitani. Rethinking transformer-based set prediction for object detection. arXiv preprint arXiv:2011.10881, 2020. · arXiv
- C. Szegedy, V. Vanhoucke, S. Ioffe, J. Shlens, and Z. Wojna. Rethinking the inception architecture for computer vision. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 2818-2826, 2016.
- H. Touvron, M. Cord, M. Douze, F. Massa, A. Sablay- rolles, and H. Jégou. Training data-efficient image trans- formers & distillation through attention. arXiv preprint arXiv:2012.12877, 2020. · arXiv
- A. Vaswani, N. Shazeer, N. Parmar, J. Uszkoreit, L. Jones, A. N. Gomez, Ł. Kaiser, and I. Polosukhin. Attention is all you need. Advances in neural information processing sys- tems, 30:5998-6008, 2017.
- F. Wang, M. Jiang, C. Qian, S. Yang, C. Li, H. Zhang, X. Wang, and X. Tang. Residual attention network for im- age classification. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 3156-3164, 2017.
- X. Wang, R. Girshick, A. Gupta, and K. He. Non-local neu- ral networks. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 7794-7803, 2018.
- Y. Wang, Z. Xu, X. Wang, C. Shen, B. Cheng, H. Shen, and H. Xia. End-to-end video instance segmentation with trans- formers. arXiv preprint arXiv:2011.14503, 2020. · arXiv
- S. Woo, J. Park, J.-Y. Lee, and I. So Kweon. Cbam: Convo- lutional block attention module. In Proceedings of the Eu- ropean conference on computer vision (ECCV), pages 3-19, 2018.
- B. Wu, C. Xu, X. Dai, A. Wan, P. Zhang, M. Tomizuka, K. Keutzer, and P. Vajda. Visual transformers: Token-based image representation and processing for computer vision. arXiv preprint arXiv:2006.03677, 2020. · arXiv
- S. Xie, R. Girshick, P. Dollár, Z. Tu, and K. He. Aggre- gated residual transformations for deep neural networks. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 1492-1500, 2017.
- F. Yang, H. Yang, J. Fu, H. Lu, and B. Guo. Learning texture transformer network for image super-resolution. In Proceed- ings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 5791-5800, 2020.
- Z. Yang, Z. Dai, Y. Yang, J. Carbonell, R. R. Salakhutdinov, and Q. V. Le. Xlnet: Generalized autoregressive pretraining for language understanding. In Advances in neural informa- tion processing systems, pages 5753-5763, 2019.
- Z. Yang, X. He, J. Gao, L. Deng, and A. Smola. Stacked at- tention networks for image question answering. In Proceed- ings of the IEEE conference on computer vision and pattern recognition, pages 21-29, 2016.
- L. Yuan, S. Chang, Z. Huang, Y. Zhou, Y. Chen, X. Nie, F. E. Tay, J. Feng, and S. Yan. A simple baseline for pose tracking in videos of crowed scenes. In Proceedings of the 28th ACM International Conference on Multimedia, pages 4684-4688, 2020.
- L. Yuan, F. E. Tay, G. Li, T. Wang, and J. Feng. Revisiting knowledge distillation via label smoothing regularization. In Proceedings of the IEEE/CVF Conference on Computer Vi- sion and Pattern Recognition, pages 3903-3911, 2020.
- L. Yuan, Y. Zhou, S. Chang, Z. Huang, Y. Chen, X. Nie, T. Wang, J. Feng, and S. Yan. Toward accurate person-level action recognition in videos of crowed scenes. In Proceed- ings of the 28th ACM International Conference on Multime- dia, pages 4694-4698, 2020.
- S. Yun, D. Han, S. J. Oh, S. Chun, J. Choe, and Y. Yoo. Cut- mix: Regularization strategy to train strong classifiers with localizable features. In Proceedings of the IEEE/CVF Inter- national Conference on Computer Vision, pages 6023-6032, 2019.
- S. Zagoruyko and N. Komodakis. Wide residual networks. arXiv preprint arXiv:1605.07146, 2016. · arXiv
- Y. Zeng, J. Fu, and H. Chao. Learning joint spatial-temporal transformations for video inpainting. In European Confer- ence on Computer Vision, pages 528-543. Springer, 2020.
- H. Zhang, M. Cisse, Y. N. Dauphin, and D. Lopez-Paz. mixup: Beyond empirical risk minimization. arXiv preprint arXiv:1710.09412, 2017. · arXiv
- H. Zhao, J. Jia, and V. Koltun. Exploring self-attention for image recognition. In Proceedings of the IEEE/CVF Con- ference on Computer Vision and Pattern Recognition, pages 10076-10085, 2020.
- H. Zhao, L. Jiang, J. Jia, P. Torr, and V. Koltun. Point trans- former. arXiv preprint arXiv:2012.09164, 2020. · arXiv
- H. Zhao, Y. Zhang, S. Liu, J. Shi, C. Change Loy, D. Lin, and J. Jia. Psanet: Point-wise spatial attention network for scene parsing. In Proceedings of the European Conference on Computer Vision (ECCV), pages 267-283, 2018.
- M. Zheng, P. Gao, X. Wang, H. Li, and H. Dong. End-to-end object detection with adaptive clustering transformer. arXiv preprint arXiv:2011.09315, 2020. · arXiv
- D. Zhou, X. Jin, Q. Hou, K. Wang, J. Yang, and J. Feng. Neu- ral epitome search for architecture-agnostic network com- pression. In International Conference on Learning Repre- sentations, 2019.
- L. Zhou, Y. Zhou, J. J. Corso, R. Socher, and C. Xiong. End-to-end dense video captioning with masked transformer. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 8739-8748, 2018.
- X. Zhu, W. Su, L. Lu, B. Li, X. Wang, and J. Dai. De- formable detr: Deformable transformers for end-to-end ob- ject detection. arXiv preprint arXiv:2010.04159, 2020. · arXiv
- Authors
- Yuan, L., Chen, Y., Wang, T., Yu, W., Shi, Y., Jiang, Z., Tay, F. E., Feng, J., & Yan, S.
- Affiliations
- National University of Singapore (SG)
- Venue
- arXiv
- Publisher
- arXiv
- Published
- 2021
- Pages
- 538-547
- arXiv
- 2101.11986
- OpenAlex
- W3121523901
- Cited by
- 2,415
- References
- 66
- Citations by year
- 2026: 191 · 2025: 530 · 2024: 529 · 2023: 617 · 2022: 392 · 2021: 156
- FWCI
- 138.26
- Type
- conference paper
- Language
- en
- Open access
- green
- arxiv.org
- Locations
- IEEE/CVF International Conference on Computer Vision (ICCV) (publishedVersion)
- arXiv (Cornell University) (submittedVersion)
- arXiv (Cornell University)
- Topics
- Physical Sciences › Computer Science › Computer Vision and Pattern Recognition › Advanced Neural Network Applications
- Physical Sciences › Computer Science › Artificial Intelligence › Domain Adaptation and Few-Shot Learning
- Physical Sciences › Computer Science › Computer Vision and Pattern Recognition › Visual Attention and Saliency Detection
- Keywords
- vision transformer, image classification, tokenization, training from scratch, ImageNet, parameter efficiency, attention mechanism
About these checks
Registry, retraction, Cites and statistics results are computed, not judged, with one exception: a printed reference that no index lists is read once by a model before it counts as a citation error. Claims are extracted by a model and kept only when their quote appears verbatim in the text; each cited source is then checked, with a model’s help, for whether it says what the claim relies on. Those verdicts can be wrong — read the claim’s quote and the cited source before relying on one.
Statistics and arithmetic are recomputed, not judged.
Confidence bands are shown only for fields calibrated on our annotated test set. None is calibrated yet, so no band is shown.
What counts as a claim ›How we measure confidence ›How we check this ›
Are you an author, or do you see a problem with this page? Request a review