TL;DR
This paper introduces the first comprehensive explainability analysis of Graph Neural Networks (GNNs) for image classification. By developing novel metrics and visualization techniques, the authors demonstrate that GNNs exhibit a progression from local to global feature processing, but their reasoning may not always align with human perception, especially in deeper layers.
What Problem Does This Paper Address?
Image classification has seen remarkable progress with deep learning models, but their "black box" nature makes it difficult to understand why they make certain predictions. While traditional Convolutional Neural Networks (CNNs) have been analyzed using techniques like Grad-CAM, Graph Neural Networks (GNNs) applied to vision tasks, which represent images as graphs of patches, remain largely underexplored in terms of explainability. GNNs offer a potentially more interpretable structure by explicitly modeling relationships between image regions. However, it's unclear how well these graph structures preserve semantic consistency and object relationships across different layers, and whether their decision-making aligns with human intuition. This paper aims to bridge this gap by providing a systematic analysis of GNNs' internal workings for image classification.
Methods
The authors propose a novel framework for analyzing Vision GNNs (ViGs), specifically focusing on the Vision GNN (ViG) architecture. Their approach involves:
- Quantitative Metrics: They introduce five new metrics to quantify various aspects of the graph structure and model behavior across layers:
- Embedding Similarity ($S_{emb}$): Measures the cosine similarity between feature embeddings of connected patches, indicating semantic relatedness.
- Spatial Distance ($D^l$): Calculates the average Manhattan distance between connected patches, revealing how the receptive field expands.
- Visual Similarity ($S_{vis}$): Computes the average pixel-space similarity between connected patches, tracking visual coherence.
- Layer-wise Classification ($p^l$): Tracks the probability of the ground-truth class at each layer to assess confidence evolution.
- Object-based Graph Modularity ($Q^l$): Measures how well graph edges remain localized within object regions versus the background, using automated object masks.
- Visualizations: They employ heatmap-style visualizations to illustrate the connection structure between patches across layers, highlighting the flow of information and attention patterns.
- Comparative Analysis: The framework is applied to both standard and adversarial image datasets to assess the robustness and generalizability of the explanations.
Datasets
The analysis is conducted on:
- ImageNet ILSVRC 2012: A standard large-scale dataset used to establish baseline metrics and patterns. A subset of 10,000 validation images is used.
- ImageNet-a: A dataset containing natural adversarial images that are commonly misclassified by models performing well on ImageNet. This dataset is used to evaluate the framework's ability to provide insights even in challenging, failure cases.
Key Insights and Ideas
- Hierarchical Feature Learning: ViGs exhibit a clear progression from local feature extraction in early layers to more global, semantic representations in deeper layers, mirroring the behavior of traditional CNNs.
- Divergence from Human Perception: While GNNs can be explained, their reasoning in deeper layers may not always align with human intuition. For instance, confident predictions can arise from connections that are visually dissimilar, suggesting a reliance on abstract semantic features.
- Robustness to Adversarial Examples: The graph structure of ViGs degrades significantly on adversarial images, leading to lower modularity scores and drastically reduced classification performance. This highlights a vulnerability in how GNNs handle perturbed inputs.
- Interpretable Receptive Field: The dynamic graph construction in ViGs offers a more interpretable view of the model's receptive field, as edges explicitly show which image regions are considered relevant for feature extraction, adapting to the input content.
Key Results
- Quantitative Trends:
- Early layers (1-4) show high visual and embedding similarity with short spatial distances, indicating local feature focus.
- Deeper layers (up to 15-16) show significantly increased spatial distances (up to ~8.8) and decreased visual similarity (down to ~0.3), signifying a broader receptive field and more abstract processing.
- A notable increase in embedding similarity in the final layers suggests convergence towards semantically meaningful features.
- On ImageNet, the model achieves a top-1 accuracy of 68.6%.
- On ImageNet-a, graph modularity scores are significantly lower (e.g., 0.095 vs. 0.236), and top-1 accuracy drops to a mere 2.7%, with prediction probability falling to 0.018.
- Qualitative Findings:
- Heatmap visualizations reveal how connections evolve, extending from local object parts to background regions and other objects as layers deepen.
- For adversarial examples, connectivity patterns are more dispersed even in early layers, and the characteristic spike in embedding similarity in later layers is diminished, indicating difficulties in forming consistent class-specific representations.
Limitations and Future Work
- Limitations:
- The proposed method is a "white-box" analysis, requiring access to the specific model architecture.
- There might be computational overhead associated with the analysis.
- Future Work:
- Leveraging the method to enhance the interpretability and performance of Vision GNNs.
- Integrating these explainability metrics into a re-training stage to refine model performance.
- Exploring potential architectural improvements guided by these insights.
Summary updated