Input image on the left is detected as the target image on the right after the mask has been applied.
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.
The purpose of this library is to create adversarial attacks against the FaceNet face recognizer. This is the preliminary work towards creating a more robust physical attack using a mask that a person could wear over their face.
For more details, please check out my research poster.
The current pipeline consists of an aligned input image with a calculated mask. This is then fed into a face detector using dlib's histogram of oriented gradients detector to test whether the face is still detected. This is then passed to FaceNet where which ouputs a face embedding and a loss which is then calculated and propagated back. This perturbs the input mask which generates enough of a disturbance to affect the loss.
The loss function maximizes the Euclidean distance between the inputs' true identity and minimizes the distance between the adversarial input and the target image.
An image of this process can be seen below.
This project works on Linux (Ubuntu 20.04). Windows and Mac are not supported but may work.
conda create -n facial_recognition python=3.8.5
conda activate facial_recognition
git clone https://github.com/392781/FaceOff.git
pip install -r requirements.txt
setup.py
is locatedpip install -e .
from FaceOff.AFR import load_data, Attack
For training instructions look at example.py
to get started in less than 30 lines.
Please cite FaceOff
if used in your research:
@misc{FaceOff,
author = {Ronaldas Paulius Lencevicius},
howpublished = {GitHub},
title = {Face-Off: Steps towards physical adversarial attacks on facial recognition},
URL = {https://github.com/392781/FaceOff},
month = {Aug}
year = {2019},
}
Used the PyTorch FaceNet implementation by Tim Esler