DiffGuard: Semantic Mismatch-Guided Out-of-Distribution Detection using Pre-trained Diffusion Models
Ruiyuan Gao, Chenchen Zhao, Lanqing Hong, Qiang Xu
Abstract
Given a classifier, the inherent property of semantic Out-of-Distribution (OOD) samples is that their contents differ from all legal classes in terms of semantics, namely semantic mismatch. There is a recent work that directly applies it to OOD detection, which employs a conditional Generative Adversarial Network (cGAN) to enlarge semantic mismatch in the image space. While achieving remarkable OOD detection performance on small datasets, it is not applicable to ImageNet-scale datasets due to the difficulty in training cGANs with both input images and labels as conditions.As diffusion models are much easier to train and amenable to various conditions compared to cGANs, in this work, we propose to directly use pre-trained diffusion models for semantic mismatch-guided OOD detection, named DiffGuard. Specifically, given an OOD input image and the predicted label from the classifier, we try to enlarge the semantic difference between the reconstructed OOD image under these conditions and the original input image. We also present several test-time techniques to further strengthen such differences. Experimental results show that DiffGuard is effective on both Cifar-10 and hard cases of the large-scale ImageNet, and it can be easily combined with existing OOD detection techniques to achieve state-of-the-art OOD detection results.
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext 3e9c1e1e-9b2f-4040-a60a-2f01e63c88e9Cited by top-tier papers11
- MagicDrive: Street View Generation with Diverse 3D Geometry ControlRuiyuan Gao, Kai Chen, Enze Xie, Lanqing Hong et al.ICLR 2024 · 248 citations
- DetDiffusion: Synergizing Generative and Perceptive Models for Enhanced Data Generation and PerceptionYibo Wang, Ruiyuan Gao, Kai Chen, Kaiqiang Zhou et al.CVPR 2024 · 14 citations
- Optimizing OOD Detection in Molecular Graphs: A Novel Approach with Diffusion ModelsXu Shen, Yili Wang, Kaixiong Zhou, Shirui Pan et al.KDD 2024 · 12 citations
- An Information-theoretical Framework for Understanding Out-of-distribution Detection with Pretrained Vision-Language ModelsBo Peng, Jie Lu, Guangquan Zhang, Zhen FangNeurIPS 2025 · 9 citations
- Diffusion-based Layer-wise Semantic Reconstruction for Unsupervised Out-of-Distribution DetectionYing Yang, De Cheng, Chaowei Fang, Yubiao Wang et al.NeurIPS 2024 · 9 citations
Builds on23
- Denoising Diffusion Probabilistic ModelsJonathan Ho, Ajay Jain, Pieter AbbeelNeurIPS 2020 · 35,902 citations
- Diffusion Models Beat GANs on Image SynthesisPrafulla Dhariwal, Alexander Quinn NicholNeurIPS 2021 · 13,211 citations
- High-Resolution Image Synthesis with Latent Diffusion ModelsRobin Rombach, Andreas Blattmann, Dominik Lorenz, Patrick Esser et al.CVPR 2022 · 13,123 citations
- Denoising Diffusion Implicit ModelsJiaming Song, Chenlin Meng, Stefano ErmonICLR 2021 · 11,743 citations
- Adding Conditional Control to Text-to-Image Diffusion ModelsLvmin Zhang, Anyi Rao, Maneesh AgrawalaICCV 2023 · 6,759 citations
Related papers
- GOOD: Training-Free Guided Diffusion Sampling for Out-of-Distribution DetectionXin Gao, Jiyao Liu, Guanghao Li, Yueming Lyu et al.NeurIPS 2025 · 9 citations
- Diffusion-based Semantic Outlier Generation via Nuisance Awareness for Out-of-Distribution DetectionSuhee Yoon, Sanghyu Yoon, Ye Seul Sim, Sungik Choi et al.AAAI 2025 · 3 citations
- BOOD: Boundary-based Out-Of-Distribution Data GenerationQilin Liao, Shuo Yang, Bo Zhao, Ping Luo et al.ICML 2025
- GDA: Generalized Diffusion for Robust Test-Time AdaptationYun-Yun Tsai, Fu-Chen Chen, Albert Y. C. Chen, Junfeng Yang et al.CVPR 2024 · 11 citations
- Out-of-Distribution Detection with a Single Unconditional Diffusion ModelAlvin Heng, Alexandre H. Thiery, Harold SohNeurIPS 2024 · 35 citations
