Manuscript Offprint

arXiv:2608.24342

Metadata-Aware Adaptation of a Generative Foundation Model for Conditional CMR Synthesis

Marc Rodríguez, Grzegorz Skorupko, Nay Aung, Steffen E Petersen, Karim Lekadir, Polyxeni Gkontra

1 st^{st} Marc Rodríguez 1^{1}, 2 nd^{nd} Grzegorz Skorupko 2^{2}, 3 rd^{rd} Nay Aung 3,4^{3,4}, 4 th^{th} Steffen E Petersen 3,4^{3,4}, 5 th^{th} Karim Lekadir 2,5^{2,5}, 6 th^{th} Polyxeni Gkontra 2^{2}

Facultat de Matemàtiques i Informàtica, Universitat de Barcelona, Spain

Barcelona Artificial Intelligence in Medicine Lab (BCN-AIM), Facultat de Matemàtiques i Informàtica, Universitat de Barcelona, Spain

William Harvey Research Institute, NIHR Barts Biomedical Research Centre, Queen Mary University London, Charterhouse Square, London, UK

Barts Heart Centre, St Bartholomew's Hospital, Barts Health NHS Trust, West Smithfield, London, UK

Institució Catalana de Recerca i Estudis Avançats (ICREA), Passeig Lluís Companys 23, Barcelona, Spain

polyxeni.gkontra@ub.edu

Abstract—Synthetic image generation is a promising strategy to address data scarcity and the underrepresentation of clinically important phenotypes in medical imaging, yet generating images that faithfully reflect meaningful patient characteristics remains challenging. In this work, we investigate metadata-conditioned cardiac magnetic resonance (CMR) synthesis using a pretrained latent diffusion model, encoding structured clinical metadata and slice position as textual prompts to guide CMR generation. To improve metadata adherence and address the imbalance of clinical attributes, we integrate three strategies: Metadata-Free Classifier-Free Guidance (CFG), Contrastive Batching, and Inverse-Frequency Sampling. The framework was fine-tuned and evaluated on 59,058 short-axis CMR from the UK Biobank using paired image similarity, distributional fidelity, and subgroup-level analyses. The combined approach achieved a Fréchet Inception Distance (FID) of 37.47, improving by 57.04% over the same model fine-tuned without these strategies and by 28.68% over a previous text-conditioned CMR diffusion baseline requiring cardiac geometry as additional input, while relying solely on patient metadata. This distributional gain, driven mainly by Metadata-Free CFG, came with a modest reduction in paired similarity, suggesting that the model prioritizes population-level realism over exact image reproduction. Subgroup analyses demonstrated improved alignment across demographic and acquisition-related metadata, with disease-specific conditioning being the most challenging task. These findings demonstrate the potential of generative foundation models for clinically meaningful CMR synthesis while highlighting the need for more effective metadata-aware conditioning strategies. Our code is available at https://github.com/rodriguezmarc/conditional-cmr.

I. INTRODUCTION

Cardiac Magnetic Resonance (CMR) is the reference modality for non-invasive cardiac assessment, playing a pivotal role in the diagnosis, prognosis, and monitoring of cardiovascular disease [1]. Building upon the rich information provided by CMR, recent advances in machine learning have demonstrated significant potential for enhancing automated CMR analysis and supporting clinical decision-making [2], [3], [4]. Nonetheless, privacy restrictions, the high cost of expert annotation, and the inherent scarcity of certain patient populations and disease phenotypes result in limited and imbalanced datasets [5], [6], [7]. Thus, as medical image analysis has moved from isolated proof-of-concept models towards clinically relevant systems, the primary bottlenecks to developing robust and clinically applicable AI models have shifted from model architecture to data availability, diversity, and quality [8].

Synthetic image generation has emerged as a practical strategy for addressing these limitations, thus supporting data augmentation [9], privacy-preserving experimentation [10] and fairness-aware dataset balancing [11]. Recent diffusion models have substantially improved the realism and diversity of synthetic medical images [12]. However, visual plausibility alone is insufficient; clinically meaningful synthesis also requires generated images to faithfully reflect patient metadata. Recently, the MINIM framework [13] demonstrated that a single text-conditioned generative model can synthesize clinically useful images across multiple modalities and anatomical sites, improving downstream clinical tasks. However, MINIM was not evaluated on CMR, and metadata-conditioned synthesis, as demonstrated for other anatomies such as the brain [14], remains largely unexplored.

In this work, building on the MINIM text-conditioning paradigm, we adapt a general-domain latent diffusion model to the CMR domain by encoding structured patient metadata together with slice position as textual prompts. Unlike MINIM, which relies on large-scale multimodal medical pretraining and a self-improving reinforcement loop, we fine-tune from public Stable Diffusion weights, and focus on metadata-aware conditioning and sampling strategies to mitigate class imbalance, enabling the generation of clinically meaningful short-axis CMR images. The proposed framework improved distributional fidelity (FID) over both a fine-tuned baseline and a previous CMR diffusion baseline [15] requiring cardiac geometry, while relying solely on metadata. We further analyze how conditioning reliability varies across metadata attributes with differing levels of class imbalance.

  1. EXAMPLE PROMPT

Metadata-aware conditioning (positive prompt)

• cardiac MRI

• short-axis view

• end-systolic frame

• central slice

• healthy heart

• obese patient

• male patient

• in their 50s

Metadata-free / unconditional (negative-prompt)

• cardiac MRI

• short-axis view

• end-systolic frame

  1. DATA PREPARATION & FINE-TUNING PIPELINE (Stable Diffusion)

Figure

2.2 Fine-tuning Pipeline

Prompt /

Metadata

Prompt /

Metadata

Contrastive Batching

Prompt /

Metadata

2.2 Fine-tuning Pipeline

Prompt /

Metadata

Text Encoder

Text Conditioning

Iterative Denoising

Random

Noise Latent

U-Net

VAE

Decoder

Generated

CMR Image

Diffusion Loss

Ldiff=∥ϵ−ϵa∥22\mathcal{L}_{diff} = \| \epsilon - \epsilon_a \|_2^2

  1. CMR IMAGE GENERATION (Inference)

Prompt /

Metadata

Text Encoder

(CLIP)

Text Conditioning

Iterative Denoising

VAE

Decoder

Fig. 1. Overview of the combined conditional CMR image generation pipeline. Target CMR characteristics are encoded as text prompts and fed to a pretrained latent diffusion model, which is then fine-tuned using the proposed techniques to improve metadata adherence and mitigate class imbalance during training.

References (24)