Giter VIP home page Giter VIP logo

faceoff's Introduction

FaceOff

Steps towards physical adversarial attacks on facial recognition

Input image on the left is detected as the target image on the right after the mask has been applied.

CC BY-SA 4.0

This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.

CC BY-SA 4.0

Table of contents

Description

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.

Installation

Requirements

This project works on Linux (Ubuntu 20.04). Windows and Mac are not supported but may work.

Instructions

  1. Create a virtual environment
conda create -n facial_recognition python=3.8.5
conda activate facial_recognition
  1. Clone the repo
git clone https://github.com/392781/FaceOff.git
  1. Install the required libraries
pip install -r requirements.txt
  1. Install FaceOff from inside the folder where setup.py is located
pip install -e .
  1. Import and use!
from FaceOff.AFR import load_data, Attack

For training instructions look at example.py to get started in less than 30 lines.

Citation

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},
}

References

  • Sharif, Mahmood, et al. "Accessorize to a crime: Real and stealthy attacks on state-of-the-art face recognition." Proceedings of the 2016 ACM SIGSAC Conference on Computer and Communications Security. ACM, 2016.
  • Wang, Mei, and Weihong Deng. "Deep face recognition: A survey." arXiv preprint arXiv:1804.06655 (2018).
  • MacDonald, Bruce. “Fooling Facial Detection with Fashion.” Towards Data Science, Towards Data Science, 4 June 2019, towardsdatascience.com/fooling-facial-detection-with-fashion-d668ed919eb.
  • Thys, Simen, et al. "Fooling automated surveillance cameras: adversarial patches to attack person detection." Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition Workshops. 2019.

Used the PyTorch FaceNet implementation by Tim Esler

faceoff's People

Contributors

392781 avatar jamsge avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.