From Explanations to Segmentation: Using Explainable AI for Image Segmentation

Clemens Seibold, Johannes Künzel, Anna Hilsmann, Peter Eisert

Introduction

This paper demonstrates a clever "shortcut" for image segmentation: instead of training a model on expensive pixel-level labels, the authors use Explainable AI (XAI) to extract segmentation masks from a simple image classifier. By applying Layer-wise Relevance Propagation (LRP) to a classification network, they achieve segmentation performance comparable to a fully supervised U-Net while only requiring easy-to-produce image-level labels (e.g., "crack" vs. "no crack").

The Challenge of Pixel-Level Labeling

Deep learning has revolutionized image segmentation, but it comes with a high "data tax." To train a standard model like a U-Net, humans must manually trace the boundaries of objects in thousands of images—a tedious, error-prone, and expensive process.

The authors address this bottleneck by exploring weakly supervised segmentation. The goal is to produce high-quality pixel-wise masks using only image-level annotations. If you can tell a computer "this image contains a crack" without showing it exactly where the crack is, can the computer figure out the boundaries on its own?

Methodology: From Classification to Segmentation

The researchers propose a three-step pipeline to bridge the gap between classification and segmentation:

  1. Classification: They train a standard VGG-11 network to perform binary classification (e.g., detecting if a magnetic tile is "damaged" or "undamaged"). This requires only a simple label for the whole image.
  2. Explanation (LRP): During inference, they use Layer-wise Relevance Propagation (LRP). LRP is an XAI technique that works backward from the network's output to the input pixels, assigning a "relevance score" to each pixel based on how much it contributed to the final decision. This produces a heatmap.
  3. Segmentation via Mixture Models: The raw LRP heatmap is noisy. To turn it into a binary mask, the authors compare three thresholding techniques: Iterative mean-based thresholding, Gaussian Mixture Models (GMM), and Beta Mixture Models (BMM).
Overview of the proposed segmentation pipeline using LRP.

Experimental Setup and Datasets

The method was evaluated on two industrial inspection datasets:

  • Sewer Pipe Cracks: Images captured by mobile robots in sewer systems. This dataset is challenging due to fisheye distortions, varying lighting, and diverse crack shapes.
  • Magnetic Tile Defects: A dataset of 1,084 images featuring very small defects like cracks or blowholes that cover only a tiny fraction of the image.
Examples of defect images and a corresponding segmentation mask from the study.

Key Insights

  • XAI as a Functional Tool: Usually, XAI is used to build trust or debug models. Here, the "explanation" is treated as the primary functional output (the mask).
  • The "Hollow" Effect: The authors noted that LRP often highlights the edges of a defect very strongly but assigns lower relevance to the interior. This is because the network's filters often trigger most strongly on high-contrast boundaries.
  • BMM Superiority: The Beta Mixture Model (BMM) proved superior for segmentation. Because relevance scores are bounded and highly skewed (a few "hot" pixels in a sea of "cold" background), the flexible shape of the Beta distribution fits the data better than a standard Gaussian curve.

Results and Performance

The most striking result is that this weakly supervised approach performs nearly as well as—and sometimes better than—a fully supervised U-Net:

  • Magnetic Tiles: The LRP-based approach using BMM achieved an Intersection over Union (IoU) of 0.462, virtually identical to the U-Net's 0.461.
  • Sewer Pipes: The LRP-BMM approach reached an IoU of 0.337, actually slightly outperforming the U-Net's 0.321.

Limitations and Future Work

While promising, the initial work focuses on binary semantic segmentation (object vs. background). Extending this to multi-class problems remains a challenge. Additionally, LRP can struggle to fill the center of large objects; future work could involve combining LRP with classical "hole-filling" algorithms or more advanced morphological operations to refine the resulting masks.

Summary updated

BibTeX
@inproceedings{seibold2022from,
  author = {Clemens Seibold and Johannes Künzel and Anna Hilsmann and Peter Eisert},
  title = {{From Explanations to Segmentation: Using Explainable AI for Image Segmentation}},
  booktitle = {VISIGRAPP (4: VISAPP)},
  year = {2022},
  url = {https://openreview.net/forum?id=EQCFHNmIgHh},
}
Figure