Making Generative Models Know What They Don’t Know via Hypothesis Testing
Leander Kurscheidt ⋅ Antonio Vergari
Abstract
Out-of-distribution (OOD) detection is a fundamental problem in machine learning, and normalizing flows are natural candidates due to their explicit density. However, likelihood alone is known to be unreliable for OOD detection, as flows may assign higher likelihood to OOD samples than to in-distribution data. In this work, we propose a goodness-of-fit (GoF) test for normalizing flows based on latent-space statistics. Our method enables both direct assessment of model fit on a held-out dataset via uniformity testing of the $p$-values, and single-sample OOD detection using a recalibrated test statistics. In contrast to existing likelihood- and score-based approaches, this allows principled evaluation of whether the learned flow itself fits the data distribution. We further show that recalibrated $p$-values provide an interpretable and flexible scoring mechanism for OOD detection when the underlying flow model achieves a sufficiently good fit.
Chat is not available.
Successful Page Load