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

令牌到令牌ViT:在ImageNet上从头开始培训视觉Transformer

Tokens-to-Token ViT: Training Vision Transformers from Scratch on ImageNet

Yitu Tech(依图科技);National University of Singapore(新加坡国立大学);YITU Technology Institute of Data Science(依图科技数据科学研究所)

Li Yuan, Yunpeng Chen, Tao Wang, Weihao Yu, Yujun Shi, Zihang Jiang, Francis EH Tay, Jiashi Feng, Shuicheng Yan

摘要:

Transformers是语言建模的热门工具,最近已被探索用于解决视觉任务,例如,用于图像分类的视觉Transformer(ViT)。ViT模型将每个图像分割成具有固定长度的标记序列,然后应用多个Transformer层来建模它们的全局关系以进行分类。然而,当在ImageNet等中型数据集上从头开始训练时,ViT的性能不如CNN。我们发现这是因为:1)输入图像的简单标记化未能对重要的局部结构(例如相邻像素之间的边缘和线)进行建模,导致低训练样本效率; 2)ViT的冗余注意力主干设计导致对于固定计算预算和有限训练样本的有限特征丰富度。为了克服这些限制,我们提出了一种新的令牌到令牌视觉Transformer(T2 T-ViT),它包括1)逐层令牌到令牌(T2 T)变换,通过递归地将相邻令牌聚合成一个令牌来逐步将图像结构化为令牌(令牌到令牌),使得可以对由周围令牌表示的局部结构进行建模并且可以减少令牌长度;(2)基于CNN的结构设计,通过实验研究,提出了一种具有深窄结构的高效视觉Transformer骨干。值得注意的是,T2 T-ViT将vanilla ViT的参数计数和MAC减少了一半,同时在ImageNet上从头开始训练时实现了超过3.0%的改进。它的性能也优于ResNets,并通过直接在ImageNet上进行训练来实现与MobileNets相当的性能。例如,具有与ResNet 50(21.5M参数)相当的大小的T2 T-ViT可以在ImageNet上的图像分辨率384 $\times$ 384中实现83.3\%的top1精度。(Code:https://github.com/yitu-opensource/T2T-ViT)

英文摘要:

Transformers, which are popular for language modeling, have been explored for solving vision tasks recently, e.g., the Vision Transformer (ViT) for image classification. The ViT model splits each image into a sequence of tokens with fixed length and then applies multiple Transformer layers to model their global relation for classification. However, ViT achieves inferior performance to CNNs when trained from scratch on a midsize dataset like ImageNet. We find it is because: 1) the simple tokenization of input images fails to model the important local structure such as edges and lines among neighboring pixels, leading to low training sample efficiency; 2) the redundant attention backbone design of ViT leads to limited feature richness for fixed computation budgets and limited training samples. To overcome such limitations, we propose a new Tokens-To-Token Vision Transformer (T2T-ViT), which incorporates 1) a layer-wise Tokens-to-Token (T2T) transformation to progressively structurize the image to tokens by recursively aggregating neighboring Tokens into one Token (Tokens-to-Token), such that local structure represented by surrounding tokens can be modeled and tokens length can be reduced; 2) an efficient backbone with a deep-narrow structure for vision transformer motivated by CNN architecture design after empirical study. Notably, T2T-ViT reduces the parameter count and MACs of vanilla ViT by half, while achieving more than 3.0\% improvement when trained from scratch on ImageNet. It also outperforms ResNets and achieves comparable performance with MobileNets by directly training on ImageNet. For example, T2T-ViT with comparable size to ResNet50 (21.5M parameters) can achieve 83.3\% top1 accuracy in image resolution 384$\times$384 on ImageNet. (Code: https://github.com/yitu-opensource/T2T-ViT)

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

↑