Out-of-distribution (OOD) detection is a crucial part of deploying machine learning models safely. It has been extensively studied with a plethora of methods developed in the literature. This problem is tackled with an OOD score computation, however, previous methods compute the OOD scores with limited usage of the in-distribution dataset. For instance, the OOD scores are computed with information from a small portion of the in-distribution data. Furthermore, these methods encode images with a neural image encoder. The robustness of these methods is rarely checked with respect to image encoders of different training methods and architectures. In this work, we introduce the diffusion process into the OOD task. The diffusion model integrates information on the whole training set into the predicted noise vectors. What's more, we deduce a closed-form solution for the noise vector (stable point). Then the noise vector is converted into our OOD score, we test both the deep model predicted noise vector and the closed-form noise vector on the OOD benchmarks \cite{openood}. Our method outperforms previous OOD methods across all types of image encoders (Table. \ref{main}). A $3.5\%$ performance gain is achieved with the MAE-based image encoder. Moreover, we studied the robustness of OOD methods by applying different types of image encoders. Some OOD methods failed to generalize well when switching image encoders from ResNet to Vision Transformers, our method performs exhibits good robustness with all the image encoders.
翻译:分布外(OOD)检测是安全部署机器学习模型的关键环节。该问题已得到广泛研究,文献中提出了大量方法。这类问题通常通过计算OOD分数来解决,然而现有方法对分布内数据集的利用有限。例如,OOD分数仅基于少量分布内数据的信息进行计算。此外,这些方法采用神经图像编码器对图像进行编码,但很少有人检验这些方法在不同训练方式和架构的图像编码器下的鲁棒性。本研究将扩散过程引入OOD任务:扩散模型将整个训练集的信息整合到预测噪声向量中。进一步地,我们推导出噪声向量的闭式解(稳定点),并将该噪声向量转换为OOD分数。我们分别在深度模型预测的噪声向量和闭式噪声向量上进行了OOD基准测试\cite{openood}。实验表明,我们的方法在所有类型的图像编码器上均优于现有OOD方法(表\ref{main}),其中基于MAE的图像编码器实现了3.5%的性能提升。此外,我们通过采用不同类型的图像编码器研究了OOD方法的鲁棒性。部分OOD方法在将图像编码器从ResNet切换为Vision Transformers时未能良好泛化,而我们的方法在所有图像编码器上均表现出优异的鲁棒性。