Skip to content
BIASED

Adversarial examples

Block 1 of 6~2 min

Accuracy and robustness

Vision Transformers closed the representations module: CNNs and ViTs that reach high accuracy on held-out images. Every accuracy in the course so far was measured the same way — on test images drawn like the training images. This topic measures something else: accuracy on inputs chosen by someone who wants the network to fail.

A digit MLP can score 0.9650.965 clean, stay at 0.9560.956 under random ±0.1\pm 0.1 noise, and fall to 0.4300.430 when the same budget uses attack signs. Size is the same; direction differs. An adversarial example for xx with label yy is an x′x' with

∥x′−x∥∞≤ε,x′∈[0,1]d,fθ(x′)≠y.\|x' - x\|_\infty \le \varepsilon, \qquad x' \in [0, 1]^d, \qquad f_\theta(x') \ne y.

The allowed set is the threat model. Robust accuracy at budget ε\varepsilon is the fraction of tests for which no such x′x' exists; an attack only upper-bounds it. Standard budgets: ε=0.3\varepsilon = 0.3 on MNIST, ε=8/255\varepsilon = 8/255 on CIFAR-10.

Answers are saved on the server and tied to this browser until you sign in.

Go deeper — optional

Code and labs do not count toward the main percentage or the certificate.

  • FGSM: one step on a logistic unitoptional

    Reproduces the topic worked example: gradient sign, ε=0.3, logit sign flip. Self-check in the notebook.

    ~15 min · easier on a computer · Adversarial examples topic read.

    Self-check in the notebook — not part of mastery or the certificate.