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

Gradient-Based Localization and Spatial Attention for Confidence Measure in Fine-Grained Recognition using Deep Neural Networks

Charles A. Kantor, Léonard Boussioux, Brice Rauby, Hugues Talbot

Introduction

Deep learning models are often criticized for being overconfident "black boxes" that lack the ability to signal when they are guessing. This is particularly problematic in high-stakes fields like medical diagnostics or fine-grained recognition, where distinguishing between subtle categories (e.g., bird species) requires extreme precision. Traditional uncertainty estimation methods, such as Monte-Carlo sampling, are computationally expensive and often unsuitable for real-time, large-scale applications. This paper introduces Over-MAP, a computationally efficient confidence measure that evaluates model certainty by comparing spatial attention with object segmentation.

Methodology: The Over-MAP Metric

The core idea behind Over-MAP is "spatial consistency." If a model is truly confident in its prediction, its internal attention should be focused on the object it is classifying. The method integrates three components:

  1. Structural Attention (Grad-CAM): Generates a heatmap indicating the pixels most influential to the model's decision.
  2. Guided Segmentation (Mask R-CNN): Identifies the actual boundaries of the object within the image.
  3. Overlap Measure: Calculates the degree of overlap between the attention heatmap and the segmentation mask.

If the model’s attention is concentrated within the object's boundaries, the prediction is deemed high-confidence. Conversely, if the model focuses on background noise or empty space, the prediction is flagged as uncertain. This "plug-and-play" approach requires no retraining or multiple inference passes, making it highly efficient for production environments.

Datasets and Evaluation

The methodology was evaluated on fine-grained recognition tasks where minute details are critical. While the paper references general problems using ImageNet, the specific evaluation utilized:

  • Internal/Real-world Data: Deployed on platforms for efficient large-scale data annotation.
  • Fine-Grained Recognition: Focused on datasets where category differences are subtle and background noise is common.

Key Results

The implementation of Over-MAP demonstrated a clear correlation between spatial consistency and prediction accuracy. By rejecting the most "uncertain" samples—specifically those with low Over-MAP scores—the researchers achieved significant performance gains.

Impact of data rejection on Top-3 accuracy across different model configurations. Rejection of low-confidence samples leads to a notable increase in accuracy.

Key findings include:

  • Accuracy Boost: Rejecting the bottom 12–18% of samples based on Over-MAP scores improved Top-3 macro test accuracy by 6 to 10 percentage points.
  • Selection Thresholds: Accuracy increases as the selection criteria tighten (i.e., as the proportion of data remaining decreases), though gains begin to plateau after rejecting approximately 18% of the data.
  • Operational Utility: The method is currently used in production to assist human annotators in processing large-scale datasets more reliably by filtering out ambiguous examples.

Discussion and Future Work

While effective, Over-MAP's performance is inherently tied to the quality of the underlying segmentation model. If the segmentation fails, the overlap defaults to zero. Furthermore, the current "foreground vs. background" approach may be overly simplistic for complex tasks. Future research could explore "spatial conjunctions"—analyzing whether the model focuses on specific, critical object parts (e.g., a bird's beak vs. its wing) rather than just the general silhouette. Despite these limitations, Over-MAP provides a robust, efficient tool for auditing model decisions and cleaning training data by identifying ambiguous or poorly labeled examples.

Summary updated

BibTeX
@inproceedings{kantor2021gradient,
  author = {Charles A. Kantor and Léonard Boussioux and Brice Rauby and Hugues Talbot},
  title = {{Gradient-Based Localization and Spatial Attention for Confidence Measure in Fine-Grained Recognition using Deep Neural Networks}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2021},
  doi = {10.1609/aaai.v35i18.17900},
}
Figure