How sumukhl17-lgtm/deepfake-detector works
Deepfake Detector accepts an uploaded image, detects and crops a face, extracts spatial, frequency, and pixel-forensic signals, then fuses them into a REAL/FAKE prediction. The web API also produces two Grad-CAM visualizations and records prediction metadata; the browser presents the label, confidence, and heatmaps. Training and dataset-preparation scripts are excluded from this runtime map. Architecture links reflect the sampled source; README documentation is brief, so unsampled subsystem wiring is not inferred.
Main entry points: pipeline.py Inference pipeline · app.py Flask API · main.js Upload and results UI · database.py Prediction audit writer
Components 15
Web interface
- Upload and results UI
frontend/static/js/main.js - Analysis page
frontend/templates/index.html - Flask API
backend/app.py - Uploaded images and heatmaps
backend/app.py
Detection inference
- Inference pipeline
models/pipeline.py - Face detection and crop
models/pipeline.py - Feature fusion classifier
models/fusion.py
Signal analysis
- Spatial features
models/spatial.py - Frequency features
models/frequency.py - Pixel-forensic features
models/forensic.py
Explainability and audit
- Spatial Grad-CAM
explainability/gradcam.py - Forensic Grad-CAM
explainability/gradcam.py - Prediction audit writer
backend/database.py - Audit log
backend/database.py
Other components
- Image uploader
Connections 16
- Image uploader → Upload and results UI: selects image
- Upload and results UI → Analysis page: uses page
- Upload and results UI → Flask API: posts image
- Flask API → Uploaded images and heatmaps: stores input and heatmaps
- Flask API → Inference pipeline: runs inference
- Inference pipeline → Face detection and crop: detects and crops
- Inference pipeline → Spatial features: extracts features
- Inference pipeline → Frequency features: extracts features
- Inference pipeline → Pixel-forensic features: extracts features
- Inference pipeline → Feature fusion classifier: classifies features
- Inference pipeline → Spatial Grad-CAM: generates heatmap
- Inference pipeline → Forensic Grad-CAM: generates heatmap
- Flask API → Prediction audit writer: logs prediction
- Prediction audit writer → Audit log: writes record
- Flask API → Upload and results UI: returns prediction and heatmap URLs
- Upload and results UI → Uploaded images and heatmaps: loads heatmaps