Optimal Transport-Guided Conditional Score-Based Diffusion Model

Xiang Gu, Liwei Yang, Jian Sun, Zongben Xu

Training conditional diffusion models usually requires perfectly paired datasets (e.g., a low-resolution image and its exact high-resolution counterpart). However, such perfectly paired data is rare and expensive to obtain in the real world. OTCS (Optimal Transport-guided Conditional Score-based diffusion model) bridges this gap by using Optimal Transport (OT) to "soft-pair" data, enabling high-quality conditional generation even when training data is unpaired or only partially paired.

The Challenge of Unpaired Data

Conditional Score-Based Diffusion Models (SBDMs) have revolutionized image-to-image translation and super-resolution. Their primary limitation is the strict requirement for paired training data. To learn how to transform domain A to domain B, the model typically needs to see thousands of exact one-to-one examples.

In many real-world scenarios—like translating a photo of a cat into a photo of a lion, or aligning different medical imaging modalities—paired data is impossible to obtain. While some "unpaired" methods exist, they often rely on unconditioned models with added guidance at inference time, which can be unstable or produce lower-quality results. OTCS seeks to train a truly conditional model using the mathematical framework of Optimal Transport to find correspondences where none are explicitly given.

The OTCS Framework

The authors propose a two-stage framework to tackle this problem:

OTCS Framework Overview
  1. Stage I: OT-Guided Coupling: Instead of assuming pairs exist, the model uses $L_2$-regularized Optimal Transport to estimate a "coupling" relationship between the condition data ($x$) and target data ($y$).
  2. For unpaired data, it uses unsupervised OT to find the most efficient way to transport the distribution of $x$ to $y$.
  3. For partially paired data, it uses semi-supervised OT, treating the few known pairs as "keypoints" to anchor the rest of the distribution.
  4. This results in a compatibility function $H(x, y)$ that estimates how likely it is that a specific $x$ and $y$ should be paired.
  5. Stage II: OT-Guided Denoising Score Matching: The standard diffusion training objective is reformulated. In a standard paired setup, the coupling is a hard link (a Dirac delta function). OTCS generalizes this by using the "soft" coupling derived from the OT stage.

To make training on mini-batches feasible (since a random $x$ and $y$ in a batch might have zero compatibility), the authors introduce Resampling-by-Compatibility (RSC). For a given $x$, a $y$ is sampled from the target set with a probability proportional to their OT compatibility, ensuring the diffusion model always receives meaningful guidance during training.

Key Insights: Training vs. Inference Guidance

A major advantage of OTCS is how it treats pairings as a probabilistic coupling rather than a hard constraint, making the model more robust to noise and better able to leverage the global structure of data distributions.

Comparison of OTCS and SCONES

The authors specifically compare their work to SCONES, a previous OT-diffusion hybrid. SCONES requires calculating the gradient of the compatibility function on noisy data during inference, which is often inaccurate and leads to instability. OTCS, on the other hand, uses the compatibility function to guide training on clean data. This fundamental shift leads to much more stable and accurate distribution matching, as seen in the toy density comparisons above.

Experimental Results

OTCS was evaluated across several challenging tasks, demonstrating significant improvements over existing methods:

  • Unpaired Super-Resolution (CelebA 64×64): OTCS achieved an FID of 1.77, vastly outperforming the previous state-of-the-art, SCONES (FID 15.46), and coming very close to an "Oracle" model (FID 0.78) trained on perfectly paired data.
  • Semi-Paired Animal Translation (AFHQ): Translating cats, foxes, and leopards into lions, tigers, and wolves using only three explicit pairs as guidance, OTCS achieved a translation accuracy of 96.44%. The next best method (TCR) only reached 40.44%.
  • Digit Translation (MNIST to Chinese-MNIST): OTCS reached 67.42% accuracy, nearly doubling the performance of competing methods like TCR (36.21%) and W2GAN (29.13%).

Limitations and Future Directions

While powerful, OTCS's performance depends heavily on the choice of the cost function (e.g., $L_2$ distance or CLIP features) used during the OT stage. If the cost function fails to capture the relevant semantics of the domain, the resulting coupling will be poor. Additionally, very small target datasets can limit the generative ability of the diffusion model. Future work will explore more complex cost functions and apply OTCS to domains like medical image synthesis, where unpaired data is a persistent hurdle.

Summary updated

BibTeX
@inproceedings{gu2023optimal,
  author = {Xiang Gu and Liwei Yang and Jian Sun and Zongben Xu},
  title = {{Optimal Transport-Guided Conditional Score-Based Diffusion Model}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2023},
  url = {https://openreview.net/forum?id=9Muli2zoFn},
}
Figure