Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

15 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

DeepShield Banner

DeepShield Logo

πŸ›‘οΈ DeepShield: AI-Powered Deepfake Detection

An intelligent video analysis system that detects AI-generated deepfake videos using a fine-tuned EfficientNetB0 deep learning model, MTCNN face detection, and majority voting. DeepShield combines Computer Vision, Deep Learning, and an interactive Streamlit interface to provide accurate, explainable, and efficient deepfake detection from uploaded videos.


🌐 Live Demo

πŸš€ Try DeepShield Online

https://deepshield-cq6f.onrender.com/


πŸ“– Project Overview

The rapid advancement of generative Artificial Intelligence has made it increasingly easy to create highly realistic deepfake videos, posing significant challenges in areas such as digital media, cybersecurity, journalism, and identity verification. Detecting manipulated content has therefore become an important research problem within Computer Vision and Deep Learning.

DeepShield presents an end-to-end AI-powered solution for deepfake video detection. The system processes uploaded videos by extracting frames, detecting human faces using MTCNN, preprocessing each detected face, and classifying them using a fine-tuned EfficientNetB0 convolutional neural network.

Rather than relying on a single frame prediction, DeepShield performs majority voting across all analyzed frames to generate a more robust video-level prediction. The application further provides confidence scores, prediction analytics, processing statistics, and sample analyzed faces through a modern Streamlit web interface.

The project demonstrates the practical integration of Deep Learning, Computer Vision, Video Processing, and AI Deployment into a complete real-world deepfake detection pipeline.

Disclaimer: This project is intended for educational, research, and demonstration purposes. Predictions should not be considered definitive evidence regarding the authenticity of any video.


πŸš€ Key Features

πŸŽ₯ Intelligent Video Processing

  • MP4 Video Upload
  • Automatic Frame Extraction
  • Efficient Video Analysis
  • Optimized Frame Sampling

πŸ‘€ Face Detection Pipeline

  • MTCNN Face Detection
  • Automatic Face Cropping
  • Face Alignment
  • Image Preprocessing

🧠 Deep Learning Inference

  • Fine-Tuned EfficientNetB0
  • Binary Classification (Real / Fake)
  • Confidence Score Estimation
  • Majority Voting Across Frames

πŸ“Š Interactive Analytics Dashboard

  • Final Prediction
  • Confidence Visualization
  • Prediction Distribution
  • Processing Statistics
  • Sample Analyzed Faces

🌐 Modern AI Web Application

  • Streamlit-Based Interface
  • Responsive User Experience
  • Dockerized Deployment
  • Hosted on Render

⭐ Project Highlights

Capability Status
Deep Learning-Based Detection βœ…
Deepfake Video Analysis βœ…
MTCNN Face Detection βœ…
EfficientNetB0 Classification βœ…
Majority Voting Pipeline βœ…
Interactive Dashboard βœ…
Streamlit Deployment βœ…
Docker Support βœ…
Open Source βœ…

πŸ’‘ Why DeepShield?

The rapid advancement of generative Artificial Intelligence has made the creation of highly realistic deepfake videos more accessible than ever before. While these technologies have many legitimate applications, they also introduce significant challenges related to misinformation, identity theft, digital impersonation, media manipulation, and cybersecurity.

DeepShield was developed to address this challenge by combining Computer Vision, Deep Learning, and Video Processing into a unified detection pipeline capable of distinguishing authentic videos from AI-generated deepfakes.

Unlike traditional image classifiers that rely on a single frame, DeepShield analyzes multiple frames from an uploaded video, performs face detection using MTCNN, classifies each detected face with a fine-tuned EfficientNetB0 model, and applies majority voting to produce a more reliable video-level prediction.

The project demonstrates how modern AI techniques can be integrated into an end-to-end application for practical deepfake detection while maintaining a clean and interactive user experience.


πŸ›  Technology Stack

Category Technologies
Programming Language Python
Deep Learning TensorFlow, Keras
CNN Backbone EfficientNetB0 (Fine-Tuned)
Computer Vision OpenCV
Face Detection MTCNN
Data Processing NumPy, Pandas
Data Visualization Matplotlib
Web Framework Streamlit
Deployment Docker, Render
Version Control Git & GitHub

🧠 Why EfficientNetB0?

EfficientNetB0 was selected as the backbone architecture because it provides an excellent balance between prediction accuracy, computational efficiency, and inference speed.

Key Advantages

  • High classification performance
  • Lightweight architecture
  • Efficient parameter utilization
  • Faster inference compared to larger CNN models
  • Suitable for deployment in interactive web applications

Its compound scaling strategy enables DeepShield to achieve strong performance while maintaining reasonable computational requirements for real-time inference.


πŸŽ₯ Detection Workflow

DeepShield Workflow

DeepShield follows a multi-stage pipeline for analyzing uploaded videos:

  1. Upload an MP4 video.
  2. Extract representative video frames.
  3. Detect human faces using MTCNN.
  4. Crop and preprocess each detected face.
  5. Classify each face using the fine-tuned EfficientNetB0 model.
  6. Aggregate frame-level predictions using majority voting.
  7. Generate the final prediction and display analytics through the interactive dashboard.

πŸ— System Architecture

DeepShield Architecture

The DeepShield architecture consists of several interconnected modules working together to provide accurate deepfake detection.

Stage Description
πŸ“€ Video Upload Accepts MP4 video input from the user.
🎞 Frame Extraction Converts the uploaded video into representative frames.
πŸ‘€ Face Detection Detects and crops faces using MTCNN.
πŸ–Ό Image Preprocessing Resizes and normalizes detected faces for inference.
🧠 Deep Learning Model EfficientNetB0 predicts each face as Real or Fake.
πŸ—³ Majority Voting Combines frame-level predictions into a final decision.
πŸ“Š Analytics Dashboard Displays prediction, confidence, statistics, and analyzed faces.

πŸ“‚ Project Structure

DeepShield
β”‚
β”œβ”€β”€ app.py
β”œβ”€β”€ Dockerfile
β”œβ”€β”€ requirements.txt
β”œβ”€β”€ README.md
β”‚
β”œβ”€β”€ assets
β”‚   β”œβ”€β”€ banner
β”‚   β”œβ”€β”€ logo
β”‚   β”œβ”€β”€ workflow
β”‚   β”œβ”€β”€ architecture
β”‚   β”œβ”€β”€ screenshots
β”‚   └── footer
β”‚
β”œβ”€β”€ config
β”‚   └── config.py
β”‚
β”œβ”€β”€ dataset
β”‚   β”œβ”€β”€ raw
β”‚   β”œβ”€β”€ processed
β”‚   └── metadata
β”‚
β”œβ”€β”€ models
β”‚   └── finetune
β”‚       └── best_cnn_finetuned.keras
β”‚
β”œβ”€β”€ notebooks
β”‚
β”œβ”€β”€ outputs
β”‚
└── src
    β”œβ”€β”€ preprocessing
    β”œβ”€β”€ models
    β”œβ”€β”€ training
    β”œβ”€β”€ evaluation
    β”œβ”€β”€ explainability
    β”œβ”€β”€ inference
    └── utils

πŸ“ Directory Overview

Directory Purpose
assets/ Repository banner, logo, workflow diagrams, screenshots, and UI assets
config/ Centralized configuration and project settings
dataset/ Raw videos, processed frames, and metadata
models/ Fine-tuned EfficientNetB0 model
notebooks/ Experimentation and model development notebooks
outputs/ Generated outputs and evaluation artifacts
src/preprocessing/ Frame extraction, preprocessing, and face detection
src/models/ Model definitions and utilities
src/training/ Training pipeline and fine-tuning scripts
src/evaluation/ Performance evaluation and metrics
src/explainability/ Explainability utilities and visual analysis
src/inference/ Video inference and majority voting pipeline
src/utils/ Common helper functions
app.py Streamlit web application entry point

πŸ“Š Model Performance

The DeepShield classification model was fine-tuned using EfficientNetB0 to distinguish between Real and Deepfake videos. Rather than relying on a single frame prediction, the system aggregates predictions across multiple frames using majority voting, resulting in a more robust video-level classification.

Evaluation Metrics

Metric Value
Accuracy 80.60%
Precision 87.74%
Recall 71.15%
ROC-AUC 89.88%

Performance Highlights

  • Fine-Tuned EfficientNetB0 Backbone
  • Binary Classification (Real / Fake)
  • Video-Level Majority Voting
  • Optimized for Efficient Inference
  • Interactive Streamlit Deployment

Note: Performance metrics were obtained using the final fine-tuned EfficientNetB0 model evaluated on a held-out test dataset. Majority voting improves prediction robustness by combining frame-level classifications into a single video-level decision.


πŸ“Έ Application Screenshots

The screenshots below illustrate the key stages of the DeepShield inference pipeline.

🏠 Home Page πŸ“€ Video Upload
βš™οΈ Video Processing 🧠 Final Prediction
πŸ‘€ Sample Analyzed Faces

βš™οΈ Getting Started

Clone the Repository

git clone https://github.com/TanmayT134/DeepShield.git

cd DeepShield

Create a Virtual Environment

Windows

python -m venv venv

venv\Scripts\activate

macOS / Linux

python3 -m venv venv

source venv/bin/activate

Install Dependencies

pip install -r requirements.txt

Launch the Application

streamlit run app.py

Once the server starts, open your browser and navigate to:

http://localhost:8501

πŸš€ How to Use

Using DeepShield is straightforward.

Step 1

Launch the Streamlit application.


Step 2

Upload a supported MP4 video.


Step 3

Click Analyze Video.


Step 4

DeepShield automatically performs:

  • Video Frame Extraction
  • Face Detection using MTCNN
  • Face Preprocessing
  • EfficientNetB0 Classification
  • Majority Voting
  • Dashboard Generation

Step 5

Review the generated analysis, including:

  • 🎯 Final Prediction
  • πŸ“Š Confidence Score
  • πŸ“ˆ Prediction Distribution
  • πŸ‘€ Sample Analyzed Faces
  • ⏱ Processing Statistics

πŸ”’ Model Information

Property Value
Model EfficientNetB0
Task Deepfake Video Detection
Classification Type Binary
Classes Real, Fake
Input Resolution 224 Γ— 224 Γ— 3
Framework TensorFlow / Keras
Face Detection MTCNN
Decision Strategy Majority Voting
Output Softmax Probability

🎯 Applications

DeepShield demonstrates practical applications across several domains.

  • Deepfake Video Detection
  • AI-Powered Media Verification
  • Digital Content Authentication
  • Cybersecurity Research
  • Computer Vision
  • Deep Learning
  • Educational AI Demonstrations
  • Video Forensics Research

πŸš€ Future Enhancements

DeepShield is designed to be modular and extensible. Several enhancements are planned to further improve detection accuracy, explainability, and deployment capabilities.

🧠 Explainable AI (XAI)

  • Grad-CAM++ visualization
  • Attention heatmaps for detected faces
  • Explainable prediction reports
  • Frame-level visual explanations

πŸŽ₯ Advanced Video Analysis

  • Multi-face tracking
  • Frame-wise prediction timeline
  • Real-time webcam analysis
  • Batch video processing

πŸ€– AI Model Improvements

  • Support for multiple deepfake datasets
  • Ensemble learning
  • Vision Transformer (ViT) architectures
  • Higher detection accuracy through improved training strategies

πŸ“Š Enhanced Analytics

  • Downloadable PDF reports
  • Confidence trend visualization
  • Detailed frame-wise statistics
  • Exportable prediction summaries

☁️ Deployment & Scalability

  • REST API support
  • Mobile-friendly interface
  • Cloud storage integration
  • User authentication
  • GPU-accelerated inference

πŸ—ΊοΈ Project Roadmap

Version Status Planned Features
v1.0 βœ… Released Video Upload, MTCNN, EfficientNetB0, Analytics Dashboard
v1.1 🚧 In Progress Performance Optimization & Code Refactoring
v2.0 πŸ”œ Planned Explainable AI (Grad-CAM++)
v2.5 πŸ”œ Planned Multi-face Tracking
v3.0 πŸ”œ Planned Real-time Detection & REST API

🀝 Contributing

Contributions are welcome.

If you'd like to improve DeepShield, feel free to:

  1. Fork the repository
  2. Create a feature branch
  3. Commit your changes
  4. Push the branch
  5. Open a Pull Request

Bug reports, feature requests, and suggestions are always appreciated.


πŸ™ Acknowledgements

DeepShield was developed using the following open-source technologies, frameworks, and tools.

Special thanks to the open-source community for providing the technologies, libraries, and resources that made this project possible.


πŸ‘¨β€πŸ’» Author

Tanmay Tawade

If you found this project useful, consider giving it a ⭐ on GitHub.


⭐ Support

If you found this project helpful, consider:

  • ⭐ Starring this repository
  • 🍴 Forking the project
  • πŸ’‘ Sharing your feedback or suggestions

Your support encourages continued development and future improvements.


⭐ If you found this project useful, please consider giving it a Star!

Building trustworthy AI requires accurate models, robust engineering, and responsible deployment.


Made with ❀️ by Tanmay Tawade

About

AI-powered deepfake detection system that analyzes videos using EfficientNetB0, MTCNN face detection, majority voting, and Streamlit to classify videos as Real or Deepfake through an interactive web application.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages