扩散模型实现 Guided-diffusion

1,307 阅读1分钟

扩散模型实现 Guided-diffusion

Diffusion Models Beat GANs on Image Synthesis (OpenAI) 项目:github.com/openai/guid… github.com/openai/impr…
论文:arxiv.org/abs/2105.05…

Contribution

  • 证明扩散模型在图像生成任务上达到sota
  • 提出classifier guidance提高有条件图像生成图片生成质量
  • 通过一系列消融实验,找到更好的模型架构

Architecture Improvements

在扩散模型中往往使用Unet作为骨干网络,本文通过设计一系列消融实验,寻找更好的模型架构,并在ImageNet等分辨率、数据量更大的数据集上取得了可观的提升。

image.png

image.png

For the rest of the architecture, we use 128 base channels, 2 residual blocks per resolution, multi-resolution attention, and BigGAN up/downsampling, and we train the models for 700K iterations.

  • Adaptive Group Normalization(AdaGN)
    作用:在Group Normalization操作后将时间、类别等信息嵌入残差模块
    实现:AdaGN(h,y)=ysGroupNorm(h)+ybAdaGN(h,y)=y_s GroupNorm(h)+y_b
    [ys,yb][y_s,y_b] linear projection of timestep and class embedding image.png

Classifier Guidance

使用分类器classifier p(yx) p(y|x)提高扩散模型generator

image.png

本文提出两种使用分类器的有条件采样方式

image.png 推导: image.png

image.png

image.png

image.png

image.png

  • Scaling Classifier Gradients
    Classifier 架构:Unet的下采样模块+attention pool输出类别预测
    Scaling Classifier Gradients: sxlogp(yx)=xlog1Zp(yx)ss\nabla_xlogp(y|x)=\nabla_x log\frac{1}{Z}p(y|x)^s

    当s大于1时,数据分布比p(y|x)更尖锐,因为较大的值被指数放大。使用更大的梯度尺度有助于提高生成图片类别正确(但多样性较小)

image.png

image.png

Results

image.png

image.png