CViT
Deepfake Video Detection Using Convolutional Vision Transformer
Implementation code for our paper. link to paper | link to MS Thesis | link to MS Thesis defense PPT file
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)
Bibtex
@misc{wodajo2021deepfake,
title={Deepfake Video Detection Using Convolutional Vision Transformer},
author={Deressa Wodajo and Solomon Atnafu},
year={2021},
eprint={2102.11126},
archivePrefix={arXiv},
primaryClass={cs.CV}
}