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

视觉Transformer可以执行卷积吗?

Can Vision Transformers Perform Convolution?

Peking University(北京大学);UCLA(加州大学洛杉矶分校);Microsoft Research(微软研究院)

Shanda Li, Xiangning Chen, Di He, Cho-Jui Hsieh

摘要:

最近的几项研究表明,基于注意力的网络,如视觉Transformer(ViT),在不使用卷积层的情况下,可以在几个计算机视觉任务上胜过卷积神经网络(CNN)。这自然会导致以下问题:ViT的自我注意层可以表达任何卷积运算吗?在这项工作中,我们证明了一个单一的ViT层与图像补丁作为输入可以执行任何卷积运算建设性的,其中的多头注意力机制和相对的位置编码起着至关重要的作用。我们进一步提供了视觉Transformer表达CNN的头数的下限。与我们的分析相对应,实验结果表明,我们的证明中的构造可以帮助将卷积偏差注入到Transformers中,并显着提高ViT在低数据状态下的性能。

英文摘要:

Several recent studies have demonstrated that attention-based networks, such as Vision Transformer (ViT), can outperform Convolutional Neural Networks (CNNs) on several computer vision tasks without using convolutional layers. This naturally leads to the following questions: Can a self-attention layer of ViT express any convolution operation? In this work, we prove that a single ViT layer with image patches as the input can perform any convolution operation constructively, where the multi-head attention mechanism and the relative positional encoding play essential roles. We further provide a lower bound on the number of heads for Vision Transformers to express CNNs. Corresponding with our analysis, experimental results show that the construction in our proof can help inject convolutional bias into Transformers and significantly improve the performance of ViT in low data regimes.

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

↑