Region-Aware CAM: High-Resolution Weakly-Supervised Defect Segmentation via Salient Region Perception

Hang-Cheng Dong, Lu Zou, Bingguo Liu, Dong Ye, Guodong LiuarXiv 2025 · DOI · arXiv

TL;DR

This paper introduces Region-Aware CAM (RA-CAM), a novel weakly-supervised method for high-resolution surface defect segmentation. By refining Class Activation Maps (CAMs) with a filtering-guided backpropagation technique and a region-aware weighting module, RA-CAM significantly improves defect localization accuracy without requiring pixel-level annotations, making it ideal for resource-constrained industrial settings.

What Problem Does This Paper Address?

Surface defect detection is crucial for industrial quality control, but traditional deep learning methods for tasks like semantic segmentation and object detection demand large, meticulously annotated datasets. This is a major bottleneck in defect detection because:

  • Defects are rare: They are designed to be avoided, leading to imbalanced datasets.
  • Annotation is difficult: It requires specialized domain expertise (e.g., materials science) and specialized tools, creating a mismatch between annotators and experts.
  • Ambiguous boundaries: Defects often have unclear edges, making precise pixel-level annotation challenging and prone to noise.

These challenges hinder the widespread adoption of intelligent defect detection systems. While weakly-supervised learning offers a solution by reducing annotation requirements, existing methods often struggle with low-resolution heatmaps and insufficient detail preservation, especially in complex industrial environments.

Methods

The proposed method, RA-CAM, tackles these issues in two main phases:

  1. Initial Heatmap Generation:
    • Filtering-Guided Backpropagation (FGBP): This is a core innovation. Instead of standard backpropagation, FGBP filters out low-gradient regions during the process. The intuition is that lower gradient magnitudes are more likely to correspond to non-target (background) noise. By truncating these low-value regions, FGBP effectively removes background interference and refines the saliency maps. This technique is designed to be a plug-in module for existing CAM-based methods.
  2. Region-Aware Class Activation Maps (RA-CAM): Building on FGBP, RA-CAM further enhances spatial precision. It uses the FGBP to guide backpropagation, specifically focusing on removing interference from non-target regions in feature map weighting. This aims to improve the segmentation resolution of target defect regions. The method also incorporates a region-aware weighting module to enhance spatial accuracy.
  3. Pseudo-Label Training:
    • After generating high-quality heatmaps, image processing techniques (like Otsu's method for adaptive thresholding) are used to create pseudo-labels.
  4. These pseudo-labels are then used to train high-performance, fully-supervised semantic segmentation models. This iterative refinement process further boosts the model's performance.

Datasets

The paper evaluates the proposed method on two publicly available industrial defect detection datasets:

  • KSDD dataset: Focuses on electrical commutator surface defects. It contains 399 annotated samples, with 52 defective instances.
  • KSDD2 dataset: A larger dataset with 3,012 high-resolution industrial inspection images, comprising 246 defective cases in the training set and 110 in the test set.

Key Insights and Ideas

  • Gradient Magnitude Matters: The authors highlight that the magnitude of gradients, not just their sign, is crucial for identifying relevant target regions. Higher gradient magnitudes are more indicative of defect presence.
  • FGBP as a General Tool: The Filtering-Guided Backpropagation (FGBP) is presented as a versatile, plug-in module that can improve various gradient-based heatmap generation techniques.
  • Weak Supervision for High Resolution: The work demonstrates that it's possible to achieve high-resolution defect segmentation using only image-level labels, bridging the gap between the ease of weak supervision and the precision of full supervision.
  • Pseudo-labeling is Key: The second phase of pseudo-label training is shown to be critical for achieving state-of-the-art performance, effectively leveraging the refined heatmaps.

Key Results

  • KSDD Dataset: RA-CAM achieved an IoU of 25.20%, significantly outperforming previous best methods like Ablation-CAM (17.96%) and Layer-CAM (16.25%). It showed substantial improvements in Precision and Micro-F1 as well.
  • KSDD2 Dataset: RA-CAM achieved an IoU of 45.54%, surpassing LayerCAM (42.01%) and FullGrad (37.95%). It also achieved the highest F1 score of 62.58%.
  • Qualitative Results: The generated heatmaps and segmentation results show RA-CAM producing more complete and higher-resolution defect localization compared to other methods. The paper also shows that even with weak supervision, their method can achieve competitive results compared to fully supervised models.

Limitations and Future Work

  • Hyperparameter Tuning: The performance of FGBP is sensitive to the hyperparameter $\delta$, which controls the gradient threshold. The paper provides an ablation study showing an optimal range for $\delta$ that balances background noise removal with target area integrity. Finding this optimal $\delta$ is crucial.
  • Comparison to Fully Supervised: While the paper shows competitive results, it acknowledges that fully supervised methods (like DeepLabV3+) still achieve higher mIoU scores on KSDD (88.6% of DeepLabV3+'s performance). However, RA-CAM's advantage lies in its significantly reduced annotation burden.
  • Future Directions: The paper suggests that the FGBP module can be applied to other similar methods, implying potential for broader impact. The analysis of semantic segmentation algorithms' unfitness for defect detection tasks also points towards further research in specialized architectures for this domain.

Summary updated

BibTeX
@misc{dong2025region,
  author = {Hang-Cheng Dong and Lu Zou and Bingguo Liu and Dong Ye and Guodong Liu},
  title = {{Region-Aware CAM: High-Resolution Weakly-Supervised Defect Segmentation via Salient Region Perception}},
  year = {2025},
  eprint = {2506.22866},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2506.22866},
}
Figure