Computation of LCAPE
The ground-truth mask is skeletonised and converted to a graph. In every iteration we sample a connected vertex pair and find its shortest path with Dijkstra’s algorithm; this path has zero cost because the label is perfectly connected. The two vertices are then shifted to the lowest-cost pixels within a small window on the network’s predicted distance map, providing tolerance to minor mis-alignments. Fixing those endpoints, we apply Dijkstra again on the prediction. The LCAPE for this pair is the sum of squared distance values along that predicted path—close to zero when connectivity is correct and larger when a gap is present. Averaging such costs over many pairs and adding them to a standard pixel-wise loss (e.g. MSE) yields the total objective used for back-propagation.

















