This project implements a Cross-Attention Fusion Network for deepfake detection, combining EfficientNet-B2 (Spatial) and ResNet18 (Frequency) features.
- Python: 3.10 or higher recommended.
- CUDA-capable GPU: Highly recommended for training (Model is configured for
cuda). - RAM: At least 16GB recommended.
Follow these steps to set up the development environment using either venv or Conda.
# Windows
python -m venv venv
.\venv\Scripts\activate
# Linux/Mac
python3 -m venv venv
source venv/bin/activateconda create -n deepfake-detection python=3.10
conda activate deepfake-detectionInstall all required packages from the requirements.txt file.
pip install -r requirements.txtEnsure that PyTorch can see your GPU:
import torch
print(torch.cuda.is_available()) notebooks/: Contains the training notebook (model.ipynb) and experiments.data/: Dataset directory (expected structure below).
The training notebook expects the data to be organized as follows:
data/
└── faces/
├── real/ # Real video files
└── fake/
└── Deepfakes/ # Deepfake video files
The script will automatically handle frame extraction to data/faces/extracted_frames/.
- Open the notebook:
jupyter notebook notebooks/model.ipynb
- Run all cells to process data, extract frames, and train the model.