Out-of-distribution (OOD) detection is critical for the safe deployment of machine learning systems in safety-sensitive domains. Diffusion models have recently emerged as powerful generative models, capable of capturing complex data distributions through iterative denoising. Building on this progress, recent work has explored their potential for OOD detection. We propose EigenScore, a new OOD detection method that leverages the eigenvalue spectrum of the posterior covariance induced by a diffusion model. We argue that posterior covariance provides a consistent signal of distribution shift, leading to larger trace and leading eigenvalues on OOD inputs, yielding a clear spectral signature. We further provide analysis explicitly linking posterior covariance to distribution mismatch, establishing it as a reliable signal for OOD detection. To ensure tractability, we adopt a Jacobian-free subspace iteration method to estimate the leading eigenvalues using only forward evaluations of the denoiser. Empirically, EigenScore achieves SOTA performance, with up to 5% AUROC improvement over the best baseline. Notably, it remains robust in near-OOD settings such as CIFAR-10 vs CIFAR-100, where existing diffusion-based methods often fail.
翻译:分布外检测对于机器学习系统在安全敏感领域的可靠部署至关重要。扩散模型作为强大的生成模型,近期通过迭代去噪过程展现出捕捉复杂数据分布的能力。基于此进展,近期研究开始探索其在分布外检测中的应用潜力。本文提出特征值评分——一种新型分布外检测方法,该方法利用扩散模型诱导的后验协方差矩阵的特征值谱进行分析。我们论证后验协方差能够提供分布偏移的一致性信号,导致分布外输入具有更大的迹和主导特征值,从而产生明确的光谱特征。我们进一步通过理论分析建立后验协方差与分布失配之间的显式关联,证明其作为分布外检测信号的可靠性。为确保计算可行性,我们采用无雅可比子空间迭代方法,仅通过去噪器的前向评估即可估计主导特征值。实验表明,特征值评分实现了最先进的性能表现,在AUROC指标上较最佳基线方法提升最高达5%。值得注意的是,该方法在近分布外场景(如CIFAR-10与CIFAR-100的区分)中仍保持稳健性,而现有基于扩散的方法在此类场景中往往失效。