Adversarial Attacks on Machine Learning Models

January 20, 2026

Adversarial Attacks on Machine Learning Models

Machine learning models have a surprising vulnerability: they can be fooled by inputs that look completely normal to humans. A picture of a panda with a few pixels changed becomes, to the model, a gibbon. A stop sign with a strategically placed sticker becomes a speed limit sign. An audio command with subtle distortions becomes a different command entirely.

These are adversarial attacks: deliberately crafted inputs designed to cause model mispredictions. As ML models become embedded in more systems, understanding these attacks becomes essential for AI safety.

What Makes an Attack Adversarial

Adversarial examples share two key characteristics.

First, they cause the model to produce incorrect outputs. A correctly classified image becomes misclassified. A correctly detected object becomes invisible. A correctly transcribed audio becomes wrong.

Second, the perturbation that causes the error is small by some measure. The modified input looks identical (or nearly identical) to the original. A human examining the adversarial example would typically reach the correct conclusion even though the model does not.

This combination is what makes adversarial attacks concerning. If modifications were obvious, humans could catch the errors. If they did not cause mispredictions, they would not matter. The combination of invisible modifications and significant model failures creates security risks that traditional validation cannot address.

Threat Models

Adversarial attacks vary based on what the attacker knows and can access. Understanding these threat models clarifies what defenses are needed.

White Box Attacks

In white box attacks, the adversary has complete access to the model: its architecture, weights, training data, and training procedure. They can compute gradients through the model and use optimization to find minimal perturbations that cause mispredictions.

White box attacks are the most powerful in terms of finding adversarial examples. They represent a worst-case scenario where the attacker has full knowledge of the system.

In practice, white box access may be realistic for models deployed on user devices (where weights can be extracted) or models whose details have been published.

Black Box Attacks

In black box attacks, the adversary can query the model but cannot see its internals. They submit inputs and observe outputs but do not have access to architecture or weights.

Black box attacks are more realistic for cloud-deployed models accessed through APIs. The attacker can probe the model many times but cannot directly compute gradients.

Black box attacks typically require more queries than white box attacks but remain effective. Techniques include transferability (attacks generated against one model often transfer to others), query-based optimization (using model outputs to guide search), and surrogate models (training a local model to approximate the target and attacking the surrogate).

Perturbation Constraints

Adversarial perturbations are constrained to be "small" in some sense. Different constraints capture different attack scenarios.

L0 Norm

L0 perturbations modify only a limited number of input features. For images, this means changing only a few pixels. For other data types, it means changing only a few input values.

L0 attacks are particularly relevant for real-world scenarios. A sticker on a stop sign modifies only the pixels it covers. An attacker tampering with sensor data may only be able to change certain readings.

L2 Norm

L2 perturbations are constrained by the Euclidean distance between original and modified inputs. The total magnitude of changes is limited, though changes can be distributed across all features.

L2 attacks often produce perturbations that are visible but subtle: a light "noise" overlaid on the entire input.

L-infinity Norm

L-infinity perturbations are constrained by the maximum change to any single feature. Each pixel (or feature) can change by at most epsilon, regardless of how many change.

L-infinity attacks are mathematically convenient and widely studied. They produce perturbations where every feature may be slightly modified but none are modified dramatically.

Why Models Are Vulnerable

The vulnerability to adversarial examples reflects fundamental properties of how neural networks learn.

Models learn decision boundaries in high-dimensional space. These boundaries are complex surfaces that separate different classes. Near the boundary, small changes in input can cross from one class to another.

The high dimensionality is key. In high-dimensional spaces, almost every input is close to a decision boundary. The number of directions available for perturbation is enormous. Finding a direction that crosses a boundary, while keeping the perturbation small, turns out to be easier than intuition suggests.

Additionally, models are trained to minimize average error, not worst-case error. The training objective does not penalize the existence of nearby adversarial examples as long as clean test accuracy is high.

Defenses and Their Limitations

Research has explored many defenses against adversarial attacks. Most have limitations.

Adversarial Training

The most effective defense trains models on adversarial examples alongside clean data. The model learns to classify correctly even when inputs are perturbed.

Adversarial training improves robustness against the attack types included in training. However, it is computationally expensive, may reduce accuracy on clean data, and may not generalize to attack types not seen during training.

Certified Defenses

Certified defenses provide mathematical guarantees: no perturbation within certain bounds can cause misclassification. These are valuable because they guarantee security rather than just empirically demonstrating it.

Certified defenses typically apply only to specific perturbation types and may significantly reduce model capacity or accuracy.

Detection

Rather than preventing adversarial examples from succeeding, detection approaches identify when inputs appear adversarial and reject them.

Detection is challenging because sophisticated attacks can evade detection. An attacker who knows the detection mechanism can craft adversarial examples that also fool the detector.

Input Preprocessing

Preprocessing inputs (compression, smoothing, etc.) can sometimes remove adversarial perturbations while preserving the underlying content.

Preprocessing is easily circumvented by adaptive attacks that account for the preprocessing in generating adversarial examples.

Practical Implications

The significance of adversarial attacks depends on the deployment context.

Security-Critical Applications

For applications where attackers have motivation and capability to launch adversarial attacks, robustness is essential. This includes:

Systems with physical access (autonomous vehicles, facial recognition, surveillance) Systems where users submit inputs (content moderation, malware detection) Systems with valuable targets (financial fraud, access control)

For these applications, adversarial robustness should be a design requirement alongside accuracy.

Non-Adversarial Applications

Many ML applications face minimal adversarial threat. Internal analytics, scientific research, and applications with no motivated attacker may not need adversarial robustness.

However, even non-adversarial applications can encounter adversarial-like failures naturally. Unusual inputs that happen to lie near decision boundaries may cause unexpected errors. The same vulnerabilities that enable adversarial attacks enable natural failures on edge cases.

Monitoring for Robustness

Model monitoring should include robustness assessment for security-critical applications.

Monitor for anomalous inputs that may indicate attack probing. Unexpected patterns of queries or unusual input characteristics could signal adversarial activity.

Periodically test robustness against known attack methods. Models may become more vulnerable over time as data distributions shift.

Track whether model errors cluster in input regions that might be targeted by adversaries. Systematic failures in specific regions may indicate vulnerability.

Building Robust Systems

Beyond model-level defenses, system design can improve robustness.

Defense in Depth

Do not rely on a single model for security-critical decisions. Multiple models, potentially with different architectures, make it harder to find adversarial examples that fool all of them.

Human Oversight

Keep humans in the loop for consequential decisions. Adversarial examples that fool models may not fool human review.

Graceful Degradation

Design systems to fail safely when model outputs are uncertain. Reject inputs where confidence is low or prediction patterns are unusual.

Monitoring and Response

Build infrastructure to detect and respond to attacks. Even if adversarial examples cannot be prevented entirely, detecting them quickly limits damage.

Looking Forward

Adversarial machine learning remains an active research area. New attacks emerge regularly, as do new defenses. The arms race between attackers and defenders will likely continue.

For practitioners, the implication is that adversarial robustness requires ongoing attention. Security assessments must be updated as new attacks are discovered. Defenses must evolve as attack capabilities advance.

AI governance frameworks should establish expectations for adversarial robustness based on application risk. High-risk applications require more stringent robustness evaluation and defense.

The existence of adversarial attacks does not mean ML systems cannot be trusted. It means that trust must be calibrated to include awareness of these failure modes. Systems designed with robustness in mind can provide reliable service even in adversarial environments. Systems that ignore adversarial risks face potential exploitation with consequences that depend on what those systems control.

Understanding adversarial attacks is part of understanding what ML systems can and cannot reliably do. That understanding is essential for deploying AI responsibly.

Join our newsletter for AI Insights