Transformers have recently shown superior performances on various vision tasks. The large, sometimes even global, receptive field endows Transformer models with higher representation power over their CNN counterparts. Nevertheless, simply enlarging receptive field also gives rise to several concerns. On the one hand, using dense attention e.g., in ViT, leads to excessive memory and computational cost, and features can be influenced by irrelevant parts which are beyond the region of interests. On the other hand, the sparse attention adopted in PVT or Swin Transformer is data agnostic and may limit the ability to model long range relations. To mitigate these issues, we propose a novel deformable self-attention module, where the positions of key and value pairs in self-attention are selected in a data-dependent way. This flexible scheme enables the self-attention module to focus on relevant regions and capture more informative features. On this basis, we present Deformable Attention Transformer, a general backbone model with deformable attention for both image classification and dense prediction tasks. Extensive experiments show that our models achieve consistently improved results on comprehensive benchmarks. Code is available at https://github.com/LeapLabTHU/DAT.
翻译:最近,变异器在各种视觉任务上表现出了优异的绩效。 巨大的,有时甚至是全球性的、可接受的场景变异器模型,其代表性强于有线电视新闻网的对口单位。 然而,仅仅扩大可接受场也引起若干关注。 一方面,使用密集的注意力,例如ViT,导致记忆和计算成本过大,特征可能受利益区域以外的无关部分的影响。另一方面,PVT或Swin变异器中采用的微弱关注是数据不可知性,可能限制模拟长程关系的能力。为了缓解这些问题,我们提议了一个新型的可变形自我注意模块,在其中,以数据独立的方式选择了自我注意的关键和价值对对的位置。这一灵活办法使自我注意模块能够关注相关区域并捕捉更多信息特征。 在此基础上,我们介绍了可变式注意力变异变异的变形器,即一个对图像分类和密集预测任务有可变形注意的一般主干模型。 广泛的实验显示,我们的模型在全面基准上取得了持续改进的结果。 http://gibb.LA. com/ AT.D. 代码可在 AT. AT. AT. AT. 。