ClearSnap offline AI-image detector (int8 ONNX)
On-device build of haywoodsloan/ai-image-detector-deploy (SwinV2, Apache-2.0) used by the ClearSnap app. Exported to ONNX (opset 17) and dynamically quantised to int8 (790 MB β 190 MB); output parity with the original PyTorch model was verified.
- Input
pixel_values: float32[1, 3, 256, 256], RGB, PIL bicubic resize to 256Γ256, scaled to 0β1, normalised with ImageNet mean/std (seepreprocessing.json). - Output
logits:[1, 2]β index 0 = artificial, 1 = real.
Benchmark (ClearSnap test set, 393 images)
216 real photos (27 phone/camera models) + 177 AI images (20 generators, 2024β2026), Wikimedia Commons originals.
| Accuracy | AI caught | Real wrongly flagged | |
|---|---|---|---|
| Original files (model + metadata provenance) | 92% | 88% | 5% |
| Re-shared copies (1600 px, JPEG q85, metadata stripped) | 88.5% | 77% | 2.3% |
License
Apache-2.0, inherited from the base model by haywoodsloan. This is a converted, quantised derivative; no retraining was performed.
v2 (ClearSnap 7.4): Fast + Thorough detectors
| File | Base model | License | Size | Output |
|---|---|---|---|---|
clearsnap_detector_v2_int8.onnx |
haywoodsloan/ai-image-detector-deploy (SwinV2) | Apache-2.0 | 190 MB | logits [1,2], features [1,1536] |
clearsnap_siglip_w8.onnx |
Ateeqq/ai-vs-human-image-detector (SigLIP) | Apache-2.0 | 85 MB | logits [1,2], features [1,768] (mean-pooled) |
clearsnap_clip_int8.onnx |
openai/clip-vit-base-patch16 (vision tower) | MIT | 83 MB | features [1,512] (L2-normalised image embedding) |
- SwinV2 / CLIP: dynamic int8. SigLIP: weight-only int8 (activation outliers break dynamic int8).
head_hay.json(Fast) andhead_hay_ate_clip.json(Thorough): logistic-regression decision layers trained by ClearSnap on frozen features of 2,056 images (Nano Banana, GPT-Image, DALL-E 3, FLUX, Midjourney/SD mix, Wikimedia Commons generators; real photos from 22 phone/camera models). CLIP features are scaled Γ10.- Preprocessing: SwinV2 β PIL bicubic 256Γ256, ImageNet mean/std. SigLIP β PIL bilinear 224Γ224, mean/std 0.5. CLIP β PIL bicubic shortest-edge 224 + centre crop 224, CLIP mean/std.
Held-out benchmark (393 Wikimedia Commons images, never used in training), compressed models, full app logic, accuracy when a verdict is given: Thorough 98.4% (originals) / 96.9% (re-shared); Fast 96.2% / 95.7%.
Model tree for PatrickKillinni/clearsnap-detector
Unable to build the model tree, the base model loops to the model itself. Learn more.