Following the success in advancing natural language processing and understanding, transformers are expected to bring revolutionary changes to computer vision. This work provides the first and comprehensive study on the robustness of vision transformers (ViTs) against adversarial perturbations. Tested on various white-box and transfer attack settings, we find that ViTs possess better adversarial robustness when compared with convolutional neural networks (CNNs). We summarize the following main observations contributing to the improved robustness of ViTs: 1) Features learned by ViTs contain less low-level information and are more generalizable, which contributes to superior robustness against adversarial perturbations. 2) Introducing convolutional or tokens-to-token blocks for learning low-level features in ViTs can improve classification accuracy but at the cost of adversarial robustness. 3) Increasing the proportion of transformers in the model structure (when the model consists of both transformer and CNN blocks) leads to better robustness. But for a pure transformer model, simply increasing the size or adding layers cannot guarantee a similar effect. 4) Pre-training on larger datasets does not significantly improve adversarial robustness though it is critical for training ViTs. 5) Adversarial training is also applicable to ViT for training robust models. Furthermore, feature visualization and frequency analysis are conducted for explanation. The results show that ViTs are less sensitive to high-frequency perturbations than CNNs and there is a high correlation between how well the model learns low-level features and its robustness against different frequency-based perturbations.
翻译:在推进自然语言处理和理解的成功之后,变压器预计将给计算机愿景带来革命性的变化。 这项工作首次全面研究了视力变压器(ViTs)在对抗性扰动方面的稳健性。 在各种白箱和传输攻击设置上测试了ViTs在与进化神经网络(CNNs)相比,具有更好的对抗性强性。 我们总结了有助于增强ViTs稳健性的以下主要观察:1) ViTs所学的特征包含较少的低级别信息,而且更加普及,有助于在对抗对立性频率扰动方面提高超强性。 2) 在ViTs中,为学习低级别特征而采用变压式或象征性对称区块可以提高分类准确性,但代价是对抗性强性神经神经神经网络(CNNC)的稳健性。 提高变压器模型的模型的稳健性。 但对于纯性变压性模型而言,仅仅增加规模或增加层次不能保证类似的效果。 4) 较高级的ViViural- tria- train-trainal-trainal redustration 也无法大幅地进行可靠的分析。