无需训练,用分类器引导生成分布外样本,提升检测效果
GOOD: Training-Free Guided Diffusion Sampling for Out-of-Distribution Detection
- 用图像和特征双层梯度引导扩散过程,生成分布外样本
- 生成样本在像素和特征空间均位于低密度区域,多样性更高
- 适配现有分类器,无需重训练,适合工业级部署
近期研究利用文本到图像扩散模型合成分布外(OOD)样本,显著提升了检测性能。但现有方法通常依赖扰动文本嵌入,导致语义不稳且分布偏移多样性不足,难以覆盖真实场景下的分布外数据。为此,我们提出GOOD框架,通过现成的分布内(ID)分类器直接引导扩散采样轨迹进入分布外区域。GOOD采用双层引导机制:(1) 图像级引导基于对数归一化项梯度,降低输入似然,推动样本向像素空间低密度区移动;(2) 特征级引导基于分类器隐空间中的k-NN距离,促进在特征稀疏区域采样。该设计实现更可控、多样化的分布外样本生成。此外,我们提出统一的分布外评分,自适应融合图像与特征差异,增强检测鲁棒性。通过大量定量与定性分析验证,使用GOOD生成的样本进行训练可显著提升分布外检测性能。
原文摘要 · Abstract (English)
Recent advancements have explored text-to-image diffusion models for synthesizing out-of-distribution (OOD) samples, substantially enhancing the performance of OOD detection. However, existing approaches typically rely on perturbing text-conditioned embeddings, resulting in semantic instability and insufficient shift diversity, which limit generalization to realistic OOD. To address these challenges, we propose GOOD, a novel and flexible framework that directly guides diffusion sampling trajectories towards OOD regions using off-the-shelf in-distribution (ID) classifiers. GOOD incorporates dual-level guidance: (1) Image-level guidance based on the gradient of log partition to reduce input likelihood, drives samples toward low-density regions in pixel space. (2) Feature-level guidance, derived from k-NN distance in the classifier's latent space, promotes sampling in feature-sparse regions. Hence, this dual-guidance design enables more controllable and diverse OOD sample generation. Additionally, we introduce a unified OOD score that adaptively combines image and feature discrepancies, enhancing detection robustness. We perform thorough quantitative and qualitative analyses to evaluate the effectiveness of GOOD, demonstrating that training with samples generated by GOOD can notably enhance OOD detection performance.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。