Skip to content
This repository was archived by the owner on Dec 15, 2025. It is now read-only.

Sonofg0tham/AI-Adversarial-Attack-Demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AI Adversarial Attack Demo

A hands-on demonstration suite for understanding, generating, and defending against adversarial attacks in AI models. This project is designed for security-conscious AI practitioners, researchers, and anyone interested in the intersection of machine learning and cybersecurity.

Demo Videos

See the project in action:

  • Adversarial Attack (adversarial_demo.py)
    Watch on Loom
    Demonstrates how a well-trained AI model can be fooled by subtle, malicious inputs. This establishes the real-world threat and your expertise in adversarial machine learning.

  • Defense (defense_demo.py)
    Watch on Loom
    Shows how to make the model more robust, resisting the attacks shown above. Demonstrates your ability to implement defensive controls—critical for DevSecOps roles.

  • Detection (detection_demo.py)
    Watch on Loom
    Demonstrates monitoring and detecting adversarial attacks in progress, similar to an intrusion detection system (IDS) for AI. Shows layered security thinking: both prevention and detection.

Features

  • Adversarial Attacks:
    Generate adversarial examples to fool image classifiers using popular techniques.

  • Defenses:
    Explore and evaluate methods to defend AI models against adversarial attacks.

  • Detection:
    Implement and test detection mechanisms for adversarial inputs.

  • Healthcare Use Case:
    Specialized demo for adversarial attacks in healthcare imaging.

  • Text-based Attacks and Defenses:
    Includes entropy-based detection and defense for text models.

Project Structure

  • adversarial_demo.py / adversarial_demo_pytorch.py: Core adversarial attack demos (TensorFlow & PyTorch).
  • defense_demo.py: Defense strategies against adversarial attacks.
  • detection_demo.py: Adversarial input detection.
  • healthcare_attack_demo.py: Healthcare-specific adversarial attack demo.
  • simple_adversarial_demo.py: Minimal working example.
  • text_detection_demo.py, text_entropy_defense.py: Text-based adversarial detection and defense.
  • utility_detection_demo.py: Utility functions for detection.
  • download_panda.py: Script to download sample image data.
  • requirements.txt: Python dependencies.

Getting Started

  1. Install dependencies:

    pip install -r requirements.txt
  2. Download sample data:

    python download_panda.py
  3. Run a demo:

    python adversarial_demo.py

    Explore other scripts for more demos and use cases.

Author


Disclaimer

This project is intended solely for educational and research purposes. It demonstrates adversarial attacks, defenses, and detection techniques in a controlled environment. The code and examples provided are not intended for malicious use or for deployment in production systems. Use responsibly and ethically.

License

This project is for educational and research purposes.


Why This Project?

Adversarial machine learning is a critical area for modern AI security. This project demonstrates practical skills in both AI and security, making it a valuable addition to any DevSecOps or AI portfolio.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages