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.
Currently this repo is compatible with Tensorflow 1.15.5.
-
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.
-
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.
- 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 intomodels/JointCNN
ormodels/Chimney
folder. Then, runpython test_binary_detector.py models/JointCNN
Digital manipulation attacks are generated via publicly available author codes:
• STGAN
• StarGAN
• STGAN
• DFFD
• SiW
Distributed under the MIT License. See LICENSE
for more information.
Debayan Deb - debdebay@msu.edu
Xiaoming Liu - liuxm@cse.msu.edu
Anil K. Jain - jain@cse.msu.edu