ContourDiff: Unpaired Image Translation with Contour-Guided Diffusion Models

Yuwen Chen, Nicholas Konz, Hanxue Gu, Haoyu Dong, Yaqian Chen, Lin Li, Jisoo Lee, Maciej A. Mazurowski

Introduction

Medical image translation—the process of converting images from one modality (e.g., CT) to another (e.g., MRI)—is a critical task for cross-modality segmentation and clinical decision support. However, traditional Unpaired Image-to-Image (I2I) translation methods, such as CycleGAN, frequently encounter a significant hurdle known as structural bias.

Structural bias occurs when the source and target domains have systematic differences in anatomical coverage or positioning. For instance, a CT dataset might consistently include both legs, while the target MRI dataset focuses on a single limb. Standard models often attempt to resolve this discrepancy by "hallucinating" or warping anatomy to match the target domain's distribution, which compromises anatomical fidelity. ContourDiff addresses this by leveraging domain-invariant anatomical contours to guide a diffusion-based generation process.

Comparison of structural bias across different anatomical regions in CT and MRI modalities.

Methodology

ContourDiff departs from the standard cycle-consistency paradigm, instead utilizing a diffusion-based framework conditioned on spatial constraints. The architecture is built upon three primary innovations:

1. Contour-Guided Diffusion

Rather than learning a direct mapping between CT and MRI pixels, the model is trained exclusively on the target domain (e.g., MRI). During training, the model learns to reconstruct MRI slices from their anatomical contours, extracted using a Canny edge filter. Because these contours represent the underlying geometry of bones and organs—features that remain spatially consistent across modalities—the model can effectively translate CT scans into MRIs at inference time by treating CT contours as the conditioning signal.

2. Spatially Coherent Guided Diffusion (SCGD)

A common issue in 2D slice-based translation of 3D medical volumes is "flickering" or axial inconsistency. ContourDiff introduces Spatially Coherent Guided Diffusion (SCGD), which ensures 3D consistency by conditioning the generation of each slice on the previously generated adjacent slice. This temporal-like consistency mechanism results in smoother, more anatomically plausible 3D reconstructions.

3. Target-Only Training

A significant advantage of ContourDiff is its training efficiency. The model does not require paired data or even exposure to the source domain (CT) during the training phase. It only needs a collection of unlabeled images from the target domain, making it highly adaptable to new modalities.

Experimental Setup and Datasets

The framework was evaluated across several challenging anatomical tasks:

  • Lumbar Spine: Utilizing the SPIDER public dataset and private MRI records.
  • Hip and Thigh: Using the TotalSegmentator CT dataset and private MRI data.
  • Liver: Cross-modality translation using the AMOS dataset.
  • Zero-Shot MRI Translation: Testing the model's ability to translate between T2 and T1 MRI sequences without specific retraining.

Key Results

ContourDiff demonstrates superior performance over established baselines like CycleGAN, CUT, and SynSeg-Net across multiple metrics:

  • Segmentation Accuracy: In the Lumbar Spine translation task, a segmentation model (UNet) trained on ContourDiff-generated images achieved a Dice Coefficient (DSC) of 0.705. This significantly outperformed CycleGAN (0.484) and GcGAN (0.554).
  • Anatomical Fidelity: The model achieved lower Hausdorff Distance (HD95) scores, confirming that the boundaries of translated structures align precisely with the original source anatomy.
  • Visual Realism: ContourDiff consistently secured the best (lowest) Frechet Inception Distance (FID) and Kernel Inception Distance (KID) scores, indicating that the generated images are statistically indistinguishable from real target-domain scans.

Discussion and Limitations

While ContourDiff represents a major step forward, some limitations remain. The reliance on Canny edge detection requires manual thresholding, though the authors noted the model's inherent robustness to varying noise levels in the input. Future iterations may incorporate automated threshold selection based on image statistics. Additionally, while the model excels at preserving major structures, it may occasionally miss fine tissue textures that are not captured by simple contours. The authors also suggest exploring "distortion-aware" guidance to account for modality-specific artifacts, such as susceptibility distortions in MRI, which are currently suppressed by the strict contour alignment.

In conclusion, ContourDiff provides a robust, anatomically consistent solution for unpaired medical image translation, bridging the gap between modalities through the universal language of anatomical contours.

Summary updated

BibTeX
@article{chen2025contourdiff,
  author = {Yuwen Chen and Nicholas Konz and Hanxue Gu and Haoyu Dong and Yaqian Chen and Lin Li and Jisoo Lee and Maciej A. Mazurowski},
  title = {{ContourDiff: Unpaired Image Translation with Contour-Guided Diffusion Models}},
  journal = {The Journal of Machine Learning for Biomedical Imaging},
  year = {2025},
  doi = {10.59275/j.melba.2025-79a2},
}
Figure