DiffusionOOD: Class-Conditional Separation Loss for Out-of-Distribution Detection
Conditional diffusion models used as generative classifiers for OOD detection, with separation loss reaching 99.03% ± 0.07% AUROC on a within-CIFAR airplane-vs-rest binary split (single ID class).
Problem
Standard neural classifiers exhibit dangerous overconfidence on out-of-distribution samples. Generative classifiers offer principled reconstruction error scoring, but suffer from catastrophic variance across random seeds and ambiguous boundary decisions.
Role
Master thesis author: novel separation loss objective formulation, PyTorch Lightning & Hydra infrastructure, multi-seed statistical evaluation, and benchmark analysis.
Architecture & Pipeline Summary
Approach
- Train a binary conditional diffusion model and score reconstruction error under competing class conditions.
- Add class-conditional separation loss to push conditional noise predictions apart and remove model ambiguity.
- Evaluate with multiple random seeds and external zero-shot benchmarks instead of relying on one lucky run.
Results
- 99.03% ± 0.07% AUROC averaged over three seeds on a within-CIFAR airplane-vs-rest binary split (single ID class; not comparable to multi-class CIFAR-10 OOD benchmarks).
- +6.5 percentage points gain over the non-separated baseline (which achieved 92.52% ± 11.07% AUROC at lambda=0).
- Seed-42 generalized zero-shot to CIFAR-100 (96.97%), Places365 (96.50%), FashionMNIST (94.03%), Textures (92.84%), and SVHN (90.50%).
Conditional Diffusion as a Generative Classifier: Interactive Evidence Explorer
Built directly from the raw PyTorch score tensors (seed42_*.pt) and ablation JSON artefacts on Hugging Face (ahmed-3m/DiffusionOOD). Explore how the class-conditional separation loss (Eq. 3.23), contrastive noise-error scoring (Eq. 3.3), Monte Carlo trial budget K, and industrial transfer behave.
Lessons
- Stability across random seeds matters almost as much as peak score in safety-critical deployments.
- A scientific finding becomes significantly more useful when variance and error bars are reported honestly.
- Cross-domain transfer should be tested empirically, not assumed from synthetic benchmarks.