When Witnesses Defend: A Witness Graph Topological Layer for Adversarial Graph Learning

Naheed Anjum Arafat, Debabrota Basu, Yulia R. Gel, Yuzhou Chen · OpenReview

Abstract

Capitalizing on the intuitive premise that shape characteristics are more robust to perturbations, we bridge adversarial graph learning with the emerging tools from computational topology, namely, persistent homology representations of graphs. We introduce the concept of witness complex to adversarial analysis on graphs, which allows us to focus only on the salient shape characteristics of graphs, yielded by the subset of the most essential nodes (i.e., landmarks), with minimal loss of topological information on the whole graph. The remaining nodes are then used as witnesses, governing which higher-order graph substructures are incorporated into the learning process. Armed with the witness mechanism, we design Witness Graph Topological Layer (WGTL), which systematically integrates both local and global topological graph feature representations, the impact of which is, in turn, automatically controlled by the robust regularized topological loss. Given the attacker's budget, we derive the important stability guarantees of both local and global topology encodings and the associated robust topological loss. We illustrate the versatility and efficiency of WGTL by its integration with five GNNs and three existing non-topological defense mechanisms. Our extensive experiments across six datasets demonstrate that WGTL boosts the robustness of GNNs across a range of perturbations and against a range of adversarial attacks, leading to relative gains of up to 18%.

Introduction

Adversarial attacks on Graph Neural Networks (GNNs) present a significant challenge for real-world applications. Because GNNs rely heavily on local, pairwise node relationships, even minor, unnoticeable changes to a graph's edges can completely derail their performance. Most current defenses focus on "purifying" the graph by removing suspicious edges or employing adversarial training. However, these methods often ignore higher-order structures (like triangles or complex cycles) and can inadvertently remove "clean" edges, degrading performance.

This research introduces a novel defense strategy that looks beyond individual edges to the "shape" of the graph itself. The fundamental insight is that topological features—such as the existence of major cycles or clusters—are inherently more resistant to adversarial noise than simple edge connections. Changing the fundamental "shape" of a graph requires a much larger and more noticeable budget than flipping a few edges.

The Witness Graph Topological Layer (WGTL)

The authors propose the Witness Graph Topological Layer (WGTL), a plug-and-play defense that uses persistent homology (PH) to capture robust, higher-order structural features. While PH is traditionally computationally expensive and sensitive to noise, WGTL leverages "witness complexes" to make topological defense practical for large-scale datasets.

The WGTL architecture integrates local (I) and global (III) topological encodings with standard GNN layers (II).

Key Components

  1. Witness Complexes: Instead of using every node to calculate topology, WGTL selects a small subset of "landmark" nodes. The remaining nodes act as "witnesses" that help define the higher-order structures (simplices) between landmarks. This drastically reduces computation and filters out topological noise.
  2. Local & Global Encodings: WGTL computes features at two scales. Local encodings use Vision Transformers to process persistence images of neighborhoods around landmarks. Global encodings use a CNN to capture the overall "shape" of the entire graph based on geodesic distances.
  3. Attention-Driven Aggregation: An attention mechanism adaptively weights these local and global topological priors alongside standard GNN node embeddings.
  4. Robust Topological Loss ($L_{topo}$): This novel loss function acts as a regularizer, specifically penalizing topological features with low "persistence" (likely noise) and encouraging the model to focus on stable, significant structural features.

Experimental Evaluation

The authors evaluated WGTL on six diverse benchmark datasets, including citation networks (Cora-ML, Citeseer, Pubmed), social networks (Polblogs), large-scale networks (OGBN-arXiv), and heterophilic networks (Snap-patents). The model was tested against powerful adversarial attacks, including Nettack (local) and Mettack (global).

Key Results

WGTL demonstrated significant improvements across various backbones (GCN, GAT, GraphSAGE, ChebNet) and integrated seamlessly with existing defense mechanisms.

Comparison of WGTL against existing defenses under Mettack global poisoning.
  • Performance Boost: When added to state-of-the-art defenses like Pro-GNN or GNNGuard, WGTL consistently improved performance. For example, on Cora-ML under a 10% global attack, adding WGTL to GNNGuard improved accuracy from 69.13% to 79.96%.
  • Efficiency: Using witness complexes made WGTL significantly faster than traditional PH methods. On Cora-ML, computing witness features took ~8.5 seconds, compared to over 23,000 seconds for standard Vietoris-Rips features—a 2500x speedup.
  • Stability Guarantees: The paper provides rigorous theoretical proofs showing that both the topological encodings and the proposed loss function remain stable under bounded adversarial perturbations.

Conclusion and Future Work

WGTL represents a significant step forward in robust graph learning by making topological analysis both scalable and effective for defense. While the current framework focuses on static graphs and non-adaptive attackers, future research directions include extending these topological defenses to dynamic, time-evolving graphs and higher-order relational structures like hypergraphs.

Summary updated

BibTeX
@inproceedings{arafat2025when,
  author = {Naheed Anjum Arafat and Debabrota Basu and Yulia R. Gel and Yuzhou Chen},
  title = {{When Witnesses Defend: A Witness Graph Topological Layer for Adversarial Graph Learning}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2025},
  doi = {10.1609/aaai.v39i15.33691},
}
Figure