GNN Predictions on k-hop Egonets Boosts Adversarial Robustness

Jian VoraGLFrontiers @ NeurIPS 2023

TL;DR

This paper introduces "k-HOP-PURIFY," a simple yet effective method to improve the robustness of Graph Neural Networks (GNNs) against adversarial attacks. By focusing predictions on a local k-hop neighborhood (egonets) instead of the entire graph, the method significantly boosts accuracy under various attack scenarios, acting as both a standalone defense and a post-processing step for existing defenses.

What Problem Does This Paper Address?

Graph Neural Networks (GNNs) have become powerful tools for analyzing graph-structured data, but like many deep learning models, they are vulnerable to adversarial attacks. These attacks, often involving subtle perturbations to graph structure (e.g., adding edges between dissimilar nodes), can drastically degrade GNN performance. Existing defense mechanisms are often computationally expensive, rely on heuristics, or alter the graph's original structure. This paper addresses the need for a lightweight, scalable, and effective defense that can be applied at inference time to mitigate the impact of these adversarial attacks on GNN predictions.

Methods

The core contribution is the "k-HOP-PURIFY" method. Instead of feeding the entire graph into a GNN for prediction, this approach constructs a local subgraph, specifically a k-hop egonet, centered around the node for which a prediction is being made. This egonet includes the target node and all nodes reachable within k hops, along with their connecting edges. The GNN then processes this smaller subgraph to generate the prediction. This method is designed to be applied during inference and can be used in two ways:

  1. Standalone Defense: The GNN (either vanilla or pre-trained) is used with k-hop subgraphs for prediction.
  2. Post-processing Step: It can be applied after existing defense mechanisms to further enhance robustness.

The authors emphasize that this method is extremely lightweight, requiring only a few lines of code to implement, and is scalable because the subgraph construction can be parallelized.

Datasets

The paper evaluates its method on several standard graph datasets commonly used in GNN research:

  • CORA: A citation network dataset.
  • PUBMED: A biomedical literature citation network.
  • OGBN-ARXIV: A large-scale dataset from the Open Graph Benchmark.
  • CITESEER: Another citation network dataset.

The experiments utilize the DeepRobust library, which provides implementations for various attacks and defenses.

Key Insights and Ideas

  • Local Context is Key (for Robustness): The most surprising insight is that focusing on a local neighborhood (k-hop egonet) significantly improves robustness against adversarial attacks. This suggests that adversarial attacks often exploit global graph structures or connections between distant, dissimilar nodes, which are effectively filtered out when considering only local information.
  • Simplicity as a Strength: The method's effectiveness despite its extreme simplicity (4 lines of code) is a major takeaway. This contrasts sharply with many complex and computationally intensive defense strategies.
  • Inference-Time Solution: The ability to apply this method at inference time makes it highly practical, as it doesn't require retraining the GNN model or modifying the training process.
  • General Applicability: k-HOP-PURIFY proves effective not only as a standalone defense but also as a valuable post-processing step to enhance the performance of existing, more complex defenses.

Key Results

The paper demonstrates significant improvements in adversarial accuracy across various scenarios:

  • Standalone Defense: Table 1 shows that using k-HOP-PURIFY as a standalone defense method consistently boosts accuracy under global evasion attacks (PRBCD, DICE, METTACK) across CORA, PUBMED, and OGBN-ARXIV datasets, often by substantial margins (e.g., improving accuracy from ~15% to ~43% on OGBN-ARXIV under PRBCD (0.3) attack).
  • Post-processing: Table 2 and Table 3 illustrate that k-HOP-PURIFY can improve the adversarial accuracy of already defended models by 4-5% on average for global evasion and poisoning attacks.
  • Local Attacks: Table 4 shows that the method also benefits local (targeted) attacks, improving the correct classification rate for target nodes.
  • Performance vs. k: Figure 1 indicates that performance typically peaks at an intermediate value of k, suggesting that while local information is beneficial, too much context can reintroduce vulnerabilities. For unattacked graphs, performance generally increases with k, highlighting that k-HOP-PURIFY's benefit is particularly pronounced in adversarial settings.

Limitations and Future Work

  • Computational Cost: While the method is lightweight, constructing the k-hop subgraph does introduce some computational overhead compared to processing the entire graph directly. However, the authors note this can be parallelized.
  • Optimal k: The optimal value of k is dataset and attack-dependent and needs to be determined via hyperparameter tuning.
  • Future Research: The authors suggest future work could involve a theoretical analysis of k-HOP-PURIFY to better understand its robustness guarantees. They also propose investigating the overlap between edges removed by the method and adversarial edges introduced by attackers, and exploring more sophisticated attacks that can circumvent local neighborhood information.

Summary updated

BibTeX
@inproceedings{vora2023gnn,
  author = {Jian Vora},
  title = {{GNN Predictions on k-hop Egonets Boosts Adversarial Robustness}},
  booktitle = {GLFrontiers @ NeurIPS},
  year = {2023},
  url = {https://openreview.net/forum?id=421Y6z81UZ},
}
Figure