NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Posterior Sampling Based on Gradient Flows of the MMD with Negative Distance Kernel

Paul Hagemann, Johannes Hertrich, Fabian Altekrüger, Robert Beinert, Jannis Chemseddine, Gabriele Steidl

In the world of imaging, "inverse problems"—like zooming into a blurry photo or reconstructing a CT scan—are notoriously difficult because they are "ill-posed." There isn't just one right answer; there are many possible images that could have produced the same blurry observation.

A new paper, "Posterior Sampling Based on Gradient Flows of the MMD with Negative Distance Kernel," introduces a theoretically grounded and computationally efficient way to explore these possibilities by sampling from the "posterior distribution" (the set of all likely solutions given the data).

TL;DR

The authors propose a conditional generative model that uses Wasserstein gradient flows of the Maximum Mean Discrepancy (MMD) to sample from posterior distributions. By leveraging the "negative distance kernel" and efficient "slicing" techniques, they provide a method that is both mathematically rigorous and powerful enough to handle complex inverse problems like limited-angle CT and high-resolution super-resolution.

What Problem Does This Paper Address?

When we try to recover an image $x$ from a noisy observation $y$, most traditional methods give us a single "best guess." However, in fields like medical imaging, knowing the uncertainty of that guess is just as important as the guess itself.

To capture this uncertainty, we need to sample from the posterior distribution $P(X|Y=y)$. While generative models like GANs and Diffusion models have made strides here, they often rely on complex training objectives (like the Kullback-Leibler divergence or score matching) that can be unstable or lack clear theoretical guarantees when applied to conditional settings.

The authors identify a gap: how can we build a conditional generative model that is computationally efficient, scales to high dimensions, and comes with a solid mathematical proof that it's actually doing what we think it's doing?

Methods

The researchers turn to Maximum Mean Discrepancy (MMD)—a way to measure the distance between two probability distributions. Specifically, they use the negative distance kernel ($K(x, y) = -\|x - y\|$), also known as the "energy distance."

The Secret Sauce: Sliced MMD Gradient Flows

  1. Gradient Flows: Imagine a cloud of random "noise" particles. The algorithm calculates a "force" (the gradient of the MMD) that pushes these particles until their distribution matches the joint distribution of the training data.
  2. Slicing and Sorting: Calculating MMD in high dimensions is slow ($O(N^2)$). By "slicing" the data—projecting it onto random 1D lines—the problem becomes a simple sorting task, which is much faster ($O(N \log N)$).
  3. Neural Approximation: Instead of simulating the flow step-by-step during inference, they train a sequence of UNets to learn the transformation. This allows them to map a simple latent distribution (like Gaussian noise) directly to the complex posterior distribution of images.

Datasets

The authors validated their approach across a wide range of tasks:

  • Standard Benchmarks: MNIST, FashionMNIST, and CIFAR10 for class-conditional generation and inpainting.
  • Human Faces: CelebA for $4\times$ super-resolution.
  • Medical Imaging: The LoDoPaB-CT dataset for low-dose computed tomography.
  • Scientific Imaging: High-dimensional microstructures of materials, testing the model's ability to handle real-world, non-natural image data.

Key Insights and Ideas

  • The "Zero Velocity" Justification: A major theoretical contribution is proving that in a conditional gradient flow, you can essentially "freeze" the conditioning variable ($y$) and only move the $x$ particles. Previous empirical work used this as a trick; this paper provides the rigorous proof that this still results in a valid Wasserstein gradient flow.
  • MMD vs. KL Divergence: Unlike the KL divergence (used in VAEs), MMD with a negative distance kernel doesn't require estimating densities. It only requires calculating distances between samples, making it more robust for certain types of data.
  • Uncertainty Visualization: Because the model produces multiple valid samples for a single input, the authors can calculate a "pixel-wise standard deviation" map. This highlights exactly which parts of a reconstruction the model is "unsure" about (e.g., the edges of a tumor in a CT scan).
Uncertainty visualization in CT reconstruction

Key Results

  • Superior Generation: On MNIST and CIFAR10, the model achieved lower (better) Class-Conditional FID scores than previous sliced Wasserstein flow methods.
  • High-Fidelity Reconstructions: In super-resolution and inpainting, the model produced diverse, high-quality samples that were consistent with the observations.
  • CT Performance: In low-dose CT, the method outperformed "WPPFlow" and "SRFlow" in both PSNR (35.37 vs 31.16) and SSIM (0.835 vs 0.774), proving its utility for high-stakes imaging.
Class-conditional generation results and FID scores

Limitations and Future Work

  • Retraining Requirements: Currently, if the forward operator (e.g., the camera blur or the CT scanner geometry) changes even slightly, the entire model must be retrained.
  • Batching Challenges: The particle-interaction nature of gradient flows makes standard mini-batch training difficult. The authors suggest exploring ways to enable more efficient batching in the future.
  • Metric Limitations: The authors acknowledge that evaluating "posterior samples" in high dimensions is still an open problem, as standard metrics like FID don't perfectly capture how well a sample matches a specific condition.

For those interested in the intersection of optimal transport, kernel methods, and Bayesian inference, this paper provides a robust new framework for tackling the "many-answers" problem in imaging.

Summary updated

BibTeX
@inproceedings{hagemann2024posterior,
  author = {Paul Hagemann and Johannes Hertrich and Fabian Altekrüger and Robert Beinert and Jannis Chemseddine and Gabriele Steidl},
  title = {{Posterior Sampling Based on Gradient Flows of the MMD with Negative Distance Kernel}},
  booktitle = {International Conference on Learning Representations},
  year = {2024},
  url = {https://openreview.net/forum?id=YrXHEb2qMb},
}
Figure