Ấn Độas791/Adversarial-Example-Attack-and-Defense
This repository contains the implementation of three adversarial example attack methods FGSM, IFGSM, MI-FGSM and one Distillation as defense against all attacks using MNIST dataset.
🛡️ Tấn công và phòng thủ adversarial example bằng PyTorch
Triển khai ba phương pháp tấn công white-box (FGSM, I-FGSM, MI-FGSM) và một phương pháp phòng thủ bằng defensive distillation trên bộ dữ liệu MNIST.
Dự án cung cấp cài đặt PyTorch của ba phương pháp tấn công adversarial example không mục tiêu (white box) cùng một phương pháp phòng thủ. Mô hình dựa trên ví dụ MNIST của PyTorch. Các phương pháp tấn công đều là white box, nghĩa là biết toàn bộ kiến trúc và siêu tham số của mạng.
✨ Điểm nổi bật
- FGSM: Thêm nhiễu theo dấu gradient bằng epsilon
- I-FGSM: Lặp 10 lần với alpha = epsilon/10, dừng nếu vượt ngưỡng epsilon
- MI-FGSM: Thêm momentum với decay_factor = 1.0, chuẩn hóa L1 gradient
- Defensive Distillation: Train NetF và NetF' với temperature = 100, NetF' giảm bớt filter một nửa
- Kết quả tấn công: Giảm độ chính xác từ ~97% xuống ~30% với epsilon = 0.3
- Kết quả phòng thủ: Chỉ giảm ~2% độ chính xác với cùng epsilon = 0.3
💡 Vì sao đáng chú ý
Ba phương pháp tấn công đều giảm đáng kể độ chính xác mô hình, cho thấy độ mạnh của adversarial examples. Defensive distillation với temperature = 100 và NetF' nhỏ hơn đáng kể giảm thiểu tác động của các cuộc tấn công, duy trì độ chính xác trên 87%. Phù hợp cho nghiên cứu adversarial ML và bảo mật mô hình.
#AdversarialML #PyTorch #MNIST #FGSM #MI-FGSM #DefensiveDistillation #TiniX
Dự án tương tự
Khám phá các dự án và mô hình AI khác có sự tương đồng.
Adversarial Robustness Toolbox (ART) - Python Library for Machine Learning Security - Evasion, Poisoning, Extraction, Inference - Red and Blue Teams
📖 The Open Distillation Codex 🌌 The Ultimate Open-Source Distillation Dataset — No Skip, Full, with Attack & Defense 🌌 Where 73 open-source minds converge into one unified stream of intelligence 18M+ Distilled Signals · 7,090 Raw GitHub Repositories · 8 Curated Categories · ~76 GB+ "We did not write this dataset. We assembled it. Every line is an echo — of a model thinking, a coder drafting, a tutor explaining, a repo breathing. Seventy-three… See the full description on the dataset page: https://huggingface.co/datasets/Manusagents/GPT-5.5-Gemini-3.1-Pro-Grok-4-Claude-Fable-5-Mythos-5-Qwen-3.7-Max-and-more-Distillation-Dataset.
A Python library for adversarial machine learning focusing on benchmarking adversarial robustness.
Official TensorFlow Implementation of Adversarial Training for Free! which trains robust models at no extra cost compared to natural training.
Physical adversarial attack for fooling the Faster R-CNN object detector
Provably defending pretrained classifiers including the Azure, Google, AWS, and Clarifai APIs
ESP32DIV is a multi-purpose wireless offensive and defensive toolkit powered by an ESP32
TextAttack 🐙 is a Python framework for adversarial attacks, data augmentation, and model training in NLP https://textattack.readthedocs.io/en/master/