adversarial attacks on neural networks for graph data...outline 1 introduction 2 graph convolutional...

25
Adversarial Attacks on Neural Networks for Graph Data Author: Daniel Zugner Technical University of Munich Presenter: Faizan Ahmad https://qdata.github.io/deep2Read Author: Daniel Zugner Adversarial Attacks on Neural Networks for Graph Data Presenter: Faizan Ahmad https://qdata.gi

Upload: others

Post on 18-Jun-2020

2 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Adversarial Attacks on Neural Networks for Graph Data...Outline 1 Introduction 2 Graph Convolutional Networks Overview 3 Related Work 4 Attack Model 5 Generating Adversarial Graphs

Adversarial Attacks on Neural Networks for Graph Data

Author: Daniel Zugner

Technical University of Munich

Presenter: Faizan Ahmadhttps://qdata.github.io/deep2Read

Author: Daniel Zugner Adversarial Attacks on Neural Networks for Graph DataPresenter: Faizan Ahmad https://qdata.github.io/deep2Read 1 / 23

Page 2: Adversarial Attacks on Neural Networks for Graph Data...Outline 1 Introduction 2 Graph Convolutional Networks Overview 3 Related Work 4 Attack Model 5 Generating Adversarial Graphs

Outline

1 Introduction

2 Graph Convolutional Networks Overview

3 Related Work

4 Attack Model

5 Generating Adversarial Graphs

6 Evaluation and Results

7 Takeaways

8 Discussion

Author: Daniel Zugner Adversarial Attacks on Neural Networks for Graph DataPresenter: Faizan Ahmad https://qdata.github.io/deep2Read 2 / 23

Page 3: Adversarial Attacks on Neural Networks for Graph Data...Outline 1 Introduction 2 Graph Convolutional Networks Overview 3 Related Work 4 Attack Model 5 Generating Adversarial Graphs

Introduction

What are Adversarial Attacks?

Success of Adversarial Attacks

ImagesTextGraphs? Adversaries in graph-based domains.

Adversarial Attacks on Node Classification by changing:

Graph StructureNode Features

Figure: Adversarial Attack Example. Carefully crafted image is added to theinput to make the model misclassify it.

Author: Daniel Zugner Adversarial Attacks on Neural Networks for Graph DataPresenter: Faizan Ahmad https://qdata.github.io/deep2Read 3 / 23

Page 4: Adversarial Attacks on Neural Networks for Graph Data...Outline 1 Introduction 2 Graph Convolutional Networks Overview 3 Related Work 4 Attack Model 5 Generating Adversarial Graphs

Basic Idea

Figure: Small perturbations of the graph structure or node features lead tomisclassification of the target

Attacker Node: Manipulated nodes

Target Node: Nodes that we want to misclassify

Author: Daniel Zugner Adversarial Attacks on Neural Networks for Graph DataPresenter: Faizan Ahmad https://qdata.github.io/deep2Read 4 / 23

Page 5: Adversarial Attacks on Neural Networks for Graph Data...Outline 1 Introduction 2 Graph Convolutional Networks Overview 3 Related Work 4 Attack Model 5 Generating Adversarial Graphs

Why Attacks on Graphs?

Large body of work on adversarial attacks for Images and Text

DeepFool (Moosavi et al. [1])Adversarial Examples in Physical World (Kurakin et al. [2])Hotflip (Ebrahimi et al. [3])Plenty more..

No work on adversarial attacks for graphs

Many new challenges

Discrete DomainTransductive Learning SettingNetwork Effects

Author: Daniel Zugner Adversarial Attacks on Neural Networks for Graph DataPresenter: Faizan Ahmad https://qdata.github.io/deep2Read 5 / 23

Page 6: Adversarial Attacks on Neural Networks for Graph Data...Outline 1 Introduction 2 Graph Convolutional Networks Overview 3 Related Work 4 Attack Model 5 Generating Adversarial Graphs

Task SetupNode Classification

Semi-supervised Node Classification via Binary Node Features

Attributed Graph G = (A,X )

Adjacency Matrix representing edges A ∈ {1, 0}NxNFeature Matrix representing D dimensional node featuresX ∈ {0, 1}NxDNode-ids V = {1, 2, ...,N}Feature-ids F = {1, 2, ...,D}

Given: A subset VL ⊆ V of labeled nodes with labels C = {1, ..ck}Task: Learn g : V → C

Author: Daniel Zugner Adversarial Attacks on Neural Networks for Graph DataPresenter: Faizan Ahmad https://qdata.github.io/deep2Read 6 / 23

Page 7: Adversarial Attacks on Neural Networks for Graph Data...Outline 1 Introduction 2 Graph Convolutional Networks Overview 3 Related Work 4 Attack Model 5 Generating Adversarial Graphs

Graph Convolutional Networks Overview (GCN) [4]

Node classification is done via Kipf et al. [4]

Learns node-level output featuresGraph level features can be obtained via aggregating

A hidden layer l + 1 is defined as H(l+1) = f (H(l),A) where H(0) = X

Simple GCN propagation rule is f (H(l),A) = σ(AH(l)W (l))

A is not normalizedNo self-loops

Proposed fixes in [4]:

f (H(l),A) = σ(D−1/2AD1/2H(l)W (l)) (1)

A = A + I (2)

Z = fθ(A,X ) = softmax(Aσ(AXW (1))W (2)) (3)

Author: Daniel Zugner Adversarial Attacks on Neural Networks for Graph DataPresenter: Faizan Ahmad https://qdata.github.io/deep2Read 7 / 23

Page 8: Adversarial Attacks on Neural Networks for Graph Data...Outline 1 Introduction 2 Graph Convolutional Networks Overview 3 Related Work 4 Attack Model 5 Generating Adversarial Graphs

Related Work

Graph Neural Networks

Node Embeddings/Classification [5]Graph Classification [6]

Adversarial Attacks

Evasion Attacks [1]Poisoning Attacks [7]

Adversarial Attacks on Graphs

Using Greedy Approximation (This Work)Via Reinforcement Learning [8]

Author: Daniel Zugner Adversarial Attacks on Neural Networks for Graph DataPresenter: Faizan Ahmad https://qdata.github.io/deep2Read 8 / 23

Page 9: Adversarial Attacks on Neural Networks for Graph Data...Outline 1 Introduction 2 Graph Convolutional Networks Overview 3 Related Work 4 Attack Model 5 Generating Adversarial Graphs

Attack ModelTerminologies

Original Graph G (0) = (A(0),X (0))

Perturbed Graph G ∗ = (A∗,X ∗)

Two type of attacks:

Structure Attacks → Changes to A(0)

Feature Attacks → Changes to X (0)

Two types of nodes:

Target Node v0 → Node we aim to misclassify → Direct AttackAttacker Nodes A → Nodes we aim to manipulate → Influencer Attack

Author: Daniel Zugner Adversarial Attacks on Neural Networks for Graph DataPresenter: Faizan Ahmad https://qdata.github.io/deep2Read 9 / 23

Page 10: Adversarial Attacks on Neural Networks for Graph Data...Outline 1 Introduction 2 Graph Convolutional Networks Overview 3 Related Work 4 Attack Model 5 Generating Adversarial Graphs

Attack ModelProblem Statement

argmax(A∗,X∗)∈P

maxc 6=cold

(lnZv0,c − lnZv0,cold )

subject to Z = fθ∗(A∗,X ∗) with θ∗ = argminθ

L(θ,A∗,X ∗)

Bi-level optimization problem.

P is the set of graphs with changes made under a budget 4

P ∈∑u

∑i

|Xui − X ∗ui |+∑u<v

|Auv − A∗uv | ≤ 4 (4)

Author: Daniel Zugner Adversarial Attacks on Neural Networks for Graph DataPresenter: Faizan Ahmad https://qdata.github.io/deep2Read 10 / 23

Page 11: Adversarial Attacks on Neural Networks for Graph Data...Outline 1 Introduction 2 Graph Convolutional Networks Overview 3 Related Work 4 Attack Model 5 Generating Adversarial Graphs

Attack ModelGraph Structure Preserving Perturbations

Degree distribution

Easy to tell the difference with different degree distributions

Generate perturbations that preserve power-law p(x) ∝ x−α behaviorof degree distribution

Likelihood (Eq. 6) ratio test for degree distribution by approximatelyestimating α

αG ≈ 1 + |DG |.[∑

di∈DG

log(di )− log(dmin − 0.5)]−1 (5)

l(Dx) = |Dx |.log(αx) + |Dx |.αx .logdmin + (αx + 1)∑di∈Dx

logdi (6)

Author: Daniel Zugner Adversarial Attacks on Neural Networks for Graph DataPresenter: Faizan Ahmad https://qdata.github.io/deep2Read 11 / 23

Page 12: Adversarial Attacks on Neural Networks for Graph Data...Outline 1 Introduction 2 Graph Convolutional Networks Overview 3 Related Work 4 Attack Model 5 Generating Adversarial Graphs

Attack ModelFeature Statistics Preserving Perturbations

Main Question: Which features can be set to 1?

Why don’t we care about 0?

Test based on feature co-occurrence

Co-occurrence graph C = (F ,E ).

F is set of features.E ⊆ F x F denote feature co-occurrence

Probabilistic Random Walk on C

Only add feature i if for Su = {j |Xuj 6= 0}

p(i |Su) =1

|Su|∑j∈Su

(1/dj).Eij > σ (7)

Author: Daniel Zugner Adversarial Attacks on Neural Networks for Graph DataPresenter: Faizan Ahmad https://qdata.github.io/deep2Read 12 / 23

Page 13: Adversarial Attacks on Neural Networks for Graph Data...Outline 1 Introduction 2 Graph Convolutional Networks Overview 3 Related Work 4 Attack Model 5 Generating Adversarial Graphs

Generating Adversarial Graphs

Bi-level optimization for discrete case is hard

Introduce a surrogate model with linearization

Z = softmax(A∗XW )

Surrogate loss

Ls(A,X ;W , v0) = maxc 6=co ld

[A2XW ]v0c − [A2XW ]v0cold (8)

Loss maximization to obtain adversarial graph

argmax(A∗,X∗)∈P

Ls(A∗,X ∗;W , v0) (9)

This is still intractable due to discreteness

Author: Daniel Zugner Adversarial Attacks on Neural Networks for Graph DataPresenter: Faizan Ahmad https://qdata.github.io/deep2Read 13 / 23

Page 14: Adversarial Attacks on Neural Networks for Graph Data...Outline 1 Introduction 2 Graph Convolutional Networks Overview 3 Related Work 4 Attack Model 5 Generating Adversarial Graphs

Generating Adversarial GraphsGreedy Approximation

Define scoring functions for greedy approximation of Eq. 9

For A∗ = A± e and X ∗ = X ± f

sstruc(e,G , v0) = Ls(A∗,X ;W , v0) (10)

sfeat(f ,G , v0) = Ls(A,X ∗;W , v0) (11)

Fast computation for the scores

Author: Daniel Zugner Adversarial Attacks on Neural Networks for Graph DataPresenter: Faizan Ahmad https://qdata.github.io/deep2Read 14 / 23

Page 15: Adversarial Attacks on Neural Networks for Graph Data...Outline 1 Introduction 2 Graph Convolutional Networks Overview 3 Related Work 4 Attack Model 5 Generating Adversarial Graphs

Generating Adversarial GraphsGreedy Approximation Pseudo Code

Author: Daniel Zugner Adversarial Attacks on Neural Networks for Graph DataPresenter: Faizan Ahmad https://qdata.github.io/deep2Read 15 / 23

Page 16: Adversarial Attacks on Neural Networks for Graph Data...Outline 1 Introduction 2 Graph Convolutional Networks Overview 3 Related Work 4 Attack Model 5 Generating Adversarial Graphs

Experimental Setup

Three Graph data sets; CORA-ML, CITESEET, POL. BLOGS

20% labeled nodes, 80% unlabeled

For adversarial graph generation

Train on uncorrupted dataPick 40 correctly classified nodes as target nodesPick 5 random neighbors as attacker nodes

Two corruption methods

NETTACK (Direct Attack)NETTACK-IN (Influence Attack)

Comparison Methods

Fast Gradient Sign Method (FGSM)Random Modification

Author: Daniel Zugner Adversarial Attacks on Neural Networks for Graph DataPresenter: Faizan Ahmad https://qdata.github.io/deep2Read 16 / 23

Page 17: Adversarial Attacks on Neural Networks for Graph Data...Outline 1 Introduction 2 Graph Convolutional Networks Overview 3 Related Work 4 Attack Model 5 Generating Adversarial Graphs

ResultsAttacks on Surrogate Model

Figure: Average surrogate loss for increasing number of perturbations.Differentvariants of our method on the Cora data. Larger is better

Author: Daniel Zugner Adversarial Attacks on Neural Networks for Graph DataPresenter: Faizan Ahmad https://qdata.github.io/deep2Read 17 / 23

Page 18: Adversarial Attacks on Neural Networks for Graph Data...Outline 1 Introduction 2 Graph Convolutional Networks Overview 3 Related Work 4 Attack Model 5 Generating Adversarial Graphs

ResultsAttacks on Surrogate Model

Figure: Top-10 feature perturbations per class on Cora

Author: Daniel Zugner Adversarial Attacks on Neural Networks for Graph DataPresenter: Faizan Ahmad https://qdata.github.io/deep2Read 18 / 23

Page 19: Adversarial Attacks on Neural Networks for Graph Data...Outline 1 Introduction 2 Graph Convolutional Networks Overview 3 Related Work 4 Attack Model 5 Generating Adversarial Graphs

ResultsTransferability of Attacks

Generate adversarial graphs on surrogate model.

Test on benchmark Graph Neural Networks

Evasion Attack: Train on clean data, keep parameters fixed, attack.Posioning Attack: Train on adversarial data and measure accuracy.

Figure: Results on Cora data using different attack algorithms. Clean indicatesthe original data. Lower scores are better

Author: Daniel Zugner Adversarial Attacks on Neural Networks for Graph DataPresenter: Faizan Ahmad https://qdata.github.io/deep2Read 19 / 23

Page 20: Adversarial Attacks on Neural Networks for Graph Data...Outline 1 Introduction 2 Graph Convolutional Networks Overview 3 Related Work 4 Attack Model 5 Generating Adversarial Graphs

ResultsTransferability of Poisoning Attacks

Figure: Overview of results. Smaller is better

Author: Daniel Zugner Adversarial Attacks on Neural Networks for Graph DataPresenter: Faizan Ahmad https://qdata.github.io/deep2Read 20 / 23

Page 21: Adversarial Attacks on Neural Networks for Graph Data...Outline 1 Introduction 2 Graph Convolutional Networks Overview 3 Related Work 4 Attack Model 5 Generating Adversarial Graphs

ResultsTransferability of Poisoning Attacks

Figure: Attacks with limited knowledge about the data

Author: Daniel Zugner Adversarial Attacks on Neural Networks for Graph DataPresenter: Faizan Ahmad https://qdata.github.io/deep2Read 21 / 23

Page 22: Adversarial Attacks on Neural Networks for Graph Data...Outline 1 Introduction 2 Graph Convolutional Networks Overview 3 Related Work 4 Attack Model 5 Generating Adversarial Graphs

Takeaways

Adversarial attacks on graphs are more challenging

Attacks on linear systems transfer well to non-linear systems

Limited knowledge of graph is sometimes enough to mount attacks

Greedy approaches usually work amazingly!

Black box attacks are successful too.

Author: Daniel Zugner Adversarial Attacks on Neural Networks for Graph DataPresenter: Faizan Ahmad https://qdata.github.io/deep2Read 22 / 23

Page 23: Adversarial Attacks on Neural Networks for Graph Data...Outline 1 Introduction 2 Graph Convolutional Networks Overview 3 Related Work 4 Attack Model 5 Generating Adversarial Graphs

Discussion

How to handle continuous features?

How to handle weighted edges?

What happens after adversarial training of graph neural networks?

What happens if we apply the greedy approximation on non-linearmodel?

Author: Daniel Zugner Adversarial Attacks on Neural Networks for Graph DataPresenter: Faizan Ahmad https://qdata.github.io/deep2Read 23 / 23

Page 24: Adversarial Attacks on Neural Networks for Graph Data...Outline 1 Introduction 2 Graph Convolutional Networks Overview 3 Related Work 4 Attack Model 5 Generating Adversarial Graphs

S.-M. Moosavi-Dezfooli, A. Fawzi, and P. Frossard, “Deepfool: asimple and accurate method to fool deep neural networks,” inProceedings of the IEEE Conference on Computer Vision and PatternRecognition, pp. 2574–2582, 2016.

A. Kurakin, I. Goodfellow, and S. Bengio, “Adversarial examples inthe physical world,” arXiv preprint arXiv:1607.02533, 2016.

J. Ebrahimi, A. Rao, D. Lowd, and D. Dou, “Hotflip: White-boxadversarial examples for text classification,” arXiv preprintarXiv:1712.06751, 2017.

T. N. Kipf and M. Welling, “Semi-supervised classification with graphconvolutional networks,” arXiv preprint arXiv:1609.02907, 2016.

B. Perozzi, R. Al-Rfou, and S. Skiena, “Deepwalk: Online learning ofsocial representations,” in Proceedings of the 20th ACM SIGKDDinternational conference on Knowledge discovery and data mining,pp. 701–710, ACM, 2014.

Author: Daniel Zugner Adversarial Attacks on Neural Networks for Graph DataPresenter: Faizan Ahmad https://qdata.github.io/deep2Read 23 / 23

Page 25: Adversarial Attacks on Neural Networks for Graph Data...Outline 1 Introduction 2 Graph Convolutional Networks Overview 3 Related Work 4 Attack Model 5 Generating Adversarial Graphs

Y. Li, D. Tarlow, M. Brockschmidt, and R. Zemel, “Gated graphsequence neural networks,” arXiv preprint arXiv:1511.05493, 2015.

B. Li, Y. Wang, A. Singh, and Y. Vorobeychik, “Data poisoningattacks on factorization-based collaborative filtering,” in Advances inneural information processing systems, pp. 1885–1893, 2016.

H. Dai, H. Li, T. Tian, X. Huang, L. Wang, J. Zhu, and L. Song,“Adversarial attack on graph structured data,” arXiv preprintarXiv:1806.02371, 2018.

Author: Daniel Zugner Adversarial Attacks on Neural Networks for Graph DataPresenter: Faizan Ahmad https://qdata.github.io/deep2Read 23 / 23