Git Product home page Git Product logo

rffr's Introduction

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.

rffr's People

Contributors

shiliang26 avatar

Stargazers

 avatar lamb_wolf avatar  avatar

Watchers

Kostas Georgiou avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.