https://arxiv.org/abs/2112.10752

Contribution

Pixel space에서 diffusion model을 학습하는 대신 pre-trained autoencoder의 embedding space를 diffusion model로 학습하여 더 효율적인 학습 및 추론이 가능

Motivation

SmartSelect_20220312-131313_Samsung Notes.jpg

이미지의 대부분의 bit들은 inperceptible details이다 (즉, image들은 실제 dimension보다 낮은 dimension의 manifold에 위치해있다). 따라서 이미지를 압축하는 AE를 먼저 학습하고 그 embedding을 diffusion model로 생성하면 더 효율적이다.

Autoencoder

Input image를 $f$배 downsample했다가 다시 복원하는 autoencoder를 미리 학습시킨다. Embedding space에 대해 저자들은 두 가지 regularization을 실험했다. 하나는 KL-reg, 즉 embedding들이 normal distribution으로 가도록 하는 regularization을 살짝 (lambda값 1e-6 정도) 걸어주는 방법이고 (LSGM과 비슷해진다), 다른 하나는 VQ-reg로 vector quantization을 사용하는 방법이다 (즉 discrete한 latent space를 만든다). VQ-reg가 성능이 더 좋아서 이후에는 그걸 사용했다.

Cross-Attention Layer

Untitled

SmartSelect_20220312-134619_Samsung Notes.jpg

Cross attention은 다양한 modality의 data들을 concat보다 더 잘 섞기 위해 널리 쓰이는 방법 같다. Vector Quantized Diffusion Model for Text-to-Image Synthesis에서도 text embedding을 DDPM에 condition으로 주기 위해 사용한 방법이다. 여기선 class label, semantic layout 등 다양한 condition에 대한 general-purpose conditioning mechanism으로 사용했다.

Training

$L_{simple}$을 이용해서 condition encoder $\tau_\theta$와 DDPM $\epsilon_\theta$을 jointly train한다.

Experiments

Untitled

LDM- 뒤에 붙은 숫자는 downsampling scale factor $f$이고, 따라서 LDM-1은 pixel space DDPM이다. LDM-1보다 LDM-4나 LDM-8이 더 수렴도 빠르고 (inperceptible details를 무시하고 학습하기 때문에?) 성능이 좋은 것을 확인할 수 있다 (LDM-1의 성능이 너무 안좋다). LDM-32처럼 downsample을 너무 많이 하면 decoder의 성능이 bottleneck이 돼서 성능이 떨어진다.

Untitled

Throughput (초당 몇 sample 찍어내는지)와 FID간의 관계를 살핀 실험이다. 확인할 수 있는건,

  1. LDM-1 (pixel space DDPM)은 아무리 step을 줄여도 throughput에 한계가 있다.