Deepfake Detection

Method and accuracy

Developed by Divyansh Srivastava. Every number below comes from the evaluation run that produced the deployed model. Nothing here is estimated or rounded in the model's favour.

Pipeline

  1. The image is resized to at most 1280 px on its longest side.
  2. MTCNN finds the largest face. If the face is under 48 px or its sharpness is under 40, the system makes no decision.
  3. The image is passed through one H.264 compression step at CRF 40, because the training videos were compressed the same way.
  4. The face is cropped with a 30% margin and resized to 299 x 299 px.
  5. An Xception network pretrained on ImageNet and fine-tuned for this task scores the crop and its mirror image. The two scores are averaged.
  6. The result is called fake only at a probability of 98.2% or higher, uncertain from 49.1%, and otherwise no manipulation detected.

Training data

17,680 face crops: FaceForensics++ (real videos and Deepfakes-method fakes, c40 compression), FFHQ real faces and StyleGAN fake faces (2,500 each), UTKFace Indian-labelled real faces (1,500), and LFW real faces (400). Videos and images were split 70, 15 and 15 percent into train, validation and test before any scoring. The decision threshold was chosen on the validation split so that at most 2% of real faces from each real source are flagged fake.

Test results

SetLevelRealFakeAUCAccuracyRecallPrecision
All test itemsVideo6785250.94675.7%46.3%96.1%
All test itemsFrame138012740.96683.9%68.5%97.1%
FF++ video facesVideo181500.98775.0%72.0%100%
FFHQ vs StyleGANFrame3753750.88266.7%36.0%93.1%

Overall video-level AUC 95% bootstrap interval: 0.934 to 0.956. Fake is the positive class. Recall is low because the threshold is deliberately strict.

Per source, at the fixed threshold

SourceItemsRateMeaning
FFHQ (real)3752.7%false-fake rate
FF++ video faces (real)180.0%false-fake rate
LFW (real)600.0%false-fake rate
UTKFace, Indian-labelled (real)2250.0%false-fake rate
FF++ Deepfakes (fake)15072.0%detected
StyleGAN (fake)37536.0%detected

Across all 678 real test items, 10 were wrongly flagged fake (1.5%). Only 18 real items come from FF++ video faces, so that row is not reliable on its own.

Robustness to small faces

The same test frames were downscaled and re-compressed (JPEG quality 50) before scoring. AUC on all test frames, by face size:

Face sizeAUC
299 px0.954
128 px0.950
64 px0.940
48 px0.922

Limits you should know

References