arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2103.11816cs.CV
收藏

用可视化的Transformers表示卷积设计

Incorporating Convolution Designs into Visual Transformers

SenseTime Research(商汤科技研究院);Nanyang Technological University(南洋理工大学)

Kun Yuan, Shaopeng Guo, Ziwei Liu, Aojun Zhou, Fengwei Yu, Wei Wu

摘要:

由于Transformers在自然语言处理(NLP)任务中的成功,出现了一些尝试(例如,ViT和DeiT)将Transformers应用于视觉领域。然而,纯Transformer架构通常需要大量的训练数据或额外的监督才能获得与卷积神经网络(CNN)相当的性能。为了克服这些限制,我们分析了直接从NLP借用Transformer架构时的潜在缺点。然后,我们提出了一种新的\textbf{Convolution-enhanced image Transformer (CeiT)},它结合了CNN在提取低级特征,加强局部性方面的优势,以及Transformers在建立远程依赖关系方面的优势。对原有的Transformer进行了三处修改:\textbf{1)}代替了直接从原始输入图像中进行标记化,设计了一个\textbf{Image-to-Tokens (I2T)}模块,从生成的低层特征中提取补丁; \textbf{2)}用一个\textbf{Locally-enhanced Feed-Forward (LeFF)}层代替了每个编码器块中的前馈网络,该层促进了空间维度上相邻标记之间的相关性; \textbf{3)}将\textbf{Layer-wise Class token Attention (LCA)}连接到使用多级表示的Transformer的顶部。在ImageNet和七个下游任务上的实验结果显示了CeiT与之前的Transformers和最先进的CNN相比的有效性和泛化能力,而不需要大量的训练数据和额外的CNN教师。此外,CeiT模型还表现出更好的收敛性,$3\times$训练迭代次数更少,这可以显着降低训练成本\footnote{Code and models will be released upon acceptance.}。

英文摘要:

Motivated by the success of Transformers in natural language processing (NLP) tasks, there emerge some attempts (e.g., ViT and DeiT) to apply Transformers to the vision domain. However, pure Transformer architectures often require a large amount of training data or extra supervision to obtain comparable performance with convolutional neural networks (CNNs). To overcome these limitations, we analyze the potential drawbacks when directly borrowing Transformer architectures from NLP. Then we propose a new \textbf{Convolution-enhanced image Transformer (CeiT)} which combines the advantages of CNNs in extracting low-level features, strengthening locality, and the advantages of Transformers in establishing long-range dependencies. Three modifications are made to the original Transformer: \textbf{1)} instead of the straightforward tokenization from raw input images, we design an \textbf{Image-to-Tokens (I2T)} module that extracts patches from generated low-level features; \textbf{2)} the feed-froward network in each encoder block is replaced with a \textbf{Locally-enhanced Feed-Forward (LeFF)} layer that promotes the correlation among neighboring tokens in the spatial dimension; \textbf{3)} a \textbf{Layer-wise Class token Attention (LCA)} is attached at the top of the Transformer that utilizes the multi-level representations. Experimental results on ImageNet and seven downstream tasks show the effectiveness and generalization ability of CeiT compared with previous Transformers and state-of-the-art CNNs, without requiring a large amount of training data and extra CNN teachers. Besides, CeiT models also demonstrate better convergence with $3\times$ fewer training iterations, which can reduce the training cost significantly\footnote{Code and models will be released upon acceptance.}.

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

↑