Glance-and-Gaze Vision Transformer

Qihang Yu, Yingda Xia, Yutong Bai, Yongyi Lu, Alan Yuille +1 more
6/4/2021
cs.CV
transformer-attention

Official code: yucornetto/GG-Transformer (28 stars, MIT, last commit 2021-06-07).

Abstract

Recently, there emerges a series of vision Transformers, which show superior performance with a more compact model size than conventional convolutional neural networks, thanks to the strong ability of Transformers to model long-range dependencies. However, the advantages of vision Transformers also come with a price: Self-attention, the core part of Transformer, has a quadratic complexity to the input sequence length.

Show full abstract

This leads to a dramatic increase of computation and memory cost with the increase of sequence length, thus introducing difficulties when applying Transformers to the vision tasks that require dense predictions based on high-resolution feature maps. In this paper, we propose a new vision Transformer, named Glance-and-Gaze Transformer (GG-Transformer), to address the aforementioned issues. It is motivated by the Glance and Gaze behavior of human beings when recognizing objects in natural scenes, with the ability to efficiently model both long-range dependencies and local context. In GG-Transformer, the Glance and Gaze behavior is realized by two parallel branches: The Glance branch is achieved by performing self-attention on the adaptively-dilated partitions of the input, which leads to a linear complexity while still enjoying a global receptive field; The Gaze branch is implemented by a simple depth-wise convolutional layer, which compensates local image context to the features obtained by the Glance mechanism. We empirically demonstrate our method achieves consistently superior performance over previous state-of-the-art Transformers on various vision tasks and benchmarks. The codes and models will be made available at https://github.com/yucornetto/GG-Transformer.

View on arXivView PDF

Code Implementations(1)

MIT

Code and models for the paper Glance-and-Gaze Vision Transformer

282Jun 6, 20215 years agoMIT

Similar Papers

Cite this paper

@article{yu2021glanceandgaze,
  title  = {Glance-and-Gaze Vision Transformer},
  author = {Qihang Yu and Yingda Xia and Yutong Bai and Yongyi Lu and Alan Yuille and Wei Shen},
  year   = {2021},
  eprint = {2106.02277},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2106.02277}
}

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

Discussion