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

用于高效视觉Transformer的贴片瘦身

Patch Slimming for Efficient Vision Transformers

Peking University(北京大学);Huawei Noah’s Ark Lab(华为诺亚方舟实验室);University of Sydney(悉尼大学);JD Explore Academy(京东探索研究院)

Yehui Tang, Kai Han, Yunhe Wang, Chang Xu, Jianyuan Guo, Chao Xu, Dacheng Tao

摘要:

通过挖掘给定网络中的冗余计算,研究了可视化Transformers的效率问题。最近的Transformer架构已经证明了其在一系列计算机视觉任务上实现出色性能的有效性。然而,与卷积神经网络类似,视觉Transformer的巨大计算成本仍然是一个严峻的问题。考虑到注意力机制是逐层聚合不同的补丁,我们提出了一种新的补丁瘦身方法,在一个自顶向下的范例中丢弃无用的补丁。我们首先在最后一层中识别有效的补丁,然后使用它们来指导前面几层的补丁选择过程。对于每一层,补丁对最终输出特征的影响是近似的,影响较小的补丁将被删除。在基准数据集上的实验结果表明,该方法可以在不影响视觉Transformer性能的前提下,显著降低其计算量.例如,在ImageNet数据集上,ViT-Ti模型的FLOP可以减少45%以上,而top-1准确率仅下降0.2%。

英文摘要:

This paper studies the efficiency problem for visual transformers by excavating redundant calculation in given networks. The recent transformer architecture has demonstrated its effectiveness for achieving excellent performance on a series of computer vision tasks. However, similar to that of convolutional neural networks, the huge computational cost of vision transformers is still a severe issue. Considering that the attention mechanism aggregates different patches layer-by-layer, we present a novel patch slimming approach that discards useless patches in a top-down paradigm. We first identify the effective patches in the last layer and then use them to guide the patch selection process of previous layers. For each layer, the impact of a patch on the final output feature is approximated and patches with less impact will be removed. Experimental results on benchmark datasets demonstrate that the proposed method can significantly reduce the computational costs of vision transformers without affecting their performances. For example, over 45% FLOPs of the ViT-Ti model can be reduced with only 0.2% top-1 accuracy drop on the ImageNet dataset.

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

↑