The official PyTorch implementation for the following paper:
DomainForensics: Exposing Face Forgery Across Domains via Bi-Directional Adaptation
Qingxuan Lv; Yuezun Li*; Junyu Dong*; Sheng Chen; Hui Yu; Huiyu Zhou; Shu Zhang
IEEE Transactions on Information Forensics and Security
opencv-python
numpy
easydict
pytorch-lightning==1.7.5
rich
matplotlib
install retinaface-pytorch.
install Libjpeg-Turbo.
install jpeg2dct
- Download FF++ from ff++ github
- Extract to
/path/to/FF++ - Crop faces by using
utils/crop_retinaface_ff.pye.g.python crop_retinaface_ff.py -d Deepfakes -n 8
- Download Celeb-DF v2 from celeb-df github
- Extract to
/path/to/Celeb-DF - Crop faces by using
utils/crop_retinaface_ff.pye.g.python crop_retinaface_ff.py -d Celeb-real -n 8 -s train
We train the model on two RTX2080Ti with 11Gx2 GPU memory.
Change the config within train.py for different adaptation setting.
e.g.
# from Deepfakes to Face2Face
cfg.DATAS.SOURCE = ["Deepfakes"]
cfg.DATAS.TARGET = ['Face2Face']
run training by executing python train.py
- Change the
cfg.TESTING.MODEL_WEIGHTto the pretrained weight - run testing by executing
python testing.py
| Task | Dataset | AUC | Model | Size |
|---|---|---|---|---|
| FaceSwap -> Face2Face | FF++ | 99.13 | google drive | 855MB |
| NeuralTextures -> FaceSwap | FF++ | 97.67 | google drive | 855MB |
@ARTICLE{10601589,
author={Lv, Qingxuan and Li, Yuezun and Dong, Junyu and Chen, Sheng and Yu, Hui and Zhou, Huiyu and Zhang, Shu},
journal={IEEE Transactions on Information Forensics and Security},
title={DomainForensics: Exposing Face Forgery Across Domains via Bi-Directional Adaptation},
year={2024},
volume={19},
number={},
pages={7275-7289},
keywords={Forgery;Deepfakes;Detectors;Feature extraction;Faces;Training;Bidirectional control;Digital forensics;DeepFake detection;DomainForensics},
doi={10.1109/TIFS.2024.3426317}}