Spending Uncertainty Where Topology Breaks: Criticality-Gated Loss Weighting for Occluded Road Extraction

Road maps extracted from satellite images break wherever a road passes under trees, through a building's shadow, or beneath an overpass. A segmentation network that labels each pixel from its local appearance calls those pixels "vegetation" or "shadow." The resulting map can score well on pixel overlap and still be useless for routing. One proposed fix is to weight the training loss by the model's uncertainty, but it pulls in two opposite directions. The common recipe trusts uncertain pixels less and down-weights their loss, which protects against noisy labels. Occluded road stretches, however, are exactly where the model is most uncertain, so discounting them tells the network it may leave the gap open. The opposite recipe up-weights uncertain pixels, and that pushes the network to chase every noisy, misaligned road edge in the annotations.

We propose to resolve this tension by letting the shape of the road network decide which way the uncertainty weight points. At each training step we cheaply identify the pixels whose prediction actually changes connectivity. These are stretches of the true centerline that the prediction fails to cover between two predicted pieces that should be one road, plus predicted pixels that wrongly fuse two separate roads. On those critical pixels the loss weight grows with uncertainty. Everywhere else, mostly road edges and wide-road interiors where annotation noise is harmless to connectivity, the standard down-weighting applies. The claim is that pixel-wise uncertainty only becomes useful for thin networks once it is split by topological role. The test is the extra connectivity gained under real occlusions, without relying on GPS traces.

Core Claim and What Is New

Pixel-wise uncertainty cannot tell a harmless boundary wobble on a wide road from a canopy gap that severs a corridor; the research file flags this as an open problem in uncertainty-weighted learning. We claim that one cheap test, "does this pixel lie on a break or a false merge of the true network?", is enough to separate the two cases. Gating the sign of the uncertainty weight with it should improve path-level connectivity under occlusion more than either uncertainty weighting alone or uniform topological weighting alone.

The closest existing work is UADSN. It segments thin facial nerves in CT scans, adds a centerline loss (clDice), and adds a separate consistency loss on regions where its 2D and 3D streams disagree. The two terms run in parallel: uncertainty never modulates the topological term, and topology never decides how uncertainty is used. Our proposal couples them, and it does so in overhead imagery, where the uncertainty comes from physical occlusion rather than blurry CT boundaries.

Mechanism

The ground-truth centerline (skeleton) comes directly from the vector road annotations in SpaceNet and the OpenStreetMap-derived datasets. At each step we threshold the current prediction and label its connected pieces. We then walk the true skeleton and collect each maximal run of skeleton pixels that the prediction misses. A run is marked critical if the predicted pieces at its two ends carry different labels while belonging to the same true road component. In that case, filling the run would merge two broken pieces. Symmetrically, predicted pixels that connect two different true components are marked as critical false merges. This is a union-find pass that is linear in the number of pixels. It is used only to build a weight map, with gradients stopped, so it adds no differentiability burden. That contrasts with the $O(n^3)$ persistence matching of TopoMatch.

Uncertainty $u_p$ at pixel $p$ follows the two-head disagreement of Zheng and Yang. In that method, the KL divergence between a main and an auxiliary classifier serves as the uncertainty estimate, and a regularizer stops the network from declaring everything uncertain. The training objective is

$$ \mathcal{L} = \sum_{p \notin \mathcal{C}} \left( e^{-u_p}\,\ell_p + \lambda u_p \right) + \sum_{p \in \mathcal{C}} \left(1 + \gamma\, \bar{u}_p\right)\ell_p , $$

where $\ell_p$ is the per-pixel cross-entropy, $\mathcal{C}$ is the set of critical pixels, $\bar{u}_p$ is $u_p$ with gradients stopped, $\lambda$ is the anti-collapse regularization weight from Zheng and Yang, and $\gamma$ controls how strongly uncertain breaks are amplified.

Two design choices matter. First, critical pixels on which the model is confidently wrong get weight near 1, not a large weight. Such pixels are often annotation errors, such as an OpenStreetMap track that does not exist in the imagery, so the loss does not force the model to hallucinate them. Second, because $\bar{u}_p$ is detached on critical pixels, the network cannot reduce the loss there by changing its uncertainty. This sidesteps the collapse problem that the research file notes for inverse weighting.

The design borrows from two sources. From CANet it takes the idea of up-weighting uncertain regions; CANet does this everywhere, on blob-shaped camouflaged objects, whereas we do it only on topologically critical pixels. From clDice, which builds a soft skeleton by iterated min/max pooling and weights every skeleton pixel equally, it takes the focus on centerlines; our criticality test instead singles out the few skeleton pixels that actually sever a path.

Research Program

The program asks three questions in sequence.

The first is diagnostic. On a set of training tiles, does the model's uncertainty actually separate the causes of critical gaps? We will hand-label a sample of critical gaps as occlusion (canopy, shadow, overpass), annotation error, or genuinely faint road. We will then measure how well $u_p$ separates occlusion gaps from annotation-error gaps. If dense canopy makes the model confidently predict vegetation, the gating idea weakens. In that case, the honest fallback is uniform critical weighting, and the diagnostic tells us which regime holds before any accuracy claim is made.

The second question is whether the loss improves connectivity specifically under occlusion, on standard road benchmarks.

The third asks whether the improvement survives geographic shift. For this we evaluate the trained models out of domain on the Global-Scale benchmark's held-out cities.

As an extension, we will replace the non-differentiable connectivity-based pseudo-label refinement in the topology-aware domain adaptation work with this objective during self-training. That paper heals gaps in target-domain pseudo-labels with an 8-neighbour search before retraining. In that setting the critical set is computed against pseudo-labels, and the confidence gate protects against propagating pseudo-label breaks.

Baselines

The naive reference is a D-LinkNet- or LinkNet34-style encoder-decoder trained with Dice plus cross-entropy. As an anchor, the DeepGlobe 2018 challenge reports 0.545 IoU for its DeepLab/ResNet18 focal-loss baseline on DeepGlobe roads.

The strongest image-only connectivity method in the file is joint orientation and segmentation learning. It adds a per-pixel road-direction head and a refinement network pre-trained on artificially corrupted masks. The paper reports 9% APLS improvement on SpaceNet and 7.5% on DeepGlobe over prior methods, but the file gives no absolute APLS values, so we will retrain it ourselves. APLS (Average Path Length Similarity) compares shortest-path lengths between matched point pairs in the predicted and true road graphs. Because our loss is architecture-agnostic, we will also add it on top of this model. Beating the orientation model means a higher APLS than it achieves on the same backbone. The stronger claim is that adding our loss to it raises APLS further, concentrated on the occluded subset.

For the graph-extraction regime, SAM-Road++ (Global-Scale paper) reports 62.33 F1 and 62.19 APLS on the Global-Scale in-domain test set. If its training code exposes a pixel road-mask head, we will train it with and without our loss under its published schedule. Otherwise we will report its number only as a reference.

Topological-loss baselines are soft-clDice with tuned $\alpha$ and TopoMatch, the latter where patch size allows. Uncertainty baselines are Zheng and Yang's inverse weighting alone and CANet-style global up-weighting.

The decisive ablations isolate the gate. They are critical-set weighting with $\gamma\bar{u}_p$ replaced by a constant, an uncertainty term without the critical mask, and the additive UADSN-style combination of an uncertainty loss and clDice. A further ablation measures how much of the gain comes from down-weighting non-critical pixels.

All methods share the same backbone, data splits, augmentation, and number of training iterations. Each method gets an equal hyperparameter search budget on a validation split: the same number of trials over its own loss weights.

Why not just…?

Why not just raise the clDice weight? clDice already emphasizes the skeleton, so it is the most direct competitor. However, it spreads that emphasis over every skeleton pixel, most of which are already correct. It also treats annotation-error gaps exactly like occlusion gaps. The constant-weight critical ablation and the clDice $\alpha$ sweep test directly whether targeting and gating beat simple emphasis. If tuned clDice matches us on the occluded subset, the claim fails.

Why not just paste synthetic trees and shadows over roads during training? This is a real threat: occlusion augmentation is cheap and teaches the network to bridge visual gaps. The corruption-pretrained refinement in the orientation paper is a cousin of this idea, and its authors still report failures under bridges and dense canopy. We will include synthetic-occlusion augmentation as a baseline and also combine it with our loss. If augmentation alone closes the gap on real occlusions, the honest conclusion is that the loss adds nothing.

Why not just fuse GPS traces? FuNet gains up to 8.7% APLS from taxi trajectories on its Beijing dataset, and DeepDualMapper gates image and trajectory inputs by visual reliability. Both need dense traces that do not exist in rural or post-disaster regions, which is the setting we target. GPS fusion and our loss are complementary rather than competing.

Why not just post-process with morphological closing and endpoint linking? RoadTracer reports that segmentation-plus-heuristics pipelines reach 0.40 junction recall at a 5% error rate, against its 0.58. Distance-based linking also tends to join field boundaries and rooftop edges. We will apply the same post-processing to every method, so any remaining gain is attributable to training.

Proposed Experiments and Decisive Checks

Training and testing use SpaceNet, DeepGlobe and Massachusetts Roads. Out-of-domain evaluation uses Global-Scale's held-out cities.

Beyond IoU, APLS, junction recall, and Betti-number error, we construct an occluded-gap subset. On test tiles we manually mark true road segments that pass under canopy, shadow or overpass, and on these we report the fraction bridged by the prediction. We also mark a confounder subset of field boundaries and roof edges, where we count spurious bridges. That count tests whether amplifying critical uncertainty causes hallucination.

The proposal succeeds only if three things hold. On the occluded subset, gated weighting must bridge more gaps than both constant critical weighting and tuned clDice. Spurious bridges on the confounder subset must not rise. And the diagnostic must show that uncertainty separates occlusion gaps from annotation-error gaps better than chance.

If the second condition fails, gating is buying recall with hallucination. If the third fails, the mechanism's premise is wrong, even if aggregate APLS improves.