Evaluating Attack Success and Perturbation Budgets
What you'll learn: How to measure whether an adversarial attack worked and how much it "costs" in terms of visible changes to the input.
The Core Challenge
After generating adversarial examples using methods like FGSM or PGD, you need objective ways to answer two questions: Did the attack succeed? and How noticeable is the perturbation? These metrics help you compare different attack strategies and understand the trade-off between effectiveness and stealth.
Attack Success Metrics
Success rate is the primary metric: the percentage of inputs where the adversarial perturbation caused misclassification. For untargeted attacks, success means any wrong prediction. For targeted attacks, success means fooling the model into predicting a specific wrong class.
Robust accuracy flips this perspective—it measures the percentage of adversarial examples the model still classifies correctly despite the attack.
Perturbation Budgets and Perceptibility
A perturbation budget (often denoted as ε, epsilon) constrains how much you can modify the input. Common distance metrics include:
- L∞ (infinity norm): Maximum change to any single pixel/feature
- L2 (Euclidean distance): Total magnitude of changes across all dimensions
- L0: Number of features actually modified
Think of ε as your "noise budget"—smaller values mean more imperceptible attacks but potentially lower success rates.
The Trade-off Curve
Plot success rate against perturbation budget: as ε increases, attacks succeed more often but become more noticeable. This curve reveals model vulnerability. A robust model requires large, visible perturbations to fool, while a fragile one fails with tiny, imperceptible changes.
Key Takeaway: Evaluating adversarial robustness requires measuring both attack success rates and perturbation magnitude using distance metrics like L∞ or L2, revealing the fundamental trade-off between attack effectiveness and perceptibility.