Winsor-CAM: Tunable Visual Explanations for CNNs
- Winsor-CAM is a human-tunable visual explanation method that aggregates saliency data across all CNN layers using winsorization.
- It employs a percentile-based clipping strategy to suppress outlier activations, producing multi-scale and semantically meaningful heatmaps.
- Empirical evaluations show that Winsor-CAM improves IoU and CoM metrics compared to Grad-CAM, enhancing CNN interpretability.
Winsor-CAM is a human-tunable, post-hoc visual explanation method for convolutional neural networks (CNNs) designed to address the limitations of conventional Gradient-weighted Class Activation Mapping (Grad-CAM) methods. By employing layer-wise Winsorization—a percentile-based clipping strategy—Winsor-CAM produces saliency maps that robustly aggregate information across all convolutional layers while suppressing outlier attributions. A single percentile parameter enables semantic-level control over the granularity of the explanations, facilitating detailed, trustworthy model introspection without altering network architectures (Wall et al., 14 Jul 2025).
1. Motivation and Conceptual Framework
Grad-CAM, the standard technique for generating class-specific heatmaps, is typically restricted to the final convolutional layer of a CNN. This focus on deep layers captures only high-level semantic concepts but ignores low-level cues such as edges and textures. Furthermore, final-layer activations can be unreliable when the gradients are unstable. Uniform averaging of Grad-CAM outputs from all convolutional layers, a naïve extension, leads to the amplification of noisy or irrelevant signals and dilution of strong, semantically meaningful activations. Winsor-CAM overcomes these deficiencies by combining the following principles:
- Aggregation of saliency information across all convolutional layers.
- Winsorization to attenuate extreme (outlier) layer importances.
- Human tunability via a percentile parameter that controls semantic scale.
2. Layer-Wise Grad-CAM Formulation
Let a CNN have convolutional layers with feature maps . For target class , the logit is . The spatial gradient of the logit with respect to activation is:
The channel-wise weights are computed as:
The Grad-CAM map for layer is then:
3. Winsorization and Layer Importance Scoring
Layer importances 0 are scalars summarizing each layer’s contribution, using one of two aggregations:
- Mean:
1
- Max:
2
Let 3 be the set of 4. Given percentile 5, Winsor-CAM clips all positive 6 at threshold 7:
8
This mechanism controls the influence of outlier layers, preventing domination by layers with excessively large gradient values—a phenomenon frequently observed in deep networks.
4. Cross-Layer Aggregation and Final Saliency Map
Clipped importances are min–max normalized to 9 (by default 0):
1
Each 2 is upsampled to a common spatial size 3. The final Winsor-CAM heatmap is a weighted sum:
4
Maps can be normalized to 5 and overlaid on input images for visualization.
5. Tunable Semantic Control via Percentile Parameter 6
The parameter 7 provides interpretable, human-in-the-loop scaling of semantic granularity:
- 8 (uniform aggregation): All nonzero layers get equal weight; fine-grained, low-semantic visualizations result.
- Intermediate 9 (e.g., 0–1): Balances suppression of outliers, enabling multi-scale, interpretable heatmaps.
- 2 (no clipping): Deep layers dominate; output approximates final-layer Grad-CAM. Empirical evaluations indicate optimal mean Intersection-over-Union (IoU) and center-of-mass (CoM) alignment metrics typically occur for intermediate 3 values.
6. Algorithmic Workflow
The Winsor-CAM procedure accepts an input image 4, target class 5, CNN 6, the user’s Winsor parameter 7, aggregation method (mean or max), and interpolation function. The workflow is:
- Forward 8 through 9, saving all convolutional feature maps.
- Backpropagate to compute 0.
- For each layer: compute 1, produce 2, upsample with chosen interpolation, and determine 3.
- Winsorize and normalize 4 to obtain 5.
- Aggregate the reweighted layer maps to obtain 6.
The method is post-hoc, requiring no architectural modifications, and is compatible with any pretrained CNN.
7. Empirical Evaluation and Comparative Results
Winsor-CAM was evaluated on PASCAL VOC 2012 for single-class localization using 933 training and 928 test images on multiple backbones (ResNet50, DenseNet121, InceptionV3, VGG16) (Wall et al., 14 Jul 2025). Quantitative metrics include mean IoU and mean CoM distance. Table 1 illustrates performance for DenseNet121:
| Method | IoU | CoM Dist. (px) |
|---|---|---|
| Winsor-CAM | 0.469 ± 0.186 | 23.055 ± 16.379 |
| Grad-CAM | 0.390 ± 0.173 | 25.684 ± 17.460 |
| Grad-CAM++ | 0.368 ± 0.180 | 24.929 ± 15.609 |
| LayerCAM | 0.379 ± 0.174 | 24.331 ± 15.265 |
| ShapleyCAM | 0.377 ± 0.173 | 26.765 ± 17.528 |
Across architectures, Winsor-CAM improved IoU by 5–10 points and reduced CoM error by 2–10 pixels over standard Grad-CAM. Naïve averaging of layer saliency maps resulted in coarse, often semantically uninformative heatmaps and inflated CoM error (e.g., ~86 px for ResNet50).
Variation of 7 yielded small, consistent performance gains toward midrange values. For example, on DenseNet121:
| 8 | IoU | CoM Dist. |
|---|---|---|
| 0 | 0.441 ± 0.182 | 22.78 ± 16.32 |
| 50 | 0.444 ± 0.184 | 22.48 ± 16.03 |
| 100 | 0.443 ± 0.185 | 21.99 ± 15.51 |
8. Qualitative Effects and Advantages
Adjustment of 9 modulates the semantic focus of the generated maps. Low 0 settings highlight details such as edges and textures by weighting early layers, midrange 1 settings produce crisp object regions, and high 2 values yield holistic masks akin to standard Grad-CAM. This enables practitioners to explore model focus across semantic hierarchies. Winsor-CAM achieves:
- Multi-scale semantic representation through cross-layer integration.
- Robustness to attribution outliers via Winsorization.
- Human-in-the-loop explanatory control with interpretable, continuous tuning.
- Full model compatibility as a post-hoc interpretability scheme.
Winsor-CAM advances interpretable AI by delivering layer-aggregated, robust, and tunably semantic visual explanations, outperforming single-layer and naïve multi-layer Grad-CAM variants in both interpretability and quantitative localization metrics (Wall et al., 14 Jul 2025).