---
title: 'DynFaceRestore: Diffusion-Guided Face Restoration'
url: https://www.emergentmind.com/topics/dynfacerestore
type: topic
---

# DynFaceRestore: Diffusion-Guided Face Restoration

Searching arXiv for the specified paper and closely related face restoration methods mentioned in the provided data.
DynFaceRestore is a blind face restoration method that addresses the recovery of high-fidelity, detail-rich facial images from unknown degraded inputs by combining a learned Gaussian-blur mapping, dynamic-step diffusion guidance, and spatially adaptive guidance scaling. It is designed to balance fidelity and perceptual quality in settings where the degradation operator is unknown and may include blur, downsampling, noise, and JPEG artifacts. The method is introduced in "DynFaceRestore: Balancing Fidelity and Quality in Diffusion-Guided Blind Face Restoration with Dynamic Blur-Level Mapping and Guidance" [2507.13797].

## 1. Problem setting and restoration objective

Blind face restoration is formulated by assuming a low-quality face image \(y\) derived from a high-quality face \(x\in\mathbb{R}^{H\times W\times3}\) through an unknown degradation operator \(\mathcal{A}\) and additive noise:
\[
y \;=\;\mathcal{A}(x)\;+\;n,\quad n\sim\mathcal{N}(0,\sigma_n^2I).
\]
The objective is to recover \(x\), or a perceptually equivalent \(\hat x\), without knowledge of \(\mathcal{A}\) [2507.13797].

In the formulation used by DynFaceRestore, typical blind degradations include blur, downsampling, noise and JPEG artifacts. The unknown blur component is approximated by a Gaussian kernel \(k_\sigma\) with standard deviation \(\sigma\):
\[
\mathcal{A}(x)\;\approx\;(x\otimes k_\sigma)\downarrow_s\;+\;n\;\xrightarrow{\text{JPEG}\;\uparrow_s, 
\]
where \(\otimes\) denotes convolution and \(\downarrow_s,\uparrow_s\) denote down- and up-sampling by factor \(s\) [2507.13797].

The central difficulty identified for diffusion-guided blind face restoration is that existing methods often use fixed diffusion sampling timesteps and a global guidance scale, thereby assuming uniform degradation. According to the formulation of DynFaceRestore, this can produce under-diffusion or over-diffusion, especially when degradation kernel estimation is imperfect, and thus creates an imbalance between fidelity and quality [2507.13797]. This suggests that the method is structured around replacing global, static control signals with blur-adaptive and spatially varying ones.

## 2. Dynamic Blur-Level Mapping

A core component of DynFaceRestore is Dynamic Blur-Level Mapping, abbreviated in the paper as DBLM. DBLM maps a blindly degraded input to Gaussian blurry images, thereby reframing blind degradation into a form usable for likelihood guidance during diffusion sampling [2507.13797].

The process begins by passing the low-quality image \(y\) through a discriminative restoration model \(RM\), given in the paper as, for example, SwinIR, and then convolving the output with a Gaussian kernel \(k_y^{\sigma^*}\):
\[
\tilde y \;=\;DBLM(y)\;=\;k_y^{\sigma^*}\,\otimes\,RM(y).
\]
Here, \(\sigma^*\) is defined as the “true” blur level that best aligns \(\tilde y\) with the unknown true Gaussian blur of \(x\) [2507.13797].

The paper formalizes \(\sigma^*\) through the constrained optimization
\[
\sigma^*
\;=\;
\arg\min_{\sigma\in[\sigma_{\min},\sigma_{\max}]}
\Big\|\,k^\sigma\otimes RM(y)\;-\;k^\sigma\otimes x\Big\|_1
\quad\text{s.t.}\quad
\big\|k^\sigma\otimes RM(y)-k^\sigma\otimes x\big\|_1<\xi.
\]
Since \(x\) is unavailable at inference time, DynFaceRestore trains a small network \(SE\) to regress \(\hat\sigma^*\) and an auxiliary \(\hat y'\) from \(y\):
\[
[\,\hat\sigma^*,\,\hat y'\,]\;=\;SE(y).
\]
Its training loss is
\[
L_{SE}
\;=\;
\big\|\hat\sigma^*-\sigma^*\big\|_1
\;+\;\gamma_{\sigma}\,\big\|\hat y'-\tilde x\big\|_1,
\quad
\tilde x\equiv k^{\sigma^*}\otimes x.
\]
The architecture summary given in the paper describes \(SE\) as a lightweight CNN regressing \((\hat\sigma,\hat y')\), while \(RM\) in DBLM is a SwinIR network [2507.13797].

Within the method’s broader logic, DBLM serves two roles. Factually, it supplies Gaussian-blurred guidance images and corresponding Gaussian kernels. Interpretively, this suggests a model-side normalization of heterogeneous real degradations into a blur-parameterized latent control variable, which is then used to govern diffusion initialization and guidance.

## 3. Diffusion prior, dynamic timesteps, and guided sampling

DynFaceRestore uses a pretrained DDPM-style diffusion model as an image prior [2507.13797]. The forward noising process is written as
\[
q(x_t\mid x_{t-1})
=\mathcal{N}\Bigl(x_t;\sqrt{\alpha_t}\,x_{t-1},\;\beta_tI\Bigr),
\quad
\bar\alpha_t=\prod_{i=1}^t\alpha_i.
\]
Letting \(\epsilon_\theta(x_t,t)\) denote the pretrained denoiser, the estimated clean image at step \(t\) is
\[
\hat x_t^0
=\frac{1}{\sqrt{\bar\alpha_t}\Bigl(x_t-\sqrt{1-\bar\alpha_t}\,\epsilon_\theta(x_t,t)\Bigr).
\]
The unconditional reverse sample is given by
\[
x_{t-1}'
=\frac{1}{\sqrt{\alpha_t}
\Bigl(x_t-\frac{\beta_t}{\sqrt{1-\bar\alpha_t}\,\epsilon_\theta(x_t,t)\Bigr)
+\sigma_t\,\epsilon,\quad\epsilon\sim\mathcal N(0,I).
\]
The pretrained diffusion backbone is specified as the standard U-Net from DDPM with parameters \(\epsilon_\theta\) [2507.13797].

To incorporate the blurred guidance image \(\tilde y\) and its Gaussian kernel, DynFaceRestore applies DPS-style kernel guidance through a likelihood gradient term:
\[
x_{t-1}
=x_{t-1}'
\;-\;s\;\nabla_{x_t}\Big\|\tilde y-\bigl(k_t\otimes \hat x_t^0\bigr)\Big\|_2^2,
\]
where \(k_t\) is a Gaussian with current standard deviation \(\sigma_t\) [2507.13797].

A distinguishing feature is that sampling does not always start from \(t=T\). Instead, the method constructs a lookup table denoted DSST, which for each blur level \(\sigma\) finds
\[
t_{\sigma}
=\min\Bigl\{t:|\log\,\mathbb E\|x_t\|-\log\,\mathbb E\|\tilde y_t^\sigma\|\bigr|\le tol\Bigr\}.
\]
At inference, the model estimates \(\hat\sigma^*\) through \(SE\), retrieves \(t_{start}=t_{\hat\sigma^*}\), and initializes
\[
x_{t_{start}
=\sqrt{\bar\alpha_{t_{start}\,\tilde y
\;+\;\sqrt{1-\bar\alpha_{t_{start}\,\epsilon,\quad \epsilon\sim\mathcal N(0,I).
\]
The stated purpose of this dynamic starting timestep is to adapt the diffusion start step to the estimated blur, thereby avoiding under-diffusion and over-diffusion [2507.13797]. This suggests that DSST functions as a blur-conditioned scheduler rather than a fixed inference policy.

## 4. Dynamic Guidance Scaling Adjuster

DynFaceRestore replaces the fixed scalar guidance scale \(s\) with a spatial map \(A_t(x,y)\in[0,1]\), generated by a Dynamic Guidance Scaling Adjuster, abbreviated DGSA. The adjuster takes \(\tilde y\), \(\hat x_t^0\), and \(t\) as input:
\[
A_t
=DGSA\bigl(\tilde y,\hat x_t^0,t\bigr).
\]
The guided reverse update becomes
\[
x_{t-1}
=x_{t-1}'
\;-\;A_t\;\odot\;\nabla_{x_t}\Big\|\tilde y-k_t\otimes\hat x_t^0\Big\|_2^2.
\]
The DGSA network is described as a three-layer CNN producing an \(H\times W\) map [2507.13797].

The role of DGSA is stated explicitly in the discussion of the method: it applies spatially varying guidance scales so that low-frequency regions, such as face shape, remain faithful, while high-frequency regions, such as hair and wrinkles, receive stronger diffusion. The abstract similarly characterizes it as modulating guidance strength across local regions, enhancing detail generation in complex areas while preserving structural fidelity in contours [2507.13797].

This component directly addresses the limitation of a global guidance scale. A plausible implication is that DynFaceRestore treats the fidelity–quality trade-off as spatially nonuniform: contours and identity-bearing geometry benefit from stronger data consistency, whereas texture-rich zones benefit from more permissive generative refinement.

## 5. Architecture, losses, and inference procedure

DynFaceRestore combines four principal modules: a pretrained diffusion model, \(RM\) for DBLM, \(SE\), and \(DGSA\). The pretrained diffusion model is the standard U-Net from DDPM; \(RM\) is SwinIR; \(SE\) is a lightweight CNN regressing \((\hat\sigma,\hat y')\); and \(DGSA\) is a three-layer CNN producing a spatial guidance map [2507.13797].

The training objective for \(SE\) is the loss \(L_{SE}\) defined by
\[
L_{SE}
\;=\;
\big\|\hat\sigma^*-\sigma^*\big\|_1
\;+\;\gamma_{\sigma}\,\big\|\hat y'-\tilde x\big\|_1.
\]
For sampling-time training of DGSA, the paper specifies that a random \(t\) is chosen, one guided reverse step is run to obtain \(x_{t-1}\), the predicted \(\hat x_{t-1}^0\) is computed, and the following loss is minimized:
\[
L_{DGSA}
=\sum_{i\in\{LL,LH,HL,HH\}
\gamma_i\;
\bigl\|SWT(x_{t-1}^0)_i-SWT(x_0)_i\bigr\|_1
\;+\;
DISTS\bigl(x_{t-1}^0,x_0\bigr),
\]
where \(SWT\) denotes a stationary wavelet transform with sub-bands and \(DISTS\) denotes a perceptual/textural similarity loss. The paper states explicitly that no adversarial loss is used, and that all weights \(\{\gamma_\sigma,\gamma_i\}\) are set by cross-validation [2507.13797].

The algorithmic procedure given in the paper is:

1. \(\bigl[\hat\sigma^*,\hat y'\bigr]=SE(y)\).
2. \(\tilde y = k^{\hat\sigma^*}\otimes RM(y)\).
3. \(t_{start}= DSST[\hat\sigma^*]\).
4. Sample \(x_{t_{start}}\) from \(\tilde y\) and Gaussian noise.
5. For \(t=t_{start},\dots,1\):
   1. compute \(\hat x_t^0\);
   2. compute \(x_{t-1}'\);
   3. compute \(A_t=DGSA(\tilde y,\hat x_t^0,t)\);
   4. update \(x_{t-1}=x_{t-1}'-A_t\odot\nabla_{x_t}\|\tilde y-k_t\otimes\hat x_t^0\|_2^2\);
   5. update blur standard deviation by
      \[
      \sigma_{t-1}
      =\sigma_t\;-\;\eta\,\nabla_{\sigma_t}\|\tilde y-k_t\otimes\hat x_t^0\|_2^2.
      \]
6. Return \(x_0\) [2507.13797].

The paper also states that kernel mismatch is mitigated by multi-level guidance and by updating \(\sigma_t\) during sampling. This indicates that guidance is not solely conditioned on an initial blur estimate but can be refined across reverse steps.

## 6. Experimental protocol and reported performance

The reported training data consist of FFHQ with synthetic degradations. The degradations used are Gaussian blur with \(\sigma\in[0.1,15]\), down/up-sample factor \(s\in[0.8,32]\), additive noise \(\zeta\in[0,20]\), and JPEG quality \(\delta\in[30,100]\) [2507.13797].

The test sets are CelebA-Test with 3,000 images under the same pipeline, and three real-world sets: LFW-Test with 1,711 images, WebPhoto-Test with 407 images, and Wider-Test with 970 images. The evaluation metrics are PSNR and SSIM for fidelity; LPIPS and FID for perceptual quality; IDA for identity, where lower is better; and LMD for facial alignment [2507.13797].

On CelebA-Test, the key quantitative results reported for DynFaceRestore are as follows.

| Metric | Reported result |
|---|---|
| PSNR | 24.35 dB (↑ 0.40 over second best) |
| SSIM | 0.664 (↑ 0.005 over second best) |
| LPIPS | 0.332 (2nd best) |
| FID | 14.78 (best) |
| IDA | 0.748 (best) |
| LMD | 3.419 (best) |

The paper further states that on real-world data DynFaceRestore also achieves the lowest FID on LFW and Wider, and strong results on WebPhoto [2507.13797].

Qualitatively, DynFaceRestore is reported to preserve facial contours and identity, associated in the paper with high PSNR and IDA, while recovering hair, wrinkles and mouth details, associated with low FID and LPIPS. In the reported comparisons, it outperforms GAN- and codebook-based baselines including GPEN, GFPGAN, and CodeFormer, as well as prior diffusion approaches including DifFace, PGDiff, and DiffBIR [2507.13797]. The data block does not provide further comparative mechanics for these baselines, so no stronger claim about their internal differences is warranted here.

## 7. Ablations, interpretation, and limitations

The ablation study reported in the paper attributes distinct functions to DBLM, DSST, and DGSA. DBLM alone lifts PSNR to approximately \(24.99\); adding multiple Gaussian-level guidance and DSST raises PSNR to approximately \(25.11\); and DGSA further improves perceptual quality, measured by FID, without harming fidelity [2507.13797]. This decomposition supports the method’s stated design goal of balancing fidelity and quality through separate but coordinated controls: degradation normalization, timestep adaptation, and spatially adaptive guidance.

The paper’s discussion frames the fidelity–quality trade-off in three terms. First, DBLM reframes blind degradation as Gaussian blur, simplifying likelihood guidance. Second, DSST adapts the diffusion start step to the estimated blur, avoiding under-diffusion and over-diffusion. Third, DGSA applies spatially varying guidance scales so that low-frequency regions remain faithful while high-frequency regions receive stronger diffusion [2507.13797]. Taken together, these statements suggest that DynFaceRestore treats restoration as a mismatch-management problem between uncertain degradations and generative priors.

Several limitations and possible extensions are identified explicitly. Hyperparameters, including the number of guidance levels and the tolerance in DSST, are currently hand-tuned. The \(SE\) and DSST stages could be unified into an end-to-end learned scheduler. The method could be extended to non-Gaussian or spatially variant blur. Acceleration via fewer diffusion steps is also proposed as future work [2507.13797].

A common misconception in diffusion-guided restoration is that stronger guidance or later diffusion starts necessarily improve identity preservation. The formulation of DynFaceRestore argues against such a uniform assumption by making both the start timestep and the guidance strength adaptive. Another potential misconception is that perceptual improvement in blind face restoration requires adversarial supervision; DynFaceRestore explicitly reports that no adversarial loss is used [2507.13797]. This does not establish a general principle beyond the method itself, but it does delimit the training regime under which its reported performance is obtained.

Source: https://www.emergentmind.com/topics/dynfacerestore