- https://openaccess.thecvf.com/content/CVPR2022/papers/Rombach_High-Resolution_Image_Synthesis_With_Latent_Diffusion_Models_CVPR_2022_paper.pdf#page=1.22
- https://arxiv.org/pdf/2112.10752#page=16.34
- https://github.com/CompVis/latent-diffusion
- 问题引入
- 为了在limited computational resources上训练diffusion model且保持它的生成效果,本文采取在pretrained autoencoder 的latent space进行训练,且在模型架构中加入了cross attention模块来完成conditional生成;
- methods
- Perceptual Image Compression:基于的工作VQGAN,本文1)探究了不同的降采样倍数,降采样倍数太小,perceptual compression不足,太大导致信息损失,最终得出4或者8的倍数比较好;以及2)为了避免arbitrarily high-variance latent spaces,实验了两种正则化方法,一种是和VAE类似的KL-reg,做法是增加KL-penalty来使得learned latents到标准正态分布的空间上,另一种是和VQGAN类似的VQ-reg,只是quantization layer合到了decoder layer当中;在补充材料中的更多信息:定义discriminator D ψ D_\psi Dψ,encoder+decoder D ( E ( x ) ) \mathcal{D}(\mathcal{E}(x)) D(E(x)),1)KL-reg,加入了 q E ( z ∣ x ) = N ( z ; E μ , E σ 2 ) q_\mathcal{E}(z|x) = \mathcal{N}(z;\mathcal{E}_\mu,\mathcal{E}_{\sigma^2}) qE(z∣x)=N(z;Eμ,Eσ2)和标准正态分布之间Kullback Leibler termKL正则项,此时保持正则项的权重系数小,在训练的时候 z = E μ ( x ) + E σ ( x ) ⋅ ϵ , ϵ ∼ N ( 0 , 1 ) \mathcal{z} = \mathcal{E}_\mu(x) + \mathcal{E}_\sigma(x)\cdot \epsilon,\epsilon\sim\mathcal{N}(0,1) z=Eμ(x)+Eσ(x)⋅ϵ,ϵ∼N(0,1),还进行了rescale操作;2)VQ-reg,加入quantilization layer,其中codebook的维度大以降低正则化的影响,该层absorbed in decoder layer中了;
- Latent Diffusion Models:在latent space进行diffusion model的训练;
- 还在原始的unet中加入了cross attention来进行conditional;