Cascaded Diffusion Models for High Fidelity Image Generation

Jonathan Ho, Chitwan Saharia, William Chan, David J. Fleet, Mohammad Norouzi, Tim Salimans

Introduction

Diffusion models (Sohl-Dickstein et al., 2015) have recently been shown to be capable of synthesizing high quality images and audio (Chen et al., 2021; Ho et al., 2020; Kong et al., 2021; Song and Ermon, 2020): an application of machine learning that has long been dominated by other classes of generative models such as autoregressive models, GANs, VAEs, and flows (Brock et al., 2019; Dinh et al., 2017; Goodfellow et al., 2014; Ho et al., 2019; Kingma and Dhariwal, 2018; Kingma and Welling, 2014; Razavi et al., 2019; van den Oord et al., 2016a, b, 2017). Most previous work on diffusion models demonstrating high quality samples has focused on data sets of modest size, or data with strong conditioning signals. Our goal is to improve the sample quality of diffusion models on large high-fidelity data sets for which no strong conditioning information is available. To showcase the capabilities of the original diffusion formalism, we focus on simple, straightforward techniques to improve the sample quality of diffusion models; for example, we avoid using extra image classifiers to boost sample quality metrics (Dhariwal and Nichol, 2021; Razavi et al., 2019).

Our key contribution is the use of cascades to improve the sample quality of diffusion models on class-conditional ImageNet . Here, cascading refers to a simple technique to model high resolution data by learning a pipeline of separately trained models at multiple resolutions; a base model generates low resolution samples, followed by super-resolution models that upsample low resolution samples into high resolution samples. Sampling from a cascading pipeline occurs sequentially, first sampling from the low resolution base model, followed by sampling from super-resolution models in order of increasing resolution. While any type of generative model could be used in a cascading pipeline (e.g., Menick and Kalchbrenner, 2019; Razavi et al., 2019), here we restrict ourselves to diffusion models. Cascading has been shown in recent prior work to improve the sample quality of diffusion models (Saharia et al., 2021; Nichol and Dhariwal, 2021); our work here concerns the improvement of diffusion cascading pipelines to attain the best possible sample quality.

The simplest and most effective technique we found to improve cascading diffusion pipelines is to apply strong data augmentation to the conditioning input of each super-resolution model. We refer to this technique as conditioning augmentation. In our experiments, conditioning augmentation is crucial for our cascading pipelines to generate high quality samples at the highest resolution. With this approach we attain FID scores on class-conditional ImageNet generation that are better than BigGAN-Deep (Brock et al., 2019) at any truncation value, and classification accuracy scores that are better than VQ-VAE-2 (Razavi et al., 2019). We empirically find that conditioning augmentation is effective because it alleviates compounding error in cascading pipelines due to train-test mismatch, sometimes referred to as exposure bias in the sequence modeling literature (Bengio et al., 2015; Ranzato et al., 2016).

The key contributions of this paper are as follows:

We show that our Cascaded Diffusion Models (CDM) yield high fidelity samples superior to BigGAN-deep (Brock et al., 2019) and VQ-VAE-2 (Razavi et al., 2019) in terms of FID score (Heusel et al., 2017) and classification accuracy score (Ravuri and Vinyals, 2019), the latter by a large margin. We achieve these results with pure generative models that are not combined with any classifier.

We introduce conditioning augmentation for our super-resolution models, and find it critical towards achieving high sample fidelity. We perform an in-depth exploration of augmentation policies, and find Gaussian augmentation to be a key ingredient for low resolution upsampling, and Gaussian blurring for high resolution upsampling. We also show how to efficiently train models amortized over varying levels of conditioning augmentation to enable post-training hyperparameter search for optimal sample quality.

Section 2 reviews recent work on diffusion models. Section 3 describes the most effective types of conditioning augmentation that we found for class-conditional ImageNet generation. Section 4 contains our sample quality results, ablations, and experiments on additional datasets. Section A contains extra samples and Section B contains details on hyperparameters and architectures. High resolution figures and additional supplementary material can be found at https://cascaded-diffusion.github.io/.

Background

We begin with background on diffusion models, their extension to conditional generation, and their associated neural network architectures.

A diffusion model (Sohl-Dickstein et al., 2015; Ho et al., 2020) is defined by a forward process that gradually destroys data x0q(x0)\mathbf{x}_{0}\sim q(\mathbf{x}_{0}) over the course of TT timesteps

and a parameterized reverse process pθ(x0)=pθ(x0:T)dx1:Tp_{\theta}(\mathbf{x}_{0})=\int p_{\theta}(\mathbf{x}_{0:T})\,d\mathbf{x}_{1:T}, where

The forward process hyperparameters βt\beta_{t} are set so that xT\mathbf{x}_{T} is approximately distributed according to a standard normal distribution, so p(xT)p(\mathbf{x}_{T}) is set to a standard normal prior as well. The reverse process is trained to match the joint distribution of the forward process by optimizing the evidence lower bound (ELBO) Lθ(x0)logpθ(x0)-L_{\theta}(\mathbf{x}_{0})\leq\log p_{\theta}(\mathbf{x}_{0}):

Sample quality can be improved, at the cost of log likelihood, by optimizing modified losses instead of the ELBO. The particular form of the modified loss depends on whether we are learning Σθ{\boldsymbol{\Sigma}}_{\theta} or treating it as a fixed hyperparameter (and whether Σθ{\boldsymbol{\Sigma}}_{\theta} is learned is itself considered a hyperparameter choice that we set experimentally). For the case of non-learned Σθ{\boldsymbol{\Sigma}}_{\theta}, we use the simplified loss

which is a weighted form of the ELBO that resembles denoising score matching over multiple noise scales (Ho et al., 2020; Song and Ermon, 2019). For the case of learned Σθ{\boldsymbol{\Sigma}}_{\theta}, we employ a hybrid loss (Nichol and Dhariwal, 2021) implemented using the expression

2 Conditional Diffusion Models

In the conditional generation setting, the data x0\mathbf{x}_{0} has an associated conditioning signal c\mathbf{c}, for example a label in the case of class-conditional generation, or a low resolution image in the case of super-resolution (Saharia et al., 2021; Nichol and Dhariwal, 2021). The goal is then to learn a conditional model pθ(x0c)p_{\theta}(\mathbf{x}_{0}|\mathbf{c}). To do so, we modify the diffusion model to include c\mathbf{c} as input to the reverse process:

The data and conditioning signal (x0,c)(\mathbf{x}_{0},\mathbf{c}) are sampled jointly from the data distribution, now called q(x0,c)q(\mathbf{x}_{0},\mathbf{c}), and the forward process q(x1:Tx0)q(\mathbf{x}_{1:T}|\mathbf{x}_{0}) remains unchanged. The only modification that needs to be made is to inject c\mathbf{c} as a extra input to the neural network function approximators: instead of μθ(xt,t){\boldsymbol{\mu}}_{\theta}(\mathbf{x}_{t},t) we now have μθ(xt,t,c){\boldsymbol{\mu}}_{\theta}(\mathbf{x}_{t},t,\mathbf{c}), and likewise for Σθ{\boldsymbol{\Sigma}}_{\theta}. The particular architectural choices for injecting these extra inputs depends on the type of the conditioning c\mathbf{c}, as described next.

3 Architectures

The current best architectures for image diffusion models are U-Nets (Ronneberger et al., 2015; Salimans et al., 2017), which are a natural choice to map corrupted data xt\mathbf{x}_{t} to reverse process parameters (μθ,Σθ)({\boldsymbol{\mu}}_{\theta},{\boldsymbol{\Sigma}}_{\theta}) that have the same spatial dimensions as xt\mathbf{x}_{t}. Scalar conditioning, such as a class label or a diffusion timestep tt, is provided by adding embeddings into intermediate layers of the network (Ho et al., 2020). Lower resolution image conditioning is provided by channelwise concatenation of the low resolution image, processed by bilinear or bicubic upsampling to the desired resolution, with the reverse process input xt\mathbf{x}_{t}, as in the SR3 (Saharia et al., 2021) and Improved DDPM (Nichol and Dhariwal, 2021) models. See Fig. 3 for an illustration of the SR3-based architecture that we use in this work.

Conditioning Augmentation in Cascaded Diffusion Models

Suppose x0\mathbf{x}_{0} is high resolution data and z0\mathbf{z}_{0} is its low resolution counterpart. We use the term cascading pipeline to refer to a sequence of generative models. At the low resolution we have a diffusion model pθ(z0)p_{\theta}(\mathbf{z}_{0}), and at the high resolution, a super-resolution diffusion model pθ(x0z0)p_{\theta}(\mathbf{x}_{0}|\mathbf{z}_{0}). The cascading pipeline forms a latent variable model for high resolution data; i.e., pθ(x0)=pθ(x0z0)pθ(z0)dz0p_{\theta}(\mathbf{x}_{0})=\int p_{\theta}(\mathbf{x}_{0}|\mathbf{z}_{0})p_{\theta}(\mathbf{z}_{0})\,d\mathbf{z}_{0}. It is straightforward to extend this to more than two resolutions. It is also straightforward to condition an entire cascading pipeline on class information or other conditioning information c\mathbf{c}: the models take on the form pθ(z0c)p_{\theta}(\mathbf{z}_{0}|\mathbf{c}) and pθ(x0z0,c)p_{\theta}(\mathbf{x}_{0}|\mathbf{z}_{0},\mathbf{c}), each using the conditioning mechanism described in Section 2.2. An example cascading pipeline is depicted in Fig. 4.

Cascading pipelines have been shown to be useful with other generative model families (Menick and Kalchbrenner, 2019; Razavi et al., 2019). A major benefit to training a cascading pipeline over training a standard model at the highest resolution is that most of the modeling capacity can be dedicated to low resolutions, which empirically are the most important for sample quality, and training and sampling at low resolutions tends to be the most computationally efficient. In addition, cascading allows the individual models to be trained independently, and architecture choices can be tuned at each specific resolution for the best performance of the entire pipeline.

The most effective technique we found to improve the sample quality of cascading pipelines is to train each super-resolution model using data augmentation on its low resolution input. We refer to this general technique as conditioning augmentation. At a high level, for some super-resolution model pθ(x0z)p_{\theta}(\mathbf{x}_{0}|\mathbf{z}) from a low resolution image z\mathbf{z} to a high resolution image x0\mathbf{x}_{0}, conditioning augmentation refers to applying some form of data augmentation to z\mathbf{z}. This augmentation can take any form, but what we found most effective at low resolutions is adding Gaussian noise (forward process noise), and for high resolutions, randomly applying Gaussian blur to z\mathbf{z}. In some cases, we found it more practical to train super-resolution models amortized over the strength of conditioning augmentation and pick the best strength in a post-training hyperparameter search for optimal sample quality. Details on conditioning augmentation and its realization during training and sampling are given in the following sections.

One simple instantiation of conditioning augmentation is augmentation of z\mathbf{z} by blurring. We found this to be most effective for upsampling to images with resolution 128×\times128 and 256×\times256. More specifically, we apply a Gaussian filter of size kk and sigma σ\sigma to obtain zb\mathbf{z}_{b}. We use a filter size of k=(3,3)k=(3,3) and randomly sample σ\sigma from a fixed range during training. We perform hyper-parameter search to find the range for σ\sigma. During training, we apply this blurring augmentation to 50% of the examples. During inference, no augmentation is applied to low resolution inputs. We explored applying different amounts of blurring augmentations during inference, but did not find it helpful in initial experiments.

2 Truncated Conditioning Augmentation

Here we describe what we call truncated conditioning augmentation, a form of conditioning augmentation that requires a simple modification to the training and architecture of the super-resolution models, but no change to the low resolution model at the initial stage of the cascade. We found this method to be most useful at resolutions smaller than 128×\times128. Normally, generating a high resolution sample x0\mathbf{x}_{0} involves first generating z0\mathbf{z}_{0} from the low resolution model pθ(z0)p_{\theta}(\mathbf{z}_{0}), then feeding that result into the super-resolution model pθ(x0z0)p_{\theta}(\mathbf{x}_{0}|\mathbf{z}_{0}). In other words, generating a high resolution sample is performed using ancestral sampling from the latent variable model

(For simplicity, we have assumed that the low resolution and super-resolution models both use the same number of timesteps TT.) Truncated conditioning augmentation refers to truncating the low resolution reverse process to stop at timestep s>0s>0, instead of ; i.e.,

The base model is now pθ(zs)=pθ(zs:T)dzs+1:Tp_{\theta}(\mathbf{z}_{s})=\int p_{\theta}(\mathbf{z}_{s:T})d\mathbf{z}_{s+1:T}, and the super-resolution model is now pθ(x0zs)=p(xT)t=1Tpθ(xt1xt,zs)dx1:Tp_{\theta}(\mathbf{x}_{0}|\mathbf{z}_{s})=\int p(\mathbf{x}_{T})\prod_{t=1}^{T}p_{\theta}(\mathbf{x}_{t-1}|\mathbf{x}_{t},\mathbf{z}_{s})d\mathbf{x}_{1:T}, where

The reason truncating the low resolution reverse process is a form of data augmentation is that the training procedure for pθ(x0zs)p_{\theta}(\mathbf{x}_{0}|\mathbf{z}_{s}) involves conditioning on noisy zsq(zsz0)\mathbf{z}_{s}\sim q(\mathbf{z}_{s}|\mathbf{z}_{0}), which, up to scaling, is z0\mathbf{z}_{0} augmented with Gaussian noise. To be more precise about training a cascading pipeline with truncated conditioning augmentation, let us examine the ELBO for pθs(x0)p_{\theta}^{s}(\mathbf{x}_{0}) in Eq. 2. We can treat pθs(x0)p_{\theta}^{s}(\mathbf{x}_{0}) as a VAE with a diffusion model prior, a diffusion model decoder, and the approximate posterior

which runs forward processes independently on a low and high resolution pair. The ELBO is

Thus we have an ELBO for the combined model

It is apparent that optimizing Eq. 3 trains the low and high resolution models separately. For a fixed value of ss, the low resolution process is trained up to the truncation timestep ss, and the super-resolution model is trained on a conditioning signal corrupted using the low resolution forward process stopped at timestep ss.

In practice, since we pursue sample quality as our main objective, we do not use these ELBO expressions directly when training models with learnable reverse process variances. Rather, we train on the “simple” unweighted loss or the hybrid loss described in Section 2, and the particular loss we use is considered a hyperparameter reported in Section B.

We would like to search over multiple values of ss to select for the best sample quality. To make this search practical, we avoid retraining models by amortizing a single super-resolution model over uniform random ss at training time. Because each possible truncation time corresponds to a distinct super-resolution task, the super-resolution model for μθ{\boldsymbol{\mu}}_{\theta} and Σθ{\boldsymbol{\Sigma}}_{\theta} must take zs\mathbf{z}_{s} as input along with ss, and this can be accomplished using a single network with an extra time embedding input for ss. We leave the low resolution model training unchanged, because the standard diffusion training procedure already trains with random ss. The complete training procedure for a two-stage cascading pipeline is listed in Algorithm 1.

3 Non-truncated Conditioning Augmentation

Another form of conditioning augmentation, which we call non-truncated conditioning augmentation, uses the same model modifications and training procedure as truncated conditioning augmentation (Section 3.2). The only difference is at sampling time. Instead of truncating the low resolution reverse process, in non-truncated conditioning augmentation we always sample z0\mathbf{z}_{0} using the full, non-truncated low resolution reverse process; then we corrupt z0\mathbf{z}_{0} using the forward process into zsq(zsz0)\mathbf{z}^{\prime}_{s}\sim q(\mathbf{z}_{s}|\mathbf{z}_{0}) and feed the corrupted zs\mathbf{z}^{\prime}_{s} into the super-resolution model.

The main advantage of non-truncated conditioning augmentation over truncated conditioning augmentation is a practical one during the search phase over ss. In the case of truncated augmentation, if we want to run the super-resolution model over all ss in parallel, we must store all low resolution samples zs\mathbf{z}_{s} for all values of ss considered. In the case of non-truncated augmentation, we need to store the low resolution samples just once, since sampling zsq(zsz0)\mathbf{z}^{\prime}_{s}\sim q(\mathbf{z}_{s}|\mathbf{z}_{0}) is computationally inexpensive. These sampling procedures are listed in Algorithm 2.

Truncated and non-truncated conditioning augmentation should perform similarly because zs\mathbf{z}_{s} and zs\mathbf{z}^{\prime}_{s} should have similar marginal distributions if the low resolution model is trained well enough. Indeed, in Section 4.3, we empirically find that sample quality metrics are similar for both truncated and non-truncated conditioning augmentation.

Experiments

We designed experiments to improve the sample quality metrics of cascaded diffusion models on class-conditional ImageNet generation. Our cascading pipelines consist of class-conditional diffusion models at all resolutions, so class information is injected at all resolutions: see Fig. 4. Our final ImageNet results are described in Section 4.1.

To give insight into our cascading pipelines, we begin with improvements on a baseline non-cascaded model at the 64×\times64 resolution (Section 4.2), then we show that cascading up to 64×\times64 improves upon our best non-cascaded 64×\times64 model, but only in conjunction with conditioning augmentation. We also show that truncated and non-truncated conditioning augmentation perform equally well (Section 4.3), and we study random Gaussian blur augmentation to train super-resolution models to resolutions of 128×\times128 and 256×\times256 (Section 4.4). Finally, we verify that conditioning augmentation is also effective on the LSUN dataset (Yu et al., 2015) and therefore is not specific to ImageNet (Section 4.5).

We cropped and resized the ImageNet dataset (Russakovsky et al., 2015) in the same manner as BigGAN (Brock et al., 2019). We report Inception scores using the standard practice of generating 50k samples and calculating the mean and standard deviation over 10 splits (Salimans et al., 2016). Generally, throughout our experiments, we selected models and performed early stopping based on FID score calculated over 10k samples, but all reported FID scores are calculated over 50k samples for comparison with other work (Heusel et al., 2017). The FID scores we used for model selection and reporting model performance are calculated against training set statistics according to common practice, but since this can be seen as overfitting on the performance metric, we additionally report model performance using FID scores calculated against validation set statistics. We also report results on Classification Accuracy Score (CAS), which was proposed by Ravuri and Vinyals (2019) due to their findings that non-GAN models may score poorly on FID and IS despite generating visually appealing samples and that FID and IS are not correlated (sometimes anti-correlated) with performance on downstream tasks.

Table 1(a) reports the main results on the cascaded diffusion model (CDM), for the 64×\times64, 128×\times128, and 256×\times256 ImageNet dataset resolutions, along with baselines. CDM outperforms BigGAN-deep in terms of FID score on the image resolutions considered, but GANs perform better in terms of Inception score when their truncation parameter is optimized for Inception score (Brock et al., 2019). We also outperform concurrently released diffusion models that do not use classifier guidance to boost sample quality scores (Dhariwal and Nichol, 2021). See Fig. 8 for a qualitative assessment of sample quality and diversity compared to VQ-VAE-2 (Razavi et al., 2019) and BigGAN-deep (Brock et al., 2019), and see Figs. 5 and 6 for examples of generated images.

Table 1(b) reports the results on Classification Accuracy Score (CAS) (Ravuri and Vinyals, 2019) for our models at the 128×\times128 and 256×\times256 resolutions. We find that CDM outperforms VQ-VAE-2 and BigGAN-deep at both resolutions by a significant margin on the CAS metric, suggesting better potential performance on downstream tasks. Figure 7 compares class-wise classification accuracy scores between classifiers trained on real training data, and CDM samples. The CDM classifier outperforms real data on 96 classes compared to 6 and 31 classes by BigGAN-deep and VQ-VAE-2 respectively. We also show samples from classes with best and worst accuracy scores in Appendix Figure 11 and 12.

Our cascading pipelines are structured as a 32×\times32 base model, a 32×\times32\rightarrow64×\times64 super-resolution model, followed by 64×\times64\rightarrow128×\times128 or 64×\times64\rightarrow256×\times256 super-resolution models. Models at 32×\times32 and 64×\times64 resolutions use 4000 diffusion timesteps and architectures similar to DDPM (Ho et al., 2020) and Improved DDPM (Nichol and Dhariwal, 2021). Models at 128×\times128 and 256×\times256 resolutions use 100 sampling steps, determined by post-training hyperparameter search (Section 4.4), and they use architectures similar to SR3 (Saharia et al., 2021). All base resolution and super-resolution models are conditioned on class labels. See Section B for details.

2 Baseline Model Improvements

To set a strong baseline for class-conditional ImageNet generation at the 64×\times64 resolution, we reproduced and improved upon a 4000 timestep non-cascaded 64×\times64 class-conditional diffusion model from Improved DDPM (Nichol and Dhariwal, 2021). Our reimplementation used dropout and was trained longer than reported by Nichol and Dhariwal; we found that adding dropout generally slowed down convergence of FID and Inception scores, but improved their best values over the course of a longer training period. We further improved the training set FID score and Inception score by adding noise to the trained model’s samples using the forward process to the 2000 timestep point, then restarting the reverse process from that point. See Table 2(a) for the resulting sample quality metrics.

3 Conditioning Augmentation Experiments up to 64×\times64

Building on our reimplementation in Section 4.2, we verify in a small scale experiment that cascading improves sample quality at the 64×\times64 resolution. We train a two-stage cascading pipeline that comprises a 16×\times16 base model and a 16×\times16\rightarrow64×\times64 super-resolution model. The super-resolution model architecture is identical to the best 64×\times64 non-cascaded baseline model in Section 4.2, except for the trivial modification of adding in the low resolution image conditioning information by channelwise concatenation at the input (see Section 2).

See Table 2(b) and Fig. 9 for the results of this 16×\times16\rightarrow64×\times64 cascading pipeline. Interestingly, we find that without conditioning augmentation, the cascading pipeline attains lower sample quality than the non-cascaded baseline 64×\times64 model; the FID score, for example, degrades from 2.35 to 6.02. With sufficient conditioning augmentation, however, the sample quality of the cascading pipeline becomes better than the non-cascaded baseline. We train two super-resolution models with non-truncated conditioning augmentation, one at truncation time s=101s=101 and another at s=1001s=1001 (we could have amortized both into a single model, but we chose not to do so in this experiment to prevent potential model capacity issues from confounding the results). The first model achieves better sample quality than the non-augmented model but is still worse than the non-cascaded baseline. The second model achieves a FID score of 2.13, outperforming the non-cascaded baseline. Conditioning augmentation is therefore crucial to improve sample quality in this particular cascading pipeline.

To further improve sample quality at the 64×\times64 resolution, we found it helpful to increase model sizes and to switch to a cascading pipeline starting with a 32×\times32 base resolution model. We train a 32×\times32 base model applying random left-right flips, which we found to help 32×\times32 scores at the expense of longer training times. Training without random flips, the best 32×\times32 resolution FID score is 1.25 at 300k training steps, while training with random flips it is 1.11 at 700k training steps. The 32×\times32\rightarrow64×\times64 super-resolution model is now amortized over the truncation time ss by providing ss as an extra time embedding input to the network (Section 2), allowing us to perform a more fine grained search over ss without retraining the model.

Table 3(a) displays the resulting sample quality scores for both truncated and non-truncated augmentation. The sample quality metrics improve and then degrade non-monotonically as the truncation time is increased. This indicates that moderate amounts of conditioning augmentation are beneficial to sample quality of the cascading pipeline, but too much conditioning augmentation causes the super-resolution model to behave as a non-conditioned model unable to benefit from cascading. For comparison, Table 3(b) shows sample quality when the super-resolution model is conditioned on ground truth data instead of generated data. Here, sample quality monotonically degrades as truncation time is increased. Conditioning augmentation is therefore useful precisely when conditioning on generated samples, so as a technique it is uniquely suited to cascading pipelines.

Based on these findings on non-monotonicity of sample quality with respect to truncation time, we conclude that conditioning augmentation works because it alleviates compounding error from a train-test mismatch for the super-resolution model. This occurs when low-resolution model samples are out of distribution compared to the ground truth data on which the super-resolution model is trained. A sufficient amount of Gaussian conditioning augmentation prevents the super-resolution model from attempting to upsample erroneous, out-of-distribution details in the low resolution generated samples. In contrast, sample quality degrades monotonically with respect to truncation time when conditioning the super-resolution model on ground truth data, because there is no such train-test mismatch.

Table 3(a) additionally shows that truncated and non-truncated conditioning augmentation are approximately equally effective at improving sample quality of the cascading pipeline, albeit at different values of the truncation time parameter. Thus we generally recommend non-truncated augmentation due to its practical benefits described in Section 3.3.

4 Experiments at 128×\times128 and 256×\times256

While we found Gaussian noise augmentation to be a key ingredient to boost the performance of our cascaded models at low resolutions, our initial experiments with similar augmentations for 128×\times128 and 256×\times256 upsampling yielded negative results. Hence, we explore Gaussian blurring augmentation for these resolutions. As mentioned in Section 3.1, we apply the blurring augmentation 50% of the time during training, and use no blurring during inference. We explored other settings (e.g. applying blurring to all training examples, and using varying amounts of blurring during inference), but found this to be most effective in our initial experiments.

Table 4(a) shows the results of applying Gaussian blur augmentation to the 64×\times64 \rightarrow 256×\times256 super-resolution model. While any amount of blurring helps improve the scores of the 256×\times256 samples over the baseline model with no blur, we found that sampling σU(0.4,0.6)\sigma\sim\mathcal{U}(0.4,0.6) gives the best results. Table 4(b) shows further improvements from class conditioning, large batch training, and random flip augmentation for the super-resolution model. While we find class conditioning helpful for upsampling at low resolution settings, it is interesting that it still gives a huge boost to the upsampling performance at high resolutions even when the low resolution inputs at 64×\times64 can be sufficiently informative. We also found increasing the training batch size from 256 to 1024 further improved performance by a significant margin. We also obtain marginal improvements by training the super-resolution model on randomly flipped data.

Since the sampling cost increases quadratically with the target image resolution, we attempt to minimize the number of denoising iterations for our 64×\times64 \rightarrow 256×\times256 and 64×\times64 \rightarrow 128×\times128 super-resolution models. To this end, we train these super-resolution models with continuous noise conditioning, like Saharia et al. (2021) and Chen et al. (2021), and tune the noise schedule for a given number of steps during inference. This tuning is relatively inexpensive as we do not need to retrain the models. We report all results using 100 inference steps for these models. Figure 10 shows FID vs number of inference steps for our 64×\times64 \rightarrow 256×\times256 model. The FID score deteriorates marginally even when using just 4 inference steps. Interestingly, we do not observe any concrete improvement in FID by increasing the number of inference steps from 100 to 1000.

5 Experiments on LSUN

While the main results of this work are on class-conditional ImageNet generation, here we study the effectiveness of non-truncated conditioning augmentation for a 64×\times64\rightarrow128×\times128 cascading pipeline on the LSUN Bedroom and Church datasets (Yu et al., 2015) in order to verify that conditioning augmentation is not an ImageNet-specific method. LSUN Bedroom and Church are two separate unconditional datasets that do not have any class labels, so our study here additionally verifies the effectiveness of conditioning augmentation for unconditional generation.

Table 5 displays our LSUN sample quality results, which confirm that a nonzero amount of conditioning augmentation is beneficial to sample quality. (The relatively large FID scores between generated examples and the validation sets are explained by the fact that the LSUN Church and Bedroom validation sets are extremely small, consisting of only 300 examples each.) We observe a similar effect as our ImageNet results in Table 3(b): because the super-resolution model is conditioned on base model samples, the sample quality improves then degrades non-monotonically as the truncation time ss is increased. See Section A for examples of images generated by our LSUN models.

Related Work

One way to formulate cascaded diffusion models is to modify the original diffusion formalism of a forward process q(x0:T)q(\mathbf{x}_{0:T}) at single resolution so that the transition q(xtxt1)q(\mathbf{x}_{t}|\mathbf{x}_{t-1}) performs downsampling at certain intermediate timesteps, for example at tS{T/4,2T/4,3T/4}t\in S\coloneqq\{T/4,2T/4,3T/4\}. The reverse process would then be required to perform upsampling at those timesteps, similar to our cascaded models here. However, there is no guarantee that the reverse transitions at the timesteps in SS are conditional Gaussian, unlike the guarantee for reverse transitions at other timesteps for sufficiently slow diffusion. By contrast, our cascaded diffusion model construction dedicates entire conditional diffusion models for these upsampling steps, so it is specified more flexibly.

Recent interest in diffusion models (Sohl-Dickstein et al., 2015) started with work connecting diffusion models to denoising score matching over multiple noise scales (Ho et al., 2020; Song and Ermon, 2019). There have been a number of improvements and alternatives proposed to the diffusion framework, for example generalization to continuous time (Song et al., 2021b), deterministic sampling (Song et al., 2021a), adversarial training (Jolicoeur-Martineau et al., 2021), and others (Gao et al., 2021). For simplicity, we base our models on DDPM (Ho et al., 2020) with modifications from Improved DDPM (Nichol and Dhariwal, 2021) to stay close to the original diffusion framework.

Cascading pipelines have been investigated in work on VQ-VAEs (van den Oord et al., 2016c; Razavi et al., 2019) and autoregressive models (Menick and Kalchbrenner, 2019). Cascading pipelines have also been investigated for diffusion models, such as SR3 (Saharia et al., 2021), Improved DDPM (Nichol and Dhariwal, 2021), and concurrently in ADM (Dhariwal and Nichol, 2021). Our work here focuses on improving cascaded diffusion models for ImageNet generation and is distinguished by the extensive study on conditioning augmentation and deeper cascading pipelines. Our conditioning augmentation work also resembles scheduled sampling in autoregressive sequence generation (Bengio et al., 2015), where noise is used to alleviate the mismatch between train and inference conditions.

Concurrent work (Dhariwal and Nichol, 2021) showed that diffusion models are capable of generating high quality ImageNet samples using an improved architecture, named ADM, and a classifier guidance technique in which a class-conditional diffusion model sampler is modified to simultaneously take gradient steps to maximize the score of an extra trained image classifier. By contrast, our work focuses solely on improving sample quality by cascading, so we avoid introducing extra model elements such as the image classifier. We are interested in avoiding classifier guidance because the FID and Inception score sample quality metrics that we use to evaluate our models are themselves computed on activations of an image classifier trained on ImageNet, and therefore classifier guidance runs the risk of cheating these metrics.

Avoiding classifier guidance comes at the expense of using thousands of diffusion timesteps in our low resolution models, where ADM uses hundreds. ADM with classifier guidance outperforms our models in terms of FID and Inception scores, while our models outperform ADM without classifier guidance as reported by Dhariwal and Nichol. Our work is a showcase of the effectiveness of cascading alone in a pure generative model, and since classifier guidance and cascading complement each other as techniques to improve sample quality and can be applied together, we expect classifier guidance would improve our results too.

Conclusion

We have shown that cascaded diffusion models are capable of outperforming state-of-the-art generative models on the ImageNet class-conditional generation benchmark when paired with conditioning augmentation, our technique of introducing data augmentation into the conditioning information of super-resolution models. Our models outperform BigGAN-deep and VQ-VAE-2 as measured by FID score and classification accuracy score. We found that conditioning augmentation helps sample quality because it combats compounding error in cascading pipelines due to train-test mismatch in super-resolution models, and we proposed practical methods to train and test models amortized over varying levels of conditioning augmentation.

Although there could be negative impact of our work in the form of malicious uses of image generation, our work has the potential to improve beneficial downstream applications such as data compression while advancing the state of knowledge in fundamental machine learning problems. We see our results as a conceptual study of the image synthesis capabilities of diffusion models in their original form with minimal extra techniques, and we hope our work serves as inspiration for future advances in the capabilities of diffusion models.

We thank Jascha Sohl-Dickstein, Douglas Eck and the Google Brain team for feedback, research discussions and technical assistance.

A Samples

B Hyperparameters

Here we give the hyperparameters of the models in our ImageNet cascading pipelines. Each model in the pipeline is described by its diffusion process, its neural network architecture, and its training hyperparameters. Architecture hyperparameters, such as the base channel count and the list of channel multipliers per resolution, refer to hyperparameters of the U-Net in DDPM and related models (Ho et al., 2020; Nichol and Dhariwal, 2021; Saharia et al., 2021; Salimans et al., 2017). The cosine noise schedule and the hybrid loss method of learning reverse process variances are from Improved DDPM (Nichol and Dhariwal, 2021). Some models are conditioned on αˉt\bar{\alpha}_{t} for post-training sampler tuning (Chen et al., 2021; Saharia et al., 2021).

• Architecture – Base channels: 256 – Channel multipliers: 1, 2, 3, 4 – Residual blocks per resolution: 6 – Attention resolutions: 8, 16 – Attention heads: 4 • Training – Optimizer: Adam – Batch size: 2048 – Learning rate: 1e-4 – Steps: 700000 – Dropout: 0.1 – EMA: 0.9999 – Hardware: 256 TPU-v3 cores • Diffusion – Timesteps: 4000 – Noise schedule: cosine – Learned variances: yes – Loss: hybrid

×\times32→→\rightarrow64×\times64 super-resolution

• Architecture – Base channels: 256 – Channel multipliers: 1, 2, 3, 4 – Residual blocks per resolution: 5 – Attention resolutions: 8, 16 – Attention heads: 4 • Training – Optimizer: Adam – Batch size: 2048 – Learning rate: 1e-4 – Steps: 400000 – Dropout: 0.1 – EMA: 0.9999 – Hardware: 256 TPU-v3 cores • Diffusion – Timesteps: 4000 – Noise schedule: cosine – Learned variances: yes – Loss: hybrid

×\times64→→\rightarrow128×\times128 super-resolution

• Architecture – Base channels: 128 – Channel multipliers: 1, 2, 4, 8, 8 – Residual blocks per resolution: 3 – Attention resolutions: 16 – Attention heads: 1 • Training – Optimizer: Adam – Batch size: 1024 – Learning rate: 1e-4 – Steps: 500000 – Dropout: 0.0 – EMA: 0.9999 – Hardware: 128 TPU-v3 cores • Diffusion (Training) – Timesteps: 2000 – Noise schedule: linear – Learned variances: no – Loss: simple – Continuous noise conditioning • Diffusion (Inference) – Timesteps: 100 – Noise schedule: linear

×\times64→→\rightarrow256×\times256 super-resolution

• Architecture – Base channels: 128 – Channel multipliers: 1, 2, 4, 4, 8, 8 – Residual blocks per resolution: 3 – Attention resolutions: 16 – Attention heads: 1 • Training – Optimizer: Adam – Batch size: 1024 – Learning rate: 1e-4 – Steps: 500000 – Dropout: 0.0 – EMA: 0.9999 – Hardware: 128 TPU-v3 cores • Diffusion (Training) – Timesteps: 2000 – Noise schedule: linear – Learned variances: no – Loss: simple – Continuous noise conditioning • Diffusion (Inference) – Timesteps: 100 – Noise schedule: linear

B.2 LSUN

Here we give the hyperparameters of our LSUN Bedroom and Church pipelines. We used the same hyperparameters for both datasets.

• Architecture – Base channels: 128 – Channel multipliers: 1, 2, 3, 4 – Residual blocks per resolution: 3 – Attention resolutions: 8, 16, 32 – Attention heads dimension: 64 • Training – Optimizer: Adam – Batch size: 2048 – Learning rate: 3e-4 – Steps: 100000 – Dropout: 0.1 – EMA: 0.9999 – Hardware: 64 TPU-v3 cores • Diffusion (Training) – Noise schedule: cosine – Learned variances: no – Loss: simple – Continuous noise conditioning • Diffusion (Inference) – Timesteps: 256 – Noise schedule: cosine

×\times64→→\rightarrow128×\times128 super-resolution

• Architecture – Base channels: 64 – Channel multipliers: 1, 2, 4, 6, 8 – Residual blocks per resolution: 3 – Attention resolutions: 8, 16, 32 – Attention heads dimension: 64 • Training – Optimizer: Adam – Batch size: 1024 – Learning rate: 2e-4 – Steps: 220000 – Dropout: 0.1 – EMA: 0.9999 – Hardware: 64 TPU-v3 cores • Diffusion (Training) – Noise schedule: cosine – Learned variances: no – Loss: simple – Continuous noise conditioning • Diffusion (Inference) – Timesteps: 256 – Noise schedule: cosine

References