Skip to content

Latest commit

 

History

8 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DM4CT: Benchmarking Diffusion Models for Computed Tomography Reconstruction (ICLR 2026)

Jiayang Shi, Daniel M. Pelt, K. Joost Batenburg

Abstract: Diffusion models have recently emerged as powerful priors for solving inverse problems. While computed tomography (CT) is theoretically a linear inverse problem, it poses many practical challenges. These include correlated noise, artifact structures, reliance on system geometry, and misaligned value ranges, which make the direct application of diffusion models more difficult than in domains like natural image generation. To systematically evaluate how diffusion models perform in this context and compare them with established reconstruction methods, we introduce DM4CT, \textit{a comprehensive benchmark for CT reconstruction}. DM4CT includes datasets from both medical and industrial domains with sparse-view and noisy configurations. To explore the challenges of deploying diffusion models in practice, we additionally acquire a high-resolution CT dataset at a high-energy synchrotron facility and evaluate all methods under real experimental conditions. We benchmark ten recent diffusion-based methods alongside seven strong baselines, including model-based, unsupervised, and supervised approaches. Our analysis provides detailed insights into the behavior, strengths, and limitations of diffusion models for CT reconstruction. The real-world dataset is publicly available at https://zenodo.org/records/15420527, and the codebase is open-sourced at https://github.com/DM4CT/DM4CT.

Table of Contents

Environment requirements

  • At least one Nvidia GPU for inference.
  • Main dependencies are pytorch, diffusers, astra-toolbox, tifffile.

We provide the conda configuration to create the same environment for the benchmark.

Create and activate the main Conda environment:

conda env create -f environment.yml
conda activate diffusers-ct

For MBIR reconstruction (due to version conflicts), use the separate environment:

conda env create -f mbir.yml
conda activate mbir

🔥 Simple Usage Examples

Unconditional Generation

All pretrained diffusion models are now also hosted on HuggingFace, which allows easy and straight-forward use. Simple try with only 3 lines of code.

from diffusers import DiffusionPipeline

# pick your target pretrained model, latent is bit quicker in unconditional generation
pipeline = DiffusionPipeline.from_pretrained("jiayangshi/lodochallenge_latent_diffusion").to("cuda")

# unconditional generation, and save as tif or png file
pipeline(batch_size=1).images[0].save("reconstructed_slice.png")

CT Reconstruction Conditioned on Measurement

We provide an example testing CT image L506_000.tif and show the steps for CT reconstruction with 18 lines of code (DDS as example).

import astra
import torch
from forward_operators_ct import Operator, NoNoise
from pipelines import DDPMPipelineDDS
from condition_methods import DDS
import numpy as np
from tifffile import imwrite, imread

# ground truth image
img = torch.tensor(imread("lodochallenge/L506_000.tif"), device='cuda').unsqueeze_(0)

# specify the CT scanning geometry
angles =np.linspace(0, np.pi, 20)
n_rows, n_cols, n_slices = 512, 512, 1
vol_geom = astra.create_vol_geom(n_rows, n_cols, n_slices)
proj_geom = astra.create_proj_geom('parallel3d', 1, 1, 1, 512, angles)

# create forward operator, noise operator
A = Operator(volume_geometry=vol_geom, projection_geometry=proj_geom)
noiser = NoNoise()

# create the diffusion pipeline, pick your algorithm
pipeline = DDPMPipelineDDS(unet=None,scheduler=None).from_pretrained("jiayangshi/lodochallenge_pixel_diffusion").to("cuda")
pipeline.measurement_condition = DDS(operator=A, noiser=noiser)

# forward pass, simulate measurement
y_n = noiser(A(img))

# CT reconstruction conditioned on measurement
imwrite("dds_L506_000.tif", pipeline(num_inference_steps=100, measurement=y_n, cg_inner=5, cg_eps=1e-5, gamma=1, output_type=np.array).images[0])

Datasets

Preprocessing

We provide the preprocessing code to perform

  • train/test split
  • rescale intensity values to the range (-1, 1)
  • flat-field correction and ring reduction for the synchrotron dataset
Dataset Procedures Code
Low Dose Grand Challenge train/test split -> rescale intensity values to the range (-1, 1) preprocess_lodochallenge.py
LoDoInd train/test split -> rescale intensity values to the range (-1, 1) preprocess_lodoind.py
Synchrotron flat-field correction->log transformation->ring reduction->reconstruction reconstruct_rocks_fbp.py
Synchrotron cropping->flat-field correction->log transformation->ring reduction->reconstruction->roughly align value ranges preprocess_rocks.py

Pretrained diffusion models

All pretrained models are available here and on HuggingFace.

Dataset Type Pretrained model (google drive) HuggingFace
Low Dose Grand Challenge pixel pixel diffusion model jiayangshi/lodochallenge_pixel_diffusion
Low Dose Grand Challenge latent latent diffusion model jiayangshi/lodochallenge_latent_diffusion
LoDoInd pixel pixel diffusion model jiayangshi/lodoind_pixel_diffusion
LoDoInd latent latent diffusion model jiayangshi/lodoind_latent_diffusion
Synchrotron pixel pixel diffusion model jiayangshi/synchrotron_pixel_diffusion
Synchrotron latent latent diffusion model jiayangshi/synchrotron_latent_diffusion

CT Reconstruction Methods

Method Type Code
Diffusion reconstruction pixel reverse_sample_pixel_ct.py
Diffusion reconstruction latent reverse_sample_latent_ct.py
Diffusion unconditional generation uncond_gen.py
INR reconstruction reverse_sample_ct_inr.py
DIP reconstruction reverse_sample_ct_dip.py
MBIR ADMM-PDTV & FISTA-SBTV reverse_sample_ct_mbir.py
Transformer SwinIR train & inference train_reverse_sample_ct_swinir.py

Training Diffusion Models from Scratch

Method Type Code
Diffusion pixel train_pixel.py
Diffusion latent train_latent.py

Citation

@inproceedings{
shi2026dmct,
title={{DM}4{CT}: Benchmarking Diffusion Models for Computed Tomography Reconstruction},
author={Shi, Jiayang and Pelt, Dani{\"e}l M and Batenburg, K Joost},
booktitle={The Fourteenth International Conference on Learning Representations},
year={2026},
url={https://openreview.net/forum?id=YE5scJekg5}
}

About

Code for ICLR2026 paper - DM4CT: Benchmarking Diffusion Models for Computed Tomography Reconstruction

Topics

Resources

Stars

28 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages