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

Diffusion-based Semantic Outlier Generation via Nuisance Awareness for Out-of-Distribution Detection

Suhee Yoon, Sanghyu Yoon, Ye Seul Sim, Sungik Choi, Kyungeun Lee, Hye-Seung Cho, Hankook Lee, Woohyung Lim

Diffusion-based Semantic Outlier Generation via Nuisance Awareness for Out-of-Distribution Detection

TL;DR

The paper introduces SONA (Semantic Outlier generation via Nuisance Awareness), a framework that uses diffusion models to create "hard" synthetic outliers for Out-of-Distribution (OOD) detection. By surgically swapping the semantic identity of an image while preserving its "nuisance" features (background, texture, lighting), SONA forces OOD detectors to learn subtle semantic distinctions, leading to a state-of-the-art 88.4% AUROC on challenging near-OOD tasks.

Introduction: The Challenge of Near-OOD Detection

In machine learning, Out-of-Distribution (OOD) detection is critical for safety, identifying when a model encounters data outside its training distribution. While "far-OOD" cases (e.g., a car shown to a bird classifier) are easily handled, "near-OOD" cases—samples sharing similar backgrounds or textures but belonging to different semantic categories (e.g., a leopard vs. a pampas deer)—remain a significant hurdle.

Existing methods often fail because:

  1. Outlier Exposure (OE) requires massive, curated datasets of real-world outliers.
  2. Synthetic generation often produces outliers that are either too "far" from the training data or too blurry for the model to learn meaningful decision boundaries.

The authors identify that "nuisance" factors—background, lighting, and style—often confuse detectors. If a synthetic outlier's background is distinct from the in-distribution (ID) data, the detector "cheats" by focusing on the background rather than the object's semantic identity.

Methods: The SONA Framework

SONA leverages Conditional Diffusion Models (CDMs) to generate outliers in pixel space through a three-step process:

  1. Input Deformation: An ID image is encoded and partially diffused with controlled noise.
  2. Nuisance-Aware Masking: By calculating the difference between conditional and unconditional noise estimates, the model separates the Semantic Region ($M_S$) from the Nuisance Region ($M_N$).
  3. SONA Guidance: During denoising, three guidance terms are applied: $\Delta_{ID}$ (removes original semantic info), $\Delta_N$ (preserves background), and $\Delta_{OOD}$ (injects new semantic info).
The SONA framework for outlier synthesis and OOD detection. It uses nuisance-aware masking and guidance to transform ID images into hard near-OOD outliers by swapping semantic identity while preserving background features.

The detector is then trained using standard cross-entropy, Outlier Exposure loss, and a Mutual Information (MI) loss to encourage the feature extractor to ignore shared nuisance features.

Key Insights: Nuisance is the Key to Nearness

The most effective outliers are those that are "almost" ID. By keeping the background identical but changing the object, SONA creates "minimal pairs" that force the network to focus on fine-grained object details. Unlike previous methods that start from random noise, SONA's "surgical diffusion" starts from real ID images, ensuring synthetic outliers inherit complex, real-world textures.

Visual comparison of ID, Near-OOD, and Far-OOD samples. SONA's attention maps (bottom) correctly identify semantic features like antlers in near-OOD cases, whereas previous methods like DreamOOD (middle) fail by focusing on shared nuisance features.

Key Results

  • State-of-the-Art Performance: SONA achieved an 88.4% AUROC on near-OOD tasks, outperforming DreamOOD by ~8% and surpassing real-world outlier methods (OE) by ~4%.
  • Consistency: SONA’s performance remained stable across both far-OOD and near-OOD benchmarks, whereas other methods saw drops up to 10%.
  • Ablation Success: Filtering the OOD semantic mask to remove nuisance overlap was critical; without it, generated images were "messy," degrading detection performance.

Limitations and Future Work

While effective, generating outliers via diffusion models is computationally expensive compared to latent-space synthesis. Additionally, SONA's quality depends on the underlying pre-trained diffusion model (e.g., Stable Diffusion v2). Future work may explore applying this nuisance-aware approach to data augmentation for fine-grained classification.

Summary updated

BibTeX
@inproceedings{yoon2025diffusion,
  author = {Suhee Yoon and Sanghyu Yoon and Ye Seul Sim and Sungik Choi and Kyungeun Lee and Hye-Seung Cho and Hankook Lee and Woohyung Lim},
  title = {{Diffusion-based Semantic Outlier Generation via Nuisance Awareness for Out-of-Distribution Detection}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2025},
  doi = {10.1609/aaai.v39i12.33427},
}
Figure