ContextLoss: Context Information for Topology-Preserving Segmentation

In image segmentation, preserving the topology of segmented structures like vessels, membranes, or roads is crucial. For instance, topological errors on road networks can significantly impact navigation. Recently proposed solutions are loss functions based on critical pixel masks that consider the whole skeleton of the segmented structures in the critical pixel mask. We propose the novel loss function ContextLoss (CLoss) that improves topological correctness by considering topological errors with their whole context in the critical pixel mask. The additional context improves the network focus on the topological errors. Further, we propose two intuitive metrics to verify improved connectivity due to a closing of missed connections. We benchmark our proposed CLoss on three public datasets (2D & 3D) and our own 3D nano-imaging dataset of bone cement lines. Training with our proposed CLoss increases performance on topology-aware metrics and repairs up to 44% more missed connections than other state-of-the-art methods. We make the code publicly available.
View on arXiv@article{schacht2025_2506.11134, title={ ContextLoss: Context Information for Topology-Preserving Segmentation }, author={ Benedict Schacht and Imke Greving and Simone Frintrop and Berit Zeller-Plumhoff and Christian Wilms }, journal={arXiv preprint arXiv:2506.11134}, year={ 2025 } }