Table of Contents
Fetching ...

How Does Unlabeled Data Provably Help Out-of-Distribution Detection?

Xuefeng Du, Zhen Fang, Ilias Diakonikolas, Yixuan Li

TL;DR

This paper tackles how unlabeled wild data can improve out-of-distribution detection by introducing SAL (Separate And Learn), a two-stage framework that first filters candidate outliers from unlabeled wild data using a gradient-based, top-singular-vector scoring mechanism and then trains an OOD classifier using both labeled ID data and the mined outliers. The authors provide rigorous theory, including separability and learnability bounds, showing that accurate outlier separation leads to generalizable OOD detection performance. Empirically, SAL achieves state-of-the-art results on common benchmarks, demonstrating substantial improvements over baselines that use only ID data or prior wild-data methods. The work combines a practical pipeline with solid theoretical guarantees, offering a flexible approach that works with non-convex models and a range of OOD datasets, and it provides publicly available code for replication.

Abstract

Using unlabeled data to regularize the machine learning models has demonstrated promise for improving safety and reliability in detecting out-of-distribution (OOD) data. Harnessing the power of unlabeled in-the-wild data is non-trivial due to the heterogeneity of both in-distribution (ID) and OOD data. This lack of a clean set of OOD samples poses significant challenges in learning an optimal OOD classifier. Currently, there is a lack of research on formally understanding how unlabeled data helps OOD detection. This paper bridges the gap by introducing a new learning framework SAL (Separate And Learn) that offers both strong theoretical guarantees and empirical effectiveness. The framework separates candidate outliers from the unlabeled data and then trains an OOD classifier using the candidate outliers and the labeled ID data. Theoretically, we provide rigorous error bounds from the lens of separability and learnability, formally justifying the two components in our algorithm. Our theory shows that SAL can separate the candidate outliers with small error rates, which leads to a generalization guarantee for the learned OOD classifier. Empirically, SAL achieves state-of-the-art performance on common benchmarks, reinforcing our theoretical insights. Code is publicly available at https://github.com/deeplearning-wisc/sal.

How Does Unlabeled Data Provably Help Out-of-Distribution Detection?

TL;DR

This paper tackles how unlabeled wild data can improve out-of-distribution detection by introducing SAL (Separate And Learn), a two-stage framework that first filters candidate outliers from unlabeled wild data using a gradient-based, top-singular-vector scoring mechanism and then trains an OOD classifier using both labeled ID data and the mined outliers. The authors provide rigorous theory, including separability and learnability bounds, showing that accurate outlier separation leads to generalizable OOD detection performance. Empirically, SAL achieves state-of-the-art results on common benchmarks, demonstrating substantial improvements over baselines that use only ID data or prior wild-data methods. The work combines a practical pipeline with solid theoretical guarantees, offering a flexible approach that works with non-convex models and a range of OOD datasets, and it provides publicly available code for replication.

Abstract

Using unlabeled data to regularize the machine learning models has demonstrated promise for improving safety and reliability in detecting out-of-distribution (OOD) data. Harnessing the power of unlabeled in-the-wild data is non-trivial due to the heterogeneity of both in-distribution (ID) and OOD data. This lack of a clean set of OOD samples poses significant challenges in learning an optimal OOD classifier. Currently, there is a lack of research on formally understanding how unlabeled data helps OOD detection. This paper bridges the gap by introducing a new learning framework SAL (Separate And Learn) that offers both strong theoretical guarantees and empirical effectiveness. The framework separates candidate outliers from the unlabeled data and then trains an OOD classifier using the candidate outliers and the labeled ID data. Theoretically, we provide rigorous error bounds from the lens of separability and learnability, formally justifying the two components in our algorithm. Our theory shows that SAL can separate the candidate outliers with small error rates, which leads to a generalization guarantee for the learned OOD classifier. Empirically, SAL achieves state-of-the-art performance on common benchmarks, reinforcing our theoretical insights. Code is publicly available at https://github.com/deeplearning-wisc/sal.
Paper Structure (47 sections, 25 theorems, 141 equations, 2 figures, 20 tables, 1 algorithm)

This paper contains 47 sections, 25 theorems, 141 equations, 2 figures, 20 tables, 1 algorithm.

Key Result

Theorem 1

(Informal). Under mild conditions, if $\ell(\mathbf{h}_{\mathbf{w}}(\mathbf{x}),y)$ is $\beta_1$-smooth w.r.t. $\mathbf{w}$, $\mathbb{P}_{\text{wild}}$ has $(\gamma,\zeta)$-discrepancy w.r.t. $\mathbb{P}_{\mathcal{X}\mathcal{Y}}$ (c.f. Appendices sec:definition_app, sec:assumption_app), and there is where $R^{*}_{{\text{in}}}$ is the optimal ID risk, i.e., $R^{*}_{{\text{in}}}=\min_{\mathbf{w}\in

Figures (2)

  • Figure 1: (a) Visualization of the gradient vectors, and their projection onto the top singular vector $\mathbf{v}$ (in gray dashed line). The gradients of inliers from $\mathcal{S}_{\text{wild}}^{\text{in}}$ (colored in orange) are close to the origin (reference gradient $\bar{\nabla}$). In contrast, the gradients of outliers from $\mathcal{S}_{\text{wild}}^{\text{out}}$ (colored in purple) are farther away. (b) The angle $\theta$ between the gradient of set $\mathcal{S}_{\text{wild}}^{\text{out}}$ and the singular vector $\mathbf{v}$. Since $\mathbf{v}$ is searched to maximize the distance from the projected points (cross marks) to the origin (sum over all the gradients in $\mathcal{S}_{\text{wild}}$), $\mathbf{v}$ points to the direction of OOD data in the wild with a small $\theta$. This further translates into a high filtering score $\tau$, which is essentially the norm after projecting a gradient vector onto $\mathbf{v}$. As a result, filtering outliers by $\mathcal{S}_T = \{\tilde{\mathbf{x}}_i\in \mathcal{S}_{\text{wild}}: \mathbf{\tau}_i>T\}$ will approximately return the purple OOD samples in the wild data.
  • Figure 2: Example of SAL on two different scenarios of the unlabeled wild data. (a) Setup of the ID/inlier $\mathcal{S}_{\text{wild}}^{\text{in}}$ and OOD/outlier data $\mathcal{S}_{\text{wild}}^{\text{out}}$ in the wild. The inliers are sampled from three multivariate Gaussians. We construct two different distributions of outliers (see details in Appendix \ref{['sec:details_of_toy_app']}). (b) The filtered outliers (in green) by SAL, where the error rate of filtered outliers $\mathcal{S}_T$ containing inlier data is $8.4\%$ and $6.4\%$, respectively. (c) The density distribution of the filtering score $\tau$, which is separable for inlier and outlier data in the wild and thus benefits the training of the OOD classifier leveraging the filtered outlier data for binary classification.

Theorems & Definitions (49)

  • Remark 1
  • Theorem 1
  • Theorem 2
  • Theorem 3
  • Definition 1: $\beta$-smooth
  • Definition 2: Gradient-based Distribution Discrepancy
  • Definition 3: $(\gamma,\zeta)$-discrepancy
  • Remark 2
  • Remark 3
  • Theorem 1
  • ...and 39 more