8000 improve robust tuto · THUMNLab/AutoGL@0637c55 · GitHub
[go: up one dir, main page]

Skip to content

Commit 0637c55

Browse files
committed
improve robust tuto
1 parent 68dd023 commit 0637c55

File tree

2 files changed

+73
-18
lines changed

2 files changed

+73
-18
lines changed

docs/docfile/tutorial/t_robust.rst

Lines changed: 48 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,31 @@
11
.. _robust:
22

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+
==========================
75

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.
108

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.
1216

13-
.. code-block:: bash
17+
Robust Graph Feature Engineering
18+
-----------
1419

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.
1821

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+
-----------
2024

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.
2226

2327
Building GNNGuard Module
24-
------------------------
28+
>>>>>>>>>>>>>>>>>>>
2529

2630
Firstly, load pre-attacked graph data:
2731

@@ -78,3 +82,33 @@ Thirdly, train defense model GNNGuard on poinsed graph:
7882
print('=== testing GCN on perturbed graph (AutoGL) + GNNGuard ===')
7983
print("acc_test:",test_autogl(modified_adj, features, device, attention=flag))
8084
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.

docs/docfile/tutorial_cn/t_robust.rst

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,33 @@
1-
.. _robust:
1+
.. _robust_cn:
22

3-
鲁棒模型
4-
==========================
3+
图鲁棒性
4+
============================
5+
6+
图鲁棒性是近年图机器学习领域重要的研究方向,我们在AutoGL中集成了图鲁棒性相关算法,可以方便地与其他模块结合使用。
7+
8+
背景知识
9+
------------
10+
11+
(介绍对抗攻击、鲁棒问题的定义等,可以适当引一些paper)
12+
13+
在AutoGL中,我们将图鲁棒性的算法分为三类,放在不同的模块中实现。
14+
鲁棒图特征工程旨在数据预处理阶段生成鲁棒的图特征,增强下游任务的鲁棒性。
15+
鲁棒图神经网络则是通过模型层面的设计,以在训练过程中确保模型的鲁棒性。
16+
鲁棒图神经网络架构搜索旨在搜索出一个鲁棒的图神经网络架构。
17+
下文中将分别介绍这三类图鲁棒性算法。
18+
19+
鲁棒图特征工程
20+
---------------------
21+
22+
我们提供了图结构特征工程的系列方法来提高鲁棒性,请参考`预处理`部分获取更多信息。
23+
24+
鲁棒图神经网络
25+
---------------------
526

627
我们提供了一系列的防御方法,旨在增强图神经网络的鲁棒性。
728

829
生成并训练 GNNGuard 模型
9-
------------------------------
30+
>>>>>>>>>>>>>>>>>>>
1031

1132
首先,加载预先攻击的图数据:
1233

0 commit comments

Comments
 (0)
0