GithubHelp home page GithubHelp logo

pydeepfakedet's Introduction

PyDeepFakeDet

An integrated and scalable library for Deepfake detection research.

Introduction

PyDeepFakeDet is an integrated and scalable Deepfake detection tool developed by Fudan Vision and Learning Lab. The goal is to provide state-of-the-art Deepfake detection Models as well as interfaces for the training and evaluation of new Models on commonly used Deepfake datasets.

This repository includes implementations of both CNN-based and Transformer-based methods:

Model Zoo and Baselines

The baseline Models on three versions of FF-DF dataset are provided.

Method RAW C23 C40 Model
ResNet50 97.61 94.87 84.95 RAW / C23 / C40
Xception 97.84 95.24 86.27 RAW / C23 / C40
EfficientNet-b4 97.89 95.61 87.12 RAW / C23 / C40
Meso4 85.14 77.14 60.13 RAW / C23 / C40
MesoInception4 95.45 84.13 71.31 RAW / C23 / C40
GramNet 97.65 95.16 86.21 RAW / C23 / C40
F3Net 99.95 97.52 90.43 RAW / C23 / C40
MAT 97.90 95.59 87.06 RAW / C23 / C40
ViT 96.72 93.45 82.97 RAW / C23 / C40
M2TR 99.50 97.93 92.89 RAW / C23 / C40

The baseline Models on Celeb-DF is also available.

Method Celeb-DF Model
ResNet50 98.51 CelebDF
Xception 99.05 CelebDF
EfficientNet-b4 99.44 CelebDF
Meso4 73.04 CelebDF
MesoInception4 75.87 CelebDF
GramNet 98.67 CelebDF
F3Net 96.47 CelebDF
MAT 99.02 CelebDF
ViT 96.73 CelebDF
M2TR 99.76 CelebDF

Installation

  • We use Python == 3.9.0, torch==1.11.0, torchvision==1.12.0.

  • Install the required packages by:

    pip install -r requirements.txt

Data Preparation

Please follow the instructions in DATASET.md to prepare the data.

Quick Start

Specify the path of your local dataset in ./configs/resnet50.yaml, and then run:

python run.py --cfg resnet50.yaml

Visualization tools

Please refer to VISUALIZE.md for detailed instructions.

Contributors

PyDeepFakeDet is written and maintained by Wenhao Ouyang, Chao Zhang, Zhenxin Li, and Junke Wang.

License

PyDeepFakeDet is released under the MIT license.

Citations

@inproceedings{wang2021m2tr,
  title={M2TR: Multi-modal Multi-scale Transformers for Deepfake Detection},
  author={Wang, Junke and Wu, Zuxuan and Ouyang, Wenhao and Han, Xintong and Chen, Jingjing and Lim, Ser-Nam and Jiang, Yu-Gang},
  booktitle={ICMR},
  year={2022}
}

pydeepfakedet's People

Contributors

wangjk666 avatar zhangchaosd 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  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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

pydeepfakedet's Issues

Parameters and FLOPs

Thank you very much for providing this codebase, which is very useful. Can you provide the parameters and FLOPs of these models?

'EfficientNet' object has no attribute 'extract_textures'

Hey , I compared the code with your other repository "m2tr", I found that your deleted the def extract_textures in efficientnet.py, and this caused the code to report an error —— 'EfficientNet' object has no attribute 'extract_textures'

about the reproduced results

Hi,

Thanks for your excellent summary.
I have reproduced the related results on the dataset "raw" of FF-DF.
But I got the results as shown:
image
image
The overall values are on the high side, where meso4, MesoInception4 is not the correct one.

PS: My dataset where the original is real, manipulated is fake, where fake and real each have 1000 videos * 128 frames.
I follow your default setup of the code for extracting frames from the video.
Is it normal? Or is there something I ignore?

thanks~

Training stuck for MAT

when I training MAT, The training is stuck, and it's not over. I checked a lot, but I didn't find the relevant information.
image

image

image

CPU shows running, Do you know what the problem is?

image

RuntimeError: CUDA error: invalid device ordinal

RuntimeError: CUDA error: invalid device ordinal
CUDA kernel errors might be asynchronously reported at some other API call,so the stacktrace below might be incorrect.
For debugging consider passing CUDA_LAUNCH_BLOCKING=1.
Excuse me, how to solve this error.

RuntimeError: Error(s) in loading state_dict for M2TR

We tried to load the corresponding weights for the model but found them to be inconsistent, including c23 and c40. We don't understand why, it looks like the keys are wrong.

RuntimeError: Error(s) in loading state_dict for M2TR:
Missing key(s) in state_dict: "layers.2.0.t.attention.query_embedding.weight", "layers.2.0.t.attention.query_embedding.bias", "layers.2.0.t.attention.value_embedding.weight", "layers.2.0.t.attention.value_embedding.bias", "layers.2.0.t.attention.key_embedding.weight", "layers.2.0.t.attention.key_embedding.bias", "layers.2.0.t.attention.output_linear.0.weight", "layers.2.0.t.attention.output_linear.0.bias", "layers.2.0.t.attention.output_linear.1.weight", "layers.2.0.t.attention.output_linear.1.bias", "layers.2.0.t.attention.output_linear.1.running_mean", "layers.2.0.t.attention.output_linear.1.running_var", "layers.2.0.t.feed_forward.conv.0.weight", "layers.2.0.t.feed_forward.conv.0.bias", "layers.2.0.t.feed_forward.conv.1.weight", "layers.2.0.t.feed_forward.conv.1.bias", "layers.2.0.t.feed_forward.conv.1.running_mean", "layers.2.0.t.feed_forward.conv.1.running_var", "layers.2.0.t.feed_forward.conv.3.weight", "layers.2.0.t.feed_forward.conv.3.bias", "layers.2.0.t.feed_forward.conv.4.weight", "layers.2.0.t.feed_forward.conv.4.bias", "layers.2.0.t.feed_forward.conv.4.running_mean", "layers.2.0.t.feed_forward.conv.4.running_var", "layers.2.1.filter.complex_weight", "layers.2.1.feed_forward.conv.0.weight", "layers.2.1.feed_forward.conv.0.bias", "layers.2.1.feed_forward.conv.1.weight", "layers.2.1.feed_forward.conv.1.bias", "layers.2.1.feed_forward.conv.1.running_mean", "layers.2.1.feed_forward.conv.1.running_var", "layers.2.1.feed_forward.conv.3.weight", "layers.2.1.feed_forward.conv.3.bias", "layers.2.1.feed_forward.conv.4.weight", "layers.2.1.feed_forward.conv.4.bias", "layers.2.1.feed_forward.conv.4.running_mean", "layers.2.1.feed_forward.conv.4.running_var", "layers.2.2.conv1.weight", "layers.2.2.conv1.bias", "layers.2.2.conv2.weight", "layers.2.2.conv2.bias", "layers.2.2.conv3.weight", "layers.2.2.conv3.bias", "layers.2.2.conv4.0.weight", "layers.2.2.conv4.0.bias", "layers.2.2.conv4.1.weight", "layers.2.2.conv4.1.bias", "layers.2.2.conv4.1.running_mean", "layers.2.2.conv4.1.running_var", "layers.3.0.t.attention.query_embedding.weight", "layers.3.0.t.attention.query_embedding.bias", "layers.3.0.t.attention.value_embedding.weight", "layers.3.0.t.attention.value_embedding.bias", "layers.3.0.t.attention.key_embedding.weight", "layers.3.0.t.attention.key_embedding.bias", "layers.3.0.t.attention.output_linear.0.weight", "layers.3.0.t.attention.output_linear.0.bias", "layers.3.0.t.attention.output_linear.1.weight", "layers.3.0.t.attention.output_linear.1.bias", "layers.3.0.t.attention.output_linear.1.running_mean", "layers.3.0.t.attention.output_linear.1.running_var", "layers.3.0.t.feed_forward.conv.0.weight", "layers.3.0.t.feed_forward.conv.0.bias", "layers.3.0.t.feed_forward.conv.1.weight", "layers.3.0.t.feed_forward.conv.1.bias", "layers.3.0.t.feed_forward.conv.1.running_mean", "layers.3.0.t.feed_forward.conv.1.running_var", "layers.3.0.t.feed_forward.conv.3.weight", "layers.3.0.t.feed_forward.conv.3.bias", "layers.3.0.t.feed_forward.conv.4.weight", "layers.3.0.t.feed_forward.conv.4.bias", "layers.3.0.t.feed_forward.conv.4.running_mean", "layers.3.0.t.feed_forward.conv.4.running_var", "layers.3.1.filter.complex_weight", "layers.3.1.feed_forward.conv.0.weight", "layers.3.1.feed_forward.conv.0.bias", "layers.3.1.feed_forward.conv.1.weight", "layers.3.1.feed_forward.conv.1.bias", "layers.3.1.feed_forward.conv.1.running_mean", "layers.3.1.feed_forward.conv.1.running_var", "layers.3.1.feed_forward.conv.3.weight", "layers.3.1.feed_forward.conv.3.bias", "layers.3.1.feed_forward.conv.4.weight", "layers.3.1.feed_forward.conv.4.bias", "layers.3.1.feed_forward.conv.4.running_mean", "layers.3.1.feed_forward.conv.4.running_var", "layers.3.2.conv1.weight", "layers.3.2.conv1.bias", "layers.3.2.conv2.weight", "layers.3.2.conv2.bias", "layers.3.2.conv3.weight", "layers.3.2.conv3.bias", "layers.3.2.conv4.0.weight", "layers.3.2.conv4.0.bias", "layers.3.2.conv4.1.weight", "layers.3.2.conv4.1.bias", "layers.3.2.conv4.1.running_mean", "layers.3.2.conv4.1.running_var", "classifier.projection.weight", "classifier.projection.bias".
Unexpected key(s) in state_dict: "classifier.weight", "classifier.bias".
size mismatch for model._fc.weight: copying a param with shape torch.Size([1, 1792]) from checkpoint, the shape in current model is torch.Size([2, 1792]).
size mismatch for model._fc.bias: copying a param with shape torch.Size([1]) from checkpoint, the shape in current model is torch.Size([2]).

Hope this can be fixed soon.

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.