Update README.md
Browse files
README.md
CHANGED
|
@@ -4,60 +4,84 @@ tags:
|
|
| 4 |
- deepfake-detection
|
| 5 |
- computer-vision
|
| 6 |
- efficientnet
|
|
|
|
|
|
|
| 7 |
---
|
| 8 |
|
| 9 |
# XADE Deepfake Detector
|
| 10 |
|
| 11 |
-
EfficientNet-B4 model trained for deepfake detection as part of the XADE
|
|
|
|
|
|
|
| 12 |
|
| 13 |
## Model Details
|
| 14 |
|
| 15 |
-
- **Architecture:** EfficientNet-B4
|
| 16 |
- **Task:** Binary classification (real vs. fake faces)
|
| 17 |
-
- **Training
|
| 18 |
-
- **
|
| 19 |
-
- **AUC-ROC:** 99.94%
|
| 20 |
|
| 21 |
-
## Performance
|
| 22 |
|
| 23 |
-
|
|
| 24 |
-
|------
|
| 25 |
-
|
|
| 26 |
-
|
|
| 27 |
-
|
|
| 28 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 29 |
|
| 30 |
## Usage
|
| 31 |
```python
|
| 32 |
import torch
|
| 33 |
from huggingface_hub import hf_hub_download
|
|
|
|
|
|
|
| 34 |
|
| 35 |
# Download model
|
| 36 |
model_path = hf_hub_download(
|
| 37 |
-
repo_id="
|
| 38 |
filename="best_model.pt"
|
| 39 |
)
|
| 40 |
|
| 41 |
-
# Load
|
| 42 |
-
checkpoint = torch.load(model_path)
|
| 43 |
-
|
|
|
|
| 44 |
```
|
| 45 |
|
| 46 |
-
## Training Details
|
| 47 |
-
|
| 48 |
-
- Samples: 100,000 training, 20,000 validation
|
| 49 |
-
- Epochs: 10 (early stopping)
|
| 50 |
-
- Optimizer: AdamW
|
| 51 |
-
- Learning rate: 0.001
|
| 52 |
-
- Batch size: 64
|
| 53 |
-
|
| 54 |
## Citation
|
| 55 |
```bibtex
|
| 56 |
@misc{xade2026,
|
| 57 |
-
author = {Viktor Ahnström
|
| 58 |
-
title = {XADE: Cross-Platform Explainable Deepfake Detection
|
|
|
|
| 59 |
year = {2026},
|
| 60 |
-
|
| 61 |
-
howpublished = {\url{https://huggingface.co/
|
| 62 |
}
|
| 63 |
```
|
|
|
|
| 4 |
- deepfake-detection
|
| 5 |
- computer-vision
|
| 6 |
- efficientnet
|
| 7 |
+
- xai
|
| 8 |
+
- explainable-ai
|
| 9 |
---
|
| 10 |
|
| 11 |
# XADE Deepfake Detector
|
| 12 |
|
| 13 |
+
EfficientNet-B4 model trained for deepfake detection as part of the XADE
|
| 14 |
+
(eXplainable Automated Deepfake Evaluation) thesis project at Jönköping
|
| 15 |
+
University, 2026.
|
| 16 |
|
| 17 |
## Model Details
|
| 18 |
|
| 19 |
+
- **Architecture:** EfficientNet-B4 with custom two-layer classifier head
|
| 20 |
- **Task:** Binary classification (real vs. fake faces)
|
| 21 |
+
- **Training:** Progressive mixed training across 4 manipulation types
|
| 22 |
+
- **Final checkpoint:** Run 4 (140k + CIPLAB + FF++ + Celeb-DF)
|
|
|
|
| 23 |
|
| 24 |
+
## Cross-Dataset Performance (AUC-ROC)
|
| 25 |
|
| 26 |
+
| Dataset | Manipulation Type | AUC |
|
| 27 |
+
|---|---|---|
|
| 28 |
+
| 140k Real-Fake (training dist.) | GAN / StyleGAN synthesis | 0.9992 |
|
| 29 |
+
| Fake-Vs-Real Hard | StyleGAN2 harder cases | 0.8948 |
|
| 30 |
+
| FF++ derived | Neural face swap | 0.8789 |
|
| 31 |
+
| CIPLAB | Photoshop manipulation | 0.7563 |
|
| 32 |
+
| Celeb-DF v2 | High-quality face swap | 0.8049 |
|
| 33 |
+
|
| 34 |
+
## Training Details
|
| 35 |
+
|
| 36 |
+
- **Base dataset:** 140k Real and Fake Faces (StyleGAN-generated)
|
| 37 |
+
- **Additional training data:** CIPLAB (~960 images), FF++ derived
|
| 38 |
+
(~1500 frames), Celeb-DF v2 (~1500 images)
|
| 39 |
+
- **Training samples:** 100,000 per run (sampled from combined pool)
|
| 40 |
+
- **Epochs:** 10 (early stopping patience 7)
|
| 41 |
+
- **Optimizer:** AdamW with differential learning rates
|
| 42 |
+
(backbone: 1e-4, classifier: 1e-3)
|
| 43 |
+
- **Batch size:** 64
|
| 44 |
+
- **Validation accuracy:** 98.51%
|
| 45 |
+
|
| 46 |
+
## Architecture
|
| 47 |
+
```
|
| 48 |
+
EfficientNet-B4 (ImageNet pretrained, last 30% unfrozen)
|
| 49 |
+
└── Custom classifier head:
|
| 50 |
+
Dropout(0.5)
|
| 51 |
+
Linear(in_features → 512)
|
| 52 |
+
ReLU
|
| 53 |
+
BatchNorm1d(512)
|
| 54 |
+
Dropout(0.4)
|
| 55 |
+
Linear(512 → 2)
|
| 56 |
+
```
|
| 57 |
|
| 58 |
## Usage
|
| 59 |
```python
|
| 60 |
import torch
|
| 61 |
from huggingface_hub import hf_hub_download
|
| 62 |
+
from torchvision.models import efficientnet_b4
|
| 63 |
+
import torch.nn as nn
|
| 64 |
|
| 65 |
# Download model
|
| 66 |
model_path = hf_hub_download(
|
| 67 |
+
repo_id="viktorahnstrom/xade-deepfake-detector",
|
| 68 |
filename="best_model.pt"
|
| 69 |
)
|
| 70 |
|
| 71 |
+
# Load checkpoint
|
| 72 |
+
checkpoint = torch.load(model_path, map_location="cpu", weights_only=False)
|
| 73 |
+
print(f"Trained for {checkpoint['epoch']} epochs")
|
| 74 |
+
print(f"Classes: {checkpoint['class_names']}") # ['fake', 'real']
|
| 75 |
```
|
| 76 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 77 |
## Citation
|
| 78 |
```bibtex
|
| 79 |
@misc{xade2026,
|
| 80 |
+
author = {Viktor Ahnström and Viktor Carlsson},
|
| 81 |
+
title = {XADE: Cross-Platform Explainable Deepfake Detection
|
| 82 |
+
Using Vision-Language Models},
|
| 83 |
year = {2026},
|
| 84 |
+
institution = {Jönköping University},
|
| 85 |
+
howpublished = {\url{https://huggingface.co/viktorahnstrom/xade-deepfake-detector}}
|
| 86 |
}
|
| 87 |
```
|