PGDAttack<T, TInput, TOutput>
Models & Types · AiDotNet.AdversarialRobustness.Attacks
Implements the Projected Gradient Descent (PGD) attack.
Inheritance: AdversarialAttackBase<T, TInput, TOutput> → PGDAttack<T, TInput, TOutput>
For Beginners
PGD is like FGSM but repeated multiple times with smaller steps. Instead of one big jump, it takes many small steps, checking after each step to make sure it hasn’t gone too far. This makes it much more powerful than FGSM but also slower.
How It Works
PGD is an iterative variant of FGSM that applies multiple small perturbation steps, projecting back into the allowed perturbation region after each step.
PGD is considered one of the strongest first-order adversarial attacks and is commonly used for adversarial training and robustness evaluation.
Original paper: “Towards Deep Learning Models Resistant to Adversarial Attacks” by Madry et al. (2017)
Constructors
| Constructor | Summary |
|---|---|
PGDAttack(AdversarialAttackOptions<T> options) |
Initializes a new instance of the PGD attack. |
Methods
| Method | Summary |
|---|---|
TInput CalculatePerturbation(TInput original, TInput adversarial) |
|
TInput GenerateAdversarialExample(TInput input, TOutput trueLabel, IFullModel<T, TInput, TOutput> targetModel) |
Generates an adversarial example using the PGD attack. |