Thin, elongated objects such as cables, wires and ropes are hard to segment for a simple reason. Where one strand passes over another, a flat 2D mask merges them into a single blob, so the true picture of what connects to what is lost at exactly the points that matter. Topology-preserving losses make this worse rather than better. These are training objectives that penalize broken or spuriously joined structures. They skeletonize the flat mask, which means thinning it to one-pixel-wide centerlines, and so they treat every crossing as a real junction: they reward the network for drawing a physical connection that does not exist. A depth sensor could in principle say which strand is on top. In practice, consumer depth cameras are least reliable on thin objects, and the robotics systems that trace cables most successfully have stopped using depth altogether.
We propose a different output and a different loss. The network predicts a small stack of ordered depth layers as a 3D occupancy volume (image height × width × a handful of relative-depth bins), filled in amodally, meaning hidden portions of strands are predicted too. We then apply a centerline topology loss to that volume rather than to the flat mask. A strand that passes over another is separated from it along the layer axis, so their skeletons never touch. A strand that slopes smoothly through depth stays connected, because neighbouring bins are adjacent in the volume. Depth-sensor input enters only as an attention bias, controlled by a per-pixel reliability gate. That gate is trained against measured depth error rather than against agreement with color features, so thinness alone is never treated as evidence of noise.
Core Claim
The false-junction problem in topological segmentation is an artifact of collapsing to 2D. It can be removed by moving the existing differentiable skeleton loss into a coarse, learned depth-layer volume. Doing so should cut spurious loops at crossings and recover correct over/under order. This should hold even for a single cable crossing itself and for visually identical cables, which are the cases where per-instance masks and appearance-based crossing classifiers have nothing to separate the strands with. A secondary and openly uncertain claim is that noisy sensor depth helps decide layer order, but only if its influence is gated per pixel. We expect ungated geometric attention to hurt, and we expect confidence filtering that relies on agreement with color features to erase thin strands.
What Prior Work Does and Leaves Open
The topology loss we reuse is clDice. It extracts soft skeletons with iterated min- and max-pooling and scores how well predicted and true centerlines overlap. It already runs on 3D vessel volumes, which is what makes our lift feasible. Its 2D form inherits the false-junction failure at crossings. TopoMatch matches persistence features only where they overlap in space; persistence features are a mathematical summary of the connected pieces and loops in a mask. It is the stronger topology measure, but it scales poorly in 3D, so we use it only as an evaluation metric on 2D projections.
Two crossing-resolution lines motivate the gap. HANDLOOM and TUSK trace cables step by step from grayscale crops and classify each crossing as over or under with a separate network. They discard depth as too noisy and assume at most two strands overlap at a crossing. RT-DLO builds a graph from 2D centerlines and resolves crossings by how well strand directions line up, which fails at shallow crossing angles. Both resolve crossings after segmentation. We resolve them inside the segmentation output and its loss.
Layered decomposition supplies the representational idea. Layered Depth Refinement with Mask Guidance predicts separate foreground and background depth sheets to remove "flying pixels", which are spurious depth values that sensor pixels straddling an edge record. It is limited to one binary split and inherits any break in its guidance mask. HiDAnet slices depth into fixed bands with a histogram threshold (Multi-Otsu), which chops slanted thin objects into disconnected pieces. Our bins are predicted per pixel and connected across neighbours, so a sloping wire is not cut. Amodal Depth Anything estimates the depth of hidden surfaces but reports its worst errors along occluded edges and has no connectivity constraint.
The depth-attention and noise literature constrains the design. DFormerv2 multiplies attention weights by a decay that grows with 3D distance between image patches. Its authors note that sensor errors then corrupt the attention matrix directly, and its separate horizontal and vertical attention passes miss diagonal strands. CalibNet and DCF down-weight depth that disagrees with color features. CalibNet itself reports that this misreads small or thin instances as noise and drops them. That is the negative result our gate is designed around.
Research Program
The model is a standard encoder-decoder segmentation network over RGB, with optional depth input. Its head outputs an occupancy volume $V \in [0,1]^{H \times W \times K}$, where $K$ is between 3 and 6 ordinal layers ordered from nearest to farthest. Ground truth places every point of every strand, including hidden parts, in the bin given by its rank among the strands it overlaps. Strands that overlap in the image are forced at least two bins apart, so an empty bin lies between them at every crossing. With this margin, the 3D soft skeleton cannot bridge the two strands, while a strand rising through depth moves to an adjacent bin and stays connected. The training loss is
$$L = (1-\alpha)\,(1-\mathrm{softDice}(V, V^{*})) + \alpha\,(1-\mathrm{soft\text{-}clDice}_{3D}(V, V^{*})),$$
where $V^{*}$ is the ground-truth layer volume and $\alpha$ trades overlap against centerline continuity, exactly as in clDice. The flat visible mask is recovered by taking the nearest occupied bin, so the model still competes on ordinary metrics.
Depth enters as an additive bias on attention logits, in the style of DFormerv2, between full 2D windows rather than axis-decomposed passes, so diagonal strands are covered. The bias is multiplied by a per-pixel reliability $r \in [0,1]$ predicted from the raw depth patch and its local statistics. On synthetic data we know the true depth, so $r$ is supervised to predict whether the sensor error at that pixel exceeds half a strand diameter. The target depends only on the error itself, never on agreement with color or on the size of the structure, so thinness is not a shortcut to suppression.
Data comes from a synthetic generator. It renders cables and wire harnesses with known crossing order, including self-crossing knots and identical-looking strands, using harness shapes taken from PointWire. The renderer adds simulated time-of-flight and structured-light artifacts: flying pixels at edges, dropouts on thin and specular strands, and multipath bias. Real evaluation uses the HANDLOOM/TUSK cable benchmark and the RT-DLO real-image set, plus a small set of real RGB-D captures that we hand-annotate with crossing order. DRIVE retinal vessels, which contain artery-vein crossings but no depth, test the RGB-only form of the volumetric loss.
Baselines
The naive reference is a DeepLabV3+ model trained with Dice and cross-entropy on flat masks, which is RT-DLO's own front end. It is followed by morphological closing. This anchors how much any topology machinery buys.
The strongest existing segmentation-side competitor is RT-DLO, which reports 79.91% mean IoU and a 32–36 FPS real-time rate on its real DLO benchmark. We run it with its released pipeline on the same train and test splits, re-tuning only its graph thresholds on our validation set.
The strongest crossing-order competitor is HANDLOOM, which reports 80% multi-cable tracing accuracy on identical cables and 77% knot detection. We compare on its benchmark using its tracing metric. Our traces are read from the layer-volume skeleton, and HANDLOOM keeps its own tracer.
Two strong flat-topology baselines share our backbone and training budget: flat 2D clDice, and flat clDice with an over/under crossing classifier attached. A depth-attention baseline runs DFormerv2-style geometry attention on raw sensor depth with no gate. A filtering baseline replaces our gate with CalibNet-style similarity filtering.
The key ablations isolate the proposal's ingredients. The first keeps the layer-volume output but drops the 3D clDice term, which isolates the loss. The second keeps the full method with RGB only, which isolates depth. The third keeps depth but removes the gate. The fourth swaps raw depth for monocular depth from Amodal Depth Anything. All variants get the same backbone, data, epochs and hyperparameter search budget (an equal number of trials per method). Beating the baselines means two things. Spurious loops at crossings, measured as the $H_1$ Betti error on the projected skeleton, must fall by a clear margin over flat clDice, with flat mean IoU no worse than RT-DLO. Crossing-order accuracy on identical and self-crossing cables must exceed HANDLOOM's reported 80% tracing level. No reported result was found on Lacuna for any topology loss evaluated per depth layer, and none for RT-DLO under injected depth noise, so those comparisons are new measurements.
Why not just…?
Why not just segment each cable as a separate instance and apply clDice per instance? Per-instance masks do remove false junctions between different cables, and that will be a strong baseline on the multi-cable split. They cannot help a single cable crossing itself, which is the knot case HANDLOOM's benchmark is built around, because one instance mask still merges at its own crossing. We report the self-crossing and multi-cable splits separately. If per-instance clDice matches us on both, the layer volume is unnecessary.
Why not just keep flat clDice and resolve crossings afterwards with a classifier or graph heuristic, as HANDLOOM and RT-DLO do? This is the real threat. The flat loss still trains the network to fill crossings as junctions, and post-hoc repair then has to undo that. RT-DLO's reliance on strand-direction alignment fails at shallow crossing angles. The flat-clDice-plus-classifier baseline settles the question directly. We will also stratify results by crossing angle. If our gains appear only at shallow angles, that is the honest scope of the claim.
Why not drop depth and work from RGB alone, given that HANDLOOM succeeds that way? It may turn out that depth adds little. The RGB-only version of our method is therefore a first-class arm, not a strawman. The layer-volume loss is meant to help without depth, and the depth gate counts as a contribution only if it improves crossing order on identical-looking cables beyond the RGB-only arm.
Why not replace sensor depth with a monocular depth estimator? Layered Depth Refinement reports that monocular depth estimators erase wires and fingers, and Amodal Depth Anything reports its worst errors along occluded edges. Both point toward failure on thin strands. Our monocular-depth arm tests this directly on our data.
Proposed Experiments
The decisive check is the $H_1$ Betti error and the false-junction count at labelled crossings, on held-out synthetic knots and on the HANDLOOM benchmark. We compare flat clDice against 3D clDice in the layer volume, with backbone and data held fixed. If the volume does not reduce false junctions, the central claim fails.
The second check sweeps the strength of injected sensor noise: flying-pixel width, dropout rate on thin strands, and multipath bias. For each level we plot crossing-order accuracy and thin-strand recall for four depth-handling variants: ungated attention, CalibNet-style filtering, our gate, and RGB-only. We predict that ungated attention falls below RGB-only as noise grows, that similarity filtering loses thin-strand recall, and that the gated model stays at or above RGB-only throughout.
The third check is transfer to real captures, where the gate's training signal no longer applies. We report how far the gate's reliability scores agree with the hand-annotated crossing order.
Throughout we also report flat mean IoU, TopoMatch-based Betti error on 2D projections, and speed against RT-DLO's 32–36 FPS. This makes any gain in topology visible alongside its cost in overlap accuracy and runtime.
References
- clDice - A Novel Topology-Preserving Loss Function for Tubular Structure Segmentation
- Topologically Faithful Image Segmentation via Induced Matching of Persistence Barcodes
- HANDLOOM: Learned Tracing of One-Dimensional Objects for Inspection and Manipulation
- Learning to Trace and Untangle Semi-planar Knots (TUSK)
- RT-DLO: Real-Time Deformable Linear Objects Instance Segmentation
- Layered Depth Refinement with Mask Guidance
- HiDAnet: RGB-D Salient Object Detection via Hierarchical Depth Awareness
- Amodal depth anything: Amodal depth estimation in the wild
- DFormerv2: Geometry Self-Attention for RGBD Semantic Segmentation
- CalibNet: Dual-Branch Cross-Modal Calibration for RGB-D Salient Instance Segmentation
- Calibrated RGB-D Salient Object Detection
- 3D Understanding of Deformable Linear Objects: Datasets and Transferability Benchmark