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

MIA-Former:基于多粒度输入自适应的高效鲁棒视觉Transformer

MIA-Former: Efficient and Robust Vision Transformers via Multi-grained Input-Adaptation

Department of Electrical and Computer Engineering, Rice University(莱斯大学电气与计算机工程系);Alibaba DAMO Academy(阿里巴巴达摩院)

Zhongzhi Yu, Yonggan Fu, Sicheng Li, Chaojian Li, Yingyan Lin

摘要:

ViT通常在计算上过于昂贵,无法安装到现实世界的资源受限设备上,这是由于(1)它们的复杂性随着输入令牌的数量呈二次方增加,以及(2)它们的过度参数化的自我注意头部和模型深度。同时,不同的图像具有不同的复杂性,并且它们的不同区域可以包含各种级别的视觉信息,这表明在模型复杂性方面平等地对待所有区域/标记是不必要的,而这种用于削减ViT复杂性的机会尚未被充分探索。为此,我们提出了一个多粒度输入自适应视觉Transformer框架,称为MIA-前,可以输入自适应调整结构的ViT在三个粗到细粒度(即,模型深度和模型头部/令牌的数量)。特别是,我们的MIA-Former采用了一种低成本的网络,该网络采用混合监督和强化训练方法进行训练,以输入自适应的方式跳过不必要的层,头部和令牌,从而降低了整体计算成本。此外,一个有趣的副作用是,我们的MIA-Former的产生的ViT自然配备了改进的鲁棒性对对抗攻击超过他们的静态同行,因为MIA-Former的多粒度动态控制提高了模型的多样性,类似于合奏的效果,从而增加了对抗攻击对所有子模型的难度。大量的实验和消融研究验证了所提出的MIA-Former框架可以有效地分配适应于输入图像难度的计算预算,同时增加鲁棒性,实现最先进的(SOTA)精度-效率权衡,例如,与SOTA动态Transformer模型相比,在相同甚至更高的精度下节省20%的计算量。

英文摘要:

ViTs are often too computationally expensive to be fitted onto real-world resource-constrained devices, due to (1) their quadratically increased complexity with the number of input tokens and (2) their overparameterized self-attention heads and model depth. In parallel, different images are of varied complexity and their different regions can contain various levels of visual information, indicating that treating all regions/tokens equally in terms of model complexity is unnecessary while such opportunities for trimming down ViTs' complexity have not been fully explored. To this end, we propose a Multi-grained Input-adaptive Vision Transformer framework dubbed MIA-Former that can input-adaptively adjust the structure of ViTs at three coarse-to-fine-grained granularities (i.e., model depth and the number of model heads/tokens). In particular, our MIA-Former adopts a low-cost network trained with a hybrid supervised and reinforcement training method to skip unnecessary layers, heads, and tokens in an input adaptive manner, reducing the overall computational cost. Furthermore, an interesting side effect of our MIA-Former is that its resulting ViTs are naturally equipped with improved robustness against adversarial attacks over their static counterparts, because MIA-Former's multi-grained dynamic control improves the model diversity similar to the effect of ensemble and thus increases the difficulty of adversarial attacks against all its sub-models. Extensive experiments and ablation studies validate that the proposed MIA-Former framework can effectively allocate computation budgets adaptive to the difficulty of input images meanwhile increase robustness, achieving state-of-the-art (SOTA) accuracy-efficiency trade-offs, e.g., 20% computation savings with the same or even a higher accuracy compared with SOTA dynamic transformer models.

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

↑