From classification to segmentation with explainable AI: A study on crack detection and growth monitoring

Florent Forest, Hugo Porta, Devis Tuia, Olga Fink

Introduction

Structural health monitoring (SHM) is critical for ensuring the safety and longevity of infrastructure such as bridges, tunnels, and buildings. Identifying surface cracks is a primary task in SHM, but traditional deep learning approaches face a significant "data bottleneck." Training high-precision segmentation models, like U-Net, requires thousands of images with manual pixel-level annotations—a process that is both time-consuming and expensive. Furthermore, these models often struggle with domain sensitivity, failing when applied to materials with different textures than those in the training set.

To address these challenges, this study explores a weakly-supervised framework that leverages Explainable AI (XAI) to transform simple image classifiers into effective crack segmentation tools. By using image-level labels ("crack" vs. "damage-free"), which are much cheaper to obtain, the researchers aim to extract pixel-level information without the need for exhaustive manual tracing.

Proposed Framework

The core of the proposed approach is a five-step pipeline designed to bypass the high cost of pixel-level labeling by extracting attribution maps from a binary classifier.

Comparison between traditional supervised segmentation (a) and the proposed weakly-supervised XAI-based framework (b).
  1. Binary Classification: A standard CNN (VGG11) is trained to perform binary classification on image patches, identifying the presence or absence of a crack.
  2. XAI Attribution: For patches identified as containing cracks, XAI methods generate "attribution maps." These heatmaps highlight the specific pixels that most influenced the model's "crack" prediction.
  3. Baseline Optimization: For methods requiring a reference (e.g., Integrated Gradients), the authors utilized a mean damage-free image as a baseline. This significantly improved the focus on the crack compared to standard black-image baselines.
  4. NN-Explainer Adaptation: The "Neural Network Explainer" was modified to better handle cases where one class represents the complete absence of the target object.
  5. Post-Processing: Fuzzy attribution maps are converted into clean binary masks through thresholding (binarization) and morphological operations to close gaps and remove noise.

Experimental Setup and Datasets

The framework was evaluated using the Experimental DIC (Digital Image Correlation) cracks dataset, which consists of 256x256 image patches of stone masonry walls under shear-compression loading. The dataset contains 1,404 patches, with 430 positive for cracks and 974 damage-free. While training only utilized image-level labels, ground truth pixel-level masks were used to evaluate segmentation performance.

The study benchmarked eight XAI techniques, including Layer-wise Relevance Propagation (LRP), DeepLiftShap, and B-cos networks.

Key Insights and Results

The research yielded several critical insights into the viability of XAI-based segmentation:

  • The "Classifier-as-Segmenter" Shortcut: A well-trained classifier inherently focuses on the crack to make its prediction. Its internal "attention" serves as a naturally occurring, albeit noisy, segmentation mask.
  • Performance vs. Cost: While XAI-derived masks achieved lower F1 scores (DeepLiftShap at 38.19%, LRP at 37.43%) compared to a fully supervised "Oracle" model (U-Net at 83.67%), they vastly outperformed purely unsupervised methods (~5% F1).
  • Consistency in Growth Monitoring: Despite lower absolute precision, the XAI masks are remarkably consistent. In growth experiments, LRP showed a strong linear correlation (r = 0.84) with actual crack area growth, proving its utility for tracking damage progression over time.
  • Efficiency: Methods like LRP and DeepLift process images in roughly one second, making them viable for near-real-time inspection.

Conclusion and Future Work

This study demonstrates that XAI can effectively bridge the gap between low-cost classification labels and high-utility segmentation masks. While the current pipeline tends to overestimate crack width due to post-processing and struggles with extremely thin cracks, its consistency makes it a powerful tool for monitoring structural degradation.

Future research will explore using XAI-generated masks as "coarse labels" to pre-train supervised models in a semi-supervised loop. Additionally, the authors plan to validate the framework on diverse infrastructure types, such as railway sleepers, to further test its generalizability.

Summary updated

BibTeX
@misc{forest2023from,
  author = {Florent Forest and Hugo Porta and Devis Tuia and Olga Fink},
  title = {{From classification to segmentation with explainable AI: A study on crack detection and growth monitoring}},
  year = {2023},
  eprint = {2309.11267},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2309.11267},
}
Figure