Closed-form Gaussian discriminants beat released AI-image detector heads on a 39-dataset benchmark

Prior-Conditioned Gaussian Discriminants for Generalizable AI-generated Image Detection

Shashank Kotyan, Makoto Shing, Yuki Imajuku, Rujikorn Charakorn, Tarin Clanuwat

ECCV 2026

cs.CV, cs.AI

2026-08-19

Sakana AI swaps trained detector heads for closed-form Gaussian discriminants on frozen encoders: 11 of 12 matched comparisons improve, up to +9.66 points on Percept-Lens (39 datasets, 7.1M images), and 219 labeled images suffice for 90.89%.

What problem this solves

AI-generated image detectors share an awkward trait: near-perfect accuracy on the generators they were trained on, collapsing accuracy once the generator, prompt style, and real-image source all shift at once. Attributing the collapse is hard because a detector is really three components bundled together: the training prior (the dataset it saw), the frozen encoder supplying features, and the classification head on top. Any published claim of "our head generalizes better out-of-domain" mixes all three contributions.

This Sakana AI paper (ECCV 2026) treats detection explicitly as a (prior, encoder, decision rule) system and asks a pointed question: on modern frozen encoder features, how much discriminative power does head training actually add beyond first- and second-order statistics?

Method

The approach is deliberately restrained. Nothing is trained. On a frozen encoder's features, the paper fits a ladder of closed-form heads ordered by covariance assumption, from simplest to most expressive:

Each rung only estimates class-conditional means and covariances from a support set; the head is computed analytically, no gradient descent. The ladder works as a controlled diagnostic: if plain Mah-NCM matches or beats a released detector head, that head contributes nothing beyond low-order feature statistics.

Evaluation runs on Percept-Lens, a protocol aggregating 39 public datasets (7.1 million images) with generator, prompt style, and real-source drifting simultaneously. Released detectors audited under matched (prior, encoder) conditions include UnivFD, AIDE, Effort, DRCT-UnivFD, CoDE-kNN, and CommunityForensics.

Results

Main table, macro-averaged class accuracy under the same frozen encoder and the same training prior:

HeadOut-of-the-shelfBest Gaussian rungDelta
UnivFD (CNNSpot prior)54.63%57.62% (Mah-NCM)+2.99
AIDE (CNNSpot)56.41%62.76% (Mah-NCM)+6.35
AIDE (GenImage-SDv1)48.99%57.35% (Mah-NCM)+8.36
DRCT-UnivFD (Full GenImage)65.77%73.01% (Mah-NCM)+7.24
AIDE (Full GenImage)54.98%64.64% (Mah-NCM)+9.66
CF-224 (CommunityForensics)81.98%82.61% (Mah-NCM)+0.63
CF-384 (CommunityForensics)87.54%84.55% (Mah-NCM)-2.99

Eleven of twelve matched comparisons favor the closed-form head. The single loss is CF-384, which also happens to be the strongest baseline overall, so the exception marks a real boundary rather than noise.

Two sweeps isolate the other factors. Fixing the encoder and varying only the prior moves best CA from 77.92% (CNNSpot) to 94.46% (CommunityForensics), a 16.5-point spread. Fixing the prior and varying the encoder, Mah-NCM is the winning rung on every encoder tested: DINOv3-ViT-7b reaches 88.91% while CLIP ViT-L/14 sits at 76.96%. Pretraining objective matters more for transfer than raw capacity.

The data-efficiency result is the most practical one: on the PE-Core-bigG-14-448 encoder, Mah-NCM fitted from 0.005% of the prior (219 labeled images) reaches 90.89% CA. With 1% of the support (about 43k images), Mah-NCM is already close to saturation.

Why it matters

For detector researchers, this changes experimental hygiene. Before claiming head-level OOD gains, run the Gaussian ladder on the same features and the same prior; a fair share of published generalization gains turn out to live in the encoder and the data, not the head.

For practitioners, the 219-image adaptation path turns detection into a lightweight accessory: swap in a new encoder, label a few hundred images, recompute means and covariances, ship. Generators iterate faster than detector training pipelines, and this asymmetry is exactly where a closed-form head helps.

To be honest about it, the contribution is incremental in method: closed-form discriminant analysis is decades old. What is new is using it systematically as a diagnostic instrument, plus the Percept-Lens protocol at 7.1-million-image scale.

Limitations

The authors state the ladder covers only first- and second-order statistics. Regimes needing higher-order, multimodal, or heavy-tailed cues (strong post-processing, unusual content, generator-specific artifacts) are where trained nonlinear heads legitimately win.

Three concerns stand out on a close read. First, the headline metric is a macro average and per-dataset variance is large: Mah-NCM is near-ceiling on many synthetic-only sets but clearly weak on DeepFakeBench, QDA is best on CelebA-Spoof, and the average hides this spread. Second, Gaussian shift metrics like Wasserstein-2 are representation-conditioned: the correlation between PE-Core and CF-384 feature spaces is -0.194, so distribution-distance conclusions can flip sign under a backbone change. Third, the decomposition is not symmetric: the head swap is a matched intervention, while prior and encoder are one-factor sweeps, so three-way interactions are not actually decomposed.

Terms

Source

What people are saying

Related papers

All paper explainers