• Stars
    star
    278
  • Rank 147,557 (Top 3 %)
  • Language
    Python
  • Created over 4 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Implementation of the KDD 2020 paper "Graph Structure Learning for Robust Graph Neural Networks"

Pro-GNN

A PyTorch implementation of "Graph Structure Learning for Robust Graph Neural Networks" (KDD 2020). [paper] [slides]

The code is based on our Pytorch adversarial repository, DeepRobust (https://github.com/DSE-MSU/DeepRobust)

Note

Although in the original paper we did not provide the results on large-scale graphs, we encourage researchers to test your model on attacked large graphs. DeepRobust has provided APIs to perform scalable attacks and you can find an example in test_prbcd.py.

Another example is in our ICLR'23 code where we tested our model robustness on the large attacked ogb-arxiv graph.

Please feel free to open an issue if you have any questions :)

Abstract

Graph Neural Networks (GNNs) are powerful tools in representation learning for graphs. However, recent studies show that GNNs are vulnerable to carefully-crafted perturbations, called adversarial attacks. Adversarial attacks can easily fool GNNs in making predictions for downstream tasks. The vulnerability to adversarial attacks has raised increasing concerns for applying GNNs in safety-critical applications. Therefore, developing robust algorithms to defend adversarial attacks is of great significance. A natural idea to defend adversarial attacks is to clean the perturbed graph. It is evident that real-world graphs share some intrinsic properties. For example, many real-world graphs are low-rank and sparse, and the features of two adjacent nodes tend to be similar. In fact, we find that adversarial attacks are likely to violate these graph properties. Therefore, in this paper, we explore these properties to defend adversarial attacks on graphs. In particular, we propose a general framework Pro-GNN, which can jointly learn a structural graph and a robust graph neural network model from the perturbed graph guided by these properties. Extensive experiments on real-world graphs demonstrate that the proposed framework achieves significantly better performance compared with the state-of-the-art defense methods, even when the graph is heavily perturbed.

Requirements

See that in https://github.com/DSE-MSU/DeepRobust/blob/master/requirements.txt

matplotlib==3.1.1
numpy==1.17.1
torch==1.2.0
scipy==1.3.1
torchvision==0.4.0
texttable==1.6.2
networkx==2.4
numba==0.48.0
Pillow==7.0.0
scikit_learn==0.22.1
skimage==0.0
tensorboardX==2.0

Installation

To run the code, first you need to install DeepRobust:

pip install deeprobust

Or you can clone it and install from source code:

git clone https://github.com/DSE-MSU/DeepRobust.git
cd DeepRobust
python setup.py install

Run the code

After installation, you can clone this repository

git clone https://github.com/ChandlerBang/Pro-GNN.git
cd Pro-GNN
python train.py --dataset polblogs --attack meta --ptb_rate 0.15 --epoch 1000

Reproduce the results

All the hyper-parameters settings are included in scripts folder. Note that same hyper-parameters are used under different perturbation for the same dataset.

To reproduce the performance reported in the paper, you can run the bash files in folder scripts.

sh scripts/meta/cora_meta.sh

To test performance under different severity of attack, you can change the ptb_rate in those bash files.

Generate attack by yourself

With the help of DeepRobust, you can run the following code to generate meta attack

python generate_attack.py --dataset cora --ptb_rate 0.05 --seed 15

Cite

For more information, you can take a look at the paper or the detailed code shown in DeepRobust.

If you find this repo to be useful, please cite our paper. Thank you.

@inproceedings{jin2020graph,
  title={Graph Structure Learning for Robust Graph Neural Networks},
  author={Jin, Wei and Ma, Yao and Liu, Xiaorui and Tang, Xianfeng and Wang, Suhang and Tang, Jiliang},
  booktitle={26th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, KDD 2020},
  pages={66--74},
  year={2020},
  organization={Association for Computing Machinery}
}

More Repositories

1

awesome-self-supervised-gnn

Papers about pretraining and self-supervised learning on Graph Neural Networks (GNN).
Python
1,542
star
2

awesome-graph-attack-papers

Adversarial attacks and defenses on Graph Neural Networks.
360
star
3

GCond

[ICLR'22] [KDD'22] [IJCAI'24] Implementation of "Graph Condensation for Graph Neural Networks"
Python
115
star
4

SelfTask-GNN

Implementation of paper "Self-supervised Learning on Graphs:Deep Insights and New Directions"
Python
94
star
5

Movie-QA-System

ๅŸบไบŽ็Ÿฅ่ฏ†ๅ›พ่ฐฑ็š„็”ตๅฝฑ้—ฎ็ญ”็ณป็ปŸใ€‚ This is a simple question answering and recommender system on movies (based on Knowledge Graph).
Python
67
star
6

awesome-graph-reduction

Papers about graph reduction including graph coarsening, graph condensation, graph sparsification, graph summarization, etc.
61
star
7

SimP-GCN

Implementation of the WSDM 2021 paper "Node Similarity Preserving Graph Convolutional Networks"
Python
57
star
8

GTrans

[ICLR'23] Implementation of "Empowering Graph Representation Learning with Test-Time Graph Transformation"
Python
53
star
9

DeCorr

[KDD 2022] Implementation of "Feature Overcorrelation in Deep Graph Neural Networks: A New Perspective"
Python
42
star
10

AutoSSL

[ICLR 2022] Implementation of paper "Automated Self-Supervised Learning for Graphs"
Python
40
star
11

pytorch-gnn-meta-attack

Pytorch implementation of gnn meta attack (mettack). Paper title: Adversarial Attacks on Graph Neural Networks via Meta Learning.
Python
17
star
12

ChandlerBang.github.io

Personal website
CSS
1
star
13

Simple-SearchEngine

A simple search engine used for fulltext retrieval, implemented by Python.
Python
1
star