Token-Label Alignment for Vision Transformers

Han Xiao, Wenzhao Zheng, Zheng Zhu, Jie Zhou, Jiwen Lu
10/12/2022
cs.CVcs.AIcs.LG
transformer-attention

Official code: Euphoria16/TL-Align (23 stars, Python, last commit 2023-07-16).

Abstract

Data mixing strategies (e.g., CutMix) have shown the ability to greatly improve the performance of convolutional neural networks (CNNs). They mix two images as inputs for training and assign them with a mixed label with the same ratio.

Show full abstract

While they are shown effective for vision transformers (ViTs), we identify a token fluctuation phenomenon that has suppressed the potential of data mixing strategies. We empirically observe that the contributions of input tokens fluctuate as forward propagating, which might induce a different mixing ratio in the output tokens. The training target computed by the original data mixing strategy can thus be inaccurate, resulting in less effective training. To address this, we propose a token-label alignment (TL-Align) method to trace the correspondence between transformed tokens and the original tokens to maintain a label for each token. We reuse the computed attention at each layer for efficient token-label alignment, introducing only negligible additional training costs. Extensive experiments demonstrate that our method improves the performance of ViTs on image classification, semantic segmentation, objective detection, and transfer learning tasks. Code is available at: https://github.com/Euphoria16/TL-Align.

View on arXivView PDF

Code Implementations(1)

[ICCV 2023]The PyTorch implementation of TL-Align: Token-Label Alignment for Vision Transformers.

231Python, ShellOct 11, 20223 years ago

Similar Papers

Cite this paper

@article{xiao2022tokenlabel,
  title  = {Token-Label Alignment for Vision Transformers},
  author = {Han Xiao and Wenzhao Zheng and Zheng Zhu and Jie Zhou and Jiwen Lu},
  year   = {2022},
  eprint = {2210.06455},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2210.06455}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2210.06455.svg)](https://codeofpaper.com/paper/2210.06455)

Discussion