Quantum Diffusion Models for Medical Image Analysis
Authors: Francesco Aldo Venturelli, Stefano Martina, Marco Parigi, Filippo Caruso, Alba Cervera-Lierta, Miguel A. González Ballester
Organizations: BCN Medtech, Department of Engineering, Universitat Pompeu Fabra, Barcelona, Spain · Barcelona Supercomputing Center, Barcelona, Spain · Department of Physics and Astronomy, University of Florence, Sesto Fiorentino, Florence, Italy · LENS - European Laboratory for Non-Linear Spectroscopy, University of Florence, Sesto Fiorentino, Florence, Italy · ICREA, Barcelona, Spain
Quantum Machine Learning is a novel field of research aimed at devising machine learning approaches exploiting principles of quantum mechanics, such as superposition, entanglement and interference. In this context, we present a scalable hybrid Quantum Diffusion Model, and evaluate its use for medical image analysis. Specifically, our method is based on a Discrete-Time Quantum Walk algorithm, executed on a real quantum device, to model the forward dynamics of the diffusion model. For the backward step of the diffusion model, we devise and evaluate a classical learning model, which is used to reversely denoise the data. In contrast with other existing attempts at applying quantum machine learning for image analysis tasks, severely limited by the size of existing quantum devices, our method allows to process real-world large size medical data. In particular, we present results on grayscale and RGB images, as well as 3D volumes of moderate sizes. We benchmark our results by reproducing an alternative classical counterpart model, based on diffusion models on discrete state spaces. By doing so, we compare the generation capabilities of both models in terms of three distinct state-of-the-art metrics in the field of image generation, showing the competitive, promising results of our approach.
Figures & tables
Figure 1: Hybrid quantum diffusion model. Given an initial image x0 at time t=0 , every single pixel is associated with a quantum walker whose corresponding color i0 is initially encoded in the quantum state ∣i0⟩ . The depicted quantum circuit visualizes only one of the multiple time steps of the dtqw algorithm, where ∣ψpos⟩≡∣i0⟩ , ∣ψcoin⟩≡∣0⟩ , H are Hadamard gates, Rk are gates diag(1,exp(2πi/2k)) (and their controlled versions diag(1,1,1,exp(2πi/2k)) ), F† is the inverse Quantum Fourier Transform [ 57 ] , and C is the coin operation (implemented in our case with a Hadamard gate). The green-shaded block is repeated for the needed time steps. To obtain the pixel values of xt at time t we perform a single measurement of every noisy state ρt after t steps of evolution of each walker. Then, for every pixel we reinitialize ∣ψpos⟩ with the obtained value, ∣ψcoin⟩ with ∣0⟩ , and we perform a further single step to obtain the states ρt+1 and the corresponding xt+1 . To train the classical backward model, we minimize for all values of t the difference between the pixel-value distribution of xt and the output x^t of a U-Net model that takes xt+1 as input. Finally, to generate new images x^0 we start from samples x^T of uniform noise and we iteratively apply the trained model.
Model evaluation on 2D and 3D images
Dataset
KL
FID
SSIM
Classical
Quantum
Classical
Quantum
Classical
Quantum
β=0.9
β=βt
β=0.9
β=βt
β=0.9
β=βt
BloodMNIST
0.098
0.046
0.090
274.4
166.6
243.3
0.220
0.336
0.377
BraTS2020
0.396
0.192
0.124
280.3
266.8
297.7
0.646
0.569
0.676
FractureMNIST3D
0.047
0.013
0.011
169.6
100.1
89.70
0.564
0.550
0.564
Table 1: Quantitative evaluation across the three datasets using kl divergence, fid , and ssim . Lower kl divergence and fid indicate better distributional alignment, while higher ssim means good structural similarity. The metrics are calculated for 100 generated samples and, regarding the 3D volumes, the reported fid value corresponds to the average of different volume slices ( z=5,10,15,20,25 ).
Figure 2: Five samples of the original set of BloodMNIST images Fig. 2a and five samples of images generated by our model Fig. 2b . Each image has a shape of 64×64 with 32 intensity levels for each RGB channel.
Figure 3: BloodMNIST distribution of the two largest eigenvalues of the pca for 3000 original samples (purple) and 100 generated samples (orange). The contours represent the kde .
Figure 4: Five samples of the original set of BraTS2020 images Fig. 4a and five samples of the brain images generated by our model Fig. 4b . Each image has a shape of 190×190 with 64 intensity levels.
Figure 5: BraTS2020 images distribution of the two largest eigenvalues of the pca for 450 original samples (purple) and 100 generated samples (orange). The contours represent the kde .
Figure 6: Volume rendering of 5 distinct samples from Fig. 6a the original dataset FractureMNIST3D and Fig. 6b generated volumes produced by the 3D U-Net. Renderings generated using 3D Slicer.
Figure 7: FractureMNIST3D distribution of the two largest eigenvalues of the pca for 1370 original samples (purple) and 100 randomly generated samples (orange). The contours represent the kde .
Figure S1: Comparison between two classical Markov chains. The network in Fig. S1a shows a first-neighbor chain, while the network in Fig. S1b is fully connected, allowing the walker to move to any of the N−1 remaining nodes.
Figure S2: Batch of 100 random BloodMNIST images.
Figure S3: Diffusion process executed on IBM Torino for T=30 steps using the dtqw on BloodMNIST with 32 states (top) and backward process performed by the U-Net trained for ∼20000 epochs (bottom). We show the evolution for 9 random combined samples of original and reconstructed images and the evolution of the pixel-value distribution for the three channels (in red, green and blue). The visualized target distribution is the Uniform for the forward and the one of the original dataset for the backward. We also report the kl divergence between the data and target distributions and the final fid of the final generated images.
Figure S4: Diffusion process performed with the classical Markov chain on a 32-node ring network embedding pixel intensity levels with nearest-neighbor connection of RGB BloodMNIST images (Top) and backward process performed by the U-Net trained for ∼20000 epochs (Down). The β scheduler is kept fixed β=0.9.
Figure S5: Diffusion process performed with the classical Markov chain on a 32-node ring network embedding pixel intensity levels with full connection of RGB BloodMNIST images (Top) and backward process performed by the U-Net trained for ∼20000 epochs (Down). The β scheduler varies at each time step according to Eq. S9 .
Figure S6: Batch of 100 random BraTS2020 images.
Figure S7: Diffusion process executed on IBM Torino for T=30 steps using the dtqw on grayscale BraTS2020 brain images of 64 states. The top row shows the forward process, while the bottom row shows the backward process performed by the U-Net trained for ∼20000 epochs. We show the evolution of 9 random combined samples of original and reconstructed images and the evolution of the pixel-value distribution compared with the target distribution.
Figure S8: Diffusion process performed with the classical Markov chain on a 64-node ring network embedding pixel intensity levels with nearest-neighbour connections. The top row shows the forward process, while the bottom row shows the backward process performed by the U-Net trained for ∼20000 epochs. The β scheduler is set to 0.9 with T=900 steps, reaching a uniform distribution.
Figure S9: Diffusion process performed with the classical Markov chain on a 64-nodes ring fully-connected network embedding pixel intensity levels (Top) and backward process performed by the U-Net trained for ∼20000 epochs (Down). The β scheduler is βt and requires only 30 time steps to converge.
Figure S10: PCA projections on the BloodMNIST dataset comparing the two distinct versions of the classical DMs.
Figure S11: PCA projections on the BraTS2020 dataset comparing the two distinct versions of the classical DMs.
Figure S12: PCA projections on the FractureMNIST dataset comparing the two distinct versions of the classical DMs.
Quantum diffusion models provide a physics-consistent route to generative learning by formulating noising and denoising directly on quantum states. However, applying such models to classical high-dimensional data is constrained by the qubit cost of state encoding and the computational burden of simulating large density operators. We propose a scalable hybrid generative pipeline that combines a classical autoencoder for dimensionality reduction with a mixed-state quantum denoising diffusion probabilistic model (MSQuDDPM) operating in the learned latent space. The autoencoder compresses data into compact latent codes that can be embedded into a small-qubit Hilbert space, after which the quantum diffusion model learns a generative distribution over latent density operators and decodes samples back to the original domain. Algorithmically, we simplify the reverse dynamics by predicting an estimate of the clean state ρ0 at timestep t and computing the one-step reverse update via an analytic backward propagation rule, rather than learning an explicit predictor for ρt−1. We demonstrate the proposed approach on MNIST image generation and discuss how mixed-state quantum diffusion can serve as a practical backbone for hybrid quantum--classical generative modeling under realistic qubit budgets.
Qipeng Qian, Keli Deng, Yuntao Qian
Program of Applied Mathematics, Department of Mathematics, University of Arizona, Tucson, USA · College of Computer Science and Technology, Zhejiang University, Hangzhou, China
Quantum Diffusion Models (QDMs) are an emerging paradigm in Generative AI that aims to use quantum properties to improve the performances of their classical counterparts. However, existing algorithms are not easily scalable due to the limitations of near-term quantum devices. Following our previous work on QDMs, here we propose and implement two physics-inspired protocols. In the first, we use the formalism of quantum stochastic walks, showing that a specific interplay of quantum and classical dynamics in the forward process produces statistically more robust models generating sets of MNIST images with lower Fréchet Inception Distance (FID) than using totally classical dynamics. In the second approach, we realize an algorithm to generate images by exploiting the intrinsic noise of real IBM quantum hardware with only four qubits. Our work could be a starting point to pave the way for new scenarios for large-scale algorithms in quantum Generative AI, where quantum noise is neither mitigated nor corrected, but instead exploited as a useful resource.
Marco Parigi, Stefano Martina, Francesco Aldo Venturelli +1
Department of Physics and Astronomy, University of Florence, Via Sansone 1, Sesto Fiorentino, 50019, Florence, Italy. · LENS - European Laboratory for Non-Linear Spectroscopy, University of Florence, Via Nello Carrara 1, Sesto Fiorentino, 50019, Florence, Italy. · Department of Engineering, Pompeu Fabra, T`anger 122-140, Barcelona, 08018, Barcelona, Spain.
Quantum generative modeling is a rapidly evolving discipline at the intersection of quantum computing and machine learning. Contemporary quantum machine learning is generally limited to toy examples or heavily restricted datasets with few elements. This is not only due to the current limitations of available quantum hardware but also due to the absence of inductive biases arising from application-agnostic designs. Current quantum solutions must resort to tricks to scale down high-resolution images, such as relying heavily on dimensionality reduction or utilizing multiple quantum models for low-resolution image patches. Building on recent developments in classical image loading to quantum computers, we circumvent these limitations and train quantum Wasserstein GANs on the established classical MNIST and Fashion-MNIST datasets. Using the complete datasets, our system generates full-resolution images across all ten classes and establishes a new state-of-the-art performance with a single end-to-end quantum generator without tricks. As a proof-of-principle, we also demonstrate that our approach can be extended to color images, exemplified on the Street View House Numbers dataset. We analyze how the choice of variational circuit architecture introduces inductive biases, which crucially unlock this performance. Furthermore, enhanced noise input techniques enable highly diverse image generation while maintaining quality. Finally, we show promising results even under quantum shot noise conditions.
Jonas Jäger, Florian J. Kiwit, Carlos A. Riofrío
BMW Group, Munich, Germany · Department of Computer Science and Institute of Applied Mathematics, University of British Columbia (UBC), Vancouver, Canada · Stewart Blusson Quantum Matter Institute (QMI), Vancouver, Canada +1