A Comparative Study of CAM Variants with GrabCut Refinement for Large-Scale Pseudo-Mask Generation
Abstract
Semantic segmentation typically demands laborious pixel-level annotations, motivating cost-effective weakly supervised approaches that generate pseudo-masks from classifier signals. Weakly supervised pseudo-mask generation offers a cost-effective alternative to costly pixel-level annotation by leveraging classifier activation maps and simple refinement. In this work, we present the first large-scale, systematic comparison of six Class Activation Map (CAM) variants—CAM, Grad-CAM, Grad-CAM++, Eigen-CAM, Layer-CAM, and Ablation-CAM—within a unified GrabCut refinement pipeline. For each CAM method, we binarize heatmaps using both a fixed 0.2 threshold and Otsu’s method, then refine seeds with GrabCut to produce final masks. Evaluated on 23,151 ImageNet-LID validation images, our results show that (1) vanilla CAM yields the most precise seeds and highest final mask quality (IoU = 0.5124, Dice = 0.6219), (2) GrabCut consistently improves mask accuracy across all variants (ΔIoU≈0.10-0.17,ΔDice≈0.08-0.14), and (3) although newer CAM methods exhibit superior localization in raw heatmaps, those advantages do not translate into better thresholded pseudo‐masks after GrabCut refinement. These findings guide practitioners toward simple yet effective weakly supervised segmentation pipelines and highlight directions—such as multi‐threshold schemes or alternative refinement methods—for capturing the strengths of advanced CAM variants.
References
- B. Zhou, A. Khosla, A. Lapedriza, A. Oliva, and A. Torralba, “Learning deep features for discriminative localization, ” in CVPR, 2016.
- R. R. Selvaraju, M. Cogswell, A. Das, R. Vedantam, D. Parikh, and D. Batra, “Grad-cam: Visual explanations from deep networks via gradient-based localization, ” in ICCV, 2017.
- A. Chattopadhyay, A. Sarkar, P. Howlader, and V. N. Balasubramanian, “Grad-cam++: Generalized gradient-based visual explanations for deep convolutional networks, ” arXiv, 2017.
- M. B. Muhammad and M. Yeasin, “Eigen-cam: Class activation map using principal components, ”in 2020 International Joint Conference on Neural Networks (IJCNN). IEEE, Jul. 2020, p. 1–7. [Online]. Available: http: //dx.doi.org/10.1109/IJCNN48605.2020.9206626
- P.-T. Jiang, C.-B. Zhang, Q. Hou, M.-M. Cheng, and Y. Wei, “Layercam: Exploring hierarchical class activation maps for localization, ” IEEE Transactions on Image Processing, vol. 30, pp. 5875–5888, 2021.
- H. G. Ramaswamy et al., “Ablation-cam: Visual explanations for deep convolutional network via gradient-free localization, ” in proceedings of the IEEE/CVF winter conference on applications of computer vision, 2020, pp. 983–991.
- C. Rother, V. Kolmogorov, and A. Blake, “Grabcut: Interactive foreground extraction using iterated graph cuts, ” ACM Trans. Graph., vol. 23, pp. 309–314, 2004.
- S. Gülen et al., “Weakly supervised semantic roadside object segmentation using digital maps, ” Remote Sens., 2020.
- R. Guo, X. Sun, K. Chen, and M. Yan, “Jmlnet: Joint multi-label learning network for weakly super-vised semantic segmentation in aerial images, ” Remote Sens., 2020.
- N. Otsu et al., “A threshold selection method from gray-level histograms, ” Automatica, vol. 11, no.285-296, pp. 23–27, 1975.
- J. Deng, W. Dong, R. Socher, L.-J. Li, K. Li, and L. Fei-Fei, “Imagenet: A large-scale hierarchical image database, ” in CVPR, 2009.
- S. Hong, D. Yeo, S. Kwak, H. Lee, and B. Han, “Weakly supervised semantic segmentation using web-crawled videos, ” in CVPR, 2017.
- W. Shimoda and K. Yanai, “Self-supervised difference detection for weakly-supervised semantic segmentation, ” in Proceedings of the IEEE/CVF international conference on computer vision, 2019, pp.5208–5217.
- K. He, X. Zhang, S. Ren, and J. Sun, “Deep residual learning for image recognition, ” in CVPR, 2016.
- Y. Wei, S. Zheng, M.-M. Cheng, H. Zhao, L. Wang, E. Ding, Y. Yang, A. Torralba, T. Liu, G. Sun et al., “Lid 2020: The learning from imperfect data challenge results, ” arXiv preprint arXiv: 2010.11724, 2020.
- K. Simonyan and A. Zisserman, “Very deep convolutional networks for large-scale image recognition, ”arXiv preprint arXiv: 1409.1556, 2014.
- M. Everingham, L. V. Gool, C. K. I. Williams, J. Winn, and A. Zisserman, “The pascal visual object classes (voc) challenge, ” in IJCV, 2010.
- L. R. Dice, “Measures of the amount of ecologic association between species, ” Ecology, vol. 26, no. 3, pp. 297–302, 1945.
- T.-Y. Lin, M. Maire, S. Belongie, J. Hays, P. Perona, D. Ramanan, P. Dollár, and C. L. Zitnick, “Microsoft coco: Common objects in context, ” in Computer vision–ECCV 2014: 13th European conference, zurich, Switzerland, September 6-12, 2014, proceedings, part v 13. Springer, 2014, pp. 740–755.
- J. Lafferty, A. McCallum, F. Pereira et al., “Conditional random fields: Probabilistic models for segmenting and labeling sequence data, ” in Icml, vol. 1, no. 2. Williamstown, MA, 2001, p. 3.
- A. Khoreva, R. Benenson, J. Hosang, and B. Schiele, “Simple does it: Weakly supervised instance and semantic segmentation, ” in CVPR, 2017.