Topology Agreement Between Raw and Edge Views as Label-Free Supervision for Thin Structures

Segmentation networks for thin, network-like structures such as retinal vessels, roads and neuron fibers break those networks apart when they are moved to a new camera, sensor or geography. The losses that repair these breaks, such as centerline-overlap losses and persistent homology losses (losses that count connected pieces and loops and match them against the ground truth), all need a correct target mask. On an unlabeled target domain, no such mask exists. The usual fallback is to train on the model's own predictions, called pseudo-labels. This fails in two ways. The pseudo-labels already contain the breaks, and the standard way of cleaning them is to erode away the uncertain boundary pixels, which erases a one- or two-pixel-wide structure completely.

We propose getting topological supervision on the target domain from agreement between two views of the same image that fail in different ways. One branch sees the raw image. The other sees an intermediate structural representation: an edge-like or orientation-field map that discards color, contrast and texture. Photometric shift mostly damages the raw branch, while lesions and background line clutter mostly damage the structural branch. A connected piece or loop that both branches predict, at the same place, is therefore much more trustworthy than either branch's prediction alone. We match topological features across the two branches using spatially grounded barcode matching. The agreed features become pseudo-labels that are filtered by topology rather than by pixel confidence. We then train both branches with a topology loss restricted to those agreed features.

Core Claim

A persistence barcode records the connected pieces and loops of a probability map as the threshold is lowered. The induced matching of TopoMatch matches barcodes of a prediction and a ground truth only when the features overlap in space. It does this by comparing both inside a shared map $C=\max(L,G)$, where $L$ is the predicted likelihood map and $G$ the ground truth. Nothing in that construction requires $G$ to be a label. Our claim is that replacing $G$ with the structural branch's prediction gives a useful, label-free matching on target images, provided the raw branch and the structural branch make errors at largely different locations. Under that condition, topology-filtered pseudo-labels should reduce Betti errors (errors in the count of pieces and loops) and raise centerline Dice on the target more than either of two alternatives. The first alternative trains a topology loss on raw pseudo-labels. The second enforces pixel-level agreement between the branches. This condition can be tested before any method is built, and the program starts there.

Relation to Prior Work

Three papers are the closest neighbors, and each leaves out one ingredient. Leveraging Topology for Domain Adaptive Road Segmentation adds a road-skeleton decoder as a domain-invariant anchor. It repairs target pseudo-labels with a hand-written 8-neighborhood gap-bridging search. We replace that heuristic with a matching criterion that asks a second, differently-biased view whether a gap is real. TopoTTA adapts at test time by cutting artificial breaks into confident regions and training the model to reconnect them. It uses a single intensity view, so under strong photometric shift the confident regions it starts from are themselves wrong, and its break heuristic can teach the model to join true endpoints. Our method is training-time adaptation with no inference cost, and it decides what counts as a true connection by cross-view agreement rather than by synthetic breaks. VesselMorph is the direct source of our two-branch design. It pairs an intensity encoder with an encoder over a fixed tensor-field shape map (per-pixel local orientation and tube likelihood) and swaps latent patches between them. However, it uses no topological objective, evaluates only Dice, and concedes that its fixed filter breaks down on lesions. We keep its two views but make their disagreement about topology the training signal.

The remaining papers play narrower roles. Shallow Features Guide Unsupervised Domain Adaptation is a constraint on design. Its erosion of target pseudo-labels to their confident interior is exactly the move that deletes thin structures, so our filter must work on topological features, not pixel margins. BrAD supplies the learned alternative for the structural view. It learns per-domain mappings into a shared edge-like space and shows that such mappings keep information that Canny or HED discard, but it was built for classification and has no connectivity constraint. Making better use of edges via perceptual grouping warns that raw machine edges are fragmented. This is why we do not feed Canny maps to the structural branch without testing that choice. clDice supplies the source-domain topology loss and a primary metric. Its soft skeleton of iterated min- and max-pooling is reused unchanged.

Research Program

The model is a shared-decoder U-Net with two encoders. The intensity encoder reads the image. The structural encoder reads a bridge map $B(x)$. We test two versions of $B$: the fixed tensor field of VesselMorph, and a small learned mapper trained BrAD-style on source images. The learned mapper is additionally regularized so that its output's soft skeleton overlaps the source vessel skeleton. Each encoder feeds its own prediction head, giving likelihood maps $L_I$ and $L_S$. On labeled source data, both heads are trained with the clDice composite loss plus TopoMatch against ground truth.

On unlabeled target images we compute persistence barcodes of the zero-dimensional features (connected pieces) and one-dimensional features (loops) of $L_I$ and $L_S$. We match them by induced matching in $C=\max(L_I,L_S)$. A feature is agreed if it is matched and its persistence exceeds a threshold $\tau$ in both maps. The target pseudo-label is the union of agreed features, obtained by thresholding each branch at its matched death value.

Pixels near the critical points of unmatched features are marked uncertain and excluded from the loss. These are cases where one branch sees a connection and the other sees a gap. We deliberately do not erode, so a one-pixel vessel whose topology both branches agree on stays fully in the label. A variant adds a one-sided veto: an unmatched connection is adopted if the other branch's likelihood at the gap's critical pixel exceeds a high threshold. This variant is ablated rather than assumed.

Both heads are then trained on the target with TopoMatch and soft-clDice against this agreed pseudo-label, and pseudo-labels are refreshed every epoch from an exponential-moving-average teacher. Persistent homology scales cubically in pixel count in the worst case, so matching is done on $256\times256$ target crops. We report wall-clock overhead against plain self-training.

The first stage is the diagnostic that justifies everything else. On pairs with target labels held out for analysis only, we locate each branch's topological errors. Breaks are ground-truth centerline segments missing from the prediction's skeleton, and spurious pieces are predicted components absent from the ground truth. We measure the overlap of the two branches' error locations as intersection-over-union of dilated error sets. If that overlap is high, agreement filtering can only remove errors both branches share, and the method has no reason to work. In that case we stop and report the negative result.

Baselines

The naive reference is a source-only model with the same two-encoder architecture and the same source losses, applied to the target without adaptation. Every adaptation gain is measured against it.

The strongest existing method on the retinal pairs is VesselMorph, the domain-generalized two-branch model. It reports a Dice of 0.7308 on fundus-to-OCTA transfer (ROSE) and 0.7420 on cross-resolution transfer (HRF) in VesselMorph. No topological metric is reported for it, so we will retrain it with its released recipe on our splits and compute clDice and Betti errors ourselves.

On roads, the strongest competitor is the skeleton-anchored adaptation of Leveraging Topology for Domain Adaptive Road Segmentation. It reports margins over prior methods of 9.8% in APLS (Average Path Length Similarity, a route-based connectivity metric) and 6.6% in IoU on SpaceNet to DeepGlobe. The file does not give its absolute values ("no reported result found on Lacuna for" absolute APLS), so we reimplement it.

On neurons and on all four TopoTTA scenarios, the competitor is TopoTTA. It reports gains of 7.74% Dice and 8.51% clDice over the second-best method on Neub1 to Neub2. We run it with its own test-time budget, and we also run a variant allowed the same number of target gradient steps as our training-time adaptation. The second run keeps the comparison from being a contest of compute.

Two further baselines are the simplest routes to the same goal. The first is self-training with soft-clDice and TopoMatch on raw, unfiltered pseudo-labels. The second is that same self-training with the 8-neighborhood gap-bridging refinement taken from the road paper, which makes it the heuristic version of our filter.

Two ablations isolate the key ingredients. Pixel-agreement co-training keeps the same two branches but trains on pixels where both are confident and ignores topology; it tests whether topology-level matching is what matters. Single-view topological agreement replaces the structural branch with a second, strongly augmented copy of the raw image; it tests whether the bridge view matters or whether any two views would do.

Fairness rules apply to every method. All use the same U-Net backbone and input resolution, the same source data, the same target images, the same number of adaptation iterations, and the same hyperparameter search budget of a fixed number of configurations. Model selection uses source validation data only, because selecting on target labels would hide the real difficulty of unsupervised adaptation.

Beating the field means two things. On at least three of the four domain pairs, we must lower both Betti-0 and Betti-1 error below the best competitor with non-overlapping 95% bootstrap intervals over test images. We must also stay within one Dice point of it. A method that gains topology only by thickening vessels does not count, so Dice must not drop, and we additionally check predicted vessel width against ground truth.

Why not just…?

Why not just train clDice or TopoMatch on the model's own target pseudo-labels? This is the most serious alternative, and it is run as a baseline. The concern is that a pseudo-label carries its breaks with it, so the loss pushes the model to reproduce them. The road paper needed a separate gap-repair step before self-training for this reason. TopoMatch also shows that less spatially careful topological matching on imperfect maps produces wrong gradients in up to 99.4% of cases. If raw pseudo-label training with a topology loss comes within noise of our method, the cross-view filter is not earning its complexity, and we would report exactly that.

Why not just use the gap-bridging heuristic, or TopoTTA's synthetic breaks? Both decide which gaps to close from a single view and from local rules. The heuristic has no mechanism to tell a missed vessel from a true termination; TopoTTA's break generation has the same blind spot, as its own authors concede. The comparison against both is direct. We will also break results down by true endpoints versus false breaks, measured on held-out labels, to see which method invents connections.

Why not just feed a Canny or Frangi map as an extra input channel and skip adaptation? VesselMorph is essentially the strong form of this idea. Its reported numbers show that a fixed shape map helps generalization. The same paper reports that heavy augmentation alone gives only 0.6406 Dice on HRF. However, VesselMorph's fixed filter fails on lesions and it never measures connectivity. Our bridge ablation compares fixed tensor field, Canny, and learned mapper inside the same agreement procedure. The comparison against VesselMorph shows whether target-side topological supervision adds anything beyond a good structural input.

Why not just any two views, such as two augmentations of the image? The single-view agreement ablation answers this. It also connects to the diagnostic: if two augmentations produce as little error overlap as the raw and bridge pair, the edge domain is not what makes the method work.

Proposed Experiments

The domain pairs come from the file's benchmarks. Retinal fundus pairs are DRIVE to STARE and DRIVE to CHASEDB1, and the harder cross-modality pairs are fundus to ROSE and fundus to OCTA-500. For roads we use SpaceNet to DeepGlobe and to Massachusetts Roads. For neurons we use Neub1 to Neub2. The metrics are Dice, clDice, and Betti-0 and Betti-1 errors computed on sliding patches; APLS is added for roads. We also report a per-image count of spurious components and missed branches stratified by vessel width, because the method is aimed specifically at the one-to-two-pixel regime where erosion fails.

Three checks decide the outcome. The first is the error-overlap diagnostic described above; if the branches break in the same places, the project ends there. The second is the pair of ablations against pixel agreement and single-view agreement. If topological agreement across raw and bridge views does not beat both on Betti error, the core claim is false. The third is a targeted stress test on STARE images with visible pathology and on DeepGlobe tiles rich in hedges and crop lines. On these, the structural branch alone is expected to hallucinate lines. Here we measure whether agreement filtering suppresses those false structures relative to VesselMorph and the road baseline, which is the failure the thin-object literature attributes to high-resolution edge streams. A secondary, exploratory transfer to natural-image thin objects in DIS5K and ThinObject-5K would test whether the mechanism extends beyond curvilinear anatomy and maps. It is not part of the main claim.