Deepfake Detection System is an AI-powered forensic authentication solution that detects manipulated facial videos and images with 93.58% accuracy. Using advanced deep learning techniques (ResNext CNN + LSTM RNN), it identifies media tampering through temporal and spatial feature extraction.
Key Highlights:
- ✅ High Accuracy: 93.58% detection on 100 frames per video
- ✅ Production-Ready: Django web interface + Docker containerization
- ✅ Transfer Learning: Pre-trained ResNext backbone for efficient training
- ✅ Temporal Analysis: LSTM layer captures video sequence patterns
- ✅ Scalable Architecture: Supports batch processing and real-time predictions
Deepfakes pose critical threats to:
- Media Authenticity: Verify video authenticity in journalism & broadcasting
- Security & Fraud Detection: Combat synthetic identity theft & voice spoofing
- Digital Forensics: Support legal investigations & forensic analysis
- Social Platform Safety: Content moderation at scale
This project demonstrates production-grade deep learning for media authentication.
Watch Full YouTube Demo | View Step-by-Step Setup Playlist
-
Dual-Stage Detection Pipeline
- ResNext CNN: Extracts spatial features from video frames
- LSTM RNN: Learns temporal patterns across frame sequences
-
Transfer Learning Architecture
- Pre-trained ResNext backbone reduces training time
- Fine-tuned for deepfake classification
-
Web Interface (Django)
- Video upload & analysis
- Real-time prediction results
- Confidence scores & visualization
-
Docker Support
- One-click deployment
- No dependency conflicts
- Tested on CPU & GPU systems
-
Flexible Frame Processing
- 10, 20, 40, 60, 80, 100 frames per video
- Accuracy improves with more frames
- Trade-off between speed & precision
-
Cross-Platform Compatibility
- CPU inference (standard systems)
- GPU acceleration (CUDA)
- AMD GPU support
| Model | Training Videos | Frames/Video | Accuracy | Detection Speed |
|---|---|---|---|---|
| Base Model | 6,000 | 10 | 84.21% | ⚡⚡⚡ |
| Enhanced | 6,000 | 20 | 87.79% | ⚡⚡ |
| Standard | 6,000 | 40 | 89.35% | ⚡⚡ |
| Optimized | 6,000 | 60 | 90.59% | ⚡ |
| Advanced | 6,000 | 80 | 91.50% | ⚡ |
| Production Grade | 6,000 | 100 | 93.59% | Standard |
- PyTorch - Deep learning framework
- ResNext-50 - Convolutional neural network (pre-trained ImageNet)
- LSTM - Long Short-Term Memory for sequence learning
- OpenCV - Video processing & frame extraction
- Scikit-learn - Model evaluation & metrics
- Django - Backend web server
- Django REST Framework - API endpoints
- HTML/CSS/JavaScript - Frontend interface
- Docker - Container orchestration
- CUDA/cuDNN - GPU acceleration (optional)
- pip - Python package management
- NumPy - Array operations
- Pandas - Data handling
- Pillow (PIL) - Image processing
- Upload Videos - Submit any video file (MP4, AVI, MOV)
- Get Predictions - Receive real/fake classification with confidence score
- View Analysis - Visualize detected manipulations frame-by-frame
- Download Results - Export detection reports
- Batch Processing - Analyze multiple videos simultaneously
- Train Custom Models - Retrain on custom datasets
✓ Python 3.8+
✓ pip (Python package manager)
✓ 4GB+ RAM
✓ Git
✓ (Optional) CUDA 11.8+ for GPU accelerationgit clone https://github.com/ManamoyB/Deepfake-Detection.git
cd Deepfake-Detectionpip install -r requirements.txtcd "Django Application"
python manage.py runserverVisit http://localhost:8000 in your browser.
cd "Django Application"
docker build -t deepfake-detector .
docker run -p 8000:8000 deepfake-detectorcd "Model Creation"
jupyter notebook
# Open and run the training notebooksDeepfake-Detection/
├── Django Application/ # Web interface for predictions
│ ├── manage.py # Django project manager
│ ├── Dockerfile # Container configuration
│ ├── requirements.txt # Python dependencies
│ └── templates/ # HTML templates
│
├── Model Creation/ # Training & development notebooks
│ ├── 1_Data_Preparation.ipynb
│ ├── 2_ResNext_Feature_Extraction.ipynb
│ ├── 3_LSTM_Training.ipynb
│ ├── 4_Model_Evaluation.ipynb
│ └── trained_models/ # Pre-trained model weights
│
├── Documentation/ # Project documentation
│ ├── Architecture.md
│ ├── Dataset_Information.md
│ ├── Installation_Guide.md
│ └── API_Reference.md
│
├── github_assets/ # Demo images & GIFs
├── README.md # This file
└── LICENSE # GPL v3.0 License
- Analyzed deepfake detection literature
- Identified ResNext + LSTM as optimal architecture
- Designed two-stage detection pipeline
- Sourced 6,000+ real & fake videos
- Extracted frames with temporal spacing
- Normalized & augmented training data
- Transfer learning with pre-trained ResNext
- LSTM tuning for sequence classification
- Hyperparameter optimization for accuracy
- Cross-validated on hold-out test set
- Analyzed failure cases & edge scenarios
- Benchmarked inference speed
- Containerized with Docker
- Created Django web interface
- Tested on CPU & GPU systems
Video Input
↓
[Frame Extraction]
↓
[ResNext CNN] ← Pre-trained on ImageNet
↓
[Feature Vectors] (2048-D per frame)
↓
[LSTM Layer] ← Learns temporal patterns
↓
[Classifier]
↓
Real/Fake Prediction + Confidence Score
Why This Approach?
- ResNext: Powerful spatial feature extractor (proven on ImageNet)
- LSTM: Captures temporal dependencies across frames (deepfakes have telltale patterns)
- Transfer Learning: Reduces training data needs & computational cost
- Ensemble Effect: Combining CNN + RNN catches both spatial & temporal anomalies
- Transfer Learning Impact: Pre-trained ResNext reduced training time by 60%
- Frame Count Trade-off: More frames = higher accuracy but slower inference
- LSTM Effectiveness: Sequential modeling improved accuracy by 8-10%
- Docker Benefits: Eliminated dependency hell, streamlined deployment
- Data Augmentation: Critical for robust generalization across video qualities
- Real-Time Video Stream Processing - Support live webcam input
- Attention Mechanisms - Add self-attention for temporal focus
- Ensemble Models - Combine with FaceForensics++ models
- Mobile Deployment - TensorFlow Lite for edge devices
- API Service - REST API for third-party integrations
- Explainability - GradCAM visualization of detection regions
- Multi-Language Support - Localized web interface
- Cloud Deployment - AWS/GCP/Azure integration
| Action | Shortcut |
|---|---|
| Upload File | Ctrl + U |
| Start Analysis | Enter |
| View Results | Ctrl + R |
| Download Report | Ctrl + S |
| Dark Mode Toggle | Ctrl + T |
- Medium Article - Detailed technical writeup
- YouTube Playlist - Step-by-step setup guide
- YouTube Demo - Live system walkthrough
- FaceForensics++ Dataset - Deepfake research benchmark
This project welcomes contributions! Potential areas:
- Improving model accuracy on diverse datasets
- Optimizing inference speed
- Creating open-source API
- Adding batch video processing
- Improving UI/UX
- Writing additional tests
- Fork the repository
- Create a feature branch (
git checkout -b feature/improvement) - Commit changes (
git commit -m "Add improvement") - Push to branch (
git push origin feature/improvement) - Open a Pull Request
This project is licensed under the GNU General Public License v3.0 - see LICENSE file for details.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Author: Manamoy B
Connect With Me:
- LinkedIn: Manamoy's Profile
- GitHub: @ManamoyB
- Portfolio: [Your Portfolio Website]
- Email: [your.email@example.com]
Questions or Issues?
- Open an GitHub Issue
- Check Documentation folder
- Review FAQ below
If this project helped you or you found it useful for learning, please:
- ⭐ Star this repository to increase visibility
- 🍴 Fork if you plan to build on it
- 💬 Share with your network
- 📧 Mention in your portfolio/resume
Lead Developer: Manamoy Banerjee
Thank you to the open-source community for PyTorch, Django, and all dependencies!
Last Updated: June 2026 | Status: Active Maintenance | Python 3.8+ | PyTorch 1.9+

