Course contentsShow
← Security
Lesson 2811 of 3,05253. AI and ML SecurityFree lesson

Iterative Attacks: PGD and BIM

Understanding multi-step attacks like Projected Gradient Descent that find stronger adversarial examples through iteration.

Iterative Attacks: PGD and BIM

What you'll learn: How attackers use multi-step refinement to craft more effective adversarial examples that reliably fool ML models.

Beyond Single-Step Attacks

You've learned about FGSM—a single-step attack that nudges an input once in the gradient direction. While fast, FGSM often produces weak adversarial examples that only work under specific conditions. Iterative attacks solve this by taking multiple smaller steps, refining the perturbation at each iteration to find stronger, more reliable adversarial examples.

Think of it like carving wood: a single aggressive cut (FGSM) might overshoot or leave rough edges, but many careful cuts (iterative attacks) produce a precise result.

Projected Gradient Descent (PGD)

PGD is the gold standard iterative attack. It takes multiple small gradient steps, but crucially projects the result back into the allowed perturbation budget after each step. This ensures the adversarial example stays within acceptable bounds (like maximum pixel change).

The process:

  1. Start with an input (often randomly perturbed within budget)
  2. Compute gradient and take a small step
  3. Project back into the epsilon-ball constraint
  4. Repeat for N iterations

PGD explores the space of possible perturbations methodically, finding adversarial examples that exist at the boundary of your constraint.

Basic Iterative Method (BIM)

BIM (also called I-FGSM) is PGD's simpler cousin. It applies FGSM repeatedly with a small step size, clipping the result to stay within bounds. BIM starts from the original input rather than a random starting point, making it slightly less thorough but still powerful.

Both methods leverage iteration to escape local minima and find perturbations that consistently fool the model—even against defended networks.

Why Iteration Matters

Single-step attacks might accidentally overshoot the decision boundary. Iterative attacks follow the gradient landscape carefully, finding the minimum perturbation needed or the strongest adversarial example within your budget.

Key Takeaway: PGD and BIM use multiple small gradient steps with constraint projection to craft robust adversarial examples that reliably fool models—they're the benchmark for testing defensive robustness.