liveBook · Manning

Adversarial input

As explained in Deep Learning with R, Third Edition

An adversarial example is an input deliberately or naturally modified in a small way that causes a machine-learning model to produce an incorrect output.

An adversarial input is a sample changed in a small, often deliberate way to make a machine-learning model produce the wrong output. It exposes a gap between model sensitivity and human perception. section 19.1.2

A panda classified as a gibbon

Gradient ascent can slightly modify a panda image to maximize the model’s prediction for “gibbon.” The altered image may look unchanged to people while overturning the model’s classification. section 19.1.2

Related sensitivity appears in several forms:

  • Image models can be tricked by carefully designed pixel changes. section 19.1.2
  • LLMs can fail when names, places, numbers, or code variable names change slightly. section 19.1.2
Figure 19.3 An adversarial example: imperceptible changes in an image can upend a model’s classification of the image.
figure

Use the figure to inspect how imperceptible image changes can reverse a model’s classification. section 19.1.2

How Deep Learning with R, Third Edition covers it

How deep it goes
Explains the idea through gradient ascent and examples, but does not develop attack algorithms or defenses.
Examples
Uses a panda-to-gibbon image change and an Alice in Wonderland riddle with altered numerical values.
What it assumes
Assumes familiarity with gradient ascent and convolutional-network filter visualization.
What you can do after
Evaluate how apparently harmless input changes can expose mismatches between model predictions and human judgment.
How it connects
Connects adversarial examples with gradient ascent, filter visualization, image classification, LLMs, and prompt engineering.

Also explained in

Compare how 5 books explain adversarial input →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Deep Learning with R, Third Edition. The section links point to the parts of the book it draws on.