[Paper Review] Towards Interpretable Semantic Segmentation via Gradient-weighted Class Activation Mapping
This paper proposes seg-grad-cam, a gradient-based method that extends Grad-CAM to semantic segmentation by generating class-specific heatmaps that highlight pixel-level relevance for predictions. It computes gradient-weighted activations from intermediate feature maps, producing interpretable visualizations that align with ground-truth segmentation masks, particularly when using bottleneck-layer features in U-Net architectures.
Convolutional neural networks have become state-of-the-art in a wide range of image recognition tasks. The interpretation of their predictions, however, is an active area of research. Whereas various interpretation methods have been suggested for image classification, the interpretation of image segmentation still remains largely unexplored. To that end, we propose SEG-GRAD-CAM, a gradient-based method for interpreting semantic segmentation. Our method is an extension of the widely-used Grad-CAM method, applied locally to produce heatmaps showing the relevance of individual pixels for semantic segmentation.
Motivation & Objective
- To address the lack of interpretability methods for semantic segmentation in deep learning models.
- To extend the widely used Grad-CAM technique from image classification to pixel-wise semantic segmentation tasks.
- To produce localized, class-specific heatmaps that explain which image regions contribute most to individual pixel predictions.
- To evaluate the effectiveness of intermediate feature layers—especially bottleneck layers—for generating meaningful visual explanations.
- To provide a flexible, gradient-based interpretation framework applicable to any semantic segmentation network, including U-Net.
Proposed method
- The method adapts Grad-CAM by replacing the global logit $ y^c $ with the sum of logits $ \sum_{(i,j)\in\mathcal{M}} y_{ij}^c $ over a set of pixels $ \mathcal{M} $ of interest, enabling per-pixel or per-object interpretation.
- It computes gradient weights $ \alpha_c^k = \frac{1}{N} \sum_{u,v} \frac{\partial y^c}{\partial A_{uv}^k} $ for each feature map $ A^k $, where gradients are backpropagated from the sum of logits to the feature maps.
- A heatmap is generated via $ L^c = \mathrm{ReLU}\left( \sum_k \alpha_c^k A^k \right) $, which highlights spatial regions contributing positively to the prediction of class $ c $.
- The method supports flexible selection of $ \mathcal{M} $, including single pixels, object instances, or all image pixels, enabling localized or global interpretability.
- It leverages feature maps from intermediate layers, particularly the bottleneck layer of a U-Net, which are shown to yield more informative heatmaps than decoder layers.
- The approach uses ReLU activation on the final heatmap to suppress negative contributions and focus on positively activating regions.
Experimental results
Research questions
- RQ1Can gradient-based class activation mapping be effectively extended to semantic segmentation, where predictions are made per pixel rather than globally?
- RQ2Which intermediate feature layers in a U-Net architecture produce the most semantically meaningful heatmaps for interpretation?
- RQ3How do heatmaps generated by seg-grad-cam compare to ground-truth segmentation masks in terms of spatial alignment and relevance?
- RQ4Does the choice of $ \mathcal{M} $—such as a single pixel or all pixels—affect the interpretability and plausibility of the resulting heatmaps?
- RQ5Can seg-grad-cam reveal contextual dependencies, such as highlighting trees when predicting sky, indicating model reasoning beyond local features?
Key findings
- Heatmaps generated from bottleneck-layer features in a U-Net architecture show stronger alignment with ground-truth segmentation masks and are more semantically meaningful than those from decoder layers.
- The method successfully highlights relevant contextual regions, such as trees, when predicting sky, indicating it captures high-level semantic dependencies.
- Early convolutional layers produce edge-like structures in heatmaps, consistent with their role in detecting low-level features.
- As feature maps progress from bottleneck to decoder layers, the resulting heatmaps increasingly resemble the final segmentation mask, indicating progressive feature refinement.
- The heatmap generation process can highlight regions beyond the receptive field of the selected pixel, due to global weighting of feature maps across the entire image.
- The approach is flexible and generalizable, as it supports interpretation for single pixels, object instances, or entire images by varying the set $ \mathcal{M} $.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.