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.
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.
-
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.
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.
-
Install dependencies:
pip install -r requirements.txt
-
Download sample data:
python download_panda.py
-
Run a demo:
python adversarial_demo.py
Explore other scripts for more demos and use cases.
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.
This project is for educational and research purposes.
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.