TL;DR
Current general-purpose Vision-Language Models (VLMs) fail completely at detecting fine-grained topological errors in tubular networks like blood vessels or road maps. Topo-R1 solves this by introducing a two-stage training paradigm—Supervised Fine-Tuning (SFT) followed by Reinforcement Learning via Group Relative Policy Optimization (GRPO)—steered by a novel, topology-aware composite reward function that prioritizes structural connectivity over superficial pixel overlap.
What Problem Does This Paper Address?
In tubular structures such as blood vessels, nerve fibers, and road networks, topology is everything. A single missing pixel can sever a critical vessel and invalidate a hemodynamic simulation, while a spurious bridge can ruin a navigation graph.
Unfortunately, standard segmentation metrics like the Dice score are blind to these critical connectivity issues; a mask can score a high 0.91 Dice coefficient while harboring catastrophic topological breaks.
While modern VLMs excel at general visual question answering and spatial reasoning, this paper reveals a stark gap: they perform nearly at random when tasked with localizing and classifying topological anomalies. This is a "needle-in-a-haystack" problem. Topological features are sparse and localized, requiring a model to trace long-range connectivity across an entire network—a capability completely absent from models trained purely on standard visual datasets.
Methods
To teach VLMs topology-aware perception, the authors developed Topo-R1, which utilizes a two-stage training framework:
- Supervised Fine-Tuning (SFT) Cold Start: Pure reinforcement learning struggles when the action space is text formatting. SFT is used first to teach the model schema compliance (outputting structured JSON bounding boxes) and basic localization.
- Reinforcement Learning via GRPO: The model is then optimized using Group Relative Policy Optimization (GRPO), which samples multiple outputs per query and normalizes rewards within the group, eliminating the need for a bulky, separate critic network.
The core innovation lies in the Topology-Aware Composite Reward Function:
- Format Reward ($R_{fmt}$): A binary gate ensuring the output parses into valid coordinates and error types.
- Accuracy Reward ($R_{acc}$): Uses type-aware Hungarian matching to pair predictions with ground truths, applying a smooth, non-linear tiered mapping to reward precise bounding box alignments.
- Topological Reward ($R_{topo}$): Instead of relying on pixel-area IoU, this component computes centerline-Dice (clDice) on cropped patches of the predicted and ground-truth skeletons. This directly rewards the model for capturing the underlying skeleton structure, modulated by a penalty to prevent the model from cheating by outputting oversized bounding boxes.
Datasets
Because no dataset paired segmentation masks with localized topological anomalies, the authors built an automated, multi-domain data-curation pipeline.
The pipeline injects four types of errors—broken connections, spurious connections, missing branches, and extra branches—and mathematically verifies them by checking changes in Betti numbers ($\beta_0$ for disjoint fragments, $\beta_1$ for loops).
The benchmark includes:
- In-Distribution (ID): 12,900 SFT samples, 50,300 RL samples, and 4,246 test samples across aerial roads, surface cracks, and retinal vasculature (OCTA).
- Out-of-Distribution (OOD): 1,564 samples from entirely unseen domains: HALVS (leaf veins) and DRIVE (retinal fundus photography).
- Real-World Stress Test: ~600 samples generated from actual deployment errors made by a pretrained nnU-Net segmentation model.
Key Insights and Ideas
- Scale Alone Does Not Solve Topology: Massive closed-source models like GPT-4o and Gemini-2.5-Flash achieve near-zero F1 scores on topological anomaly detection. Tracing pixel-thin connections requires explicit structural rewards, not just more parameters.
- SFT Limits, RL Propels: SFT teaches the model how to speak (JSON formatting), but next-token prediction causes it to default to empty predictions on uncertain, complex structures. RL training is what actually forces the model to structurally inspect the image.
- Synthetic Training Transfers to Real Errors: Even though Topo-R1 was trained on procedurally injected synthetic errors, its performance held up remarkably well against the messy, drifting boundary errors produced by real-world deployment models like nnU-Net.
Key Results
Topo-R1 achieves massive performance leaps over baseline VLMs and even surpasses specialized, supervised object detection models:
- In-Distribution Breakthrough: On the Qwen3-VL-4B backbone, Topo-R1 rocketed from a zero-shot [email protected] of 0.0% and an SFT score of 23.0% up to 45.2%.
- Beating Supervised Baselines: Topo-R1 (45.2% F1) outperformed fully supervised object detectors like YOLOv8 (30.7% F1) and DINO-DETR (32.9% F1) trained directly on the same 4-channel inputs.
- Strong OOD Generalization: On unseen leaf textures and fundus photography, Topo-R1 maintained a massive margin (45.5% [email protected]) over SFT (24.4%) and zero-shot models (~1.0%), proving it learns a transferable concept of "topological consistency" rather than memorizing dataset biases.
Limitations and Future Work
Despite its success, the authors note a few limitations:
- Scale Constraints: The framework was only evaluated on edge-scale VLMs (2B to 8B parameters). Testing on frontier-scale models remains unverified.
- Contextual Ambiguity: The model relies solely on a single input image. In highly ambiguous regions (e.g., severely occluded vessels), it can flag legitimate visual gaps as errors. The authors recommend treating Topo-R1 as a "candidate flagger" for human-in-the-loop verification.
- Future Directions: Promising next steps include scaling to larger backbones, incorporating multi-image references, and training directly on real-world segmentation failures rather than synthetic injections.
Summary updated