ResT: An Efficient Transformer for Visual Recognition

Qinglong Zhang, Yubin Yang
5/28/2021
cs.CV

Official code: wofmanaf/ResT (292 stars, Apache-2.0, last commit 2022-09-28).

Abstract

This paper presents an efficient multi-scale vision Transformer, called ResT, that capably served as a general-purpose backbone for image recognition. Unlike existing Transformer methods, which employ standard Transformer blocks to tackle raw images with a fixed resolution, our ResT have several advantages: (1) A memory-efficient multi-head self-attention is built, which compresses the memory by a simple depth-wise convolution, and projects the interaction across the attention-heads dimension while keeping the diversity ability of multi-heads; (2) Position encoding is constructed as spatial attention, which is more flexible and can tackle with input images of arbitrary size without interpolation or fine-tune; (3) Instead of the straightforward tokenization at the beginning of each stage, we design the patch embedding as a stack of overlapping convolution operation with stride on the 2D-reshaped token map. We comprehensively validate ResT on image classification and downstream tasks. Experimental results show that the proposed ResT can outperform the recently state-of-the-art backbones by a large margin, demonstrating the potential of ResT as strong backbones. The code and models will be made publicly available at https://github.com/wofmanaf/ResT.

View on arXivView PDF

Code Implementations(1)

wofmanaf/ResTOfficial100%
Apache-2.0

This is an official implementation for "ResT: An Efficient Transformer for Visual Recognition".

29231Shell, PythonMay 21, 20214 years agoApache-2.0

Cite this paper

@article{zhang2021rest,
  title  = {ResT: An Efficient Transformer for Visual Recognition},
  author = {Qinglong Zhang and Yubin Yang},
  year   = {2021},
  eprint = {2105.13677},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2105.13677}
}

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

Discussion