TL;DR
The paper introduces Simple Graph Metric Learning (SGML), a lightweight and scalable framework for learning distances between attributed graphs. By combining a streamlined Graph Convolutional Network (GCN) with a novel, deterministic Optimal Transport metric called Restricted Projected Wasserstein ($RPW_2$), SGML achieves quasi-linear computational complexity. This allows simple, training-efficient algorithms like $k$-Nearest Neighbors ($k$-NN) to achieve classification performance competitive with state-of-the-art, computationally heavy models.
What Problem Does This Paper Address?
Graph classification is crucial in fields like bioinformatics, chemistry, and social network analysis. To classify graphs, algorithms need a reliable way to measure the "distance" or dissimilarity between them.
While metric learning (learning an optimal distance function from data) is highly successful for standard vector data, it is notoriously difficult for graphs. Traditional graph distance measures like Graph Edit Distance (GED) are NP-hard to compute. Modern approaches leverage Optimal Transport (OT) theory (like the Wasserstein distance) to compare graph node distributions, but these methods suffer from quadratic ($O(n^2)$) or cubic ($O(n^3)$) computational complexities. This lack of scalability and differentiability prevents researchers from using simple, instance-based classifiers like $k$-NN, forcing a reliance on expensive retraining cycles when new data arrives.
Methods
The authors break down the SGML framework into three core components:
- Graph to Distribution Mapping: They use a simplified Graph Convolutional Network (SGCN) that strips away all intermediate non-linearities. This dramatically reduces the number of trainable parameters while retaining structural and attribute information. The graph is then represented as a uniform discrete distribution over these node embeddings.
- Restricted Projected Wasserstein ($RPW_2$): To avoid the high cost of standard Wasserstein distance, they introduce $RPW_2$. Instead of projecting data randomly across thousands of angles (like Sliced Wasserstein distance), $RPW_2$ projects node distributions exclusively along the canonical basis vectors of the embedding space. This results in a deterministic formula with a quasi-linear complexity of $O(p^2 n \log n)$, where $n$ is the number of nodes and $p$ is the feature dimension.
- Nearest Class Cloud Metric Learning (NCCML): Traditional metric learning losses fail during mini-batch training because a single batch rarely represents a graph's true local neighborhood. The authors propose NCCML, a novel softmax-based loss function that measures the distance of a graph to the entire "cloud" of same-class graphs within a batch, acting as a global regularizer.
Datasets
The model was evaluated on a wide variety of standard graph classification benchmarks from the literature:
- Discrete Attributes/Degrees: MUTAG, NCI1, PROTEINS, ENZYMES, IMDB-M, IMDB-B.
- Continuous Attributes: BZR, COX2, CUNEIFORM.
No new datasets were introduced in this work.
Key Insights and Ideas
- Canonical Projections are Enough: The most surprising finding is that restricting Wasserstein projections to just the canonical basis vectors ($RPW_2$) provides sufficient geometric information to distinguish graphs. This eliminates the variance and sampling overhead introduced by Monte-Carlo approximations in Sliced Wasserstein ($SW_2$) methods.
- Global Over Local in Batch Training: For batch-based gradient descent, optimizing a graph's distance to a class "cloud" (NCCML) is far more effective than optimizing local neighbor relationships (like Neighborhood Component Analysis).
- The Power of Linearized GCNs: Removing non-linearities from the feature extraction step (SGCN) speeds up training significantly without degrading the quality of the learned metric.
Key Results
- Exceptional Scalability: As shown in the runtime analysis, $RPW_2$ scales quasi-linearly ($O(n \log n)$) with the number of nodes. It easily processes graphs with up to $10^6$ nodes, whereas standard exact Wasserstein solvers ($W_2$ POT) fail due to memory limitations beyond a few thousand nodes.
- Superior $k$-NN Performance: SGML significantly boosts the accuracy of simple $k$-NN classifiers, outperforming other task-agnostic graph distances (e.g., scoring 90.00% on MUTAG compared to 86.47% for FGSD).
- Competitive with State-of-the-Art: When plugged into an SVM kernel, the learned $RPW_2$ metric achieves accuracies competitive with heavy-duty frameworks like Wasserstein Weisfeiler-Lehman (WWL) and Fused-Gromov-Wasserstein (FGW), despite its drastically lower computational footprint.
Limitations and Future Work
- GCN Expressiveness: Because the model relies on a GCN-style message-passing architecture, it inherits the well-known "oversmoothing" problem, where graph representations lose distinctiveness as the neighborhood depth ($r$) increases.
- Theoretical Guarantees: While the authors prove that $RPW_2$ is a valid metric on discrete distribution spaces, they note that its full theoretical behavior (such as strictly satisfying the triangle inequality within the graph embedding pipeline) requires further mathematical clarification.
- Task Expansion: The current framework and NCCML loss are strictly tailored for supervised classification. Future work is needed to adapt SGML to unsupervised clustering ($k$-means) or regression tasks.
Summary updated