ViT-P: Rethinking Data-efficient Vision Transformers from Locality

Bin Chen, Ran Wang, Di Ming, Xin Feng
3/4/2022
cs.CV
transformer-attention

Official code: Freder-chen/Swelling-ViT (5 stars, Python, Apache-2.0, last commit 2024-10-10).

Abstract

Recent advances of Transformers have brought new trust to computer vision tasks. However, on small dataset, Transformers is hard to train and has lower performance than convolutional neural networks.

Show full abstract

We make vision transformers as data-efficient as convolutional neural networks by introducing multi-focal attention bias. Inspired by the attention distance in a well-trained ViT, we constrain the self-attention of ViT to have multi-scale localized receptive field. The size of receptive field is adaptable during training so that optimal configuration can be learned. We provide empirical evidence that proper constrain of receptive field can reduce the amount of training data for vision transformers. On Cifar100, our ViT-P Base model achieves the state-of-the-art accuracy (83.16%) trained from scratch. We also perform analysis on ImageNet to show our method does not lose accuracy on large data sets.

View on arXivView PDF

Code Implementations(1)

Apache-2.0

PyTorch implementation of Swelling-ViT

51PythonJan 23, 20222 years agoApache-2.0

Similar Papers

Cite this paper

@article{chen2022vitp,
  title  = {ViT-P: Rethinking Data-efficient Vision Transformers from Locality},
  author = {Bin Chen and Ran Wang and Di Ming and Xin Feng},
  year   = {2022},
  eprint = {2203.02358},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2203.02358}
}

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

Discussion