Attack small models with FGSM, PGD and C&W, and try poisoning, backdoors, defense, privacy and robustness evaluation in your browser, with real numbers.
- Home
- Image Attacks Lab
- Data Poisoning Lab
- Evasion Attacks Lab
- Defense Lab
- LLM Red Teaming Lab
- Model Privacy Lab
- Backdoor / Trojan Lab
- Robustness Evaluation Lab
- My experiments
- Scientific references
- Glossary and FAQ
FGSM: Fast Gradient Sign Method
Image Attacks Lab · Attack
Level 1: idea and analogy
The idea
A one-step attack that moves every pixel by ε in the direction that raises the loss.
Analogy
Like pushing a ball down the nearest slope: it takes the local direction once, without planning the whole path.
Level 2: how it works and when to use it
Steps
1) Compute the loss gradient w.r.t. the input. 2) Take its sign. 3) Multiply by ε and add. 4) Clip to [0,1].
When to use it
A quick fragility check, a baseline, and fast adversarial training.
Strengths
Very fast (one gradient); good for generating training examples and for a first check.
Level 3: mathematics, assumptions, limits
Mathematical form
x_{adv}=\mathrm{clip}_{[0,1]}\big(x+\varepsilon\cdot\mathrm{sign}(\nabla_x J(\theta,x,y))\big)Assumptions
Gradient access (white box) and a roughly linear loss inside the L∞ ball.
Limitations
Weaker than iterative attacks; its failure does not prove robustness. Gradient masking can fool it.
Metrics
Accuracy under attack, ASR, mean ‖δ‖∞ and ‖δ‖₂.
Defenses
Adversarial training, input compression and randomised transforms (evaluate them adaptively).
Level 4: pitfalls and references for researchers
Common pitfalls
Concluding that a model is "robust" because FGSM failed; ignoring clipping to [0,1]; comparing models at different ε.
References
- Goodfellow, I. J.; Shlens, J.; Szegedy, C. (2015). Explaining and Harnessing Adversarial Examples. ICLR 2015. Link
- Szegedy, C. et al. (2014). Intriguing properties of neural networks. ICLR 2014. Link
