ronny3050 / UniFAD

Universal Face Attack Detection

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

UniFAD: Universal Face Attack Detection

By Debayan Deb, Xiaoming Liu, and Anil K. Jain

A tensorflow implementation of UniFAD, a state-of-the-art face attack detector that can detect adversarial, digital, and physical face attacks. UniFAD learns joint representations for coherent attacks, while uncorrelated attack types are learned separately.

Tensorflow release

Currently this repo is compatible with Tensorflow 1.15.5.

Training

JointCNN: A Single Binary CNN Detector

  • The configuration files for training are saved under config/ folder, where you can define the dataset prefix, training list, model file, attack setting and other hyper-parameters. Use the following command to run the default training configuration:

    python train_binary_detector.py config/joint_cnn.py

The command will create an folder under log/JointCNN/ which saves all the checkpoints, test samples and summaries. The model directory is named as the time you start training.

Note: training JointCNN requires one-hot labels (0 for real and 1 for all attacks). Please refer to config/train_joint.txt for reference.

ChimneyCNN: Early Layers + Branching

  • The configuration files for training are saved under config/ folder, where you can define the dataset prefix, training list, model file, attack setting and other hyper-parameters. Use the following command to run the default training configuration:

    python train_chimney_detector.py config/chimney.py

The command will create an folder under log/Chimney/ which saves all the checkpoints, test samples and summaries. The model directory is named as the time you start training.

Note: training ChimneyCNN requires class-wise labels (0 for real and 1,2,3,... for different attack types). Please refer to config/train_chimney.txt for reference.

Testing

  • Run the test code in the following format:
    python test_binary_detector.py <PATH_TO_SAVED_MODEL>
    python test_chimney_detector.py <PATH_TO_SAVED_MODEL>
  • For example, if you want to use the pre-trained model, create a folder called models, download the model and unzip it into models/JointCNN or models/Chimney folder. Then, run
    python test_binary_detector.py models/JointCNN

Pre-trained Models

JOINT-CNN MODEL:

Dropbox

CHIMNEY-CNN MODEL:

Dropbox

Datasets

Adversarial Face Dataset:

Dropbox

Digital Attack Dataset:

Digital manipulation attacks are generated via publicly available author codes:

DeepFake/Face2Face/FaceSwap

STGAN

StarGAN

STGAN

DFFD

Physical Attack Dataset:

SiW

License

Distributed under the MIT License. See LICENSE for more information.

Contact

Debayan Deb - debdebay@msu.edu

Xiaoming Liu - liuxm@cse.msu.edu

Anil K. Jain - jain@cse.msu.edu

About

Universal Face Attack Detection

License:MIT License


Languages

Language:Python 58.7%Language:CSS 31.3%Language:JavaScript 5.9%Language:SCSS 2.5%Language:HTML 1.6%