Wenbo Pu, Jing Hu, Xin Wang, Yuezun Li, Shu Hu, Bin Zhu, Rui Song, Qi Song, Xi Wu, Siwei Lyu
This repository is the official implementation of our paper "Learning a Deep Dual-level Network for Robust DeepFake Detection", which has been accepted by Pattern Recognition.
We provided our method, Xception6, FWA7, MesoNet8, Capsule9 and others to train and test in this repository. Xception and FWA can be train or test at main.py
while the other methods can be found in their individual folders, such as Capsule in capsule/
.
Except the model proposed in our paper, we also provided many variants of our model, including VIT, ResVIT and DCTNet10 for replacement of ResNet, and CRNN for replacement of RNN.
We also implemented Face X-ray for data-augumentation (it is not used in this paper, but we found that it can increase the performance), if you are interested in, go check utils/dataloader.py
.
The implementation of AUC loss proposed in our paper can be found in utils/aucloss.py
.
Our checkpoint can be found here.
- Pytorch 1.4.0
- Ubuntu 16.04
- CUDA 10.0
- Python 3.6
- Dlib 19.0
-
We provide a demo to show how our model work. See
demo/demo.py
python demo.py --restore_from restore_from -- path video path
-
To train and test a model, use
python main.py -i input_path -r restore_from -g gpu_id
-
More parameters including the gamma of AUC loss can be found and adjusted in
main.py
.
We provided a script to generate training and test data for this repository. Use make_train_test.py
. This script can preprocess FaceForensics++, Celeb-DF and DFDC datasets using MTCNN or Dlib.
Please kindly consider citing our paper in your publications.
@article{PU2022108832,
title = {Learning a deep dual-level network for robust DeepFake detection},
journal = {Pattern Recognition},
volume = {130},
pages = {108832},
year = {2022},
issn = {0031-3203},
doi = {https://doi.org/10.1016/j.patcog.2022.108832},
url = {https://www.sciencedirect.com/science/article/pii/S0031320322003132},
author = {Wenbo Pu and Jing Hu and Xin Wang and Yuezun Li and Shu Hu and Bin Zhu and Rui Song and Qi Song and Xi Wu and Siwei Lyu}
}
This repository is NOT for commecial use. It is provided "as it is" and we are not responsible for any subsequence of using this code.
6 FaceForensics++ Learning to Detect Manipulated Facial Images
7 Exposing DeepFake Videos By Detecting Face Warping Artifacts
8 MesoNet - a Compact Facial Video Forgery Detection Network
9 USE OF A CAPSULE NETWORK TO DETECT FAKE IMAGES AND VIDEOS
10 Learning in the Frequency Domain