GithubHelp home page GithubHelp logo

pwb97 / deepfake-detection Goto Github PK

View Code? Open in Web Editor NEW
30.0 1.0 3.0 3.55 MB

Learning a Deep Dual-level Network for Robust DeepFake Detection

Python 100.00%
deepfake-detection auc-loss fwa xception pytorch tensorflow deep-learning facexray mesonet transformer

deepfake-detection's Introduction

Learning a Deep Dual-level Network for Robust DeepFake Detection

Python

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.

Overview

Imbalanced Performance

Info

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.

Requirements

  • Pytorch 1.4.0
  • Ubuntu 16.04
  • CUDA 10.0
  • Python 3.6
  • Dlib 19.0

Usage

  • 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.

Training data preparation

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.

Citation

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}
}

Notice

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.

Thanks

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

deepfake-detection's People

Contributors

pwb97 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

deepfake-detection's Issues

always getting video is fake:true and frame score =1 for all videos.

Hi! you guys have done some great work. While trying to take inference on deepfake videos I have created along with the original videos, the demo model always predicts all videos as fake and gives frame wise score almost always 1.
Are the demo weights provided trained significantly or should I train it on my own ?
Is it possible for you guys to provide pre-trained weights to take inference?

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.