Join our Newsletter — 33% off our NHI Course
Home› Guides› Adversarial Examples for Beginners: How Small Changes Fool…
Guide AI Threats & Model Security

Adversarial Examples for Beginners: How Small Changes Fool AI Models

PDF for newsletter subscribers · free to read online

← All guides
By NHI Mgmt Group, under the editorial direction of Lalit Choda Updated 30 November 2026 10 min read
On this page

An adversarial example is an input changed on purpose, often very slightly, so an AI model gets it wrong.

This guide is for students, managers and anyone curious about how AI can be tricked, and how teams defend against it. You do not need to build AI to be affected: if your business relies on AI to check photos, documents or messages, this matters to you.

In short

  • AI models learn patterns from examples, and those patterns can be fooled.
  • A small, careful change to a photo, sound or text can make a model give a wrong answer with confidence.
  • Researchers have shown this in the physical world, for example with stickers on a road sign.
  • Defences include testing with tricky inputs, training on them, adding extra checks and keeping a person for important decisions.

What you will learn

  • Explain what an adversarial example is in one sentence.
  • Spot where your organisation relies on an AI model to judge inputs.
  • Check whether a model has been tested against tricky inputs.
  • Ask a supplier what defences their model has.
Pattern learner (AI model)
software that has learned to make guesses from many examples.
Trick input (adversarial example)
an input changed on purpose so the model guesses wrong.
Toughness (robustness)
how well a model keeps giving the right answer when inputs are changed.

What is an adversarial example?

Think of an optical illusion. Your eyes see lines that look bent, even though they are straight. An adversarial example is an optical illusion made for a computer.

An AI model learns from lots of examples. It does not see a stop sign the way you do. It reacts to small patterns of colour and shape. If someone changes those patterns in just the right way, the model can give a very different answer.

The change can be tiny. A person may not notice it at all, or may think it is a bit of dirt or a sticker. The model, though, may be very sure of its wrong answer.

Where the comparison stops working: an optical illusion fools most people in the same way by accident. An adversarial example is usually made on purpose, and it may fool one model but not a person.

This is different from prompt injection, where someone hides instructions in text for a chatbot. Adversarial examples change the input itself so the model reads it wrongly.

Why does it matter?

More decisions now rely on AI models that judge pictures, sounds and text. If the model can be fooled, the decision can be wrong.

If you manage a team that uses AI

What could happen: a model that checks uploaded photos or documents lets through a doctored one.

Check this: ask whether the model was tested with tricky inputs before it went live.

Next: AI Security for Beginners

If you are a student

What could happen: you build a model that scores well in tests but fails on slightly changed inputs.

Check this: try small changes to your test data and see whether the answers hold.

Next: Machine Learning for Beginners

If you buy AI products

What could happen: a supplier's accuracy figure hides how easily the model can be tricked.

Check this: ask the supplier how they test toughness, not only accuracy.

Next: AI Red Teaming Guide

What does it look like?

Here is a made-up test record. A team is checking its own photo model.

Example only. All values are made up.

TEST LOG  model: EXAMPLE-photo-checker v0.0
photo_0001.png  original        -> "damaged parcel"   score 0.97  (1)
photo_0001.png  small changes   -> "undamaged parcel" score 0.95  (2)
photo_0002.png  original        -> "undamaged parcel" score 0.98
photo_0002.png  small changes   -> "undamaged parcel" score 0.96  (3)
result: 1 of 2 changed photos fooled the model     (4)
  1. The model gets the normal photo right and is very sure.
  2. After small changes, it gives the opposite answer. It is still very sure.
  3. Here the model holds firm. Toughness can differ from input to input.
  4. In a real file, this line would show how often the test changes fooled the model.

Why this is risky: a high score does not mean the answer is right. A model that only passed normal tests may be easy to fool.

The safer way: test with changed inputs before launch, fix what fails, and send unsure or high-stakes cases to a person.

How does it work?

  1. The model learns patterns. It is trained on many labelled examples, such as photos marked "stop sign".
  2. The patterns have weak spots. Researchers have shown that small, worst-case changes to an input can make a model confidently wrong. Such changes can work against more than one model.[1]
  3. Someone finds a change that hits a weak spot. This can be a pattern of pixels, a sound, or stickers on a real object.
  4. The model gives the wrong answer. In one study, researchers put black and white stickers on a real stop sign. In a drive-by test, a road sign model misread it in most video frames (84.8%).[2]
  5. Defenders test and harden. Teams test their own models with changed inputs and can train on such examples, an approach called adversarial training.[1] Free toolkits exist to help with this testing.[4]
Diagram titled How a small change can fool an AI model. On the left, two inputs: a normal photo of a stop sign, and the same photo with small stickers that look harmless to people. Both go into a box labelled AI model, which looks for patterns it learned. On the right, two answers: the normal photo gives Stop sign, in green; the photo with stickers gives A different sign, wrong but confident, in red. A box at the bottom lists defences: test with tricky inputs, train on them, add checks, and keep a person for important decisions.
Figure 1. The same sign, with and without small changes, can get different answers from a model. Simplified from published research.

US government researchers have published a shared set of terms for attacks on machine learning, so teams can describe these risks in the same way.[3] No single defence is known to work against every trick input, so we suggest using several layers.

There is an identity angle too. A model in production is usually reached through a service that uses a non-human identity (NHI), such as an API key. Limiting who and what can send inputs, and how often, makes it harder for someone to keep trying changes until one works.

A worked example

Lina Delmar manages the returns team at an online shop. Customers who say a parcel arrived damaged upload a photo. An AI model checks the photo and approves a refund when it sees damage.

The refunds look normal, but Lina wants to be sure the model is hard to fool. She asks Leila Tanaka, who works in the security team, to help.

Leila does not attack anyone else's system. She tests the shop's own model on a copy, with the supplier's agreement. She takes test photos and makes small changes to them using a testing toolkit.

Some changed photos of undamaged parcels get marked as damaged. The model is very sure each time. Leila writes down which changes worked and shares the results with the supplier.

The supplier retrains the model with changed photos included. Leila tests again, and fewer changed photos get through.

Lina also changes the process. Refunds above a set amount now go to a person for a quick check. Photos the model is unsure about go to a person too. Leila limits how many photos one account can upload in an hour, and reviews which keys can send photos to the model.

Lina adds a yearly test to the team's plan. She knows the model is not perfect. But she now knows where it is weak, and a person checks the cases that matter most.

Myths and mistakes

What people thinkWhat is true
A model with high accuracy cannot be fooled.Accuracy on normal tests says little about toughness against changed inputs. Test both.
A high confidence score means the answer is right.Trick inputs can produce wrong answers with high confidence.
This only happens in the lab.Researchers have shown it with stickers on a real road sign.
One fix solves it.Defences help but are not complete. Use several layers, including a person for high-stakes decisions.
It is the same as prompt injection.They are related but different. Prompt injection hides instructions; adversarial examples change the input so the model misreads it.

What can I do this week?

  • List the places where an AI model judges photos, sounds, documents or text for your organisation.
  • Mark the ones where a wrong answer could cost money or harm someone.
  • Ask the owner or supplier how the model was tested against changed inputs.
  • Make sure high-stakes or unsure cases go to a person.
  • Check which keys and accounts can send inputs to each model, and limit them.

Checklist

  • I know which decisions rely on an AI model.
  • Each important model has been tested with changed inputs.
  • Test results are recorded and shared with the model owner.
  • High-stakes or unsure cases go to a person.
  • Only approved services and keys can send inputs to the model.
  • There are limits on how many inputs one account can send.
  • Testing is repeated after the model changes.

Common questions

Can people see the changes in an adversarial example?

Often not, or not as anything worrying. The changes can be so small that a photo looks the same, or they can look like stickers or dirt. That is why testing matters: you cannot rely on a person spotting the trick by eye.

Does this affect chatbots too?

Yes, in a related way. Text can also be changed so a model misreads it. Chatbots face a separate problem called prompt injection, where hidden instructions are slipped into text. Both need testing, and they need different defences.

Is testing my own model with trick inputs allowed?

Testing your own model, or one you have written permission to test, is a normal defensive step. Testing someone else's system without permission is not. Agree the scope in writing first, and use a copy of the model where you can.

What is adversarial training?

Adversarial training means adding trick inputs, with the right labels, to the examples a model learns from. The model then learns to handle them better. It improves toughness against the kinds of changes it saw, but it does not cover every possible change.

Where next?

Ready for the detail? Read the practitioner guide: Adversarial Robustness Toolbox Guide. It goes further into how to run robustness tests, the main types of defence and the measures used to score toughness.

Also useful:

Related NHI Mgmt Group resources: AI Data Poisoning and Backdoors Guide, OWASP Machine Learning Security Top 10, AI Red Teaming Guide.

Key terms

Adversarial example
An input changed on purpose so an AI model gives a wrong answer.
Evasion attack
Using trick inputs to get past a working AI model, such as a filter or checker.
Adversarial robustness
How well a model keeps giving right answers when inputs are changed on purpose.
Adversarial machine learning
The study of attacks on AI models and how to defend against them.
Training data
The examples a model learns from.
Data poisoning
Tampering with training data so a model learns the wrong thing.

Sources and further reading

  1. Goodfellow, I. J., Shlens, J. and Szegedy, C., "Explaining and Harnessing Adversarial Examples", arXiv:1412.6572, 2014 (v3 2015). arxiv.org (accessed 30 Nov 2026).
  2. Eykholt, K. et al., "Robust Physical-World Attacks on Deep Learning Models", arXiv:1707.08945, 2017 (v5 2018). arxiv.org (accessed 30 Nov 2026).
  3. NIST, "Adversarial Machine Learning: A Taxonomy and Terminology of Attacks and Mitigations", NIST AI 100-2 E2025, March 2025. csrc.nist.gov (accessed 30 Nov 2026).
  4. Adversarial Robustness Toolbox (ART), project repository and documentation, Linux Foundation AI and Data. github.com (accessed 30 Nov 2026).

PDF for subscribers

Take this guide with you

Every section, table and checklist in one PDF, with links to the sources and related guides. Subscribe to our weekly NHI & AI Identity Journal and we’ll email you a download link.

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.

PDF Downloads for Newsletter Subscribers

Get the guide

Enter your details and we’ll email you a download link.

The full guide is free to read online. The PDF is a thank you for subscribing.

Fill in all fields marked * and tick both boxes to continue.