All Projects → dessa-oss → Deepfake Detection

dessa-oss / Deepfake Detection

Licence: mit
Towards deepfake detection that actually works

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Deepfake Detection

neuralBlack
A Multi-Class Brain Tumor Classifier using Convolutional Neural Network with 99% Accuracy achieved by applying the method of Transfer Learning using Python and Pytorch Deep Learning Framework
Stars: ✭ 36 (-83.1%)
Mutual labels:  resnet, transfer-learning
sparsezoo
Neural network model repository for highly sparse and sparse-quantized models with matching sparsification recipes
Stars: ✭ 264 (+23.94%)
Mutual labels:  resnet, transfer-learning
Video Classification
Tutorial for video classification/ action recognition using 3D CNN/ CNN+RNN on UCF101
Stars: ✭ 543 (+154.93%)
Mutual labels:  transfer-learning, resnet
Keras-MultiClass-Image-Classification
Multiclass image classification using Convolutional Neural Network
Stars: ✭ 48 (-77.46%)
Mutual labels:  resnet, transfer-learning
Imagenet
Pytorch Imagenet Models Example + Transfer Learning (and fine-tuning)
Stars: ✭ 134 (-37.09%)
Mutual labels:  transfer-learning, resnet
Kashgari
Kashgari is a production-level NLP Transfer learning framework built on top of tf.keras for text-labeling and text-classification, includes Word2Vec, BERT, and GPT2 Language Embedding.
Stars: ✭ 2,235 (+949.3%)
Mutual labels:  transfer-learning
Deep Learning With Python
Deep learning codes and projects using Python
Stars: ✭ 195 (-8.45%)
Mutual labels:  resnet
Senet Caffe
A Caffe Re-Implementation of SENet
Stars: ✭ 169 (-20.66%)
Mutual labels:  resnet
Eeg Dl
A Deep Learning library for EEG Tasks (Signals) Classification, based on TensorFlow.
Stars: ✭ 165 (-22.54%)
Mutual labels:  resnet
Chinese ulmfit
中文ULMFiT 情感分析 文本分类
Stars: ✭ 208 (-2.35%)
Mutual labels:  transfer-learning
Iseebetter
iSeeBetter: Spatio-Temporal Video Super Resolution using Recurrent-Generative Back-Projection Networks | Python3 | PyTorch | GANs | CNNs | ResNets | RNNs | Published in Springer Journal of Computational Visual Media, September 2020, Tsinghua University Press
Stars: ✭ 202 (-5.16%)
Mutual labels:  resnet
Pytorch Deeplab Xception
DeepLab v3+ model in PyTorch. Support different backbones.
Stars: ✭ 2,466 (+1057.75%)
Mutual labels:  resnet
Vip
Video Platform for Action Recognition and Object Detection in Pytorch
Stars: ✭ 175 (-17.84%)
Mutual labels:  resnet
Sca Cnn.cvpr17
Image Captions Generation with Spatial and Channel-wise Attention
Stars: ✭ 198 (-7.04%)
Mutual labels:  resnet
Machine Learning Is All You Need
🔥🌟《Machine Learning 格物志》: ML + DL + RL basic codes and notes by sklearn, PyTorch, TensorFlow, Keras & the most important, from scratch!💪 This repository is ALL You Need!
Stars: ✭ 173 (-18.78%)
Mutual labels:  resnet
Tensorflow Computer Vision Tutorial
Tutorials of deep learning for computer vision.
Stars: ✭ 206 (-3.29%)
Mutual labels:  resnet
Sceneclassify
AI场景分类竞赛
Stars: ✭ 169 (-20.66%)
Mutual labels:  resnet
Fashion Recommendation
A clothing retrieval and visual recommendation model for fashion images.
Stars: ✭ 193 (-9.39%)
Mutual labels:  resnet
Seg Uncertainty
IJCAI2020 & IJCV 2020 🌇 Unsupervised Scene Adaptation with Memory Regularization in vivo
Stars: ✭ 202 (-5.16%)
Mutual labels:  transfer-learning
Bert Sklearn
a sklearn wrapper for Google's BERT model
Stars: ✭ 182 (-14.55%)
Mutual labels:  transfer-learning

parallel coordinates plot

Read the technical deep dive: https://www.dessa.com/post/deepfake-detection-that-actually-works

Visual DeepFake Detection

In our recent article, we make the following contributions:

  • We show that the model proposed in current state of the art in video manipulation (FaceForensics++) does not generalize to real-life videos randomly collected from Youtube.
  • We show the need for the detector to be constantly updated with real-world data, and propose an initial solution in hopes of solving deepfake video detection.

Our Pytorch implementation, conducts extensive experiments to demonstrate that the datasets produced by Google and detailed in the FaceForensics++ paper are not sufficient for making neural networks generalize to detect real-life face manipulation techniques. It also provides a current solution for such behavior which relies on adding more data.

Our Pytorch model is based on a pre-trained ResNet18 on Imagenet, that we finetune to solve the deepfake detection problem. We also conduct large scale experiments using Dessa's open source scheduler + experiment manger Atlas.

Setup

Prerequisities

To run the code, your system should meet the following requirements: RAM >= 32GB , GPUs >=1

Steps

  1. Install nvidia-docker
  2. Install ffmpeg or sudo apt install ffmpeg
  3. Git Clone this repository.
  4. If you haven't already, install Atlas.
  5. Once you've installed Atlas, activate your environment if you haven't already, and navigate to your project folder.

That's it, You're ready to go!

Datasets

Half of the dataset used in this project is from the FaceForensics deepfake detection dataset. .

To download this data, please make sure to fill out the google form to request access to the data.

For the dataset that we collected from Youtube, it is accessible on S3 for download.

To automatically download and restructure both datasets, please execute:

bash restructure_data.sh faceforensics_download.py

Note: You need to have received the download script from FaceForensics++ people before executing the restructure script.

Note2: We created the restructure_data.sh to do a split that replicates our exact experiments avaiable in the UI above, please feel free to change the splits as you wish.

Walkthrough

Before starting to train/evaluate models, we should first create the docker image that we will be running our experiments with. To do so, we already prepared a dockerfile to do that inside custom_docker_image. To create the docker image, execute the following commands in terminal:

cd custom_docker_image
nvidia-docker build . -t atlas_ff

Note: if you change the image name, please make sure you also modify line 16 of job.config.yaml to match the docker image name.

Inside job.config.yaml, please modify the data path on host from /media/biggie2/FaceForensics/datasets/ to the absolute path of your datasets folder.

The folder containing your datasets should have the following structure:

datasets
├── augment_deepfake        (2)
│   ├── fake
│   │   └── frames
│   ├── real
│   │   └── frames
│   └── val
│       ├── fake
│       └── real
├── base_deepfake           (1)
│   ├── fake
│   │   └── frames
│   ├── real
│   │   └── frames
│   └── val
│       ├── fake
│       └── real
├── both_deepfake           (3)
│   ├── fake
│   │   └── frames
│   ├── real
│   │   └── frames
│   └── val
│       ├── fake
│       └── real
├── precomputed             (4)
└── T_deepfake              (0)
    ├── manipulated_sequences
    │   ├── DeepFakeDetection
    │   ├── Deepfakes
    │   ├── Face2Face
    │   ├── FaceSwap
    │   └── NeuralTextures
    └── original_sequences
        ├── actors
        └── youtube

Notes:

  • (0) is the dataset downloaded using the FaceForensics repo scripts
  • (1) is a reshaped version of FaceForensics data to match the expected structure by the codebase. subfolders called frames contain frames collected using ffmpeg
  • (2) is the augmented dataset, collected from youtube, available on s3.
  • (3) is the combination of both base and augmented datasets.
  • (4) precomputed will be automatically created during training. It holds cashed cropped frames.

Then, to run all the experiments we will show in the article to come, you can launch the script hparams_search.py using:

python hparams_search.py

Results

In the following pictures, the title for each subplot is in the form real_prob, fake_prob | prediction | label.

Model trained on FaceForensics++ dataset

For models trained on the paper dataset alone, we notice that the model only learns to detect the manipulation techniques mentioned in the paper and misses all the manipulations in real world data (from data)

model1 model11

Model trained on Youtube dataset

Models trained on the youtube data alone learn to detect real world deepfakes, but also learn to detect easy deepfakes in the paper dataset as well. These models however fail to detect any other type of manipulation (such as NeuralTextures).

model2 model22

Model trained on Paper + Youtube dataset

Finally, models trained on the combination of both datasets together, learns to detect both real world manipulation techniques as well as the other methods mentioned in FaceForensics++ paper.

model3 model33

for a more in depth explanation of these results, please refer to the article we published. More results can be seen in the interactive UI

Help improve this technology

Please feel free to fork this work and keep pushing on it.

If you also want to help improving the deepfake detection datasets, please share your real/forged samples at [email protected].

LICENSE

© 2020 Square, Inc. ATLAS, DESSA, the Dessa Logo, and others are trademarks of Square, Inc. All third party names and trademarks are properties of their respective owners and are used for identification purposes only.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].