This is the official PyTorch implementation of the AAP (Adversarial Attenuation Patch) method and integrates with popular attack algorithms from the Adversarial Robustness Toolbox (ART).
- AAP Method: A novel Adversarial Attenuation Patch approach for SAR object detection.
- Multiple Benchmark Methods: Supports standard attacks including AdvPatch, DPatch, and RobustDPatch via ART.
- YOLO Integration: Seamless integration with YOLO-based object detection models.
- Modular Design: Clean and extensible architecture for research and experimentation.
- Evaluation Tools: Built-in metrics and visualization for assessing attack performance.
SAAP/
├── aap_utils/ # Core utilities and custom implementations
│ ├── adv_attenuation_patch.py # AAP (Adversarial Attenuation Patch) implementation
│ ├── aap_utils.py # Helper functions and model wrappers
│ ├── random_attack.py # Random attack utilities for toy experiments
│ └── random_pipeline.py # Attack pipeline management
├── adv_examples/ # Directory for adversarial examples (empty by default)
├── art/ # Minimal integrated components from the Adversarial Robustness Toolbox (ART)
│ ├── attacks/
│ │ └── evasion/
│ │ ├── adversarial_patch/ # Standard adversarial patch attack
│ │ ├── dpatch.py # DPatch attack implementation
│ │ └── dpatch_robust.py # Robust DPatch attack implementation
│ ├── estimators/ # Model estimators (PyTorch YOLO support)
│ └── ... # Other essential ART components
├── dataset/ # Dataset directory (empty by default)
├── models/ # YOLO model configurations
│ └── hub/ # Predefined YOLO architectures
├── result_pipeline/ # Evaluation results directory (empty by default)
├── utils/ # General utilities and tools
├── weights/ # Model weights directory (empty by default)
├── attack_advpatch.py # Standard adversarial patch attack script
├── attack_dpatch.py # DPatch attack script
├── attack_robustdpatch.py # RobustDPatch attack script
├── attackv1.py # Integrated development version (for learning ART interfaces)
├── attackv2.py # Standard production version (using AAP method)
├── detect_ship.py # Ship detection example
├── val.py # Validation and evaluation script
└── advset.yaml # Dataset configuration
- Python 3.8+
- PyTorch 2.2.2
- YOLOv5 (Ultralytics implementation)
- CUDA (optional, for GPU acceleration)
# Clone the repository
git clone https://github.com/your-username/SAAP.git
cd SAAP
# Install dependencies
pip install -r requirements.txtpython attack_advpatch.py
python attack_dpatch.py
python attack_robustdpatch.py
python attackv2.py # AAP methodThe platform provides comprehensive evaluation metrics including:
- False Negative Rate (FNR)
- False Positives Per Image (FPPI)
- mAP and detection confidence reduction
Run evaluation with:
python result_fprfnr.py
python result_pipeline.pyContributions are welcome! Please feel free to submit issues, feature requests, or pull requests.
This project is licensed under the MIT License - see the LICENSE file for details.
If you use AAP in your research, please cite our work:
@article{Zhang2026SAAP,
title = {Towards Physically Realizable Adversarial Attenuation Patch against SAR Object Detection},
author = {Yiming Zhang and Weibo Qin and Feng Wang},
journal = {arXiv preprint arXiv:2604.00887},
year = {2026}
}This code is intended for research and educational purposes only. Users are responsible for ensuring compliance with applicable laws and regulations when using adversarial attack techniques.
- This project makes extensive use of the Adversarial Robustness Toolbox (ART) for implementing standard adversarial patch methods, including AdvPatch, DPatch, and RobustDPatch.
- The object detection backbone is based on Ultralytics YOLOv5.
