CS38300 / Ethics in ML

MNIST adversarial attack demo

A browser-side FGSM explainer using real MNIST test images and a small CNN trained for this project. Move epsilon to compute a new adversarial image from the input-gradient sign and watch the classifier confidence shift.

Status

Loading model weights...

Next.jsTensorFlow.jsMNISTFGSM
Attack result

Clean: loading -> Attacked: loading

Still correct
Original MNIST sample
Test index -
FGSM perturbation
No perturbation
Adversarial image
Classifier remains correct
Method

x_adv = clip(x + epsilon * sign(grad_x loss(model, x, y)))

This is untargeted FGSM. The demo recomputes the input gradient in the browser for the selected image and epsilon. It is an educational visualization, not a robust adversarial-ML benchmark.