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)表示。以往的工作应用基于识别的方法学习ID特征,但这些方法倾向于学习捷径而非全面的表示。在本工作中,我们惊人地发现,仅使用基于重构的方法即可显著提升OOD检测的性能。我们深入探讨了OOD检测的主要贡献因素,发现基于重构的预训练任务能够提供一种普遍适用且有效的先验知识,有助于模型学习ID数据集的固有数据分布。具体而言,我们采用掩码图像建模作为OOD检测框架(MOOD)的预训练任务。无需任何额外技巧,MOOD在单类OOD检测上超越现有最优方法5.7%,在多类OOD检测上超越3.0%,在近分布OOD检测上超越2.1%。即使不包含任何OOD样本,它甚至击败了每类使用10个样本的离群值暴露OOD检测方法。