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 | β | β |