arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2207.01580cs.CVcs.AIcs.LG
收藏

面向高效Vision Transformers与卷积神经网络的动态空间稀疏化

Dynamic Spatial Sparsification for Efficient Vision Transformers and Convolutional Neural Networks

Department of Automation, Tsinghua University(清华大学自动化系)

Yongming Rao, Zuyan Liu, Wenliang Zhao, Jie Zhou, Jiwen Lu

AI总结:

提出DynamicViT式动态空间稀疏化框架,依据输入逐步剪除或分流低信息量空间位置,以非对称快速/慢速路径高效加速ViT、CNN及密集预测任务。

摘要:

本文提出一种通过利用视觉数据中的空间稀疏性来加速模型的新方法。我们观察到,Vision Transformers中的最终预测仅基于信息量最大的一部分token,而这已足以实现准确的图像识别。基于该观察,我们提出一个动态token稀疏化框架,根据输入逐步且动态地剪除冗余token,以加速Vision Transformers。具体而言,我们设计了一个轻量级预测模块,根据当前特征估计每个token的重要性分数。该模块被添加到不同层中,以分层方式剪除冗余token。尽管该框架源于我们对Vision Transformers中稀疏注意力的观察,但我们发现自适应和非对称计算的思想可以成为加速多种架构的通用解决方案。我们将方法扩展到包括CNN和分层Vision Transformers在内的分层模型,以及需要结构化特征图的更复杂密集预测任务;为此,我们构建了一个更通用的动态空间稀疏化框架,对不同空间位置采用渐进稀疏化和非对称计算。通过对信息量较少的特征应用轻量级快速路径,并对更重要的位置使用表达能力更强的慢速路径,我们能够在保持特征图结构的同时显著降低总体计算量。大量实验证明了我们的框架在多种现代架构和不同视觉识别任务上的有效性。结果清楚表明,动态空间稀疏化为模型加速提供了一个新的、更有效的维度。代码可在https://github.com/raoyongming/DynamicViT获取。

英文摘要:

In this paper, we present a new approach for model acceleration by exploiting spatial sparsity in visual data. We observe that the final prediction in vision Transformers is only based on a subset of the most informative tokens, which is sufficient for accurate image recognition. Based on this observation, we propose a dynamic token sparsification framework to prune redundant tokens progressively and dynamically based on the input to accelerate vision Transformers. Specifically, we devise a lightweight prediction module to estimate the importance score of each token given the current features. The module is added to different layers to prune redundant tokens hierarchically. While the framework is inspired by our observation of the sparse attention in vision Transformers, we find the idea of adaptive and asymmetric computation can be a general solution for accelerating various architectures. We extend our method to hierarchical models including CNNs and hierarchical vision Transformers as well as more complex dense prediction tasks that require structured feature maps by formulating a more generic dynamic spatial sparsification framework with progressive sparsification and asymmetric computation for different spatial locations. By applying lightweight fast paths to less informative features and using more expressive slow paths to more important locations, we can maintain the structure of feature maps while significantly reducing the overall computations. Extensive experiments demonstrate the effectiveness of our framework on various modern architectures and different visual recognition tasks. Our results clearly demonstrate that dynamic spatial sparsification offers a new and more effective dimension for model acceleration. Code is available at https://github.com/raoyongming/DynamicViT

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

↑