Abstract
Large pre-trained vision-language models (VLMs), such as CLIP, demonstrate impressive generalization but remain highly vulnerable to adversarial examples (AEs). Previous work has explored robust text prompts through adversarial training, achieving some improvement in both robustness and generalization. However, they primarily rely on single-gradient direction perturbations (e.g., PGD) to generate AEs, which lack diversity, resulting in limited improvement in adversarial robustness. To address these limitations, we propose an evolution-based region adversarial prompt tuning method called ER-APT, which combines gradient methods with genetic evolution to generate more diverse and challenging AEs. In each training iteration, we first generate AEs using traditional gradient-based methods. Subsequently, a genetic evolution mechanism incorporating selection, mutation, and crossover is applied to optimize the AEs, ensuring a broader and more aggressive perturbation distribution. The final evolved AEs are used for prompt tuning, achieving region-based adversarial optimization instead of conventional single-point adversarial prompt tuning. We also propose a dynamic loss weighting method to adjust prompt learning efficiency for accuracy and robustness. Experimental evaluations on various benchmark datasets demonstrate the superiority of our proposed method, outperforming state-of-the-art APT methods.
Introduction
Vision-Language Models (VLMs) have revolutionized AI by connecting images and text, but they possess a "glass jaw": adversarial examples (AEs). These are images with tiny, imperceptible perturbations that can trick a model into misclassifying an object entirely. Current defenses, known as Adversarial Prompt Tuning (APT), try to train models on these "tricky" examples. However, they typically rely on single-gradient direction methods (like PGD) to generate AEs. This approach is too narrow; it's like a boxer training to dodge only one specific type of punch. This leads to limited robustness and poor generalization when the model encounters a slightly different attack pattern.
Methodology: ER-APT
The authors introduce Evolution-based Region Adversarial Prompt Learning (ER-APT). The core idea is to move from "single-point" optimization to "region-based" optimization.
1. Evolutionary Adversarial Generation
Instead of generating one adversarial image per iteration, ER-APT maintains a population of adversarial candidates.
- Initialization: Start with traditional gradient-based perturbations.
- Selection: Keep the "fittest" individuals (those that cause the highest loss/confusion for the model).
- Mutation: Introduce random noise to explore the local neighborhood of an attack.
- Crossover: Linearly combine different adversarial perturbations to discover new, aggressive directions in the feature space.
2. Region-based Prompt Tuning
The model is then trained on this diverse population of evolved AEs. This forces the learnable prompts to be robust across a broader "region" of potential perturbations rather than just a single point.
3. Dynamic Loss Weighting
To manage the trade-off between "clean" accuracy and "robust" accuracy, ER-APT uses a dynamic weighting strategy. It monitors the learning speed of both tasks and automatically shifts weight to the lagging task, ensuring balanced optimization.
Experimental Results
The researchers evaluated ER-APT across 11 diverse image recognition datasets, covering generic objects (ImageNet-1K), textures (DTD), fine-grained categories (OxfordPets, Flowers102), and specialized domains (EuroSAT).
ER-APT consistently outperformed state-of-the-art (SOTA) methods like FAP:
- 16-Shot Robustness: Across 11 datasets, ER-APT achieved 36.22% robust accuracy (under a 100-step PGD attack), surpassing the previous SOTA of 34.61%.
- Generalization: When tested on entirely "new" classes, ER-APT showed a significant lead, improving accuracy by 4.3% to 4.43% over existing methods.
- Resilience: Even against Auto-Attack, ER-APT maintained superiority with an average improvement of 3.29% over the baseline.
Conclusion
ER-APT demonstrates that diversity in adversarial training is a powerful defense. By using genetic algorithms to explore adversarial "regions," the model avoids overfitting to specific attack styles. While the computational overhead is slightly higher (1.4x to 1.7x slower training), the gains in robustness and generalization are substantial. Future work will focus on closing the remaining gap between natural and robust accuracy and scaling these techniques to even larger multi-modal models.
Summary updated