A one-class detector trained only on real images, scoring how atypical an image is in feature space. The hypothesis was that it would generalise to unseen generators better than a discriminative classifier. It did not: the baseline won, including on the held-out generator. A negative result cleanly obtained, with a distributional explanation.

The hypothesis: a one-class detector trained only on real images should generalise to unseen generators better than a discriminative real-versus-fake classifier, which overfits to the generators it saw.

It did not hold. The discriminative baseline beat both one-class variants, including on the held-out generator that was supposed to be the one-class approach’s home ground. A negative result, cleanly obtained, with a distributional explanation for why.

Why feature-space typicality, not reconstruction

Pixel-reconstruction error as an anomaly signal depends on generators being bad at generating. It degrades as they improve, and it averages away small local tells. Instead this models the distribution of real-image features and scores anomaly as the squared Mahalanobis distance to that distribution: closed-form, parameter-light, and the standard typicality estimator for deep-feature out-of-distribution detection.

Setup

Two feature-space anomaly detectors, both fit on real features only, plus a fusion of the two. A multivariate Gaussian with Ledoit-Wolf-shrunk covariance, on GenImage, with a held-out generator and leakage-controlled fusion. k-nearest neighbours was tried as a scorer and did not beat the Gaussian.

What was interesting

Designing the comparison so that losing was still informative. A three-system comparison with a held-out generator gives you an answer either way; a single model with a good number does not.

Work

AI image detector, one-class

· 1 min

Year
2026
Status
research
Role
Sole author
Built with
Python · PyTorch · Mahalanobis