A deep learning system that detects AI-generated (fake) face images with high confidence — featuring a full interactive GUI, batch detection, and live analytics.
Upload a face image → get an instant REAL or FAKE verdict with confidence score, probability breakdown, and visual analytics.
| Feature | |
|---|---|
| 🤖 | CNN classifier trained on thousands of real and AI-generated face images |
| 🖼️ | Single & batch detection — analyze one image or hundreds at once |
| 📊 | Live analytics dashboard — confidence charts, distribution graphs |
| 📋 | Prediction history — full log with CSV export |
| ⚡ | Runs on Kaggle — no installation or setup needed |
No installation. No configuration. Just click and run.
1. Go to kaggle.com and create a free account
↓
2. Add the dataset → search "deepfake-and-real-images" in Kaggle datasets
↓
3. Open notebooks/deepfake_detector.ipynb in a new Kaggle notebook
↓
4. Click "Run All" — training + evaluation + interactive app launches automatically ✅
Input Image (128 × 128 × 3)
│
▼
┌─────────────────────────────┐
│ Conv2D(32) + BatchNorm │ ← Block 1
│ MaxPool + Dropout(0.25) │
└─────────────────────────────┘
│
▼
┌─────────────────────────────┐
│ Conv2D(64) + BatchNorm │ ← Block 2
│ MaxPool + Dropout(0.25) │
└─────────────────────────────┘
│
▼
┌─────────────────────────────┐
│ Conv2D(128) + BatchNorm │ ← Block 3
│ MaxPool + Dropout(0.30) │
└─────────────────────────────┘
│
▼
┌─────────────────────────────┐
│ Dense(128) + BatchNorm │ ← Classifier Head
│ Dropout(0.50) │
│ Dense(1, sigmoid) │
└─────────────────────────────┘
│
▼
🤖 FAKE (0) or 👤 REAL (1)
| Setting | Value |
|---|---|
| Optimizer | Adam (lr = 0.001) |
| Loss | Binary Cross-Entropy |
| Input Size | 128 × 128 × 3 |
| Early Stopping | patience = 5 |
| LR Scheduler | ReduceLROnPlateau |
The app runs directly inside the Kaggle notebook with 3 tabs:
Upload a single image or a batch — choose between two modes:
- Basic Mode → Label + confidence donut chart
- Diagnostic Mode → Label + confidence + full probability bar chart
Live statistics that update after every detection:
- Real vs Fake distribution pie chart
- Confidence score histogram across all predictions
- Scrollable log of every prediction made
- Timestamp, filename, result, confidence, raw score
- One-click CSV export
deepfake-detector-system/
│
├── 📓 notebooks/
│ └── deepfake_detector.ipynb ← ⭐ Start here
│
├── 🧠 src/
│ ├── data_loader.py ← Dataset paths + generators
│ ├── model.py ← CNN architecture
│ ├── train.py ← Training loop + callbacks
│ ├── evaluate.py ← Metrics + confusion matrix
│ └── predict.py ← Single & batch inference
│
├── 🖥️ app/
│ └── app.py ← Interactive GUI
│
├── 📦 data/ ← Dataset (not tracked by Git)
├── 💾 models/ ← Saved .h5 files (not tracked)
├── 📤 outputs/ ← Evaluation outputs
│
├── requirements.txt
└── README.md
Click to expand local setup instructions
git clone https://github.com/huda-usman/deepfake-detector-system
cd deepfake-detector-systempip install -r requirements.txtGet it from Kaggle and place it as:
data/
└── Dataset/
├── Train/ → Fake/ Real/
├── Validation/ → Fake/ Real/
└── Test/ → Fake/ Real/
python src/train.pypython src/evaluate.pypython src/predict.py --image path/to/face.jpgjupyter notebook notebooks/deepfake_detector.ipynb| Package | Version |
|---|---|
| Python | ≥ 3.9 |
| TensorFlow | ≥ 2.10 |
| OpenCV | ≥ 4.6 |
| scikit-learn | ≥ 1.1 |
| ipywidgets | ≥ 8.0 |
| pandas | ≥ 1.5 |
| matplotlib | ≥ 3.6 |
pip install -r requirements.txtdeepfake-and-real-images on Kaggle
| Split | Fake | Real |
|---|---|---|
| Train | ✅ | ✅ |
| Validation | ✅ | ✅ |
| Test | ✅ | ✅ |