All Tokens Matter: Token Labeling for Training Better Vision Transformers
Zihang Jiang, Qibin Hou, Li Yuan, Daquan Zhou, Yujun Shi, Xiaojie Jin, Anran Wang, Jiashi Feng
Abstract
In this paper, we present token labeling -- a new training objective for training high-performance vision transformers (ViTs). Different from the standard training objective of ViTs that computes the classification loss on an additional trainable class token, our proposed one takes advantage of all the image patch tokens to compute the training loss in a dense manner. Specifically, token labeling reformulates the image classification problem into multiple token-level recognition problems and assigns each patch token with an individual location-specific supervision generated by a machine annotator. Experiments show that token labeling can clearly and consistently improve the performance of various ViT models across a wide spectrum. For a vision transformer with 26M learnable parameters serving as an example, with token labeling, the model can achieve 84.4% Top-1 accuracy on ImageNet. The result can be further increased to 86.4% by slightly scaling the model size up to 150M, delivering the minimal-sized model among previous models (250M+) reaching 86%. We also show that token labeling can clearly improve the generalization capability of the pre-trained models on downstream tasks with dense prediction, such as semantic segmentation. Our code and all the training details will be made publicly available at https://github.com/zihangJiang/TokenLabeling.
Ask Lune
Know this paper in minutes, not an afternoon.
Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.
62 top-tier papers have cited it since. Know what they found before your reviewers do.
Lune can draw on
the full paper · the top-tier papers that cite it · related work
Free to start. No credit card required.
Lineage
- Masked Feature Prediction for Self-Supervised Visual Pre-Training cites An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
- Masked Feature Prediction for Self-Supervised Visual Pre-Training cites Language Models are Few-Shot Learners
- Masked Feature Prediction for Self-Supervised Visual Pre-Training cites Training data-efficient image transformers & distillation through attention
- Rethinking Mobile Block for Efficient Attention-based Models cites An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
- Rethinking Mobile Block for Efficient Attention-based Models cites Swin Transformer: Hierarchical Vision Transformer using Shifted Windows
- Rethinking Mobile Block for Efficient Attention-based Models cites CSWin Transformer: A General Vision Transformer Backbone with Cross-Shaped Windows
- Rethinking Mobile Block for Efficient Attention-based Models cites Training data-efficient image transformers & distillation through attention
- An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale cites Language Models are Few-Shot Learners
- Swin Transformer: Hierarchical Vision Transformer using Shifted Windows cites An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
- Swin Transformer: Hierarchical Vision Transformer using Shifted Windows cites Training data-efficient image transformers & distillation through attention
- Swin Transformer: Hierarchical Vision Transformer using Shifted Windows cites Deformable DETR: Deformable Transformers for End-to-End Object Detection
- Rep ViT: Revisiting Mobile CNN From ViT Perspective cites An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
- Rep ViT: Revisiting Mobile CNN From ViT Perspective cites Swin Transformer: Hierarchical Vision Transformer using Shifted Windows
- Rep ViT: Revisiting Mobile CNN From ViT Perspective cites MViTv2: Improved Multiscale Vision Transformers for Classification and Detection
- Rep ViT: Revisiting Mobile CNN From ViT Perspective cites CSWin Transformer: A General Vision Transformer Backbone with Cross-Shaped Windows
- Rep ViT: Revisiting Mobile CNN From ViT Perspective cites Training data-efficient image transformers & distillation through attention
- MViTv2: Improved Multiscale Vision Transformers for Classification and Detection cites An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
- MViTv2: Improved Multiscale Vision Transformers for Classification and Detection cites Swin Transformer: Hierarchical Vision Transformer using Shifted Windows
- MViTv2: Improved Multiscale Vision Transformers for Classification and Detection cites CSWin Transformer: A General Vision Transformer Backbone with Cross-Shaped Windows
- MViTv2: Improved Multiscale Vision Transformers for Classification and Detection cites Training data-efficient image transformers & distillation through attention
- CSWin Transformer: A General Vision Transformer Backbone with Cross-Shaped Windows cites An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
- CSWin Transformer: A General Vision Transformer Backbone with Cross-Shaped Windows cites Swin Transformer: Hierarchical Vision Transformer using Shifted Windows
- CSWin Transformer: A General Vision Transformer Backbone with Cross-Shaped Windows cites Training data-efficient image transformers & distillation through attention
- CSWin Transformer: A General Vision Transformer Backbone with Cross-Shaped Windows cites Deformable DETR: Deformable Transformers for End-to-End Object Detection
- Training data-efficient image transformers & distillation through attention cites An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
Cited by top-tier papers62
- CSWin Transformer: A General Vision Transformer Backbone with Cross-Shaped WindowsXiaoyi Dong, Jianmin Bao, Dongdong Chen, Weiming Zhang et al.CVPR 2022 · 1,207 citations
- MViTv2: Improved Multiscale Vision Transformers for Classification and DetectionYanghao Li, Chao-Yuan Wu, Haoqi Fan, Karttikeya Mangalam et al.CVPR 2022 · 699 citations
- Masked Feature Prediction for Self-Supervised Visual Pre-TrainingChen Wei, Haoqi Fan, Saining Xie, Chao-Yuan Wu et al.CVPR 2022 · 524 citations
- Rep ViT: Revisiting Mobile CNN From ViT PerspectiveAo Wang, Hui Chen, Zijia Lin, Jungong Han et al.CVPR 2024 · 500 citations
- Rethinking Mobile Block for Efficient Attention-based ModelsJiangning Zhang, Xiangtai Li, Jian Li, Liang Liu et al.ICCV 2023 · 223 citations
Builds on30
- Language Models are Few-Shot LearnersTom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah et al.NeurIPS 2020 · 64,255 citations
- Swin Transformer: Hierarchical Vision Transformer using Shifted WindowsZe Liu, Yutong Lin, Yue Cao, Han Hu et al.ICCV 2021 · 31,683 citations
- An Image is Worth 16x16 Words: Transformers for Image Recognition at ScaleAlexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn et al.ICLR 2021 · 21,477 citations
- Training data-efficient image transformers & distillation through attentionHugo Touvron, Matthieu Cord, Matthijs Douze, Francisco Massa et al.ICML 2021 · 8,974 citations
- Deformable DETR: Deformable Transformers for End-to-End Object DetectionXizhou Zhu, Weijie Su, Lewei Lu, Bin Li et al.ICLR 2021 · 7,353 citations
Related papers
- Fully Attentional Networks with Self-emerging Token LabelingBingyin Zhao, Zhiding Yu, Shiyi Lan, Yutao Cheng et al.ICCV 2023 · 7 citations
- Masked Image Modeling with Denoising ContrastKun Yi, Yixiao Ge, Xiaotong Li, Shusheng Yang et al.ICLR 2023 · 8 citations
- Positional Label for Self-Supervised Vision TransformerZhemin Zhang, Xun GongAAAI 2023 · 12 citations
- BEiT: BERT Pre-Training of Image TransformersHangbo Bao, Li Dong, Songhao Piao, Furu WeiICLR 2022 · 3,632 citations
- SATA: Spatial Autocorrelation Token Analysis for Enhancing the Robustness of Vision TransformersNick Nikzad, Yi Liao, Yongsheng Gao, Jun ZhouCVPR 2025
