Dynamic Grained Encoder for Vision Transformers

Abstract

Transformers, the de-facto standard for language modeling, have been recently applied for vision tasks. This paper introduces sparse queries for vision transformers to exploit the intrinsic spatial redundancy of natural images and save computational costs. Specifically, we propose a Dynamic Grained Encoder for vision transformers, which can adaptively assign a suitable number of queries to each spatial region. Thus it achieves a fine-grained representation in discriminative regions while keeping high efficiency. Besides, the dynamic grained encoder is compatible with most vision transformer frameworks. Without bells and whistles, our encoder allows the state-of-the-art vision transformers to reduce computational complexity by 40%-60% while maintaining comparable performance on image classification. Extensive experiments on object detection and segmentation further demonstrate the generalizability of our approach. Code is available at https://github.com/StevenGrove/vtpack.

Cite

Text

Song et al. "Dynamic Grained Encoder for Vision Transformers." Neural Information Processing Systems, 2021.

Markdown

[Song et al. "Dynamic Grained Encoder for Vision Transformers." Neural Information Processing Systems, 2021.](https://mlanthology.org/neurips/2021/song2021neurips-dynamic/)

BibTeX

@inproceedings{song2021neurips-dynamic,
  title     = {{Dynamic Grained Encoder for Vision Transformers}},
  author    = {Song, Lin and Zhang, Songyang and Liu, Songtao and Li, Zeming and He, Xuming and Sun, Hongbin and Sun, Jian and Zheng, Nanning},
  booktitle = {Neural Information Processing Systems},
  year      = {2021},
  url       = {https://mlanthology.org/neurips/2021/song2021neurips-dynamic/}
}