Topo-R1 Catches Hidden Map Errors 30x Better Than GPT-4o
A new framework teaches vision-language models to spot broken vessels, missing branches, and phantom bridges in segmentation masks, without any ground truth.
ProTakeaways
- Topo-R1 detects topological errors in segmentation masks without ground-truth supervision, via vision-language models.
- Frontier VLMs like GPT-5.2 and Gemini 2.5 Flash score under 2% F1@0.5 on this task, essentially random.
- Automated pipeline injects four verified error types (broken/spurious connections, missing/extra branches) using Betti-number checks.
- Two-stage training: supervised fine-tuning plus GRPO with a composite reward including type-aware Hungarian matching and clDice.
- Best result reaches 45.2% F1@0.5 on Qwen3-VL-4B, roughly 30x the strongest closed-source baseline.
- Generalizes zero-shot to leaf venations and unseen retinal datasets; benchmark and pipeline will be released.
A segmentation mask can score a shiny 0.91 Dice against ground truth and still be quietly broken. A single missing pixel can sever a blood vessel; a thin spurious bridge can wire two roads into a phantom intersection that corrupts an entire navigation graph. These are topological errors, and until now nobody had a good way to find them once a model was deployed to a new domain with no labels.
Topo-R1 is a new framework from Stony Brook, Harvard Medical School, Stanford, and Penn State that reframes this problem as a visual reasoning task and teaches vision-language models to locate and classify topological anomalies directly on predicted masks. It uses a two-stage training paradigm of supervised fine-tuning followed by reinforcement learning with Group Relative Policy Optimization (GRPO), with a topology-aware composite reward that integrates type-aware Hungarian matching for classification, spatial localization scoring, and a centerline Dice (clDice) reward that penalizes connectivity disruptions.

Why frontier VLMs flunk the vessel test
The authors first ran a stress test on the usual suspects, GPT-4o, GPT-5.2, Gemini 2.5 Flash, and Qwen3.5-Plus, asking each model to find broken connections and spurious bridges in tubular masks. The results were brutal. Across four canonical topological anomalies (broken/spurious connections, missing/extra branches), leading closed and open-source VLMs performed nearly at random, indicating that topology-aware perception is largely absent from current general-purpose VLMs. The best zero-shot score from a closed model was 1.5% F1 at IoU 0.5.
Why so bad? Two reasons. First, pretraining data emphasizes medium and large-scale visual patterns, with almost no signal for topology. Second, topological errors are a needle-in-a-haystack problem: one missing pixel among thousands correctly labeled ones can sever a critical connection. Unlike object detection, there are no salient visual cues to guide attention, and the model must trace long-range connectivity across the whole network. Few-shot prompting did not help either, capping out at 0.5% F1 across shot counts.
Synthesizing errors you can actually verify
There is no dataset that pairs segmentation masks with localized anomaly annotations, so the team built one. Their automated curation pipeline aggregates images from road networks, surface crack detection, and retinal vasculature, then injects controlled errors into the morphological skeleton of each mask.

The taxonomy is a clean two-by-two: connectivity errors (broken vs. spurious connections) that change the global graph, and branching errors (missing vs. extra branches) that alter local skeleton endpoints. Crucially, every injection is checked by computing Betti numbers before and after. Betti numbers are algebraic invariants where missing a connected vessel entirely alters the blood-flow dynamics, so verifying that beta-0 (connected components) or beta-1 (loops) actually changed guarantees a genuine topological perturbation rather than a cosmetic pixel edit. Failed injections retry up to 20 times.
The result is the first large-scale benchmark for the task:
- 12,900 samples for supervised fine-tuning
- 50,300 samples for reinforcement learning
- 4,246 in-distribution test samples spanning roads, OCTA-3M, OCTA-6M, and cracks
- 1,564 out-of-distribution samples from DRIVE and HALVS retinal datasets
- Error counts stratified into a curriculum: 0, 1, 2 to 5, and 6 to 10 errors per patch
The reward that actually teaches topology
The heart of Topo-R1 is a composite reward with three weighted parts: a format gate (0.10), an accuracy term (0.85), and a topological term (0.05). The accuracy reward is where most of the work happens. Predictions are matched to ground-truth errors using type-aware Hungarian matching, meaning bipartite assignment is solved separately within each of the four error types. A prediction that finds the right pixels but assigns the wrong type is counted as both a false positive and a false negative, so classification correctness is strictly enforced.
Raw IoU makes a lousy reward, because it changes non-linearly during training and gives flat signal near the boundaries that matter. The authors instead map IoU through a piecewise power function with tier thresholds at 0.3, 0.5, 0.7, and 0.9 and rewards of 0.25, 0.55, 0.80, and 1.0. This gives sharper shaping precisely at the IoU cutoffs used for evaluation. Ablations show this design beats raw IoU by 27 to 35 points at F1@0.3.
The final piece is a type-conditioned clDice reward. clDice is a similarity measure calculated on the intersection of segmentation masks and their morphological skeleta, and it guarantees topology preservation up to homotopy equivalence for binary 2D and 3D segmentation. Topo-R1 uses (1 - clDice) as a reward on matched pairs, so predictions that land on regions where the corrupted skeleton diverges from ground truth get topological credit. A localization penalty kicks in when a box exceeds 30% of the image, discouraging the model from cheating with oversized regions.
The numbers
Trained on four open-source backbones (InternVL-2.5-2B, Qwen2.5-VL-3B, and Qwen3-VL-4B/8B), Topo-R1 blows past every zero-shot baseline. The best result of 45.2% F1@0.5 on Qwen3-VL-4B is roughly 30x better than the strongest closed-source model at 1.5%. SFT alone gets to 23%; the GRPO stage adds another 22 points. The gains are consistent across all four error types, with broken connections jumping from near-zero to over 30% F1 in the harder categories.
Generalization holds up. On leaf venation networks, a domain the model never saw during training, Topo-R1 still localizes broken and spurious connections correctly.

Where it helps, and where it still struggles
The practical case for Topo-R1 is quality assurance for segmentation pipelines in domains where you cannot afford expert annotation: retinal vessel analysis, road network mapping from aerial imagery, crack inspection, neural circuit tracing, or any downstream task where connectivity governs the answer. Instead of trusting a Dice score, you get typed bounding boxes pointing at exactly where the topology broke, which experts can verify quickly or feed into active learning loops.
The weaknesses are honest. Performance degrades as the number of errors per image grows from 1 to 6-10, even if Topo-R1 stays substantially ahead of SFT at every density. Broken connections and extra branches remain harder than spurious connections, because they involve subtle pixel-level changes rather than salient visual bridges. Small ground-truth boxes are also disproportionately punished by IoU because minor offsets tank the score, which is why the paper reports at multiple thresholds.
The team says both the curation pipeline and benchmark will be publicly released. Base checkpoints are standard Qwen and InternVL variants, so anyone with a handful of RTX 6000 Ada or H100 GPUs can reproduce the training recipe.