Views
No views yet
| Metric | Clean Images | Degraded Images | Average |
|---|---|---|---|
| AUC | 0.9998 | 0.9995 | 0.9997 |
| Accuracy | 99.24% | 98.96% | 99.10% |
| Dataset | Samples | Accuracy | Mean P(AI) |
|---|---|---|---|
| Food-101 | 300 | 100.00% | 0.032 |
| COCO 2017 | 300 | 90.67% | 0.135 |
| Cats vs Dogs | 300 | 99.67% | 0.036 |
| Stanford Cars | 300 | 94.67% | 0.110 |
| Oxford Flowers | 300 | 95.67% | 0.115 |
| Average | — | 96.13% | — |
| Dataset | Generator | Samples | Accuracy | Mean P(AI) |
|---|---|---|---|---|
| DALL-E 3 | OpenAI | 300 | 100.00% | 0.993 |
| Midjourney V6 | Midjourney | 300 | 96.33% | 0.936 |
| Average | — | — | 98.17% | — |
| Dataset | Samples | Accuracy | AUC | F1 |
|---|---|---|---|---|
| AI-or-Not | 500 | 96.80% | 0.9986 | 97.04% |
pip install torch torchvision transformers timm peft pillow1from huggingface_hub import hf_hub_download
2from model import AIImageDetector
3
4# Download model
5model_path = hf_hub_download(
6 repo_id="Bombek1/ai-image-detector-siglip-dinov2",
7 filename="pytorch_model.pt"
8)
9
10# Initialize detector
11detector = AIImageDetector(model_path)
12
13# Predict single image
14result = detector.predict("path/to/image.jpg")
15print(f"Prediction: {result['prediction']}")
16print(f"Confidence: {result['confidence']:.1%}")
17print(f"P(AI): {result['probability']:.4f}")1from pathlib import Path
2
3images = list(Path("./images").glob("*.jpg"))
4for img_path in images:
5 result = detector.predict(img_path)
6 print(f"{img_path.name}: {result['prediction']} ({result['confidence']:.1%})")EnsembleAIDetector (~740M parameters, ~8M trainable)
├── SigLIP2-SO400M-patch14-384 (with LoRA r=32 on q_proj, v_proj)
│ └── Output: 1152-dim features
├── DINOv2-Large-patch14 (with LoRA r=32 on qkv)
│ └── Output: 1024-dim features
└── ClassificationHead
├── LayerNorm(2176)
├── Linear(2176 → 512) + GELU + Dropout(0.3)
├── Linear(512 → 256) + GELU + Dropout(0.3)
└── Linear(256 → 1) → Sigmoid| Parameter | Value |
|---|---|
| Dataset | OpenFake (~95K train, 5K val) |
| Image Size | 392×392 |
| Epochs | 5 |
| Batch Size | 16 (effective: 144 with grad accum) |
| Learning Rate | 2e-4 (head), 5e-5 (LoRA) |
| Scheduler | Cosine with warmup |
| LoRA Rank | 32 |
| LoRA Alpha | 64 |
| Loss | Focal Loss (γ=2, α=0.25) |
| Limitation | Details |
|---|---|
| Low-resolution images | Performance degrades on images <128×128 (e.g., CIFAKE 32×32 dataset shows ~50% accuracy) |
| COCO-style images | ~9% false positive rate on casual/cluttered real photos |
| Artistic macro photography | Professional studio/macro shots may occasionally trigger false positives (~5%) |
| Non-photographic content | Designed for photographs; screenshots, graphics, and illustrations may not work well |
pytorch_model.pt — Full checkpoint with LoRA weightsmodel.py — Inference code with AIImageDetector classconfig.json — Model configuration1@misc{ai-image-detector-2025,
2 author = {Bombek1},
3 title = {AI Image Detector (SigLIP2 + DINOv2 Ensemble)},
4 year = {2025},
5 publisher = {Hugging Face},
6 url = {https://huggingface.co/Bombek1/ai-image-detector-siglip-dinov2}
7}