The core of out-of-distribution (OOD) detection is to learn the in-distribution (ID) representation, which is distinguishable from OOD samples. Previous work applied recognition-based methods to learn the ID features, which tend to learn shortcuts instead of comprehensive representations. In this work, we find surprisingly that simply using reconstruction-based methods could boost the performance of OOD detection significantly. We deeply explore the main contributors of OOD detection and find that reconstruction-based pretext tasks have the potential to provide a generally applicable and efficacious prior, which benefits the model in learning intrinsic data distributions of the ID dataset. Specifically, we take Masked Image Modeling as a pretext task for our OOD detection framework (MOOD). Without bells and whistles, MOOD outperforms previous SOTA of one-class OOD detection by 5.7%, multi-class OOD detection by 3.0%, and near-distribution OOD detection by 2.1%. It even defeats the 10-shot-per-class outlier exposure OOD detection, although we do not include any OOD samples for our detection
翻译:分布外检测的核心在于学习能与分布外样本区分的分布内表示。以往工作采用基于识别的方法学习分布内特征,但此类方法易学习捷径而非全面表征。本研究发现,单纯使用基于重建的方法即可显著提升分布外检测性能。我们深入探究分布外检测的关键要素,发现基于重建的预训练任务具有提供普适且有效先验的潜力,有助于模型学习分布内数据集的内在数据分布。具体而言,我们将掩码图像建模作为分布外检测框架(MOOD)的预训练任务。无需额外复杂设计,MOOD在单类分布外检测上以5.7%、多类分布外检测以3.0%、近分布检测以2.1%的优势超越此前最优方法。尽管未使用任何分布外样本,本方法甚至优于每类10样本的异常样本暴露式分布外检测方法。