Skip to main content
QUICK REVIEW

[论文解读] Your Diffusion Model is Secretly a Zero-Shot Classifier

Alexander C. Li, Mihir Prabhudesai|arXiv (Cornell University)|Mar 28, 2023
Domain Adaptation and Few-Shot Learning被引用 7
一句话总结

本文提出 Diffusion Classifier,一种无需额外训练即可从预训练的条件扩散模型(如 Stable Diffusion 和 DiT)中提取零样本和标准图像分类器的方法,通过利用 ELBO 的条件似然估计实现。该方法在零样本准确率方面表现优异,优于对比基线模型在组合推理任务中的表现,并展现出对分布偏移更强的鲁棒性。

ABSTRACT

The recent wave of large-scale text-to-image diffusion models has dramatically increased our text-based image generation abilities. These models can generate realistic images for a staggering variety of prompts and exhibit impressive compositional generalization abilities. Almost all use cases thus far have solely focused on sampling; however, diffusion models can also provide conditional density estimates, which are useful for tasks beyond image generation. In this paper, we show that the density estimates from large-scale text-to-image diffusion models like Stable Diffusion can be leveraged to perform zero-shot classification without any additional training. Our generative approach to classification, which we call Diffusion Classifier, attains strong results on a variety of benchmarks and outperforms alternative methods of extracting knowledge from diffusion models. Although a gap remains between generative and discriminative approaches on zero-shot recognition tasks, our diffusion-based approach has significantly stronger multimodal compositional reasoning ability than competing discriminative approaches. Finally, we use Diffusion Classifier to extract standard classifiers from class-conditional diffusion models trained on ImageNet. Our models achieve strong classification performance using only weak augmentations and exhibit qualitatively better "effective robustness" to distribution shift. Overall, our results are a step toward using generative over discriminative models for downstream tasks. Results and visualizations at https://diffusion-classifier.github.io/

研究动机与目标

  • 探究预训练的条件扩散模型是否可在无需额外训练的情况下作为有效的零样本分类器。
  • 弥合生成模型与判别模型在图像分类任务上的性能差距。
  • 评估生成模型在多模态组合推理与鲁棒性方面相较于判别模型的表现。
  • 仅使用弱增强数据,从如 DiT 这类类别条件扩散模型中提取标准分类器。
  • 证明生成建模可作为下游任务中判别学习的可行替代方案。

提出的方法

  • 该方法利用扩散模型的变分下界(ELBO)来近似每个类别 $\mathbf{c}$ 的条件对数似然 $\log p_{\theta}(\mathbf{x} \mid \mathbf{c})$。
  • 对于每个输入图像 $\mathbf{x}$,通过在多个时间步上计算噪声重建损失(即 $\epsilon$-预测损失)的蒙特卡洛估计,来估计 $p(\mathbf{x} \mid \mathbf{c})$。
  • 结合均匀先验,应用贝叶斯定理,从估计的似然中计算类别概率 $p(\mathbf{c} \mid \mathbf{x})$。
  • 通过在时间步上对 $\ell_2$ 损失进行均匀加权,降低方差并提升准确率,其性能优于加权或仅变分目标。
  • 通过分辨率降低、利用弱判别模型进行类别剪枝以及并行化噪声预测步骤,实现快速推理。
  • 该方法被应用于文本到图像模型(如 Stable Diffusion)和类别条件模型(如 DiT)中,以提取分类器。

实验结果

研究问题

  • RQ1预训练的扩散模型是否可在无需微调的情况下用作零样本图像分类器?
  • RQ2基于扩散的分类器在零样本识别任务中与最先进判别模型相比表现如何?
  • RQ3扩散模型在多模态组合推理方面相较于判别模型表现出多强的优越性?
  • RQ4类别条件扩散模型是否可被用于在极少数据增强下提取鲁棒且高准确率的标准分类器?
  • RQ5扩散模型的设计(如潜在空间 vs. 像素空间、文本编码器选择)如何影响最终分类器的性能?

主要发现

  • 使用 Stable Diffusion 时,Diffusion Classifier 在 ImageNet 上实现了 77.5% 的零样本准确率,优于其他知识提取方法。
  • 在 Winoground 基准测试中,其在多模态组合推理方面显著优于最强的对比基线模型。
  • 对于在 ImageNet 上训练的类别条件扩散模型 DiT,该方法仅使用弱增强即实现了 79.1% 的 top-1 准确率。
  • 所得到的分类器在分布偏移下的“有效鲁棒性”优于在相同数据上训练的对比判别模型。
  • 在时间步上对 $\ell_2$ 损失进行均匀加权可获得最佳性能,优于变分下界或联合目标。
  • 通过降低分辨率(如 $256^2$ 或 $128^2$)或使用弱判别模型提前剪枝不可能类别,可加速推理。

更好的研究,从现在开始

从阅读论文到最终审阅,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。