U-CAM: Visual Explanation using Uncertainty based Class Activation Maps

Badri N. Patro, Mayank Lunayach, Shivansh Patel, Vinay P. Namboodiri · DOI

Introduction

Deep learning models for Visual Question Answering (VQA) often function as "black boxes," providing answers without clear justification for their internal reasoning. While attention mechanisms attempt to visualize a model's focus, these maps are frequently noisy or fixated on irrelevant background features. U-CAM addresses this by introducing a novel framework that leverages uncertainty gradients to refine attention maps, ensuring the model focuses on the most "certain" and relevant parts of an image.

The Problem: Noisy Attention and Hidden Uncertainty

Standard VQA models rarely quantify their confidence. A model might correctly identify an object by chance while attending to an unrelated region. Existing explanation methods like Grad-CAM primarily use classification loss gradients, failing to account for data uncertainty (e.g., image noise) or model uncertainty (knowledge gaps). This leads to visual explanations that lack interpretability and fail to align with human visual processing.

Methodology: The U-CAM Recipe

The core innovation of this work is the Gradient-based Certainty Attention Mask (GCA). Unlike traditional methods, U-CAM incorporates Bayesian uncertainty into the training loop.

U-CAM Architecture: Integrating uncertainty gradients into the attention mechanism.

The process involves:

  1. Uncertainty Modeling: The framework captures both Aleatoric uncertainty (data noise) and Predictive uncertainty (model-wide confidence) using Monte Carlo (MC) sampling.
  2. Uncertainty Gradients: While standard Grad-CAM highlights regions based on classification loss, U-CAM calculates the gradient of the uncertainty loss.
  3. Gradient Reversal Logic: By applying a gradient reversal layer, the model is incentivized to minimize uncertainty in its attended regions. This effectively teaches the model to ignore "confusing" areas and prioritize regions where it can generate high-certainty predictions.
  4. Architectural Flexibility: The GCA module is architecturally flexible, allowing it to be integrated into various VQA backbones such as Multimodal Compact Bilinear pooling (MCB) or Stacked Attention Networks (SAN).

Experimental Setup

The authors evaluated U-CAM across several benchmark datasets:

  • VQA-v1 & VQA-v2: Standard benchmarks for open-ended VQA tasks.
  • VQA-HAT (Human Attention): Used to measure the correlation between model attention and human-annotated attention maps.
  • VQA-X: Evaluated for multimodal (textual and visual) explanations.

Key Insights

  • Uncertainty as an Optimization Signal: Rather than just reporting uncertainty as a post-hoc metric, U-CAM uses it as a signal to optimize the model's focus, resulting in sharper and more semantically relevant attention maps.
  • Error Correlation: High uncertainty was found to strongly correlate with misclassification. By minimizing this uncertainty, the model naturally improves its predictive accuracy.
  • Human Alignment: U-CAM attention maps show a significantly higher correlation with human eye-tracking data compared to baselines, suggesting that "certainty" is a fundamental component of human-like visual reasoning.

Results and Discussion

U-CAM demonstrates significant improvements in both accuracy and interpretability. On the VQA-v1 benchmark, the P-GCA (Predictive-GCA) variant improved baseline MCB accuracy by approximately 2.7% (from 63.8% to 66.5%).

Qualitative comparison of attention maps across baseline and GCA variants, showing alignment with human-like focus and uncertainty levels.

Qualitatively, as seen in Figure 1, U-CAM (A-GCA and P-GCA) produces much cleaner attention masks that focus on the subject of the question (e.g., the baseball player or the dog) compared to the noisy baseline. Quantitatively, U-CAM achieved a Rank Correlation (RC) of 0.3341 on VQA-HAT, a substantial increase over the baseline's 0.2790.

Conclusion and Future Work

U-CAM provides a robust method for making VQA models more transparent and accurate by unifying uncertainty estimation with visual explanation. While the use of Monte Carlo sampling introduces some computational overhead, the gains in interpretability and human alignment are significant. Future research may extend this certainty-based approach to other multimodal domains such as Visual Dialog and Image Captioning.

Summary updated

BibTeX
@inproceedings{patro2019u,
  author = {Badri N. Patro and Mayank Lunayach and Shivansh Patel and Vinay P. Namboodiri},
  title = {{U-CAM: Visual Explanation using Uncertainty based Class Activation Maps}},
  booktitle = {IEEE/CVF International Conference on Computer Vision},
  year = {2019},
  doi = {10.1109/iccv.2019.00754},
}
Figure