At a glance
| Upstream base model | legekka/AI-Anime-Image-Detector-ViT |
|---|---|
| Loaded ONNX repo |
onnx-community/AI-Anime-Image-Detector-ViT-ONNX
(onnx/model_quantized.onnx)
|
| Pipeline task | image-classification Β· id2label {"0": "real", "1": "ai"} |
| Architecture |
ViTForImageClassification (vit) β 12 layers, 12 heads, hidden size 768,
MLP 3072, 512Γ512 input, 32Γ32 patches (16Γ16 grid + [CLS])
|
| Image processor |
ViTImageProcessor β 512Γ512 bilinear resize, rescale 1/255,
mean [0.5, 0.5, 0.5], std [0.5, 0.5, 0.5]
|
| Backend & size |
CPU WASM q8 β 88.94 MB (88,943,600 B) via local
@huggingface/transformers@4.3.0 worker pin (3.7.5 WASM EP lacks ConvInteger(10)
for /vit/embeddings/patch_embeddings/projection/Conv_quant)
|
| License | Apache-2.0 (upstream checkpoint and ONNX conversion) |
Live Synthetic vs Human Illustration Classifier
Test deterministic procedural anime illustration plates, rights-cleared gallery photos/charts (out-of-domain controls), uploaded artwork, clipboard paste (Ctrl/Cmd+V), or a webcam snapshot. Inference and logit extraction run 100% locally in a module Web Worker.
Camera frames stay strictly on your device. Approve permission when prompted, then capture a frame.
Camera idle.
Initialising model loaderβ¦
No artwork selected yet.
Raw pipeline output & logits (exact id2label real/ai readout)
{}
See inside the ViT-B/32 @ 512Γ512 pipeline
Unlike 224Γ224 ImageNet ViTs that downsample away subtle brush strokes, screentone dots, and
latent diffusion upsampling artifacts, AI-Anime-Image-Detector-ViT preserves a
512Γ512 input frame and projects 32Γ32 pixel patches into a
16Γ16 token grid (256 spatial patches + 1 [CLS] token).
How the API works
Transformers.js executes onnx-community/AI-Anime-Image-Detector-ViT-ONNX inside a
module Web Worker pinned locally to @huggingface/transformers@4.3.0 so ORT-Web
executes the quantized ConvInteger patch projection cleanly:
import { pipeline } from "https://cdn.jsdelivr.net/npm/@huggingface/transformers@4.3.0";
const detector = await pipeline(
"image-classification",
"onnx-community/AI-Anime-Image-Detector-ViT-ONNX",
{ device: "wasm", dtype: "q8" },
);
const results = await detector(image, { top_k: 2 });
// -> [{ label: "real", score: ... }, { label: "ai", score: ... }]
See inside the code
Inspect the exact ES modules powering this page β local 4.3.0 worker load, single-pass logit extraction, and pure binary analysis maths.
Show the code β worker.js: ensureLoaded() (local 4.3.0 WASM q8 + epoch guards)
Show the code β worker.js: classifyImage() (white-flatten, raw logits, real nanCount)
Show the code β anime-core.mjs: analyzeDetection() (logit margin & Shannon entropy)
Explore the 5-route use-case ladder
Basics: 16Γ16 Patch Sensitivity & Calibration
Sweep a live patch occlusion sensitivity grid over 32Γ32 ViT tokens and calibrate P(ai) decision thresholds.
Practical: Art-Contest Provenance Queue
Audit multi-file submissions sequentially with review-band sliders, mid-batch Cancel, and formula-safe CSV/JSON.
Wild: OOD Photos, Compression & Lineart Lab
Probe JPEG/WebP compression, grayscale lineart, 60% crops, upscaling, and out-of-domain real-world photos.
Multi-model: ViT Authenticity β TinyCLIP Forensics
Chain AI Anime Detector (88.94 MB) into TinyCLIP ViT-8M (24.28 MB) for Authenticity Γ Style/Subject domain gating.