LoRA Deepfake Detector
Self-contained inference package for the LoRA-augmented deepfake detector.
- Backbone:
facebook/dinov3-vith16plus-pretrain-lvd1689m(LoRA on attention projections) - Input: RGB image, letterboxed to 512Γ512
- Output:
prob_fakein[0, 1]β labelfakeifprob_fake >= 0.5
Checkpoints
| File | Training step | Notes |
|---|---|---|
lora_75k.pth |
75,000 | Default |
lora_115k.pth |
115,000 | Later checkpoint |
Both were trained with HUGE_LORA_aug (augmentation on, 512px).
Setup
pip install -r requirements.txt
You must accept the DINOv3 license and be logged in:
huggingface-cli login
# or: export HF_TOKEN=...
Usage
CLI
python infer.py path/to/image.jpg
python infer.py path/to/image.jpg --weights lora_115k.pth --device cuda
Example output:
fake (0.8734)
Python
from lora import Model
model = Model.load(device="cuda")
result = model.predict("photo.jpg", device="cuda")
print(result) # {"label": "fake", "prob_fake": 0.87}
Model architecture
- DINOv3 ViT-H+ with LoRA (
r=16,alpha=32) onq/k/v/o_proj - MMFuser β multi-layer feature fusion
- Head β L2-normalized CLS + mean patch tokens β linear β binary softmax
Preprocessing uses aspect-preserving letterbox to 512 (no stretch).
Files
lora.pyβModelclass and preprocessinginfer.pyβ command-line inference scriptlora_75k.pth/lora_115k.pthβ fine-tuned weights (state dict)config.jsonβ metadata
Citation
DFKI / GAI Joint project.
- Downloads last month
- 16