Adversarial AI Attacks with PyTorch + IBM ART
π§ What if AI could be tricked?
Imagine training a high-performing AI model, clean dataset, stellar accuracy, flawless predictions. But then⦠a small, almost invisible noise and suddenly your AI sees a panda instead of a stop sign. That's the terrifying beauty of adversarial attacks. I spent days diving into this problem trying to understand, simulate, and outsmart it. What began as curiosity quickly became obsession. I wanted to see the AI's weakness, to show how even the most confident model could be deceived... pixel by pixel.
π₯ What you get
This is not just another notebook. Itβs a complete hands-on guide to adversarial attacks using real PyTorch models and the powerful IBM Adversarial Robustness Toolbox (ART).
Hereβs whatβs inside:
- β Clean `.ipynb` file
- β Easy `requirements.txt` to get started in minutes
- β Side-by-side original vs adversarial image comparisons
- β Beautifully structured `README.md` file
- β All images generated and stored in an organized folder
π Included Adversarial Attacks:
-
Fast Gradient Method (FGM / FGSM)
βββ Type: Evasion Attack (White-box)
βββ Description: A fast, one-step attack that perturbs input data using the gradient of the loss with respect to the input. -
Copycat CNN
βββ Type: Model Extraction Attack
βββ Description: Queries a target model to train a substitute model that mimics its behavior, revealing internal patterns. -
Adversarial Noise Attack
βββ Type: Evasion Attack (White-box)
βββ Description: Adds specifically crafted noise to inputs to trick the model into misclassifying, based on adversarial perturbations.
π¦ Who is this for?
- π Students & researchers studying AI security
- π§βπ» Developers building robust models for production
- π€― Anyone who wants to see AI being fooled β live
π Letβs Break AI (Before It Breaks Us)
This is a real-world project born from curiosity, refined with passion, and shared so others can learn, explore, and innovate.
Take it. Modify it. Break it. Defend against it.
The world needs smarter AI and it starts with understanding its flaws.
Discover how AI can be fooled and how you can break, manipulate, and defend it. Includes full code, visuals, and real-world attacks built with IBM ART.