NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Non-Linear Outlier Synthesis for Out-of-Distribution Detection

Lars Doorenbos, Raphael Sznitman, Pablo Márquez-NeilaarXiv 2024

TL;DR

NCIS (Non-Linear Class-wise Invariant Sampling) establishes a new state-of-the-art in out-of-distribution (OOD) detection by generating high-quality, near-boundary synthetic outliers. By optimizing embeddings directly within a diffusion model's native conditioning space and modeling complex data manifolds with a conditional volume-preserving network (cVPN), NCIS provides a significantly more precise boundary signal for training robust classifiers.

What Problem Does This Paper Address?

Deep learning classifiers are notoriously overconfident; when presented with an image from an unknown class, they will confidently assign it to an existing training category. Out-of-distribution (OOD) detection aims to fix this by finding a clear boundary between in-distribution (ID) data and everything else.

A powerful strategy is outlier exposure, where a model is trained on synthetic OOD images to map out the decision boundary. However, generating effective pixel-space outliers is incredibly difficult. Current state-of-the-art methods (like Dream-OOD) rely on disjoint text/image encoders to find boundaries and assume simple, spherical Gaussian distributions for ID data. This mismatch means the generated "outliers" often don't align with the generative model's actual boundaries, resulting in synthetic images that lack the nuance required to teach a classifier where the true ID distribution ends.

Methods

NCIS introduces two key techniques to precisely locate and sample the boundaries of ID data:

  1. Diffusion-Based Embedding: Instead of using an external image encoder, NCIS optimizes image embeddings directly within Stable Diffusion’s native conditioning space. Similar to prompt tuning, it finds the exact embedding that maximizes the likelihood of the diffusion model generating that specific training image.
  2. Conditional Volume-Preserving Networks (cVPN): Real-world data distributions are rarely simple Gaussians. NCIS uses a cVPN to map these complex, non-linear class manifolds into a flattened "invariant space."

Once in this invariant space, the authors fit a class-conditional Gaussian distribution and use rejection sampling to select low-likelihood points—effectively capturing the exact boundary where ID data transitions into OOD data. These boundary points are mapped back to the diffusion space to generate highly effective, near-OOD synthetic images.

Figure 2. Comparison between (a) Dream-OOD, (b) linear invariants on our embeddings, and (c) our proposed method on a toy example. The disjoint embeddings and normalization of Dream-OOD greatly limit the flexibility of the generated outliers. Linear invariants similarly lack capacity. On the other hand, our method can generate successful outliers by modeling arbitrary distributions.

Datasets

The method was evaluated using standard OOD benchmarks:

  • In-Distribution (ID) Datasets: CIFAR-100 and ImageNet-100.
  • OOD Evaluation Datasets:
  • For CIFAR-100: SVHN, Places365, LSUN, iSun, and Textures.
  • For ImageNet-100: iNaturalist, Places, SUN, and Textures.

Key Insights and Ideas

  • Stay in the Native Latent Space: Combining disjoint models (e.g., an independent image encoder and a separate diffusion model) creates alignment errors. Operating entirely within the diffusion model's native conditioning space ensures that sampled boundaries actually correspond to meaningful image transitions.
  • Controlling Outlier "Difficulty": By adjusting a regularization factor ($\lambda$) in the invariant space, the authors can precisely control how far outside the distribution the synthetic outliers fall. This provides an intuitive knob to tune the difficulty of the training signal.
Figure 4. Effect of regularization on generated outliers. Out- liers get progressively more OOD with stronger regularization, providing an intuitive way to control their difficulty.
  • The Low-Level Statistic Trap: The authors discovered that OOD detectors are highly sensitive to low-level image statistics, such as the pixel interpolation method (bilinear vs. nearest neighbor) used when resizing synthetic images during training. Mismatches between training and testing interpolation caused massive performance drops, proving that OOD models often latch onto subtle texture artifacts rather than high-level semantics.

Key Results

NCIS achieves a new state-of-the-art on both canonical benchmarks, significantly outperforming traditional post-hoc detectors and existing feature- and pixel-space synthesis methods:

  • CIFAR-100: NCIS achieves an average FPR95 of 10.84%, outperforming the previous best pixel-space method, Dream-OOD, which sat at 40.31% (a absolute reduction of 29.47%).
  • ImageNet-100: NCIS reduces the average FPR95 to 33.89%, surpassing Dream-OOD's 38.76%.
  • Qualitative Superiority: As shown below, the outliers generated by NCIS retain semantic relevance to the target class (e.g., a leopard-print boot for "leopard") providing a much tighter, more challenging decision boundary for the classifier.
Figure 5. Nine random generated outliers by our method and Dream-OOD for CIFAR100 (top) and ImageNet-100 (bottom). Our generated outliers are closer to the intended meaning, provid- ing better signal to learn the ID/OOD decision boundary.

Limitations and Future Work

The primary limitation of NCIS is its reliance on the frozen image decoder of Stable Diffusion. This restricts its ability to generate high-quality outliers for highly specialized domains, such as medical imaging or industrial anomaly detection, where a generic text-to-image model lacks baseline knowledge.

Additionally, finding the initial training embeddings is computationally expensive, requiring roughly 13 hours on 8 A100 GPUs for CIFAR-100. However, the authors demonstrate that this load can be heavily mitigated by using only a fraction of the training data to fit the ID distributions without severe performance penalties. Future work will focus on integrating domain-specific diffusion models to expand the utility of the framework.

Summary updated

BibTeX
@misc{doorenbos2024non,
  author = {Lars Doorenbos and Raphael Sznitman and Pablo Márquez-Neila},
  title = {{Non-Linear Outlier Synthesis for Out-of-Distribution Detection}},
  year = {2024},
  eprint = {2411.13619},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2411.13619},
}
Figure