Vision Transformer with Quadrangle Attention
Authors:
- Qiming ZhangQZQiming Zhang
- Jing ZhangJZJing Zhang
- Yufei XuYXYufei Xu
- Dacheng TaoDTDacheng Tao
Preprint
Abstract
Window-based attention has become a popular choice in vision transformers due to its superior performance, lower computational complexity, and less memory footprint. However, the design of hand-crafted windows, which is data-agnostic, constrains the flexibility of transformers to adapt to objects of varying sizes, shapes, and orientations. To address this issue, we propose a novel quadrangle attention (QA) method that extends the window-based attention to a general quadrangle formulation. Our method employs an end-to-end learnable quadrangle regression module that predicts a transformation matrix to transform default windows into target quadrangles for token sampling and attention calculation, enabling the network to model various targets with different shapes and orientations and capture rich context information. We integrate QA into plain and hierarchical vision transformers to create a new architecture named QFormer, which offers minor code modifications and negligible extra computational cost. Extensive experiments on public benchmarks demonstrate that QFormer outperforms existing representative vision transformers on various vision tasks, including classification, object detection, semantic segmentation, and pose estimation. The code will be made publicly available at \href{https://github.com/ViTAE-Transformer/QFormer}{QFormer}.Keywords
All Related Versions
This publication has 14 references indexed in Scilit:
- ViTAEv2: Vision Transformer Advanced by Exploring Inductive Bias for Image Recognition and BeyondInternational Journal of Computer Vision, 2023
- KVT: k-NN Attention for Boosting Vision Transformers2022
- VSA: Learning Varied-Size Window Attention in Vision Transformers2022
- PVT v2: Improved baselines with pyramid vision transformerComputational Visual Media, 2022
- Vision Transformer with Deformable Attention2022
- MSG-Transformer: Exchanging Local Spatial Information by Manipulating Messenger Tokens2022
- Swin Transformer V2: Scaling Up Capacity and Resolution2022
- MViTv2: Improved Multiscale Vision Transformers for Classification and Detection2022
- CSWin Transformer: A General Vision Transformer Backbone with Cross-Shaped Windows2022
- Semantic Understanding of Scenes Through the ADE20K DatasetInternational Journal of Computer Vision, 2018