Abstract
Deep learning models often operate as "black boxes," making visual explanation tools like Class Activation Mapping (CAM) essential for establishing trust. However, existing CAM methods frequently suffer from a "trilemma" of instability, high computational cost, or poor localization quality. This paper introduces LFI-CAM, a novel approach that utilizes a Feature Importance Network (FIN) to learn feature weights in a single forward pass. By integrating an attention mechanism that forces the backbone to focus on relevant regions, LFI-CAM produces stable, high-quality heatmaps that simultaneously improve the underlying model's classification performance.
Introduction
To deploy deep neural networks in high-stakes environments, we must understand the rationale behind their decisions. Visual explanation methods, particularly Class Activation Mapping (CAM), generate heatmaps to highlight the image regions most influential to a model's output. Despite their utility, current methods face significant trade-offs:
- Instability: Methods like the Attention Branch Network (ABN) are highly sensitive to hyper-parameters; identical architectures trained with different seeds can produce wildly inconsistent explanations.
- Computational Latency: High-quality, gradient-free methods like Score-CAM require a separate forward pass for every feature channel (often 512+), making them unsuitable for real-time applications.
- Localization Quality: Gradient-based methods (e.g., Grad-CAM) often yield noisy visualizations or fail to capture the full extent of an object.
LFI-CAM (Learning Feature Importance CAM) addresses these challenges by transforming feature importance from a post-hoc calculation into a learned task.
The LFI-CAM Architecture
LFI-CAM re-architects the standard explainable network into a dual-branch system:
The Perception Branch
This branch consists of a standard backbone (such as ResNet or ResNeXt) responsible for feature extraction and final classification. It receives feedback from the attention branch to refine its focus during training.
The Attention Branch (FIN)
The core innovation is the Feature Importance Network (FIN). Rather than calculating weights based on gradients or scores, the FIN learns the importance of each feature map. The process involves:
- Feature Masking: Feature maps from the final convolutional layer are treated as spatial masks.
- Grayscale Contextualization: These masks are applied to a downsampled, grayscale version of the input image. This allows the FIN to understand spatial context without the heavy computational load of full RGB processing.
- Weight Generation: The FIN processes these masked images to output a specific weight for each channel.
- Feedback Loop: The resulting attention map is fed back into the Perception branch. This creates a virtuous cycle where the model is forced to focus on the regions the FIN deems important, leading to more robust feature representations.
Experimental Evaluation
The authors evaluated LFI-CAM across five diverse benchmarks to ensure robustness: CIFAR10, CIFAR100, STL10, Kaggle’s Cat&Dog dataset, and ImageNet. The method was tested across various ResNet variants (18, 34, 50, 101, 152) and ResNeXt architectures.
Key Results
- Superior Stability: In stability benchmarks on the STL10 dataset, LFI-CAM achieved over 60% Intersection over Union (IoU) overlap between different training runs, doubling the 30% IoU managed by the previous state-of-the-art (ABN).
- Enhanced Accuracy: LFI-CAM consistently improved classification performance. On the Cat&Dog dataset, it reduced top-1 error by 0.35% compared to ABN, and on STL10, it outperformed the baseline by 0.59%.
- Real-Time Efficiency: By generating explanations during the initial forward pass, LFI-CAM is orders of magnitude faster than Score-CAM, which requires hundreds of passes per image.
- Parameter Efficiency: On ImageNet, LFI-CAM achieved comparable or superior accuracy to ABN while utilizing significantly fewer parameters (e.g., 17.47M vs. 21.61M for a ResNet-18 backbone).
Discussion and Conclusion
LFI-CAM successfully bridges the gap between fast, unstable attention models and slow, high-quality perturbation methods. By treating feature importance as a learning objective, the model produces explanations that are not only visually precise—even in images containing multiple target objects—but also highly consistent across different training sessions.
While currently optimized for image classification, the potential for LFI-CAM extends to more complex tasks. Future work will explore adapting the Feature Importance Network for object detection and semantic segmentation, as well as evaluating its performance on emerging architectures like Vision Transformers (ViTs).
Summary updated