Home▸Articles▸Cybersecurity

Adversarial Attacks: FGSM & PGD Perturbation Visualizer

Understanding how small, carefully crafted perturbations can fool machine learning models.

mysimulator teamUpdated June 2026≈ 3 min read▶ Open the simulation

What Adversarial Attacks Are

Adversarial attacks are malicious manipulations of input data designed to deceive machine learning models, often with imperceptible changes. These perturbations can cause misclassifications by exploiting the model's decision boundaries.

The Fast Gradient Sign Method (FGSM) and Projected Gradient Descent (PGD) are two popular techniques for generating such attacks, each with its own approach in crafting these subtle yet effective perturbations.

How FGSM & PGD Work

The Fast Gradient Sign Method (FGSM) creates a single-step adversarial perturbation by scaling the gradient of the loss function with respect to the input data. This method is simple but can be effective in pushing model predictions across decision boundaries.

Projected Gradient Descent (PGD), on the other hand, iteratively updates the input data within an L-infinity norm budget, making it more robust and capable of generating adversarial examples that are less likely to be detected.

live demo · related simulation● LIVE

Why Adversarial Attacks Matter

Adversarial attacks highlight vulnerabilities in machine learning models, especially those used in critical applications like autonomous driving or medical diagnosis. Understanding these attacks is crucial for developing more secure and robust systems.

By studying adversarial attacks, researchers can improve model resilience through techniques such as adversarial training, which aims to make decision boundaries smoother and less susceptible to small perturbations.

Real-World Implications

In the realm of cybersecurity, adversarial attacks can compromise the integrity of AI systems used in financial transactions or security applications. For instance, an attacker could manipulate images to fool facial recognition systems.

Adversarial training and other defense mechanisms are essential for ensuring that machine learning models remain reliable even when faced with malicious inputs.

Frequently asked questions

What is the difference between FGSM and PGD?

FGSM creates a single-step adversarial perturbation, while PGD iteratively updates the input data within a given budget to generate more robust adversarial examples.

How can adversarial attacks be prevented or mitigated?

Adversarial training and defensive distillation are techniques that can make machine learning models more resilient to adversarial attacks by making their decision boundaries smoother and less susceptible to small perturbations.

Why is it important to study adversarial attacks in cybersecurity?

Studying adversarial attacks helps identify vulnerabilities in AI systems, which can be exploited for malicious purposes. Understanding these attacks aids in developing more secure and robust machine learning models.

Can adversarial attacks affect all types of machine learning models?

Yes, adversarial attacks can affect various types of machine learning models, including deep neural networks, support vector machines, and decision trees, as long as they have decision boundaries that can be exploited.

Try it live

Everything above runs in your browser — open Adversarial Attacks: FGSM & PGD Perturbation Visualizer and change the parameters while it is running. Nothing is installed, nothing is uploaded, the whole model lives in one tab.

▶ Open Adversarial Attacks: FGSM & PGD Perturbation Visualizer simulation

What did you find?

Add reproduction steps (optional)