3.0 KiB
Source-pipeline classification
classify_source (and the CLI command classify-source) is an opt-in,
metadata-free pixel source-pipeline classifier across 10 AI provider families
with Stage-2 model-version attribution.
This is not a SynthID detector. It does not decode or verify a watermark
payload, and it must not be used to claim that SynthID is present or absent
(watermark_truth="unknown"). The model describes the complete source/export
pixel pipeline, where renderer, geometry, encoding, post-processing, and
watermark state can be confounded.
Install the lightweight runtime:
uv add "remove-ai-watermarks[source-classify]"
It evaluates a 512-dimensional physics-grounded forensic, sublattice, spectral,
sensor, and codec/geometry regime descriptor (112-d adaptive native-tile SRM
residuals + 128-d phase-resolved modulo-8/16 sublattice and 8x8 DCT comb
features + 144-d Moisan periodic-plus-smooth spectral and period-comb profiles
96-dCFA/shot-noise/chromatic-aberration sensor cues +32-dcodec and geometry regime features) through a two-tower pure NumPy ensemble (Regime-FiLM residual MLP trunks + packedHistGradientBoostingspecialists), 2D multiplicative interaction gates, decoupled regime-aware supported-AI acceptance, a threshold-invariant 10-way skip attribution head, and stacked Stage-2 version classifiers.
It routes across all 10 canonical AI provider classes (openai, google,
bytedance, flux, stable_diffusion, meta, midjourney, ideogram,
firefly, xai) or abstains as unknown.
Call the CLI command or Python API explicitly:
remove-ai-watermarks classify-source metadata-stripped.png
remove-ai-watermarks classify-source metadata-stripped.png --json
import remove_ai_watermarks as raiw
result = raiw.classify_source("metadata-stripped.png")
print(result.label) # one of the 10 providers or "unknown"
print(result.version_subfamily) # e.g. "google:gemini_3_pro_image", "openai:gpt_image_1_5", or None
print(result.reason) # "classified" | "abstained" | "feature_unavailable"
print(result.margins) # provider margins before thresholding
print(result.thresholds) # calibrated provider thresholds
print(result.watermark_truth) # always "unknown"
feature_unavailable is returned for images below the required 256x256
geometry or for a degenerate feature vector. abstained means the image did not
clear the calibrated acceptance threshold. Both are honest unknown
results.
The first call downloads the exact pinned revision of
wiltodelta/raiw-source-classify
(multi-provider-source-v6.npz, verified by SHA-256). Set
RAIW_SOURCE_CLASSIFY_WEIGHTS to the .npz file itself or its parent directory
for an offline deployment.
This classifier is never invoked by identify, has_invisible_target, or all.
The model card records the evaluation and
robustness limits.