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

当对抗性训练遇到视觉Transformer:从训练到架构的食谱

When Adversarial Training Meets Vision Transformers: Recipes from Training to Architecture

Peking University(北京大学);The University of Tokyo(东京大学)

Yichuan Mo, Dongxian Wu, Yifei Wang, Yiwen Guo, Yisen Wang

摘要:

视觉Transformer(ViTs)最近在宽视觉任务中实现了具有竞争力的性能。不幸的是,在流行的威胁模型上,自然训练的ViT并不比卷积神经网络(CNN)提供更多的对抗鲁棒性。对抗性训练仍然是必要的,以抵御这种对抗攻击。在本文中,我们通过对基准数据集上的各种训练技术进行广泛评估,首次全面研究了ViTs的对抗性训练方法。我们发现预训练和SGD优化器对于ViTs的对抗训练是必要的。进一步考虑ViT作为一种新型的模型架构,我们从其独特的架构组件的角度研究其对抗鲁棒性。我们发现,当在对抗性训练期间随机掩蔽来自某些注意力块的梯度或掩蔽某些补丁上的扰动时,ViTs的对抗性鲁棒性可以显着提高,这可能会开辟一条探索新设计的模型(如ViTs)内部架构信息的工作路线。我们的代码可在https://github.com/mo666666/When-Adversarial-Training-Meets-Vision-Transformers上获得。

英文摘要:

Vision Transformers (ViTs) have recently achieved competitive performance in broad vision tasks. Unfortunately, on popular threat models, naturally trained ViTs are shown to provide no more adversarial robustness than convolutional neural networks (CNNs). Adversarial training is still required for ViTs to defend against such adversarial attacks. In this paper, we provide the first and comprehensive study on the adversarial training recipe of ViTs via extensive evaluation of various training techniques across benchmark datasets. We find that pre-training and SGD optimizer are necessary for ViTs' adversarial training. Further considering ViT as a new type of model architecture, we investigate its adversarial robustness from the perspective of its unique architectural components. We find, when randomly masking gradients from some attention blocks or masking perturbations on some patches during adversarial training, the adversarial robustness of ViTs can be remarkably improved, which may potentially open up a line of work to explore the architectural information inside the newly designed models like ViTs. Our code is available at https://github.com/mo666666/When-Adversarial-Training-Meets-Vision-Transformers.

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

↑