- Python 3 (Tested on 3.6.8)
- numpy (Tested on 1.19.3)
- opencv-python (Tested on 4.2.0)
- matplotlib (Tested on 3.0.3)
- TensorFlow 2 (Tested on 2.2.0)
pip install -r requirements.txt
python generate_adversarial_example_targeted.py <input_file_name> <target_class_name>
For example:
python generate_adversarial_example_targeted.py input.jpg airliner
In this code sample, ResNet50 model pre-trained on ImageNet is used. You may refer to imagenet_index.json
file for a mapping of ImageNet 1000 class labels to their corresponding index.
- Aaron Chong - Initial work - aaronchong888
See also the list of contributors who participated in this project.
This project is licensed under the MIT License - see the LICENSE file for details
This project is built referencing the tutorial at pyimagesearch - Targeted adversarial attacks with Keras and TensorFlow, and using the following packages and libraries as listed here