Home

Awesome

Exposing the Deception: Uncovering More Forgery Clues for Deepfake Detection

This repo is the official implementation of “Exposing the Deception: Uncovering More Forgery Clues for Deepfake Detection”. Accepted by AAAI-2024.

Installation

Our code is implemented and evaluated on pytorch. The following packages are used by our code.

Our code is evaluated on Python 3.8.11 and CUDA 11.7.

Training

Prepare Datasets

dataset
|-- FF++ < dataset name >
    |-- train_fake.txt < data line: label,path,the number of frames\n >
    |-- train_real.txt
    |-- val_fake.txt
    |-- val_real.txt
    |-- test_fake.txt
    |-- test_real.txt
|-- Celeb-DF-V1
    |-- ...
|-- ...

Train Models

You should make output and logs folders to save files of the model and log before running the following command.

python training.py  --name                                      \

                    (arguments for training)
                    --gpu_num 0,1                                                   \
                    --model resnet,efficientnet,mobilenet                           \
                    --epoch 20                                                      \
                    --weight_decay 1e-6                                             \ 
                    --lr 1e-3                                                       \
                    --bs 256                                                        \
                    --test_bs 1000                                                  \
                    --num_workers 12                                                \
                    --size 224                                                      \
                    --dataset FF++_c23,Celeb-DF-v2,Celeb-DF-v1,DFDC-Preview,DFDC    \
                    --mixup True                                                    \
                    --alpha 0.5                                                     \

                    (arguments for loss)
                    --lil_loss True                             \
                    --gil_loss True                             \
                    --temperature 1.5                           \
                    --mi_calculator kl                          \
                    --balance_loss_method auto,hyper            \
                    --scales [1,2,10]                           \

                    (model parameters)
                    --num_LIBs 4                                \
                    --resume_model output/{name}/....           \

                    (checkpoint)
                    --test False                                \
                    --save_model True                           \
                    --save_path output                          \

The following is a description of some parameters in the configuration file:

Citation

@article{ba2024exposing,
  title={Exposing the Deception: Uncovering More Forgery Clues for Deepfake Detection},
  author={Ba, Zhongjie and Liu, Qingyu and Liu, Zhenguang and Wu, Shuang and Lin, Feng and Lu, Li and Ren, Kui},
  journal={arXiv preprint arXiv:2403.01786},
  year={2024}
}