Graph Filtration Kernels

Till Hendrik Schulz, Pascal Welke, Stefan Wrobel

Abstract

Traditional graph kernels often rely on counting mutual substructures, a method that can overlook the continuous nature of edge attributes and the broader topological context. We introduce Graph Filtration Kernels, a novel framework for graph classification that analyzes graphs at varying resolutions through a process called filtration. By tracking the appearance and persistence of structural features as edges are incrementally added, and comparing these lifespans using the Wasserstein distance, we construct a kernel that is mathematically proven to be strictly more expressive than the standard Weisfeiler-Lehman (WL) kernel. Our approach demonstrates significant performance improvements on social network benchmarks and successfully distinguishes non-isomorphic graphs in synthetic tests where traditional methods fail.

Introduction

Graph classification is a cornerstone of machine learning with applications ranging from drug discovery to social network analysis. Historically, this field has been dominated by "histogram kernels," such as the R-convolution or the Weisfeiler-Lehman subtree kernel. These methods measure similarity by counting the frequency of shared substructures. While effective, this counting-based approach is inherently rigid; it treats features as discrete entities and ignores the structural evolution of the graph. Consequently, two graphs with identical feature counts may be considered similar even if those features exist in fundamentally different topological environments.

To address these limitations, we propose a framework inspired by persistent homology. Instead of viewing a graph as a static object, we treat it as a dynamic system that evolves through a sequence of nested subgraphs.

Methodology

The core of our approach is the Graph Filtration. A filtration is a sequence of nested subgraphs $G_1 \subset G_2 \subset \dots \subset G_k = G$, typically constructed by adding edges based on a threshold of their weights or other structural attributes.

The Graph Filtration Kernel pipeline: from weighted graph to filtration sequence, persistence intervals, and final histogram.

The process involves four primary steps:

  1. Feature Persistence: As the filtration progresses, structural features (e.g., WL subtree labels) emerge and persist. We track the "existence intervals" or lifespans of these features across the sequence.
  2. Filtration Histograms: These lifespans are aggregated into histograms. Unlike standard histograms that only record frequency, filtration histograms capture when a feature appears and how long it survives.
  3. Wasserstein Distance: To compare histograms between two graphs, we utilize the 1-Wasserstein distance (Earth Mover's Distance). This metric calculates the optimal cost of transforming one graph's feature lifespans into another's, providing a more nuanced measure of similarity than simple overlap.
  4. Kernel Construction: The resulting distances are transformed into a positive semi-definite kernel using an exponential decay function, enabling their use in standard kernel-based learning algorithms.

A prominent implementation of this framework is the Weisfeiler-Lehman Filtration Kernel (FWL), which applies these principles to WL subtree features.

Theoretical Expressivity

A key contribution of this work is the mathematical proof that the WL Filtration Kernel is strictly more expressive than the standard WL subtree kernel. The standard WL test is a well-known upper bound for the expressive power of most message-passing Graph Neural Networks (GNNs). By incorporating the temporal dimension of feature appearance through filtrations, our method can distinguish non-isomorphic graphs that the standard WL test finds identical.

Comparison of filtrations for two non-isomorphic graphs that standard WL kernels might fail to distinguish.

This increased expressivity suggests that an ensemble of GNNs operating over a graph filtration would be more powerful than a single GNN operating on the original graph alone, providing a new theoretical blueprint for building more powerful GNNs.

Experimental Evaluation

We evaluated the FWL kernel on diverse benchmarks, including molecular datasets (DHFR, NCI1), social networks (EGO), and synthetic graphs (CSL).

Key Results

  • Social Network Performance: On the EGO datasets, the FWL kernel significantly outperformed state-of-the-art methods. Notably, it achieved a 10% accuracy increase on the EGO-4 dataset.
  • Efficiency: Despite the added complexity of tracking lifespans, the 1D nature of the Wasserstein distance calculation allows for linear time complexity relative to filtration length. We found that a short filtration length ($k=2$ or $3$) was sufficient to achieve peak performance.
  • CSL Benchmark: The Circular Skip Link (CSL) dataset consists of regular graphs that are indistinguishable by standard WL methods. While traditional kernels achieve only random accuracy, the FWL kernel successfully distinguished up to 100% of these graphs when provided with edge weights based on walk lengths.

Conclusion

Graph Filtration Kernels represent a significant step beyond simple feature counting in graph classification. By leveraging the persistence of structural features across multiple resolutions, we provide a richer, more expressive signature for graphs. Future work will focus on developing "filtration-aware" GNNs that can natively learn from these nested subgraph sequences, potentially overcoming the fundamental limitations of current message-passing architectures.

Summary updated

BibTeX
@inproceedings{schulz2022graph,
  author = {Till Hendrik Schulz and Pascal Welke and Stefan Wrobel},
  title = {{Graph Filtration Kernels}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2022},
  doi = {10.1609/aaai.v36i8.20793},
}
Figure