Denoising Diffusion Restoration Models

Bahjat Kawar, Michael Elad, Stefano Ermon, Jiaming Song

Introduction

Many problems in image processing, including super-resolution , deblurring , inpainting , colorization , and compressive sensing , are instances of linear inverse problems, where the goal is to recover an image from potentially noisy measurements given through a known linear degradation model. For a specific degradation model, image restoration can be addressed through end-to-end supervised training of neural networks, using pairs of original and degraded images . However, real-world applications such as medical imaging often require flexibility to cope with multiple, possibly infinite, degradation models . Here, unsupervised approaches based on learned priors , where the degradation model is only known and used during inference, may be more desirable since they can adapt to the given problem without re-training . By learning sound assumptions over the underlying structure of images (e.g., priors, proximal operators or denoisers), unsupervised approaches can achieve effective restoration without training on specific degradation models .

Under this unsupervised setting, priors based on deep neural networks have demonstrated impressive empirical results in various image restoration tasks . To recover the signal, most existing methods obtain a prior-related term over the signal from a neural network (e.g., the distribution of natural images), and a likelihood term from the degradation model. They combine the two terms to form a posterior over the signal, and the inverse problem can be posed as solving an optimization problem (e.g., maximum a posteriori ) or solving a sampling problem (e.g., posterior sampling ). Then, these problems are often solved with iterative methods, such as gradient descent or Langevin dynamics, which may be demanding in computation and sensitive to hyperparameter tuning. An extreme example is found in where a “fast” version of the algorithm uses 15,00015,000 neural function evaluations (NFEs).

Inspired by this unsupervised line of work, we introduce an efficient approach named Denoising Diffusion Restoration Models (DDRM), that can achieve competitive results in as low as 2020 NFEs. DDRM is a denoising diffusion generative model that gradually and stochastically denoises a sample to the desired output, conditioned on the measurements and the inverse problem. This way we introduce a variational inference objective for learning the posterior distribution of the inverse problem at hand. We then show its equivalence to the objective of an unconditional denoising diffusion generative model , which enables us to deploy such models in DDRM for various linear inverse problems (see Figure 2). To our best knowledge, DDRM is the first general sampling-based inverse problem solver that can efficiently produce a range of high-quality, diverse, yet valid solutions for general content images.

We demonstrate the empirical effectiveness of DDRM by comparing with various competitive methods based on learned priors, such as Deep Generative Prior (DGP) , SNIPS , and Regularization by Denoising (RED) . On ImageNet examples, DDRM mostly outperforms the neural network baselines under noiseless super-resolution and deblurring measured in PSNR and KID , and is at least 50×50\times more efficient in terms of NFEs when it is second-best. Our advantage becomes even larger when measurement noise is involved, as noisy artifacts produced by iterative methods do not appear in our case. Over various real-world images, we further show DDRM results on super-resolution, deblurring, inpainting and colorization (see Figure 1). A DDRM trained on ImageNet also works on images that are out of its training set distribution (see Figure 6).

Background

A general linear inverse problem is posed as

Denoising Diffusion Probabilistic Models.

After drawing x0:T{\mathbf{x}}_{0:T}, only x0{\mathbf{x}}_{0} is kept as the sample of the generative model. To train a diffusion model, a fixed, factorized variational inference distribution is introduced:

which leads to an evidence lower bound (ELBO) on the maximum likelihood objective . A special property of some diffusion models is that both pθ(t)p_{\theta}^{(t)} and q(t)q^{(t)} are chosen as conditional Gaussian distributions for all t<Tt<T, and that q(xt∣x0)q({\mathbf{x}}_{t}|{\mathbf{x}}_{0}) is also a Gaussian with known mean and covariance, i.e., xt{\mathbf{x}}_{t} can be treated as x0{\mathbf{x}}_{0} directly corrupted with Gaussian noise. Thus, the ELBO objective can be reduced into the following denoising autoencoder objective (please refer to for derivations):

where fθ(t)f^{(t)}_{\theta} is a θ\theta-parameterized neural network that aims to recover a noiseless observation from a noisy xt{\mathbf{x}}_{t}, and γ1:T\gamma_{1:T} are a set of positive coefficients that depend on q(x1:T∣x0)q({\mathbf{x}}_{1:T}|{\mathbf{x}}_{0}).

Denoising Diffusion Restoration Models

Inverse problem solvers based on posterior sampling often face a dilemma: unsupervised approaches apply to general problems but are inefficient, whereas supervised ones are efficient but can only address specific problems.

To solve this dilemma, we introduce Denoising Diffusion Restoration Models (DDRM), an unsupervised solver for general linear inverse problems, capable of handling such tasks with or without noise in the measurements. DDRM is efficient and exhibits competitive performance compared to popular unsupervised solvers .

The key idea behind DDRM is to find an unsupervised solution that also suits supervised learning objectives. First, we describe the variational objective for DDRM over a specific inverse problem (Section 3.1). Next, we introduce specific forms of DDRM that are suitable for linear inverse problems and allow pre-trained unconditional and class-conditional diffusion models to be used directly (Sections 3.2, 3.3). Finally, we discuss practical algorithms that are compute and memory efficient (Sections 3.4, 3.5).

For any linear inverse problem, we define DDRM as a Markov chain xT→xT−1→…→x1→x0{{\mathbf{x}}_{T}\to{\mathbf{x}}_{T-1}\to\ldots\to{\mathbf{x}}_{1}\to{\mathbf{x}}_{0}} conditioned on y{\mathbf{y}}, where

and x0{\mathbf{x}}_{0} is the final diffusion output. In order to perform inference, we consider the following factorized variational distribution conditioned on y{\mathbf{y}}:

leading to an ELBO objective for diffusion models conditioned on y{\mathbf{y}} (details in Appendix A).

In the remainder of the section, we construct suitable variational problems given H{\bm{H}} and σy\sigma_{{\mathbf{y}}} and connect them to unconditional diffusion generative models. To simplify notations, we will construct the variational distribution qq such that q(xt∣x0)=N(x0,σt2I)q({\mathbf{x}}_{t}|{\mathbf{x}}_{0})={\mathcal{N}}({\mathbf{x}}_{0},\sigma_{t}^{2}{\bm{I}}) for noise levels 0=σ0<σ1<σ2<…<σT0=\sigma_{0}<\sigma_{1}<\sigma_{2}<\ldots<\sigma_{T}.This is called “Variance Exploding” in . In Appendix B, we will show that this is equivalent to the distribution introduced in DDPM and DDIM ,This is called “Variance Preserving” in . up to fixed linear transformations over xt{\mathbf{x}}_{t}.

2 A Diffusion Process for Image Restoration

We use the shorthand notations for values in the spectral space: xˉt(i)\bar{{\mathbf{x}}}_{t}^{(i)} is the ii-th index of the vector xˉt=V⊤xt\bar{{\mathbf{x}}}_{t}={\bm{V}}^{\top}{\mathbf{x}}_{t}, and yˉ(i)\bar{{\mathbf{y}}}^{(i)} is the ii-th index of the vector yˉ=Σ†U⊤y\bar{{\mathbf{y}}}={\bm{\Sigma}}^{\dagger}{\bm{U}}^{\top}{\mathbf{y}} (where †\dagger denotes the Moore–Penrose pseudo-inverse). Because V{\bm{V}} is an orthogonal matrix, we can recover xt{\mathbf{x}}_{t} from xˉt\bar{{\mathbf{x}}}_{t} exactly by left multiplying V{\bm{V}}. For each index ii in xˉt\bar{{\mathbf{x}}}_{t}, we define the variational distribution as:

where η∈(0,1]\eta\in(0,1] is a hyperparameter controlling the variance of the transitions, and η\eta and ηb\eta_{b} may depend on σt,si,σy\sigma_{t},s_{i},\sigma_{{\mathbf{y}}}. We further assume that σT≥σy/si\sigma_{T}\geq\sigma_{{\mathbf{y}}}/s_{i} for all positive sis_{i}.This assumption is fair, as we can set a sufficiently large σT\sigma_{T}.

In the following statement, we show that this construction has the “Gaussian marginals” property similar to the inference distribution used in unconditional diffusion models .

The conditional distributions q(t)q^{(t)} defined in Equations 4 and 5 satisfy the following:

defined by marginalizing over xt′{\mathbf{x}}_{t^{\prime}} (for all t′>tt^{\prime}>t) and y{\mathbf{y}}, where q(y∣x0)q({\mathbf{y}}|{\mathbf{x}}_{0}) is defined as in Equation 1 with x=x0{\mathbf{x}}={\mathbf{x}}_{0}.

We place the proof in Appendix C. Intuitively, our construction considers different cases for each index of the spectral space. (i) If the corresponding singular value is zero, then y{\mathbf{y}} does not directly provide any information to that index, and the update is similar to regular unconditional generation. (ii) If the singular value is non-zero, then the updates consider the information provided by y{\mathbf{y}}, which further depends on whether the measurements’ noise level in the spectral space (σy/si\sigma_{{\mathbf{y}}}/s_{i}) is larger than the noise level in the diffusion model (σt\sigma_{t}) or not; the measurements in the spectral space yˉ(i)\bar{{\mathbf{y}}}^{(i)} are then scaled differently for these two cases in order to ensure Proposition 3.1 holds.

We define DDRM with trainable parameters θ\theta as follows:

Compared to q(t)q^{(t)} in Equations 4 and 5, our definition of pθ(t)p_{\theta}^{(t)} merely replaces xˉ0(i)\bar{{\mathbf{x}}}_{0}^{(i)} (which we do not know at sampling) with {\color[rgb]{.5,0,.5}\definecolor[named]{pgfstrokecolor}{rgb}{.5,0,.5}\bar{{\mathbf{x}}}_{\theta,t}^{(i)}} (which depends on our predicted {\color[rgb]{.5,0,.5}\definecolor[named]{pgfstrokecolor}{rgb}{.5,0,.5}{\mathbf{x}}_{\theta,t}}) when t<Tt<T, and replaces xˉ0(i)\bar{{\mathbf{x}}}_{0}^{(i)} with when t=Tt=T. It is possible to learn the variances or consider alternative constructions where Proposition 3.1 holds; we leave these options as future work.

3 “Learning” Image Restoration Models

Once we have defined pθ(t)p_{\theta}^{(t)} and q(t)q^{(t)} by choosing σ1:T\sigma_{1:T}, η\eta and ηb\eta_{b}, we can learn model parameters θ\theta by maximizing the resulting ELBO objective (in Appendix A). However, this approach is not desirable since we have to learn a different model for each inverse problem (given H{\bm{H}} and σy\sigma_{{\mathbf{y}}}), which is not flexible enough for arbitrary inverse problems. Fortunately, this does not have to be the case. In the following statement, we show that an optimal solution to DDPM / DDIM can also be an optimal solution to a DDRM problem, under reasonable assumptions used in prior work .

Assume that the models fθ(t)f_{\theta}^{(t)} and fθ(t′)f_{\theta}^{(t^{\prime})} do not have weight sharing whenever t≠t′t\neq t^{\prime}, then when η=1\eta=1 and ηb=2σt2σt2+σy2/si2\eta_{b}=\frac{2\sigma_{t}^{2}}{\sigma_{t}^{2}+\sigma_{{\mathbf{y}}}^{2}/s_{i}^{2}}, the ELBO objective of DDRM (details in Appendix A) can be rewritten in the form of the DDPM / DDIM objective in Equation 2.

Even for different choices of η\eta and ηb\eta_{b}, the proof shows that the DDRM objective is a weighted sum-of-squares error in the spectral space, and thus pre-trained DDPM models are good approximations to the optimal solution. Therefore, we can apply the same diffusion model (unconditioned on the inverse problem) using the updates in Equation 7 and Equation 8 and only modify H{\bm{H}} and its SVD (U{\bm{U}}, Σ{\bm{\Sigma}}, V{\bm{V}}) for various linear inverse problems.

4 Accelerated Algorithms for DDRM

Typical diffusion models are trained with many timesteps (e.g., 1000) to achieve optimal unconditional image synthesis quality, but sampling speed is slow as many NFEs are required. Previous works have accelerated this process by “skipping” steps with appropriate update rules. This is also true for DDRM, since we can obtain the denoising autoencoder objective in Equation 2 for any choice of increasing σ1:T\sigma_{1:T}. For a pre-trained diffusion model with T′T^{\prime} timesteps, we can choose σ1:T\sigma_{1:T} to be a subset of the T′T^{\prime} steps used in training.

5 Memory Efficient SVD

Our method, similar to SNIPS , utilizes the SVD of the degradation operator H{\bm{H}}. This constitutes a memory consumption bottleneck in both algorithms as well as other methods such as Plug and Play (PnP) , as storing the matrix V{\bm{V}} has a space complexity of Θ(n2)\Theta(n^{2}) for signals of size nn. By leveraging special properties of the matrices H{\bm{H}} used, we can reduce this complexity to Θ(n)\Theta(n) for denoising, inpainting, super resolution, deblurring, and colorization (details in Appendix D).

Related Work

Various deep learning solutions have been suggested for solving inverse problems under different settings (see a detailed survey in ). We focus on the unsupervised setting, where we have access to a dataset of clean images at training time, but the degradation model is known only at inference time. This setup is inherently general to all linear inverse problems, a property desired in many real-world applications such as medical imaging .

Almost all unsupervised inverse problem solvers utilize a trained neural network in an iterative scheme. PnP, RED, and their successors apply a denoiser as part of an iterative optimization algorithm such as steepest descent, fixed-point, or alternating direction method of multipliers (ADMM). OneNet trained a network to directly learn the proximal operator of ADMM. A similar use of denoisers in different iterative algorithms is proposed in . The authors of leverages robust classifiers learned with additional class labels.

Another approach is to search the latent space of a generative model for a generated image that, when degraded, is as close as possible to the given measurements. Multiple such methods were suggested, mainly focusing on generative adversarial networks (GANs) . While they exhibit impressive results on images of a specific class, most notably face images, these methods are not shown to be largely successful under a more diverse dataset such as ImageNet . Deep Generative Prior (DGP) mitigates this issue by optimizing the latent input as well as the weights of the GAN’s generator .

More recently, denoising diffusion models were used to solve inverse problems in both supervised (i.e., degradation model is known during training) and unsupervised settings . Unlike previous approaches, most diffusion-based methods can successfully recover images from measurements with significant noise. However, these methods are very slow, often requiring hundreds or thousands of iterations, and are yet to be proven on diverse datasets. Our method, motivated by variational inference, obtains problem-specific, non-equilibrium update rules that lead to high-quality solutions in much fewer iterations.

ILVR suggests a diffusion-based method that handles noiseless super-resolution, and can run in 250250 steps. In Appendix H, we prove that when applied on the same underlying generative diffusion model, ILVR is a special case of DDRM. Therefore, ILVR can be further accelerated to run in 2020 steps, but unlike DDRM, it provides no clear way of handling noise in the measurements. Similarly, the authors of suggest a score-based solver for inverse problems that can converge in a small number of iterations, but does not handle noise in the measurements.

Experiments

We demonstrate our algorithm’s capabilities using the diffusion models from , which are trained on CelebA-HQ , LSUN bedrooms, and LSUN cats (all 256×256256\times 256 pixels). We test these models on images from FFHQ , and pictures from the internet of the considered LSUN category, respectively. In addition, we use the models from , trained on the training set of ImageNet 256×256256\times 256 and 512×512512\times 512, and tested on the corresponding validation set. Some of the ImageNet models require class information. For these models, we use the ground truth labels as input, and denote our algorithm as DDRM class conditional (DDRM-CC). In all experiments, we use η=0.85\eta=0.85, ηb=1\eta_{b}=1, and a uniformly-spaced timestep schedule based on the 1000-step pre-trained models (more details in Appendix E). The number of NFEs (timesteps) is reported in each experiment.

In each of the inverse problems we show, pixel values are in the range $,andthedegradedmeasurementsareobtainedasfollows:(i)forsuper−resolution,weuseablockaveragingfiltertodownscaletheimagesbyafactorof, and the degraded measurements are obtained as follows: (i) for super-resolution, we use a block averaging filter to downscale the images by a factor of2,,4,or, or8ineachaxis;(ii)fordeblurring,theimagesareblurredbyain each axis; (ii) for deblurring, the images are blurred by a9\times 9uniformkernel,andsingularvaluesbelowacertainthresholdarezeroed,makingtheproblemmoreill−posed.(iii)forcolorization,thegrayscaleimageisanaverageofthered,green,andbluechannelsoftheoriginalimage;(iv)andforinpainting,wemaskpartsoftheoriginalimagewithtextoverlayorrandomlydropuniform kernel, and singular values below a certain threshold are zeroed, making the problem more ill-posed. (iii) for colorization, the grayscale image is an average of the red, green, and blue channels of the original image; (iv) and for inpainting, we mask parts of the original image with text overlay or randomly drop50\%$ of the pixels. Additive white Gaussian noise can optionally be added to the measurements in all inverse problems. We additionally conduct experiments on bicubic super-resolution and deblurring with an anisotropic Gaussian kernel in Appendix I.

Our code is available at https://github.com/bahjat-kawar/ddrm.

2 Quantitative Experiments

In order to quantify DDRM’s performance, we focus on the ImageNet dataset (256×256256\times 256) for its diversity. For each experiment, we report the average peak signal-to-noise ratio (PSNR) and structural similarity index measure (SSIM) to measure faithfulness to the original image, and the kernel Inception distance (KID) , multiplied by 10310^{3}, to measure the resulting image quality.

We compare DDRM (with 2020 and 100100 steps) with other unsupervised methods that work in reasonable time (requiring 15001500 NFEs or less) and can operate on ImageNet. Namely, we compare with RED , DGP , and SNIPS . The exact setup of each method is detailed in Appendix F. We used the same hyperparameters for noisy and noiseless versions of the same problem for DGP, RED, and SNIPS, as tuning them for each version would compromise their unsupervised nature. Nevertheless, the performance of baselines like RED with such a tuning does not surpass that of DDRM, as we show in Appendix F. In addition, we show upscaling by bicubic interpolation as a baseline for super-resolution, and the blurry image itself as a baseline for deblurring. OneNet is not included in the comparisons as it is limited to images of size 64×6464\times 64, and generalization to higher dimensions requires an improved network architecture.

We evaluate all methods on the problems of 4×4\times super-resolution and deblurring, on one validation set image from each of the 10001000 ImageNet classes, following . Table 1 shows that DDRM outperforms all baseline methods, in all metrics, and on both problems with only 2020 steps. The only exception to this is that SNIPS achieves better KID than DDRM in noiseless deblurring, but it requires 50×50\times more NFEs to do so. Note that the runtime of all the tested methods is perfectly linear with NFEs, with negligible differences in time per iteration. DGP and DDRM-CC use ground-truth class labels for the test images to aid in the restoration process, and thus have an unfair advantage.

DDRM’s appeal compared to previous methods becomes more substantial when significant noise is added to the measurements. Under this setting, DGP, RED, and SNIPS all fail to produce viable results, as evident in Table 2 and Figure 4. Since DDRM is fast, we also evaluate it on the entire ImageNet validation set in Appendix F.

3 Qualitative Experiments

DDRM produces high quality reconstructions across all the tested datasets and problems, as can be seen in Figures 1 and 3, and in Appendix I. As it is a posterior sampling algorithm, DDRM can produce multiple outputs for the same input, as demonstrated in Figure 5. Moreover, the unconditional ImageNet diffusion models can be used to solve inverse problems on out-of-distribution images with general content. In Figure 6, we show DDRM successfully restoring 256×256256\times 256 images from USC-SIPI that do not necessarily belong to any ImageNet class (more results in Appendix I).

Conclusions

We have introduced DDRM, a general sampling-based linear inverse problem solver based on unconditional/class-conditional diffusion generative models as learned priors. Motivated by variational inference, DDRM only requires a few number of NFEs (e.g., 20) compared to other sampling-based baselines (e.g., 1000 for SNIPS) and achieves scalability in multiple useful scenarios, including denoising, super-resolution, deblurring, inpainting, and colorization. We demonstrate the empirical successes of DDRM on various problems and datasets, including general natural images outside the distribution of the observed training set. To our best knowledge, DDRM is the first unsupervised method that effectively and efficiently samples from the posterior distribution of inverse problems with significant noise, and can work on natural images with general content.

In terms of future work, apart from further optimizing the timestep and variance schedules, it would be interesting to investigate the following: (i) applying DDRM to non-linear inverse problems, (ii) addressing scenarios where the degradation operator is unknown, and (iii) self-supervised training techniques inspired by DDRM as well as ones used in supervised techniques that further improve performance of unsupervised models for image restoration.

Acknowledgements

We thank Kristy Choi, Charlie Marx, and Avital Shafran for insightful discussions and feedback. This research was supported by NSF (#1651565, #1522054, #1733686), ONR (N00014-19-1-2145), AFOSR (FA9550-19-1-0024), ARO (W911NF-21-1-0125), Sloan Fellowship, Amazon AWS, Stanford Institute for Human-Centered Artificial Intelligence (HAI), Google Cloud, the Israel Science Foundation (ISF) under Grant 335/18, the Israeli Council For Higher Education - Planning & Budgeting Committee, and the Stephen A. Kreynes Fellowship.

References

Appendix A Details of the DDRM ELBO objective

DDRM is a Markov chain conditioned on y{\mathbf{y}}, which would lead to the following ELBO objective :

where q(x0)q({\mathbf{x}}_{0}) is the data distribution, q(y∣x0)q({\mathbf{y}}|{\mathbf{x}}_{0}) follows Equation 1 in the main paper, the expectation on the right hand side is given by sampling x0∼q(x0){\mathbf{x}}_{0}\sim q({\mathbf{x}}_{0}), y∼q(y∣x0){\mathbf{y}}\sim q({\mathbf{y}}|{\mathbf{x}}_{0}), xT∼q(T)(xT∣x0,y){\mathbf{x}}_{T}\sim q^{(T)}({\mathbf{x}}_{T}|{\mathbf{x}}_{0},{\mathbf{y}}), and xt∼q(t)(xt∣xt+1,x0,y){\mathbf{x}}_{t}\sim q^{(t)}({\mathbf{x}}_{t}|{\mathbf{x}}_{t+1},{\mathbf{x}}_{0},{\mathbf{y}}) for t∈[1,T−1]t\in[1,T-1].

Appendix B Equivalence between “Variance Preserving” and “Variance Exploding” Diffusion Models

In our main paper, we describe our methods based on the “Variance Exploding” hyperparameters σt\sigma_{t}, where σt∈[0,∞)\sigma_{t}\in[0,\infty) and

In DDIM , the hyperparameters are “Variance Preserving” ones αt\alpha_{t}, where αt∈(0,1]\alpha_{t}\in(0,1] and

We use the colored notation {\color[rgb]{0,.5,.5}\definecolor[named]{pgfstrokecolor}{rgb}{0,.5,.5}{\mathbf{x}}_{t}} to emphasize that this is different from xt{\mathbf{x}}_{t} (an exception is {\color[rgb]{0,.5,.5}\definecolor[named]{pgfstrokecolor}{rgb}{0,.5,.5}{\mathbf{x}}_{0}}={\mathbf{x}}_{0}). Using the reparametrization trick, we have that:

where ϵ∼N(0,I)\epsilon\sim{\mathcal{N}}(0,{\bm{I}}). We can divide by 1+σt2\sqrt{1+\sigma_{t}^{2}} in both sides of Equation 13:

Let αt=1/(1+σt2)\alpha_{t}=1/(1+\sigma_{t}^{2}), and let {\color[rgb]{0,.5,.5}\definecolor[named]{pgfstrokecolor}{rgb}{0,.5,.5}{\mathbf{x}}_{t}}={\mathbf{x}}_{t}/\sqrt{1+\sigma_{t}^{2}}; then from Equation 15 we have that

which is equivalent to the “Variance Preserving” case. Therefore, we can use “Variance Preserving” models, such as DDPM, directly in our DDRM updates, even though the latter uses the “Variance Exploding” parametrization:

From {\color[rgb]{0,.5,.5}\definecolor[named]{pgfstrokecolor}{rgb}{0,.5,.5}{\mathbf{x}}_{t}}, obtain predictions ϵ\epsilon and {\mathbf{x}}_{t}={\color[rgb]{0,.5,.5}\definecolor[named]{pgfstrokecolor}{rgb}{0,.5,.5}{\mathbf{x}}_{t}}\sqrt{1+\sigma_{t}^{2}}.

From xt{\mathbf{x}}_{t} and ϵ\epsilon, apply DDRM updates to get xt−1{\mathbf{x}}_{t-1}.

From xt−1{\mathbf{x}}_{t-1}, get {\color[rgb]{0,.5,.5}\definecolor[named]{pgfstrokecolor}{rgb}{0,.5,.5}{\mathbf{x}}_{t-1}}={\mathbf{x}}_{t-1}/\sqrt{1+\sigma_{t-1}^{2}}.

Note that although the inference algorithms are shown to be equivalent, the choice between "Variance Preserving" and "Variance Exploding" may affect the training of diffusion networks.

Appendix C Proofs

The proof uses a basic property of Gaussian marginals (see for the complete version).

If p(z1∣z0)=N(z0,V1)p(z_{1}|z_{0})={\mathcal{N}}(z_{0},V_{1}), p(z2∣z1)=N(αz1,V2)p(z_{2}|z_{1})={\mathcal{N}}(\alpha z_{1},V_{2}), then p(z2∣z0)=N(αz0,α2V1+V2)p(z_{2}|z_{0})={\mathcal{N}}(\alpha z_{0},\alpha^{2}V_{1}+V_{2}).

If p(z1)=N(μ1,V1)p(z_{1})={\mathcal{N}}(\mu_{1},V_{1}) and p(z2)=N(μ2,V2)p(z_{2})={\mathcal{N}}(\mu_{2},V_{2}), then p(z1+z2)=N(μ1+μ2,V1+V2)p(z_{1}+z_{2})={\mathcal{N}}(\mu_{1}+\mu_{2},V_{1}+V_{2}).

First, we note that q(y∣x0)q({\mathbf{y}}|{\mathbf{x}}_{0}) is defined from Equation 1 in the main paper, and thus for all ii:

Case I For xT{\mathbf{x}}_{T}, it is obvious when si=0s_{i}=0. When si>0s_{i}>0, we have Equation 17 and that:

Case II For any t<Tt<T and ii such that si>0s_{i}>0 and σt>σy/si\sigma_{t}>\sigma_{{\mathbf{y}}}/s_{i}, we have Equation 17 and that:

and thus we can safely remove the dependence on xt+1{\mathbf{x}}_{t+1} via marginalization. q(t)(xˉt(i)∣x0)q^{(t)}(\bar{{\mathbf{x}}}_{t}^{(i)}|{\mathbf{x}}_{0}) is a Gaussian with the mean being (1−ηb)xˉ0(i)+ηbxˉ0(i)=xˉ0(i)(1-\eta_{b})\bar{{\mathbf{x}}}_{0}^{(i)}+\eta_{b}\bar{{\mathbf{x}}}_{0}^{(i)}=\bar{{\mathbf{x}}}_{0}^{(i)} and variance being

where we note that yˉ(i)\bar{{\mathbf{y}}}^{(i)} has a standard deviation of σy/si\sigma_{\mathbf{y}}/s_{i}.

Case III For any t<Tt<T and ii such that si>0s_{i}>0 and σt<σy/si\sigma_{t}<\sigma_{{\mathbf{y}}}/s_{i}, we have Equation 17, so (yˉ(i)−xˉ0(i))/(σy/si)(\bar{{\mathbf{y}}}^{(i)}-\bar{{\mathbf{x}}}_{0}^{(i)})/(\sigma_{{\mathbf{y}}}/s_{i}) is distributed as a standard Gaussian. Moreover, similar to Case II, q(t)(xˉt(i)∣x0)q^{(t)}(\bar{{\mathbf{x}}}_{t}^{(i)}|{\mathbf{x}}_{0}) is a Gaussian with its mean being

and its variance being η2σt2\eta^{2}\sigma_{t}^{2}, so q(t)(xˉt(i)∣x0)q^{(t)}(\bar{{\mathbf{x}}}_{t}^{(i)}|{\mathbf{x}}_{0}) is a Gaussian with a mean of xˉ0(i)\bar{{\mathbf{x}}}_{0}^{(i)} and a variance of

Case IV For any t≤Tt\leq T and ii such that si=0s_{i}=0 (where there is no dependence on y{\mathbf{y}}), we apply mathematical induction. The base case (t=Tt=T) is true, as we have shown earlier in Case I. In the step case (t<Tt<T), we have that q(t+1)(xˉt+1(i)∣x0)=N(xˉ0(i),σt+12)q^{(t+1)}(\bar{{\mathbf{x}}}_{t+1}^{(i)}|{\mathbf{x}}_{0})={\mathcal{N}}(\bar{{\mathbf{x}}}_{0}^{(i)},\sigma_{t+1}^{2}). Similar to Case II, q(t)(xˉt(i)∣x0)q^{(t)}(\bar{{\mathbf{x}}}_{t}^{(i)}|{\mathbf{x}}_{0}) is a Gaussian with its mean being

and variance being η2σt2\eta^{2}\sigma_{t}^{2}, which does not depend on y{\mathbf{y}}. Therefore, q(t)(xˉt(i)∣x0)q^{(t)}(\bar{{\mathbf{x}}}_{t}^{(i)}|{\mathbf{x}}_{0}) is also Gaussian, with a mean of xˉ0(i)\bar{{\mathbf{x}}}_{0}^{(i)} and a variance of

Hence, the proof is completed via the four cases. ∎

As there is no parameter sharing between models at different time steps tt, let us focus on any particular time step tt and rewrite the corresponding objective as a denoising autoencoder objective.

Case I For t>0t>0, the only term in Equation 10 that is related to fθ(t)f^{(t)}_{\theta} (which is used to make the prediction xθ,t{\mathbf{x}}_{\theta,t}) is:

where the first equality is from the orthogonality of V⊤{\bm{V}}^{\top} and the second equality is from the fact that both q(t)q^{(t)} and pθ(t)p_{\theta}^{(t)} over the spectral space are Gaussians with identical diagonal covariance matrices (so the KL divergence can factorize).

Here, we will use a simple property of the KL divergence between univariate Gaussians :

If p=N(μ1,V1)p={\mathcal{N}}(\mu_{1},V_{1}), q=N(μ2,V2)q={\mathcal{N}}(\mu_{2},V_{2}), then

Since we constructed pθ(t)p_{\theta}^{(t)} and q(t)q^{(t)} to have the same variance, Equation 20 is a total squared error with weights for each dimension of xˉt\bar{{\mathbf{x}}}_{t} (the spectral space), so the DDPM objective (which is a total squared error objective in the original space) is still a good approximation. In order to transform it into a denoising autoencoder objective (equivalent to DDPM), the weights have to be equal. Next, we will show that our construction of η=1\eta=1 and ηb=2σt2/(σt2+σy2/si2)\eta_{b}=2\sigma_{t}^{2}/(\sigma_{t}^{2}+\sigma_{\mathbf{y}}^{2}/s_{i}^{2}) satisfies this.

All the indices ii will fall into one of the three cases: si=0s_{i}=0, σt<σy/si\sigma_{t}<\sigma_{{\mathbf{y}}}/s_{i}, or σt>σy/si\sigma_{t}>\sigma_{{\mathbf{y}}}/s_{i}.

For si=0s_{i}=0, the KL divergence is \frac{({\color[rgb]{.5,0,.5}\definecolor[named]{pgfstrokecolor}{rgb}{.5,0,.5}\bar{{\mathbf{x}}}_{\theta,t}^{(i)}}-\bar{{\mathbf{x}}}_{0}^{(i)})^{2}}{2\sigma_{t}^{2}}, where we recall {\color[rgb]{.5,0,.5}\definecolor[named]{pgfstrokecolor}{rgb}{.5,0,.5}\bar{{\mathbf{x}}}_{\theta,t}}={\bm{V}}^{\top}f_{\theta}^{(t)}({\mathbf{x}}_{t+1}).

For σt<σysi\sigma_{t}<\frac{\sigma_{{\mathbf{y}}}}{s_{i}}, the KL divergence is also \frac{({\color[rgb]{.5,0,.5}\definecolor[named]{pgfstrokecolor}{rgb}{.5,0,.5}\bar{{\mathbf{x}}}_{\theta,t}^{(i)}}-\bar{{\mathbf{x}}}_{0}^{(i)})^{2}}{2\sigma_{t}^{2}}.

For σt≥σysi\sigma_{t}\geq\frac{\sigma_{{\mathbf{y}}}}{s_{i}}, we have defined ηb\eta_{b} as a solution to the following quadratic equation (the other solution is , which is irrelevant to our case since it does not make use of information from y{\mathbf{y}}):

Therefore, regardless of how the cases are distributed among indices, we will always have that:

Case II For t=0t=0, we will only have two cases (si=0s_{i}=0 or σt<σysi\sigma_{t}<\frac{\sigma_{{\mathbf{y}}}}{s_{i}}), and thus, similar to Case I,

as long as we have a constant variance for pθ(0)p_{\theta}^{(0)}. Thus, every individual term in Equation 10 can be written as a denoising autoencoder objective, completing the proof. ∎

Appendix D Memory Efficient SVD

Here we explain how we obtained the singular value decomposition (SVD) for different degradation models efficiently.

In denoising, the corrupted image is the original image with additive white Gaussian noise. Therefore, H=I{\bm{H}}={\bm{I}} and all the SVD elements of H{\bm{H}} are simply the identity matrix I{\bm{I}}, which in turns makes their multiplication by different vectors trivial.

D.2 Inpainting

In inpainting, H{\bm{H}} retains a known subset of size kk of the image’s pixels. This is equivalent to permuting the pixels such that the retained one are placed at the top, then keeping the first kk entries. Therefore,

where P{\bm{P}} is the appropriate permutation matrix, Σ{\bm{\Sigma}} is a rectangular diagonal matrix of size k×nk\times n with ones in its main diagonal, and I{\bm{I}} is the identity matrix. Since permutation matrices are orthogonal, Equation 23 is the SVD of H{\bm{H}}.

We can multiply a given vector by P{\bm{P}} and PT{\bm{P}}^{T} by storing the permutation itself rather than the matrix. Σ{\bm{\Sigma}} can multiply a vector by simply slicing it. Therefore, by storing the appropriate permutation and the number kk, we can apply each element of the SVD with Θ(n)\Theta(n) space complexity.

D.3 Super Resolution

For super resolution, we assume that the original image of size d×dd\times d (i.e. n=3d2n=3d^{2}) is downscaled using a block averaging filter by rr in each dimension, such that dd is divisible by rr. In this scenario, each pixel in the output image is the average of an r×rr\times r patch in the input image, and each such patch affects exactly one output pixel. Therefore, any output pixel is given by (Hx)i=kTpi({\bm{H}}{\mathbf{x}})_{i}={\bm{k}}^{T}{\bm{p}}_{i}, where k{\bm{k}} is a vector of size r2r^{2} with 1r2\frac{1}{r^{2}} in each entry, and pi{\bm{p}}_{i} is the vectorized ii-th r×rr\times r patch. More formally, if P1{\bm{P}}_{1} is a permutation matrix that reorders a vectorized image into patches, then

where ⊗\otimes is the Kronecker product, and I{\bm{I}} is the identity matrix of size dr×dr\frac{d}{r}\times\frac{d}{r}. In order to obtain the SVD of H{\bm{H}}, we calculate the SVD of kT{\bm{k}}^{T}:

Using properties of the Kronecker product, we observe

The Kronecker product of two orthogonal matrices is an orthogonal matrix. Therefore, I⊗Uk{\bm{I}}\otimes{\bm{U}}_{\bm{k}} and I⊗VkT{\bm{I}}\otimes{\bm{V}}_{\bm{k}}^{T} are orthogonal. Observe that the matrix I⊗Σk{\bm{I}}\otimes{\bm{\Sigma}}_{\bm{k}} has one non-zero value (1r2\frac{1}{r^{2}}) in each row. By applying a simple permutation on its columns, these values can be reordered to be on the main diagonal. We denote the appropriate permutation matrix by P2{\bm{P}}_{2}, and obtain

where U=I⊗Uk{\bm{U}}={\bm{I}}\otimes{\bm{U}}_{\bm{k}} is orthogonal, Σ=(I⊗Σk)P2T{\bm{\Sigma}}=\left({\bm{I}}\otimes{\bm{\Sigma}}_{\bm{k}}\right){\bm{P}}_{2}^{T} is a rectangular diagonal matrix with non-negative entries, and VT=P2(I⊗VkT)P1{\bm{V}}^{T}={\bm{P}}_{2}\left({\bm{I}}\otimes{\bm{V}}_{\bm{k}}^{T}\right){\bm{P}}_{1} is orthogonal. As such, Equation 25 is the SVD of H{\bm{H}}. By storing the permutations and the SVD elements of kT{\bm{k}}^{T}, we can simulate each element of the SVD of H{\bm{H}} with Θ(n)\Theta(n) space complexity, without directly calculating the Kronecker products with I{\bm{I}}.

D.4 Colorization

The grayscale image is obtained by averaging the red, green, and blue channels of each pixel. This means that every output pixel is given by (Hx)i=kTpi\left({\bm{H}}{\mathbf{x}}\right)_{i}={\bm{k}}^{T}{\bm{p}}_{i}, where kT=(131313){\bm{k}}^{T}=\begin{pmatrix}\frac{1}{3}&\frac{1}{3}&\frac{1}{3}\end{pmatrix} and pi{\bm{p}}_{i} is the 33-valued ii-th pixel of the original color image. The SVD of H{\bm{H}} is obtained exactly the same as in the super resolution case, with separate pixels replacing separate patches.

D.5 Deblurring

We focus on separable blurring, where the 22D blurring kernel is K=rcT{\bm{K}}={\bm{r}}{\bm{c}}^{T}, which means c{\bm{c}} is applied on the columns of the image, and rT{\bm{r}}^{T} is applied on its rows. The blurred image can be obtained by B=AcXArT{\bm{B}}={\bm{A}}_{c}{\bm{X}}{\bm{A}}_{r}^{T}, where Ac{\bm{A}}_{c} and Ar{\bm{A}}_{r} apply a 11D convolution with kernels c{\bm{c}} and r{\bm{r}}, respectively. Alternatively, b=Hx{\bm{b}}={\bm{H}}{\bm{x}}, where x{\bm{x}} is the vectorized image X{\bm{X}}, b{\bm{b}} is the vectorized blurred image B{\bm{B}}, and H{\bm{H}} is the matrix applying the 22D convolution K{\bm{K}}. It can be shown that H=Ar⊗Ac{\bm{H}}={\bm{A}}_{r}\otimes{\bm{A}}_{c}, where ⊗\otimes is the Kronecker product. In order to calculate the SVD of H{\bm{H}}, we calculate the SVD of Ar{\bm{A}}_{r} and Ac{\bm{A}}_{c}:

Using the properties of the Kronecker product, we observe

The Kronecker product preserves orthogonality. Therefore, Equation 26 is a valid SVD of H{\bm{H}}, with the exception of the singular values not being on the main diagonal, and not being sorted descendingly. We reorder the columns so that the singular values are on the main diagonal and denote the corresponding permutation matrix by P1{\bm{P}}_{1}. We also sort the values descendingly and denote the sorting permutation matrix by P2{\bm{P}}_{2}, and obtain the following SVD:

where U=(Ur⊗Uc)P2T{\bm{U}}=\left({\bm{U}}_{r}\otimes{\bm{U}}_{c}\right){\bm{P}}_{2}^{T}, Σ=P2(Σr⊗Σc)P1TP2T{\bm{\Sigma}}={\bm{P}}_{2}\left({\bm{\Sigma}}_{r}\otimes{\bm{\Sigma}}_{c}\right){\bm{P}}_{1}^{T}{\bm{P}}_{2}^{T}, and VT=P2P1(Vr⊗Vc)T{\bm{V}}^{T}={\bm{P}}_{2}{\bm{P}}_{1}\left({\bm{V}}_{r}\otimes{\bm{V}}_{c}\right)^{T}.

For every matrix of the form M=N⊗L{\bm{M}}={\bm{N}}\otimes{\bm{L}}, it holds that Mx{\bm{M}}x is the vectorized version of LXNT{\bm{L}}{\bm{X}}{\bm{N}}^{T}. By using this property and applying the relevant permutation, we can simulate multiplying a vector by U{\bm{U}}, V{\bm{V}}, UT{\bm{U}}^{T}, or VT{\bm{V}}^{T} without storing the full matrix. The space complexity of this approach is Θ(n)\Theta(n), which is required for computing the SVD of Ar{\bm{A}}_{r} and Ac{\bm{A}}_{c}, as well as storing the permutations.

The above calculations remain valid when the blurring is zero-padded, i.e., images are padded with zeroes so that the convolution is not circulant around the edges. We consider a zero-padded deblurring problem in our experiments. Note that the noiseless version of this problem has a simple solution – applying the pseudo-inverse of the blurring matrix on the blurry image. This solution attains 32.4132.41dB in PSNR on ImageNet-1K, while DDRM improves upon it and achieves 35.6435.64dB. When noise is added to the blurry image, such a simple solution amplifies the noise and fails to provide a valid output. Therefore, we opt not to report its results.

Furthermore, the above calculations are also applicable to blurring with strided convolutions. We use this fact in our implementation of the bicubic super resolution SVD, which can be interpreted as a strided convolution with a fixed kernel.

Appendix E Ablation Studies on Hyperparameters

Apart from the timestep schedules, DDRM has two hyperparameters η\eta and ηb\eta_{b}, which control the level of noise injected at each timestep. To identify an ideal combination, we perform a hyperparameter search over η,ηb∈{0.7,0.8,0.9,1.0}\eta,\eta_{b}\in\{0.7,0.8,0.9,1.0\} for the task of deblurring with σy=0.05\sigma_{y}=0.05 in 10001000 ImageNet validation images, using the model trained in . It is possible to also consider different η\eta values for si=0s_{i}=0 and σi<σy/si\sigma_{i}<\sigma_{\mathbf{y}}/s_{i}; we leave that as future work.

We report PSNR and KID results in Table 3. From the results, we observe that generally (i) as ηb\eta_{b} increases, PSNR increases while KID decreases, which is reasonable given that we wish to leverage the information from y{\mathbf{y}}; (ii) as η\eta increases, PSNR increases (except for η=1.0\eta=1.0) yet KID also increases, which presents a trade-off in reconstruction error and image quality (known as the perception-distortion trade-off ). Therefore, we choose ηb=1\eta_{b}=1 and η=0.85\eta=0.85 to balance performance on PSNR and KID when we report results.

Timestep schedules.

The timestep schedule has a direct impact on NFEs, as the wall-clock time is roughly linear with respect to NFEs . In Tables 5 and 6, we compare the PSNR, FID, and KID of DDRM with 20 or 100 timesteps (with or without conditioning) and default η=0.85\eta=0.85 and ηb=1\eta_{b}=1. We observe that DDRM with 20 or 100 timesteps have similar performance when other hyperparameters are identical, with DDRM (20) having a slight edge in FID and KID.

Appendix F Experimental Setup of DGP, RED, and SNIPS

Recall that we evaluated DGP , RED , and SNIPS on 256×256256\times 256 ImageNet 1K images, for the problems of 4×4\times super resolution and deblurring without any noise in the measurements. Below we expand on the experimental setup of each one.

For DGP , we use the same hyperparameters introduced in the original paper for MSE-biased super resolution. We note that the downscaling applied in DGP is different from the block averaging filter that we used, and the numbers they reported are on the 128×128128\times 128 resolution. Nevertheless, in our experiments, DGP achieved a PSNR of 23.0623.06 on ImageNet 1K 256×256256\times 256 block averaging 4×4\times super resolution, which is similar to the 23.3023.30 reported in the original work. When applied on the deblurring problem, we retained the same DGP hyperparameters as well.

For RED , we apply the iterative algorithm only in the luminance channel of the image in the YCbCr space, as done in the original paper for deblurring and super resolution. As for the denoising engine enabling the algorithm, we use the same diffusion model used in DDRM to enable as fair a comparison as possible. We use the last step of the diffusion model (equivalent to denoising with σ=0.005\sigma=0.005), as we found it to work best empirically. We also chose the steepest-descent version (RED-SD), and λ=500\lambda=500 for best PSNR performance given the denoiser we used. We also set σ0=0.01\sigma_{0}=0.01 when the measurements are noiseless, because σ0\sigma_{0} cannot be as RED divides by it.

In super resolution, RED is initialized with the bicubic upsampled low-res image. In deblurring, it is initialized with the blurry image. We then run RED on the ImageNet 1K for different numbers of steps (see Table 4), and choose the best PSNR for each problem. Namely, we show in our paper RED on super resolution with 100100 steps, and on deblurring with 500500 steps. Interestingly, RED achieves a PSNR close to its best for super resolution in just 2020 steps. However, DDRM (with 2020 steps) still outperforms RED in PSNR, with substantially better perceptual quality (see Table 1 in the main paper).

Another interesting plug-and-play image restoration method is DPIR , which has recently achieved impressive results. It does so by applying the well-known Half Quadratic Splitting (HQS) plug-and-play algorithm using a newly proposed architecture. HQS requires an analytical solution of a minimization problem which is infeasible in general, due to the high memory requirements. DPIR provides efficient solutions for the specific degradation matrices H\mathbf{H} considered (circulant blurring, bicubic downsampling), which are different from the ones we consider (zero-padded blurring, block downsampling). In order to draw a fair comparison between the algorithms, one would have to use the same denosier architecture in both (as we have done for RED and SNIPS), and use the same degradation models. To apply DPIR on the same problems that we consider, we would need to substantially modify it and introduce efficient solutions. Therefore, we instead compare to RED, an alternative plug-and-play method.

SNIPS did not originally work with ImageNet images. However, considering the method’s similarity to DDRM (as both operate in the spectral space of H{\bm{H}}), a comparison is necessary. We apply SNIPS with the same underlying diffusion model (with all 10001000 timesteps) as DDRM for fairness. SNIPS evaluates the diffusion model τ\tau times for each timestep. We set τ=1\tau=1 so that SNIPS’ runtime remains reasonable in comparison to the rest of the considered methods, and do not explore higher values of τ\tau. It is worth mentioning that in the original work, τ\tau was set to 33 for an LSUN bedrooms diffusion model with 10861086 timesteps. We set c=0.67c=0.67 as it achieved the best PSNR performance.

The original work in SNIPS calculates the SVD of H{\bm{H}} directly, which hinders its ability to handle 256×256256\times 256 images on typical hardware. In order to draw comparisons, we replaced the direct calculation of the SVD with our efficient implementation detailed in Appendix D.

In Figure 4 and Table 2 in the main paper, we show that DGP, RED, and SNIPS all fail to produce viable results when significant noise is added to the measurements. For these results, we use the same hyperparameters used in the noiseless case for all algorithms (except σy\sigma_{\mathbf{y}} where applicable). While tuning the hyperparameters may boost performance, we do not explore that option as we are only interested in algorithms where given H{\bm{H}} and σy\sigma_{\mathbf{y}}, the restoration process is automatic. To further demonstrate DDRM’s capabilities and speed, we evaluate it on the entire 50,00050,000-image ImageNet validation set in Tables 5 and 6, reporting Fréchet Inception distance (FID) as well as KID, as enough samples are available.

Appendix G Runtime of Algorithms

In the main paper, we show the number of neural function evaluations (NFEs) as a proxy for the runtime of algorithms. Here, we consider the case of noisy deblurring, and measure the runtime of DDRM, RED, SNIPS, and DGP on an Nvidia RTX 3080 GPU. For each image, DDRM, RED, and SNIPS all run at around 0.090.09 s/it (seconds per iteration), with negligible differences of <0.01<0.01s/it. We note that the denoiser model of DDRM, SNIPS, and RED is the same, so runtime is almost perfectly linearly correlated with NFEs. As for DGP, it uses a different model (a GAN), and it is slightly slower than our denoiser (0.110.11 s/it); this is partly because DGP requires additional gradient computations in order to perform an update. All in all, we observe that the runtime is indeed linear with NFEs, and since no algorithm has a significant runtime advantage over the rest, we prefer to use NFEs as a proxy for runtime, as it is a hardware-independent measure.

In this paper, we used pretrained generative models for image restoration. Since we didn’t train any models, a single Nvidia RTX 3080 GPU was sufficient to run all experiments that were shown in the paper and the appendices.

Appendix H ILVR as a special case of DDRM

Given a generative diffusion model (e.g. DDPM ) that can predict x{\mathbf{x}} given xt+1{\mathbf{x}}_{t+1} and t+1t+1 for t∈[0,T−1]t\in[0,T-1], and a noiseless measurement y=Hx{\mathbf{y}}={\bm{H}}{\mathbf{x}}, where H{\bm{H}} is a downscaling matrix, the Iterative Latent Variable Refinement (ILVR) algorithm can sample from the posterior distribution pθ(t)(xt∣xt+1,y)p_{\theta}^{(t)}({\mathbf{x}}_{t}|{\mathbf{x}}_{t+1},{\mathbf{y}}) for t∈[0,T−1]t\in[0,T-1].

We assume a variance exploding diffusion model, i.e. xt=x+σtϵt{\mathbf{x}}_{t}={\mathbf{x}}+\sigma_{t}\epsilon_{t} where ϵt∼N(0,I)\epsilon_{t}\sim{\mathcal{N}}(0,{\bm{I}}), without loss of generality (because it is equivalent to the variance preserving scheme, as we show in Appendix B). Under this setting, ILVR applies the following updates for t=T−1,…,0t=T-1,\dots,0:

where {\color[rgb]{.5,0,.5}\definecolor[named]{pgfstrokecolor}{rgb}{.5,0,.5}{\mathbf{x}}_{\theta,t}({\mathbf{x}}_{t+1},t+1)} is the prediction for x{\mathbf{x}} given by the diffusion model at timestep t+1t+1, ϵt∼N(0,I)\epsilon_{t}\sim{\mathcal{N}}(0,{\bm{I}}), and ϵt′∼N(0,I)\epsilon_{t}^{\prime}\sim{\mathcal{N}}(0,{\bm{I}}). Substituting xt′{\mathbf{x}}_{t}^{\prime}, yt{\mathbf{y}}_{t}, and H=UΣVT{\bm{H}}={\bm{U}}{\bm{\Sigma}}{\bm{V}}^{T}, the last equation becomes

The second to last equality holds because Σ†Σ{\bm{\Sigma}}^{\dagger}{\bm{\Sigma}} is a square diagonal matrix, and matrix multiplication with a square diagonal matrix is commutative. Recall that xˉt=VTxt\bar{{\mathbf{x}}}_{t}={\bm{V}}^{T}{\mathbf{x}}_{t}, yˉ=Σ†UTy\bar{{\mathbf{y}}}={\bm{\Sigma}}^{\dagger}{\bm{U}}^{T}{\mathbf{y}}, and {\color[rgb]{.5,0,.5}\definecolor[named]{pgfstrokecolor}{rgb}{.5,0,.5}\bar{{\mathbf{x}}}_{\theta,t}}={\bm{V}}^{T}{\color[rgb]{.5,0,.5}\definecolor[named]{pgfstrokecolor}{rgb}{.5,0,.5}{\mathbf{x}}_{\theta,t}({\mathbf{x}}_{t+1},t+1)}, thus

The matrix Σ†Σ{\bm{\Sigma}}^{\dagger}{\bm{\Sigma}} is a square diagonal matrix with zeroes in its entries where the singular value is zero, and ones otherwise. In addition, Σ†{\bm{\Sigma}}^{\dagger} has a row of zeroes when the singular value is zero. Therefore, it holds that

This distribution is exactly the same as Equation 8 in the main paper when η=ηb=1\eta=\eta_{b}=1 and σy=0\sigma_{\mathbf{y}}=0.

As for xT{\mathbf{x}}_{T}, ILVR initializes it by sampling from N(0,σT2I){\mathcal{N}}\left(0,\sigma_{T}^{2}{\bm{I}}\right) (or N(0,I){\mathcal{N}}\left(0,{\bm{I}}\right) in the variance preserving case) while DDRM samples according to Equation 7 in the main paper. The two initializations have the same variance but differ in the mean. This difference has a negligible effect on the end result since the variance is much larger than the difference in the means. Therefore, the above form of ILVR is a specific form of a DDRM (with η=ηb=1\eta=\eta_{b}=1), posed as a solution for linear inverse problems without noise in the measurements.

In their experiments, ILVR only tested H{\bm{H}} which is the bicubic downscaling matrix with varying scale factors. In theory, ILVR can also work for any linear degradation H{\bm{H}}, as long as y{\mathbf{y}} does not contain noise.

Appendix I Additional Results

We provide additional figures below showing DDRM’s versatility across different datasets, inverse problems, and noise levels (Figures I, I, I, I, and I). We also showcase the sample diversity provided by DDRM in Appendix I; we present more uncurated samples from the ImageNet experiments in Figures I and I. Moreover, we further illustrate DDRM’s advantage over previous unsupervised methods by evaluating on two additional inverse problems: (i) 4×4\times super-resolution with the popular bicubic downsampling kernel; and (ii) deblurring with an anisotropic Gaussian blur kernel (with σ=20\sigma=20 horizontally and σ=1\sigma=1 vertically), mimicing motion blur. We show both noiseless and noisy versions in Tables 7 and 8, respectively. To maintain the unsupervised nature of the tested methods, we use the same hyperparameters as in block-averaging super-resolution and uniform deblurring.

8×8\times super-res \forlooprow0< 4 \forlooprow0< 4

16×16\times super-res \forlooprow0< 4 \forlooprow0< 4

Inpainting \forlooprow0< 4 \forlooprow0< 4

Deblurring \forlooprow0< 4 \forlooprow0< 4 Original Degraded Samples from a 2020-step DDRM Mean std

Inpainting \forlooprow0< 6 \forlooprow0< 6 Colorization \forlooprow0< 6 \forlooprow0< 6 Deblurring \forlooprow0< 6 \forlooprow0< 6 4×4\times super-res \forlooprow0< 6 \forlooprow0< 6

Inpainting \forlooprow0< 9 \forlooprow0< 9 Colorization \forlooprow0< 9 \forlooprow0< 9 Deblurring \forlooprow0< 9 \forlooprow0< 9 4×4\times super-res \forlooprow0< 9 \forlooprow0< 9

Inpainting \forlooprow0< 6 \forlooprow0< 6 Deblurring \forlooprow0< 6 \forlooprow0< 6 4×4\times super-res \forlooprow0< 6 \forlooprow0< 6