StructPool: Structured Graph Pooling via Conditional Random Fields

Hao Yuan, Shuiwang JiICLR 2020

TL;DR

StructPool is a novel graph pooling technique that treats the reduction of a graph as a node clustering problem solved via Conditional Random Fields (CRFs). By explicitly modeling the relationships between node assignments, it captures high-order structural information that traditional pooling methods often ignore, leading to state-of-the-art results in graph classification.

What Problem Does This Paper Address?

Graph Neural Networks (GNNs) have revolutionized how we handle data structured as graphs, such as molecules or social networks. However, while we are great at learning individual node features, "pooling"—the process of shrinking a large graph into a smaller, high-level representation for classification—remains a challenge.

Most existing pooling methods fall into two camps:

  1. Global Pooling: Simply summing or averaging all nodes. This is "flat" and loses the rich structural hierarchy of the graph.
  2. Selection/Clustering Pooling: Methods like TopKPool pick the "best" nodes, while DiffPool clusters nodes together.

The authors argue that these methods share a common flaw: they don't explicitly model the relationships between node assignments. In other words, when deciding which cluster a node should belong to, existing models don't sufficiently consider where that node's neighbors are going. StructPool aims to fix this by treating pooling as a structured prediction task.

Methods

The core innovation of StructPool is the use of Conditional Random Fields (CRFs) to learn the cluster assignment matrix.

The architecture of StructPool, illustrating the computation of unary and pairwise energies to form the assignment matrix.

1. Pooling as Clustering

The goal is to map $n$ nodes in the original graph to $k$ nodes in a pooled graph. This requires an assignment matrix $M$. StructPool formulates the creation of $M$ as a CRF problem, which is characterized by a Gibbs energy function consisting of two parts:

  • Unary Energy: Based on individual node features (calculated using standard GCN layers). It asks: "Based on its own features, which cluster does this node fit into?"
  • Pairwise Energy: Based on the relationship between pairs of nodes. It asks: "If node A goes to cluster X, how does that affect where its neighbor node B should go?"

2. Incorporating Topology

Unlike CRFs used in computer vision (which often assume every pixel relates to every other pixel), StructPool uses the graph's actual topology. It uses $l$-hop connectivity to define the "clique set," meaning only nodes within a certain distance of each other influence their respective assignments.

3. Efficient Inference

To make this computationally feasible, the authors use a mean-field approximation. This is an iterative update process (similar to an attention mechanism) that allows the model to converge on the most probable cluster assignments. The entire process is differentiable, meaning StructPool can be trained end-to-end with the rest of the GNN.

Datasets

The authors evaluated StructPool on eight widely used benchmark datasets:

  • Bioinformatics (Protein/Molecules): ENZYMES, D&D, PROTEINS, PTC, MUTAG.
  • Social Networks: COLLAB, IMDB-Binary (IMDB-B), IMDB-Multi (IMDB-M).

These datasets vary significantly in size and complexity, providing a robust test for the model's generalizability.

Key Insights and Ideas

  • The "Peer Pressure" Effect: By using CRFs, StructPool introduces a form of "structured consistency." If two nodes are closely connected and share similar features, the pairwise energy term strongly encourages them to be pooled into the same cluster.
  • Attention as Energy: The authors found that traditional Gaussian kernels (used in image CRFs) were too slow for high-dimensional graph data. Instead, they used an attention matrix to measure pairwise energy, which is much more efficient for sparse graph structures.
  • Hierarchical Flexibility: StructPool isn't just a one-off operation; it can be stacked to create deep, hierarchical networks (like a "Graph U-Net") that progressively distill a graph into its most essential components.

Key Results

Performance comparison of StructPool against baseline methods across multiple graph classification datasets.
  • Superior Accuracy: StructPool outperformed state-of-the-art methods like DiffPool and DGCNN on 5 out of 6 main benchmark datasets. On these five, it beat the second-best model by an average of 3.58%.
  • Ablation Success: When the authors removed the "Pairwise Energy" (the CRF component), performance dropped significantly across all datasets. This confirms that explicitly modeling node relationships is the "secret sauce" of the model.
  • Complexity: Despite the sophisticated math, the computational complexity is $O(n^3)$, which the authors show is comparable to simply adding more GCN layers. In practice, for a graph with 500 nodes, StructPool adds only about 10-15 milliseconds of overhead compared to simpler methods.

Limitations and Future Work

  • Overfitting on Small Data: The authors noted that on smaller datasets (like PROTEINS), adding too many StructPool layers (making the network "deeper") actually decreased performance due to overfitting.
  • Hyperparameter Sensitivity: The model requires tuning the number of clusters ($k$) and the hop-distance ($l$). While the paper provides heuristics, finding the optimal settings for a brand-new dataset might require significant experimentation.
  • Scalability to Massive Graphs: While $O(n^3)$ is acceptable for the benchmarks used, extremely large graphs (millions of nodes) would likely require further optimizations or sampling techniques to remain performant.

Summary updated

BibTeX
@inproceedings{yuan2020structpool,
  author = {Hao Yuan and Shuiwang Ji},
  title = {{StructPool: Structured Graph Pooling via Conditional Random Fields}},
  booktitle = {International Conference on Learning Representations},
  year = {2020},
}
Figure