Deepfake Detection System
Dec 2025 to Dec 2026
Overview
Deepfakes are getting scarily convincing, and most people can't tell the difference anymore. This project is my attempt to build something that can. Drop in an image, video, audio clip, or text snippet, and it tells you how likely the content is to be AI-generated.
Each media type runs through its own set of pretrained classifiers and forensic checks, with an optional LLM cross-check layered on top. The result is a clear breakdown of every suspicious signal, so both media organizations and everyday users have a straightforward way to verify what they're looking at.
Key Features
- Image analysis with pretrained classifiers and forensic checks for generation artifacts
- Video analysis for facial artifacts, lighting inconsistencies, and frame-to-frame anomalies
- Audio analysis for voice synthesis patterns, pitch anomalies, and unnatural cadence
- Text analysis that flags AI-generated writing
- Optional LLM cross-check that adds a second opinion on top of the forensic signals
- Clear, per-signal breakdown showing exactly what looked suspicious and why
How It's Built
Each media type is routed to its own detection path, then the results are merged into a single verdict:
- Image: pretrained classifiers and forensic checks scan for generation artifacts, compression anomalies, and inconsistent lighting
- Video: frame-level CNNs catch facial artifacts while temporal checks flag flickering and inter-frame inconsistencies that single-frame analysis would miss
- Audio: mel-spectrogram analysis picks up voice synthesis patterns, unnatural pitch shifts, and audio-visual sync issues
- Text: classifiers estimate how likely a snippet is machine-written
- LLM Cross-Check: an optional language-model pass reviews the combined signals and adds a second opinion before the final breakdown
FastAPI handles high-throughput inference on the backend, while OpenCV manages efficient video decoding and frame extraction. A React frontend provides a clean interface for uploading media, tracking analysis progress, and exploring the per-signal breakdown.
Interesting Challenges
- Dataset Imbalance: Real-world deepfake datasets are heavily skewed toward authentic content. Stratified sampling and focal loss prevent the model from just predicting "real" every time
- Inference Speed: Full video analysis was too slow for practical use. Keyframe extraction and adaptive frame sampling cut processing time by 60% while keeping accuracy intact
- Generalization: A model trained on one deepfake method often fails on others. Multi-dataset training with domain randomization helps the system detect manipulation across different generation techniques