---
title: 'fastWDM3D: Efficient 3D Inpainting for Brain MRIs'
url: https://www.emergentmind.com/topics/fastwdm3d
type: topic
---

# fastWDM3D: Efficient 3D Inpainting for Brain MRIs

Searching arXiv for the primary paper and closely related inpainting/diffusion context.
fastWDM3D is a wavelet-domain 3D diffusion inpainting model for healthy brain tissue synthesis in T1-weighted MRI, introduced for the task of reconstructing plausible healthy anatomy inside a masked pathological region while preserving the surrounding observed tissue. It was developed in the context of the BraTS Local Synthesis of Healthy Brain Tissue via Inpainting Challenge, where the input is a T1-weighted brain MRI together with a mask, and the output is a 3D inpainted healthy tissue volume [2507.13146]. The method is motivated by applications including pseudo-healthy baselines for tumor growth modeling and improved image registration and related MRI analysis methods that benefit from healthy-looking anatomy. Its defining result is that a modified WDM3D formulation can perform 3D healthy tissue inpainting using only two diffusion steps, reaching a SSIM of 0.8571, a MSE of 0.0079, a PSNR of 22.26, and 1.81 s per image on the BraTS inpainting test set [2507.13146].

## 1. Problem setting and motivation

Healthy tissue inpainting denotes the reconstruction of healthy-appearing anatomy within a masked region of a pathological scan, yielding a pseudo-healthy image while preserving the observed tissue outside the mask [2507.13146]. In the formulation used for fastWDM3D, the model receives a T1-weighted brain MRI with a masked region to fill, together with the corresponding mask, and outputs a 3D inpainted healthy tissue volume. The work is explicitly situated within the BraTS Local Synthesis of Healthy Brain Tissue via Inpainting Challenge [2507.13146].

The practical motivation is twofold. The first stated use is the generation of pseudo-healthy baselines for tumor growth modeling. The second is the facilitation of downstream tasks such as image registration and other MRI analysis methods that perform better on healthy-looking anatomy [2507.13146]. The paper positions the task as one where diffusion models are attractive because they can preserve 3D anatomical realism, but where conventional denoising diffusion probabilistic models had been hindered by long sampling chains and correspondingly slow inference [2507.13146].

A central contrast is therefore between qualitative realism and computational tractability. Earlier DDPM-based healthy tissue inpainting approaches had shown convincing results, including in BraTS challenge settings, but often required hundreds or thousands of denoising steps and inference times measured in minutes per volume [2507.13146]. fastWDM3D was designed to retain the diffusion-based advantages of 3D consistency and realism while reducing inference to only two diffusion steps.

## 2. Lineage from WDM3D and the rejection of adversarial training

fastWDM3D is a modified version of WDM3D, a 3D wavelet diffusion model [2507.13146]. The original WDM3D used 1000 time steps, a linear variance schedule, and MSE on wavelet coefficients [2507.13146]. The fastWDM3D study first examined whether a 2D fast-generation strategy based on combining DDPMs with GANs and using a variance-preserving schedule could transfer to 3D inpainting. This led to two intermediate variants: WDDGAN3D, which retained adversarial training, and GO3D, which removed the discriminator [2507.13146].

The experiments identified the transferable components precisely. The variance-preserving noise schedule and the selected reconstruction losses were found to be effective for high-quality 3D inpainting in a few time steps, whereas adversarial training was not [2507.13146]. The paper states that the adversarial loss did not decrease during training and that the discriminator brought no performance benefit. Training cost also differed sharply: WDDGAN3D required about 112 h and 31.69 GiB, whereas GO3D required about 11 h and 24.24 GiB [2507.13146].

This empirical outcome determined the final method design. fastWDM3D is not a GAN hybrid. It is a pure diffusion model derived from WDM3D, modified to use the variance-preserving schedule and a reconstruction loss in image space focused both globally and on the masked region [2507.13146]. The resulting system simplifies training and lowers cost while preserving or improving performance. A plausible implication is that, for this specific 3D medical inpainting regime, diffusion trajectory design and supervisory signal were more consequential than adversarial discrimination.

## 3. Diffusion formulation and variance-preserving scheduling

The paper follows standard DDPM notation for the forward and reverse processes [2507.13146]. The forward process gradually perturbs an input image $x_0$ over $T$ steps:
$$
q(x_{t}|x_{t-1}):=\mathcal{N}(x_{t};\sqrt{1-\beta _{t}x_{t-1},\beta _{t}\vec{I}),
$$
with $\vec{I}$ the identity matrix and $\beta_t$ the variance at time step $t$ [2507.13146]. The intended meaning is stated to be the standard Gaussian transition with signal scaling by $\sqrt{1-\beta_t}$ and isotropic variance $\beta_t\vec I$.

The reverse process is defined as
$$
p_{\theta}(x_{t-1}|x_t) := \mathcal{N}\left(x_{t-1}; \mu_{\theta}(x_t, t), \sigma_t^2\vec{I}\right),
$$
where $\mu_\theta$ and $\sigma_t^2$ are parameterized by a time-conditioned model $\epsilon_\theta(x_t,t)$ [2507.13146]. The reverse process aims to match the true denoising distribution $q(x_{t-1}|x_t)$, and the paper notes that $\epsilon_\theta(x_t,t)$ can be trained to predict $x_0$, after which $x_{t-1}$ can be sampled using the posterior $q(x_{t-1}|x_t,x_0)$ [2507.13146].

The critical modification enabling few-step operation is the variance-preserving schedule. Following Song et al., the forward process corresponds to the SDE
$$
dx = -\frac{1}{2}\beta_{t}x \, dt + \sqrt{\beta_{t} \, dw,
$$
and the paper adopts the VP schedule from Xiao et al.:
$$
\beta_{t} = 1 - \exp\Big(-{\beta}_{\text{min} \frac{t}{T} - 0.5({\beta}_{\text{max} - {\beta}_{\text{min}) \frac{2t-1}{T^2}\Big) \quad \text{for } t = 1,2,\ldots, T,
$$
again preserving the paper’s typesetting as given [2507.13146]. The practical point is explicit: this schedule makes the overall perturbation independent of the number of diffusion steps, so the image can still be fully perturbed even when $T$ is very small. The definitions
$$
\alpha_t := 1-\beta_t,\qquad \overline{\alpha}_t := \prod_{s=1}^{t}\alpha_s
$$
are used to denote stepwise and cumulative signal preservation [2507.13146].

The paper compares three schedules: linear, adapted linear, and VP [2507.13146]. Its analysis states that the usual linear schedule does not sufficiently perturb the image when $T$ is small, while the adapted linear schedule can destroy image information too early for large $T$. The VP schedule works for both small and large $T$ and is therefore preferred [2507.13146]. This suggests that schedule robustness across step counts was a prerequisite for compressing the denoising chain to two steps.

## 4. Wavelet-domain representation, conditioning, and architecture

The model operates in the wavelet domain rather than directly in full-resolution voxel space [2507.13146]. It uses a 3D discrete wavelet transform with low- and high-pass filters of stride 2,
$$
l=\frac{1}{\sqrt{2}\begin{bmatrix}1 & 1\end{bmatrix}, \qquad h=\frac{1}{\sqrt{2}\begin{bmatrix}-1 & 1\end{bmatrix},
$$
applied along all three spatial dimensions [2507.13146]. A 3D volume $y$ is decomposed into eight subbands,
$$
(x_{lll},x_{llh},x_{lhl},x_{lhh},x_{hll},x_{hlh},x_{hhl},x_{hhh}),
$$
each at half the spatial resolution of $y$, and the inverse discrete wavelet transform reconstructs the original image [2507.13146].

The inpainting setup is implemented using Palette-conditioning [2507.13146]. During training, the ground-truth image $g$, the mask $m$, and the corresponding voided image $v$ are used. Operationally, the wavelet coefficients of $v$, $m$, and the noisy $g$ are concatenated into a 24-channel input, and the model predicts an 8-channel output [2507.13146]. The output is passed through the IDWT to reconstruct the inpainted image $\hat y$. Because each of $v$, $m$, and noisy $g$ contributes eight wavelet channels, the input dimensionality is 24 channels and the prediction target is the 8 wavelet channels corresponding to the reconstructed target [2507.13146].

Architecturally, fastWDM3D inherits the WDM3D wavelet-domain 3D diffusion design rather than the adversarial WDDGAN route [2507.13146]. The generator-style models explored in the paper mention 4 residual blocks and, for WDDGAN, an NCSN++-based generator with a StyleGAN-like mapping network for latent conditioning, but the final fastWDM3D is the DDPM-only wavelet model rather than the adversarial NCSN++ setup [2507.13146]. The processing pipeline is described as follows: preprocess a cropped 3D T1 volume, generate a voided version using the healthy mask, compute DWTs of voided image, mask, and noisy target, concatenate them, run a 3D diffusion backbone in wavelet space, predict 8 wavelet output channels, and reconstruct the inpainted volume via IDWT [2507.13146].

The model’s full 3D character is emphasized by comparison with 2D alternatives. The paper notes that a 2D DDPM can look realistic in axial slices but introduces stripe artifacts in coronal view due to lack of true 3D consistency [2507.13146]. In this context, fastWDM3D is positioned as preserving anatomically coherent volumetric structure.

## 5. Objective functions and the few-step regime

A major methodological departure from the original WDM3D is the supervisory signal [2507.13146]. For WDDGAN3D, the total loss is given as
$$
\mathcal{L} = \mathcal{L}_{adv} + \mathcal{L}_{\hat{y} + \mathcal{L}_{\hat{y}_m}.
$$
Here, $\mathcal{L}_{adv}$ is the adversarial loss, $\mathcal{L}_{\hat y}$ is a reconstruction loss between ground truth $g$ and prediction $\hat y$, and $\mathcal{L}_{\hat y_m}$ is a region-specific reconstruction loss over the masked area $m$ [2507.13146].

After removing the discriminator, GO3D uses
$$
\mathcal{L} = \mathcal{L}_{\hat{y} + \mathcal{L}_{\hat{y}_m},
$$
and fastWDM3D explicitly replaces the original WDM3D wavelet-coefficient MSE loss with the same reconstruction objective
$$
\mathcal{L} = \mathcal{L}_{\hat{y} + \mathcal{L}_{\hat{y}_m}.
$$
The paper does not specify scalar weighting factors between these two terms and presents them as an unweighted sum [2507.13146].

The significance of this change is stated directly. Rather than supervising only wavelet coefficients with MSE, fastWDM3D supervises the reconstructed image both globally and specifically within the inpainted region [2507.13146]. The paper attributes its speed and quality to several interacting factors: only two denoising steps instead of the 1000 steps of the original WDM3D; the VP schedule, which preserves meaningful perturbation and denoising behavior even at very low $T$; image-space reconstruction losses $\mathcal{L}_{\hat y} + \mathcal{L}_{\hat y_m}$, which help preserve quality in the few-step regime; wavelet-domain processing, which reduces spatial resolution per subband; and the removal of adversarial training, which lowers training complexity and memory use [2507.13146].

The paper’s summary of its main experimental insights is correspondingly specific. Adversarial training is unnecessary for this task; the VP schedule is crucial; replacing wavelet-coefficient MSE with global plus masked-region reconstruction losses is important; and, in this 3D inpainting setting, very small diffusion step counts are not merely acceptable but optimal, with the best fastWDM3D model using $T=2$ [2507.13146].

## 6. Empirical results, benchmarks, and computational profile

The ablation results establish the model’s behavior in several stages. For WDDGAN3D(VP), the reported metrics were SSIM $0.8562 \pm 0.1169$, MSE $0.0082 \pm 0.0063$, and PSNR $21.92 \pm 3.74$ at $T=4$, and SSIM $0.8587 \pm 0.1165$, MSE $0.0081 \pm 0.0064$, and PSNR $22.08 \pm 3.84$ at $T=8$ [2507.13146]. GO3D(VP), which removes the discriminator, was reported as better or comparable while being much cheaper: at $T=4$, SSIM $0.8595 \pm 0.1162$, MSE $0.0079 \pm 0.0062$, and PSNR $22.17 \pm 3.84$; at $T=8$, SSIM $0.8606 \pm 0.1145$, MSE $0.0079 \pm 0.0061$, and PSNR $22.19 \pm 3.83$ [2507.13146].

The schedule ablation further supports the VP choice. For GO3D(LA), the paper reports SSIM $0.8521 \pm 0.1242$, MSE $0.0066 \pm 0.0065$, and PSNR $21.69 \pm 4.10$ at $T=4$, and SSIM $0.8438 \pm 0.1409$, MSE $0.0061 \pm 0.0049$, and PSNR $21.83 \pm 3.54$ at $T=8$ [2507.13146]. Although the adapted linear schedule gave lower MSE numerically, it was worse in SSIM and PSNR than GO3D(VP) and WDDGAN3D, and VP was preferred because it worked robustly across different $T$ without modification [2507.13146].

The final fastWDM3D comparison against GO3D is the paper’s central benchmark. At 120k iterations, fastWDM3D achieved the following results [2507.13146]:

| Configuration | Metrics | AST |
|---|---|---|
| fastWDM3D, $T=2$ | SSIM $0.8571 \pm 0.1193$; MSE $0.0079 \pm 0.0063$; PSNR $22.26 \pm 3.97$ | $1.81$ s |
| fastWDM3D, $T=4$ | SSIM $0.8566 \pm 0.1185$; MSE $0.0081 \pm 0.0065$; PSNR $22.20 \pm 4.03$ | $3.78$ s |
| fastWDM3D, $T=8$ | SSIM $0.8561 \pm 0.1192$; MSE $0.0079 \pm 0.0063$; PSNR $22.24 \pm 4.01$ | $4.10$ s |

These results are reported on the BraTS inpainting test set, with the $T=2$ model trained for 120k iterations, corresponding in that setup to 300 epochs with batch size 3 [2507.13146]. The paper notes that GO3D with $T=8$ and batch size 2 had slightly higher SSIM in another experimental setting, but fastWDM3D($T=2$) was selected as the best overall configuration because it had the best PSNR, the same rounded MSE, the lowest sampling time, and much lower memory use [2507.13146].

The runtime comparison with prior diffusion inpainting methods is especially stark. Table 4 reports 20 min for DDPM 2D slice-wise, 25 min for DDPM 2D seq-pos, 25 min for DDPM Pseudo3D, 20 min for DDPM 3D mem-eff, 1 min for LDM3D, 5 min for WDM3D, and 1.81 s for fastWDM3D($T=2$) [2507.13146]. The paper therefore states that fastWDM3D is up to $\sim 800\times$ faster than other DDPMs used for healthy brain tissue inpainting [2507.13146]. Relative to the prior WDM3D specifically, it uses 500× fewer time steps, 2 instead of 1000, and the paper reports that WDM3D had SSIM $0.61 \pm 0.16$, MSE $0.1060 \pm 0.0757$, PSNR $10.57 \pm 3.20$, and 5 min runtime, versus fastWDM3D’s SSIM $0.86 \pm 0.12$, MSE $0.0079 \pm 0.0063$, PSNR $22.26 \pm 3.97$, and 1.81 s [2507.13146]. The authors explicitly attribute this “vast improvement” to changing the schedule and the loss.

Relative to the 2023 BraTS challenge podium, fastWDM3D is competitive but not dominant [2507.13146]. Zhang et al. are reported at SSIM $0.91 \pm 0.15$, MSE $0.0049 \pm 0.0016$, and PSNR $23.59 \pm 5.35$; Durrer et al. at SSIM $0.86 \pm 0.20$, MSE $0.0100 \pm 0.0016$, and PSNR $20.42 \pm 3.82$; Huo et al. at SSIM $0.87 \pm 0.18$, MSE $0.0144 \pm 0.0025$, and PSNR $18.71 \pm 4.01$; and fastWDM3D($T=2$) at SSIM $0.86 \pm 0.12$, MSE $0.0079 \pm 0.0063$, and PSNR $22.26 \pm 3.97$ [2507.13146]. Thus, the first-place challenge method remains quantitatively stronger, but fastWDM3D outperforms the second- and third-place methods in MSE and PSNR while remaining similar in SSIM. The paper also emphasizes a qualitative advantage: fastWDM3D reconstructs 3D realistic structures, whereas some challenge methods are blurrier and 2D methods exhibit through-plane artifacts [2507.13146].

## 7. Data regime, training protocol, limitations, and reproducibility

The training data are the BraTS 2023 Local Synthesis of Healthy Brain Tissue via Inpainting Challenge training set, containing 1251 patient scans with T1 images, tumor masks, and healthy masks [2507.13146]. The split used was 1200 for training and 51 for validation, while the hidden test set contains 568 patients [2507.13146]. Original image size was $240\times240\times155$. Intensities were clipped by removing the top and bottom 0.5 percentile, then normalized to $[-1, 1]$ [2507.13146].

During training, the region defined by the healthy mask $m$ was cropped from the T1 image $g$ to produce the voided image $v$, and then $v$, $m$, and $g$ were all cropped to $128\times128\times128$ with the inpainting region centered [2507.13146]. For evaluation, each prediction $\hat y$ was normalized back to the individual input range of $v$ [2507.13146]. All models were trained on an NVIDIA A100 40 GB GPU [2507.13146]. In the Table 1 experiments, the settings were batch size 2, 4 residual blocks in the generator, learning rate $2\cdot10^{-5}$, and 100 epochs = $60\cdot10^3$ iterations. In the Table 2 experiments, the settings were batch size 3, 4 residual blocks, learning rate $2\cdot10^{-5}$, and results shown for 40k and 120k iterations [2507.13146]. The paper states that convergence followed by overfitting was observed in the first comparison, that GO3D did not improve after 100 epochs, and that fastWDM3D continued improving up to 300 epochs [2507.13146]. During training, GO3D required 38.8 GiB, while fastWDM3D required 18.3 GiB [2507.13146].

The method’s strengths are positioned as a combination of high quality, 3D consistency, fast sampling, lower memory use, and simpler training [2507.13146]. The authors also mention lower environmental footprint because of reduced compute. However, the limitations are stated with comparable clarity. A more thorough ablation disentangling the effects of variance schedule, loss, and architecture would be beneficial; future work should investigate why the VP schedule works so well here, test additional schedules, and evaluate robustness on other datasets, modalities, and generative tasks [2507.13146]. The paper therefore does not claim broad generalization beyond healthy brain tissue inpainting in a BraTS-like T1 MRI setting.

For reproducibility, the paper states that code is publicly available at `https://github.com/AliciaDurrer/fastWDM3D`, and it identifies the practical ingredients that matter for reproduction: 3D DWT/IDWT, Palette-style conditioning, the VP noise schedule, image-space reconstruction losses $\mathcal L_{\hat y} + \mathcal L_{\hat y_m}$, training on $128^3$ crops centered on the inpainting region, intensity clipping and normalization to $[-1,1]$, and selecting very small $T$, especially $T=2$ for the final model [2507.13146].

In summary, fastWDM3D is defined less by adversarial augmentation than by a particular convergence of design choices within 3D diffusion inpainting: a wavelet-domain representation, Palette-style conditioning, a variance-preserving schedule, and direct image-space supervision over both the full image and the masked region [2507.13146]. The paper’s central contribution is the empirical finding that, in this setting, these ingredients make two-step diffusion not merely feasible but effective, yielding a 3D healthy tissue inpainting model that is dramatically faster than earlier DDPM-based approaches while preserving strong quantitative performance and volumetric anatomical consistency [2507.13146].

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