Deepfake Detection Platform (Final Year Project)
A live web platform that detects AI-manipulated media using a ConvNeXt-Tiny 6-class model, with accounts, payments and AI-generated explanations.
Overview
My final year project at National Textile University, built in a team of three: a live web platform (deep-fake.dev) for detecting manipulated media. A ConvNeXt-Tiny model fine-tuned for 6-way classification runs as a Dockerised model API on Hugging Face Spaces, behind a FastAPI backend and a Next.js frontend with user accounts, email OTP verification, Google sign-in, Stripe payments and AI-generated explanations of each result.
The Problem
Synthetic media generation has outpaced detection capabilities. Organizations need reliable tools to distinguish real photographs from AI-generated images across multiple generation methods (GANs, diffusion models, etc.).
Solution
Fine-tuned a ConvNeXt-Tiny model on a curated dataset spanning 6 classes: real faces and 5 types of AI-generated faces, with aggressive data augmentation to improve generalization. The model is served from a Docker container on Hugging Face Spaces; a FastAPI backend handles uploads, authentication, payments and history in PostgreSQL, and a Next.js frontend shows predictions with confidence scores, Grad-CAM heatmaps and a plain-language explanation generated with Groq.
Architecture
Key Features
- →6-class classification: Real vs. GAN, Diffusion, VAE, StyleGAN, and Other synthetic
- →ConvNeXt-Tiny architecture optimized for inference speed
- →Docker containerized for reproducible deployment
- →Live web platform with upload, prediction history and Grad-CAM explanations
- →User accounts with email OTP verification (Resend) and Google sign-in
- →Stripe payments and AI-generated result explanations via Groq
- →Data augmentation pipeline with random crops, flips, and color jitter
Gallery

Landing page that shows detailed information about the Deepfake Detection System project, including overview, architecture, and key features.

Upload interface for submitting videos for deepfake detection

Prediction results showing the classification of the uploaded video along with confidence scores

Grad-CAM visualization for explaining deepfake detection decisions
Tech Stack
Key Decisions & Challenges
Cross-Generator Generalization
Models trained on one generation method (e.g., GANs) don't generalize to others (e.g., diffusion). Augmented the training set with images from 5 distinct generation methods and used aggressive augmentation to prevent method-specific overfitting.
Model Size vs. Inference Speed
Larger models achieve better accuracy but are too slow for real-time use. ConvNeXt-Tiny provided the best accuracy-to-latency trade-off, achieving 94% validation accuracy with sub-100ms inference on CPU.
Docker Container Size
PyTorch-based containers are large. Optimized the Docker image using multi-stage builds and PyTorch CPU-only slim images to reduce container size from 3.2GB to 850MB.
Lessons Learned
- →Deepfake detection models must be trained on diverse generation methods to generalize in the wild
- →Model distillation can further improve inference speed without significant accuracy loss
- →Containerized deployment ensures reproducibility across environments
Results
The model achieves 94% validation accuracy across all 6 classes with sub-100ms CPU inference time. Deployed on Hugging Face Spaces with Docker, serving 50+ daily inference requests.
Need something similar?
I can build a system like this for your business — tell me what you need and I'll reply with a plan and a quote.