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
RAIW multi-provider source-pipeline classifier (multi-provider-source-v8)
This repository contains the unified (57.80 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, 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):
remove-ai-watermarks classify-source image.jpg --json
uv run https://huggingface.co/wiltodelta/raiw-source-classify/resolve/main/infer.py image.jpg --json
uv run https://huggingface.co/wiltodelta/raiw-source-classify/resolve/main/infer.py --inspect-weights
uv run https://huggingface.co/wiltodelta/raiw-source-classify/resolve/main/benchmark.py
uv run https://huggingface.co/wiltodelta/raiw-source-classify/resolve/main/benchmark.py --tier frontier
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-v8.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]).
- Visual multi-task branch (
ViT-S/16 @ 384weight-fp16 ONNX,vit_onnx_bytes,59-d):- Permissive MIT
ViT-S/16 @ 384frozen visual stem (TensorFold/detectra-v1lineage) paired with a zero-initialized parallel residual token adapter, multi-layerRINEintermediate hooks (blocks[5, 9, 11]),SubCenterArcFace-24d(93sub-centers across31generator subfamilies), a24x24SpatialPatchHead, andAIDEtexture-vs-smooth high-frequency patch contrast (59-doutput[orig_syn(0), prov_10(1:11), foreign_ai(11), real_non_ai(12), gfx_veto(13), dom_syn(14), emb_24(15:39), proto_sim_10(39:49), sp_summary_10(49:59)]) stored as a weight-fp16 -> fp32-compute ONNX graph inside the pickle-free.npzbundle and executed viaonnxruntimeon CPU, plus conditional1:1unresampledmodulo-16-aligned384x384native-tile passes (preprocess_vit_384_native_2chw) for gray-zone rescue and widescreen attribution recovery.
- Permissive MIT
- Stage 1 & 1.5 (
154unit channels +962D gates +195-d3-view open-set provider head +106-dopen-world synthetic fusion):- 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 a195-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
106-d -> 64-d -> 1LayerNorm+SiLUskip multimodal synthetic fusion head combining the59-dViT output, bounded11-channel Stage-1.5 physics acceptance vector, positive/negative global physics cues, the26-dcodec-invariant born-digital graphics score, spatial/graphics interaction gates, and the32-dregime block. When container laundering or an unseen generator prevents 10-family attribution,labelhonestly abstains asunknownwhilesynthetic_detectedandsynthetic_probabilityretain binary synthetic recall without sacrificing screenshot, diagram, or document specificity.
- 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-v8.npz(allow_pickle=False,57.80 MB) - SHA-256:
7e7a9ee708bc2d64b45b87829b2c45e487aed3936220fb09843267662c99e0da
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)
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):92.9%binary synthetic recall (351 / 378) and42.6%exact generator attribution (45.9%when classified). - Native AI exports (
125):98.4%binary synthetic recall (123 / 125) and80.8%exact generator attribution (101 / 125;82.1%when classified, including96.0%on SDXL and84.0%on FLUX.1-dev, GPT-Image-1, and widescreen1408x768Gemini Nano Banana Pro). - Transcoded crowd-arena AI (
253):90.1%binary synthetic recall (228 / 253, up from87.0%inv7and30.4%inv6) and23.7%exact generator attribution (60 / 253, up from18.6%inv7and9.5%inv6via 3-view open-set multimodal attribution while keeping honestunknownabstention when provider identity is unrecoverable;385.9 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,415resolvedlocked_testparents (2,074supported AI +2,341real non-AI across 15 real varieties):0.09%real synthetic FPR (2 / 2,341false positives;0.04%real provider FPR,1 / 2,341),97.54%native synthetic recall (95.18%exact provider recall, up from92.82%inv7;0.9997ROC-AUC /0.9996PR-AUC), and79.36%synthetic recall (46.96%exact provider recall, up from65.43%/25.41%inv7) after forced1024x1024JPEG/WebP arena transcoding across all 10 provider families (0.68%transcoded real FPR,0.9847ROC-AUC). - Sealed open-world foreign-generator check (
84held-out views outside the 10 provider families):96.43%honestlabel="unknown"abstention (81 / 84;0 / 51false attributions oncal-fitforeign AI) with67.86%binary synthetic recall across unseen generators. - External blind
selective-v8end-to-end RGB + ViT (1,512untouched real-variety parents):0 / 638(0.00%FPR) across all camera photo (0 / 25),diagram(0 / 305), anddocument(0 / 308) parents,1 / 327oninterface,1 / 332onvector, and2 / 215ongame_art(4 / 1,512 = 0.26%overall synthetic FPR;1 / 2,267 = 0.04%across all2,267512-drows). - External in-the-wild social/news benchmark (
WildAIGC-Bench V3,1,238images):19.67%processed AI recall (up from10.50%inv7) at3.92%real FPR (down from4.86%inv7,57.87%balanced accuracy). - 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
- 138