Image Classification
ONNX
Grok
raiw-source-classify
image-forensics
source-attribution
open-set-classification
ai-image-detection
ai-generated-content
provider-attribution
openai
gpt-image
dall-e
google
imagen
flux
midjourney
stable-diffusion
ideogram
firefly
seedream
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
Source-classify freeze (GitHub 4ce3bad)
Browse files- README.md +2 -0
- benchmark.py +9 -4
- demo.ipynb +1 -1
- infer.py +1 -1
README.md
CHANGED
|
@@ -83,6 +83,8 @@ The artifact contains only learned parameters, weight-fp16 ONNX graph bytes, nor
|
|
| 83 |
|
| 84 |
### Open 578-image multi-regime benchmark (`benchmark.py`)
|
| 85 |
|
|
|
|
|
|
|
| 86 |
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):
|
| 87 |
|
| 88 |
- **Non-AI false-positive rate (`200` traps):** **`0.0%` (`0 / 200`)** across all four slices (`0%` camera photo, `0%` UI screenshot, `0%` science diagram, `0%` scanned document) and **`100.0%` precision**.
|
|
|
|
| 83 |
|
| 84 |
### Open 578-image multi-regime benchmark (`benchmark.py`)
|
| 85 |
|
| 86 |
+
Interactive 20-model comparison matrix: [`wiltodelta/ai-image-detector-leaderboard`](https://huggingface.co/spaces/wiltodelta/ai-image-detector-leaderboard).
|
| 87 |
+
|
| 88 |
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):
|
| 89 |
|
| 90 |
- **Non-AI false-positive rate (`200` traps):** **`0.0%` (`0 / 200`)** across all four slices (`0%` camera photo, `0%` UI screenshot, `0%` science diagram, `0%` scanned document) and **`100.0%` precision**.
|
benchmark.py
CHANGED
|
@@ -2,7 +2,7 @@
|
|
| 2 |
# /// script
|
| 3 |
# requires-python = ">=3.11,<3.15"
|
| 4 |
# dependencies = [
|
| 5 |
-
# "remove-ai-watermarks[source-classify]>=0.
|
| 6 |
# "huggingface-hub>=0.26.0",
|
| 7 |
# "onnxruntime>=1.24.0",
|
| 8 |
# "peft>=0.14.0",
|
|
@@ -722,11 +722,16 @@ def _evaluate_rgb_detector(
|
|
| 722 |
)
|
| 723 |
|
| 724 |
|
| 725 |
-
def evaluate_raiw(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 726 |
"""Evaluate `wiltodelta/raiw-source-classify` on CPU."""
|
| 727 |
from remove_ai_watermarks import source_classify as sc
|
| 728 |
|
| 729 |
-
weights_file = sc.resolve_weights_path()
|
| 730 |
weights_mb = round(weights_file.stat().st_size / (1024 * 1024), 2)
|
| 731 |
|
| 732 |
def _classify_one(raw_bytes: bytes) -> dict[str, Any]:
|
|
@@ -755,7 +760,7 @@ def evaluate_raiw(samples: list[SampleItem]) -> dict[str, Any]:
|
|
| 755 |
|
| 756 |
return _summarize_predictions(
|
| 757 |
model_id=sc.WEIGHTS_REPO,
|
| 758 |
-
revision=sc.WEIGHTS_REVISION,
|
| 759 |
runtime="NumPy + ONNX Runtime (CPU)",
|
| 760 |
weights_mb=weights_mb,
|
| 761 |
license_id="apache-2.0",
|
|
|
|
| 2 |
# /// script
|
| 3 |
# requires-python = ">=3.11,<3.15"
|
| 4 |
# dependencies = [
|
| 5 |
+
# "remove-ai-watermarks[source-classify]>=0.64.0",
|
| 6 |
# "huggingface-hub>=0.26.0",
|
| 7 |
# "onnxruntime>=1.24.0",
|
| 8 |
# "peft>=0.14.0",
|
|
|
|
| 722 |
)
|
| 723 |
|
| 724 |
|
| 725 |
+
def evaluate_raiw(
|
| 726 |
+
samples: list[SampleItem],
|
| 727 |
+
*,
|
| 728 |
+
weights_path: Path | None = None,
|
| 729 |
+
revision: str | None = None,
|
| 730 |
+
) -> dict[str, Any]:
|
| 731 |
"""Evaluate `wiltodelta/raiw-source-classify` on CPU."""
|
| 732 |
from remove_ai_watermarks import source_classify as sc
|
| 733 |
|
| 734 |
+
weights_file = sc.resolve_weights_path(weights_path)
|
| 735 |
weights_mb = round(weights_file.stat().st_size / (1024 * 1024), 2)
|
| 736 |
|
| 737 |
def _classify_one(raw_bytes: bytes) -> dict[str, Any]:
|
|
|
|
| 760 |
|
| 761 |
return _summarize_predictions(
|
| 762 |
model_id=sc.WEIGHTS_REPO,
|
| 763 |
+
revision=revision or sc.WEIGHTS_REVISION,
|
| 764 |
runtime="NumPy + ONNX Runtime (CPU)",
|
| 765 |
weights_mb=weights_mb,
|
| 766 |
license_id="apache-2.0",
|
demo.ipynb
CHANGED
|
@@ -22,7 +22,7 @@
|
|
| 22 |
"metadata": {},
|
| 23 |
"outputs": [],
|
| 24 |
"source": [
|
| 25 |
-
"%pip install -q \"remove-ai-watermarks[source-classify]>=0.
|
| 26 |
]
|
| 27 |
},
|
| 28 |
{
|
|
|
|
| 22 |
"metadata": {},
|
| 23 |
"outputs": [],
|
| 24 |
"source": [
|
| 25 |
+
"%pip install -q \"remove-ai-watermarks[source-classify]>=0.64.0\""
|
| 26 |
]
|
| 27 |
},
|
| 28 |
{
|
infer.py
CHANGED
|
@@ -2,7 +2,7 @@
|
|
| 2 |
# /// script
|
| 3 |
# requires-python = ">=3.11,<3.15"
|
| 4 |
# dependencies = [
|
| 5 |
-
# "remove-ai-watermarks[source-classify]>=0.
|
| 6 |
# ]
|
| 7 |
# ///
|
| 8 |
"""Standalone reference runner and pickle-free `.npz` weight inspector for `wiltodelta/raiw-source-classify`.
|
|
|
|
| 2 |
# /// script
|
| 3 |
# requires-python = ">=3.11,<3.15"
|
| 4 |
# dependencies = [
|
| 5 |
+
# "remove-ai-watermarks[source-classify]>=0.64.0",
|
| 6 |
# ]
|
| 7 |
# ///
|
| 8 |
"""Standalone reference runner and pickle-free `.npz` weight inspector for `wiltodelta/raiw-source-classify`.
|