The implementation of Generalized Face Anti-spoofing via Finer Domain Partition and Disentangling Liveness-irrelevant Factors (DLIF).
The motivation of the proposed DLIF method:
An overview of the proposed DLIF architecture:
- python 3.10
- torch 1.12.1
- torchvision 0.13.1
- cuda 11.4
Dataset.
Download the OULU-NPU, CASIA-FASD, Idiap Replay-Attack, MSU-MFSD and CASIA-Spoof datasets.
Data Pre-processing.
MTCNN algotithm is utilized for face detection and face alignment. All the detected faces are normlaize to 256x256x3, where only RGB channels are utilized for training.
Move to the folder ./protocol/I_C_M_to_O/
and just run like this:
python -m torch.distributed.launch --nproc_per_node=ngpus train.py
The file config.py
contains all the hype-parameters used during training.
Run like this:
python test.py
Please cite our paper if the code is helpful to your research.
@article{yang2024generalized,
title={Generalized Face Anti-spoofing via Finer Domain Partition and Disentangling Liveness-irrelevant Factors},
author={Yang, Jingyi and Yu, Zitong and Ni, Xiuming and He, Jia and Li, Hui},
journal={arXiv preprint arXiv:2407.08243},
year={2024}
}