GraphWar: Arms Race in Graph Adversarial Learning

NOTE: GraphWar is still in the early stages and the API will likely continue to change.


?
Installation

Please make sure you have installed PyTorch and Deep Graph Library(DGL).

# Comming soon
pip install -U graphwar

or

# Recommended
git clone https://github.com/EdisonLeeeee/GraphWar.git && cd GraphWar
pip install -e . --verbose

where -e means “editable” mode so you don’t have to reinstall every time you make changes.

Get Started

Assume that you have a dgl.DGLgraph instance g that describes you dataset.

A simple targeted attack

from graphwar.attack.targeted import RandomAttack
attacker = RandomAttack(g)
attacker.attack(1, num_budgets=3) # attacking target node `1` with `3` edges 
attacked_g = attacker.g()
edge_flips = attacker.edge_flips()

A simple untargeted attack

from graphwar.attack.untargeted import RandomAttack
attacker = RandomAttack(g)
attacker.attack(num_budgets=0.05) # attacking the graph with 5% edges perturbations
attacked_g = attacker.g()
edge_flips = attacker.edge_flips()

Implementations

In detail, the following methods are currently implemented:

Attack

Targeted Attack

Methods Venue
RandomAttack A simple random method that chooses edges to flip randomly.
DICEAttack Marcin Waniek et al.

?
Hiding Individuals and Communities in a Social Network
, Nature Human Behavior’16

Nettack Daniel Zügner et al.

?
Adversarial Attacks on Neural Networks for Graph Data
, KDD’18

FGAttack Jinyin Chen et al.

?
Fast Gradient Attack on Network Embedding
, arXiv’18
Jinyin Chen et al.

?
Link Prediction Adversarial Attack Via Iterative Gradient Attack
, IEEE Trans’20
Hanjun Dai et al.

?
Adversarial Attack on Graph Structured Data
, ICML’18

GFAttack Heng Chang et al.

?
A Restricted Black – box Adversarial Framework Towards Attacking Graph Embedding Models
, AAAI’20

IGAttack Huijun Wu et al.

?
Adversarial Examples on Graph Data: Deep Insights into Attack and Defense
, IJCAI’19

SGAttack Jintang Li et al.

?
Adversarial Attack on Large Scale Graph
, TKDE’21

Untargeted Attack

Methods Venue
RandomAttack A simple random method that chooses edges to flip randomly
DICEAttack Marcin Waniek et al.

?
Hiding Individuals and Communities in a Social Network
, Nature Human Behavior’16

FGAttack Jinyin Chen et al.

?
Fast Gradient Attack on Network Embedding
, arXiv’18
Jinyin Chen et al.

?
Link Prediction Adversarial Attack Via Iterative Gradient Attack
, IEEE Trans’20
Hanjun Dai et al.

?
Adversarial Attack on Graph Structured Data
, ICML’18

Metattack Daniel Zügner et al.

?
Adversarial Attacks on Graph Neural Networks via Meta Learning
, ICLR’19

PGD, MinmaxAttack Kaidi Xu et al.

?
Topology Attack and Defense for Graph Neural Networks: An Optimization Perspective
, IJCAI’19

Defense

Model-Level

Methods Venue
MedianGCN Liang Chen et al.

?
Understanding Structural Vulnerability in Graph Convolutional Networks
, IJCAI’21

RobustGCN Dingyuan Zhu et al.

?
Robust Graph Convolutional Networks Against Adversarial Attacks
, KDD’19

Data-Level

Methods Venue
JaccardPurification Huijun Wu et al. , IJCAI’19

More details of literatures and the official codes can be found in Awesome Graph Adversarial Learning.

GitHub

View Github