We first need to generate an image-agnostic Universal Adversarial Perturbation (UAP).
You may use anaconda or miniconda.
# Clone the repo
$ git clone https://github.com/wuhanstudio/adversarial-camera/
$ cd adversarial-camera/detection
# For CPU
$ conda env create -f environment.yml
$ conda activate adversarial-camera
# For GPU
$ conda env create -f environment_gpu.yml
$ conda activate adversarial-gpu-camera
$ python detect.py --model model/yolov3-tiny.h5 --class_name coco_classes.txt
The web page will be available at: http://localhost:9090/
That's it! The perturbation is saved as noise.npy
file in the detection/noise/
folder.
Alternatively, you can generate the UAP using the WHite-box Adversarial Toolbox (WHAT).
You can use a raspberry pi 4 to deploy the perturbation (documentation).