AI Attacks
Isometric illustration of a central pink block ringed by scattered cubes on a dark board, representing tiny pixel changes that flip a model's prediction
Explainer

Adversarial Examples Explained Simply: How Pixels Fool a Model

A plain-language walkthrough of adversarial examples: what they are, why neural networks fall for them, how FGSM works, and what defenders can do.

By AI Attacks Editorial · ·Updated August 18, 2026 · 5 min read

Here are adversarial examples explained simply: an adversarial example is an input a model gets wrong on purpose, because someone added a small, carefully chosen perturbation designed to push the prediction across a decision boundary. To a human the changed input looks identical to the original. To the model it is now a completely different thing. Change a handful of pixel values by an amount your eye cannot detect and a classifier that was 99% sure it saw a panda is suddenly 99% sure it saw a gibbon. That specific panda-to-gibbon result comes from the 2014 paper by Goodfellow, Shlens, and Szegedy, which remains the cleanest illustration of the phenomenon.

The problem is not a bug in one model. It is a structural property of how neural networks draw decision boundaries, and it has held up across a decade of attempts to make it go away.

What an adversarial example actually is

Start with a trained image classifier. It takes an input, runs it through learned weights, and outputs a probability for each class. Training pushed those weights so that clean images land on the correct side of every decision boundary. The boundaries are high-dimensional and not intuitive, which is the whole point.

An attacker does not need to retrain anything. They take a correctly classified input and ask a different question: what is the smallest change to this input that moves it to the wrong side of a boundary? Because the model is differentiable, you can answer that with calculus. Compute the gradient of the loss with respect to the input pixels, then step the pixels in the direction that increases the loss. You are running training in reverse, optimizing the image instead of the weights, with the goal of being wrong.

The constraint that makes this an attack rather than just image editing is the size limit on the change. Attacks are usually bounded by an L-infinity norm, meaning no single pixel may change by more than some tiny epsilon. Stay under that budget and the perturbation is invisible to a person while still being more than enough to flip the model. This was first documented in the 2013 paper “Intriguing properties of neural networks”, which showed that imperceptible perturbations reliably cause misclassification.

Why models fall for it

The intuitive guess is that neural networks are too complex and nonlinear, and adversarial examples exploit some weird fold in that complexity. Goodfellow and colleagues argued the opposite. Their explanation is that models are too linear, not too nonlinear.

Think about a single neuron computing a weighted sum of thousands of inputs. Nudge every input by a tiny epsilon in the direction of its weight’s sign, and each tiny nudge adds up. In a high-dimensional space with thousands of dimensions, thousands of imperceptible nudges sum into a large shift in the neuron’s output. The perturbation per pixel stays under the visibility threshold, but the aggregate effect on the model’s internal activations is enormous. This is why the fast gradient sign method (FGSM) works: take the sign of the gradient, multiply by epsilon, add it to the image, done in a single step.

A second uncomfortable property is transferability. An adversarial example crafted against one model often fools a different model trained on different data. The 2013 work found that the same perturbation misclassifies across independently trained networks. For attackers this is the gift that keeps giving: you can craft against a model you own and fire the result at a target you have never seen, which turns many white-box attacks into practical black-box ones.

From pixels to the physical world

It is tempting to dismiss this as a lab curiosity that needs direct API access to a model’s raw input. It does not. In “Robust Physical-World Attacks on Deep Learning Models”, researchers printed black and white stickers, applied them to a real stop sign, and drove past it. The perturbation survived the camera, the lighting, the angles, and the motion. Their algorithm produced targeted misclassification in 100% of lab images and 84.8% of video frames captured from a moving vehicle.

That result matters because it breaks the assumption that the attacker needs to touch the tensor. A sticker, a printed patch, or a manipulated document is enough when the model sits behind a camera or a scanner. Any perception pipeline feeding a downstream decision inherits this exposure.

Where this fits in the threat model

Adversarial examples are the classic case of an evasion attack: the model is not modified, the training data is not poisoned, only the input at inference time is manipulated. The NIST AI 100-2 E2025 taxonomy formalizes this, separating evasion from data poisoning and privacy attacks, and splitting attacker knowledge into white-box (full access to weights and gradients) and black-box (query access only). Getting the category right matters, because the defenses differ. Guarding against a poisoned training set is a data-provenance problem; guarding against evasion is a runtime robustness problem.

The same core idea has migrated well beyond image classifiers. Malware detectors, spam filters, network intrusion classifiers, and speech systems all live on learned decision boundaries, and all can be pushed across those boundaries by an input crafted with the same gradient logic. If your product makes a decision from a model output, evasion is in scope.

What defenders can actually do

There is no clean fix, so treat this as risk reduction, not elimination.

  • Adversarial training. Generate adversarial examples during training and include them in the loss. This is the most reliable known defense and the current baseline, but it costs accuracy on clean inputs and buys robustness mainly against the attack types you trained on.
  • Do not trust obfuscation. Defenses that hide or mask gradients tend to fail against adaptive attackers who estimate the gradient anyway. Evaluate any defense against an attacker who knows the defense exists.
  • Monitor inputs in production. Distribution shift and anomalous input statistics are a signal that something is probing your model. Runtime observability and drift detection, the kind of tooling covered at SentryML, turns a silent evasion campaign into an alert.
  • Add guardrails at the boundary. Input validation, ensembling, and output-confidence thresholds raise the cost of an attack even when they do not stop it. The defensive-AI tradeoffs here are the subject of ongoing work at GuardML.
  • Assume transferability. Do not treat a private model as a secret defense. Craft your own adversarial examples against it and measure how badly it fails before an attacker does it for you.

The honest summary: adversarial examples are a durable, well-understood consequence of how gradient-trained models carve up their input space. You can make them more expensive to produce and easier to detect. You cannot yet make them go away.

Sources

  1. Intriguing properties of neural networks (Szegedy et al., 2013)
  2. Explaining and Harnessing Adversarial Examples (Goodfellow et al., 2014)
  3. Robust Physical-World Attacks on Deep Learning Models (Eykholt et al., 2017)
  4. NIST AI 100-2 E2025: Adversarial Machine Learning Taxonomy
#adversarial-examples#machine-learning-security#evasion-attacks#model-robustness#fgsm
Subscribe

AI Attacks — in your inbox

Practitioner-grade AI red team techniques and tooling — delivered when there's something worth your inbox.

No spam. Unsubscribe anytime.

Related