arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2107.00652cs.CVcs.LG
收藏

CSWin Transformer:具有十字形窗口的通用视觉Transformer主干

CSWin Transformer: A General Vision Transformer Backbone with Cross-Shaped Windows

University of Science and Technology of China(中国科学技术大学);Microsoft Research Asia(微软亚洲研究院);Microsoft Cloud + AI(微软云与人工智能)

Xiaoyi Dong, Jianmin Bao, Dongdong Chen, Weiming Zhang, Nenghai Yu, Lu Yuan, Dong Chen, Baining Guo

摘要:

我们提出CSWin Transformer,这是一个高效的基于Transformer的通用视觉任务骨干。Transformer设计中的一个挑战性问题是全局自注意力的计算非常昂贵,而局部自注意力通常限制每个令牌的交互领域。为了解决这个问题,我们开发了十字形窗口自注意力机制,用于计算平行的水平和垂直条纹中的自注意力,这些条纹形成十字形窗口,每个条纹通过将输入特征分割成相等宽度的条纹来获得。我们提供了一个数学分析的条纹宽度的影响,并改变条纹宽度的Transformer网络的不同层,实现强大的建模能力,同时限制计算成本。我们还介绍了本地增强的位置编码(LePE),它比现有的编码方案更好地处理本地位置信息。LePE自然支持任意输入分辨率,因此对于下游任务特别有效和友好。结合这些设计和分层结构,CSWin Transformer在常见的视觉任务上表现出具有竞争力的性能。具体来说,它在ImageNet-1 K上实现了85.4\%的Top-1准确率,没有任何额外的训练数据或标签,在COCO检测任务上实现了53.9个框AP和46.4个掩码AP,在ADE 20 K语义分割任务上实现了52.2 mIOU,超过了之前最先进的Swin Transformer骨干+1.2,+2.0,+1.4,和+2.0分别在类似的FLOPs设置。通过在更大的数据集ImageNet-21 K上进行进一步的预训练,我们在ImageNet-1 K上实现了87.5%的Top-1准确率,并在ADE 20 K上实现了55.7 mIoU的高分割性能。代码和模型可在https://github.com/microsoft/CSWin-Transformer上获得。

英文摘要:

We present CSWin Transformer, an efficient and effective Transformer-based backbone for general-purpose vision tasks. A challenging issue in Transformer design is that global self-attention is very expensive to compute whereas local self-attention often limits the field of interactions of each token. To address this issue, we develop the Cross-Shaped Window self-attention mechanism for computing self-attention in the horizontal and vertical stripes in parallel that form a cross-shaped window, with each stripe obtained by splitting the input feature into stripes of equal width. We provide a mathematical analysis of the effect of the stripe width and vary the stripe width for different layers of the Transformer network which achieves strong modeling capability while limiting the computation cost. We also introduce Locally-enhanced Positional Encoding (LePE), which handles the local positional information better than existing encoding schemes. LePE naturally supports arbitrary input resolutions, and is thus especially effective and friendly for downstream tasks. Incorporated with these designs and a hierarchical structure, CSWin Transformer demonstrates competitive performance on common vision tasks. Specifically, it achieves 85.4\% Top-1 accuracy on ImageNet-1K without any extra training data or label, 53.9 box AP and 46.4 mask AP on the COCO detection task, and 52.2 mIOU on the ADE20K semantic segmentation task, surpassing previous state-of-the-art Swin Transformer backbone by +1.2, +2.0, +1.4, and +2.0 respectively under the similar FLOPs setting. By further pretraining on the larger dataset ImageNet-21K, we achieve 87.5% Top-1 accuracy on ImageNet-1K and high segmentation performance on ADE20K with 55.7 mIoU. The code and models are available at https://github.com/microsoft/CSWin-Transformer.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑