|
1 | 1 | .. _robust: |
2 | 2 |
|
3 | | -Robust Model |
4 | | -============ |
5 | | - |
6 | | -We provides a series of defense methods that aim to enhance the robustness of GNNs. |
| 3 | +Graph Robustness |
| 4 | +========================== |
7 | 5 |
|
8 | | -Requirements |
9 | | ------------- |
| 6 | +Graph robustness is an important research direction in the field of graph representation learning in recent years, |
| 7 | +and we have integrated graph robustness-related algorithms in AutoGL, which can be easily used in conjunction with other modules. |
10 | 8 |
|
11 | | -During the evaluation, the adversarial attacks on graph are performed by DeepRobust from MSU, please install it by |
| 9 | +Preliminaries |
| 10 | +----------- |
| 11 | +In AutoGL, we divide the algorithms for graph robustness into three categories, which are placed in different modules for implementation. |
| 12 | +Robust graph feature engineering aims to generate robust graph features in the data pre-processing phase to enhance the robustness of downstream tasks. |
| 13 | +Robust graph neural networks, on the other hand, are designed at the model level to ensure the robustness of the model during the training process. |
| 14 | +Robust graph neural network architecture search aims to search for a robust graph neural network architecture. |
| 15 | +Each of these three types of graph robustness algorithms will be described in the following sections. |
12 | 16 |
|
13 | | -.. code-block:: bash |
| 17 | +Robust Graph Feature Engineering |
| 18 | +----------- |
14 | 19 |
|
15 | | - git clone https://github.com/DSE-MSU/DeepRobust.git |
16 | | - cd DeepRobust |
17 | | - python setup.py install |
| 20 | +We provide structure engineering methods to enhance robustness, please refer to `preprocessing` part for more information. |
18 | 21 |
|
19 | | -To better plugin GNNGuard to AutoGL, we slightly revised some functions in geometric. Please use the file ``AutoGL/autogl/module/model/pyg/robust/nn/conv/gcn_conv.py`` we provided to replace the corresponding file in the installed geometric folder (for example, the folder path could be `/home/username/.local/lib/python3.5/site-packages/torch_geometric/nn/conv/`). |
| 22 | +Robust Model |
| 23 | +----------- |
20 | 24 |
|
21 | | -*Note:* Don't forget to backup all the original files when you replacing anything, in case you need them at other places! |
| 25 | +We provides a series of defense methods that aim to enhance the robustness of GNNs. |
22 | 26 |
|
23 | 27 | Building GNNGuard Module |
24 | | ------------------------- |
| 28 | +>>>>>>>>>>>>>>>>>>> |
25 | 29 |
|
26 | 30 | Firstly, load pre-attacked graph data: |
27 | 31 |
|
@@ -78,3 +82,33 @@ Thirdly, train defense model GNNGuard on poinsed graph: |
78 | 82 | print('=== testing GCN on perturbed graph (AutoGL) + GNNGuard ===') |
79 | 83 | print("acc_test:",test_autogl(modified_adj, features, device, attention=flag)) |
80 | 84 |
|
| 85 | +
|
| 86 | +Robust Graph Neural Architecture Search |
| 87 | +--------------------------------------- |
| 88 | +Robust Graph Neural Architecture Search aims to search for adversarial robust Graph Neural Networks under attacks. |
| 89 | +In AutoGL, this module is the code realization of G-RNA. |
| 90 | + |
| 91 | +Specifically, we design a robust search space for the message-passing mechanism by adding the adjacency mask operations into the search space, |
| 92 | +which is inspired by various defensive operators and allows us to search for defensive GNNs. |
| 93 | +Furthermore, we define a robustness metric to guide the search procedure, which helps to filter robust architectures. |
| 94 | +G-RNA allows us to effectively search for optimal robust GNNs and understand GNN robustness from an architectural perspective. |
| 95 | + |
| 96 | + |
| 97 | +Adjacency Mask Operations |
| 98 | +>>>>>>>>>>>>>>>>>>>>>>>>> |
| 99 | +Inspired from the success of current defensive approaches, we conclude the properties of operations on graph structure for robustness and |
| 100 | +design representative defensive operators in our search space accordingly. |
| 101 | +In this way, we can choose the most appropriate defensive strategies when confronting perturbed graphs. |
| 102 | +To our best knowledge, this is the first time for the search space to be designed with a specific purpose to enhance the robustness of GNNs. |
| 103 | +Specifically, we include five mask operations in the search space. |
| 104 | + |
| 105 | +- Identity keeps the same adjacency matrix as previous layer |
| 106 | +- Low Rank Approximation (LRA) reconstructs the adjacency matrix from the top-k components of singular value decomposition. |
| 107 | +- Node Feature Similarity (NFS) deletes edges that have small jaccard similarities among node features. |
| 108 | +- Neighbor Importance Estimation (NIE) updates mask values with a pruning strategy base on quantifying the relevance among nodes. |
| 109 | +- Variable Power Operator (VPO) forms a variable power graph from the original adjacency matrix weighted by the parameters of influence strengths |
| 110 | + |
| 111 | +Measuring Robustnes |
| 112 | +>>>>>>>>>>>>>>>>>>> |
| 113 | +Intuitively, the performance of a robust GNN should not deteriorate too much when confronting various perturbed |
| 114 | +graph data. |
0 commit comments