← All models

image-classification Β· vision Β· WASM Β· ~89 MB

AI-generated image detector β€” real photo, or made by a model?

A Swin Transformer fine-tuned to sort images into artificial (AI-generated / synthetic) and human (a real photograph). Drop an image and it returns a probability for each. Treat the number as a signal for triage β€” a reason to look closer β€” not proof of where an image came from. It has real blind spots, and this page shows them. Everything happens on your device; the image is never uploaded.

At a glance

Modelonnx-community/SMOGY-Ai-images-detector-ONNX
Task / pipelineimage-classification Β· single-label (softmax over 2 classes)
Labelsartificial (AI-generated) / human (real photo)
ArchitectureSwin Transformer (hierarchical vision transformer) fine-tuned for AI-image detection
Quantizationq8 (8-bit) ONNX
BackendWebAssembly (runs anywhere; no WebGPU needed)
Download~89 MB, cached after first load
LicenseApache-2.0 (ONNX conversion by onnx-community)
Web APIsWebAssembly, Web Workers, FileReader β€” all Baseline widely available
Read this first. No AI-image detector is reliable. This one is a fine-tuned classifier trained on a specific mix of real and generated images β€” it will mislabel photos it finds "too clean" and miss generated images that look photographic. Never make an accusation or an automated block on its output alone. The bundled samples are two real photographs and one procedurally-generated pattern (computer graphics, not a diffusion model), chosen to show both a true and a false-ish call.

Run it

Pick or drop an image, set how much "AI-generated" probability should raise a flag, and hit Analyse. The verdict is a policy on top of the model's score: flag for review when the AI-generated probability is at or above your threshold.

Drop an image here, or click to choose
A real photograph of two cats on a couch A real photograph of a riverside at golden hour A procedurally-generated interference pattern (computer graphics, not a photo)
Selected image preview

See inside β€” score vs. certainty

The model outputs two raw logits; a softmax turns them into two probabilities that sum to 100%. A high number is the model's confidence, and that is not the same as being calibrated β€” these detectors are notorious for being confidently wrong. A 99% "AI-generated" score is a strong prompt to look closer, never a certificate. The threshold is your policy: lower it to catch more suspected AI images (more real photos wrongly flagged), raise it to only flag the blatant cases (more AI images slip through). There is no universally right value β€” it depends on what a mistake costs you.

Analyse an image to see the raw numbers.

Why it matters

As generated images flood feeds, marketplaces, and evidence, "was a human behind the camera?" becomes a routine question. A fast, private, offline signal β€” running before an image is trusted, published, or paid for β€” is a first triage filter: it decides what to look at harder, not what is true. No API bill, no third party seeing the image, low enough latency to run inline.

All of these are signal, not verdict use cases. Anywhere the cost of a wrong call is high (accusations, takedowns, legal), a probability from one model is never enough on its own.

Use cases

Basics

Analyse one image and read the AI-generated / real probabilities plainly.

Practical

Provenance triage: score a batch at a threshold, sort the queue β€” signal, never an auto-block.

Wild

Break it on purpose: crop, recompress and add noise, and watch the "AI-generated" score swing.

Multi-model

Detect, then describe: pair the provenance flag with an image caption for a richer intake card.

How the API works

The convenience path is two lines with Transformers.js:

import { pipeline } from "@huggingface/transformers";

const detect = await pipeline("image-classification", "onnx-community/SMOGY-Ai-images-detector-ONNX");
const out = await detect(imageURL, { top_k: 2 });
// β†’ [{ label: "human", score: 0.99 }, { label: "artificial", score: 0.01 }]

This page goes one level deeper for "See inside": instead of the pipeline it runs the model's processor then model() in a single forward pass, so it can read the raw two-value logits tensor and compute the softmax itself β€” then apply your flag threshold. Same weights, same result. Inference runs in a Web Worker so the page never janks.

References