Interpretable Network Visualizations: A Human-in-the-Loop Approach for Post-hoc Explainability of CNN-based Image Classification
Abstract Transparency and explainability in image classification are essential for establishing trust in machine learning models and detecting biases and errors. State-of-the-art explainability methods generate saliency maps to show where a specific class is identified, without providing a detailed explanation of the model's decision process. Striving to address such a need, we introduce a post-hoc method that explains the entire feature extraction process of a Convolutional Neural Network. These explanations include a layer-wise representation of the features the model extracts from the input. Such features are represented as saliency maps generated by clustering and merging similar feature maps, to which we associate a weight derived by generalizing Grad-CAM for the proposed methodology. To further enhance these explanations, we include a set of textual labels collected through a gamified crowdsourcing activity and processed using NLP techniques and Sentence-BERT. Finally, we show an approach to generate global explanations by aggregating labels across multiple images.
Introduction: Bridging the Semantic Gap
In the field of computer vision, Convolutional Neural Networks (CNNs) have achieved remarkable success, yet their internal decision-making processes often remain "black boxes." While existing Explainable AI (XAI) tools like Grad-CAM or LIME provide saliency maps—heatmaps indicating which pixels influenced a prediction—they often suffer from a "semantic gap." For instance, if a model highlights a dog's face, it remains unclear whether it is identifying the ears, the texture of the fur, or the shape of the snout. This ambiguity hinders trust and complicates model debugging. To bridge this gap, we present Interpretable Network Visualizations (INV), a framework that translates abstract internal features into human-understandable labels.
The INV Framework
The INV methodology is a post-hoc approach, meaning it can be applied to pre-trained models without requiring architectural changes. The pipeline consists of three primary stages: Feature Map Analysis, Human Knowledge Collection, and Label Analysis.
- Feature Map Analysis: CNN layers contain hundreds of feature maps. To make this manageable, INV uses PCA and t-SNE for dimensionality reduction, followed by Agglomerative Hierarchical Clustering. This process groups similar neurons into "cluster maps" that represent distinct visual concepts. Each cluster is assigned a weight by generalizing the Grad-CAM algorithm, indicating its importance to the final classification.
- Human Knowledge Collection (Deep Reveal): To attach semantic meaning to these clusters, we developed "Deep Reveal," a gamified crowdsourcing platform. Participants are shown "masked" images where only the region highlighted by a specific cluster is visible. They must first guess the object's class and then provide textual labels for the features they see.
- Label Analysis: Human-provided labels are often noisy or redundant. We employ NLP techniques and Sentence-BERT to clean the data, group synonyms (e.g., "tower" and "steeple"), and filter out errors. The result is a set of high-quality, weighted labels for each cluster map.
Key Insights and Results
Our evaluation using a VGG-16 model trained on the Imagenette dataset yielded several key insights:
- Discriminative Labeling: By requiring users to guess the class before labeling, we ensure the labels capture features that are actually useful for classification.
- Layer-wise Evolution: The visualizations confirm that shallower layers detect generic shapes (like roof lines), while deeper layers identify specific semantic parts (like crosses or steeples).
- Global Explanations: By aggregating labels across multiple images, we can generate global profiles for classes, describing the general features the model uses to recognize them (e.g., identifying a fish primarily by its gills and scales).
In a user study with 165 participants, INV was rated significantly more "informative" than industry standards like Grad-CAM, LIME, and SHAP. While traditional methods are simpler, INV provides a deeper, more satisfying understanding of the model's internal logic. We further validated the human labels using Testing with Concept Activation Vectors (TCAV), confirming their mathematical significance within the model's latent space.
Conclusion and Future Work
The INV framework represents a significant step toward closing the semantic gap in image classification explainability. By integrating human knowledge directly into the explanation process, we provide a layer-by-layer map of model reasoning. Future work will explore replacing human crowds with Large Language Models (LLMs) to automate labeling and extending the framework to non-CNN architectures like Vision Transformers.
Summary updated