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
翻译:“离分布”(OOD)检测的核心是学习“在分布”(ID)表示,这种表示可以与OOD样本区分开来。先前的工作采用基于识别的方法学习ID特征,这些方法往往学习的是快捷方式而非全面性的表示。在这项工作中,我们惊讶地发现,仅使用基于重建的方法就可以显著提高OOD检测的性能。我们深入探讨了OOD检测的主要贡献者,并发现基于重建的前提任务具有提供普遍适用的、有效的先验知识的潜力,这有利于模型学习ID数据集的内在数据分布。具体而言,我们采用遮蔽图像建模作为我们OOD检测框架(MOOD)的前提任务。没有花哨的技巧,MOOD在一类OOD检测方面的超过先前的最佳方法5.7%,在多类OOD检测方面的超过先前的最佳方法3.0%,在接近分布的OOD检测方面的超过先前的最佳方法2.1%。它甚至在10个样本每类的外部曝光OOD检测中都取得了胜利,尽管我们没有包含任何OOD样本进行检测。