Tensorflow implementation of "fast landmark manipulation method" (FLM) and "grouped fast landmark manipulation method" (GFLM) for generating adversarial faces, from our paper: Fast Geometrically-Perturbed Adversarial Faces.
Download pretrained "Inception ResNet v1" model, trained on the "CASIA-WebFace" dataset provided by FaceNet.
Download the file and extract it to get the "shape_predictor_68_face_landmarks.dat" pretrained model for DLib landmark detector.
# clone this repo
git clone https://github.com/alldbi/FLM.git
cd FLM
# Generating adversarial faces by Grouped FLM:
python main.py \
--method GFLM \
--pretrained_model "path to the Inception ResNet v1 model trained on CASIA-WebFace" \
--dlib_model "path to the pretrained model of the Dlib landmark detector" \
--img "path to the input image" \
--label "label of the input image" \
--output_dir "path to the directory to save results"
--epsilon "coefficient for a scaling the gradient sign for each single iteration of the attack"
# Generating adversarial faces by FLM:
python main.py \
--method GFLM \
--pretrained_model "path to the Inception ResNet v1 model trained on CASIA-WebFace" \
--dlib_model "path to the pretrained model of the Dlib landmark detector" \
--img "path to the input image" \
--label "label of the input image" \
--output_dir "path to the directory to save results"
--epsilon "coefficient for a scaling the gradient sign for each single iteration of the attack"
If you use this code for your research, please cite the paper: Fast Geometrically-Perturbed Adversarial Faces:
@article{dabouei2018fast, title={Fast Geometrically-Perturbed Adversarial Faces}, author={Dabouei, Ali and Soleymani, Sobhan and Dawson, Jeremy and Nasrabadi, Nasser M}, journal={arXiv preprint arXiv:1809.08999}, year={2018} }