Mesmer AI Image Detector
Tells you whether an image looks likely AI, uncertain, or likely real, with a score showing how close the call was.
Two image models on Meta's Perception Encoder backbones look at the image, and their scores are combined: the first sees it resized and as crops at native pixel scale (from a copy capped at 1,024 px on the long side), the second sees it resized. The first is PE-Core-L14-336 with a small fine-tuned adapter (LoRA); the second is the frozen PE-Core-G14-448 with a linear head. These are the same weights and thresholds (R6-final) behind the free tool on mesmer.tools. This is a research model: a score is a hint, not proof.
Try it in the browser (no GPU needed): mesmer.tools · Sibling text detectors: mesmer-ai-detector-4b · mesmer-ai-detector-9b
Fun fact: this whole project was built autonomously by Claude Opus agents, from collecting data to training, testing, and deploying the model. Run on this card, the sibling mesmer-ai-detector-4b text detector says AI-edited (p ≈ 0.98 that AI was involved).
Benchmarks
Mesmer beats Smaug—the best open-source detector we tested—on recent generators, AI edits, and every public benchmark (tying on Reddit), rarely flagging ordinary photos, though it often flags artwork (see Limitations).
We ran Smaug ourselves on the same images (open-source, Apache-2.0). Two ways of counting appear in the tables below (measured on GPU in bf16):
- At 1% false alarms (the usual benchmark protocol): for each test, the threshold is set so that 1% of that test's real photos are wrongly flagged, and we report the share of AI images caught (TPR @ 1% FPR). Smaug was measured the same way.
- At the live setting: uses the fixed likely AI threshold (
score ≥ 4.286) that the model ships with.
Fresh test set (scored once)
A fresh test set, locked before the model was finalized and scored once. No result from it was used to choose anything. It is built from public datasets the model never trained on: So-Fake-OOD (recent generators and social-platform real photos), OpenFake Reddit (in-the-wild Reddit images), WikiArt (artwork), LAION-Mobile (phone photos), and Unsplash Lite (stock and pro photos). Higher is better.
| Test | AI / real | Mesmer, at 1% false alarms [95% CI] | Smaug, at 1% false alarms | Mesmer, live setting (AI caught / real flagged) |
|---|---|---|---|---|
| 6 recent generators (GPT-image-1.5, Seedream 3.0, Seedream 4.5, Recraft v3, Ideogram 2, HiDream) | 900 / 1,196 | 90.7% [83.8, 95.3] | 61.3% | 96.9% / 2.5% |
| Real photos partly edited with AI (local GPT-image / Ideogram edits) | 800 / 1,196 | 59.4% [49.4, 69.4] | 19.1% | 73.4% / 2.5% |
| Reddit AI art vs Reddit photos (OpenFake Reddit; labels by subreddit) | 1,499 / 1,497 | 88.3% [79.9, 93.2] | 86.4% | 96.8% / 2.9% |
Mesmer beats Smaug on each of the six recent generators and on AI edits (each 95% CI of the difference is above zero). Reddit is a tie (difference 95% CI [−4.9, +8.3] points); Smaug's own headline benchmark uses this source. This test's real photos are social-media photos: they are the 2,693 in the social-media row of the real-photo table (the generator and edit tests share the same 1,196).
Per generator on the same test (AI caught ↑; at the live setting, 2.5% of its real photos are flagged):
| Generator | AI images | Mesmer (1% false alarms) | Smaug (1% false alarms) | Mesmer (live setting) |
|---|---|---|---|---|
| GPT-image-1.5 | 150 | 75.3% | 36.7% | 86.7% |
| Seedream 3.0 | 150 | 99.3% | 50.0% | 99.3% |
| Seedream 4.5 | 150 | 99.3% | 82.0% | 100.0% |
| Recraft v3 | 150 | 72.7% | 33.3% | 96.0% |
| Ideogram 2 | 150 | 97.3% | 68.0% | 99.3% |
| HiDream | 150 | 100.0% | 98.0% | 100.0% |
Public benchmarks
The model did not train on these test images. It did see some of the same generators during training, though it stays ahead of Smaug on unseen generators too. Higher is better for AI caught; lower is better for real photos flagged.
| Benchmark | AI / real | Mesmer (1% false alarms) | Smaug (1% false alarms) | Mesmer, live setting (AI caught / real flagged) |
|---|---|---|---|---|
| WasItAI (originals) | 261 / 484 | 97.3% | 81.6% | 85.1% / 0.0% |
| WasItAI social copies (Instagram, WhatsApp, reshared) | 783 / 1,446 | 93.7% | 79.3% | 78.8% / 0.0% |
| AIGenImages2026 | 3,000 / 3,559 | 99.2% | 93.2% | 97.4% / 0.1% |
| Mirage-Test | 4,000 / 3,500 | 99.9% | 95.1% | 99.4% / 0.1% |
| DailyBench | 1,000 / 2,000 | 94.7% | 62.8% | 98.6% / 5.3% |
| Average of these five | 9,044 AI | 97.0% | 82.4% | |
| DailyBench AI edits of real photos | 1,000 / 2,000 | 64.0% | 11.1% | 84.7% / 5.3% |
Mesmer beats Smaug on every benchmark above (each 95% CI of the difference is above zero). For AIGenImages2026, the table adds 3,000 extra Mirage-Test real photos (not the 3,500 in the Mirage-Test row) to the benchmark's own 559, for 3,559 in all; using only the benchmark's own real photos gives 99.5% for Mesmer vs 88.2% for Smaug.
On older benchmarks measured by AUROC (area under the ROC curve; 1.000 = perfect ranking), Mesmer vs Smaug: X-AIGD 1.000 vs 0.990, CommunityForensics-Eval 0.997 vs 0.985, and Synthbuster 1.000 vs 0.968.
Compared with Pangram's published numbers
Pangram Image is a closed commercial detector. We did not run it: its numbers below are the ones Pangram published (July 29, 2026), and its "AI caught" is 100% minus its published miss rate. For Mesmer, we set the threshold on each benchmark so that we flag no more real images than Pangram's published false-alarm rate, and report the share of AI images caught.
| Benchmark | Pangram (self-reported): AI caught at its false-alarm rate | Mesmer at Pangram's false-alarm rate | Mesmer, live setting (AI caught / real flagged) |
|---|---|---|---|
| AIGenImages2026 (the benchmark's own test pairs: 559 AI / 559 real) | 99.5% at 0.537% | 100.0% at 0.537% (3 of 559 real) | 98.6% / 0.00% |
| Mirage-Test (our sample: 4,000 AI / 3,500 real) | 99.4% at 0.056% | 96.6% at 0.029% (1 of 3,500 real) | 99.4% / 0.11% |
| CommunityForensics (our subset of its eval set: 877 AI / 886 real) | 93.6% at 0.413% | 94.6% at 0.34% (3 of 886 real) | 94.2% / 0.23% |
| ReLAION pre-2022 (10,000 real web images: photos, web graphics, CGI) | 0.16% wrongly flagged | not measured: we don't have this set | our closest sets, not the same images: phone photos 0.0%, stock photos 0.1% |
In short: about level with Pangram on AIGenImages2026 and CommunityForensics; on Mirage-Test, at Pangram's very strict 0.056% false-alarm rate, Pangram is ahead by about 2–3 points.
- Pangram's numbers are its own. We did not run Pangram, and its post gives no sample sizes, so its samples may differ from ours. Our Mirage-Test set is a sample of the full test set, and our CommunityForensics set is a subset of its eval set. On our larger AIGenImages2026 sample (3,000 AI images, the same 559 real photos), Mesmer catches 99.5% at 0.537% and 97.4% at the live setting.
- The middle column picks a threshold per benchmark, which slightly favours us. The live-setting column uses one fixed threshold for everything, like a product.
- False alarms at these rates are counted in single images (1–3), so the numbers are noisy: allowing one more on Mirage-Test (2 of 3,500, 0.06%) gives 97.4%.
Real photos wrongly flagged (at the live setting)
Share of real images wrongly called likely AI at the live setting. Lower is better.
| Kind of real photo | Photos | Wrongly flagged ↓ |
|---|---|---|
| Phone camera photos (LAION-Mobile) | 1,455 | 0.0% |
| Stock and pro camera photos (Unsplash Lite) | 1,497 | 0.1% |
| Real photos in public benchmarks (WasItAI, AIGenImages2026, Mirage-Test) | 7,543 | 0.0–0.1% |
| Social-media photos (Reddit, Tumblr, Bluesky) | 2,693 | 2.7% (2.0–3.7% by platform) |
| Real photos in DailyBench (curated web image collections) | 2,000 | 5.3% |
| Paintings and other artwork (WikiArt) | 1,497 | 37.9% [35.5, 40.4] |
Across our tests, ordinary phone and stock photos are wrongly flagged about 0–0.3% of the time (the 0.3% comes from 1,500 of our own held-out phone photos, recompressed).
How to read the result
The model outputs a combined score (higher = more AI-like) and maps it to one of three verdicts using two fixed thresholds, the same ones used by the live tool:
| Verdict | score |
|---|---|
Likely AI (likely_ai) |
≥ 4.286 |
Uncertain (uncertain) |
2.918 to < 4.286 |
Likely real (likely_real) |
< 2.918 |
- How the thresholds were set: both were calibrated on our own held-out real photos of many kinds (phone, camera, stock, edited, social copies, and more), none of them used in training. Likely AI is set so that each kind is wrongly flagged at most about 2% of the time; uncertain uses a looser threshold of about 5%. Both thresholds are provisional.
p_ai: a 0–1 display score (shown as 0–100 on mesmer.tools). It is0.5at the uncertain threshold and0.9at the likely-AI threshold. It is not a probability:0.95does not mean a 95% chance of AI.members: each model's raw logit, plus its score after putting both on one scale.heatmap()(experimental): scores native 336 × 336 crops individually with one of the two models. It is a hint about where the model reacts, not proof. A few warm crops on a real photo are normal, and it never changes the verdict.
The live tool on mesmer.tools also reads C2PA / IPTC "AI-generated" labels from file metadata as an informational side note; that is a site feature and is not included in this package.
Quickstart
pip install huggingface_hub # provides the `hf` command
hf download mesmertech/mesmer-ai-image-detector inference.py requirements.txt --local-dir .
pip install -r requirements.txt # or: pip install torch torchvision timm pillow numpy safetensors huggingface_hub
python inference.py photo.jpg
# photo.jpg likely_real score -1.481 p_ai 0.001
python inference.py --json photo.jpg # full result as JSON
from inference import Detector
det = Detector.from_pretrained("mesmertech/mesmer-ai-image-detector") # GPU in bf16 if available, else CPU
r = det.predict("photo.jpg") # a path, bytes, a PIL image or an H x W x 3 uint8 RGB array
r["verdict"] # "likely_ai" | "uncertain" | "likely_real"
r["score"] # higher = more AI-like
r["p_ai"] # 0-1 display score (NOT a probability)
r["members"] # each model's own score
det.heatmap("photo.jpg") # experimental: which 336 px crops look AI to one of the models
- Downloads: this repo is about 10 MB. On first run, it downloads two Apache-2.0 backbones from Hugging Face at pinned revisions:
timm/vit_pe_core_large_patch14_336.fb(1.3 GB) andtimm/vit_pe_core_gigantic_patch14_448.fb(7.5 GB). - GPU (default): runs in
bf16and uses about 4.5 GB of GPU memory (4.4 GB steady and ≤ 4.5 GB peak per image in the live service). On an RTX A4500, one image takes about 0.15 s of model time. The published code reproduces the live tool's scores. - CPU fallback: runs in
fp32and is much slower—about 15 s per image on 8 threads of a desktop CPU (Intel i7-14700K), using about 16 GB of system RAM (16.0 GB peak measured). CPUfp32scores differ slightly from GPUbf16(mean difference of 0.04 on the score scale). - Inputs: supports JPEG, PNG, WebP, GIF (first frame), BMP, TIFF, and AVIF. HEIC is not supported—export it as JPEG first. Use the original file: screenshots, resizing, and social-media recompression wipe out fine detail the detector looks at. The package decodes the file as given, at full resolution; one model then looks at a copy capped at 1,024 px on the long side (a resized view plus crops at that copy's native pixel scale), the other at a 448 px resized view.
Limitations
- Paintings and other artwork: about 4 in 10 are mistaken for AI (37.9% on WikiArt).
- Social-media photos and reposts: flagged more often than other photos—2.7% overall (2.0–3.7% by platform), above the 2% target.
- Real photos with AI edits: it does not catch every one (59.4% caught on the fresh test set at 1% false alarms; 73.4% at the live setting).
- Screenshots, resized, or recompressed copies: these lose detail and are judged less reliably. Use the original file whenever you can.
- Curated web image collections: some have higher false-alarm rates (5.3% on DailyBench real photos).
- Newer generators: images from generators released after the model was trained may be missed.
- Research model: the thresholds are provisional. A score is a hint, not proof. Never use a result as the only evidence to accuse anyone of faking an image.
License
CC BY-NC-SA 4.0: non-commercial use, with attribution and share-alike. The full text is in LICENSE.
The backbones are Meta's Perception Encoder models (Apache-2.0), downloaded from their own repos and not included here.
- Downloads last month
- -
Model tree for mesmertech/mesmer-ai-image-detector
Base model
timm/vit_pe_core_gigantic_patch14_448.fb
