Skip to content

xinleihe/link_stealing_attack

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 

Repository files navigation

Stealing links from Graph Neural Networks

This is a TensorFlow implementation of Stealing links from Graph Neural Networks, as described in our paper:

Xinlei He, Jinyuan Jia, Michael Backes, Neil Zhenqiang Gong, Yang Zhang, Stealing Links from Graph Neural Networks (Usenix Security 2021)

Step -1: Requirement

We follows the instruction on https://github.com/tkipf/gcn to install gcn.

Step 0: Datasets

We provide the datasets used in our paper:

["AIDS", "COX2", "DHFR", "ENZYMES", "PROTEINS_full", "citeseer", "cora", "pubmed"]

Step 1: Train Target Model

Train GCN and MLP for all datasets.

Train GCN:

python3 train.py --dataset cora --model gcn

Train MLP:

python3 train.py --dataset cora --model dense

Step 2: Generate Partial Graph

Split train / test for all datasets.

python3 partial_graph_generation.py --dataset cora

Step 3: Run Attacks

Note that all attacks rely on the partial graphs generated by Step 2.

Attack 0

python3 attack_0.py --dataset cora

Attack 1

Shadow dataset: dataset1; target dataset: dataset2

python3 attack_1.py --dataset1 citeseer --dataset2 cora

Attack 2

python3 attack_2.py --dataset cora

Attack 3

python3 attack_3.py --dataset cora

Attack 4

python3 attack_4.py --dataset1 citeseer --dataset2 cora

Attack 5

python3 attack_5.py --dataset1 citeseer --dataset2 cora

Attack 6

python3 attack_6.py --dataset cora

Attack 7

python3 attack_7.py --dataset1 citeseer --dataset2 cora

Note

Note that in the code we use standard scaler to fit the training data and testing data separately as we assume that the adversary may acquire the whole testing data at the beginning.

ss = StandardScaler()
x_train = ss.fit_transform(x_train)
x_test = ss.fit_transform(x_test)

but please feel free to modify it into:

ss = StandardScaler()
x_train = ss.fit_transform(x_train)
x_test = ss.transform(x_test)

Cite

Please cite our paper if you use this code in your own work:

@inproceedings{HJBGZ21,
author = {Xinlei He and Jinyuan Jia and Michael Backes and Neil Zhenqiang Gong and Yang Zhang},
title = {{Stealing Links from Graph Neural Networks}},
booktitle = {{USENIX Security Symposium (USENIX Security)}},
publisher = {USENIX},
year = {2021}
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages