File size: 4,993 Bytes
8b3a3e4 05c84a9 8b3a3e4 27d3220 73401b5 05c84a9 8b3a3e4 05c84a9 8b3a3e4 26c3baa | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 | ---
library_name: pytorch
pipeline_tag: image-classification
tags:
- computer-vision
- image-forensics
- ai-image-detection
- dinov2
- safetensors
---
# Raven
Raven์ ์ค์ ์ฌ์ง๊ณผ AI ์์ฑ ์ด๋ฏธ์ง๋ฅผ ๊ตฌ๋ถํ๊ธฐ ์ํด ๋ง๋ ์ด๋ฏธ์ง ํฌ๋ ์ ๋ชจ๋ธ์
๋๋ค.
์ต์ข
์ถ๋ ฅ์ `REAL`, `AI`, `UNCERTAIN` ๋ก ์ด 3๊ฐ์ง์ด๊ณ , AI ๋ฐ์ดํฐ๋ GPT Image 2 ๊ณ์ด์ ๊ธฐ์ค์ผ๋ก ํฉ๋๋ค.
ํ์ ๊ธฐ์ค์ ๋ค์๊ณผ ๊ฐ์ต๋๋ค.
```text
REAL p(AI) <= 0.28
UNCERTAIN 0.28 < p(AI) < 0.72
AI p(AI) >= 0.72
```
## ์์์ฝ๋
```python
import warnings
warnings.filterwarnings("ignore")
import sys
from pathlib import Path
HERE = Path(__file__).resolve().parent
sys.path.insert(0, str(HERE))
from raven.inference import infer_image
model = HERE / "model.safetensors"
image_extensions = {
".png",
".jpg",
".jpeg",
".webp",
".bmp",
}
images = sorted(
[
file for file in HERE.iterdir()
if file.is_file()
and file.suffix.lower() in image_extensions
],
key=lambda p: p.name.lower()
)
for image in images:
print(f"File: {image.name}")
result = infer_image(
str(model),
str(image),
)
print(f"Verdict: {result['verdict']}")
print(f"AI: {result['ai_probability'] * 100:.2f}%")
print(f"REAL: {result['real_probability'] * 100:.2f}%")
print()
```
## Benchmark
Validation ๋ฐ์ดํฐ๋ ์ด **4,470์ฅ**์
๋๋ค.
* REAL: 3,003
* AI: 1,467
| Metric | Result | 95% CI |
| --------------------- | -----------: | ------------------: |
| Accuracy | **98.635%** | 98.251% - 98.936% |
| Balanced Accuracy | **98.566%** | 98.159% - 98.935% |
| AUROC | **0.998255** | 0.997220 - 0.999083 |
| Balanced AP | **0.998472** | 0.997685 - 0.999135 |
| AI confirmed recall | **97.001%** | 95.998% - 97.758% |
| REAL confirmed recall | **97.502%** | 96.881% - 98.003% |
| AI to REAL error | **0.954%** | 0.569% - 1.596% |
| REAL to AI error | **0.599%** | 0.379% - 0.946% |
| Coverage | **98.054%** | - |
| Selective accuracy | **99.207%** | - |
| Uncertain | **1.946%** | - |
| Balanced Brier | **0.011403** | - |
| Balanced ECE | **0.005572** | - |
### Decisions
AI 1,467์ฅ:
```text
AI 1,423
REAL 14
UNCERTAIN 30
```
REAL 3,003์ฅ:
```text
REAL 2,928
AI 18
UNCERTAIN 57
```
## REAL-only Test
๋ณ๋๋ก ๋ถ๋ฆฌ๋ REAL ์ด๋ฏธ์ง **2,986์ฅ**์์๋ ํ๊ฐ๋ฅผ ํ์์ต๋๋ค.
| Metric | Result | 95% CI |
| --------------------- | ----------: | ----------------: |
| Accuracy | **98.225%** | 97.686% - 98.640% |
| REAL confirmed recall | **96.383%** | 95.652% - 96.995% |
| REAL to AI error | **1.038%** | 0.732% - 1.470% |
| Coverage | **97.421%** | - |
| Selective accuracy | **98.934%** | - |
| Uncertain | **2.579%** | - |
์ค์ ํ์ ๊ฒฐ๊ณผ:
```text
REAL 2,878
AI 31
UNCERTAIN 77
```
## Lighting
Validation ๋ฐ์ดํฐ์ ๋ฐ๊ธฐ๋ณ ๊ฒฐ๊ณผ์
๋๋ค.
| Group | N | Accuracy | AUROC | AI Recall | REAL Recall | Uncertain |
| ------------ | ----: | -------: | -------: | --------: | ----------: | --------: |
| dark | 299 | 99.331% | 0.999498 | 98.611% | 92.771% | 2.676% |
| dim | 1,137 | 98.769% | 0.999256 | 97.767% | 97.139% | 2.199% |
| extreme-dark | 28 | 96.429% | 1.000000 | 94.444% | 90.000% | 7.143% |
| normal | 3,006 | 98.536% | 0.997519 | 96.265% | 97.840% | 1.730% |
extreme-dark๋ ํ๋ณธ ์๊ฐ ์ ๊ธฐ ๋๋ฌธ์ ๋ค๋ฅธ ๊ตฌ๊ฐ๋ณด๋ค ์์น์ ๋ถํ์ค์ฑ์ด ํด ์ ์์ต๋๋ค.
## Limitations
ํ์ฌ AI ํ์ต ๋ฐ์ดํฐ๋ **GPT Image 2**๋ฅผ ์ค์ฌ์ผ๋ก ๊ตฌ์ฑ๋์ด ์์ต๋๋ค.
๋ฐ๋ผ์ ์ benchmark๋ GPT Image 2 ๊ณ์ด๊ณผ ํ์ฌ REAL ๋ฐ์ดํฐ ๋ถํฌ์์์ ์ฑ๋ฅ์ ๋ํ๋
๋๋ค.
๋ค์๊ณผ ๊ฐ์ ๊ฒฝ์ฐ ๋์ผํ ์ฑ๋ฅ์ ๋ณด์ฅํ์ง ์์ต๋๋ค.
* ํ์ต์ ํฌํจ๋์ง ์์ AI ์์ฑ ๋ชจ๋ธ
* ๊ฐํ JPEG ์ฌ์์ถ
* ์คํฌ๋ฆฐ์ท
* ์
์ค์ผ์ผ ๋ฐ ๋
ธ์ด์ฆ ์ ๊ฑฐ
* ๊ณผ๋ํ ์๋ณด์ ๋๋ ํ์ฒ๋ฆฌ
* ์ด๋ฏธ์ง ์ผ๋ถ๋ง ํฉ์ฑ๋ ๊ฒฝ์ฐ
* ๋งค์ฐ ์ด๋์ด ์ด๋ฏธ์ง
ํนํ Midjourney, FLUX, Stable Diffusion ๋ฑ ๋ค๋ฅธ ์์ฑ๊ธฐ์์์ ์ฑ๋ฅ์ ๋ณ๋๋ก ๊ฒ์ฆ๋์ด์ผ ํฉ๋๋ค.
Raven์ ์ถ๋ ฅ์ ์ด๋ฏธ์ง ์ถ์ฒ์ ๋ํ ํ๋ฅ ๊ธฐ๋ฐ ํฌ๋ ์ ํ๋จ์ด๋ฉฐ, ์ด๋ฏธ์ง๊ฐ AI๋ก ์์ฑ๋์์์ ์ฆ๋ช
ํ๋ ์ ๋์ ์ธ ์ฆ๊ฑฐ๋ก ์ฌ์ฉํด์๋ ์ ๋ฉ๋๋ค. |