- Introduction
Diffusion: 확산
이 표현은 열역학(Thermodynamics)에서 원자나 분자가 농도가 높은 곳에서 낮은 곳으로 이동하는 현상을 모티브로 하였음

Diffusion (Probabilistic) Model 은 parameterized 된 Markov Chain 으로 이루어져 있으며, finite 시간이 지난 후에 data 에 맞는 이미지를 생성하도록 설계 되어 있음
Diffusion process 는 데이터에 noise 를 점진적으로 추가하는 방식으로 이루어짐
Diffusion 모델 자체로 직관적이고 학습하기 용이하지만 high quality sample 을 만드는 연구는 없었음 (ICML 2015 논문을 뜻하는듯)

- Method
Forward Process (Diffusion Process): x0 (data) + ∏Tt=1N→xT (Gaussian Noise)
Reverse Process: XT (Gaussian Noise) - ∏Tt=1N→x0 (data)
이 Reverse Process q(xt−1∣xt) 를 모델링 하는게 어려움😬
따라서 neural network 인 pθ(xt−1∣xt) 를 사용해서 q(xt−1∣xt) 를 approximate 함
(이 부분에서 VAE 와 비슷하다고 느낌)
이때 pθ(xt−1∣xt)≈q(xt−1∣xt) 를 Diffusion Model 이라고 함

수식으로 좀 더 자세히 알아보자
Forward Process (Diffusion Process)
Autoregressive form: q(x1:T∣x0)=∏Tt=1q(xt∣xt−1)
q(xt∣xt−1):=N(xt;√1−βtxt−1,βtI)
βt 는 degree of injecting noise 를 뜻함
이때, 원하는 시점의 xt 를 자유롭게 sampling 할 수 있음
q(xt∣x0)=N(xt;√ˉαtx0,(1−ˉαt)I)
(αt=1−βt, ˉαt=∏ts=1αs) 증명은 논문 참고
Reverse Process
Autoregressive form:
pθ(x0:T)=p(xT)∏Tt=1pθ(xt−1∣xt)
p\left(\mathbf{x}_T\right)=\mathcal{N}\left(\mathbf{x}_T ; \mathbf{0}, \mathbf{I}\right), \quad p_\theta\left(\mathbf{x}_{t-1} \mid \mathbf{x}_t\right):=\mathcal{N}\left(\mathbf{x}_{t-1} ; \boldsymbol{\mu}_\theta\left(\mathbf{x}_t, t\right), \sum_\theta\left(\mathbf{x}_t, t\right)\right)
이 때, \boldsymbol{\mu}_\theta\left(\mathbf{x}_t, t\right), \sum_\theta\left(\mathbf{x}_t, t\right) 은 learnable parameter
결론적으로 Diffusion Model 은 VAE 구조에 Progressive Denoising part 가 추가된 것이라고 생각하면 됨
Training
NLL 을 최소화 하도록 학습 (ELBO 를 사용하여 정리)
\mathbb{E}\left[-\log p_\theta\left(\mathbf{x}_0\right)\right] \leq \mathbb{E}_q\left[-\log \frac{p_\theta\left(\mathbf{x}_{0: T}\right)}{q\left(\mathbf{x}_{1: T} \mid \mathbf{x}_0\right)}\right]=\mathbb{E}_q\left[-\log p\left(\mathbf{x}_T\right)-\sum_{t \geq 1} \log \frac{p_\theta\left(\mathbf{x}_{t-1} \mid \mathbf{x}_t\right)}{q\left(\mathbf{x}_t \mid \mathbf{x}_{t-1}\right)}\right]=: L
Simple Objective:
\mathcal{L}_{\text {simple }}(\theta):=\mathbb{E}_{t, \mathbf{x}_0, \boldsymbol{\epsilon}}\left[\left\|\boldsymbol{\epsilon}-\boldsymbol{\epsilon}_\theta\left(\sqrt{\bar{\alpha}_t} \mathbf{x}_0+\left(\sqrt{1-\bar{\alpha}_t}\right) \boldsymbol{\epsilon}, t\right)\right\|^2\right], where t \sim \mathcal{U}(1, T)

- Experiment



Interpolation 도 잘되는 것을 확인할 수 있음
- Reference
[1] Ho, Jonathan, Ajay Jain, and Pieter Abbeel. "Denoising diffusion probabilistic models." NeurIPS 2020 [Paper link]
'Paper Review > Diffusion, VAE' 카테고리의 다른 글
[CVPR 2022] High-Resolution Image Synthesis with Latent Diffusion Models (Stable-Diffusion) (0) | 2024.03.07 |
---|