Class Activation Map Generation by Representative Class Selection and Multi-Layer Feature Fusion

Fanman Meng, Kaixu Huang, Hongliang Li, Qingbo WuarXiv 2019

Abstract

Existing methods generate class activation maps (CAM) using a fixed set of all classes, often failing to consider discriminative cues between specific class pairs. This typically results in heatmaps that highlight only local discriminative parts rather than the global object. This paper proposes a novel approach that selects a few representative classes for binary comparison, extracting complementary cues to obtain more global CAMs. Additionally, a multi-layer fusion method combines high-level semantic features with low-level details. Validated on PASCAL VOC and COCO datasets across various network architectures (ResNet, VGG, MobileNet), the proposed method significantly improves object localization accuracy.

Introduction

Class Activation Maps (CAMs) are vital for weakly supervised computer vision tasks, such as object segmentation using only image-level labels. However, standard CAMs face two primary challenges:

  1. Local Focus: Models trained on multi-class classification often focus on the most unique features (e.g., a bird's beak) to differentiate classes, ignoring the rest of the object's body.
  2. Low Resolution: Methods like Grad-CAM usually rely on the final convolutional layer, which lacks the spatial resolution needed for fine-grained detail, resulting in blurry heatmaps.

Methodology

The proposed framework addresses these limitations through a three-stage process: representative class selection, binary classification, and multi-layer feature fusion.

Overall framework of the proposed CAM generation method, including representative class selection, binary classification, and multi-layer fusion.

1. Representative Class Selection

Instead of a single multi-class pass, the system selects a subset of "representative" classes. This is achieved through either similarity sorting (based on model confusion) or a clustering strategy (using K-means) to ensure a diverse set of comparison points.

2. Binary Classification CAM Generation

For each selected representative class, a binary classification task is performed (e.g., "Target Class vs. Representative Class"). The authors argue that different pairs reveal different parts of the object. For instance, comparing a cat to a chair might highlight ears, while comparing it to a bottle might highlight the tail.

3. Multi-Layer Feature Fusion

To improve spatial precision, Grad-CAMs are extracted from multiple network layers. Fusing these maps combines the high-level "objectness" from deeper layers with the sharp edges and details from earlier layers.

Results and Discussion

The core insight of this work is that binary pairs provide complementary information. By aggregating these specific comparisons, the model captures a more holistic view of the object.

Visual comparison showing how different binary class pairs (e.g., Cat-Bottle vs. Cat-Chair) provide complementary activation regions, leading to a more complete object mask.

Performance Metrics

The method was evaluated using mean Intersection over Union (mIoU) against ground-truth masks:

  • PASCAL VOC 2012: Using ResNet-101, the method achieved 33.43 mIoU, compared to the Grad-CAM baseline of 27.94 mIoU.
  • COCO 2017: Performance improved from 11.82 to 15.41 mIoU.
  • Lightweight Networks: The strategy is particularly effective for small models. For ResNet-18, mIoU rose from 19.65 to 30.73, suggesting that binary comparisons help smaller networks punch above their weight.

Conclusion

By shifting from global multi-class classification to targeted binary comparisons and multi-layer fusion, this approach generates significantly more accurate and complete object heatmaps. While it introduces some computational overhead due to multiple passes, the gain in localization quality—especially for smaller architectures—is substantial. Future work will focus on optimizing runtime for real-time applications.

Summary updated

BibTeX
@misc{meng2019class,
  author = {Fanman Meng and Kaixu Huang and Hongliang Li and Qingbo Wu},
  title = {{Class Activation Map Generation by Representative Class Selection and Multi-Layer Feature Fusion}},
  year = {2019},
  eprint = {1901.07683},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1901.07683},
}
Figure