A deep learning-based project for detecting deepfake videos and images, focusing on robustness under social media compression. This project evaluates multiple state-of-the-art CNN models for deepfake detection and provides tools for model training and evaluation.
- Multiple model architectures: XceptionNet, EfficientNet (B4, B7), MesoNet, and ResNet
- Support for different datasets including DeepfakeTIMIT and WildDeepfake
- Pre-processing utilities for video frame extraction and data balancing
- Model evaluation and comparison tools
- Pre-trained models for quick deployment
- Source: IDIAP Research Institute
- Description: Low-quality (64×64) deepfake videos
- Content: Manipulated videos based on VidTIMIT dataset
- Source: VidTIMIT
- Description: Source dataset with real videos
- Content: Videos of 43 consented volunteers
- Clone the repository:
git clone https://github.com/yourusername/Deepfake_Detection.git
cd Deepfake_Detection- Create and activate a virtual environment (recommended):
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate- Install the required packages:
pip install -r requirements.txtDeepfake_Detection/
├── VidTIMIT/ # Code for models trained on VidTIMIT dataset
│ ├── ResNet152.py # ResNet model implementation
│ ├── efficientNetB4_model.py # EfficientNetB4 implementation
│ ├── efficientNetB7.py # EfficientNetB7 implementation
│ ├── mesoNet.py # MesoNet implementation
│ └── xception_model.py # Xception model implementation
├── VidTIMIT_deepfake_dataset/ # DeepfakeTIMIT dataset
├── WDFtest/ # WildDeepfake test implementations
├── WildDeepfake/ # Code for models trained on WildDeepfake dataset
├── weights/ # Trained model weights
│ ├── VidTIMIT
│ └── WD
├── pre_processing/ # Data preprocessing utilities
│ ├── balance_frames.py # Utility for balancing dataset
│ └── extract_frame.py # Frame extraction from videos
├── comparison.py # Model comparison utilities
└── kaggle.py # WildDeepfake competition utilities
└── charts/ # Charts for model comparison
- Extract Frames from Videos:
python pre_processing/extract_frame.py --input_dir /path/to/videos --output_dir /path/to/save/frames- Balance Dataset:
python pre_processing/balance_frames.py --data_dir /path/to/frames --output_dir /path/to/balanced_dataExample: Training Xception model on VidTIMIT dataset
python VidTIMIT/xception_model.py --data_dir /path/to/training_data --model_save_path /path/to/save/modelExample: Evaluating a pre-trained model
python VidTIMIT/xception_test.py --model_path /path/to/model --test_data /path/to/test_dataContributions are welcome! Please feel free to submit a Pull Request.
- DeepfakeTIMIT dataset provided by IDIAP Research Institute
- VidTIMIT dataset