aha I got it right thank you. I will continue to deliver the latter part of the thesis. Read it and ask for a summary!
Method
To lower the computational demands of training diffusion models towards high-resolution image synthesis, we
observe that although diffusion models allow to ignore
perceptually irrelevant details by undersampling the corresponding loss terms [30], they still require costly function
evaluations in pixel space, which causes huge demands in
computation time and energy resources.
We propose to circumvent this drawback by introducing
an explicit separation of the compressive from the generative learning phase (see Fig. 2). To achieve this, we utilize
an autoencoding model which learns a space that is perceptually equivalent to the image space, but offers significantly
reduced computational complexity.
Such an approach offers several advantages: (i) By leaving the high-dimensional image space, we obtain DMs
which are computationally much more efficient because
sampling is performed on a low-dimensional space. (ii) We
exploit the inductive bias of DMs inherited from their UNet
architecture [71], which makes them particularly effective
for data with spatial structure and therefore alleviates the
need for aggressive, quality-reducing compression levels as
required by previous approaches [23, 66]. (iii) Finally, we
obtain general-purpose compression models whose latent
space can be used to train multiple generative models and
which can also be utilized for other downstream applications such as single-image CLIP-guided synthesis [25].
3.1. Perceptual Image Compression
Our perceptual compression model is based on previous
work [23] and consists of an autoencoder trained by combination of a perceptual loss [106] and a patch-based [33]
adversarial objective [20, 23, 103]. This ensures that the reconstructions are confined to the image manifold by enforcing local realism and avoids bluriness introduced by relying
solely on pixel-space losses such as L2 or L1 objectives.
More precisely, given an image x ∈ R
H×W×3
in RGB
space, the encoder E encodes x into a latent representation3
tion z = E(x), and the decoder D reconstructs the image from the latent, giving x˜ = D(z) = D(E(x)), where
z ∈ R
h×w×c
. Importantly, the encoder downsamples the
image by a factor f = H/h = W/w, and we investigate
Different downsampling factors f = 2m, with m ∈ N.
In order to avoid arbitrarily high-variance latent spaces,
we experiment with two different kinds of regularizations.
The first variant, KL-reg., imposes a slight KL-penalty towards a standard normal on the learned latent, similar to a
VAE [46, 69], whereas VQ-reg. uses a vector quantization
layer [96] within the decoder. This model can be interpreted
as a VQGAN [23] but with the quantization layer absorbed
by the decoder. Because our subsequent DM is designed
to work with the two-dimensional structure of our learned
In latent space z = E(x), we can use relatively mild compression rates and achieve very good reconstructions. This is
in contrast to previous works [23, 66], which relied on an
arbitrary 1D ordering of the learned space z to model its
distribution autoregressively and thereby ignored much of
the inherent structure of z. Hence, our compression model
preserves details of x better (see Tab. 8). The full objective
and training details can be found in the supplement.
3.2. Latent Diffusion Models
Diffusion Models [82] are probabilistic models designed to
learn a data distribution p(x) by gradually denoising a normally distributed variable, which corresponds to learning
the reverse process of a fixed Markov Chain of length T.
For image synthesis, the most successful models [15,30,72]
rely on a reweighted variant of the variational lower bound
on p(x), which mirrors denoising score-matching [85].
These models can be interpreted as an equally weighted
sequence of denoising autoencoders θ(xt, t); t = 1 . . . T,
which are trained to predict a denoised variant of their input
xt, where xt is a noisy version of the input x. The corresponding objective can be simplified to (Sec. B)
LDM = Ex, ~N(0,1),th
k − θ(xt, t)k
2
2
i
, (One)
with t uniformly sampled from {1, . . . , T}.
Generative Modeling of Latent Representations With
our trained perceptual compression models consisting of E
and D, we now have access to an efficient, low-dimensional
latent space in which high-frequency, imperceptible details
are abstracted away. Compared to the high-dimensional
pixel space, this space is more suitable for likelihood-based
generative models, as they can now (i) focus on the important, semantic bits of the data and (ii) train in a lower dimensional, computationally much more efficient space.
Unlike previous work that believed on autoregressive,
attention-based transformer models in a highly compressed,
In the discrete latent space [23,66,103], we can take advantage of
image-specific inductive biases that our model offers. This
Semantic
Map
crossattention
Latent Space Conditioning
Text
Diffusion Process
denoising step switch skip connection
Repres
entations
Pixel Space
Images
Denoising U-Net
concat
Figure 3. We condition LDMs either via concatenation or by a
more general cross-attention mechanism. See Sec. 3.3
includes the ability to build the underlying UNet primarily from 2D convolutional layers, and further focusing the
objective on the perceptually most relevant bits using the
reweighted bounds, which now reads
LLDM := EE(x), ~N(0,1),th
k − θ(zt, t)k
2
2
i
. (2)
The neural backbone θ(◦, t) of our model is realized as a
time-conditional UNet [71]. Since the forward process is
fixed, zt can be efficiently obtained from E during training,
and samples from p(z) can be decoded to image space with
a single pass through D.
3.3. Conditioning Mechanisms
Similar to other types of generative models [56, 83],
Diffusion models are in principle capable of modeling
conditional distributions of the form p(z|y). This can
be implemented with a conditional denoising autoencoder
θ(zt, t, y) and paves the way to controlling the synthesis
process through inputs y such as text [68], semantic maps
[33, 61] or other image-to-image translation tasks [34].
In the context of image synthesis, however, combining
the generative power of DMs with other types of conditionings beyond class-labels [15] or blurred variants of the input
image [72] is so far an under-explored area of research.
We turn DMs into more flexible conditional image generators by augmenting their underlying UNet backbone with
the cross-attention mechanism [97], which is effective for
learning attention-based models of various input modalities [35,36]. To pre-process y from various modalities (such as
as language prompts) we introduce a domain specific encoder τθ that projects y to an intermediate representation
τθ(y) ∈ RM×dτ
, which is then mapped to the intermediate
layers of the UNet via a cross-attention layer implementing
Attention(Q, K, V) = softmax
QKT
√
d