Table of Contents
Fetching ...

NODI: Out-Of-Distribution Detection with Noise from Diffusion

Jingqiu Zhou, Aojun Zhou, Hongsheng Li

TL;DR

The paper tackles out-of-distribution detection by introducing diffusion models that incorporate information from the entire in-distribution training set into predicted noise vectors. It proposes a bias-removing encoding scheme and normalizes features onto a fixed-radius sphere, enabling either a diffusion-based or a closed-form noise-vector OOD score, with test-time scaling determined by binary search. Empirically, the approach yields robust improvements across image encoders (ResNet and Vision Transformers) on Imagenet-backed OOD benchmarks, including up to about a 3.5 percentage-point AUROC gain with MAE-based encoders, and demonstrates clear benefits from bias removal, normalization, and class-wise scoring. The method shows strong encoder-robustness and outperforms prior OOD techniques, suggesting practical impact for safe deployment and avenues for further refinement.

Abstract

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.

NODI: Out-Of-Distribution Detection with Noise from Diffusion

TL;DR

The paper tackles out-of-distribution detection by introducing diffusion models that incorporate information from the entire in-distribution training set into predicted noise vectors. It proposes a bias-removing encoding scheme and normalizes features onto a fixed-radius sphere, enabling either a diffusion-based or a closed-form noise-vector OOD score, with test-time scaling determined by binary search. Empirically, the approach yields robust improvements across image encoders (ResNet and Vision Transformers) on Imagenet-backed OOD benchmarks, including up to about a 3.5 percentage-point AUROC gain with MAE-based encoders, and demonstrates clear benefits from bias removal, normalization, and class-wise scoring. The method shows strong encoder-robustness and outperforms prior OOD techniques, suggesting practical impact for safe deployment and avenues for further refinement.

Abstract

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 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.
Paper Structure (12 sections, 18 equations, 4 figures, 3 tables, 1 algorithm)

This paper contains 12 sections, 18 equations, 4 figures, 3 tables, 1 algorithm.

Figures (4)

  • Figure 1: The pipeline of Diffusion Based OOD. During the training of the diffusion model, the in-distribution images are first encoded with a bias removing image encoder. Then those in-distribution feature vectors are normalized and used to train a diffusion model or compute the closed-form noise feature vector. At test time, the testing images are encoded with the same bias removing image encoder. A binary search algorithm is applied to determine the scale factor $r(y)$ of the testing feature vector $y$. Together with the trained diffusion model or the closed-form noise vector formula, we compute the OOD score of the scaled testing feature vector $r(y)y$.
  • Figure 2: Binary Search for $r(y)$
  • Figure 3: The impact of normalization factor $r$ on different types of image encoder.
  • Figure 4: Class-wise OOD score and Class agnostic OOD score