A research demo for detecting face-manipulated video.
Veridex is a practical deepfake detector built around a hybrid ResNet-50 + BiLSTM trained on FaceForensics++. The decision threshold is calibrated on validation, the inference pipeline runs locally on commodity hardware, and the whole stack — backend, model, frontend — is open source.
Performance
Evaluated on 150 held-out test videos (4 800 face frames). Numbers below come from outputs/hybrid_evaluation.txt.
| Metric | Hybrid v3 (deployed) | CNN baseline (alt) |
|---|---|---|
| Test accuracy | 82.00 % | 77.58 % |
| ROC-AUC | 0.8703 | 0.7657 |
| Macro F1 | 0.7509 | 0.6433 |
| F1 real | 0.6197 | 0.4258 |
| F1 fake | 0.8821 | 0.8607 |
| Recall real | 0.7333 | 0.4156 |
| Recall fake | 0.8417 | 0.8659 |
| Decision threshold | 0.575 (val-tuned) | 0.75 (val-tuned) |
Decision threshold 0.575 was selected on the val split for macro-F1. ROC-AUC is threshold-independent.
Architecture
Backbone
ResNet-50 with ImageNet pretraining; the last block was fine-tuned on the FaceForensics++ subset during the CNN baseline stage. At inference its global-average-pool layer produces a 2 048-d feature per face crop. The classification head is replaced by Identity so the backbone acts as a feature extractor.
Temporal head
A single-layer bidirectional LSTM (hidden 128, dropout 0.5) consumes the 32-frame feature sequence and produces a single sigmoid logit per video. Trained for 12 epochs on cached features with WeightedRandomSampler for class balance.
Pipeline
- Upload validated for size, type and emptiness.
- OpenCV extracts 32 evenly-spaced frames.
- facenet-pytorch MTCNN detects + crops one face per frame.
- Backbone produces (32, 2 048); LSTM aggregates → logit.
- Sigmoid → P(fake) compared to threshold → REAL / FAKE.
Calibration
At threshold 0.5 the un-tuned CNN baseline labels almost everything as fake — real-recall 5.5 %. Sweeping thresholds on the validation split and picking the macro-F1 maximiser brings real-recall to 73 % at the deployed threshold of 0.575, with no retraining.
Limitations
Real-class recall is 73 %.
Roughly 1 in 4 authentic videos still gets called fake at the deployed threshold. This is markedly better than the un-calibrated 5.5 %, but it isn't 100 %.
Trained on 700 videos.
Published FaceForensics results in the 90 %+ range fine-tune the backbone end-to-end on a GPU with the full dataset. CPU training caps practical accuracy here.
Single-modality, single-face.
The model only looks at 32 face crops per video at 224 × 224. No body-language cues, no audio, no compression-domain features.
Not for forensic use.
Research demo only. Predictions are probabilistic; novel manipulation pipelines may transfer poorly.
Tech stack
PyTorch 2.x
ResNet-50 + LSTM, training & inference
facenet-pytorch
MTCNN face detection
OpenCV
Frame extraction
Flask + SQLAlchemy
Backend, JWT auth, prediction API
SQLite + bcrypt
User storage, password hashing
Next.js 14 (App Router)
This frontend
Tailwind CSS
Styling system
TypeScript
Frontend types
Try it on a clip of your own.
The detector runs entirely on this machine. No upload to a third party.
Open the detector