This project is a web-based application for detecting deepfake images and videos using an ensemble of deep learning models. It provides a user-friendly interface for uploading media files, processes them using state-of-the-art deepfake detection algorithms, and presents the results with detailed analysis and visualization.
- File Upload: Supports drag-and-drop or button-click file upload for images and videos.
- DeepFake Detection: Utilizes an ensemble of EfficientNet-B7 models for robust deepfake detection.
- Detailed Analysis: Provides a comprehensive report on the authenticity of the uploaded media.
- Visualization: Includes donut charts for overall confidence and bar charts for specific metrics.
- Responsive Design: Works seamlessly on desktop and mobile devices.
- Dark/Light Mode: Supports theme switching for user preference.
- Backend: Python, Flask
- Frontend: HTML, CSS, JavaScript
- Machine Learning: PyTorch, timm (PyTorch Image Models)
- Data Visualization: Matplotlib, Plotly
- AI-Generated Reports: Google's Gemini API
-
Clone the repository:
git clone https://github.com/yourusername/deepfake-detection-app.git cd deepfake-detection-app -
Set up a virtual environment (optional but recommended);
python -m venv venv source venv/bin/activate # On Windows, use `venv\Scripts\activate` -
Install the required packages:
pip install -r requirements.txt -
Download the model weights and place them in the
weightsdirectory. -
Set up your Gemini API key:
- Create a
.envfile in the root directory - Add your API key:
GEMINI_API_KEY=your_api_key_here
- Create a
-
Start the Flask server:
python app.py -
Open a web browser and navigate to
http://localhost:5000. -
Upload an image or video file using the interface.
-
View the detection results, including the confidence score, detailed report, and visualizations.
app.py: Main Flask application filedeepfake_model.py: DeepFake detection model implementationstatic/: Contains CSS and JavaScript filesstyles.css: Main stylesheetindex.js: Frontend JavaScript logictemplates/: Contains HTML templatesindex.html: Main page templateweights/: Directory for storing model weights (not included in repository)
Contributions to improve the application are welcome. Please follow these steps:
- Fork the repository
- Create a new branch (
git checkout -b feature-branch) - Make your changes and commit them (
git commit -am 'Add some feature') - Push to the branch (
git push origin feature-branch) - Create a new Pull Request




