NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Rethinking Class Activation Mapping for Weakly Supervised Object Localization

Wonho Bae, Junhyug Noh, Gunhee Kim

Introduction

Weakly Supervised Object Localization (WSOL) aims to identify object locations using only image-level labels. The standard approach, Class Activation Mapping (CAM), identifies discriminative regions by analyzing feature maps from a Convolutional Neural Network (CNN). However, CAM often suffers from a "greedy" bias, focusing on the most distinctive parts (e.g., a bird's head) while ignoring the rest of the object's body.

The standard CAM pipeline consists of three main stages: Global Average Pooling (GAP), weighted averaging of feature maps, and thresholding to produce a localization result.

The Mathematical Biases of CAM

This paper argues that the localization failure is not necessarily a failure of the network's representation, but rather a result of mathematical biases in the CAM pipeline. Specifically, the authors identify three issues:

  1. The Dilution Effect in GAP: Global Average Pooling averages activations over the entire image. Features covering large areas (like a bird's body) are mathematically "diluted" compared to sharp, localized features (like a head). Consequently, the network learns higher weights for these small, discriminative parts to maximize classification scores.
  2. Negative Weight Interference: Standard classifiers use negative weights to suppress background or distinguish between similar classes. However, these negative weights can inadvertently "delete" valid object parts from the final heatmap if those parts share features with other categories.
  3. Maximum-Value Sensitivity: Traditional thresholding relies on the absolute maximum value of a heatmap. A single noisy outlier can shift the threshold, leading to inconsistent localization.
Comparison of head and body features. The "head" feature (Fi) has a smaller area but higher weight, while the "body" feature (Fj) is diluted by GAP, leading the classifier to rely more on the head for recognition.

Proposed Solutions

The authors propose three simple, plug-and-play fixes:

  • Thresholded Average Pooling (TAP): Instead of averaging over the whole image, TAP averages only the "active" pixels above a certain threshold. This prevents the signal from large object parts from being diluted.
  • Negative Weight Clamping (NWC): During the localization phase, all negative weights are set to zero. This ensures that features representing the object are not suppressed by weights intended for classification-specific discrimination.
  • Percentile as a Standard (PaS): Rather than using the absolute maximum, PaS uses a high percentile (e.g., 90th) as the reference for thresholding, making the process robust to noise.

Results and Impact

The combination of TAP, NWC, and PaS achieves state-of-the-art results on major benchmarks including CUB-200-2011, ImageNet-1K, and OpenImages30K. On CUB-200-2011 with a VGG16 backbone, localization accuracy improved significantly from 37.05% to 61.30%. These methods are architecture-agnostic and can be easily integrated into existing WSOL models to provide an immediate performance boost without additional training or complex architectural changes.

Summary updated

BibTeX
@inproceedings{bae2020rethinking,
  author = {Wonho Bae and Junhyug Noh and Gunhee Kim},
  title = {{Rethinking Class Activation Mapping for Weakly Supervised Object Localization}},
  booktitle = {European Conference on Computer Vision},
  year = {2020},
  doi = {10.1007/978-3-030-58555-6\_37},
}
Figure