This is a PyTorch implementation of Adversarial Mask: Real-World Universal Adversarial Attack on Face Recognition Models by Alon Zolfi, Shai Avidan, Yuval Elovici, Asaf Shabtai. Mask projection code is partially inspired from FaceXZoo.
Please put the downloaded weights in a local directory called "weights" under each model directory (or change location in the config file).
Code is taken from here. Download weights from here.
Code is taken from here. Download weights from here.
Code is taken from here. Download weights from here. (Weights file is already included in this repository under landmark_detection/pytorch_face_landmark/weights).
Code is taken from here. Weights are downloaded automatically on the first run.
Note: this model is more accurate, however, it is a lot larger than MobileFaceNet and requires a large memory GPU to be able to backpropagate when training the adversarial mask.
Code is taken from here. Download weights from here. (Weights file is already included in this repository under prnet).
The cleaned up version of the dataset can be found here, suggested by this github issue.
Install the required packages in req.txt.
Configurations can be changed in the config file.
Run the patch/train.py file.
Run the patch/test.py file. Specify the location of the adversarial mask image in main function.
@article{zolfi2021adversarial,
title={Adversarial Mask: Real-World Adversarial Attack Against Face Recognition Models},
author={Zolfi, Alon and Avidan, Shai and Elovici, Yuval and Shabtai, Asaf},
journal={arXiv preprint arXiv:2111.10759},
year={2021}
}