XFlow: A Workflow Model for Instruction-Guided Lesion Segmentation in Chest X-rays

Geon Choi, Hangyul Yoon, Hyunki Park, Sang Hoon Seo, Edward ChoiarXiv 2026

TL;DR

XFlow is a novel workflow model for instruction-guided lesion segmentation in chest X-rays that mirrors the "coarse-to-fine" diagnostic process used by human radiologists. By combining box-based localization with multi-turn point refinement, it significantly outperforms previous single-shot models, producing cleaner, more accurate masks and effectively identifying when a queried lesion is absent.

What Problem Does This Paper Address?

Automated lesion segmentation in chest X-rays (CXRs) is notoriously difficult due to overlapping anatomical structures and the high level of expertise required for pixel-level delineation. While recent "instruction-guided" models like ROSALIA can handle diverse findings from simple text prompts, they suffer from two major flaws:

  1. Single-Shot Simplification: They attempt to predict a complex mask in one go, whereas radiologists typically survey the thorax, localize an area of interest, and then meticulously refine the boundary.
  2. Mask Quality: Single-shot predictions often result in "noisy" masks with scattered fragments (specks) that don't align with clinical reality.
  3. Presence Detection: Most models assume a lesion is always there, failing to correctly return an empty mask when a patient is healthy or the specific finding is absent.

Methods

XFlow introduces a two-stage workflow that separates coarse-level perception from fine-level refinement:

  • Stage 1: Initial Segmentation: The model (based on the MedGemma VLM) first grounds the lung regions to establish anatomical context. It then decides if the queried lesion is present. If so, it generates a bounding box which is passed to a fine-tuned Segment Anything Model (SAM) to produce an initial mask.
  • Stage 2: Segmentation Revision: The model inspects the initial mask and issues a series of positive or negative "point prompts" (clicks) over multiple turns (up to 4). These clicks tell the SAM module where to expand or shrink the mask until the boundary is satisfactory.
Overview of the XFlow workflow showing Stage 1 (localization) and Stage 2 (point-based refinement).

Training Strategy: The authors use a two-phase training approach for both stages: Supervised Fine-Tuning (SFT) to teach the model the correct output format, followed by Reinforcement Learning (RL) using the GRPO algorithm. The RL phase is crucial as it rewards the model based on the actual IoU (Intersection over Union) gain of the final mask, rather than just imitating text tokens.

Datasets

  • MIMIC-ILS: A large-scale dataset used for initial training, containing diverse CXR findings and automated masks.
  • CheXpercept: A high-quality subset of MIMIC-ILS where masks were reviewed and judged reliable by medical experts. This was used for RL training and internal evaluation.
  • CheXlocalize: An external dataset used to test the model's generalization on masks drawn from scratch by independent radiologists.

Key Insights and Ideas

  • Mirroring Clinical Workflow: The "aha moment" is that segmentation isn't just a vision task; it's a reasoning task. By forcing the model to "think" through lung localization and presence detection before drawing, it avoids many common pitfalls of black-box models.
  • Explicit Reasoning: Every intermediate decision (lung boxes, presence verdict, revision clicks) is written out in text. This makes the model's "thought process" transparent and inspectable by clinicians.
  • RL for Refinement: Using RL (GRPO) allows the model to learn a policy for refinement. It learns how its clicks work together across multiple turns to maximize mask quality, rather than just treating each click as an isolated event.
  • Noise Reduction: By using SAM as the final mask generator steered by geometric prompts (boxes/points) rather than predicting pixels directly, XFlow produces much smoother, continuous regions that look like human-drawn annotations.

Key Results

XFlow sets a new state-of-the-art for instruction-guided lesion segmentation:

  • Quantitative Superiority: On the CheXpercept benchmark, XFlow achieved a gIoU of 0.703, significantly higher than ROSALIA's 0.621.
  • External Validation: On CheXlocalize, it reached a gIoU of 0.283, approaching the human benchmark of 0.314.
  • Cleaner Masks: XFlow produced significantly fewer "specks" (noisy fragments). ROSALIA's masks were 2.6% noise by area, while XFlow's were only 0.14%.
  • Expert Preference: In a blinded study, medical experts preferred XFlow's masks over ROSALIA's twice as often, ranking them nearly as high as the ground truth.
Qualitative comparison showing XFlow's cleaner, more accurate masks compared to noisy baseline models.

Limitations and Future Work

  • Local Correction Limits: The authors note that Stage 2 is designed for local corrections; it cannot recover a lesion that Stage 1 completely missed or change a "not present" decision.
  • Computational Overhead: Multi-turn refinement is inherently slower than single-shot prediction, which might impact real-time clinical use.
  • Future Directions: The authors suggest that the intermediate steps and masks produced by XFlow could serve as a foundation for other complex CXR tasks, such as automated report generation or differential diagnosis.

Summary updated

BibTeX
@misc{choi2026xflow,
  author = {Geon Choi and Hangyul Yoon and Hyunki Park and Sang Hoon Seo and Edward Choi},
  title = {{XFlow: A Workflow Model for Instruction-Guided Lesion Segmentation in Chest X-rays}},
  year = {2026},
  eprint = {2609.34513},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2609.34513},
}
Figure