This project is an implementation of the paper FaceForensics++: Learning to Detect Manipulated Facial Images for detecting fake or manipulated facial images. The project follows a modular and production-grade approach, divided into various components such as config files, data ingestion, data validation, data transformation, model training, and a training pipeline.
With the advancement of deep learning techniques, it has become increasingly easy to create fake or manipulated images, which can be used for malicious purposes such as spreading misinformation or identity theft. This project aims to develop a model that can accurately detect whether a given facial image is real or fake, providing a confidence score for the prediction.
The project is organized into the following components:
- Config Files: Contains configuration settings for various components of the project.
- Data Ingestion: Handles the process of downloading and ingesting the dataset.
- Data Validation: Validates the ingested data to ensure its integrity.
- Data Transformation: Applies necessary transformations and augmentations to the dataset for model training.
- Model Trainer: Implements two approaches for training the model:
- Building a model from scratch and training it from the beginning.
- Using a pre-trained Xception model and fine-tuning it for the task.
- Training Pipeline: Orchestrates the end-to-end training process by integrating all the components.
- Logger and Custom Exception: Implements logging and custom exception handling mechanisms.
- Experimentation Notebook: Contains serialized code for experimenting with the project components.
- Web Application: Provides a user-friendly interface built with Gradio for uploading images and obtaining predictions.
This project utilizes Weights and Biases (W&B)
for tracking experiments, tuning hyperparameters, and monitoring model performance. W&B provides a user-friendly interface for visualizing and analyzing experiment results, making it easier to iterate and optimize the model.
- Python 3.7 or higher
- Required Python packages (listed in
requirements.txt
)
- Clone the repository:
git clone https://github.com/rahulg-101/Implementation-of-Paper---FaceForensics-Learning-to-Detect-Manipulated-Facial-Images--DeepFakes
- Navigate to the project directory:
cd deep-fake-image-detection
- Install the required Python packages:
pip install -r requirements.txt
- Ensure that the dataset is downloaded and properly ingested into the project.
- Run the training pipeline to train the model:
python training_pipeline.py
- After successful training, run the web application:
python app.py
- The web application will provide a user interface for uploading images and obtaining predictions.
Contributions to this project are welcome. If you find any issues or have suggestions for improvements, please open an issue or submit a pull request.
This project is licensed under the MIT License.
This project is based on the research paper FaceForensics++: Learning to Detect Manipulated Facial Images by Andreas Rössler, Davide Cozzolino, Luisa Verdoliva, Christian Riess, Justus Thies, and Matthias Nießner.
@inproceedings{roessler2019faceforensicspp,
author = {Andreas R\"ossler and Davide Cozzolino and Luisa Verdoliva and Christian Riess and Justus Thies and Matthias Nie{\ss}ner},
title = {Face{F}orensics++: Learning to Detect Manipulated Facial Images},
booktitle= {International Conference on Computer Vision (ICCV)},
year = {2019}
}
If you're interested in creating projects that teach you how to develop production-grade code, then you should check out my previous project, "Objection Detection and Tracking on Football Players ," where I have outlined all the necessary steps to build such a project.