Binary Graph Neural Networks

Mehdi Bahri, Gaétan Bahl, Stefanos Zafeiriou

Graph Neural Networks (GNNs) have become the standard for processing irregular data structures such as social networks, molecular graphs, and 3D point clouds. Despite their success, the high computational cost and memory footprint of standard floating-point (FP32) GNNs pose significant challenges for deployment on resource-constrained edge devices.

This paper introduces a comprehensive framework for Binary Graph Neural Networks, compressing weights and activations to a single bit. This approach achieves up to a 32x reduction in model size and enables high-speed inference through bitwise operations, particularly for dynamic graph architectures.

Methodology

The researchers focused on binarizing the Dynamic Graph CNN (DGCNN) and GraphSAGE architectures. Transitioning to a binary regime requires addressing the inherent difficulty of training discrete networks and the high cost of dynamic graph construction.

Cascaded Distillation and LSP Loss

Training binary networks from scratch often leads to poor convergence. To mitigate this, the authors propose a three-stage cascaded knowledge distillation protocol. In the first stage, a real-valued student network is trained to mimic a pre-trained FP32 teacher. The second stage binarizes activations, and the final stage binarizes both weights and activations.

To ensure the student network captures the essential topology of the graph, a Local Structure Preserving (LSP) loss is integrated. This loss encourages the student to maintain the same relative distances between node features as the teacher network.

The proposed cascaded distillation framework, illustrating the teacher-student relationship and the integration of Local Structure Preserving (LSP) loss.

XorEdgeConv and Hamming Space

In dynamic GNNs like DGCNN, the graph structure is re-computed in every layer using $k$-Nearest Neighbors ($k$-NN) in Euclidean space. This is computationally prohibitive for edge devices. The authors propose performing $k$-NN searches in Hamming space using binarized node features. By replacing Euclidean distance with Hamming distance (computed via XOR and POPCNT instructions) and replacing edge feature subtraction with the XOR ($\oplus$) operation (XorEdgeConv), the framework significantly accelerates graph construction.

Experimental Results

The framework was evaluated on ModelNet40 (3D point clouds), OGBN-Products, and OGBN-Proteins.

Accuracy and Compression

On the ModelNet40 benchmark, the "Real Features" (RF) binary model—which binarizes weights and internal activations but keeps input features real—achieved 91.05% accuracy, remarkably close to the 92.89% FP32 baseline. In terms of storage, the model size was reduced from 7.2MB to 341KB, representing a 20x practical compression.

Hardware Efficiency

To validate real-world performance, the models were benchmarked on a Raspberry Pi 4B. The optimized binary implementation achieved a 2x speedup in total runtime compared to the FP32 version. Theoretical analysis suggests that fully optimized Hamming distance kernels could provide up to a 64x speedup for the $k$-NN component on ARM hardware.

Relative run time comparison on a Raspberry Pi 4B, demonstrating the efficiency gains of the binary BDGCNN variants over the standard FP32 DGCNN.

Conclusion

This work demonstrates that GNNs can be aggressively quantized without catastrophic loss in performance. By combining cascaded distillation with efficient Hamming space operations, the authors bridge the gap between complex geometric deep learning and the constraints of edge computing. Future work remains to close the "binary gap" for models where input node features are also fully binarized.

Summary updated

BibTeX
@inproceedings{bahri2021binary,
  author = {Mehdi Bahri and Gaétan Bahl and Stefanos Zafeiriou},
  title = {{Binary Graph Neural Networks}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2021},
  doi = {10.1109/cvpr46437.2021.00937},
}
Figure