NeurIPS 2026Coming to NeurIPS in Sydney?Explore papers, orals & directions

On countering adversarial perturbations in graphs using error correcting codes

Saif Eddin JabariarXiv 2024 · DOI

Adversarial attacks on Graph Neural Networks (GNNs) pose a significant threat to their deployment in critical domains. By subtly adding or removing edges—a process known as "graph poisoning"—attackers can induce high-confidence misclassifications. While traditional defenses focus on robustifying the GNN models themselves, a novel approach treats the graph structure as a message requiring error correction. This paper proposes a model-agnostic, pre-processing defense using repetition coding and majority voting to protect graph integrity.

Methodology: Graph Structure as a Message

The proposed defense mechanism leverages classic information theory principles to "clean" a graph before it reaches a GNN. The process involves three main stages:

  1. Encoding (Sender): The sender flattens the graph's adjacency matrix into a vector $s$. To protect against attackers who might identify identical copies, the sender generates $K$ versions of this vector, each perturbed with a small amount of "sender-assigned noise" (random bit flips).
  2. Transmission and Attack: These $K$ copies are transmitted. An attacker may intercept and further perturb them by adding or removing edges.
  3. Decoding (Receiver): The receiver collects the $K$ perturbed copies and performs a majority vote for every potential edge. An edge is included in the final reconstructed graph only if it appears in more than half of the received copies.
Overview of the proposed graph defense mechanism using repetition coding and majority voting.

The mathematical foundation of this approach relies on McDiarmid’s inequality to derive a theoretical bound for $K$, ensuring the reconstructed graph remains within a robustness threshold $\rho$ with high statistical confidence.

Key Insights: The Large Graph Paradox

A pivotal finding of this research is that larger graphs are inherently easier to protect using this method. As the number of nodes $N$ increases, the number of repetitions $K$ required to achieve a specific error tolerance actually decreases. This "Large Graph Paradox" occurs because the law of large numbers more effectively stabilizes the majority vote when errors are averaged over a larger set of elements.

Theoretical bound on the number of repetitions $K$ as a function of graph size $N$ and error probability $\eta$.

Furthermore, the study highlights that graph topology significantly impacts defense efficacy. Random Erdős-Rényi (ER) graphs are more resilient to this method than scale-free Barabási-Albert (BA) graphs. In BA graphs, the high importance of "hub" nodes means that even a few edge flips can cause significant structural damage that simple majority voting may struggle to rectify without a high $K$.

Experimental Results

The effectiveness of the repetition code approach was validated using synthetic graph models under both random and targeted centrality-based attacks:

  • Scalability: For large ER graphs ($N=1000$), near-perfect reconstruction (error $\approx 0.003$) was achieved with as few as $K=4$ repetitions.
  • Small Graph Volatility: Smaller networks ($N=50$) proved more difficult to defend, often requiring $K > 14$ to stabilize.
  • Robustness Targets: The method consistently maintained reconstruction errors below the 5% threshold ($\rho = 0.05$), a level typically manageable for robust GNNs.
  • Conservative Bounds: The derived theoretical bounds for $K$ serve as a safe, albeit conservative, upper limit for defenders in practical scenarios.

Conclusion and Future Directions

Treating graph structures as error-prone messages provides a powerful, model-agnostic defense against adversarial poisoning. While effective, the current majority voting scheme is "topology-blind," treating all edges with equal weight. Future research could enhance this by incorporating network centrality measures into the voting process, potentially improving performance on scale-free networks. Additionally, optimizing the computational complexity for massive real-world datasets remains an open challenge.

Summary updated

Abstract

We consider the problem of a graph subjected to adversarial perturbations, such as those arising from cyber-attacks, where edges are covertly added or removed. The adversarial perturbations occur during the transmission of the graph between a sender and a receiver. To counteract potential perturbations, this study explores a repetition coding scheme with sender-assigned noise and majority voting on the receiver's end to rectify the graph's structure. The approach operates without prior knowledge of the attack's characteristics. We analytically derive a bound on the number of repetitions needed to satisfy probabilistic constraints on the quality of the reconstructed graph. The method can accurately and effectively decode Erdős-Rényi graphs that were subjected to non-random edge removal, namely, those connected to vertices with the highest eigenvector centrality, in addition to random addition and removal of edges by the attacker. The method is also effective against attacks on large scale-free graphs generated using the Barabási-Albert model but require a larger number of repetitions than needed to correct Erdős-Rényi graphs.
BibTeX
@misc{jabari2024countering,
  author = {Saif Eddin Jabari},
  title = {{On countering adversarial perturbations in graphs using error correcting codes}},
  year = {2024},
  eprint = {2406.14245},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2406.14245},
}
Figure