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

CvT:将卷积引入视觉Transformer

CvT: Introducing Convolutions to Vision Transformers

McGill University(麦吉尔大学);Microsoft Cloud + AI(微软云与人工智能)

Haiping Wu, Bin Xiao, Noel Codella, Mengchen Liu, Xiyang Dai, Lu Yuan, Lei Zhang

摘要:

本文提出了一种新的架构,称为卷积视觉Transformer(CvT),提高了视觉Transformer(ViT)的性能和效率,通过引入卷积到ViT产生最好的两种设计。这是通过两个主要修改来实现的:包含新卷积令牌嵌入的Transformers层次结构,以及利用卷积投影的卷积Transformer块。这些变化将卷积神经网络(CNN)的理想属性引入ViT架构(\ie移位、缩放和失真不变性),同时保持了Transformers的优点(\ie动态注意力、全局上下文和更好的泛化)。我们通过进行广泛的实验来验证CvT,表明这种方法在ImageNet-1 k上实现了比其他视觉Transformer和ResNets更先进的性能,参数更少,FLOP更低。此外,当在较大的数据集(\eg ImageNet-22 k)上进行预训练并针对下游任务进行微调时,性能增益得以保持。在ImageNet-22 k上进行预训练后,我们的CvT-W24在ImageNet-1 k val集上获得了87.7\%的前1准确率。最后,我们的研究结果表明,位置编码,在现有的视觉Transformer的一个重要组成部分,可以安全地删除在我们的模型,简化设计更高分辨率的视觉任务。代码将在\url{https://github.com/leoxiaobin/CvT}发布。

英文摘要:

We present in this paper a new architecture, named Convolutional vision Transformer (CvT), that improves Vision Transformer (ViT) in performance and efficiency by introducing convolutions into ViT to yield the best of both designs. This is accomplished through two primary modifications: a hierarchy of Transformers containing a new convolutional token embedding, and a convolutional Transformer block leveraging a convolutional projection. These changes introduce desirable properties of convolutional neural networks (CNNs) to the ViT architecture (\ie shift, scale, and distortion invariance) while maintaining the merits of Transformers (\ie dynamic attention, global context, and better generalization). We validate CvT by conducting extensive experiments, showing that this approach achieves state-of-the-art performance over other Vision Transformers and ResNets on ImageNet-1k, with fewer parameters and lower FLOPs. In addition, performance gains are maintained when pretrained on larger datasets (\eg ImageNet-22k) and fine-tuned to downstream tasks. Pre-trained on ImageNet-22k, our CvT-W24 obtains a top-1 accuracy of 87.7\% on the ImageNet-1k val set. Finally, our results show that the positional encoding, a crucial component in existing Vision Transformers, can be safely removed in our model, simplifying the design for higher resolution vision tasks. Code will be released at \url{https://github.com/leoxiaobin/CvT}.

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

↑