arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2106.05786cs.CVcs.AI
收藏

CAT:视觉Transformer中的交叉注意

CAT: Cross Attention in Vision Transformer

Beijing University of Posts and Telecommunications(北京邮电大学);KuaiShou Inc(快手公司)

Hezheng Lin, Xing Cheng, Xiangyu Wu, Fan Yang, Dong Shen, Zhongyuan Wang, Qing Song, Wei Yuan

摘要:

由于Transformer在NLP中得到了广泛的应用,Transformer在CV中的潜力已经实现,并激发了许多新的方法。然而,在图像的标记化之后用用于Transformer的图像块替换单词标记所需的计算是巨大的(例如,ViT),这会对模型训练和推理造成瓶颈。本文提出了一种新的Transformer中的注意力机制--交叉注意力(Cross Attention),该注意力机制在图像块内部而不是整个图像中交替进行,以捕获局部信息,并在从单通道特征图中划分出的图像块之间应用注意力,以捕获全局信息。这两种操作都比Transformer中的标准自注意运算量小。通过交替应用注意力内部和之间的补丁,我们实现了交叉注意,以保持较低的计算成本的性能,并建立了一个层次网络称为交叉注意Transformer(CAT)的其他视觉任务。我们的基础模型在ImageNet-1 K上达到了最先进的水平,并提高了COCO和ADE 20 K上其他方法的性能,这表明我们的网络有潜力作为通用骨干。代码和型号可在\url{https://github.com/linhezheng19/CAT}上获得。

英文摘要:

Since Transformer has found widespread use in NLP, the potential of Transformer in CV has been realized and has inspired many new approaches. However, the computation required for replacing word tokens with image patches for Transformer after the tokenization of the image is vast(e.g., ViT), which bottlenecks model training and inference. In this paper, we propose a new attention mechanism in Transformer termed Cross Attention, which alternates attention inner the image patch instead of the whole image to capture local information and apply attention between image patches which are divided from single-channel feature maps capture global information. Both operations have less computation than standard self-attention in Transformer. By alternately applying attention inner patch and between patches, we implement cross attention to maintain the performance with lower computational cost and build a hierarchical network called Cross Attention Transformer(CAT) for other vision tasks. Our base model achieves state-of-the-arts on ImageNet-1K, and improves the performance of other methods on COCO and ADE20K, illustrating that our network has the potential to serve as general backbones. The code and models are available at \url{https://github.com/linhezheng19/CAT}.

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

↑