GCExplainer: Human-in-the-Loop Concept-based Explanations for Graph Neural Networks

Lucie Charlotte Magister, Dmitry Kazhdan, Vikash Singh, Pietro LiòarXiv 2021

Introduction

Graph Neural Networks (GNNs) have become indispensable for processing complex relational data, from molecular structures to social networks. However, their "black box" nature remains a significant barrier to adoption in high-stakes domains like medicine or safety-critical engineering. While existing tools like GNNExplainer provide "local" explanations—clarifying why a model made a specific prediction—they fail to provide "global" insights into what the model has learned about a category as a whole.

GCExplainer addresses this gap by introducing a human-in-the-loop, unsupervised framework designed to move GNN explainability from individual predictions to high-level, human-understandable concepts.

The GCExplainer Framework

GCExplainer adapts the Automated Concept-based Explanation (ACE) algorithm, originally developed for computer vision, to the graph domain. The methodology follows a structured pipeline that leverages the internal representations of the GNN to discover latent concepts.

The GCExplainer pipeline, from input dataset and trained GNN to human-reasoned output concepts.

Methodology Steps:

  1. Activation Mapping: The framework records the internal numerical representations (activations) of nodes at the final neighborhood aggregation layer of a trained GNN.
  2. Unsupervised Clustering: Using $k$-Means clustering on these activations, the system identifies groups of nodes that the model perceives as similar. Each cluster is hypothesized to represent a "concept."
  3. Human-in-the-Loop Discovery: Unlike fully automated systems, GCExplainer involves the user in defining the number of concepts ($k$) and the neighborhood depth ($n$) for visualization. This allows experts to filter out noise and focus on structurally relevant motifs.
  4. Evaluation: The discovered concepts are evaluated using Concept Completeness (measuring how well concepts predict GNN output) and Concept Purity (using Graph Edit Distance to assess structural consistency within clusters).

Experimental Setup and Datasets

The researchers evaluated GCExplainer across seven datasets, including synthetic benchmarks like BA-Shapes and Tree-Cycles, where ground-truth motifs are known. They also tested real-world applications using the Mutagenicity molecular dataset and the REDDIT-BINARY social graph dataset. These tests aimed to determine if the model could identify critical features, such as specific chemical functional groups, that drive its decision-making process.

Key Insights and Results

GCExplainer demonstrated that GNNs naturally group similar structural motifs within their internal layers. By clustering these "thoughts," the framework extracts human-understandable rules without requiring pre-labeled concept data.

Example of fine-grained concepts discovered by GCExplainer, showing distinct structural patterns learned by the model.

Major Findings:

  • High Completeness: The method achieved an average completeness score of 0.753 across all datasets, reaching a perfect 1.0 on the BA-Grid benchmark. This indicates that the discovered concepts are highly representative of the model's actual decision-making logic.
  • Fine-Grained Discovery: In synthetic tests, GCExplainer did not just identify broad shapes; it distinguished between specific components of motifs, such as the "top" versus the "middle" of a house-shaped structure.
  • Superiority over Local Explainers: Qualitatively, GCExplainer produced cleaner, more intuitive motifs than GNNExplainer, which often includes irrelevant "noise" nodes from the surrounding graph.
  • Layer Depth Correlation: Concepts extracted from deeper layers were significantly more complete, confirming that GNNs build increasingly complex structural understandings as data flows through the network.

Limitations and Future Work

While highly effective for node classification, the framework faces challenges in graph-level classification, where extracting concepts requires more complex reasoning about subgraph alignment. On real-world datasets like Mutagenicity, concept "purity" was lower, reflecting the inherent noise in non-synthetic data. Future research will explore advanced dimensionality reduction techniques like UMAP and the addition of structural regularizers to encourage even cleaner clustering of graph motifs.

Summary updated

BibTeX
@misc{magister2021gcexplainer,
  author = {Lucie Charlotte Magister and Dmitry Kazhdan and Vikash Singh and Pietro Liò},
  title = {{GCExplainer: Human-in-the-Loop Concept-based Explanations for Graph Neural Networks}},
  year = {2021},
  eprint = {2107.11889},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2107.11889},
}
Figure