Abstract
Graph classification is a fundamental task in machine learning with applications ranging from bioinformatics to social network analysis. However, traditional approaches such as Graph Kernels and Graph Neural Networks (GNNs) often face scalability and efficiency challenges, particularly in resource-constrained environments. This paper presents GraphHD, a novel framework that utilizes Hyperdimensional Computing (HDC) to encode graph topology into high-dimensional hypervectors. By leveraging PageRank for vertex identification and bitwise operations for edge encoding, GraphHD achieves competitive accuracy while significantly outperforming existing methods in training and inference speed.
1. Introduction
Assigning labels to entire graph structures—such as determining the toxicity of a molecule or the function of a protein—is a critical challenge in data science. Currently, the landscape is dominated by Graph Kernels, which often scale quadratically with dataset size, and Graph Neural Networks (GNNs), which require intensive matrix multiplications and high energy consumption. These requirements make them less suitable for deployment on low-power Internet of Things (IoT) devices.
GraphHD introduces a "middle ground" by applying Hyperdimensional Computing (HDC), a brain-inspired paradigm that represents data using massive vectors (typically 10,000 dimensions). This approach offers a robust, linearly scaling alternative that is inherently hardware-friendly.
2. Methodology
2.1 Hyperdimensional Computing (HDC) Principles
HDC represents information as high-dimensional hypervectors composed of bits or bipolar values. The framework relies on three primary operations:
- Binding: An XOR-like operation that combines two hypervectors to create a new, orthogonal representation.
- Bundling: An element-wise addition and normalization that aggregates multiple hypervectors into a single representative vector.
- Similarity Check: A distance metric (e.g., cosine similarity) used to compare hypervectors.
2.2 The GraphHD Encoding Scheme
The core innovation of GraphHD is its three-step process for translating graph topology into a single hypervector:
- Vertex Identification: To handle the lack of a natural 1-to-1 correspondence between vertices across different graphs, GraphHD uses PageRank centrality. Vertices are ranked by structural importance; vertices sharing the same rank across different graphs are assigned the same random "basis" hypervector.
- Edge Encoding: An edge between two vertices is represented by binding their respective vertex hypervectors. This creates a unique "edge-hypervector" that captures the relationship between specific structural roles.
- Graph Representation: All edge-hypervectors within a graph are bundled together to form a single "graph-hypervector."
2.3 Training and Inference
Training in GraphHD is highly efficient. For each class, the model bundles all graph-hypervectors belonging to that class into a single "class-vector." During inference, a new graph is encoded into a hypervector, and the model calculates its similarity to each class-vector, assigning the label of the most similar match.
3. Experimental Evaluation
3.1 Datasets
The researchers evaluated GraphHD using six standard benchmarks from the TUDataset collection, including chemical compounds (MUTAG, NCI1, PTC_FM) and protein structures (PROTEINS, ENZYMES, DD). These datasets range in complexity, with the DD dataset containing the largest graphs, averaging approximately 284 vertices.
3.2 Performance Metrics
GraphHD was compared against GNN baselines (such as GIN-ε) and traditional kernel methods. The evaluation focused on accuracy, training speed, and inference efficiency.
4. Results and Discussion
4.1 Computational Efficiency
GraphHD demonstrated superior speed across all benchmarks. On the large-scale DD dataset, GraphHD trained 12.1× faster than GNNs and 24.6× faster than the fastest kernel method. Overall, training was up to 14.6× faster than GNNs in specific configurations. Inference was similarly efficient, with GNNs being roughly 10.5% slower and kernels being over 20× slower on the largest datasets.
4.2 Predictive Accuracy
GraphHD achieved accuracy levels comparable to GNNs on most datasets. While it lagged behind specialized kernel methods on specific datasets like NCI1 and ENZYMES (by 12-18%), it remained competitive. Notably, GraphHD relies purely on topology (structure), whereas many GNNs utilize additional node attributes. This suggests that structural encoding alone provides a powerful signal for classification.
4.3 Scalability
As graph size increases, GraphHD’s training time grows much more slowly than its counterparts. This linear scaling makes it a viable candidate for processing very large graphs that would be computationally prohibitive for kernel-based methods.
5. Conclusion and Future Work
GraphHD provides a lightweight, high-speed alternative for graph classification. Its reliance on bitwise operations makes it exceptionally well-suited for FPGA and ASIC implementations, potentially enabling classification in a single clock cycle on dedicated hardware.
Future research will focus on:
- Attribute Integration: Incorporating node and edge labels (e.g., atom types) to close the accuracy gap on chemical datasets.
- Iterative Training: Implementing "retraining" techniques to refine class-vector boundaries and improve precision.
- Hardware Deployment: Validating energy efficiency on specialized HDC hardware architectures.
Summary updated