Manuscript Offprint
arXiv:2608.25648MAMA-FLUX.2: Image-to-Image Synthesis of Post-Contrast Breast DCE-MRI for the MAMA-SYNTH Challenge
Kamil Kwarciak [0000-0002-1392-4291] and Marek Wodzinski [0000-0002-8076-6246]
Department of Measurement and Electronics, AGH University of Krakow, Krakow, Poland
Sano Centre for Computational Medicine, Krakow, Poland
{kwarciak,wodzinski}@agh.edu.pl
Abstract. Dynamic contrast-enhanced breast MRI is central to cancer diagnosis and monitoring, but requires gadolinium-based contrast agents. In this work, we address pre-to-post contrast breast MRI synthesis for the MAMA-SYNTH challenge. We propose MAMA-FLUX.2, a conditional latent flow-matching approach based on FLUX.2-Klein-4B. The pre-contrast image is encoded as spatial conditioning, while the model predicts the flow field associated with the post-contrast target latent. To adapt the pretrained model efficiently, we use LoRA fine-tuning and introduce a regional training objective combining global flow matching, tumor-region supervision, and stable foreground regularization. We further investigate LoRA rank, intensity windowing, and regional loss weights on axial slices, prioritizing clinically relevant tumor-focused metrics. Our ablation study shows that moderate tumor and stable-foreground weighting improves the trade-off between image fidelity and tumor-region accuracy. The final model achieves the best overall balance with LoRA rank/ , MHA , , and . These results demonstrate that compact pretrained rectified-flow transformers can be adapted for contrast-enhanced MRI synthesis using parameter-efficient fine-tuning and task-aware regional losses.
Keywords: MAMA-SYNTH · Breast MRI Synthesis · Rectified Flow
1 Introduction
Dynamic contrast-enhanced magnetic resonance imaging (DCE-MRI) is central to breast cancer imaging, as contrast uptake provides clinically important information about lesion conspicuity, morphology, and enhancement behaviour. However, post-contrast imaging requires intravenous gadolinium administration, increasing examination complexity and patient burden and limiting use in some clinical settings. This has motivated interest in virtual contrast enhancement, where post-contrast images are synthesized from pre-contrast acquisitions.
K. Kwarciak and M. Wodzinski
The MAMA-SYNTH Challenge formalizes this task by evaluating methods that synthesize peak-enhanced post-contrast breast MR images from corresponding pre-contrast inputs [7]. The task is challenging because synthesized images must show plausible enhancement while preserving patient-specific anatomy. Since clinically relevant enhancement is often localized to small tumor regions, global image-level objectives alone may be insufficient. Effective models must therefore produce realistic images, preserve tumor-specific enhancement patterns, and maintain anatomical structures relevant to segmentation and image-level evaluation.
Recent diffusion and flow-based generative models have shown strong performance in high-fidelity image synthesis and image-to-image translation. Latent generative modelling improves efficiency by operating in a compressed representation rather than pixel space [8], while flow matching and rectified-flow formulations provide an effective framework for learning transformations between noise and data distributions [4, 5]. These properties make latent rectified-flow models well suited to conditional medical image synthesis, where realism and structural consistency are both required.
In this work, we adapt FLUX.2-Klein-4B, a compact latent rectified-flow transformer backbone [1], to pre-to-post contrast breast MRI synthesis. We formulate the task as conditional latent rectified-flow modeling: the pre-contrast image is encoded as spatial conditioning, while the model predicts the flow field for a noised post-contrast target latent. To better match the clinical structure of the task, we introduce a three-component objective combining global latent flow matching, tumor-region supervision, and stable-foreground preservation. This encourages accurate contrast synthesis while discouraging unnecessary changes in non-tumor foreground anatomy.
Contributions. Our contributions are threefold. First, we adapt a pre-trained latent rectified-flow transformer to conditional pre-to-post contrast breast MRI synthesis. Second, we introduce a tumor-aware and anatomy-preserving training objective that combines global latent flow matching with regional supervision. Third, we evaluate the effects of LoRA rank, LoRA scaling, and regional loss weighting through an ablation study using both image-quality and tumor-focused metrics.
2.1 Conditional Latent Flow Matching
Let denote the pre-contrast conditioning image and the corresponding clean post-contrast target image. Their VAE latents are given by , and , where denotes the VAE encoder. Given Gaussian noise and a sampled noise level , we construct the noised target latent as
Thus, t = 0 corresponds to the clean target latent, while t = 1 corresponds to pure noise. The corresponding flow-matching target is
Equivalently, since , we have
and therefore
The rectified-flow transformer is conditioned on the pre-contrast latent , the text embedding c, and the timestep embedding, and predicts the flow field
The corresponding estimate of the clean post-contrast latent is
and the synthetic post-contrast image is reconstructed by VAE decoding,
where denotes the VAE decoder.
2.2 Tumor-Aware and Anatomy-Preserving Objective
We train the model using a three-component objective. The first component is the standard global flow-matching loss. For latent element k, corresponding to a channel and spatial position in the latent-error tensor, the squared flow-matching error is
The global loss is defined as
where N is the total number of latent elements.
K. Kwarciak and M. Wodzinski
The second component uses the available tumor mask to emphasize accurate synthesis within the lesion region. Let denote the tumor mask resized to the latent-error resolution and broadcast over latent channels. The tumor-region loss is
The third component encourages preservation of stable foreground anatomy outside the tumor. We define an image-space stable-foreground mask as
where suppresses background regions and excludes strongly enhancing tissue. We set these thresholds empirically to and . After resizing this mask to the latent-error resolution and broadcasting it over latent channels, we obtain . The stable-foreground loss is
The final training objective is
where and control the relative contributions of the tumor-region and stable-foreground objectives, respectively.
3 Experiments
3.1 Dataset
We use MAMA-SYNTH challenge data, derived from the MAMA-MIA breast DCE-MRI dataset [3]. Each sample contains a paired pre-contrast image and peak-enhanced post-contrast target. Images are provided as 2D z-score-normalized MHA slices, with tumor masks for regional supervision and evaluation.
3.2 Preprocessing
We follow the official MAMA-SYNTH preprocessing protocol to convert DCE-MRI volumes into paired 2D slices. For each case, the pre-contrast acquisition is used as the conditioning input, while the peak-enhanced post-contrast slice is used as the synthesis target. All slices are resampled and stored as 2D MHA images, with spatial metadata preserved for evaluation. Image intensities are z-score normalized using the dataset-level pre-contrast statistics provided by the challenge. During training and inference, normalized MHA intensities are linearly clipped and mapped to the image range expected by the pretrained latent rectified-flow model. Unless otherwise stated, we use as the z-score window for the final model, while alternative upper bounds are evaluated in the ablation study. Since the pretrained model expects three-channel inputs, each scalar MHA slice is replicated across the RGB channels before VAE encoding. After decoding, the prediction is converted back to a single-channel normalized MHA slice.
3.3 Experimental Setup
Anatomical Plane Routing Initial experiments suggested that plane-specific adaptation improves synthesis quality. We therefore train separate LoRA adapters for axial and sagittal slices. Although the MAMA-SYNTH validation and test sets are expected to contain axial slices, this routing mechanism supports both acquisition planes (Figure 1). A lightweight binary logistic-regression classifier predicts the anatomical plane of each pre-contrast slice and selects the corresponding adapter for inference. Image synthesis is then performed by the FLUX.2-Klein-4B backbone conditioned on the input image. The classifier uses hand-crafted features extracted from the 2D MHA slices, including image dimensions, intensity statistics and percentiles, threshold-based pixel fractions, foreground shape descriptors, and coarse row- and column-wise occupancy profiles. The foreground mask is defined as , with , consistent with the stable-foreground loss. Features are standardized, and class imbalance is addressed using balanced logistic-regression weights.
FLUX.2 Fine-Tuning We fine-tune FLUX.2-Klein-4B using low-rank adaptation (LoRA), while keeping the VAE, text encoder, and pretrained transformer backbone frozen. LoRA layers are inserted into the main attention projections of the transformer, including the query, key, value, and output projections of the double transformer blocks, as well as the joint projection and attention output projections of the single transformer blocks. This restricts optimization to a small set of adapter parameters while preserving the pretrained generative prior. The LoRA fine-tuning procedure is presented in Figure 2. For all

Fig. 1. Plane-aware inference routing. A lightweight binary classifier predicts the anatomical plane of the input pre-contrast slice and selects the corresponding axial or sagittal LoRA adapter. The selected adapter is then used by the frozen FLUX.2-Klein-4B backbone for conditional post-contrast synthesis.
K. Kwarciak and M. Wodzinski

Fig. 2. Overview of the proposed MAMA-FLUX.2 fine-tuning pipeline. The pre-contrast slice is encoded into the VAE latent space and used as spatial conditioning for a frozen FLUX.2-Klein-4B rectified-flow transformer. Only LoRA adapters inserted into the attention projections are optimized, while the VAE, text encoder, and pre-trained transformer weights remain frozen.
fine-tuning runs, we use the fixed text prompt: “Synthesize the matching peak-enhancement post-contrast breast DCE-MRI slice from this pre-contrast breast DCE-MRI slice. Preserve anatomy, acquisition plane, lesion location, and keep non-breast background dark.” We perform the main hyperparameter search on axial slices, since the challenge validation and test sets are indicated to be axial. Based on these experiments, we transfer the selected configuration to the sagittal setting. The ablation study varies the LoRA rank and scaling factor, using tied values , the upper MHA intensity window , and the regional loss weights and . The final selected configuration uses , , , and , which provides the best overall trade-off between tumor-focused metrics and global image quality. This final adapter contains 66,846,720 trainable parameters, corresponding to 1.72% of the 3,875,544,576 parameters in the frozen base transformer. The resulting LoRA adapter occupies 255 MiB in memory.
Models are trained with AdamW [6], a constant learning rate, bf16 mixed precision, FSDP, gradient checkpointing, a per-device batch size of 1, and gradient accumulation over 4 steps. This results in an effective batch size of 16 on four NVIDIA GH200 GPUs with 96 GB of VRAM each. At inference, we use 50 rectified-flow sampling steps with guidance scale 4.0. On the evaluation slices used for runtime profiling, with spatial sizes ranging from to , the model call required 11.21 s per slice on average.
Table 1. Ablation study of LoRA rank, MHA maximum value, and regional loss weights. Each row denotes one complete configuration. Results are reported as mean ± standard deviation. Best mean values are highlighted in bold.
| LoRA rank/α | MHA max | DSC ↑ | HD95 ↓ | LPIPS ↓ | MSE ↓ | Tumor SSIM ↑ | ||
|---|---|---|---|---|---|---|---|---|
| 16/16 | 35 | 0.25 | 0 | 0.8192 ± 0.1212 | 31.0522 ± 62.1443 | 0.0913 ± 0.0256 | 0.2956 ± 0.4154 | 0.7717 ± 0.1192 |
| 16/16 | 35 | 1 | 0 | 0.7472 ± 0.2565 | 72.9320 ± 147.1482 | 0.1127 ± 0.0274 | 0.3858 ± 0.6377 | 0.8010 ± 0.1045 |
| 16/16 | 35 | 2 | 0 | 0.7679 ± 0.2075 | 81.3741 ± 148.7569 | 0.1100 ± 0.0307 | 0.3547 ± 0.5304 | 0.7616 ± 0.1882 |
| 32/32 | 35 | 0.25 | 0 | 0.8436 ± 0.1036 | 28.8759 ± 60.5567 | 0.0857 ± 0.0253 | 0.3041 ± 0.4552 | 0.8169 ± 0.0894 |
| 32/32 | 35 | 1 | 0 | 0.8110 ± 0.2001 | 58.5668 ± 143.8272 | 0.1016 ± 0.0278 | 0.3395 ± 0.4910 | 0.7869 ± 0.1917 |
| 32/32 | 35 | 2 | 0 | 0.7890 ± 0.2027 | 61.1797 ± 90.3439 | 0.1118 ± 0.0291 | 0.3571 ± 0.5071 | 0.7999 ± 0.1494 |
| 32/32 | 25 | 0.25 | 0 | 0.8406 ± 0.1221 | 31.4182 ± 61.5544 | 0.0812 ± 0.0269 | 0.2897 ± 0.4651 | 0.8363 ± 0.0891 |
| 32/32 | 25 | 1 | 0 | 0.8380 ± 0.0980 | 27.5710 ± 53.3358 | 0.1021 ± 0.0288 | 0.3384 ± 0.4709 | 0.8368 ± 0.0776 |
| 32/32 | 25 | 2 | 0 | 0.8084 ± 0.1190 | 68.1819 ± 90.7406 | 0.1055 ± 0.0307 | 0.3437 ± 0.4888 | 0.8432 ± 0.0708 |
| 64/64 | 25 | 0.25 | 0.1 | 0.8722 ± 0.0716 | 16.8431 ± 38.9849 | 0.0745 ± 0.0249 | 0.2592 ± 0.3837 | 0.8610 ± 0.0702 |
| 64/64 | 25 | 0.25 | 1 | 0.8263 ± 0.1614 | 33.2027 ± 61.3941 | 0.0710 ± 0.0213 | 0.2144 ± 0.3506 | 0.8672 ± 0.0656 |
| 64/64 | 25 | 2 | 0 | 0.8632 ± 0.0628 | 28.3243 ± 60.4912 | 0.0764 ± 0.0261 | 0.2610 ± 0.4015 | 0.8748 ± 0.0453 |
| 64/64 | 35 | 0.25 | 0.25 | 0.8467 ± 0.1023 | 17.2244 ± 39.2133 | 0.0772 ± 0.0208 | 0.2460 ± 0.3544 | 0.8189 ± 0.1472 |
| 64/64 | 35 | 0.25 | 0.1 | 0.8104 ± 0.1986 | 19.3245 ± 39.7797 | 0.0797 ± 0.0238 | 0.2667 ± 0.3749 | 0.8292 ± 0.0932 |
| 64/64 | 35 | 0.1 | 0.25 | 0.8128 ± 0.2031 | 59.9237 ± 145.0143 | 0.0733 ± 0.0219 | 0.2276 ± 0.3436 | 0.7808 ± 0.1656 |
| 64/64 | 35 | 0.1 | 0.1 | 0.7949 ± 0.1722 | 19.9224 ± 39.2512 | 0.0761 ± 0.0198 | 0.2267 ± 0.3520 | 0.8434 ± 0.0618 |
| 64/64 | 40 | 0.25 | 0.25 | 0.7621 ± 0.2831 | 54.3626 ± 139.6625 | 0.0853 ± 0.0215 | 0.2611 ± 0.3673 | 0.8201 ± 0.1361 |
4 Results
We perform an exploratory hyperparameter analysis on axial slices, as the MAMA-SYNTH validation and test sets are reported to contain axial acquisitions. This analysis is conducted on a small development subset of 10 instances sampled from the available training data. Performance is evaluated using the Sørensen–Dice coefficient (DSC), 95th-percentile Hausdorff distance (HD95), tumor structural similarity index (tumor SSIM), mean squared error (MSE), and learned perceptual image patch similarity (LPIPS). The ablation study in Table 1 suggests that moderate regional supervision provides the most favorable trade-off between global image fidelity and tumor-focused performance in this development setting. In particular, and yield the strongest segmentation-oriented results, achieving the highest DSC and lowest HD95. Increasing the stable-foreground weight while keeping improves image-level metrics such as MSE and LPIPS, but degrades segmentation performance. Conversely, using a stronger tumor-region weight improves tumor ROI similarity in terms of tumor SSIM, but does not provide the best overall balance across metrics. Since the task requires preservation of localized enhancement patterns relevant to downstream tumor assessment, we prioritize DSC and HD95 over small gains in global image similarity. We therefore select the configuration with LoRA rank/, MHA * max = 25, , and as the final setup. Qualitative results presented in Fig. 3 are broadly consistent with the quantitative trends. The selected model preserves the overall breast anatomy and produces spatially aligned enhancement patterns in most shown examples, while residual errors are most apparent in regions with strong or heterogeneous contrast uptake. To provide a fairer qualitative assessment, Fig. 3
K. Kwarciak and M. Wodzinski

Fig. 3. Qualitative results of the selected model (LoRA rank/ , MHA , , ). The predictions preserve the main anatomical structure and produce spatially aligned enhancement patterns in the shown examples. Residual errors are visualized with independently scaled error maps for each case.
also includes a case with visibly higher reconstruction error, illustrating that the model can still struggle with challenging enhancement patterns. Error maps indicate that discrepancies are concentrated primarily around enhancing tissue and tumor-adjacent regions rather than in the background. Overall, these exploratory results indicate that conditional latent rectified-flow modeling is a promising formulation for pre-to-post contrast breast MRI synthesis, particularly when combined with tumor-aware and anatomy-preserving supervision.
5 Limitations
This study is limited by the exploratory ablation on only 10 development cases, so the selected hyperparameters may not generalize to the hidden test set or external cohorts. The method is trained slice-wise and does not enforce volumetric consistency, while the intensity window, regional loss weights, and plane-routing classifier were selected empirically. These design choices should therefore be validated on larger, independent datasets and across different acquisition protocols.
Acknowledgments. We gratefully acknowledge Polish high-performance computing infrastructure PLGrid (HPC Center: ACK Cyfronet AGH) for providing computer facilities and support within computational grant no. PLG/2026/019392. This work was partially supported by the Excellence Initiative Research University program at the AGH University of Krakow.
Disclosure of Interests. The authors have no competing interests to declare that are relevant to the content of this article.
References
-
Black Forest Labs: FLUX.2-klein-4B. https://huggingface.co/black-forest-labs/FLUX.2-klein-4B (2026), hugging Face model card. Accessed: 2026-06-29
-
Esser, P., Kulal, S., Blattmann, A., Entezari, R., Müller, J., Saini, H., Levi, Y., Lorenz, D., Sauer, A., Boesel, F., et al.: Scaling rectified flow transformers for high-resolution image synthesis. In: Forty-first international conference on machine learning (2024)
-
Garrucho, L., Kushibar, K., Reidel, C.A., Joshi, S., Osuala, R., Tsirikoglou, A., Bobowicz, M., Del Riego, J., Catanese, A., Gwoździewicz, K., et al.: A large-scale multicenter breast cancer dce-mri benchmark dataset with expert segmentations. Scientific data 12(1), 453 (2025)
-
Lipman, Y., Chen, R.T., Ben-Hamu, H., Nickel, M., Le, M.: Flow matching for generative modeling. arXiv preprint arXiv:2210.02747 (2022)
-
Liu, X., Gong, C., Liu, Q.: Flow straight and fast: Learning to generate and transfer data with rectified flow. arXiv preprint arXiv:2209.03003 (2022)
-
Loshchilov, I., Hutter, F.: Decoupled weight decay regularization. In: International Conference on Learning Representations (2017)
-
Osuala, R., Joshi, S., van Dijk, J., Han, L., Cosaka, M.L., Mysler, D., Garrucho, L., Lekadir, K., Balocco, S., Diaz, O.: The MAMA-SYNTH Challenge: Synthesizing Virtual Contrast-Enhancement in Breast MRI (Apr 2026). https://doi.org/10.5281/zenodo.19852228, https://doi.org/10.5281/zenodo.19852228, accessed: 2026-06-29
-
Rombach, R., Blattmann, A., Lorenz, D., Esser, P., Ommer, B.: High-resolution image synthesis with latent diffusion models. In: Proceedings of the IEEE/CVF conference on computer vision and pattern recognition. pp. 10684–10695 (2022)