Refiner: Refining Self-attention for Vision Transformers

Daquan Zhou, Yujun Shi, Bingyi Kang, Weihao Yu, Zihang Jiang +4 more
6/7/2021
cs.CV
transformer-attention

Official code: zhoudaquan/Refiner_ViT (110 stars, Python, last commit 2021-09-15).

Abstract

Vision Transformers (ViTs) have shown competitive accuracy in image classification tasks compared with CNNs. Yet, they generally require much more data for model pre-training.

Show full abstract

Most of recent works thus are dedicated to designing more complex architectures or training methods to address the data-efficiency issue of ViTs. However, few of them explore improving the self-attention mechanism, a key factor distinguishing ViTs from CNNs. Different from existing works, we introduce a conceptually simple scheme, called refiner, to directly refine the self-attention maps of ViTs. Specifically, refiner explores attention expansion that projects the multi-head attention maps to a higher-dimensional space to promote their diversity. Further, refiner applies convolutions to augment local patterns of the attention maps, which we show is equivalent to a distributed local attention features are aggregated locally with learnable kernels and then globally aggregated with self-attention. Extensive experiments demonstrate that refiner works surprisingly well. Significantly, it enables ViTs to achieve 86% top-1 classification accuracy on ImageNet with only 81M parameters.

View on arXivView PDF

Code Implementations(1)

11015Python, ShellJun 5, 20215 years ago

Similar Papers

Cite this paper

@article{zhou2021refiner,
  title  = {Refiner: Refining Self-attention for Vision Transformers},
  author = {Daquan Zhou and Yujun Shi and Bingyi Kang and Weihao Yu and Zihang Jiang and Yuan Li and Xiaojie Jin and Qibin Hou and Jiashi Feng},
  year   = {2021},
  eprint = {2106.03714},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2106.03714}
}

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

Discussion