An Implementation of the Crack Topology Score with Extensions
Siheon Joo, Hongjo Kim
TL;DR
This work provides a faithful, PyTorch-compatible implementation of the Crack Topology Score (CTS), a skeleton-based metric for evaluating topological correctness in crack segmentation. It defines CTS via skeleton matching of ground-truth and predicted crack masks, computing PCS and RCS as length-weighted proportions and CTS as their harmonic mean, with default parameters $r=10$ and $t=0.5$ for the matching criteria. Optional preprocessing steps—hole filling and morphological smoothing—are offered to suppress common prediction artifacts, though they are disabled by default to maintain strict comparability. The package includes visualization tools and demos to support transparent and fair evaluation for real-world infrastructure monitoring applications.
Abstract
The Crack Topology Score (CTS) is a recently proposed metric that focuses on evaluating the topological correctness of crack segmentation outputs. While pixel-wise metrics such as IoU or F1-score fail to capture structural validity, CTS offers a skeleton-based matching framework to measure the preservation of connectivity. This paper presents a faithful implementation of the CTS metric, along with optional preprocessing extensions designed to handle common prediction artifacts (e.g., small holes and edge noise) found in deep learning outputs. All extensions are disabled by default to ensure strict comparability with the original definition. The implementation supports PyTorch-based workflows and includes visualization tools for transparency. Code and archival resources will be made available at https://github.com/SH-Joo/crack-topology-score.
