Reinforcement learning enhanced flow matching for reference-based tumor generation on unpaired CT images

Xiaoxuan Gong, Zhilin Zheng, Tiancheng Lin, Qinji Yu, Jianpeng Zhang, Shaoteng Zhang, Kai Cao, Xiaoli Yin, Yu Shi, Jie Ma, Ling Zhang, Yingda XiaNeurIPS 2026

TL;DR

Training AI to spot rare or early-stage tumors is tough because we simply don't have enough scans of them. MedGRPO solves this by taking a real, rare tumor from one patient and seamlessly "growing" a variation of it inside a healthy CT scan of another patient. By combining generative flow matching with reinforcement learning—a first for 3D medical imaging—it creates ultra-realistic synthetic training data that significantly boosts the accuracy of diagnostic models.

What Problem Does This Paper Address?

Medical datasets suffer from a massive "long-tail" problem: common lesions are everywhere, while rare or early-stage tumors—the exact ones doctors need the most help catching—are scarce.

Researchers try to fix this by generating synthetic tumors inside healthy 3D CT scans. However, current methods hit a specification bottleneck. Asking an AI to paint a complex, heterogeneous 3D pathology using only a text prompt ("pancreatic tumor") or a simple binary shape mask is like asking a sketch artist to draw a specific suspect based only on "human face." Lacking detail, models fill in the blanks with smooth, averaged-out textures that lack clinical realism.

What if you handed the model an actual 3D cutout of a rare tumor—an exemplar—as a high-dimensional template? The catch is that we don't have "paired" ground-truth data showing how Patient A's exact tumor would naturally look inside Patient B's anatomy, and naive copy-pasting leaves obvious, artificial seams.

Methods

To pull off seamless, exemplar-guided synthesis without paired data, the authors introduce MedGRPO, built on Conditional Flow Matching (a faster, straighter-trajectory cousin of diffusion models) and trained in two stages:

Figure 1: Overall architecture of MedGRPO. (a) Inference Stage: We generate tumors at arbitrary locations (specified by bounding boxes) within the target CT by conditioning on a exemplar tumor CT and the textual tumor type. The exemplar tumor can be sourced from different CT scans. (b) Supervised Learning Stage: Paired data, consisting of tumor-bearing CTs and their corresponding extracted tumors, are encoded via a VAE into the latent space for Flow Matching training. This process enables the model to learn the general distribution of tumors. (c) Reinforcement Learning Stage: The model is trained using unpaired tumor-free CTs and exemplar tumors. Initially, random samples are generated and evaluated by a reward function. Based on these evaluation results, the model undergoes adapter-based fine-tuning, thereby enhancing its generalization capability on unpaired data.
  1. Supervised Learning (The Foundation): Using standard paired data—a tumor CT and the tumor extracted from that same scan (randomly rotated and scaled to prevent lazy copy-pasting)—a U-Net learns to inpaint tumors inside a latent bounding box, conditioned on the exemplar and a text embedding of the tumor type.
  2. Reinforcement Learning (The Novelty): When given unpaired data (putting Patient A's tumor into Patient B's healthy organ), the supervised model tends to ignore the exemplar. Because there is no ground-truth image to calculate a standard error against, the authors turn to Flow-GRPO (Group Relative Policy Optimization). They inject slight randomness into the generation path to sample a group of candidate scans, score them, and nudge the model toward the winners—all without needing a memory-heavy "Critic" network.

To grade these unpaired generations, they design three custom rewards:

  • Shape reward: Uses a lightweight contrastively-trained network to check 3D morphological similarity to the exemplar.
  • Texture reward: Measures intensity histogram overlap (via Bhattacharyya distance) between the generated and exemplar tumors.
  • Segmentation reward: Checks if a pre-trained diagnostic network actually recognizes the generated lesion as the intended tumor type.

Instead of fine-tuning the whole U-Net during RL—which causes instability—they freeze it and train only a lightweight CNN adapter injected via zero-initialized convolutions.

Datasets

  • Internal 4-Cancer Dataset: A private clinical collection of 15,419 labeled 3D CT scans (1,287 breast, 389 kidney, 6,176 liver, and 4,767 pancreatic tumor cases, plus lesion-free scans used as hosts for synthesis).
  • Tumor Template Dataset: Newly extracted from the 4-Cancer dataset, containing ~1,000 real tumor-only 3D patches per organ to act as exemplars (and ~3,000 extracted tumors used to train the shape-reward network).
  • AbdomenAtlas 2.0: A massive, public external dataset (evaluated on 1,493 liver, 1,135 pancreas, and 2,200 kidney scans) kept completely unseen during training to test real-world, cross-hospital generalization.

Key Insights and Ideas

  • Supervised models learn shortcuts: Without RL, the model learns to generate a plausible-looking tumor in the bounding box, largely ignoring the specific exemplar template when applied to a new patient. RL forces it to actually pay attention to the reference.
  • Rewards compete with each other: Optimizing only for semantic segmentation causes shape fidelity to plummet below baseline; optimizing only for shape hurts segmentation. Jointly averaging normalized advantages across shape, texture, and semantics keeps the model honest and prevents reward-hacking.
  • Resemblance over replication: Conditioning a single healthy CT on different exemplars noticeably alters the generated tumor's morphology to match each template while naturally adapting to the host organ's boundaries.

Key Results

  • Visual Realism: MedGRPO achieves the best (lowest) Fréchet Inception Distance (FID) scores across all 4 organs internally and on 2 of 3 organs externally, eliminating the boundary artifacts seen in diffusion baselines.
Figure 2: Visual comparison of tumors generated by different methods. Synthetic tumors and their corresponding segmentation masks across four distinct organs: pancreas, liver, kidney, and breast are visualized.
  • Downstream Diagnostic Boost: Augmenting an nnUNet segmentation model with MedGRPO's synthetic data significantly improves out-of-distribution Dice Similarity Coefficients (DSC) on the unseen AbdomenAtlas 2.0 dataset—beating the real-data-only baseline by +6.69 (kidney), +4.15 (liver), and +5.12 (pancreas) percentage points, and outperforming competing synthesis tools.
Table 3: Lesion segmentation performance (mean ± standard deviation) on AbdomenAtlas 2.0 datasets.
  • Fooling the Experts: In a blinded study of 200 scans, a junior radiologist misclassified 76.0% of MedGRPO's synthetic tumors as real (55.5% overall accuracy), while a senior radiologist reached 75.0% accuracy (classifyng 38.0% of synthetic cases as real), demonstrating convincing clinical plausibility.

Limitations and Future Work

Not discussed in the paper. (Note: An observation from the training details is that full U-Net fine-tuning during RL leads to instability and poor reward convergence, necessitating the frozen-backbone adapter workaround.)

Summary updated

Abstract

The success of deep learning in medical image analysis is often hindered by the long-tail distribution of disease cases, where rare or early-stage tumors are critically under-represented. While controllable synthesis offers a potential solution, existing methods suffer from a \textit{specification bottleneck}, as low-dimensional signals like text or binary masks fail to capture complex textures and morphological variations. In this paper, we propose an exemplar-driven synthesis framework that utilizes real tumor samples as high-dimensional templates to enable precise, case-specific generation. To the best of our knowledge, this is the first work to introduce reinforcement learning (RL) into the field of 3D medical image generation, called **MedGRPO**. We formulate the unpaired tumor synthesis task as a constrained trajectory optimization problem and leverage Flow-GRPO to find an optimal generation path. By designing a multi-objective reward system encompassing texture, shape, and semantic consistency, our model effectively balances pathological fidelity with anatomical coherence without requiring paired supervision. Rigorous evaluations across four major tumor types and the external AbdomenAtlas 2.0 dataset demonstrate that our method produces high-fidelity synthetic data that significantly enhances the performance of downstream diagnostic models.
BibTeX
@inproceedings{gong2026reinforcement,
  author = {Xiaoxuan Gong and Zhilin Zheng and Tiancheng Lin and Qinji Yu and Jianpeng Zhang and Shaoteng Zhang and Kai Cao and Xiaoli Yin and Yu Shi and Jie Ma and Ling Zhang and Yingda Xia},
  title = {{Reinforcement learning enhanced flow matching for reference-based tumor generation on unpaired CT images}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=zSCkPewf7l},
}
Figure