Salahuddin Bayassi

Deep learning · 2024

Deepfake Detection

A forensic pipeline that turns images into Error Level Analysis heatmaps and classifies them with a fine-tuned EfficientNet-B0, at 86.4% accuracy (F1 86.1%) on 2,000 unseen FaceForensics++ images.

Role
Research: pipeline, training, report
Stack
PyTorch, EfficientNet-B0, OpenCV, Pillow
Year
2024
Status
Research
Links
accuracy, 2,000 unseen validation images
86.4%
precision
88.0%
recall
84.3%
Two ELA heatmaps side by side: an even real image and a manipulated one where the edited face glows

Intended use

Edited faces are now hard to see. Their compression history is not.

When part of a JPEG is edited, that region has been compressed fewer times than the rest. Error Level Analysis resaves the image and measures the difference, so edited regions glow. A fine-tuned EfficientNet-B0 then learns to read those heatmaps.

Architecture

heatmapJPEG inputResave at Q=90Absolute differenceExtrema scalingEfficientNet-B0Real / fake
System diagram: data flows left to right

Decisions

  1. Feed the model forensics, not pixels. Classifying ELA heatmaps instead of raw images makes the signal the model learns explicit.
  2. Transfer, don't train from scratch. EfficientNet-B0 starts from ImageNet weights and is fine-tuned end to end.
  3. Different speeds for different layers. The backbone learns at 5e-5 to keep its edge filters; the head learns at 1e-3 with cosine annealing.

Results & evaluation

accuracy, 2,000 unseen validation images
86.4%
precision
88.0%
recall
84.3%
ELA heatmap of a manipulated image, the edited region glowing
ELA, manipulated sample
Confusion matrix for real versus fake predictions
Confusion matrix

Limitations & next steps

  • ELA depends on JPEG history; PNGs and heavily recompressed images weaken the signal.
  • Trained and validated on a balanced 10,000-frame subset of FaceForensics++ (80/20 split). The 2,000 validation images also chose the best epoch, so the figures are slightly optimistic; a separate test split is the next measurement.
  • One benchmark: other generators may behave differently.
  • Next: combine ELA with frequency-domain features and test on newer diffusion models.
Next project · Data scienceSu Ufku