DAT++: Spatially Dynamic Vision Transformer with Deformable Attention

Zhuofan Xia, Xuran Pan, Shiji Song, Li Erran Li, Gao Huang
9/4/2023
cs.CV

No official code found. Best implementation: LeapLabTHU/DAT (938 stars, Apache-2.0, PyTorch, last commit 2024-04-17).

Abstract

Transformers have shown superior performance on various vision tasks. Their large receptive field endows Transformer models with higher representation power than their CNN counterparts. Nevertheless, simply enlarging the receptive field also raises several concerns. On the one hand, using dense attention in ViT leads to excessive memory and computational cost, and features can be influenced by irrelevant parts that are beyond the region of interests. On the other hand, the handcrafted attention adopted in PVT or Swin Transformer is data agnostic and may limit the ability to model long-range relations. To solve this dilemma, we propose a novel deformable multi-head attention module, where the positions of key and value pairs in self-attention are adaptively allocated in a data-dependent way. This flexible scheme enables the proposed deformable attention to dynamically focus on relevant regions while maintains the representation power of global attention. On this basis, we present Deformable Attention Transformer (DAT), a general vision backbone efficient and effective for visual recognition. We further build an enhanced version DAT++. Extensive experiments show that our DAT++ achieves state-of-the-art results on various visual recognition benchmarks, with 85.9% ImageNet accuracy, 54.5 and 47.0 MS-COCO instance segmentation mAP, and 51.5 ADE20K semantic segmentation mIoU.

View on arXivView PDF

Code Implementations(1)

LeapLabTHU/DATCommunity100%
PyTorchApache-2.0

Repository of Vision Transformer with Deformable Attention (CVPR2022) and DAT++: Spatially Dynamic Vision Transformerwith Deformable Attention

93885Shell, PythonJan 3, 20222 years agoApache-2.0
deep-learningdeformable-attentionimage-classificationpytorchvision-transformer

Similar Papers

Cite this paper

@article{xia2023dat,
  title  = {DAT++: Spatially Dynamic Vision Transformer with Deformable Attention},
  author = {Zhuofan Xia and Xuran Pan and Shiji Song and Li Erran Li and Gao Huang},
  year   = {2023},
  eprint = {2309.01430},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2309.01430v1}
}

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

Discussion