CryptoGCN: Fast and Scalable Homomorphically Encrypted Graph Convolutional Network Inference

Ran Ran, Wei Wang, Quan Gang, Jieming Yin, Nuo Xu, Wujie Wen

Introduction

Cloud-based Graph Convolutional Networks (GCNs) are increasingly used for analyzing sensitive data, such as medical records and financial transactions. However, sending raw data to the cloud introduces significant privacy risks. Homomorphic Encryption (HE) offers a compelling solution by allowing servers to compute directly on encrypted data without ever decrypting it. Unfortunately, HE comes with a massive "performance tax"—operations can be orders of magnitude slower than standard plaintext math.

CryptoGCN is a novel framework designed to make private GCN inference fast and scalable. By introducing a new data formatting method and a strategic network pruning technique, the researchers achieved a 3.10× speedup in latency and a 77.4% reduction in homomorphic operations with minimal impact on accuracy.

The Challenge: GCNs and Homomorphic Encryption

Standard neural networks are already difficult to run under HE, but GCNs present a unique, compounded challenge. In a GCN, every layer requires a matrix-matrix multiplication between the node features and an adjacency matrix (which represents the graph's structure).

As shown in the authors' profiling, this single requirement of multiplying by the adjacency matrix can lead to a nearly 50× increase in the number of expensive homomorphic operations compared to standard operations.

Motivation: The inclusion of adjacency matrix multiplication significantly spikes the count of HE operations.

Core Innovations

To tackle the immense HE overhead, CryptoGCN introduces two primary innovations:

1. Adjacency Matrix Aware (AMA) Data Formatting

Standard HE frameworks often use "row-major" formatting. This is highly inefficient for the repeated matrix multiplications found in GCNs because it requires many computationally expensive "ciphertext rotations" to align the data properly.

CryptoGCN introduces Adjacency Matrix Aware (AMA) formatting, which packs data into ciphertexts in a way that aligns natively with the graph's structure. By decomposing the sparse adjacency matrix into patterned sub-matrices, the framework can perform multiplications without needing any rotations, drastically cutting down on computational costs.

Comparison of AMA data formatting versus traditional row-major formatting. AMA exploits sparsity to eliminate rotations.

2. Activation Pruning (AP)

HE struggles with non-linear functions like ReLU, which must be approximated using polynomials (e.g., $ax^2 + bx + c$). Each approximation layer consumes "rescale levels" in the HE scheme, eventually forcing the use of larger, slower encryption parameters (like a larger "ring size") to maintain security.

The authors developed a co-optimization framework that identifies and prunes non-essential activation layers. By keeping the "multiplicative depth" of the network shallow, they can use smaller encryption parameters, providing a massive, non-linear boost to overall speed.

Key Insights

  • Sparsity is a Secret Weapon: While GCNs add complexity, their adjacency matrices are often very sparse. AMA formatting turns this sparsity into a direct performance gain by avoiding the "inner loop" of rotations typically required for encrypted matrix math.
  • Depth is More Expensive than Breadth: In HE, the number of sequential multiplications (depth) dictates the size of the encryption parameters. Reducing depth through Activation Pruning allows for a smaller ring size, which speeds up all operations. For instance, doubling the ring size can more than double the latency of basic HE operations.
  • Co-Optimization is Essential: Optimizing the crypto-system and the neural network in isolation is insufficient. CryptoGCN succeeds by trading off a tiny bit of model accuracy for a massive gain in security-compliant speed.

Results and Performance

The framework was evaluated using the NTU-XVIEW benchmark of the NTU-RGB+D dataset, a large-scale dataset for 3D skeleton-based human action recognition. The authors note this is the largest dataset evaluated homomorphically in the literature to date.

Compared to state-of-the-art HE-based privacy-preserving frameworks, CryptoGCN achieved:

  • Up to a 3.10× speedup in average latency when processing mini-batches.
  • A 77.4% reduction in the total Homomorphic Operation Count (HOC).
  • A very small accuracy loss of only 1% to 1.5%.

Furthermore, unlike previous methods that struggle as batch sizes grow, CryptoGCN's efficiency actually improves with larger batch sizes due to better utilization of Single Instruction Multiple Data (SIMD) structures.

Limitations and Future Work

While CryptoGCN represents a major step forward, there are areas for further development. Currently, the framework assumes the normalized adjacency matrix is plaintext. While node features are encrypted, the graph structure itself might contain sensitive information in some applications, suggesting a need to encrypt the adjacency matrix in future iterations.

Additionally, the current implementation is single-threaded; integrating multi-threading or specialized hardware (like FPGAs or ASICs designed for HE) could further slash inference times. Finally, exploring higher-order polynomials for activation approximations might recover the small accuracy loss for even more complex graph tasks.

Summary updated

BibTeX
@inproceedings{ran2022cryptogcn,
  author = {Ran Ran and Wei Wang and Quan Gang and Jieming Yin and Nuo Xu and Wujie Wen},
  title = {{CryptoGCN: Fast and Scalable Homomorphically Encrypted Graph Convolutional Network Inference}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2022},
  url = {https://openreview.net/forum?id=VeQBBm1MmTZ},
}
Figure