Vision Transformers with Patch Diversification

Chengyue Gong, Dilin Wang, Meng Li, Vikas Chandra, Qiang Liu
4/26/2021
cs.CVcs.LG
transformer-attention

Official code: ChengyueGongR/PatchVisionTransformer (74 stars, Jupyter Notebook, last commit 2022-12-08).

Abstract

Vision transformer has demonstrated promising performance on challenging computer vision tasks. However, directly training the vision transformers may yield unstable and sub-optimal results.

Show full abstract

Recent works propose to improve the performance of the vision transformers by modifying the transformer structures, e.g., incorporating convolution layers. In contrast, we investigate an orthogonal approach to stabilize the vision transformer training without modifying the networks. We observe the instability of the training can be attributed to the significant similarity across the extracted patch representations. More specifically, for deep vision transformers, the self-attention blocks tend to map different patches into similar latent representations, yielding information loss and performance degradation. To alleviate this problem, in this work, we introduce novel loss functions in vision transformer training to explicitly encourage diversity across patch representations for more discriminative feature extraction. We empirically show that our proposed techniques stabilize the training and allow us to train wider and deeper vision transformers. We further show the diversified features significantly benefit the downstream tasks in transfer learning. For semantic segmentation, we enhance the state-of-the-art (SOTA) results on Cityscapes and ADE20k. Our code is available at https://github.com/ChengyueGongR/PatchVisionTransformer.

View on arXivView PDF

Code Implementations(1)

7413Jupyter Notebook, PythonJan 3, 20213 years ago

Similar Papers

Cite this paper

@article{gong2021vision,
  title  = {Vision Transformers with Patch Diversification},
  author = {Chengyue Gong and Dilin Wang and Meng Li and Vikas Chandra and Qiang Liu},
  year   = {2021},
  eprint = {2104.12753},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2104.12753}
}

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/2104.12753.svg)](https://codeofpaper.com/paper/2104.12753)

Discussion