A Flask-powered web application that uses PyTorch, OpenCV, and a custom ResNeXt + LSTM deep learning model to detect face-swap deepfake videos. Users can upload a video, select the number of frames to analyze, and receive real-time predictions labeled “REAL” or “FAKE”, along with confidence scores and visual heatmaps for interpretability. The underlying model, designed by combining RNN and LSTM architectures, achieved 92% accuracy on benchmark test datasets.
- YouTube Walkthrough:
🎞️ Youtube Video Link - Hackathon Report (PDF):
📑 SMART INDIA HACKATHON 2024 – Team Wolfenstein
-
🎥 Smart Video Processing : Upload a video, pick the number of frames, and let OpenCV +
face_recognitionhandle face extraction. -
🧠 Dual-Stage Prediction: Deepfake + Mask Detection : A pre-trained mask classifier filters masked faces before deepfake detection for better accuracy.
-
🔍 Custom Deepfake Detection Model : A hybrid ResNeXt-50 + LSTM model trained on FF++, CelebDF, and custom datasets with 84–97% accuracy.
-
🧪 Confidence & Calibration : Uses softmax-based prediction scores with Grad-CAM–like heatmaps to highlight manipulated regions.
-
🖼️ Visual & Interactive Results : Displays prediction labels, confidence, cropped faces, and highlighted frames — all in-browser.
-
🌐 User-Friendly Web App (Flask) : Smooth flow from landing → login → model overview → upload → result page — no technical setup needed.
| Category | Tools / Technologies |
|---|---|
| Frontend | HTML5, CSS3, JavaScript, Jinja2 (Flask Templates) |
| Backend | Flask (session handling, routing) |
| Deep Learning | PyTorch, Torchvision, Autograd |
| Model Architecture | ResNeXt50_32x4d (CNN) + LSTM (RNN) |
| Face & Mask Detection | face_recognition, Custom Mask Classifier |
| Video Processing | OpenCV (frame extraction, manipulation) |
| Visualization | Grad-CAM-style overlays, NumPy, Matplotlib |
| Prediction Logic | Softmax (probability conversion), Confidence Calibration |
| Deployment Ready | Docker (containerization), Cloud support (AWS/GCP/Azure) |
-
Clone the repository
git clone https://github.com/priyanka350/DeepfakeDetection.git cd DeepfakeDetection -
Install Python dependencies
pip install -r requirements.txt
-
Download Trained Models
- Each model (
*.pt, ~2.1 GB) is hosted on Google Drive. Download all models here - Place the
.ptfiles intoDeepfakeDetection/static/img/models/andDeepfakeDetection/models.
- Each model (
-
Run the Web App
python app.py
Open your browser at
http://127.0.0.1:5000.
- Open the Deepfake Detection website at
http://127.0.0.1:5000. - Click Login to access the system.
- View the model description and project overview.
- Click Get Started to go to the upload page.
- Upload a video and choose the number of frames to analyze.
- Click Submit.
- View the prediction, confidence score, extracted frames, and detected faces.
📺 Check out the YouTube video for a full demonstration of the project in action.
If you find this project useful, please give it a ⭐ on GitHub and share it with fellow developers!
Email : priyanka.tmsl2022@gmail.com
Made with ❤️ by Priyanka Kumari
