Implementation code for our paper. link to paper | link to MS Thesis
- Pytorch >=1.4
- helpers_read_video_1.py
- helpers_face_extract_1.py
- blazeface.py
- blazeface.pth
extractfaces.py
Face extraction from video.
The code works for DFDC dataset. You can test it using the sample data provided.
deepfake_cvit_gpu_ep_50.pth - Full model weight.
deepfake_cvit_gpu_inference_ep_50.pth - For detection.
python cvit_prediction.py
Predicts whether a video is Deepfake or not.
Prediction value <0.5 - REAL
Prediction value >=5 - FAKE
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/
Deressa Wodajo
Solomon Atnafu (PhD)
Deressa Wodajo and Solomon Atnafu, "Deepfake Video Detection Using Convolutional Vision Transformer," arXiv preprints arXiv:2102.11126, 2021.