Open-Set Graph Anomaly Detection via Normal Structure Regularisation

## Abstract

Abstract This paper considers an important Graph Anomaly Detection (GAD) task, namely open-set GAD, which aims to train a detection model using a small number of normal and anomaly nodes (referred to as seen anomalies ) to detect both seen anomalies and unseen anomalies ( i.e. , anomalies that cannot be illustrated the training anomalies). Those labelled training data provide crucial prior knowledge about abnormalities for GAD models, enabling substantially reduced detection errors. However, current supervised GAD methods tend to over-emphasise fitting the seen anomalies, leading to many errors of
detecting the unseen anomalies as normal nodes.
Further, existing open-set AD models were introduced to handle Euclidean data, failing to effectively capture discriminative features from graph structure and node attributes for GAD.
In this work, we propose a novel
open-set GAD approach, namely n ormal s tructure reg ularisation ( NSReg ),
to achieve generalised detection ability to unseen anomalies, while maintaining its effectiveness on detecting seen anomalies.
The key idea in NSReg is to introduce a regularisation term that enforces the learning of compact, semantically-rich representations of normal nodes based on their structural relations to other nodes. When being optimised with supervised anomaly detection losses, the regularisation term helps incorporate strong normality into the modelling, and thus, it effectively avoids overfitting the seen anomalies and learns a better normality decision boundary, largely reducing the false negatives of detecting unseen anomalies as normal. Extensive empirical results on seven real-world datasets show that NSReg significantly outperforms state-of-the-art competing methods by at least 14% AUC-ROC on the unseen anomaly classes and by 10% AUC-ROC on all anomaly classes.

## 1 Introduction

Detection of anomalous nodes in a graph is a crucial task in the context of Graph Anomaly Detection (GAD) (Akoglu et al., ; Ma et al., ). Its popularity has been growing in recent years due to its wide range of real-world applications, such as detection of malicious users in social networks, illegal transactions in financial networks, and faults in sensor networks. There have been numerous GAD methods introduced (Akoglu et al., ; Ding et al., ; Liu et al., ; Ma et al., ; Qiao et al., ), with the majority of them designed as unsupervised approaches. However, they are often associated with high detection errors due to the lack of knowledge about anomalies.

There has been growing interest in supervised Anomaly Detection (AD) methods (Jiang et al., ; Pang et al., ; Tang et al., ; Pang et al., ; ) because they are able to utilise labelled anomaly data to substantially reduce the high detection errors of unsupervised approaches.
Such methods assume the availability of a limited number of labelled anomalies, which is usually feasible to obtain in real-world applications and can be utilised to enable anomaly-informed supervision. Despite their generally superior performance, these methods prove less effective in open-set AD where training models with labelled anomalies (referred to as seen anomalies) fails to adequately represent anomalies at inference time, particularly in the context of newly emerging types/classes of anomalies that are substantially different from those seen in training (i.e., unseen anomalies). This is because such methods often concentrate solely on modelling abnormal patterns derived from labelled anomalies, thus exhibiting poor generalisation to the unseen anomalies, i.e., many unseen anomalies are detected as normal, as shown in Figure 1(a-b). Further, they are mostly designed for handling Euclidean data like image and tabular data (Pang et al., ; ), thereby overlooking valuable discriminative information on the structure and node attributes in graph data for GAD.

Figure: Figure 1: Visualisation of node representations with anomaly score contour lines of three supervised GAD models: baseline classifier Binary Cross-Entropy (BCE), recent state-of-the-art BWGNN (Tang et al., ), and our proposed NSReg, on two real-world datasets: Photo and ogbn-proteins. The models are trained using a limited number of seen anomalies and normal nodes. BCE and BWGNN overly focus on the decision boundary between the seen anomalies and normal nodes, whereas NSReg mitigates overfitting to the seen anomalies, resulting in more generalised detection of seen and unseen anomalies.
Refer to caption: x1.png

To address these issues, this paper focuses on the practical yet under-explored problem of open-set GAD, aiming to enhance the generalisation for both seen and unseen anomaly nodes by leveraging a small
set of labelled seen anomaly nodes.
To this end, we propose a novel open-set GAD approach, namely normal structure regularisation (NSReg), to leverage the rich normal graph information embedded in the labelled nodes. The key idea in NSReg is to introduce a regularisation term that enforces the learning of compact, semantically-rich representations of normal nodes based on their structural relations to other nodes. When being optimised with supervised AD losses, the regularisation term incorporates strong normality into the modelling, and thus, it effectively avoids overfitting the seen anomalies, while learning better normality decision boundary. This helps substantially reduce the errors of detecting unseen anomalies as normal.

In particular, to capture those semantically-rich normal structure relations, NSReg differentiates the labelled normal nodes that are connected in their local neighbourhood from those that are not. This is done by predicting three types of normal-node-oriented relation prediction, including: connected normal nodes, unconnected normal nodes, and unconnected normal nodes to unlabelled nodes. We show theoretically that our regularisation module prioritises establishing distinct node representations based on their structural relationships with the normal class, rather than attempting to predict these anomalies without grounded information. As a result, it effectively reinforces the structural normality of the graph in the representation space and enforces a more stringent decision boundary for the normal class, enabling better separability of the unseen anomaly nodes from the normal nodes, as shown in Figure 1(c).
Moreover, NSReg is a plug-and-play module, which can be integrated as a plugin module into various supervised GAD learning approaches to enhance their generalisability to unseen anomalies.
It is worth noting that NSReg is designed to enhance the generalisation of supervised GAD to unseen anomalies by leveraging discriminative structural information derived from a small number of labelled nodes. It is not intended for unsupervised GAD, where label information is unavailable, and models designed for the unsupervised setting are prone to different issues, e.g., the failure to capture anomaly patterns of interest or high false positives.

In summary, our main contributions are as follows:

- •
We study an under-explored problem of GAD, namely open-set GAD, and validate the feasibility of leveraging graph structural normality to regularise representation learning in supervised GAD, resulting in effective mitigation of the overfitting on the seen anomalies.
- •
We propose NSReg that regularises supervised GAD models by differentiating normal-node-oriented relations.
It tackles the problem by enforcing better separation between unseen anomalies and normal nodes while retaining seen anomaly detection performance.
- •
NSReg is a plug-and-play regularisation term that can be applied to enhance the generalisation of different supervised GAD methods.
- •
We show through extensive empirical studies that NSReg significantly outperforms all competing methods by at least 14% AUC-ROC on the unseen anomaly classes and by 10% AUC-ROC on all anomaly classes.

## 2 Related Work

Graph Anomaly Detection. GAD methods are usually designed as unsupervised learning to bypass the reliance of labelled data (Ma et al., ; Jiang et al., ). Earlier shallow methods (Peng et al., ; Perozzi & Akoglu, ; Gao et al., ; Li et al., ; Yu et al., ) leverage various heuristics to detect anomalies. Recent GAD methods predominantly utilise graph neural networks (GNNs) (Wu et al., ) and have demonstrated superior performance due to their strong representation learning capacity. There are numerous unsupervised GNN-based GAD methods proposed (Ding et al., ; Li et al., ; Zhao et al., ; Ding et al., ; Wang et al., ; Liu et al., ; Xu et al., ; Qiao & Pang, ; He et al., ).
However, these methods are not trained using real anomalies and have proven to be ineffective when their heuristic optimisation objective mismatches the actual anomaly patterns. To leverage anomaly-specific prior knowledge, supervised learning that utilises a small number of labelled anomalies (Wang et al., ; Tang et al., ; Chai et al., ; Dou et al., ; Huang et al., ; Wang et al., ; Gao et al., ) and learning schemes such as meta learning and transfer learning have also been explored for GAD (Ding et al., ; ; Zhou et al., ; Wang et al., ). Nevertheless, these methods are prone to overfitting the small number of labelled anomaly nodes and do not implement effective regularisation to ensure the generalisation on the unseen anomalies.

Towards Supervised Anomaly Detection. Although numerous AD methods have been proposed (Chandola et al., ; Pang et al., ), most of them (Zenati et al., ; Park et al., ; Roth et al., ) adopt optimisation objectives that focus on representation learning and are indirect for anomaly scoring. More recent works (Sohn et al., ; Ruff et al., ; Pang et al., ; ; ; Zhao & Hryniewicki, ) leverage a small number of labelled anomalies to perform optimisation and anomaly scoring in an end-to-end pipeline, significantly improving detection performance. However, such methods are originally designed for non-structured data and cannot explore structural information when directly applied for GAD.

Imbalanced Node Classification. Another closely related line of research is imbalanced classification (Chawla et al., ; Zhou & Liu, ; Johnson & Khoshgoftaar, ), which is a longstanding challenge in mitigating the class imbalance in the training data. A variety of approaches (Ding et al., ; Wang et al., ; Qu et al., ; Zhao et al., ; Park et al., ) have been proposed to mitigate class imbalance in the training graph data to avoid overfitting the majority classes. However, these methods only assume a fixed number of known classes and do not consider the potential unseen classes at inference time. As a result, they fail to generalise to unseen anomaly classes in open-set GAD.

Figure: Figure 2: An overview of our proposed approach, NSReg, illustrating the integration of the NSR module into a graph anomaly detector as a plug-and-play module for regularising supervised GAD training, where red arrows indicate the “plugging points”. The green teal dashed box illustrates the decomposition of NSReg’s overall learning objective in the shared representation space. Here, $\mathcal{L}_{\mathrm{NSR}}$ focuses on enforcing a more stringent decision boundary for the normal class, enabling better separability of the unseen anomaly nodes from the normal nodes, which is not considered by $\mathcal{L}_{\mathrm{AD}}$.
Refer to caption: x2.png

## 3 Our Proposed Approach

### 3.1 Problem Statement

We consider open-set GAD on attributed graphs. Let $\mathcal{G}=(\mathcal{V},\mathcal{E},\mathbf{X})$ be an attributed graph with a node set $\mathcal{V}$, an edge set $\mathcal{E}$ and a feature matrix $\mathbf{X}$, which contains significantly fewer anomalous nodes $\mathcal{V}_{\mathrm{a}}$ than normal nodes $\mathcal{V}_{\mathrm{n}}$.
In open-set GAD, during training, the labelled training nodes $\mathcal{V}^{\mathrm{train}}$ are often unable to illustrate all possible anomaly classes at inference. For clarity, we use $\mathcal{V}_{\mathrm{a}}^{\mathrm{seen}}$ to denote anomaly nodes that can be illustrated by the labelled anomaly nodes (seen anomalies) and $\mathcal{V}_{\mathrm{a}}^{\mathrm{unseen}}$ to denote the unseen anomalies, such that $\mathcal{V}_{\mathrm{a}}=\mathcal{V}_{\mathrm{a}}^{\mathrm{seen}}\cup\mathcal{
V}_{\mathrm{a}}^{\mathrm{unseen}}$ and $\mathcal{V}^{\mathrm{train}}_{\mathrm{a}}\subset\mathcal{V}_{\mathrm{a}}^{
\mathrm{seen}}$.

Our objective is to learn a scoring function $\phi:(\mathcal{G},\mathcal{V})\rightarrow\mathbb{R}$, such that $\phi(\mathcal{G},v_{\mathrm{a}})\gg\phi(\mathcal{G},v_{\mathrm{n}})$, for all $v_{\mathrm{a}}\in\mathcal{V}_{\mathrm{a}}^{\mathrm{seen}}\cup\mathcal{V}_{
\mathrm{a}}^{\mathrm{unseen}}$ and $v_{\mathrm{n}}\in\mathcal{V}_{\mathrm{n}}$. In this paper, we consider a GNN-based anomaly scoring function $\phi$, which consists of a pipeline with two components: a graph representation learner $\psi(\mathcal{G},\mathcal{V};\Theta_{\psi})$: $(\mathcal{G},\mathcal{V})\rightarrow\mathcal{Z}$ and an anomaly scoring function $\eta(\mathcal{Z};\Theta_{\eta})$ : $\mathcal{Z}\rightarrow\mathbb{R}$, where $\Theta_{\psi}$ and $\Theta_{\eta}$ are learnable parameters. We aim to obtain the following anomaly scoring mapping:

$$ $\phi(\mathcal{G},\mathcal{V};\Theta_{\phi})=\eta(\psi(\mathcal{G},\mathcal{V}; \Theta_{\psi});\Theta_{\eta}),$ (1) $$

with the support of the labelled nodes and the graph structure.
The main challenges are the unforeseeable nature of anomalies and the risk of overfitting to labelled anomaly nodes.

### 3.2 Overview of NSReg

In this paper, we propose a novel open-set GAD framework, namely normal structure regularisation (NSReg), as a solution to tackle the aforementioned challenges. The key insight behind NSReg is to explicitly guide the representation learner in capturing discriminative normal structural information from the graph characterised by the labelled normal nodes, supplementing the incomplete and often biased label information provided by the labelled anomalies that represent the seen anomalies. The modelling of this structural normality effectively calibrates the normality decision boundary, enabling better generalisation to the unseen anomalies, i.e., better separation between the unseen anomalies and normal nodes.

As illustrated in Figure 2, NSReg leverages a novel Normal Structure Regularisation (NSR) module to enforce compact and uncluttered normal subspace in the representation space. During training, the NSR module is integrated as a regularising component with a supervised graph anomaly detector, both sharing the same representation learner for joint optimisation, to enable the joint learning of the structural normality and seen anomaly patterns for GAD. The general objective of NSReg can be defined as the following:

$$ $\operatorname*{arg\,min}_{\Theta_{\phi},\Theta_{\mathrm{NSR}}}\sum_{v\in \mathcal{V}}\mathcal{L}_{\mathrm{AD}}(s_{v},y_{v})+\lambda\sum_{r\in\mathcal{R }}\mathcal{L}_{\mathrm{NSR}}(q_{r},c_{r}),$ (2) $$

where $\Theta_{\phi}$ and $\Theta_{\mathrm{NSR}}$ are the respective learnable parameters of the anomaly detection $\phi$ and the NSR module, and $\mathcal{L}_{\mathrm{AD}}$ is the loss function of a supervised GAD model, with $s_{v}$ being the predicted anomaly score and $y_{v}$ being the ground truth. Additionally, $\mathcal{L}_{\mathrm{NSR}}$ signifies the loss function of the NSR module adjusted by the regularisation coefficient $\lambda$, with $q_{r}$ denoting the predicted normality of a relation sample $r$, and its normality $c_{r}$ is defined by a labelling function $C$.
During inference, the representation learner $\psi*$ is combined with the trained anomaly scoring network $\eta*$ to form an end-to-end pipeline for detection, and the NSR module is disconnected from the representation learner since the normal structural information has already been learned. This simplifies the inference process without introducing any additional NSR module-related runtime or resource overhead.

### 3.3 Normal Structure Regularisation (NSR)

The design of the NSR module, which is the core of NSReg, is motivated by the limitations of most supervised GAD methods, which are only designed to maximise separability between normal nodes and seen anomalies, but fail to provide sufficient supervision for the representation learner to effectively differentiate unseen anomaly representations from the normal class.
In an open-set environment, we are unable to obtain the prior knowledge of the unseen anomalies, and thus, difficult to learn the unseen anomaly patterns. Thus, NSReg takes a step back and focuses on learning better normality, which would help distinguish the unseen anomalies from the normal nodes better. NSReg achieves this by modelling the normal-node-oriented relations (i.e., $\{r=(v,u)\mid v\in\mathcal{V}_{\mathrm{n}},u\in\mathcal{V}\}$), which is aimed at enforcing a stricter definition of the normal region and recalibrating misplaced unseen anomaly representations within the representation space. By modelling three types of normal-node-oriented relations as a discriminative task, NSReg enhances representation learning with significantly enriched normality semantics, effectively disentangling unseen anomaly nodes from normal nodes in the representation space.
We first provide a theoretical analysis of enforcing structural normality and then detail the two core components of NSR: normal-node-oriented relation generation and modelling.
Preserving Structural Normality Improves Representation Learning for GAD. We analyse the effects of enforcing structural normality in the representation space and its advantages for enhancing generalisation to unseen anomalies. We consider a mapping $g:(\mathbb{R}^{d},\mathbb{R}^{d})\rightarrow\mathbb{R}_{[0,1]}$ in the node representation space $\mathcal{Z}$, which takes the representations of nodes in each relation as inputs to model their normality. The normality of the relations is defined by a labelling function $C$, where 0 and 1 indicate the lowest and the highest levels of normality, respectively.
$C$ should satisfy that $0<=\max(\mathcal{C}_{\mathrm{a}})\ll\min(\mathcal{C}_{\mathrm{n}})<=1$,
where $\mathcal{C}_{\mathrm{n}}$ and $\mathcal{C}_{\mathrm{a}}$ indicate the respective set of the labels for the relations between only the normal nodes and the relations between normal and anomaly nodes respectively, emphasising a significant differentiation in the scale of normality.

Specifically, $g=g_{C}\circ g_{E}$ consists of two sub-mappings: $g_{E}$, a linear mapping that fuses the node representations to produce relation representations, with the option to incorporate a scaling function on these node representations; and $g_{C}$, a linear mapping with a monotonic final activation function to assign normality scores based on the representation. Note that both the scaling function and activation function are required to be homeomorphic.
If $\mathcal{Z}$ is shared with a discriminative graph anomaly detector, the normal nodes and the observed anomalies will be well separated into two isolated dense regions. Based on this observation, we demonstrate through the following proposition that differentiating between these two types of relations will force any anomalous nodes, including unseen ones, to be excluded from the normal region.

###### Proposition 1 .

Consider a well-trained mapping $g$ that effectively distinguishes between the two types of normal-node-oriented relations within a relation representation space $\mathcal{H}$, derived from a node representation space $\mathcal{Z}$. The first type consists exclusively of relations among normal nodes, while the second type involves one normal and one anomalous node, with normality defined by some labeling function $C$, regardless their connectivity. Consider the subspace of all normal nodes in $\mathcal{Z}$ as a connected open set $\mathcal{Z}_{\mathrm{n}}$, the boundary of which is defined by some closed hypersurfaces $\mathcal{M}=\{M_{i}|i\in\{1,\cdots,k\}\}$. Furthermore, let $\mathcal{Z}_{\mathrm{m}}$ denote the union of the interior of each $M_{i}\subset\mathcal{M}$. Given such $\mathcal{Z}_{\mathrm{n}}$ and $\mathcal{Z}_{\mathrm{m}}$, we can obtain that $\mathbf{z}\in\mathcal{Z}_{\mathrm{n}}$ is true for all $\mathbf{z}\in\mathcal{Z}_{\mathrm{m}}$, indicating their equivalence.

The proof, along with an intuitive diagram (Figure 5), is provided in Appendix 5. There are two key insights we can obtain from this proposition. First, since it is obvious that $\mathcal{Z}_{\mathrm{n}}$ is a subset of $\mathcal{Z}_{\mathrm{m}}$, by proving their equivalence, we observe that inside the boundary of the normal subspace, no anomalous subspace exists, and therefore, no anomaly nodes, whether seen or unseen, are present.
Second, this implies that for normal-node-oriented relations involving anomalies to be distinguishable from relations exclusively between normal nodes, the only way to adjust the representation learner is to ensure that no anomaly node resides within the normal space $\mathcal{Z}_{\mathrm{n}}$. Therefore, enforcing structural normality will result in the displacement of misplaced anomalies from the normal subspace. These insights motivate the design of our NSR module, which is detailed below.

Normal-node-oriented Relation Generation. The relation generation module implements the labelling function $C$ and oversees relation sampling, specifically tailored to integrate structural normality knowledge in open-set GAD. It first samples normal-node-oriented relations and defines their normality, considering three types of relations, including connected normal relations $\mathcal{R}_{(\mathrm{n},\mathrm{c},\mathrm{n})}$,
unconnected normal relations $\mathcal{R}_{(\mathrm{n},\mathrm{u},\mathrm{n})}$, and unconnected normal to other nodes, $\mathcal{R}_{(\mathrm{n},\mathrm{u},\mathrm{u})}$. A labelling function
$C$, which meets the requirements outlined in Proposition 1, is then used to define their normality scores as follows:

$$ $C(r)=\begin{cases}\text{1}&\text{if }r\in\mathcal{R}_{(\mathrm{n},\mathrm{c}, \mathrm{n})}=\{(v,u)\mid v,u\in\mathcal{V}^{\mathrm{train}}_{\mathrm{n}},(v,u) \in\mathcal{E}\}\\ \alpha&\text{if }r\in\mathcal{R}_{(\mathrm{n},\mathrm{u},\mathrm{n})}=\{(v,u) \mid v,u\in\mathcal{V}^{\mathrm{train}}_{\mathrm{n}},(v,u)\notin\mathcal{E}\} \\ \text{0}&\text{if }r\in\mathcal{R}_{(\mathrm{n},\mathrm{u},\mathrm{u})}=\{(v,u )\mid v\in\mathcal{V}^{\mathrm{train}}_{\mathrm{n}},u\in\mathcal{V}\setminus \mathcal{V}^{\mathrm{train}},(v,u)\notin\mathcal{E}\},\\ \end{cases}$ $$

where $0\ll\alpha<1$ is the specification of the normality of $\mathcal{R}_{(\mathrm{n},\mathrm{u},\mathrm{n})}$ relative to other two types of relations. $\alpha=0.8$ is set by default to define a three-level normality hierarchy we want to enforce. This specification effectively embeds the homophilic assumption between the normal nodes while preserving the difference between the most related and related normal relations. We also find it unnecessary to include normal - seen anomaly pairs because similar information can be learned from supervised GAD objectives. Due to space limit, please refer to Appendix D.4 for details.
Normal-node-oriented Relation Modelling. This module instantiates the discriminative mapping $g$ for normal relation modeling as a neural network, denoted $F$. It first generates the representations of relations by fusing the representations of their corresponding end nodes using a learnable mapping $F_{E}$, which is then fed into a normality prediction network $F_{C}$ to model their normality. Specifically, $F_{E}$ can be defined as:

$$ $\mathbf{h}_{r}=F_{E}\big{(}\psi(\mathcal{G},v),\psi(\mathcal{G},u)\big{)}= \sigma(\mathbf{z}_{v})\cdot\mathbf{W}_{E}\circ\sigma(\mathbf{z}_{u}),$ (3) $$

where $\sigma$ is the sigmoid function, and $\mathbf{W}_{E}$ is a learnable weight matrix. $\mathbf{z}_{v}$ and $\mathbf{z}_{u}$ are the representations of the node in relation $r$, generated by the node representation learner $\psi$, which comprises a GNN-based representation learner followed by a projection network. The default GNN is a two-layer GraphSAGE (Hamilton et al., ) considering its good learning capacity and scalability.
The relation modelling network is then optimised according to the following loss function:

$$ $\mathcal{L}_{\mathbf{NSR}}=-\Big{(}c_{r}\cdot\log\big{(}F_{C}(\mathbf{h}_{r}) \big{)}+(1-c_{r})\cdot\log\big{(}1-F_{C}(\mathbf{h}_{r})\big{)}\Big{)},$ (4) $$

where $c_{r}$ is the relation label subject to the labelling function $C$ and $F_{C}$ is implemented as a learner layer followed by the Sigmoid function. This design satisfied all the conditions required for Proposition 1, ensuring that the normality enforced by the NSR module is accurately reflected in the shared representation space. It produces distinctive node representations in relation to those of the labelled normal nodes, thereby enforcing significantly enriched, fine-grained normality among the node representations. This enhancement directly regularises the representation learning of supervised anomaly detectors, enabling better separation of the unseen anomaly nodes from the normal nodes.

Note that our NSR module is different from PReNet (Pang et al., ). PReNet is a weakly-supervised anomaly detector trained with an anomaly-oriented relation network, whereas NSR is a regularisation term focusing on learning fine-grained normal representations to regularise supervised anomaly detectors.

###### Proposition 1 .

### 3.4 Open-set GAD using NSReg

Training.
NSReg is trained through batch gradient descent over a predefined number of iterations. At each iteration, we first sample a batch of $b_{\mathrm{AD}}$ training nodes $V$, which contains $b^{\mathrm{n}}_{\mathrm{AD}}$ labelled normal nodes and all labelled anomaly nodes (note that the number of labelled anomalies is typically very small) for tuning the anomaly scoring network $\eta$ and the representation learner $\psi$. In addition, the normal-node-oriented relation generation is performed to generate $b_{\mathrm{NSR}}$ relation samples $R$ for optimising the NSR module and $\psi$. The overall training objective of NSReg can be formulated as:

$$ $\operatorname*{arg\,min}_{\Theta_{\phi},\Theta_{\mathrm{NSR}}}\frac{-1}{{|V|}} \big{(}Y_{V}\log(S_{V})+(1-Y_{V})\log\big{(}1-S_{V})\big{)}+\frac{\lambda}{{|R |}}\mathcal{L}_{\mathrm{NSR}}(Q_{R},C_{R}),$ (5) $$

where the first term is a simple supervised cross-entropy-loss-based anomaly detector and the second term is our NSR module. As shown in Sec. 4.1, the NSR term can be also effectively combined with other supervised GAD models in the first term.
During training, the GAD loss is computed initially based on the first term of the objective function and is used to update the parameters of the anomaly scoring network $\eta$. Subsequently, the NSR loss can be calculated using the second term of the objective function to update the relation modelling network. Finally, the combined GAD and NSR losses are aggregated and backpropagated to update the parameters of the representation learner. A Python-style pseudocode for training is provided in the Appendix C.1.

Inference. During inference, given a test node $v$, NSReg first generates its representation $\mathbf{z}_{v}$, which is then scored using the trained anomaly scoring network $\eta$: $s_{v}=\phi(\mathcal{G},v)=\eta(\psi(\mathcal{G},v))$.

## 4 Experiments

Datasets.
NSReg is extensively evaluated using seven real-world attributed graph datasets. To the best of our knowledge, no publicly available GAD datasets include multiple types of human-annotated natural anomaly classes. Therefore, we adapt imbalanced node classification and binary-labelled GAD datasets to define anomaly subclasses with distribution discrepancies for open-set GAD evaluation. For imbalanced node classification datasets with multiple minor classes, such as Photo, Computers, and CS (Shchur et al., ), we treat each minor class (those with less than 5% of total nodes) as seen anomalies, and the rest as unseen anomalies. This is consistent with the general definition of anomalies, characterised by rarity and significant difference from the majority. In the case of Yelp (Rayana & Akoglu, ) and T-Finance (Tang et al., ), two well-known GAD datasets with binary labels, we cluster the learned representations of the anomaly class to create anomaly subclasses. Three large-scale attributed graph datasets, ogbn-arxiv, ogbn-proteins (Hu et al., ), and T-Finance (Tang et al., ) are also adapted to evaluate NSReg at scale. More details about the datasets are presented in Appendix C.2.

This approach provides a realistic and comprehensive evaluation of detecting real-world anomalies, while also introducing an open-set GAD scenario with guaranteed semantic deviation across multiple anomaly classes.
There are GAD datasets with injected anomalies using added artificial edges or node attributes in some earlier GAD works, but, following previous studies (Tang et al., ; Qiao et al., ), they are not used here since their injection patterns are often unintentionally incorporated into the design of detection models, resulting in unwanted information leakage.

Evaluation Protocol and Metrics.
For each dataset, we treat one of the anomaly classes as the seen anomaly, with the other anomaly classes as unseen anomalies.
We alternate this process for all anomaly classes, and report the results averaged over all cases. All experiments are repeated for 5 random runs. For example, the CS dataset includes 8 anomaly classes, each is treated as ‘seen’ in turn, resulting in 8 sub-experiments per run, with a total of 40 sub-experiments across 5 runs. The Python style code for the evaluation protocol is presented in Appendix C.3.

We employ two widely used and complementary performance metrics in GAD: the Area Under Receiver Operating Characteristic Curve (AUC-ROC) and the Area Under Precision-Recall Curve (AUC-PR).
In particular, AUC-ROC measures both true positives and false positives, while AUC-PR summarises the precision and recall of the anomaly classes, offers a focused measure exclusively on the anomaly classes.

Competing Methods. NSReg is compared with 16 competing methods from multiple related areas, including four popular unsupervised methods, eight state-of-the-art (SOTA) supervised methods and one baseline method. Specifically, DOMINANT (Ding et al., ), GGAN (Chen et al., ), (Wang et al., ), CoLA (Liu et al., ), (Xu et al., ), TAM (Qiao & Pang, ) and ADA-GAD (He et al., ) are implemented as our unsupervised baselines due to their popularity and competitive performance among unsupervised GAD methods. The SOTA methods consist of recently proposed supervised anomaly detectors for Euclidean data: DevNet (Pang et al., ), PReNet (Pang et al., ), and those for graph data: DCI (Wang et al., ), BWGNN (Tang et al., ), AMNet (Chai et al., ) and GHRN (Gao et al., ), and two imbalanced node classification methods as well: GraphSMOTE (Zhao et al., ) and GraphENS (Park et al., ).
The classification method using binary cross-entropy (BCE) is considered as a baseline model.

Implementation Details.
NSReg comprises a representation learner featuring a two-layer GraphSAGE (Hamilton et al., ), followed by a two-layer projection network, each containing 64 hidden units per layer. NSReg is optimised using the Adam (Kingma & Ba, ) optimiser for 200 epochs for the Photo, Computers, and CS datasets with a learning rate of $1\times 10^{-3}$, and for 400 epochs for Yelp with a learning rate of $5\times 10^{-3}$ due to its larger number of nodes. We set the number of labelled anomalies to 50 and the percentage of labelled normal nodes to 5% by default. Each batch of training nodes includes all labelled anomalies and randomly sampled number of labelled normal nodes capped at 512. Similarly, each batch of relations is capped at 512, with an equal number of samples for each relation type. The default value of $\alpha$ is set to 0.8 and $\lambda$ is set to 1 for all datasets. The analysis of their sensitivity can be found in Appendix D.5, where NSReg maintains stable performance, showing its robustness to the choice of hyperparameters. Further details are provided in Appendix C.4. In our default setting, 50 anomalies are used for training along with 5% of randomly selected normal nodes, while the remaining data is reserved for evaluation.

Table: Table 1: AUC-ROC and AUC-PR (mean±std) for detecting all anomalies and exclusively unseen anomalies. The boldfaced are the best results. “-” denotes unavailable result due to out-of-memory.

### 4.1 Main Results

GAD Performance on Both Seen and Unseen Anomalies. We first evaluate the performance of NSReg on detecting all test anomalies (i.e., $\mathcal{V}\setminus\mathcal{V}^{\mathrm{train}}$, including samples of both seen and unseen anomaly classes). The results are reported in Table 1 (the upper part). We can see that NSReg achieves consistently and significantly better performance than all competing methods across all datasets in terms of both AUC-ROC and AUC-PR. On average, NSReg demonstrates a significant performance advantage over all competing methods, among which the supervised baselines prove to be considerably more effective than the unsupervised ones. Specifically, for AUC-ROC, NSReg achieves an improvement of 9.7% and 12.7% compared to the best and second-best competing methods, BCE and AMNet, respectively.
Additionally, NSReg shows 16.9% and 24.2% improvement compared to these two methods in terms of AUC-PR. The significant overall performance gain is mainly attributed to NSReg’s strong capability of detecting unseen anomalies, while at the same time achieving an effective fitting of the seen anomalies.

GAD Generalisation to Unseen Anomalies.
The capability of detecting unseen anomalies in the test data (i.e., $\mathcal{V}^{\mathrm{test}}_{\mathrm{n}}\cup\mathcal{V}^{\mathrm{unseen}}_{
\mathrm{a}})$ is more indicative for evaluating a model’s open-set GAD ability.
As shown in Table 1 (lower part),
NSReg again achieves significantly better performance, compared to the competing methods. Notably, on average, NSReg exhibits a greater margin of improvement on the unseen anomaly classes, with a 14% and 21% improvement over the top-2 performing competing methods in terms of AUC-ROC. Similarly, a 35% and 43% performance gain over the top-2 performing competing methods is observed for AUC-PR. The substantially enhanced performance underscores NSReg’s strong ability in reducing the errors of detecting unseen anomalies as normal.

Data Efficiency. We investigate NSReg’s data efficiency by varying the number of seen anomalies around the default setting, including 5, 15, 25, 50, and 100, in order to understand the model’s capacity to handle variations in data availability. The results are illustrated in Figure 3.

Figure: Figure 3: AUC-PR on all anomalies w.r.t. number of labelled anomalies.
Refer to caption: x3.png

Due to space constraints, we report results on the AUC-PR results on all test anomalies and provide the AUC-ROC results in Appendix D.6.
The results show that NSReg consistently achieves significantly improved AUC-PR performance on the overall anomaly detection across the complete spectrum of the Photo, Computers, and CS datasets. On Yelp, NSReg either outperforms, or is on par with the competing methods across the entire range for overall performance. Similar findings can be observed on detecting unseen anomalies (see Figures 8 and 9).

Table: Table 2: Our NSR as a plugin module in supervised AD models DevNet, DCI and BWGNN.

NSReg as a Plug-and-Play Module.
This section examines the effect of using the NSR module of NSReg as a plugin module to enhance three other supervised methods, referred to as NSR-enabled models.
Table 3 shows the GAD performance on detecting all test anomalies, with the original BWGNN, DCI and DevNet as the baselines. Due to the page limit, the results for unseen anomalies are reported in Table 7. We can observe that the NSR-enabled BWGNN, DCI and DevNet yield significant performance improvements across all datasets in both evaluation metrics.
In particular, on average, it improves DevNet by over 10% for AUC-ROC and 30% for AUC-PR, for all anomalies and unseen anomalies. Similarly, for BWGNN, its NSR-variant outperforms the original model by over 7% in terms of AUC-ROC on both test sets and more than 14% for AUC-PR. For DCI, NSR also yields similar level of performance improvement. The consistent improvement demonstrates not only the high generalisability of our proposed NSR but also the importance of enforcing structural normality in supervised GAD.

Large-scale GAD Performance.
We compare NSReg’s GAD performance with supervised baselines on all test nodes and unseen anomalies of three large-scale GAD datasets, as presented in Table 3 and Table 11 in Appendix D.3. Notably, NSReg consistently demonstrates advantageous performance, as observed in other datasets in Table 1. Moreover, NSReg exhibits superior efficiency in terms of data utilisation for large-scale GAD tasks—it achieves effective structural regularisation and significantly improves generalisation with only 100 seen anomalies, accounting for only less than 1% of total anomalies.

### 4.2 Ablation Study

This section empirically explores the effectiveness and significance of enforcing our structural normality within node representations by answering the following questions, with AUC-PR results reported in Table 4 and a visualisations included in Figure 4. We include the results in AUC-ROC in Table 9 in Appendix D.2 due to space limits.

How important is graph structural information when enforcing normality? We answer this question by replacing the NSR module with the one-class hypersphere objective in Deep SAD (SAD) (Ruff et al., ), which minimises the volume of normal node representations to learn the normality without considering the graph structure information. Table
4 shows that NSR can significantly outperform the one-class learning SAD, highlighting the advantage of enforcing graph structure-informed normality. This is because, by simply tightening the normal representations without considering their structural relationships, SAD may not necessarily learn discriminative unseen anomaly representations, as illustrated in Figure 4(SAD). We also found the one-class learning-based SAD is unstable due to its notorious risk of model collapse, while our NSR does not have this issue due to the fine-grained structural relation prediction.

Table: Figure 4: Node representations learned via various regularisation schemes on Photo.

Why is our proposed NSR more effective at structural regularisation? To answer this question, we replace our NSR module with supervised and unsupervised contrastive learning (CL (s.) and CL (u.s.) in Table 4), which enforce similarities between nodes based on their connections. NSReg consistently outperforms both baselines on all tests for both metrics. This is because the NSR module is tailored to ensure that its enforced normality, which is normal-nodes-oriented and thus better aligned with the objective of enhanced normal class modelling, is reflected in the shared representation space, therefore resulting in a more stringent normal class subspace and significantly mitigating overfitting on the seen anomalies, as shown in Figure 4(NSR).

Can we just augment the seen anomalies to improve the generalisation on the unseen ones? This can be answered by comparing the results of NSReg with graph augmentation-based methods G.SMOTE and G.ENS in Table 1. NSReg significantly outperforms the two methods, suggesting that merely augmenting seen anomalies is inadequate for generalising to unseen ones. This is due to the fact that the augmented anomaly samples mainly resemble only the seen abnormalities, which may even further increase the risk of overfitting on the seen anomalies.

Can we perform the relation prediction in NSR with less types of relations?
We compare NSR with its variant that is trained without the second relation $\mathcal{R}_{(\mathrm{n},\mathrm{u},\mathrm{n})}$ (NSR (dual) in short).
Table 4 shows that the default NSR outperforms NSR (dual) by a non-trivial margin on almost all cases. This is because $\mathcal{R}_{(\mathrm{n},\mathrm{u},\mathrm{n})}$ is essential for defining our normality hierarchy, enabling finer granularity in relation modeling, preserving the structural differences between more closely related normal nodes and other nodes, on top of enforcing the distinction between normal and anomaly nodes.

## 5 Conclusion and Future Work

This paper introduces a novel open-set GAD approach, Normal Structure Regularisation (NSReg), which employs a plug-and-play regularisation term to enhance anomaly-discriminative normality from graph structures, thereby reinforcing strong normality in node representations during supervised GAD model training. By aligning node representations with their structural relationships relative to the normal nodes, NSReg establishes a stringent decision boundary for the normal class and enhances its generalisation to unseen anomalies by reducing the errors of detecting them as normal. Comprehensive empirical results show the superiority of NSReg in detecting both seen and unseen anomalies compared to 16 competing methods on several real-world graph datasets.

In terms of limitations, despite its impressive effectiveness in improving generalisation in open-set GAD, NSReg models normality only within the immediate neighbourhood of the labelled normal nodes. While this is not an issue at present, as real-world interactions grow more complex and larger in scale, exploring normal relations beyond immediate neighbours to gain additional information for open-set GAD may become necessary. However, this could introduce additional computational overhead in the relation generation process. One potential solution is to implement efficient relation sampling or approximation strategies, which we leave for future work.

## Appendix A Appendix

Appendix
The appendix section is structured as follows. In Appendix B, we details the proof of the proposition 1. In Appendix C, we provide extended details of the experimental setup, including dataset information, experimental protocol, and implementation specifics. In Appendix D , we provide additional results that were not included in the main section due to space limitations.

## Appendix B Proof of Proposition 1

Figure: Figure 5: Proposition 1 proof intuition: $\mathcal{Z}$ and $\sigma(\mathcal{Z})$ represent the shared node representation spaces before and after applying the scaling function $\sigma$, respectively. In this plot, the grey region represents the normal subspace $\mathcal{Z}_{\mathrm{n}}$, and the union of the grey and red regions represents $\mathcal{Z}_{\mathrm{m}}$. The boundary of the normal subspace, $\mathcal{M}$, is depicted by the black lines. The goal is to prove that the red regions, which denote the neighbourhood of anomalies, do not exist within the normal subspace for a well-trained relation discriminator.
Refer to caption: x5.png

For convenience, we define a labelling function $C$ with a range of $[0,1]$. This function assigns a normality score of 0 to relations between normal nodes and anomaly nodes. In contrast, relations exclusively between normal nodes receive scores ranging from a significantly greater value than 0, denoted as $\alpha$, to a maximum of 1. For simplicity, we use the mapping of our default choice of relation modelling function $F$. It is worth noting that any function that satisfies the condition specified in Sec. 3.3 can be proved using the same approach. We show via proof by contradiction that, if $F$ is well-trained to distinguish the normal nodes exclusive relations and those that involves anomalies in node representation space shared with a supervised anomaly detector, no anomaly node lies in the normal region within the shared representation space of $\eta$ and $F$, where normal nodes form a dense subspace.

We assume the normal region in the shared representation space is a connected open set, due to the high similarity and dense distribution of normal representations forced by supervised discriminative loss $\mathcal{L}_{\mathrm{AD}}$. For a well-trained $F$ and any given normal node from the region $\mathrm{n}$, suppose there are two anomaly nodes, ${\mathrm{a}1}$ and ${\mathrm{a}2}$, where ${\mathrm{a}1}$ lies outside the normal region and ${\mathrm{a}2}$ overlaps with the normal region. Note that such $\mathrm{a}1$ can be easily found, as $\mathcal{L}_{\mathrm{AD}}$ will ensure a sufficient number of seen anomalies residing outside of the normal subspace $\mathcal{Z}_{\mathrm{n}}$. Consider a path connecting these two anomaly nodes:

$$ $l_{t}=t\sigma(\mathbf{z}_{\mathrm{a}1})+(1-t)\sigma(\mathbf{z}_{\mathrm{a}2}), t\in(0,1).$ (6) $$

The homeomorphic of the Sigmoid function will ensure that we are able to find the scaled representation of a normal node $\sigma(\mathbf{z}_{\mathrm{m)}}$ along the path at $t=t_{\mathrm{m}}$. Then we have:

$$ $\sigma(\mathbf{z}_{\mathrm{m}})=t_{\mathrm{m}}\sigma(\mathbf{z}_{\mathrm{a}1}) +(1-t_{\mathrm{m}})\sigma(\mathbf{z}_{\mathrm{a}2}).$ (7) $$

Applying $F$ to the relation between $n$ and $m$, we have:

$$ $\displaystyle F(\mathbf{h}_{\mathrm{nm}})$ $\displaystyle=\mathbf{W}_{C}\cdot\mathbf{h}_{\mathrm{nm}}+\mathbf{b}$ $\displaystyle=\mathbf{W}_{C}(\operatorname{diag}(\sigma(\mathbf{z}_{\mathrm{n} })\cdot\mathbf{W}_{E})\sigma(\mathbf{z}_{\mathrm{m}}))+\mathbf{b}$ $\displaystyle=\mathbf{W}_{C}(\operatorname{diag}(\sigma(\mathbf{z}_{\mathrm{n} })\cdot\mathbf{W}_{E})(t_{\mathrm{m}}\sigma(\mathbf{z}_{\mathrm{a1}})+(1-t_{ \mathrm{m}})\sigma(\mathbf{z}_{\mathrm{a2}}))+\mathbf{b}$ $\displaystyle=t_{\mathrm{m}}\Big{(}\mathbf{W}_{C}\operatorname{diag}\big{(} \sigma(\mathbf{z}_{\mathrm{n}})\cdot\mathbf{W}_{E}\big{)}\sigma(\mathbf{z}_{ \mathrm{a1}})+\mathbf{b}\Big{)}+(1-t_{\mathrm{m}})\Big{(}\mathbf{W}_{C} \operatorname{diag}\big{(}\sigma(\mathbf{z}_{\mathrm{n}})\cdot\mathbf{W}_{E} \big{)}\sigma(\mathbf{z}_{\mathrm{a2}})+\mathbf{b}\Big{)}$ $\displaystyle=t_{\mathrm{m}}\Big{(}\mathbf{W}_{C}\mathbf{h}_{\mathrm{na1}}+ \mathbf{b}\Big{)}+(1-t_{\mathrm{m}})\Big{(}\mathbf{W}_{C}\mathbf{h}_{\mathrm{ na2}}+\mathbf{b}\Big{)}$ $\displaystyle=t_{\mathrm{m}}F(\mathbf{h}_{\mathrm{na1}})+(1-t_{\mathrm{m}})F( \mathbf{h}_{\mathrm{na2}}).$ $$

Since $F$ is well trained, we have $F(\mathbf{h}_{\mathrm{na1}})<\gamma-\delta$ and $F(\mathbf{h}_{\mathrm{na2}})<\gamma-\delta$, where $\sigma(\gamma)=\alpha$ and $\delta\in\mathbb{R}_{(0,\gamma)}$. Therefore, we have :

$$ $\displaystyle F(\mathbf{h}_{\mathrm{nm}})$ $\displaystyle=t_{\mathrm{m}}F(\mathbf{h}_{\mathrm{na1}})+(1-t_{\mathrm{m}})F( \mathbf{h}_{\mathrm{na2}})<\gamma-\delta$ $\displaystyle q_{\mathrm{nm}}$ $\displaystyle=\sigma(F(\mathbf{h}_{\mathrm{nm}}))<\sigma(\gamma-\delta)<\alpha$ $$

which contradicts with the fact that $q_{\mathrm{nm}}>\alpha$.

## Appendix C More Experimental Details

### C.1 Pseudocode for Training NSReg

The training procedure of NSReg is described in the following pseudocode:

Figure: Algorithm 1 Training NSReg

### C.2 Datasets

#### C.2.1 Dataset Statistics

Table 5 shows the statistics of the seven datasets used. Note that the Yelp dataset is a heterogeneous graph containing three different views. We choose the edge subset of the “Review-User-Review (RUR)” view in our experiments.

Table: Table 5: A summary of dataset statistics

#### C.2.2 Dataset Preprocessing

For the imbalance attributed node classification datasets Photo, Computers, CS and ogbn-proteins, we treat each class that has less than 5% of the total number of nodes of the graph as an anomaly class and the remaining classes as normal. In the ogbn-arxiv dataset, with the original graph containing 40 subclasses, for experimental efficiency, any class representing 3% to 5% of the total nodes is considered an anomaly class. Note that the normal class is defined as the combination of all the majority classes, from which labelled normal nodes are randomly and uniformly drawn, and remain consistent through the entire experiment.

For the Yelp and T-Finance datasets, which only contain binary anomaly labels, we first apply an unsupervised representation learning method Deep Graph Infomax (DGI) for representation learning and then apply k-means clustering to partition the anomaly class into two anomaly subclasses using their node representations. Specifically, our DGI model employs a two-layer GraphSAGE as the representation learner with 128 hidden units per layer. The model is optimised for 1,000 epochs using the Adam optimiser with the learning rate and the batch size set to $1\times 10^{-3}$ and 512, respectively. To further magnify the distribution shift, instead of employing random sampling, we conduct weighted random sampling to generate training anomaly nodes, where the probability associated with each anomaly node is proportional to its distance from its corresponding cluster centroid.

### C.3 Experimental Protocol

Figure: Algorithm 2 Open-set GAD Experimental Protocol

In this section, we outline the process of conducting open-set GAD experiments and encapsulate it in Algorithm 2. For each dataset, we alternate treating each anomaly class as the seen anomaly, with the remaining anomaly classes as unseen, for all anomaly classes. For example, in the CS dataset, 8 out of 15 classes are marked as anomalies. The results for this dataset underwent 5 independent runs of 8 sub-experiments, with each anomaly class treated as ‘seen’ in rotation, totaling 40 sub-experiments for CS.
Note that the normal class remains consistent across each run, and the labelled normal nodes are uniformly drawn.

### C.4 Implementation Details

#### C.4.1 Dependencies

NSReg is implemented in Python and makes extensive use of Pytorch (Paszke et al., ) and Pytorch Geometric (Fey & Lenssen, ). We summarise the main scientific computing libraries and their versions used for our implementation as follows:

- •
python==3.8.13
- •
pytorch==1.10.1 (py3.8_cuda11.3_cudnn8.2.0_0)
- •
pytorch_geometric==2.0.4 (py38_torch_1.10.0_cu113)
- •
numpy==1.23.5
- •
scipy==1.10.0
- •
scikit-learn==1.2.1
- •
cudatoolkit==11.3.1
- •
dgl==1.0.2

#### C.4.2 Hyperparameter Settings

For NSReg, in addition to the hyperparameters reported in Sec. 4, we set the numbers of neighbours used for GraphSAGE aggregation to 25 and 10 for the first layer and the second layer, respectively, for better runtime efficiency. The same sampling strategy as NSReg is employed for the GNN-adapted competing methods that were designed for Euclidean data. Our anomaly scoring network $\eta$ is a two-layer neural network with 32 hidden units in the hidden layer. BCE, DevNet and PReNet are trained for the same number of epochs (200) as NSReg using the Adam optimiser using the learning rate of $1\times 10^{-3}$. We keep the default hyperparameter settings for the other baselines except for GraphSMOTE, for which the pretraining and training epoch numbers are both set to 2,500 where the model exhibits convergence.

For the large-scale datasets ogbn-arxiv and ogbn-proteins, we set the default number of labelled anomalies to 100, and a reduced percentage of labelled normal nodes to 1% to make it more challenging and practical for real-world applications. For ogbn-proteins, where it is set to 2 to enforce stronger structural regularisation due to its large number of nodes and highly dense connections (i.e., over a hunderd thousand nodes with over 300 average degree).

#### C.4.3 Visualisation Method

We utilise UMAP (McInnes et al., ), a widely adopted non-linear invertible dimensionality reduction algorithm, in conjunction with the Matplotlib library to generate contour plots representing anomaly scores. Specifically, we apply UMAP to transform node representations at the anomaly scoring (final) layer of each method into a 2-dimensional representation space. Within the boundaries of the 2D representation space for each method, determined by the maximum values of each dimension, we create a uniform mesh with a step size of 0.1. Subsequently, all points within the mesh are coloured based on the anomaly scores assigned by the final layer, utilising their representations transformed by the inverse transformation of the same UMAP model.

## Appendix D Additional Experimental Results

### D.1 Detailed Results for NSR as a Plug-and-Play Module

We present the complete results of plugging our NSR module into three state-of-the-art supervised AD model, DevNet, DCI and BWGNN, with the original models as the baselines for both all test anomalies and in Table 6 the unseen anomalies in Table 7 in terms of both AUC-ROC and AUC-PR.
Similar substantial performance improvement can be observed as Sec. 4.1.

Table: Table 6: Results of plugging our NSR module into three SOTA supervised AD models DevNet, DCI and BWGNN, with the original models as the baselines on all test anomalies.

Table: Table 7: Results of plugging our NSR module into three SOTA supervised AD models DevNet, DCI and BWGNN, with the original models as the baselines on unseen anomalies.

### D.2 Detailed Ablation Study Results.

We present the comprehensive results of the ablation study in Table 8 and 9, corresponding to Table 4 in the paper. The performance in AUC-ROC shows a similar trend as AUC-PR, aligning with our observations and findings in Sec. 4.2.

Table: Table 8: Our proposed NSR module vs other regularisation methods for all test anomalies.

Table: Table 9: Our proposed NSR module vs other regularisation methods for unseen anomalies.

### D.3 Detailed Large-scale GAD Results

In this section, we present the complete results for large-scale GAD in Tables 10 and 11. We observe NSReg consistently outperforms the baseline methods by a large margin on unseen anomalies, similar to our discussion in Sec. 3.

Table: Table 10: Results on large-scale graph datasets for all test anomalies, where “-” denotes unavailable results due to out of memory.

Table: Table 11: Results on large-scale graph datasets for unseen anomalies, where “-” denotes unavailable results due to out of memory.

Table: Table 12: NSReg vs. NSReg considering connected normal-anomaly relation (NSReg + NA).

### D.4 Effect of Including Normal-anomaly Relations

This section investigates the effect of including an additional type of normal relation that connects normal and anomaly nodes in the relation modelling of NSReg. We report the GAD performance for all test anomalies and the unseen anomalies in both AUC-ROC and AUC-PR in Table 12. We found that the inclusion of connected normal-anomaly relations is less effective than the default NSReg in terms of average performance, although it can achieve comparable performance on the CS and Yelp datasets. This is because the structural distinction between the normal and the seen anomalies is usually sufficiently preserved by the GAD loss. Additionally, it could introduce unnecessary complexity into the hierarchy of the relation modelling, resulting in less effective modelling of the normality that is not addressed by the GAD loss.

### D.5 Detailed Hyperparameter Analysis

We report the GAD performance on all test anomalies in both AUC-ROC and AUC-PR with respect to $\lambda$ and $\alpha$ in Figure 6 and Figure 7, respectively. The results demonstrate stability across a wide spectrum, indicating the robustness of NSReg with respect to their settings.

Figure: Figure 6: Overall GAD performance of NSReg w.r.t $\alpha$.
Refer to caption: x6.png

Figure: Figure 7: Overall GAD performance of NSReg w.r.t $\lambda$.
Refer to caption: x7.png

### D.6 Detailed Data Efficiency Results

In this section, our primary focus is on showing the data efficiency performance of NSReg in terms of AUC-ROC, which complements the discussion of AUC-PR in Sec. 4.1. As illustrated in Figure 8 and Figure 9, NSReg consistently achieves remarkable performance similar to AUC-PR. Specifically, across the entire spectrum, NSReg outperforms the baselines on both overall and unseen anomaly detection for the Photo, Computers, and CS datasets. For the Yelp dataset, NSReg either outperforms or achieves comparable performance, particularly when the number of labelled training anomalies exceeds 5. While GraphSMOTE slightly outperforms NSReg in unseen anomaly detection, its effectiveness in the seen anomalies is limited, resulting in less effective overall detection performance.

Figure: Figure 8: Data efficiency of NSReg and the competing methods in utilising labelled data in AUC-ROC for both all test anomalies and the unseen anomalies.
Refer to caption: x8.png

Figure: Figure 9: Data efficiency of NSReg and the competing methods in utilising labelled data in AUC-PR for both all test anomalies and the unseen anomalies.
Refer to caption: x9.png

## Peer Reviews

confidence: 4
contribution: 2
initial_rating: 5
presentation: 3
questions: See Weakness.
soundness: 2
strengths: 1. The paper tackles an important and impactful problem—open-set graph anomaly detection—with significant potential for real-world applications.
2. The writing is clear, and the paper is well-organized, making it easy to follow.
3. A theoretical analysis is provided, adding depth to the proposed approach.
4. The paper includes thorough experiments that demonstrate the proposed method's effectiveness, along with ablation studies that evaluate the contribution of each component.
summary: This paper tackles the challenge of open-set graph anomaly detection, where the detection model is trained to detect both known and previously unseen anomalies. The authors introduce NSReg, a method that utilizes auxiliary relational information around normal nodes to regularize the model's training. NSReg works by distancing unseen anomalies from normal nodes, aiding in their detection. The paper also includes a theoretical analysis of the proposed method. Comprehensive experiments evaluate the model's effectiveness and the individual contributions of its components.
weaknesses: 1. The core idea of using neighborhood information to enhance anomaly detection is not entirely novel, as similar approaches have been explored in prior works [1], [2], [3]. A comparison between NSReg and these previous methods is necessary to better contextualize its contributions.

2. I have some concerns about the effectiveness of the Normal-node-oriented Relation Generation component. Specifically, the unconnected relation $R_{(n,u,u)}$ between normal nodes and other nodes may include a large number of connections to unlabeled normal nodes, given the predominance of normal nodes in the dataset, as the authors also note. If most $R_{(n,u,u)}$ relations are between labeled and unlabeled normal nodes, distancing these pairs may not meaningfully enhance model training. At the same time, if there are very few $R_{(n,u,u)}$ relations involving labeled normal nodes and unlabeled unseen anomalies, the regularization term may have minimal impact on detecting unseen anomalies. I suggest that the authors conduct an empirical analysis on the distribution of different types of relations within the sampled $R_{(n,u,u)}$ set and discuss how this distribution affects the regularization term's effectiveness.

3. In Eq. (3), the meaning of symbols $\cdot$ and $\circ$ are unclear. Also, in Eq. (2) and (5), the supervised training loss should sum over all training nodes, not the entire node set $V$.

4. Could the authors provide justifications for updating the three components $\eta$, $F$ and $E$, and $\phi$ separately as stated in the pseudo-code?

5. In the Yelp dataset, NSReg displays less sensitivity to the hyper-parameter $\lambda$ compared to other datasets (such as Photo, Computers, and CS). Could the authors provide an explanation for this? Additionally, G. SMOTE performs better on unseen anomalies for this dataset, as shown in Table 1. An explanation for this would also be necessary.

6. The source code for this work is not provided for review.

[1]: Label information enhanced fraud detection against low homophily in graphs. WWW. 2023.

[2]: Consistency training with learnable data augmentation for graph anomaly detection with limited supervision. ICLR. 2024.

[3]: Partitioning message passing for graph fraud detection. ICLR. 2024.

---

confidence: 4
contribution: 2
initial_rating: 3
presentation: 1
questions: 1. Aegis (Inductive anomaly detection on attributed networks) is an unsupervised graph anomaly detection using GAN to strengthen the generalization ability of the model. The authors should discuss how their method compares with this work.
2. Line 271, why is the $aplha$ set to 0.8? What is the significance of this value? The author should discuss this in detail and provide some experiment results to support this choice.
3. Figure 3 is hard to understand.
soundness: 2
strengths: 1. The problem studied in the paper is interesting. Due to the lack of prior knowledge, unsupervised graph anomaly detection often suffers from high error rates. The authors focus on learning normality to enhance the model's ability to detect unseen anomalies, potentially improving the performance of existing methods in this area.
2.  The Plug-and-Play design is a notable strength, as it allows the method to be easily integrated into existing frameworks and applied to various scenarios.
3. The experiments conducted are comprehensive, covering the performance on all anomalies and unseen anomalies, ablation study, and the performance as a plug module, which evaluates the proposed method's effectiveness well.
summary: The paper studied the unsupervised graph anomaly detection problem under the lack of prior knowledge setting. In particular, it proposes an approach focusing on learning normality using supervised signals to distinguish unseen anomalies from normal nodes. The proposed method, NSReg, models three types of normal-node-oriented relations as a discriminative task, enhancing representation learning with enriched normality semantics. The authors argue that this approach effectively disentangles unseen anomalous nodes from normal nodes in the representation space. The paper also discusses the plug-and-play design of the method, which allows for its application in various scenarios.
weaknesses: 1. There are some unsupervised graph anomaly detection works that achieve considerable inductive performance. The author did not point out why these methods cannot meet the requirements. There should be a more thorough comparison of these existing methods and an analysis of the deeper reasons behind them.
2. The description of the proposed method did not clarify the innovation of this paper. One innovation of this paper is the focus on learning normality on structure. This differentiates this work from existing one-class classification/anomaly detection methods, but this point is unclear.
3. The presentation of the paper needs to be improved.

---

confidence: 3
contribution: 2
initial_rating: 3
presentation: 1
questions: 1. What does "connected normal nodes, unconnected normal nodes, and unconnected normal nodes to unlabelled nodes" mean? It would be best to illustrate these relationships with a diagram.
2. What does the calculation symbol "$\circ$" represent in the paper?
3. In line 241, what do "these two types of relations" refer to? Are they the two types described in line 232: "the relations between only the normal nodes and the relations between normal and anomaly nodes"? Why does the relationship description in line 2—“connected normal nodes, unconnected normal nodes, and unconnected normal nodes to unlabelled nodes”—not use the same phrasing? Are there actually distinctions between them?
4. In line 238, what is the specific operation when it states, “If Z is shared with a discriminative graph anomaly detector”?
5. The equations in lines 267-269 are not labelled and should correspond to Equation 3. How is alpha determined, and why is it set to 0.8?
6. In Figure 2, is the "shared representation space" represented by the grey rectangle with dashed lines? The arrows inside have three different styles, but the authors only labelled two of them.
7. In line 277, why is g considered a mapping and how is it discriminative?
8. What is the relationship between the equation in line 282 and g? Is this equation equivalent to $g_C$?
9. How does the paper address the prediction of unseen nodes, and how does it identify unseen nodes?
soundness: 3
strengths: 1. The experiments are comprehensive and yield strong results.
2. The paper provides some theoretical proofs.
3. It introduces a novel open-set approach to Graph Anomaly Detection (GAD).
summary: This paper presents a novel open-set Graph Anomaly Detection (GAD) approach called Normal Structure Regularization (NSReg). The method aims to achieve generalized detection capabilities for unseen anomalies while retaining effectiveness in identifying known anomalies. It introduces a regularization term that encourages the learning of compact, semantically rich representations of normal nodes, informed by their structural relationships with other nodes. Extensive empirical evaluations on seven real-world datasets demonstrate that NSReg significantly outperforms state-of-the-art competing methods.
weaknesses: 1. The paper's structure is disorganized, and the context of the paragraph is stiff. For instance, the three types of 'Normal-node-oriented Relations' are not clearly explained. Additionally, in lines 225-228, the authors mention analyzing the effects of enforcing structural normality in the representation space and its advantages for enhancing generalization to unseen anomalies. However, it is difficult to connect this to the later explanations, and the concept of structural normality even is not defined.
2. The wording in the paper is imprecise. For example, in the caption of Figure 2, the term "The green teal dashed box" does not clearly indicate which part of the figure it corresponds to. Furthermore, it is unclear whether "a discriminative graph anomaly detector" refers to "a graph anomaly detector with a discriminator," as the term "detector" itself implies a discriminative function.
3. The paper does not provide information about the hardware used for running experiments, nor does it include the experimental code and datasets. This raises concerns about the reproducibility of the results.

---

confidence: 4
contribution: 2
initial_rating: 5
presentation: 3
questions: Q1. Can the authors explain the differences between open-set GAD and out-of-distribution detection? 

Reference
1. Qitian Wu, Yiting Chen, Chenxiao Yang, Junchi Yan. Energy-based Out-of-Distribution Detection for Graph Neural Networks. ICLR 2023. 
2. Zheng Gong, Ying Sun. An Energy-centric Framework for Category-free Out-of-distribution Node Detection in Graphs. KDD 2024. 
3. Xixun Lin, Wenxiao Zhang, Fengzhao Shi, Chuan Zhou, Lixin Zou, Xiangyu Zhao, Dawei Yin, Shirui Pan, Yanan Cao. Graph Neural Stochastic Diffusion for Estimating Uncertainty in Node Classification. ICML 2024. 
4. Jianheng Tang, Fengrui Hua, Ziqi Gao, Peilin Zhao, Jia Li. GADBench: Revisiting and Benchmarking Supervised Graph Anomaly Detection. NeurIPS 2023. 
5. Nan Chen, Zemin Liu, Bryan Hooi, Bingsheng He, Rizal Fathony, Jun Hu, Jia Chen. Consistency Training with Learnable Data Augmentation for Graph Anomaly Detection with Limited Supervision. ICLR 2024.
soundness: 2
strengths: S1. The authors introduce a method called Normal Structure Regularisation (NSReg) to regularize the learning process by focusing on the structural relationships among normal nodes in the graph.

S2. Experiments show that the framework outperforms baselines on datasets included in this paper.
summary: The paper proposes an approach for open-set graph anomaly detection. The authors introduce a method called Normal Structure Regularisation (NSReg) to regularize the learning process by focusing on the structural relationships among normal nodes in the graph. Experiments show that the framework outperforms baselines on datasets included in this paper.
weaknesses: W1. The contribution seems to be overclaimed. As stated in this paper, open-set GAD is an under-explored problem. However, the definition of open-set GAD problem is very similar to that of out-of-distribution detection, and there are several previous works in this area, such as GNNSAFE[1], EnergyDef[2], and GNSD[3]. 

W2. Experiments are not comprehensive enough. As for the supervised GAD model, there are several new baselines, such as XGBGraph[4], and CONSISGAD[5]. The authors should include them as baselines as well. Besides, as mentioned above in W1, such a task is almost the same as the out-of-distribution problem, which means the authors need to compare their framework with out-of-distribution models on out-of-distribution datasets, instead of creating synthetic datasets from T-Finance. 

W3. Some parts of the paper need to be further explained. For example, in Section 3.3, Normal-node-oriented Relation Generation, the authors set alpha = 0.8 by default but did not provide any intuition or theoretical analysis of such a value.

Meta-review: This paper focuses on training a detection model using a small number of normal and anomaly nodes to detect both seen anomalies and unseen anomalies and enhancing the generalization for both seen and unseen anomaly nodes. It introduces a regularizer to enforce the learning of compact, semantically-rich representations of normal nodes, and differentiates the labelled normal nodes that are connected in their local neighborhood from those that are not.  The regularizer incorporates strong normality into the modelling and avoids overfitting the seen anomalies.  The proposed method is a plug-and-play module and can be integrated as a plugin module into multiple supervised graph anomaly detection learning approaches to enhance the generalizability to unseen anomalies. Experimental results on several datasets and metrices demonstrate the effectiveness. 


After rebuttal, one out of four reviewers still holds negative score. Reviewer VYmz thinks there should be a more thorough comparison of existing methods and an analysis of the deeper reasons behind them as well as a detailed innovation description. The parameter setting is also not discussed. Reviewer KzVj has some reservations about the reproducibility. Reviewer uvQ4 has concerns about the datasets. 
Reviewer JRAN raises its scores to 6.  After reading the rebuttal, I think these issues are cleared to some extent. For example, 
about the comparison with existing methods, the authors employ 8 supervised methods and 4 unsupervised methods, as shown in Table 1 of the manuscript. The analysis is provided in Section 4.1 and C.1.  The innovation description is emphasized in General Rebuttal. The hyper-parameter analysis is newly added in Section C.6.   The concerns about the datasets, reproducibility and presentation, I think the authors can further clear these minor issues in the next version.  Based on these, I tend to vote (borderline) acceptance.

Decision: Accept (Poster)