DeepScan — Deepfake Video Detection
End-to-end deepfake detection system combining EfficientNet-B4 + Transformer Encoder with temporal attention — 98% accuracy, 99.87% ROC AUC on 300-video hold-out test set
DeepScan is a complete end-to-end deepfake detection solution for both research and production. It converts raw video into a forensic prediction by combining a video processing pipeline that extracts frames and crops faces, a hybrid spatio-temporal deep learning model, and a FastAPI backend + React frontend dashboard for upload, prediction, explainability, and results tracking.
The system accepts a video upload, detects and crops faces using InsightFace (buffalo_l), extracts spatial features using EfficientNet-B4, and models temporal relationships across frames with a Transformer Encoder. Temporal attention is used to identify the most influential frames, producing a final REAL / DEEPFAKE prediction with confidence scores.
The production inference pipeline samples 32 frames uniformly, detects faces with InsightFace, builds the input tensor, and runs forward_with_attention() to get logits and temporal attention weights. The top 5 most influential frames are extracted for explainability, with frame-level scores and timestamps surfaced in the UI. The model was rigorously tested on a hold-out test dataset of 300 videos (150 Real, 150 Deepfake).
Video Input
│
▼
┌─────────────────────────────┐
│ Frame Extraction (32 fps) │ ← Uniform sampling
└──────────────┬──────────────┘
│
▼
┌─────────────────────────────┐
│ InsightFace (buffalo_l) │ ← Face detection & crop
└──────────────┬──────────────┘
│ 380×380 face crops
▼
┌─────────────────────────────┐
│ EfficientNet-B4 Backbone │ ← 1792-dim spatial features/frame
└──────────────┬──────────────┘
│ Project → 512-dim
▼
┌─────────────────────────────┐
│ Transformer Encoder (6L×8H) │ ← Sinusoidal positional encoding
└──────────────┬──────────────┘
│
▼
┌─────────────────────────────┐
│ Temporal Attention MLP │ ← Frame importance weights
└──────────────┬──────────────┘
│ Weighted aggregation
▼
┌─────────────────────────────┐
│ Classifier Head │ ← BN → ReLU → Dropout → Linear
└──────────────┬──────────────┘
│
▼
REAL / DEEPFAKE + Confidence
1 / 4


