Abstract
Certifying the robustness of a graph-based machine learning model poses a critical challenge for safety. Current robustness certificates for graph classifiers guarantee output invariance with respect to the total number of node pair flips (edge addition or edge deletion), which amounts to an $l_{0}$ ball centred on the adjacency matrix. Although theoretically attractive, this type of isotropic structural noise can be too restrictive in practical scenarios where some node pairs are more critical than others in determining the classifier's output. The certificate, in this case, gives a pessimistic depiction of the robustness of the graph model. To tackle this issue, we develop a randomised smoothing method based on adding an anisotropic noise distribution to the input graph structure. We show that our process generates structural-aware certificates for our classifiers, whereby the magnitude of robustness certificates can vary across different pre-defined structures of the graph. We demonstrate the benefits of these certificates in both synthetic and real-world experiments.
Introduction
As graph-based machine learning models, such as Graph Neural Networks (GNNs), are increasingly deployed in critical domains like drug discovery and combinatorial optimization, understanding their vulnerability to adversarial structural perturbations is paramount. Attackers can often manipulate these models by adding or deleting edges.
To guarantee a model's robustness, researchers typically use randomized smoothing, which creates a "smoothed" classifier by injecting noise into the input and taking a majority vote. For graphs, this has traditionally meant applying "isotropic" noise: flipping every possible edge with the exact same probability. However, in real-world graphs, some edges are critical for the classification label (e.g., functional chemical rings), while others are merely background noise. Isotropic certificates treat all edges equally, leading to tiny, pessimistic certified radii because they must guard against the worst-case scenario: the attacker flipping the most critical edges.
Methods: Anisotropic Randomized Smoothing
To address the limitations of isotropic noise, this work proposes an anisotropic randomized smoothing framework. This method allows for varying noise levels across different regions of the graph based on their structural importance.
- Graph Partitioning: The set of all possible node pairs (edges and non-edges) is divided into disjoint regions based on structural importance or domain-specific knowledge.
- Anisotropic Noise Injection: Independent Bernoulli noise is applied to the graph, but the probability of flipping an edge ($p_i$) is specific to the region it belongs to. Critical regions receive low noise to preserve accuracy, while unimportant regions receive high noise to maximize certified robustness.
- Regional Certificates: The framework derives closed-form expressions for likelihood ratios and region probabilities. By solving a linear programming problem (building on the Neyman-Pearson framework), it identifies the worst-case adversarial perturbation.
Key Insights
"Oblong" Certificates
By using anisotropic noise, the certified regions become "oblong" (ellipsoidal or rectangular in the discrete sense) rather than spherical. This allows the model to certify a massive number of perturbations in unimportant regions while keeping noise low in critical regions to preserve the base model's accuracy.
Decoupling Accuracy and Robustness
In standard randomized smoothing, increasing noise increases robustness but destroys accuracy. Anisotropic noise breaks this strict trade-off by allowing high noise only where the model's decision boundary is relatively flat (i.e., unimportant edges), thus maintaining high accuracy while providing strong guarantees for non-critical regions.
Experimental Evaluation
Synthetic Experiment
The authors introduced a binary classification dataset where each graph consists of a "motif" (a cycle or clique determining the label) connected to a "random" Erdos-Rényi graph. The anisotropic certificate (using $p=0.02$ for the motif and $p=0.45$ for the random part) achieved 100% certified accuracy against up to 45 edge flips in the random part. In contrast, the best isotropic certificate could only guarantee robustness against 1 edge flip anywhere in the graph before accuracy degraded significantly.
Real-World Experiment (MUTAG)
On the MUTAG molecular graph dataset, the base model achieved 84% test accuracy. The anisotropic certificate successfully certified a higher ratio of test samples across various edge additions and deletions compared to existing "sparsity-aware" baselines, demonstrating its flexibility on real-world structures.
Conclusion and Future Work
While the current method requires a priori knowledge to define edge regions (e.g., chemical domain expertise), it provides a powerful framework for more realistic robustness guarantees. Future work aims to learn the importance of node pairs in a data-driven way—using attention weights or causal relations—to automatically define these regions. The mathematical framework is highly generalizable and could be extended to directed graphs, node classification, and other discrete domains like binary image classification.
Summary updated