mirror of
https://github.com/wiltodelta/remove-ai-watermarks.git
synced 2026-10-14 13:30:55 +02:00
43 lines
1.8 KiB
Markdown
43 lines
1.8 KiB
Markdown
# Source-pipeline classification
|
|
|
|
`classify_source` is an opt-in, metadata-free pixel classifier for images that
|
|
still resemble an original provider export. It returns `openai`, `google`, or
|
|
an explicit `unknown` abstention.
|
|
|
|
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.
|
|
The model describes the complete source/export pipeline, where renderer,
|
|
geometry, encoding, post-processing, and watermark state can be confounded.
|
|
|
|
Install the lightweight runtime:
|
|
|
|
```bash
|
|
uv add "remove-ai-watermarks[source-classify]"
|
|
```
|
|
|
|
Call the Python API explicitly:
|
|
|
|
```python
|
|
import remove_ai_watermarks as raiw
|
|
|
|
result = raiw.classify_source("metadata-stripped.png")
|
|
print(result.label) # "openai" | "google" | "unknown"
|
|
print(result.reason) # "classified" | "abstained" | "feature_unavailable"
|
|
print(result.margins) # provider margins before thresholding
|
|
print(result.thresholds) # frozen provider thresholds
|
|
```
|
|
|
|
`feature_unavailable` is returned for images below the required 256x256
|
|
geometry or for a degenerate feature vector. `abstained` means neither provider
|
|
cleared its independent calibrated margin. Both are honest `unknown` results.
|
|
|
|
The first call downloads the exact pinned revision of
|
|
[`wiltodelta/raiw-source-classify`](https://huggingface.co/wiltodelta/raiw-source-classify).
|
|
Set `RAIW_SOURCE_CLASSIFY_WEIGHTS` to the NPZ itself or a directory containing
|
|
`source-pipeline-mlp.npz` for an offline deployment.
|
|
|
|
The model is useful as a routing suggestion for a processing workflow or as one
|
|
probabilistic signal in a broader forensic report. Do not use it as evidence of
|
|
authorship, fraud, policy compliance, provenance, or watermark presence. The
|
|
published model card records the evaluation and robustness limits.
|