An AI-generated image detector: from idea to an honest quality evaluation

Tatiana Kutuzova29 Dec 2025

Problem

Wildberries built an AI-generated image detector (WB AI Detector) for its marketplace. Offline tests showed more than 95% accuracy, but users disagreed. In the main scenario, review moderation, generated images are rare (the flow is hundreds of thousands of images a day, with orders of magnitude more real photos). Labelers look mostly at "suspicious" cases, so the labeled sample no longer resembles the stream. A model that looks good on validation can then have precision about 10 times lower in production.

Example from the article: on a controlled experiment with a production positive-class share of 0.05, ordinary validation reports precision 0.81 while the true production precision is 0.18.

Solution in brief

Do not trust the validation split. Draw the examples to be labeled by importance sampling on the model score, so that the labeled subsample covers the score regions that matter in production. Then recompute the metrics with weights that correct the remaining difference between the production and labeled score distributions, and bootstrap them to get confidence intervals.

Questions this case answers
  • How to estimate the precision and recall of a classifier on an unlabeled production stream with a rare positive class when labeling covers only a small, biased part of the stream
  • How to pick examples for labeling so that metric estimates stay unbiased with minimal variance and come with confidence intervals
  • How to estimate the real precision and recall of a classifier on a production stream when labels are scarce and biased?
  • How to choose which production images to send to labeling so that metric estimates stay unbiased and cheap?

Tools and methods

  • Importance sampling on model scores — choose items for labeling and weight metrics by production score density
  • Bootstrap — confidence intervals for the weighted metrics
  • Image classification (vision transformer) — the detector model
  • Frequency-domain analysis (FFT) — spectral view to find generator fingerprints
Continue reading — it's free

Google or a one-time email code. No password.