Release SimLBR aigc and genimage heads
Browse files- README.md +73 -0
- aigc/config.json +11 -0
- aigc/model.safetensors +3 -0
- genimage/config.json +11 -0
- genimage/model.safetensors +3 -0
README.md
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: mit
|
| 3 |
+
library_name: pytorch
|
| 4 |
+
pipeline_tag: image-classification
|
| 5 |
+
tags:
|
| 6 |
+
- ai-generated-image-detection
|
| 7 |
+
- deepfake-detection
|
| 8 |
+
- dinov3
|
| 9 |
+
- cvpr2026
|
| 10 |
+
---
|
| 11 |
+
|
| 12 |
+
# SimLBR: Learning to Detect Fake Images by Learning to Detect Real Images (CVPR 2026)
|
| 13 |
+
|
| 14 |
+
[](https://arxiv.org/abs/2602.20412)
|
| 15 |
+
[](https://github.com/mvrl/SimLBR)
|
| 16 |
+
|
| 17 |
+
Pretrained AI-generated image detectors from the CVPR 2026 paper **SimLBR**. A frozen DINOv3 ViT-L/16 backbone (LVD-1689M weights) produces one CLS embedding per image, and a small MLP head, trained with Latent Blending Regularization (LBR), predicts whether the image is real or fake.
|
| 18 |
+
|
| 19 |
+
Each file in this repo holds **only the MLP head** (~2.6 MB). The DINOv3 backbone is not redistributed here; it is downloaded from Meta under the [DINOv3 license](https://ai.meta.com/resources/models-and-libraries/dinov3-downloads/).
|
| 20 |
+
|
| 21 |
+
## Models
|
| 22 |
+
|
| 23 |
+
| Variant | Files | Training data | Benchmark | Avg. Acc | Avg. AP |
|
| 24 |
+
|---|---|---|---|---|---|
|
| 25 |
+
| `aigc` | `aigc/` | ProGAN | AIGCDetectionBenchMark (16 subsets) | 88.4 | 96.1 |
|
| 26 |
+
| `genimage` | `genimage/` | GenImage SD v1.4 | GenImage (8 subsets) | 91.1 | 97.1 |
|
| 27 |
+
|
| 28 |
+
Note: the GenImage numbers above differ from the paper. The paper's GenImage ADM entry was evaluated on real images only, because a data-loading bug skipped ADM's fake images (`.PNG` extension). The numbers here include all ADM images and are what the released code reproduces.
|
| 29 |
+
|
| 30 |
+
Head: `Linear(1024→512) → ReLU → Dropout → Linear(512→256) → ReLU → Dropout → Linear(256→1)`, trained with LBR α ~ U(0.5, 0.8). Output is a logit; `sigmoid(logit) > 0.5` means fake.
|
| 31 |
+
|
| 32 |
+
## Usage
|
| 33 |
+
|
| 34 |
+
Install the [SimLBR code](https://github.com/mvrl/SimLBR) and set `DINO_V3_KEY` to your DINOv3 ViT-L/16 download URL from Meta:
|
| 35 |
+
|
| 36 |
+
```bash
|
| 37 |
+
git clone https://github.com/mvrl/SimLBR && cd SimLBR
|
| 38 |
+
export DINO_V3_KEY=YOUR_DINOV3_VITL16_URL
|
| 39 |
+
```
|
| 40 |
+
|
| 41 |
+
Score images:
|
| 42 |
+
|
| 43 |
+
```bash
|
| 44 |
+
python -m simlbr.predict --pretrained aigc image1.png image2.jpg
|
| 45 |
+
```
|
| 46 |
+
|
| 47 |
+
Load in Python:
|
| 48 |
+
|
| 49 |
+
```python
|
| 50 |
+
from simlbr import SimLBR
|
| 51 |
+
|
| 52 |
+
model = SimLBR.from_pretrained("aigc") # or "genimage"
|
| 53 |
+
```
|
| 54 |
+
|
| 55 |
+
Reproduce benchmark numbers:
|
| 56 |
+
|
| 57 |
+
```bash
|
| 58 |
+
python -m simlbr.evaluate --dataset_name aigc --data_dir /path/to/AIGCDetectionBenchMark --pretrained aigc
|
| 59 |
+
```
|
| 60 |
+
|
| 61 |
+
**Preprocessing matters:** images must be resized to 256×256 and normalized with `mean=(0.430, 0.411, 0.296)`, `std=(0.213, 0.156, 0.143)`, as in `simlbr.utils.make_dinov3_transform()`. The heads were trained with these exact statistics.
|
| 62 |
+
|
| 63 |
+
## Citation
|
| 64 |
+
|
| 65 |
+
```bibtex
|
| 66 |
+
@article{dhakal2026simlbr,
|
| 67 |
+
title={SimLBR: Learning to Detect Fake Images by Learning to Detect Real Images},
|
| 68 |
+
author={Dhakal, Aayush and Khanal, Subash and Sastry, Srikumar and Arndt, Jacob and Ambrozio Dias, Philipe and Lunga, Dalton and Jacobs, Nathan},
|
| 69 |
+
booktitle={Computer Vision and Pattern Recognition},
|
| 70 |
+
year={2026},
|
| 71 |
+
organization={IEEE/CVF}
|
| 72 |
+
}
|
| 73 |
+
```
|
aigc/config.json
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"backbone": "dinov3",
|
| 3 |
+
"activation": "relu",
|
| 4 |
+
"hidden_layers": 2,
|
| 5 |
+
"dropout": 0.3,
|
| 6 |
+
"lbr": true,
|
| 7 |
+
"lbrdist": [
|
| 8 |
+
0.5,
|
| 9 |
+
0.8
|
| 10 |
+
]
|
| 11 |
+
}
|
aigc/model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:0fc5cf6d30cb324ef651bdea4461ddd567569a16a89fca038b8ec839d8f21494
|
| 3 |
+
size 2625988
|
genimage/config.json
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"backbone": "dinov3",
|
| 3 |
+
"activation": "relu",
|
| 4 |
+
"hidden_layers": 2,
|
| 5 |
+
"dropout": 0.3,
|
| 6 |
+
"lbr": true,
|
| 7 |
+
"lbrdist": [
|
| 8 |
+
0.5,
|
| 9 |
+
0.8
|
| 10 |
+
]
|
| 11 |
+
}
|
genimage/model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:d829f60e91a8c8b7d1acbb99c59bb8271001401705d8cf73ce229fd91f46226b
|
| 3 |
+
size 2625988
|