EDoG: Adversarial Edge Detection For Graph Neural Networks
Abstract —Graph Neural Networks (GNNs) have been widely applied to different tasks such as bioinformatics, drug design, and social networks.
However, recent studies have shown that GNNs are vulnerable to adversarial attacks which aim to mislead the node (or subgraph) classification prediction by adding subtle perturbations.
In particular, several attacks against GNNs have been proposed by adding/deleting a small amount of edges, which have caused serious security concerns.
Detecting these attacks is challenging due to the small magnitude of perturbation and the discrete nature of graph data.
In this paper, we propose a general adversarial edge detection pipeline EDoG without requiring knowledge of the attack strategies based on graph generation.
Specifically, we propose a novel graph generation approach combined with link prediction to detect suspicious adversarial edges.
To effectively train the graph generative model, we sample several sub-graphs from the given graph data.
We show that since the number of adversarial edges is usually low in practice, with low probability the sampled sub-graphs will contain adversarial edges based on the union bound.
In addition, considering the strong attacks which perturb a large number of edges, we propose a set of novel features to perform outlier detection as the preprocessing for our detection.
Extensive experimental results on three real-world graph datasets including a private transaction rule dataset from a major company and two types of synthetic graphs with controlled properties (e.g., Erdos-Renyi and scale- free graphs) show that EDoG can achieve above 0.8 AUC against four state-of-the-art unseen attack strategies without requiring any knowledge about the attack type (e.g., degree of the target victim node); and around 0.85 with knowledge of the attack type.
EDoG significantly outperforms traditional malicious edge detection baselines.
We also show that an adaptive attack with full knowledge of our detection pipeline is difficult to bypass it.
Our results shed light on several principles to improve the robustness of GNNs.
I. I NTRODUCTION
Graph neural networks (GNNs) have been widely applied in many real-world tasks, such as drug screening [7], [11], protein structure prediction [19], and social network analysis [32].
However, recent studies show that GNNs are vulnerable to adversarial manipulation, where carefully crafted instances are able to mislead machine learning models to make an arbitrarily incorrect prediction.
Such vulnerabilities have raised great concerns when applying GNNs to securitycritical applications.
In particular, different types of attacks targeting on GNNs by adding/deleting a small amount of edges within a target graph have been proposed to fool the node classification or subgraph classification tasks [8], [53], [54].
These attacks are shown to be possible in real world scenarios.
For example, as shown in Figure 1, a malicious user can bypass the malicious access detection system by linking himself with other legitimate users [25]
Detecting such adversarial attacks on GNNs involves several challenges.
First, such adversarial attacks focus on local graph properties and aim to create “unnoticeable” perturbations.
Therefore, the manipulation of a small number of local edges is not obvious enough to be detected by traditional Sybil detection methods [3].
Second, existing defense/detection methods against adversarial behaviors on machine learning models are not easy to be applied to detect malicious attacks on GNNs for several reasons.
For instance, Robust generative models are proposed to mitigate adversarial perturbation via denoising autoencoders and Generative Adversarial Networks (GAN) respectively [17], [27], [34]; however, subtle adversarial perturbation in graph-structured data is hard to remove directly through generative models due to the discrete nature of graph data.
Third, the perturbations on a graph will show diverse behaviors due to different factors, which makes it impossible to learn unified rules to identify them, and in-depth understanding of such adversarial behaviors is required.
For instance, adding adversarial edges to a node of higher degree will induce different adversarial patterns (adversarial edges in this case are more likely to be outliers) compared with adding them to a node of low degree.
Given these challenges, in this paper we propose a general detection pipeline EDoG as shown in Figure 2 to detect different unseen adversarial attacks in GNNs.
In particular, we propose several detection strategies as components of
EDoG , including Link Prediction based method ( LP ), Graph
Generation based method ( GGD ), and Outlier Detection based method ( OD ).
Here we mainly consider four types of attacks: (1) adding only one adversarial edge [8]; (2) the number of added adversarial edges is allowed to be up to the degree of a chosen target node, while these adversarial edges are all directly connected to the target node [53]; (3) the number of added adversarial edges is allowed to be up to the degree of a chosen target node, while they are not directly connected to the target node [53];(4) the number of added adversarial edges is allowed to be up to a certain percentage (e.g., 5%) of the number of the edges in the original graph [54].
We found that adversarial edges in the first type of attacks can be characterized by graph generative models which are trained with a large number of subsampled graphs.
Therefore, we propose a novel graph generative model based detection method GGD to detect such adversarial edges.
In particular, we first sample a number of subgraphs for training the generative model; and since the original graph contains a small number of adversarial edges, based on the union bound these sub-graphs will not contain malicious edges with high probability.
Such generative models can learn useful patterns from subgraphs and detect malicious edges.
In addition, we propose to use link prediction models to filter out suspicious edges coarsely to ensure that the generative models are trained on “clean” edges.
However, when a larger number of adversarial edges are allowed (i.e., the other three types of attacks), the sampled sub-graphs may contain more adversarial edges and therefore the trained graph generative model and link prediction model are not accurate enough to distinguish the added adversarial edges.
In such scenarios, we found that the added adversarial edges are more likely to appear as “outliers,” while the single adversarial edge would not.
As a result, we propose a list of intrinsic features that can be leveraged to perform outlier detection ( OD ), together with GGD and LP .
By leveraging the intrinsic tradeoff between the stealthiness (hard to appear as “outliers”) and sparsity (hard to be sampled in subgraphs) of attacks, the proposed EDoG is able to effectively identify adversarial edges effectively based on at least one of these properties.
We conduct extensive experiments on three real-world graph datasets including one private transaction rule graph from a major company as well as two types of synthetic graphs (e.g., Erdos-Renyi and scale-free graphs) with controlled properties.
We show that OD can achieve detection AUC above 0.9 for the cases when the target nodes have high degree (larger than 10), which means that if we have knowledge about the attack type it is possible to achieve nearly perfect detection rate.
Even without the knowledge of attack types, our results show that the proposed general pipeline EDoG outperforms other state-of-the-art adversarial edge detection methods [31], [33] significantly.
In addition, we also evaluate an adaptive attack in which the attacker has full knowledge of our detection pipeline and intentionally aims to bypass it during the attack.
We show that the adaptive attack success rate remains very low given our detection pipeline.
In summary, we make the following contributions:
• We propose a general light-weighted adversarial edge detection pipeline EDoG on GNNs against the state-ofthe-art GNNs based attacks.
In particular, we evaluate EDoG to detect against four adversarial attacks on GNNs without requiring knowledge of the attack strategies.
• We propose a novel graph generative model and a filter-and-sample framework to train the graph generative model for adversarial edge detection purpose.
• Based on several interesting observations, we provide a set of effective features on graphs that can be leveraged to perform outlier detection against unseen adversarial attacks as preprocessing.
• We conduct extensive experiments on Cora, Citeseer, transaction rule graph and synthetic data with controlled properties to detect the state-of-the-art attacks, demonstrating the effectiveness of the proposed pipeline.
The detection AUC of EDoG can reach 0.8 without any knowledge of attack types and over 0.85 when we know the attack type.
In both scenarios, the proposed EDoG approach outperforms other baseline methods.
• We evaluate EDoG against a strong adaptive attack and show that it is difficult to bypass our detection pipeline.
II. B ACKGROUND
In this section, we will introduce background on neural networks, GNNs and the adversarial attacks on GNNs.
A “ c -way classification task” in machine learning is a problem that given an input x and c classes, the model is required to predict which class the input belongs to.
In order to deal with a c -way classification task, the output of a neural network is p ∈ R c where the i -th value in p corresponds to the probability that the input belongs to class i .
If we know the ground truth class y , we can evaluate the prediction by calculating the cross entropy loss between them:
[Equation]
In order to generate a predicted class for the input, the model will take the class with the largest probability:
[Equation]
A. Graph Neural Networks
Graph Neural Networks (GNNs) are a class of nerual networks which processes graph data G .
In general, G = ( V, E, X ) , where V = { v 1 , v 2 , . . .
} denotes the set of nodes,
E = { e 1 , e 2 , . . .
} , e i ∈ V
× V denotes the set of edges and X =
( x 1 , x 2 , . .
, x | V | ) represents the feature vector of each node.
Graph data is different from traditional machine learning data in that in addition to the node features, each node has relationship with its neighborhood indicated by the edges.
Therefore, a GNN model is usually designed such that each layer will consider the information in the neighbourhood of each node.
In particular, a GNN based model calculates an embedding vector θ u of each node u ∈ V via iteratively aggregating information of itself and its neighbours:
[Equation]
[Figure] [Figure] where N ( u ) denotes the neighbours of u in the graph.
The node features x u serves as the initial embedding θ (0) u .
After we calculated the node embedding, we can use it in different tasks such as node classification and abnormal edge detection.
Many GNN models have been proposed such as Graph Convolutional Networks (GCN) [23] and Structure2Vec [7] with impressive performance on various tasks.
In this paper, we will focus on the GCN model.
Let Θ ( k )
=
( θ ( k ) 1 , θ ( k ) 2 , . . .
, θ ( k ) | V | ) be the matrix of all node embedding vectors at step k .
For
GCN, the aggregation function is calculated as:
[Equation]
where ˜ A =
A + I N , such that A is the adjacency matrix and
I N the identity matrix.
˜ D is a diagonal matrix such that ˜ D ii = (cid:80)
j ˜
A ij .
The function σ is a non-linear activation function, and
W ( k ) is the trainable parameters at the k -th layer.
Node classification
In a node classification task over graph data, each node v i has a label y i ∈ Y , but we only have access to a small subset of the true labels, i.e.,
L train : V train → Y where V train =
{ v i 0 , v i 1 , . . .
} ⊂ V is the set of nodes for which we know the true labels.
We also have a set of nodes V infer with V train ∩ V infer = ∅ .
Given L train , we would like to infer the labels of V infer .
That is to say, we seek for a model to give a prediction ˆ y i ∈ Y to each of the node v i , and we would like to maximize the classification accuracy, i.e.,
[Equation]
When performing the node classification task, a GNN model f first calculates the embedding θ u for each node in graph G , which will then be used to calculate the probability vector
[Equation]
indicating the probability of each class that node u belongs to.
During the training process, the goal is to minimize the cross-entropy loss for the prediction of nodes in V train .
During the evaluation process, the predicted class of each node u is given by ˆ y u = arg max y ( p u ) y .
B. Adversarial Attacks on Graph-structured Data
Recently, several studies [8], [53], [54] have shown that graph neural networks for node classification are vulnerable under adversarial attack.
This means that a malicious attacker can modify the graph G subtly into G ′ before it is fed into the graph neural network such that the graph neural network will generate wrong classification results as desired by the attacker.
[8], [53] transform this setting into an optimization problem:
[Equation]
where L ( · , · ) is the cross-entropy loss function between prediction vector of a node v t and its ground truth class y t .
I ( G, G ′ , v t ) is an equivalency indicator which judges whether the small modification between G ′ and G is reasonable.
This indicator function may vary under different attack setting.
Note that this optimization goal cannot be solved by gradient-based approach because the constraint space is discrete - the value in the adjacency matrix of a graph can only be 0 or 1.
In order to solve this problem, [8] defines the equivalency indicator such that the attacker is only allowed to add/delete one edge.
The authors propose to parametrize the perturbation generator G ′
=
h ( G, v t ) as a neural network and trains it with reinforcement learning [42].
In [53] the equivalency indicator is defined such that the total amount of changed edges and node features is bounded.
They propose a simple approximate model of GNNs on which they can analytically solve the optimization problem.
In [54], the optimization problem is defined differently so that it is not restricted to a single node, but over a set of nodes (usually the entire graph):
[Equation]
They solve the optimization problem by approximating the gradient of the adjacency matrix of G ′
so that traditional gradient-based approach is employed.
III. T HREAT M ODEL AND D ETECTION G OAL
In this section, we will first introduce the threat model on graph neural networks.
Then we will discuss our goal as detecting adversarial attacks against GNNs.
A. Attack Model
Here we mainly focus on the node classification task, where
GNNs are used to perform node classification on graph G =
( V, E, X ) .
Based on the Kerckhoffs’s theory [37], we consider the strongest attacker who has whitebox access to the trained
GNNs including the model architecture and parameters.
The attacker aims to perform evasion attacks given a trained GNNs, and the strong attack assumption allows us to best evaluate the detection ability of EDoG.
The attacker’s goal is to change the predicted label of a target node v t from the ground truth y t to the adversarial target
ˆ y ′ t ( ˆ y ′ t ̸ = y t ) by manipulating the input test graph data in a subtle.
There are mainly two categories of attacks on GNNs:
• Feature attack: The attacker makes small modification to the feature vectors of nodes on the graph.
In this attack the graph structure remains unchanged, i.e. G ′
=
( V, E, X ′ ) .
• Structure attack
: The attacker adds or delete a small number of edges in the graph.
In this attack the node feature remains unchanged, i.e. G ′
=
( V, E ′ , X ) .
An attacker may use either or both of the above approaches to attack GNNs.
The feature attack is similar to the attack over other continuous data such as computer vision [18] where gradient-based optimization techniques can be used.
Many works have been conducted against such kind of attacks.
The structure attack, on the other hand, is a newly-proposed attack over discrete data structure.
Hence, we mainly focus on the structure attack in this paper and assume that the node features are not changed.
Without loss of generality, here we mainly focus on attackers that add different numbers of malicious edges to the graph, which means E ⊂ E ′ .
There are two reasons for such setting.
First, adding edges is usually a cheaper and more practical attack approach than deleting edges.
For instance, in an undirected citation network an author can easily add edge by citing others in their own paper but cannot delete edges if their paper has been cited by others.
Second, we empirically find that adding edges will yield higher attack success rate than deleting for attackers.
As a result, adding edge attack is a more severe threat for learning tasks on graph structured data which we will mainly focus on.
On the other hand, we can also leverage the inverse graph to analyze the attacks for deleting edges.
As for the structure attack, we consider the state-of-theart attack strategies targeting on GNNs [8], [53].
Based on the number of allowed malicious edges and whether these malicious edges are directly connected to the target node of an attacker so as to make direct impact, we can categorize the attacks into three types as below.
1) Single-edge attack .
This attack is proposed by [8] where an attacker is allowed to add only one malicious edge to the graph to perform stealthy attack,
i
e. | E ′ \ E | = 1 . 2) Multi-edge direct attack .
This attack is proposed by [53] where an attacker is allowed to add several edges to the graph.
The maliciously added edges would be connected to the target node and the number of malicious edges should not exceed the degree of the target node.
That is, | E ′ \ E | ≤ deg ( v t ) and for any edge ∀ e ( i, j
) ∈ E ′ \ E , v t ∈ e ( i, j ) .
3) Multi-edge indirect attack .
This attack is similar to the Multi-edge direct attack except that the added malicious edges are not directly connected to the target node.
That is, | E ′ \ E | ≤ deg ( v t ) and for edge ∀ e ( i, j ) ∈
E ′ \ E , v t / ∈
e
( i, j ) .
In addition, [54] proposes another structure attack which is known as meta attack.
In meta attack, the attacker does not have a target node but focuses on the entire graph.
The attacker’s goal is to make the GNN model to give wrong classification result on as much nodes as possible.
They allow the number of added edges to be up to 5% of the total number of existing edges in the graph.
Hence, we have the fourth type of attack considered in the paper: 4) Meta attack .
Here the attacker can add at most 5% of malicious edges, i.e. | E ′ \ E | ≤ 5% × | E | .
Examples of the four types of attacks are shown in Figure 3.
B. Goals of Adversarial Edge Detection
In order to deal with the aforementioned threat, we aim to propose a general pipeline to detect the maliciously added edges | E ′ \ E | .
Our detection goal is as follows.
Suppose the defender is provided with a graph G ′
=
( V, E ′ , X ) .
The defender knows that some of the edges may be added maliciously by the attacker as above, and he/she does not have any other information about the attack (e.g. the degree of target nodes or the attack strategies).
The goal is to determine which edges in E ′ are likely to be malicious.
On the high level, the defender will calculate a score s j for each edge e j ∈ E ′ indicating how likely the edge may be a malicious one.
After calculating this score for chosen edges, he/she can either identify adversarial edges directly (by setting a proper threshold) or set priorities for further inspection of “suspicious” edges.
In particular, we would like the detection pipeline to satisfy the following properties:
• The defender only sees the modified graph G ′ and does not have information about the original graph G .
Otherwise the task would become trivial.
• The pipeline should work without any information about the attack, such as the attack strategies or the target node.
We will also show later that with such auxiliary information the pipeline may achieve a better performance as ablation studies for understanding purpose.
• The detection pipeline should be general against different attacks.
EDoG should be able to generalize and detect malicious edges for 1) different types of graphs, 2) various of attack algorithms and 3) different target nodes with different degrees.
IV. A NALYSIS OF A DVERSARIAL A TTACKS ON G RAPHS
In this section, we will first summarize the findings and insights about adversarial edge properties of different types of attacks.
We then provide the high level overview and intuitions of our proposed detection approaches, as well as the final detection pipeline EDoG.
A. Malicious Links between Low-degree Nodes: Link Prediction and Generative Model
Here we consider the attack model where the attacker only adds a small number of adversarial edges, which is a sufficient condition for target nodes with low degree.
This is because for all the attacks we considered, the maximum number of allowed adversarial edges is up to the degree of target node.
When an attacker only adds a very small number of edges to ensure the perturbation is “unnoticeable”, we will first assume that the perturbation of malicious edges is small enough to be neglected—any algorithm, except for the target GNN based models, applied over the malicious graph G ′ will return approximately the same result as if it is applied over G .
Thus, an intuitive approach is that we can train a link prediction model using G ′ .
Ideally, the link prediction model would behave as if it were trained using G , so it will predict the node pairs with edges as high scores and the pairs without edges as low scores.
The malicious edges, however, do not exist in the benign graph.
So the scores of them will be low.
Thus, after applying the link prediction algorithm we can check the scores for the edges in G ′ .
Those with low scores should be considered likely to be malicious.
In this link prediction based approach, selecting features that would focus more on global structures are more helpful, and therefore we propose to use the GCN based structural features for prediction.
We will discuss the used features in detail in the next section.
In addition, in order to better capture the global structure information of the original graph data, we also propose generative models to better approximate the original link distribution.
A key step for training generative models is to ensure that the data are strictly clean (not malicious) to avoid being “poisoned”.
One approach for reducing the effect of malicious edges would be to sample subgraphs from the large graph, as illustrated in Figure 4.
The intuition is that if we randomly sample many small sub-graphs from a large graph, each edge will only appear in a small proportion of the subgraphs with high probability by union bound.
Thus, most subgraphs will contain no malicious edges while preserving the information of the original graph.
For example, in our experiment we find that if we sample the graphs by extracting the two-hop neighbour for each node, it turns out that the more than 99% of subgraphs do not contain malicious edges in single-edge attack on average on the dataset we use, and more than 90% for multi-edge attack and meta-attack.
Therefore, we can train generative models over the subgraphs to learn a good distribution approximation of the original graph, and then leverage this to detect abnormal edges.
Note that the naive link prediction algorithm is not suitable for training over subgraphs in two aspects: first, many link prediction algorithms are based on feature extraction over the entire graph; second, link prediction algorithms tend to have relatively small model capacity to capture the pattern of entire sub-graphs.
Therefore, we can only train the proposed graph generative models based on deep neural networks on subgraphs.
Based on the generative models, we will be able to identify which edges are the least likely to be generated and these edges are highly likely to be malicious.
We find that such generative models are good at discovering patterns from subgraphs and thus detect malicious edges.
B. Malicious Links between High-degree Nodes: Outliers
It turns out that both link prediction and graph generation approach may sometimes fail when applied to multi-edge direct attack, especially when the node degree is large.
We attribute this to a principle of the collective power of malicious edges which can be understood as: when there are many malicious edges connecting to one node, they confirm the legitimacy of each other mutually.
We show an example as in Figure 5.
Suppose one node is originally connected to three nodes in class 1.
If an attacker adds just one malicious edge that connects it to a node in class 2, this edge will seem abnormal and is easily detected.
However, if the attacker instead adds three malicious edges in class 2, the legitimacy of each malicious edge will be supported by the rest, and they will all be judged to be benign.
Under this circumstance, the neighbours of the target node in G ′ should contain a number of different classes (e.g. 50% in class 1 and 50% in class 2), while the classes of other nodes’ neighbors are usually quite uniform.
As a result, we may calculate several edge features indicating the information of the neighbourhood of edges, e.g. number of different classes appearing in the neighbourhood of the edge.
We could expect
[Figure]
that the feature vector of a malicious edge would be different from those of benign edges.
Therefore, we could build an outlier detection model over all the edges and consider the outliers as malicious.
V. EDoG : A DVERSARIAL E DGE D ETECTION
In this section, we will introduce the proposed primitives for adversarial detection considering different scenarios, followed by the proposed general detection pipeline EDoG.
A. LinkPred ( LP )
A direct link prediction algorithm is first considered to integrate given its simplicity and effectiveness.
For example, in [31] the authors calculate five features (as we will discuss in Section VI-A) for each node pair ( u, v ) and use the feature vector to judge whether the node pair should be connected.
However, we can do more than that—using GNN, we may discover some latent feature space in addition to the features used in link prediction.
In practice, we first adopt a two-layer graph convolutional network to calculate the node embedding vector θ u for each node.
Then for each pair node ( u, v ) we use a bilinear hidden layer to calculate a hidden feature
[Equation]
← [ ] 3: for e in E target do 4:
LinkProbs [ e ] ← [ ] 5: π = permutation ( | E | ) 6:
E 0 = ∅ 7: for t in 0 , 1 , . .
. , | E | − 1 do 8: for e in E target \ E t do 9:
LinkProb =
f gen ( V, E t , X )[ e ] 10:
LinkProbs [ e ] ← LinkProbs [ e ] + [ LinkProb ] 11: /
* Add one edge in each iteration.
E t +1 ← E t ∪ E [ π t ] 13: for e in E target do 14:
LinkProbs [ e ] ← average ( LinkProbs [ e ]) 15: return LinkProbs where σ ( · ) is the sigmoid function.
This feature is appended to the feature vector of each node pair to form a 6-dimensional vector and then passed through a logistic regression layer.
The entire model is trained end-to-end.
The inference process is similar to [31]—we calculate the score for all existing edges, and the edges with low scores are likely to be malicious.
B. GraphGenDetect ( GGD )
Following the intuition in IV-A, we propose to train a generative models to capture the complex structure of different subgraphs.
There have been several works on graph generative models [5], [10], [38], [50], [51].
However, most of the existing generative models aim to generate as diverse as possible graphs from the training set.
On the other hand, our goal is to leverage the generative model to predict which edges are more likely to be generated, which means we hope to preserve the properties of original graph.
Hence, we aim f gen to detect malicious edges on graph G ′ =
( V, E ′ , X ) .
1: procedure M ALICIOUS E DGE D ETECT ( f gen , G ′ ) 2: /
* Sample sub-graphs.
G ′ 0 , G ′ 1 , . . .
, G ′ n =
Sample ( G ′ ) 4:
LinkProbs ← [] 5: for e in E do 6:
LinkProbs [ e ] ← [] 7: /* Enumerate through sub-graphs.
*/ 8: for G
′ i in G ′ 0 , G ′ 1 , . . .
, G ′ n − 1 do 9:
SubLinkP ← EdgeLinkProbs( f gen , G ′ i , E ) 10: for e in E ′
i do 11:
LinkProbs ← LinkProbs + SubLinkP [ e ] 12: /
* Probability of being malicious.
MalProbs ← [] 14: for e in E ′ do 15:
MalProbs [ e ] ← 1 − Average ( LinkProbs [ e ]) 16: return MalProbs to design a generative model that could discover the graph structural pattern and does not need to include much diversity in the output.
As a result, we propose a deep graph generation model inspired by sequence generation approaches [41] – the model will generate the edges one-by-one to construct the entire graph.
We train the generative model based on randomly sampled subgraphs, and apply the trained model to predict which edges in E ′ are the least likely to be generated.
These edges with low generative likelihood would be considered to be malicious.
Our model, denoted as f gen , will take as input a graph
G =
( V, E, X ) and output a probability distribution indicating that if we are going to add one edge into the graph, which node pair is likely to be added.
That is to say, the output of f gen is a probability distribution over all the node pairs that have not been connected yet:
[Equation]
/ ∈ E (cid:3)
Based on this model, we can generate a graph given only node information ( V, X ) in a step-by-step procedure.
In particular, we start from an empty edge set E (0) and gradually add edges to the set.
At each time step t , we input ( V, E ( t − 1) , X ) into the f gen , sample a new edge using the output probability distribution and add the new edge into the edge set to get
E ( t ) .
In practice, we use a GCN with bilinear output layer to calculate the probability.
We first apply a two-layer GCN to calculate the embedding vector θ ( t − 1) u for each node u at time t − 1 .
Then, for each node pair ( u, v ) , we apply a bilinear function s ( t − 1)
uv
=
( θ ( t − 1) u ) ⊺ W θ ( t − 1) v to calculate the score.
In order to determine which edge will be generated at the next time step, we take softmax of the scores of all the node pairs which have not been connected to calculate the probability as:
[Equation]
Algorithm model f gen given a graph G ′
=
( V, E ′ , X ) .
E nonexist is a randomly sampled set of node pairs such that no edge exists among each node pair.
1: procedure M ODEL T RAINING L OSS ( f gen , G ′ , E nonexist ) 2: /*
Sample sub-graphs.
G ′ 0 , G ′ 1 , . . .
, G ′ n =
Sample ( G ′ ) 4: loss ←5:
E all = E ′ ∪ E nonexist 6: for G ′ i in G ′ 0 , G ′ 1 , . . . , G ′ n − 1 do 7: SubLinkP ← EdgeLinkProbs( f gen , G ′ i , E all ) 8: for e in E all do 9: label =
e is an existing edge ?
1 :10: loss ← loss + cross ent(label,SubLinkP[e]) 11: return loss
After training the generative model f gen , we aim to calculate: given a graph G and a set of node pairs E target , what is the likelihood ratio that there exists an edge between each node pair in E target ?
The detailed algorithm is shown in Algorithm 1.
In particular, given a subgraph G i we will 1) randomly generate a permutation to get an order for edges.
Following this order, we are going to start with an empty edge set and add one edge to the graph at each time step; 2) at each time step t , feed in the current adjacency matrix A ( t ) and node feature X to model f gen and calculate the scores s uv for the desired node pairs in
E target ; 3) calculate the final score of an edge as the average of the scores which we calculate in all the time steps.
Using Alg. 1, we can infer which edges are likely to be malicious in graph G ′ as in Alg. 2.
During this inference stage, we will first sample sub-graphs from G ′ and calculate the probability of links for edges in each sub-graph.
Then the score of edges in the original graph can be calculated by taking the average accordingly.
A small score means the edge is unlikely to be generated, and therefore it is likely to be malicious.
We will use gradient-based method to minimize a training loss iteratively in order to train the model f gen .
At each training step, the process for calculating the training loss is shown in Alg 3.
Similar to the inference stage,
we first sample sub-graphs from G ′ =
( V, E ′ , X ) .
However, in order to train the model, we not only calculate the probability of the linked node pairs (i.e. edges in sub-graphs) but also calculate the probability for a set of unlinked node pairs E nonexist .
This set is uniformly sampled from the unlinked node pairs in the graph and we sample a different set in different training step.
We let the set size be | E nonexist | = | E ′ | .
Hence, the training loss at each time step is a binary cross entropy loss over all the node pairs.
The ground truth label is 1 if the node pairs is linked in the original graph and 0 otherwise.
After calculating the loss, we can apply the gradient-based optimizer to update the model parameters in f gen .
C. Filtering for GraphGenDetect
The graph generation model indeed has a strong capacity in learning patterns from sub-graphs.
However, the existence of malicious graphs may still harm the performance of GraphGenDetect because our graph generation model would treat the pattern of malicious edges as benign and learn it well, leading the algorithm to be unstable.
Therefore, we propose an effective filtering process, i.e. we can first filter away a proportion of edges in the original graph which seems to be suspicious and train our generation model on the filtered graph.
If the malicious edges are indeed filtered away, most of the sampled graphs should be benign during the training process and we can expect that our trained generative model will capture the structure properties of benign subgraphs.
In order to decide which edges are likely to be malicious and should be filtered, we can use algorithms introduced before to evaluate the maliciousness score for each edge.
In practice, we find our LinkPred approach a good way to filter away edges, as it is a stable algorithm and could reach acceptable performance to filter away malicious edges in most cases.
We denote this approach as LinkPred + GraphGenDetect .
That is to say, we first apply LinkPred over G ′ and to get a score for each edge indicating how likely it is malicious.
Then we will remove the top k edges with highest malicious scores, getting G ′ filter =
( V, E ′ filter , X ) .
Thus, we can train our
GraphGenDetect model on G ′ filter and finally use the trained model to detect the malicious edges over G ′ .
D. OutlierDetect ( OD )
Based on the intuition in Section IV-B, we propose the
OutlierDetect to further identify adversarial edges mainly for high-degree victim nodes.
The intuition of this approach comes from an observation on the attacker behaviour during direct structure attack: in order to make the target victim node be misclassified into another class (say class 1), the attacker tends to add many edges between the target nodes with nodes that belong to class 1.
Hence, the class distribution of the target node’s neighbours can be quite diverse considering its previous connections.
In contrast, the classes in a benign node’s neighbourhood should be quite uniform.
Inspired by this phenomenon, we propose a novel outlier detection model for the edges based on the class distribution of the neighbourhood nodes of an edge.
In particular, we calculate the following features for each node:
• The number of different classes of the neighbourhood nodes.
• Average appearance time of each class in the neighbourhood nodes.
• Appearance time of the most frequently appeared class in the neighbourhood nodes.
• Appearance time of the second most frequent class in the neighbour (0 if only one class is in the neighbourhood).
• Standard deviation of the appearance time of each class in the neighbourhood.
• Logarithm of the betweenness centrality [14] of each node in the graph.
Note that we do not have ground truth classes information for most nodes, so we would first fit a GNN over the graph G ′ and use the prediction as the label.
For each edge, we calculate the above features for both nodes and concatenate them together, constructing a 10-dimensional feature vector.
We then train a one-class SVM with the RBF kernel over these edge feature vectors to detect the outliers.
The trained model will calculate a score for each edge indicating its abnormality.
The larger the value is, the more likely that the edge is a malicious one.
E. General Pipeline for Detection - EDoG
The primitive approaches we propose above focus on different attacking scenarios.
In particular, LinkPred + GraphGenDetect and GraphGenDetect approach work well in most cases, except for the case when many malicious edges are connected to a single node (target node with high degree).
On the other hand, OutlierDetect is very good at detecting such kinds of attacks with target nodes of high degree.
Therefore, similar to [6], in which a strong model is fit over graph data, we need to design a unified framework for the overall detection on adversarial edges.
Based on the node degree information, our final pipeline, namely Edge Detection of Graph ( EDoG ), is shown in Figure 2.
It is an aggregated model which averages the output of LinkPred + GraphGenDetect , OutlierDetect and GraphGenDetect .
In particular, we apply the three approaches over the graph and get their prediction score for each edge.
Then for edges between high-degree nodes (in practice we choose the criteria that the sum of degree of the two nodes is larger than 6), we use the average of scores from the three approaches; otherwise, for low degree nodes we only use the average score of LinkPred + GraphGenDetect and GraphGenDetect .
The advantage in doing this is: first, GraphGenDetect and LinkPred + GraphGenDetect perform not very well at attacks with high node degree by Multi-edge direct attack, and incorporating it with OutlierDetect significantly improve the detection performance; second, the GraphGenDetectbased approach performs well but sometimes not very stable, so an aggregated model could help improve its robustness significantly.
VI. E XPERIMENTAL RESULTS
In this section, we will first introduce the dataset and evaluation metrics we use, followed by the attack models, and performance analysis of the proposed detection methods.
A. Experimental Setup
Datasets and evaluation metrics.
We evaluate our detection model on two public citation networks, one private transaction rule graph from a major company, and two types of synthetic dataset with controlled properties.
The benign accuracy of our model on the datasets are shown in Appendix A.
We hope that such variety of datasets can demonstrate the flexibility of our approach.
The real-world network datasets we use are Cora [26] and
Citeseer [15].
These two datasets are citation networks where a node represents a research paper and an edge represents a citation between two papers.
Cora has 2,708 nodes and 5,429 edges; Citeseer has 3,327 nodes and 4,732 edges.
Each node contains a bag-of-word feature vector and has a ground truth label indicating which type of paper it is.
During the training process, only a small part of node labels are available (140 for Cora and 120 for Citeseer).
The model is trained to determine what are the labels for the other nodes.
Cora is a 7-way classification task and Citeseer is 6-way.
This setting is commonly used in the task of node classification on graph data [8], [23], [53].
We also evaluate EDoG on a private transaction rule graph from a major company.
In this rule graph (denoted as Rule), each node represents a rule in the system and each edge represents a relationship that two rules are frequently cotriggered.
We extract a subgraph with 719 nodes and 3, edges.
Each node has a related feature vector, including information such as author ID and its application in the system.
The node classification task is to determine whether a rule is a temporary test rule or not.
For experiments on synthetic graphs with controlled properties, we generate two Erdos-Renyi graphs [12] and one scalefree graph [2].
The two Erdos-Renyi graphs are G n,p 1 and
G n,p 2 with n = 1000 and p 1 = ln nn , p 2 = 2ln n n .
The scalefree graph is generated using Barabasi-Albert algorithms, with 1,000 nodes and parameter m = 1 .
We would like to assign node features and node labels that are related with the graph structures.
Therefore, given a synthetic graph we first assign a 20-dimensional random feature e u to each node u .
Then we let the node features to correlate with its neighbours by repeat:
[Equation]
where N ( u ) is the neighboring nodes of u .
After repeat the process several times (in practice we repeat 3 times), we can get a hidden feature vector e u which is related with graph structures.
The final node feature vector x u is a discrete random binary vector, the probability that the i -th bit of x u equals 1 is:
[Equation]
And the label of u is y u
= 1 if (cid:80) i
x ( i ) u >
and otherwise y u = 0 .
The node classification accuracy can reach around 80% for ER graphs and around 75% for scale-free graphs.
For each dataset and attack approach, we randomly pick several target victim nodes and perform the state-of-the-art attacks to generate malicious edges.
Then we perform the detection method on the new graphs and check whether the malicious edges can be detected without attack information.
The evaluation metric is the Area Under ROC Curve (AUC), which is a commonly used metric to verify the performance of a detection method.
Attack strategies.
We evaluate the attack strategies as introduced in Section III-A. We only choose the target nodes that are successfully attacked and randomly sample the target nodes with different degrees.
We observe in practice that
[Table]
Multi-edges direct attack is the most successful attacking model, followed by Single-edge attack and finally Multi-edges indirect attack.
Therefore, we selected 20, 10 and 6 target nodes respectively for these three attack methods on real-world data.
For synthetic data, we simply pick two target nodes, one with the smallest degree and the other with the largest degree.
The selected target node degrees are shown in the Table I.
For the meta-attack, we follow the same setting as in the paperand add 5% malicious edges to the graph.
We use a standard 2-layer GCN for the classification tasks and the training setting is the same as in [8], [53], [54].
Baseline Detection Approaches.
We compare the proposed
EDoG with two state-of-the-art detection approaches as below.
We will show the performance of other traditional metrics in
Appendix B. 1) Anomaly Link Discovery Approach ( ALD ): Our first baseline is the anomaly link detection approach as proposed in [31].
This approach trains a link prediction-based algorithm for detection.
For each node pair ( u, v ) it calculates five features, including the similarity of neighbours, the number of common neighbours, the distance between two nodes, the preferential attachment of two nodes and the similarity of the node features of u and v .
Then it trains a logistic regression classifier over the feature vectors of the node pairs, where the ground truth label of node pairs with edge is 1, otherwise 0.
After the model is trained, we calculate the probability of link for each existing edge.
The smaller the probability is, the more likely that edge is a malicious one.
2) Katz Index Approach ( Katz ): Another baseline is an anomaly link discovery method described in [33], in which they used a high-order heuristic named Katz index [24] to measure the connectivity of each node pair ( u, v ) as
[Equation]
where β is damping factor to assign more weight to shorter walks and walks l ( u, v ) is the set of random walks with the length of l between u and v .
The intuition behind this measure is that compared with the normal links, malicious links often have small Katz index values.
Then we can calculate the Katz index for each node pair and used the softmax function for normalization.
After that, the value assigned for each node pair is bounded between 0 and 1, and we use this value as the
[Table]
probability for the existence of the link between the nodes.
The smaller the probability is, the more likely that edge is a malicious one.
Implementation Details.
We implement all the detection models in Pytorch [29] except for the ALD and Katz and
OutlierDetect where we use the scikit-learn toolkit [30] for logistic regression and one-class SVM.
In order to sample subgraphs from the original graph, we iterate through each node and extract its two-hop neighbourhood as a subgraph.
Thus, we can get a set of subgraphs whose cardinality equals the number of nodes in the original graph.
For LinkPred , we train it for 500 epochs using SGD optimizer with learning rate of 0.01 and we sample among node pairs which are not connected so that the number of positive and negative labels is the same.
For OutlierDetect we fit a one-class svm with radial basis function kernel.
For GraphGenDetect we train it using
Adam optimizer [22] for 15 epochs with learning rate 0.001.
We observe that the detection result of the GraphGenDetect model is reasonable fast (e.g. 5 epochs can be enough) while the result can be non-stable.
Therefore, during test time we evaluate the trained model from the 6th to 15th epoch and take the average scores as the final prediction.
For filtering model LinkPred + GraphGenDetect , we filter away 50% of the edges using the result of LinkPred .
B. Detection Performance on Real-world Datasets
We will first provide the overall performance comparison between our proposed pipeline EDoG and the state-of-the-art baselines [31], [33] with and without knowledge of the attacker’s approach to demonstrate its efficacy, and then present how each of our proposed detection approaches perform on different real-world datasets and attacks strategies.
Overall Performance without knowledge of attack type.
Despite the efficacy of our approach compared with baselines, in many cases we do not know the attack approach.
Therefore, we need a uniform pipeline, EDoG , to defend against the various types of attacks.
The performance of
EDoG compared with the baselines is shown in Table II.
To avoid data dependency and make the comparison more clear, we average the results over datasets to evaluate the overall performance.
As we can see, our approach EDoG outperforms the baselines on all the tasks.
Also, we observe that defending against Single-edge attack and Multi-edges indirect attack are relatively easy tasks.
Our pipeline can achieve over 0.8 AUC on these tasks.
The other two attacks are relatively hard to defend.
Some results of baseline approaches are even worse than random guess.
As we discussed before, this may be due to the principle of the collective power of malicious edges .
Nevertheless, our approach can still get an over 0.7 detection
AUC against such kind of attack since we use the scores of
OutlierDetect to detect edges between high degree nodes.
This again demonstrates the robustness of our general pipeline.
Overall Performance with knowledge of attack type.
As shown in Table III, our approach EDoG outperforms the state-of-the-art baselines in most cases significantly when there is knowledge about the attack type.
The performance of different detection approaches matches with our intuition discussed above, and different models do well against different types of attacks.
Hence, when we have knowledge of the attack approach, we can use the detection method that is good at dealing with it.
This is also useful when we want to defend against specific type of attacks.
In particular, LinkPred + GraphGenDetect works well for Single-edge attack and
Multi-edges direct attack on small-degree target nodes (degree ≤ 5 ).
For Multi-edges direct attack on large-degree target nodes, OutlierDetect is the appropriate choice.
On Multiedges indirect attack, it turns out that both GraphGenDetect and LinkPred + GraphGenDetect would work well and we choose LinkPred + GraphGenDetect to be coherent with that in Single-edge attack.
For Meta attack, EDoG is used since
Meta-attack may contain various types of malicious edges.
The average AUC of the proposed approaches is close to 0.85, demonstrating the efficacy of our detection pipeline EDoG against different attacks.
In order to explore the detection performance of different detection primitives, we show the results of each detection method that we proposed in Appendix C. We will observe that graph generation-based method has superior performance for low-degree attacks while outlier detection method performs better on high-degree attacks.
With our ensemble method
EDoG , the performance will be good for all tasks.
C. Analysis on Synthetic Dataset
Besides the real-world graph dataset, we also evaluate the attack approaches and our detection framework on the synthetic ER graphs and scale-free BA graph, aiming to obtain in-depth analysis of our detection approaches in the controlled environments.
In this set of experiments, we perform in-depth analysis for how well the EDoG perform in terms of detecting adversarial edges, if the graph has certain properties to make the detection harder.
The result is shown in Table IV.
As we can see, the performance of our detection approach over synthetic graphs is even better than that over real-world data.
The performance on the scale-free graph, which is similar to real world citation network structure, reaches an average of above 92% AUC on all tasks.
The performance on ErdosRenyi graphs are comparatively low, yet still achieve an average AUC of around 80%.
This shows that our approach does exploit the structure of scale-free graph to improve the performance.
Also, we observe that our approach beats [Table] [Table] baselines on all Multi-edges direct attack and Meta attack, which we consider as hard tasks.
For the other two tasks, the baseline can sometime outperform our approach.
Hence [Table] we conclude that EDoG can generalize to different graph structures.
In addition, the baseline approaches can sometimes work well in clean synthetic dataset, but in complicated and noisy real-world graph structure, the robustness of our approach is superior.
D. Visualization of Attack and Detection
To intuitively understand the adversarial attack and corresponding detection performance, we include a visualization of an attack and our detection on the Rule dataset as shown in Fig.
The node in the middle is the target node and the attacker performed multi-edges direct attack to inject several malicious edges connected to it.
We can observe that the target node is a test rule and the attacker’s goal is to fool the model to predict it as non-test rule, so the malicious edges are all connected to the non-test rules.
During detection, our
EDoG pipeline detects such adversarial edges easily.
All the malicious edges are detected with a high EDoG score.
[Figure]
E. Adaptive Attacks
In this subsection, we consider the adaptive attack where the attacker has full knowledge of our detection pipeline and will intentionally try to bypass our detection during their attack.
We design the adaptive attack as follows: given the clean graph
G , the attacker will first run the EDoG pipeline and get the prediction scores for all the node pairs.
Then, during the attack process, the attacker will only inject the malicious edges with a lower EDoG prediction score (in practice we use only the lower 25% edges).
With such process, the attacker tries to only inject the edges that seem benign to the EDoG system.
Note that the edges are not guaranteed to evade the detection, since the EDoG score will change after the injection of malicious edges.
We show the results of adaptive attacks as in Table V and compare with the standard attack which is allowed to inject arbitrary edges.
In order to perform adaptive attack, the attacker’s choice of malicious edges are restricted.
Therefore, we can observe that the attack success rate is greatly reduced.
In most cases the success rate is reduced by over 50%.
This shows that our detection pipeline is difficult to bypass even if the attacker has full knowledge of it. [Table]
F. Detecting Random Edges on Graphs
In order to evaluate whether our pipeline is able to capture the behaviours of pure malicious attackers [Table] we conduct another experiment where we add random edges into the graph.
The detailed results and analysis are shown in Appendix D. We can observe that baseline approaches will consider random edges as some malicious behaviour, while ours will ignore those randomness and focus only on those malicious edges.
VII. R ELATED W ORK
Adversarial attacks on graphs.
Recently the robustness of machine learning models has been studied in numerous settings such as adversarial examples [18], [44], [46], [47].
Most of the researches on on a continuous input space (e.g. images and audios).
As for text domain, some of attacks are based on manually constructed perturbations ( [20], [35]) and [16] adopted the gradient attacking method to the embedding space of texts.
As for graphs, performing attacks can be more difficult especially when we want to make perturbations on edges, since the gradient attacking method is not easy to be used here.
So far there are several attacks proposed on graphs: some of the works attempted to attack the graph neural networks [8], [53], [54], as [8] proposed three attack methods on both node classification and graph classification problems and [53] developed an attack method targeting on a particular node based on greedy approximation scheme.
Rather than reducing the classification result of a particular node, [54] attacked the overall performance of node classification tasks through meta learning method.
Moreover, [4], [40] studied the vulnerability of unsupervised node embedding models.
Defense methods against adversarial attacks.
Defense on neural networks is much harder compared with attacks ( [27]).
Currently, most of the defense methods are based on (1) changing the architecture of deep learning models: [28] leveraged distillation training techniques and reduce the magnitude of gradients between the pre-softmax layer (logits) and softmax outputs.
[43] used the graph attention network ( [45]) to harness information from a graph of peer samples to improve the robustness of network.
(2) adversary training methods: [18] managed to augment the training dataset with adversarial examples.
(3) data preprocessing: [49] hardened the deep learning models against adversarial perturbations on images through reducing the color depth and smoothing on spatial domain.
[27], [34] attempted to filter the adversarial noise of the input samples with autoencoders and Generative
Adversarial Networks (GAN) ( [17]) respectively.
Although those approaches are somehow effective, they still have some limitations and the task of defending against adversarial attacks is still challenging.
In this paper we focus on detecting malicious edges in a graph under attack.
There are also works aiming to directly defend the attacks and mitigate the effect of malicious edges [52].
Comparisong with defense approaches, our detection approach is superior in two properties: first, detecting the malicious edge can help identify the attacker.
For example, in the case of social network we can find out which user is adding the malicious link.
Second, the defense approaches are usually more prone to adversarial attack, since they incorporate the defense mechanism in the model and are therefore easier to be attacked as a whole when the attacker has knowledge of such mechanism.
Robust Graph Neural Networks.
Considering that the threat of adversarial attacks on GNNs is newly emereged, the research with regard to defense methods on graph neural networks is limited.
[55] proposes a certificate for GNN robustness under adversarial attack by changing node features.
[13] proposes adversarial retraining pipeline to improve GNN model robustness and it also deals with node feature attack.
The goal of these two works is different from ours since we are defending against graph structure attack.
[48] also proposes an adversarial retraining pipeline to defend against graph structure attack.
They evaluate over the meta attack and the retrained model still suffers from performance decrease.
[52] proposes a GNN structure where each layer is no longer deterministic but a stochastic transformation layer.
They show that using this structure the model performance will increase under adversarial structure attack.
However, when the number of added edges increases the model will still fail.
Anomaly detection on graphs.
There have been various researches on the topic of ‘ Anomaly Detection ’ or ‘ Fraud
Detection ’ on graphs [1], [21], [36].
Note that the detection purpose is different from ours: anomaly detection on graphs aims to find nodes/edges that differ a lot from others.
While the two proposed subtle adversarial attack on graphs appear to contain too small magnitude of perturbation to be detected, and here we focus on graph neural networks instead of general graph analysis.
In addition, [6] studied on how to fit a good model over graph data when only one graph is available.
They focus on the classification performance while our work focuses on the detection of malicious edges, and we have completely no supervision.
Our work is going to defend against graphical network models by detecting malicious edges with original approaches.
[9], [39] propose virtual adversarial training on
GNNs as a way to improve model performance but they do not evaluate their model against adversarial attack.
VIII. C ONCLUSIONS
Overall, we propose the first general detection pipeline
EDoG against the state-of-the-art attack on GNNs.
We investigate into the attack and defense properties and find that different attack strategies led to different behaviors: malicious edges connecting low degree nodes will not likely to appear as outliers while the ones connecting high degree nodes will.
Thorough experiments show that the average detection AUC of EDoG can reach above 80% and adaptive attacks are hard to be performed given the complexity of the detection pipeline.
These results shed light on the design of robust GNNs against attacks on graph-structured data.
A CKNOWLEDGEMENTS
This work is partially supported by NSF grant No.1910100, NSF CNS No.2046726, a C3.ai DTI Award, and the Alfred P. Sloan Foundation.
In Table VI, we show the benign accuracy of our GNN models on the different datasets. A PPENDIX B T RADITIONAL METRICS
In addition to the baselines mentioned in the paper, we also evaluate two heuristic metrics which are commonly used in link prediction tasks - the common neighborhood (CN) score and the Adamic-Adar (AA) score. The CN score will calculate the common neighbors between two nodes, while the AA score will calculate the inverse logarithmic degree centrality of the common neighbors. We show the detection performance of the metrics on Cora and Citeseer in Table VII. We can observe from the tables that our approach can still outperform these baselines in detecting malicious edges.
In this section we will explore in-depth on the detection performance against different types of attacks based on our proposed detection primitives.
Single-edge attack.
The result for Single-edge attack is shown in Table VIII.
As we can see, the link predictionbased approaches perform quite well.
The best approach is
LinkPred + GraphGenDetect , achieving an average of over 0.9 AUC over the tasks.
When comparing the performance of the combination model LinkPred + GraphGenDetect with GGD , we see that the combination model significantly improves the detection performance as the LinkPred filters out the malicious edges (i.e., AUC > 0.5).
This shows that our GraphGenDetect detection model can learn “benign properties” from normal graphs and improve detection performance.
On the other hand, a direct GraphGenDetect can achieve good performance in some cases.
This shows that
GraphGenDetect is a good yet unstable model, so a filtering algorithm can be combined to reduce the variation and improve its robustness.
In addition, We observe that the performance of LP + GGD in Cora is slightly better than in Citeseer while Rule has the best performance.
This is because that the graph of Citeseer is more sparse than Cora (with more nodes and fewer edges), and
Rule is the most densne graph.
After filtering, the information contained in Citeseer dataset is reduced and therefore it is harder for the model to learn useful patterns.
Multi-edge direct attack.
The result for Multi-edge direct attack is shown in Table VIII.
We see that as the node degree increases, approaches related to link prediction algorithms perform no better than random guessing.
As we have discussed in
Section IV-B, we attribute this to a principle of the ‘collective power of malicious edges’.
By contrast, this collective power does not fool the OutlierDetect approach; its average AUC is over 0.85 when target node degree is larger than five, and 0.
when it is larger than ten.
Multi-edge indirect attack.
The result for Multi-edge indirect attack is shown in Table VIII.
We see that the detection
AUC decreases compared with Single-edge attack.
This is reasonable: since more malicious edges are added, the defense would be more challenging.
We observe that the LinkPred approach is affected the most.
Therefore, the filtering algorithm does not help to improve the performance of GraphGenDetect .
The best approach here is GraphGenDetect .
One surprising observation is that the performance in Citeseer is better than Cora.
We think that this phenomenon is also because of the sparsity: malicious edges tend to accumulate in a small neighbourhood of the target node, and the sparsity induces that subgraphs of nodes far away from the target node will not contain malicious edges.
Therefore, the proportion of benign subgraphs will increase and therefore the trained generative detection model can learn a better pattern of benign properties.
Meta attack.
The result for Meta attack is shown in Table
VIII.
We see that none of the approaches shows a very good performance against such kind of attack, especially over the
Citeseer dataset.
This is because this meta attack may be a combination of different type of attacks, and a large number of malicious edges are added (5%).
Nevertheless, we can still see that our EDoG pipeline reaches acceptable performance on over the tasks.
The detection performance on the Rule dataset is still very good, since it is a dense graph and contains more information for detection.
A PPENDIX D R ESULTS ON D ETECTING R ANDOM E DGES ON G RAPHS
In this experiment, we randomly choose 1, 2, 4, 8, andunconnected node pairs in Cora and Citeseer datasets to add random edges.
We then run our detection pipeline as well as the baseline approaches on the graph to see whether these random edges will be identified as the malicious edges.
In
Table IX, we show the ratio of detecting non-random edges.
Hence, larger value means that the detection model will not be distracted by the added random edges.
In particular, 50% means that the detection method will not distinguish random and benign edges which is a desired property.
We can observe that baseline approaches tend to detect random edges as malicious edges while EDoG will ignore most random added edges.
This is because these baseline approaches are essentially designed to detect abnormality in the graphs and therefore they will recognize the abnormal behaviour of the randomly added edges.
On the other hand, our detection pipeline EDoG will not identify the random edges as malicious ones.
In some cases the value is near 50% which means that the model views random edge to be [Table] [Table] [Table]
similar as normal ones.
This is ideal for our goal since our model will not be distracted by the random edges in the task of malicious edge detection.
Comparing the result with the baseline approaches, we claim that our EDoG pipeline can not only detect malicious behaviors of the attacker
[Table]
but also resilient against random added edges [Table] which has great potential to improve the robustness of GNNs.