depblack / CViT

Deepfake Video Detection Using Convolutional Vision Transformer

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CViT

Deepfake Video Detection Using Convolutional Vision Transformer

Implementation code for our paper. link to paper | link to MS Thesis

Requirements:

  • Pytorch >=1.4

DL library used for face extraction

  • helpers_read_video_1.py
  • helpers_face_extract_1.py
  • blazeface.py
  • blazeface.pth

Preprocessing

extractfaces.py
   Face extraction from video.
   The code works for DFDC dataset. You can test it using the sample data provided.

Weights

deepfake_cvit_gpu_ep_50.pth - Full model weight.
deepfake_cvit_gpu_inference_ep_50.pth - For detection.

Predict CViT

python cvit_prediction.py
    Predicts whether a video is Deepfake or not.
    Prediction value <0.5 - REAL
    Prediction value >=5 - FAKE

Train CViT

To train the model on your own you can use the following parameters:
  e: epoch
  s: session - (g) - GPU or (t) - TPU
  w: weight decay default= 0.0000001
  l: learning rate default=0.001
  d: path file
  b: batch size, defualt=32

python cvit_train.py -e 10 -s 'g' -l 0.0001 -w 0.0000001 -d sample_train_data/

Authors

Deressa Wodajo
Solomon Atnafu (PhD)

References

Deressa Wodajo and Solomon Atnafu, "Deepfake Video Detection Using Convolutional Vision Transformer," arXiv preprints arXiv:2102.11126, 2021.

About

Deepfake Video Detection Using Convolutional Vision Transformer

License:GNU General Public License v3.0


Languages

Language:Python 100.0%