Visual Prompting for Adversarial Robustness

Aochuan Chen, Peter Lorenz, Yuguang Yao, Pin-Yu Chen, Sijia Liu
10/12/2022
51 citations
cs.CVcs.CRcs.LG

Official code: Phoveran/vp-for-adversarial-robustness (12 stars, Python, MIT, last commit 2023-08-12).

Abstract

In this work, we leverage visual prompting (VP) to improve adversarial robustness of a fixed, pre-trained model at testing time. Compared to conventional adversarial defenses, VP allows us to design universal (i.e., data-agnostic) input prompting templates, which have plug-and-play capabilities at testing time to achieve desired model performance without introducing much computation overhead.

Show full abstract

Although VP has been successfully applied to improving model generalization, it remains elusive whether and how it can be used to defend against adversarial attacks. We investigate this problem and show that the vanilla VP approach is not effective in adversarial defense since a universal input prompt lacks the capacity for robust learning against sample-specific adversarial perturbations. To circumvent it, we propose a new VP method, termed Class-wise Adversarial Visual Prompting (C-AVP), to generate class-wise visual prompts so as to not only leverage the strengths of ensemble prompts but also optimize their interrelations to improve model robustness. Our experiments show that C-AVP outperforms the conventional VP method, with 2.1X standard accuracy gain and 2X robust accuracy gain. Compared to classical test-time defenses, C-AVP also yields a 42X inference time speedup.

View on arXivView PDF

Code Implementations(1)

MIT

[ICASSP23] "Visual Prompting for Adversarial Robustness" by Aochuan Chen*, Peter Lorenz*, Yuguang Yao, Pin-Yu Chen, and Sijia Liu

124PythonOct 27, 20223 years agoMIT

Similar Papers

Cite this paper

@article{chen2022visual,
  title  = {Visual Prompting for Adversarial Robustness},
  author = {Aochuan Chen and Peter Lorenz and Yuguang Yao and Pin-Yu Chen and Sijia Liu},
  year   = {2022},
  eprint = {2210.06284},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2210.06284}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2210.06284.svg)](https://codeofpaper.com/paper/2210.06284)

Discussion