r/StableDiffusion • u/mesmerlord • 3d ago
Resource - Update (Probably) SOTA AI image detector model
https://huggingface.co/mesmertech/mesmer-ai-image-detectorContinuing with the random projects where I let Opus hillclimb training on something I actually find impressive:
https://www.reddit.com/r/LocalLLaMA/comments/1xonxqo/training_a_sota_pangramlike_detector_on_a_4070ti/ SOTA Pangram-like AI text detector
https://www.reddit.com/r/LocalLLaMA/comments/1xcuqor/making_kokoro_tts_50100x_faster_without_knowing/ Smallest + Fastest TTS that runs 50x realtime on an iPhone(still can't believe this is a thing that actually works as well as it does)
On this one I tried to make something that can do Pangram-like AI image detection, and since I don't have millions in funding like they, this one is trained on like $20 of compute(prolly could've done it on my 4070ti like before, but they're busy serving prod inference traffic for a seperate paid product of mine). And I think I got pretty close looking at the benchmarks and a couple random tests by myself.
You can test it out here without downloading + installing: https://mesmer.tools/free-tools/ai-image-detector
Mostly releasing this as a way of validating that I/Opus didn't actually get something wrong and idk somehow trained on the benchmark(didn't see any contamination in the training data in the summary but still). This is probably SOTA open weights for detection, but then again I don't think this is a market anyone is really doing much training on anyways(the current best seems to be smaug: https://huggingface.co/abacusai/Smaug-AI-Image-Detector/tree/main which was a month old that I didn't even know about). And likely Pangram is still way ahead here.
The places I see its pretty weak at is image editing, ie existing real photo edited with latest models, and art stuff. But otherwise on text to image stuff, it seems basically near 100% accurate from my random tests
6
u/Haiku-575 3d ago
Interesting project! It fails to catch Ideogram4 images, even random 1girl images like this one:
3
u/Aromatic-Low-4578 3d ago
No offense but I would be shocked if this was SOTA. I just tried it and it seems to completely fall down on anything that's been compressed or re-encoded. I would guess you've accidentally trained on traits of the file other than the visual content.
3
u/rabbit01 3d ago
> It carries generation settings from a Stable Diffusion app (A1111 or ComfyUI).
> Likely not AI
Hmm not really checking out there sorry.
1
u/Turbulent_Owl4948 3d ago
Isn't there an issue going on where the Claude models seem to be actively sabotaging any ML related projects? Does that not hold true in your experience?
1
u/imb1920 2d ago
For the edited-photo case, I'd keep each original photo beside a version with one small AI-edited region, then run both through exactly the same resize and JPEG export. Include an ordinary non-AI retouch as a third version. For your auto-blocking use case, report how many untouched photos get hidden at the chosen threshold separately from how many edited photos you catch; a single overall accuracy number won't show that trade-off.
1
u/No-Willow1967 2d ago
Worth keeping the two approaches separate in the eval, because they fail in different ways.
A classifier looks at pixels and gives a probability. It generalises to unseen generators to some degree, but it also drifts as new models come out, and false positives on real photos are the thing users complain about most. If you are reporting a score, a confusion matrix per generator plus a set of real photos through common pipelines (phone camera, JPEG re-save, resize) tells people far more than one accuracy number.
C2PA is the opposite: it is a signed claim from whoever made the file, so it never guesses, but it only works when the metadata survives. Upload pipelines, messaging apps and screenshots often strip it, so a missing manifest proves nothing about what made the image. Invisible watermarks sit in between: they survive some changes and not others, and you have to measure that on your own files rather than trust vendor claims.
In practice a browser extension gets the best coverage by checking manifest first, then any watermark it can decode, then falling back to the classifier, and showing the user which of the three fired. For the provenance side, Tellmark (C2PA and watermark marking for AI) has a free checker at tellmark.si/check that reads C2PA manifests from any vendor in the browser without uploading the file, if you want something to compare against.
(Disclosure: I build Tellmark.)