All entries

    FGSM vs PGD: A Reproducible Robustness Test

    Compare FGSM and PGD with one perturbation budget and evaluate both against a clean baseline.

    A processing console shows clean and altered image paths
    Conceptual pixel-art illustration.

    Compare FGSM and PGD with one perturbation budget and evaluate both against a clean baseline.

    Build the example

    For a toy PyTorch classifier, choose a bounded input range and an L-infinity epsilon in pixel units. FGSM takes one sign-gradient step. PGD takes multiple steps, projecting each update back to the permitted neighborhood and valid input range. State whether PGD uses a random start, the step size and the number of iterations.

    On a normalized image fixture, explicitly convert the model input back to display coordinates to audit the resulting perturbation. A per-channel standard deviation can turn a nominally uniform step into different raw pixel changes. Check the maximum absolute difference and valid range for each sample. Save both the attack settings and the baseline metrics.

    Watch the failure boundary

    Generate the adversarial example in the same coordinate system as the allowed perturbation. If the model standardizes channels, put that transformation inside the forward pass for an attack defined on raw pixels. Keep random seeds fixed in a smoke test and use multiple starts in any comparison that depends on robustness claims.

    Verify the behavior

    Evaluate clean and perturbed accuracy on the same labelled fixtures. Check the maximum perturbation numerically and assert it respects the budget after any normalization. Report whether results include originally misclassified samples, and use test data and models you have authorization to attack.

    FURTHER READING

    Sources

    Technical references checked .

    END OF ENTRY / 66
    Eeshan Singh with Big Ben in London
    BEHIND THE JOURNAL

    Eeshan Singh

    I’m Eeshan Singh Pokharia, an AI Full Stack Developer and CoFounder of UltraFit360. I work across AI features, full-stack product development, and web and mobile experiences—from Figma and frontend interactions to the systems behind them.

    Generate the adversarial example in the same coordinate system as the allowed perturbation. If the model standardizes channels, put that transformation inside the forward pass for an attack defined on raw pixels. Keep random seeds fixed in a smoke test and use multiple starts in any comparison that depends on robustness claims.

    Meet the author
    THE CONVERSATION

    Your side of the story.