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

多尾视觉Transformer用于高效推理

Multi-Tailed Vision Transformer for Efficient Inference

School of Computer Science, Wuhan University(武汉大学计算机学院);School of Electric Information, Wuhan University(武汉大学电子信息学院);School of Computer Science, The University of Sydney(悉尼大学计算机学院)

Yunke Wang, Bo Du, Wenyuan Wang, Chang Xu

AI总结:

提出多尾视觉Transformer(MT-ViT),通过多个尾部生成不同长度令牌序列并预测最有效尾部,在ImageNet-1K上实现FLOPs显著降低且精度不降。

摘要:

近年来,视觉Transformer(ViT)在图像识别中取得了令人瞩目的性能,并逐渐成为各种视觉任务中的强大骨干网络。为了满足Transformer的序列输入要求,ViT的尾部首先将每张图像分割成固定长度的视觉令牌序列。然后,随后的自注意力层构建令牌之间的全局关系,为下游任务产生有用的表示。经验上,用更多令牌表示图像会带来更好的性能,但自注意力层对令牌数量的二次计算复杂度可能严重影响ViT推理的效率。为了减少计算量,一些剪枝方法在Transformer编码器中逐步剪除信息量低的令牌,而保持Transformer之前的令牌数量不变。实际上,作为Transformer编码器输入的令牌越少,可以直接降低后续的计算成本。基于此思想,本文提出了一种多尾视觉Transformer(MT-ViT)。MT-ViT采用多个尾部为后续的Transformer编码器生成不同长度的视觉序列。引入一个尾部预测器来决定对于图像而言,哪个尾部最有效以产生准确预测。两个模块通过Gumbel-Softmax技巧以端到端的方式进行优化。在ImageNet-1K上的实验表明,MT-ViT在精度不下降的情况下实现了FLOPs的显著减少,并且在精度和FLOPs方面均优于其他对比方法。

英文摘要:

Recently, Vision Transformer (ViT) has achieved promising performance in image recognition and gradually serves as a powerful backbone in various vision tasks. To satisfy the sequential input of Transformer, the tail of ViT first splits each image into a sequence of visual tokens with a fixed length. Then the following self-attention layers constructs the global relationship between tokens to produce useful representation for the downstream tasks. Empirically, representing the image with more tokens leads to better performance, yet the quadratic computational complexity of self-attention layer to the number of tokens could seriously influence the efficiency of ViT's inference. For computational reduction, a few pruning methods progressively prune uninformative tokens in the Transformer encoder, while leaving the number of tokens before the Transformer untouched. In fact, fewer tokens as the input for the Transformer encoder can directly reduce the following computational cost. In this spirit, we propose a Multi-Tailed Vision Transformer (MT-ViT) in the paper. MT-ViT adopts multiple tails to produce visual sequences of different lengths for the following Transformer encoder. A tail predictor is introduced to decide which tail is the most efficient for the image to produce accurate prediction. Both modules are optimized in an end-to-end fashion, with the Gumbel-Softmax trick. Experiments on ImageNet-1K demonstrate that MT-ViT can achieve a significant reduction on FLOPs with no degradation of the accuracy and outperform other compared methods in both accuracy and FLOPs.

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

↑