Official implementation of Simlified Gradient Attack (SGA) in TKDE 2021: Adversarial attack on large scale graph.
- The PyTorch implementation can be found at DeepRobust or GraphWar.
- 2021/3/20: add tensorflow 2.x support
- TensorFlow 1.15 (it should work in
1.14
,1.13
... and2.x
) - Numpy
- Scipy
- tqdm
we consider the largest connected component (LCC) of the graph for each dataset, e.g., data/cora_lcc
.
Cora, Citeseer and Pubmed could be found at https://github.com/danielzuegner/gnn-meta-attack,
reddit could be found at http://snap.stanford.edu/graphsage/
- cora
- citeseer
- pubmed
How to attack a graph neural networks?
- Train the surrogate model SGC
- Generate perturbation (edge flips)
- Attack target models with adversarial examples (SGC, GCN ...)
See src/demo.ipynb
for a simple example to run our codes.
- Run
src/generate_edges.ipynb
to generate adversarial edges and save them, the adversarial edges can be generated bySGA
,GradArgmax
,Nettack
. - Run
src/attack.ipynb
to test the attack performance onSGC
andGCN
.
If you make use of this code or the SGA algorithm in your work, please cite the following paper:
@article{li2021adversarial,
title={Adversarial attack on large scale graph},
author={Li, Jintang and Xie, Tao and Liang, Chen and Xie, Fenfang and He, Xiangnan and Zheng, Zibin},
journal={IEEE Transactions on Knowledge and Data Engineering},
year={2021},
publisher={IEEE}
}