Instructions to use wiltodelta/raiw-source-classify with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Grok
How to use wiltodelta/raiw-source-classify with Grok:
# No code snippets available yet for this library. # To use this model, check the repository files and the library's documentation. # Want to help? PRs adding snippets are welcome at: # https://github.com/huggingface/huggingface.js
- Notebooks
- Google Colab
- Kaggle
# No code snippets available yet for this library.
# To use this model, check the repository files and the library's documentation.
# Want to help? PRs adding snippets are welcome at:
# https://github.com/huggingface/huggingface.js
RAIW multi-provider source-pipeline classifier (multi-provider-source-v10)
This repository contains the unified (67.00 MB), CPU-only, pickle-free (allow_pickle=False) multimodal weights for the abstaining remove-ai-watermarks pixel source-pipeline and synthetic-image classifier across 10 AI provider families (openai, google, bytedance, flux, stable_diffusion, meta, midjourney, ideogram, firefly, xai) plus unknown, with Stage-2 model/export version attribution (version_subfamily) and calibrated binary synthetic detection (synthetic_detected, synthetic_probability) under foreign resize, social recompression, localized inpainting, and container transcoding.
This model is not a SynthID detector and does not decode or verify any cryptographic or invisible watermark payload (watermark_truth="unknown"). Its labels describe complete generation and export pixel pipelines, so renderer, geometry, encoding, post-processing, and watermark state may be confounded. unknown does not mean that SynthID is absent, and a provider label does not prove that SynthID is present.
Quickstart (NumPy + ONNX Runtime CPU, no PyTorch required)
pip install "remove-ai-watermarks[source-classify]"
import remove_ai_watermarks as raiw
res = raiw.classify_source("image.jpg")
print(res.label, res.version_subfamily, res.synthetic_detected, round(res.synthetic_probability, 4))
# e.g. 'openai' 'openai:gpt_image_1_5' True 0.9942 (native AI export)
# e.g. 'unknown' None True 0.9412 (foreign 1024x1024 transcoded AI image)
# e.g. 'unknown' None False 0.0084 (camera photo, UI screenshot, diagram, or scanned document)
Command line (installed CLI or zero-setup uv run with the bundled infer.py and open-detector benchmark.py from Hugging Face or GitHub):
remove-ai-watermarks classify-source image.jpg --json
uv run https://raw.githubusercontent.com/wiltodelta/raiw-source-classify/main/infer.py image.jpg --json
uv run https://raw.githubusercontent.com/wiltodelta/raiw-source-classify/main/infer.py --inspect-weights
uv run https://raw.githubusercontent.com/wiltodelta/raiw-source-classify/main/benchmark.py
uv run https://huggingface.co/wiltodelta/raiw-source-classify/resolve/main/benchmark.py --tier frontier
The verified multi-provider-source-v10.npz bundle is published identically on Hugging Face and GitHub Releases (automatic SHA-256-verified fallback when Hugging Face is unreachable). Try it in your browser on the Remove AI Watermarks Hugging Face Space or at raiw.cc. Set RAIW_SOURCE_CLASSIFY_WEIGHTS to multi-provider-source-v10.npz or its parent directory for air-gapped deployments.
Model architecture
- Physics, sublattice, sensor, and codec branch (
512-d,extract_512d_v4_features):112-dadaptive overlapping native-tile truncated SRM micro-residuals across flat and textured regions.128-dphase-resolved modulo-8 / modulo-16 sublattice energy, cropped-grid secondary-phase detection, interior VAE modulation, and8x8block-DCT quantization comb statistics.144-dMoisan periodic-plus-smooth (p + s) spectral decomposition, radial decay profile, and continuous scale-invariant period-comb scanner.96-dpatch-averaged cross-channel spectral phase coherence, Bayer/Quad-Bayer CFA periodicity, heteroscedastic shot-noise slope, and radial chromatic-aberration alignment.32-dexplicit codec, aspect-ratio, scale, and social-recompression regime vector (x[480:512]).
- Dual-branch visual & spatial split-tail (
OwensLab/commfor-model-384MITViT-B/16 @ 384selective weight-fp16 ONNX,vit_onnx_bytes,66-d):- Permissive MIT
OwensLab/commfor-model-384(@ 6076002bf0d9) frozen visual stem (blocks[0..8]) feeding Branch A (unadapted frozenblocks[9..11]preserving generalist[orig_cf_cls, orig_cf_valid_patch_mean]logits) and Branch B (adaptedblocks[9..11]+ 4-layerRINEintermediate gating + 3-teacher permissive logit distillation acrossCommFor-MIT,DINOv2-Reg4-Base, andSigLIP2-Base+SubCenterArcFace-24d+24x243x3SpatialPatchHeadwithpatch_clean_24x24andpatch_gfx_24x24), stored as a selective weight-fp16 -> fp32-compute ONNX graph inside the pickle-free.npzbundle and executed viaonnxruntimeon CPU, paired with coordinate-routed1:1unresampled384x384Pass-2 native tiles (preprocess_vit_384_routed_2chw_v10).
- Permissive MIT
- Stage 1 & 1.5 (
154unit channels +962D gates +209-d3-view open-set provider head +117-dglobal fusion +39-dspatial-anomaly local edit head):- Two-tower
512-densemble in pure NumPy (5multi-seed Regime-FiLMLayerNorm+SiLUresidual MLP trunks +65packedHistGradientBoostingspecialist forests) feeding an11-channel regime-standardized acceptance detector, conditional attribution MLP, and a209-d -> 96-d -> 123-view open-set multimodal provider head (10providers vslogsumexp(foreign_ai, real_non_ai)) that recovers exactlabelon native and transcoded 10-provider images while keeping unseen generators as honestunknown. - Anchored
117-d -> 64-d -> 1global synthetic fusion head and39-d -> 32-d -> 1_LocalEditHeadV9spatial-anomaly head combining the66-ddual-branch ViT output, Pass-2 tile contrast, bounded11-channel Stage-1.5 physics acceptance vector, positive/negative global physics cues, the26-dcodec-invariant born-digital graphics score, and the32-dregime block.
- Two-tower
- Stage 2 (
9stacked blended + multimodal residual version heads,666-d+ ArcFace/ViT residual):- Vectorized
HistGradientBoostingtree ensembles blended with standardized linear heads (666-d) and multimodal_MMStage2HeadV8residual version heads (SubCenterArcFace+ ViT + regime) to predict the canonical model/export subfamily (version_subfamily).
- Vectorized
- Artifact:
multi-provider-source-v10.npz(allow_pickle=False,67.00 MB) - SHA-256:
b3eb961cc68cf283b399bebf11cdf61b2bf41b98fabca0579f8b61d9141f695f
The artifact contains only learned parameters, weight-fp16 ONNX graph bytes, normalization constants, tree arrays, labels, and calibrated thresholds. It does not contain training images, paths, image hashes, embeddings, or a training catalog.
Evaluation
Open 578-image multi-regime benchmark (benchmark.py)
Interactive 20-model comparison matrix: wiltodelta/ai-image-detector-leaderboard.
Evaluated end-to-end via classify_source on 200 non-AI false-positive traps (50 camera photos, 50 UI screenshots, 50 science diagrams, 50 scanned documents), 125 untouched native AI exports (25 each across FLUX.1-dev, GPT-Image-1, Gemini Nano Banana Pro, SDXL, Midjourney v6.1), and 253 square-resized/transcoded crowd-arena AI images (Rapidata and bitmind 1024x1024 JPEG/WebP/PNG):
- Non-AI false-positive rate (
200traps):0.0%(0 / 200) across all four slices (0%camera photo,0%UI screenshot,0%science diagram,0%scanned document) and100.0%precision. - Overall AI detection (
378):82.8%binary synthetic recall (313 / 378) and38.6%exact generator attribution (46.6%when classified). - Native AI exports (
125):93.6%binary synthetic recall (117 / 125) and76.8%exact generator attribution (96 / 125;82.1%when classified, including100.0%on SDXL and96.0%on FLUX.1-dev). - Transcoded crowd-arena AI (
253):77.5%binary synthetic recall (196 / 253, including87.1%on xAI Grok and96.3%on Ideogram) and19.8%exact generator attribution (50 / 253, keeping honestunknownabstention when provider identity is unrecoverable;371.8 msmedian single-image CPU latency).
Internal locked test & external blind multi-variety verification
The operating point was selected strictly on parent-disjoint calibration partitions (parent_sha256 grouped). Across sealed held-out benchmarks:
- End-to-end RGB + ViT on
4,421resolvedlocked_testparents (2,074supported AI +2,347real non-AI across 15 real varieties):0.26%real synthetic FPR (6 / 2,347false positives;0.00%real provider FPR,0 / 2,347),95.76%native synthetic recall (93.35%exact provider recall;0.9994ROC-AUC /0.9993PR-AUC), and70.54%synthetic recall (43.30%exact provider recall) after forced1024x1024JPEG/WebP arena transcoding across all 10 provider families (0.77%transcoded real FPR,0.9817ROC-AUC). - Sealed 12-unseen-family open-world generator benchmark (
480native + transcoded views across 12 unseen generator families):87.71%binary synthetic recall with94.79%honestlabel="unknown"abstention (and63.10%recall /94.05%abstention on the84-view historical foreign-generator panel). - External
AI Detector Arena v0.1(2,038images across 17 generators + 6 studio/real categories):4.31%real FPR (44 / 1,020),91.02%pixels-only F1 (91.64combined score;92.26full combined score with provenance/visible marks,0.9689ROC-AUC). - External blind
selective-v8end-to-end RGB + ViT (1,512untouched real-variety parents):0 / 965(0.00%FPR) across all camera photo (0 / 25),diagram(0 / 305),document(0 / 308), andinterface(0 / 327) parents,1 / 332onvector, and1 / 215ongame_art(2 / 1,512 = 0.13%overall synthetic FPR;0 / 1,512provider FPR;1 / 2,267 = 0.04%across all2,267512-drows;0 / 60on real phone scanned documents). - External in-the-wild social/news benchmark (
WildAIGC-Bench V3,1,238images):2.35%real FPR (15 / 638real posts) with14.17%processed AI recall (15.33%raw recall). - Full
10,585-rowlocked_test512-dprovider router:99.93%unknownspecificity (3 / 4,538false positives,0.07%FPR),83.28%exact provider recall (92.45%native,92.95%resized,77.06%social-recompressed),99.94%any-AI precision, and95.93%Stage-2 version accuracy given exact provider.
| Provider | Test count | Standalone ROC AUC | Router recall | Router precision | Stage-2 version accuracy |
|---|---|---|---|---|---|
openai |
1,478 | 0.9997 | 92.1% | 96.1% | 95.6% |
google |
1,382 | 0.9996 | 86.4% | 97.5% | 97.0% |
bytedance |
389 | 0.9863 | 72.0% | 98.9% | 96.8% |
flux |
1,357 | 0.9993 | 80.8% | 95.2% | 95.0% |
stable_diffusion |
955 | 0.9987 | 77.2% | 98.1% | 98.0% |
meta |
94 | 0.9995 | 86.2% | 98.8% | - (meta:imagine) |
midjourney |
123 | 1.0000 | 82.1% | 87.8% | 98.0% |
ideogram |
118 | 0.9999 | 84.7% | 78.7% | 77.0% |
firefly |
103 | 0.9948 | 61.2% | 91.3% | 100.0% |
xai |
48 | 0.9990 | 45.8% | 91.7% | 77.3% |
Intended use
Install remove-ai-watermarks[source-classify] and call the explicit Python API classify_source(path) or CLI command remove-ai-watermarks classify-source <IMAGE>. identify does not run this model. Set RAIW_SOURCE_CLASSIFY_WEIGHTS to the .npz file or its parent directory for offline deployments.
- Downloads last month
- 302