Skip to content

Official implementation of the paper "Real Face Foundation Representation Learning for Generalized Deepfake Detection"

License

Notifications You must be signed in to change notification settings

shiliang26/RFFR

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Real Face Foundation Representation Learning for Generalized Deepfake Detection

This repository is the official implementation of Real Face Foundation Representation Learning for Generalized Deepfake Detection.

Overview

In this study, we propose Real Face Foundation Representation Learning (RFFR), which aims to learn a general representation from large-scale real face datasets and detect potential artifacts outside the distribution of RFFR.

Real Face Foundation Representation Learning for Generalized Deepfake Detection

Preparations

  • To install requirements:
pip install -r requirements.txt
[
    {
        "path": "path/to/image_0.png",
        "label": 0
    },

    {
        "path": "path/to/image_1.png",
        "label": 1
    },

    ...
]

  • Link the json files in the config files to load the data. You can also just modify the dataset files to load the images in any other ways you want.

Training

Make sure to specify paths to labels, pretrained models, as well as hyperparameters in rffr_classifier/configs/config.py and rffr_generative/configs/config.py.

To train the generative model that produces residuals:

cd rffr_generative
python train.py

To train the classifier:

cd rffr_classifier
python train.py

Evaluation

Specify models to test in the aforementioned config files.

View demos of the generative model's output by running:

cd rffr_generative
python evaluate.py

Test the deepfake detector by running:

cd rffr_classifier
python test.py

Acknowledgements

This repository partially borrows from SSDG (for code structure) and MAE (for implementation of the generative model). Thank you!

Reference

Consider citing our paper if you find it helpful:

@article{shi2023real,
  title={Real Face Foundation Representation Learning for Generalized Deepfake Detection},
  author={Shi, Liang and Zhang, Jie and Shan, Shiguang},
  journal={arXiv preprint arXiv:2303.08439},
  year={2023}
}

Feel free to contact us with any comments or feedback.

About

Official implementation of the paper "Real Face Foundation Representation Learning for Generalized Deepfake Detection"

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages