GAD-NR: Graph Anomaly Detection via Neighborhood Reconstruction

Amit Roy, Juan Shu, Jia Li, Carl Yang, Olivier Elshocht, Jeroen Smeets, Pan Li · DOI · OpenReview

Abstract

Graph Anomaly Detection (GAD) is a technique used to identify abnormal nodes within graphs, finding applications in network security, fraud detection, social media spam detection, and various other domains. A common method for GAD is Graph Auto-Encoders (GAEs), which encode graph data into node representations and identify anomalies by assessing the reconstruction quality of the graphs based on these representations. However, existing GAE models are primarily optimized for direct link reconstruction, resulting in nodes connected in the graph being clustered in the latent space. As a result, they excel at detecting cluster-type structural anomalies but struggle with more complex structural anomalies that do not conform to clusters. To address this limitation, we propose a novel solution called GAD-NR, a new variant of GAE that incorporates neighborhood reconstruction for graph anomaly detection. GAD-NR aims to reconstruct the entire neighborhood of a node, encompassing the local structure, self-attributes, and neighbor attributes, based on the corresponding node representation. By comparing the neighborhood reconstruction loss between anomalous nodes and normal nodes, GAD-NR can effectively detect any anomalies. Extensive experimentation conducted on six real-world datasets validates the effectiveness of GAD-NR, showcasing significant improvements (by up to 30% in AUC) over state-of-the-art competitors. The source code for GAD-NR is openly available. Importantly, the comparative analysis reveals that the existing methods perform well only in detecting one or two types of anomalies out of the three types studied. In contrast, GAD-NR excels at detecting all three types of anomalies across the datasets, demonstrating its comprehensive anomaly detection capabilities.

Introduction: The Challenge of Graph Anomalies

Graph Anomaly Detection (GAD) is critical for spotting fraudsters in financial networks or spammers on social media. Generally, anomalies fall into three distinct categories:

  1. Contextual: A node whose attributes are anomalous relative to its neighbors (e.g., a user posting in a language they don't speak).
  2. Structural: A node with an unusual connection pattern (e.g., a "review farm" where a group of bots are all densely connected to each other).
  3. Joint-type: A node that appears normal in isolation but is suspicious because of who it connects to (e.g., a phishing bot connecting to many unrelated, diverse communities).
Illustration of normal graph structure versus structural, contextual, and joint-type anomalies.

Most existing Graph Auto-Encoders focus on direct link reconstruction. They try to compress a graph and then see if they can predict which nodes are connected. While this is effective for finding dense structural clusters, it often fails to catch joint-type anomalies. Because these models are optimized to push connected nodes closer together in latent space, they can actually "smooth over" the very signals that indicate an anomaly.

Methodology: Neighborhood Reconstruction

The authors propose GAD-NR (Graph Anomaly Detection via Neighborhood Reconstruction). The core idea is that a node's representation should be a compressed summary of its entire "receptive field." If a node is "normal," the decoder should be able to "unpack" that summary to recreate its local environment. If it cannot, the node is likely an anomaly.

The GAD-NR Architecture

The framework consists of an encoder and a specialized "Triple-Threat Decoder":

  • The Encoder: A standard Graph Neural Network (like GCN or GraphSAGE) that compresses node features and graph structure into a low-dimensional embedding.
  • The Decoder: Instead of just predicting edges, the decoder performs three tasks:
  • Self-Feature Reconstruction: Predicts the node’s own original attributes.
  • Degree Reconstruction: Predicts the number of neighbors the node has.
  • Neighborhood Distribution Reconstruction: This is the "secret sauce." Instead of trying to predict every neighbor individually, GAD-NR assumes the neighbors' features follow a Gaussian distribution. The decoder predicts the mean and covariance of this distribution, using KL-Divergence as a loss metric.

Experimental Evaluation

The model was evaluated on six diverse real-world datasets: Cora, Weibo, Reddit, Disney, Books, and Enron. The authors utilized the BOND benchmark and the PyGOD library to ensure fair comparisons against 14 baseline models, including popular ones like DOMINANT and AnomalyDAE.

Key Results

  • Superior Performance: GAD-NR outperformed all 14 baselines on five out of six datasets. In some cases, like the "Books" dataset, it improved the AUC by a massive 30%.
  • Comprehensive Detection: While feature-based models catch contextual anomalies and structure-based models catch structural ones, GAD-NR was the only model to consistently excel at all three types, including the elusive joint-type anomalies.
  • Efficiency: Compared to its predecessor NWR-GAE, GAD-NR is significantly faster. By shifting to a Gaussian approximation, it reduces complexity from $O(d^3)$ to $O(d)$, making it viable for large graphs while preventing overfitting to anomalous noise.

Discussion and Future Work

A key insight of this research is that knowing that an edge exists is less important for GAD than knowing what kind of node is at the other end of that edge. By reconstructing the distribution of neighbor features, GAD-NR captures the synergy between structure and attributes. Furthermore, the model's robustness is evidenced by its ability to outperform baselines across almost all datasets using a single, fixed hyperparameter configuration.

Future work may address the current Gaussian Assumption, as real-world neighbor distributions might be multi-modal. Additionally, while the current implementation focuses on the immediate (1-hop) neighborhood, extending neighborhood reconstruction to temporal, dynamic graphs remains an open challenge.

Summary updated

BibTeX
@inproceedings{roy2024gad,
  author = {Amit Roy and Juan Shu and Jia Li and Carl Yang and Olivier Elshocht and Jeroen Smeets and Pan Li},
  title = {{GAD-NR: Graph Anomaly Detection via Neighborhood Reconstruction}},
  booktitle = {WSDM},
  year = {2024},
  doi = {10.1145/3616855.3635767},
}
Figure