A deep learning model for detecting deepfake images using MobileNetV1 architecture. This project aims to combat the growing threat of AI-generated fake media by providing a reliable detection system.
Deepfakes pose significant challenges to digital trust and information authenticity. As AI technology advances, the ability to create convincing fake images and videos becomes more accessible, potentially leading to:
- Misinformation campaigns
- Identity theft
- Reputational damage
- Financial fraud
This project contributes to developing countermeasures against such threats.
├── data/
│ ├── train/ # Training images
│ ├── train_label.csv # Training labels
│ ├── val/ # Validation images
│ └── val_label.csv # Validation labels
├── model/
│ ├── dataset.py # Dataset class implementation
│ ├── model.py # Model architecture definition
│ └── train.py # Training script
├── README.md
├── Dockerfile
├── config.yaml
├── requirements.txt
└── submission.ipynb # Original notebookThis project is based on a Kaggle competition dataset. Due to the large size of the original dataset (25+ GB), I created a scaled-down version for development and testing purposes:
- 1,000 training images
- 1,000 validation images
This subset maintains the same structure and characteristics as the original dataset while being more manageable for development and experimentation.
- Install dependencies:
pip install -r requirements.txt- Run training:
python model/train.py- Using Docker:
docker build -t deepfake-detection .
# adjust the memory given to Docker
docker run --shm-size=2g deepfake-detection The project includes Kubernetes deployment configuration in config.yaml with the following components:
- PersistentVolume: 30Gi storage capacity with ReadOnlyMany access
- PersistentVolumeClaim: Matching 30Gi claim for data storage
- Replicas: 4 distributed pods
- Resources per pod:
- GPU: 1 NVIDIA GPU
- Memory: 4Gi
- CPU: 2 cores
- Data: Mounted from PVC at
/app/data(read-only)
# Apply the configuration
kubectl apply -f config.yaml
# Check deployment status
kubectl get deployments deepfake-detectionThe model achieved the public accuracy score of 94.56%.
View the complete model implementation and results on Kaggle: Kaggle Submission