DeepSafe-Satyanveshi is an end-to-end deepfake detection system designed to identify manipulated videos with high precision. It utilizes a hybrid deep learning architecture, combining EfficientNet-B0 for spatial feature extraction and a Bidirectional GRU for temporal analysis.
Ensure you have Python 3.10+ installed. It is highly recommended to use a high-performance GPU (NVIDIA GTX 1650 or better) for training, though inference can run on CPU.
Clone the repository and set up a virtual environment:
PowerShell
git clone https://github.com/yaswanth-pidugu/DeepSafe-Satyanveshi.git
cd DeepSafe-Satyanveshi
python -m venv .venv
.venv\Scripts\activate
pip install -r requirements.txt
This project uses a centralized configuration system.
Navigate to the configs/ folder.
Ensure base.yaml contains the model hyperparameters.
Open local.yaml and update the paths to match your local directory structure.
Follow these steps in order:
Step A: Preprocessing
-
Extract faces from your raw video datasets.
-
PowerShell
python -m preprocessing.face_extractor
Step B: Data Splitting
-
Split your processed face data into training, validation, and testing sets.
-
PowerShell
python -m preprocessing.split_data
Step C: Training
-
Train the hybrid EfficientNet-GRU model. The best weights will be saved automatically based on validation loss.
-
PowerShell
python -m training.train
Step D: Evaluation & Inference
-
Generate a classification report and confusion matrix, or test a specific video.
-
PowerShell
-
#Run evaluation on the test set
python -m training.test
- #Run inference on a specific video
python -m inference.predict_video
🏗️ Project Structure
DeepSafe-Satyanveshi/
├── config/ # Centralized YAML configurations
│ ├── base.yaml # Global hyperparameters
│ ├── local.yaml # Local machine paths (Git ignored)
│ └── prod.yaml # Production/Server settings
├── inference/ # Scripts for real-world prediction
│ └── predict_video.py # Main inference logic
├── preprocessing/ # Data cleaning and face extraction scripts
│ ├── face_extractor.py # MTCNN face cropping
│ └── split_data.py # Training/Val/Test partitioning
├── training/ # Model architecture and training logic
│ ├── dataset.py # Custom PyTorch Dataset class
│ ├── model.py # EfficientNet + Bi-GRU stack
│ ├── train.py # Training loop with checkpoints
│ └── test.py # Evaluation and confusion matrix
├── .gitignore # Rules to exclude data/local configs
├── config_manager.py # Logic for loading YAML environments
└── requirements.txt # Project dependencies
🛠️ Tech Stack
-
Deep Learning: PyTorch (EfficientNet_B0 + Bi-GRU)
-
Computer Vision: OpenCV, facenet-pytorch (MTCNN)
-
Configuration: YAML
-
Analytics: Scikit-learn, Matplotlib, Seaborn