UniFORM: Towards Unified Framework for Anomaly Detection on Graphs

Chuancheng Song, Xixun Lin, Hanyang Shen, Yanmin Shang, Yanan Cao

Abstract

Graph Anomaly Detection (GAD) is a critical task in various domains, including finance and social media. However, existing methods often suffer from granularity isolation—focusing on either nodes, edges, or graphs—and label sparsity. This paper introduces UniFORM, a unified self-supervised framework presented at AAAI-25. UniFORM integrates node, edge, and graph-level anomaly detection into a single pipeline by combining energy-based Graph Neural Networks (GNNs) with a novel meta-learning approach. By generating "phantom" samples to sharpen decision boundaries, UniFORM effectively addresses the challenges of limited labeled data and fragmented detection granularities.

Introduction

In real-world graph data, anomalies are often interconnected across different scales. For instance, a fraudulent transaction (edge) might involve a suspicious user (node) as part of a larger criminal scheme (graph). Despite this inherent connection, traditional GAD models typically treat these granularities as isolated problems. This "granularity isolation" prevents models from capturing collective behaviors that span multiple levels.

Illustration of graph anomalies across node, edge, and graph levels.

Furthermore, the scarcity of labeled anomalous data makes it difficult to train robust supervised models. UniFORM addresses these issues by proposing a unified architecture that handles all three granularities simultaneously within a self-supervised learning paradigm.

Methodology: The UniFORM Framework

UniFORM consists of three primary modules: Unified Input and Output (UIO), Unified Meta-learning with Contrastive learning (UMC), and Unified Intra-Inter Perspective for Loss (UPL).

The UniFORM framework architecture, featuring the UIO, UMC, and UPL modules.

Unified Input and Output (UIO)

To bridge the gap between different granularities, UniFORM standardizes inputs using a dual subgraph sampling strategy. It employs ego-graphs to capture local node and edge contexts and random walks to represent broader graph-level structures. These subgraphs are processed by an energy-based GNN, where "energy" serves as a metric for anomaly detection: the model is trained to assign low energy to normal patterns and high energy to unusual ones.

Unified Meta-learning with Contrastive learning (UMC)

To overcome label sparsity, UniFORM utilizes a self-supervised meta-learning approach. A key innovation is the generation of "Phantom Samples" using Langevin Dynamics. These synthetic samples occupy the boundary regions between normal and anomalous distributions. By acting as mediators, they force the model to learn more precise decision boundaries, enhancing its ability to distinguish subtle anomalies without requiring extensive manual labeling.

Unified Intra-Inter Perspective for Loss (UPL)

The framework is optimized using a dual-perspective loss function:

  • Inter-level Loss: Employs contrastive learning to ensure the model can differentiate between various tasks and graph views.
  • Intra-level Loss: Focuses on the energy gap, specifically pushing down the energy scores of normal samples while increasing the energy of the generated phantom samples.

Experimental Evaluation

The researchers evaluated UniFORM across ten real-world datasets from research, social, and commercial domains (e.g., Cora, Flickr, Yelp, and IBM-AML).

Key Results

UniFORM consistently outperformed state-of-the-art (SOTA) models across all three granularities:

  • Node-Level: Improved AUC by up to 4.51% on the BlogCatalog dataset.
  • Edge-Level: Surpassed specialized models by up to 2.89%.
  • Graph-Level: Achieved a 4.27% performance jump on complex datasets like COLLAB and IBM-AML.

Ablation studies confirmed that the "phantom" samples generated via Langevin Dynamics are crucial for success in label-sparse environments, as removing the intra-level loss led to significant performance degradation.

Conclusion

UniFORM represents a significant step toward a holistic approach to graph anomaly detection. By treating subgraphs as a universal language and leveraging energy-based logic with synthetic phantom samples, it provides a robust, unified solution for multi-granularity detection. Future work will focus on extending the framework to heterogeneous graphs and improving the efficiency of the Langevin sampling process for massive, billion-scale networks.

This summary is based on the paper "UniFORM: Towards Unified Framework for Anomaly Detection on Graphs" presented at AAAI-25.

Summary updated

Abstract

Graph anomaly detection has attracted significant attention due to its critical applications, such as identifying money laundering in financial systems and detecting fake reviews on social networks. However, two major challenges persist: (1) anomaly detection at the node, edge, and graph levels is often addressed in isolation, hindering the integration of complementary information to identify anomalies arising from collective behaviors; and (2) the inherent label sparsity in graph data, coupled with the difficulty of obtaining high-quality annotations, exacerbates bias in detection. To address these challenges, we propose UniFORM, a unified self-supervised anomaly detection framework comprising two modules: UIO and UMC. UIO unifies node-, edge-, and graph-level tasks from a subgraph perspective, leveraging an energy-based GNN for iterative multi-granular anomaly detection. UMC enhances meta-learning through contrastive learning and employs Langevin dynamics to generate phantom samples as substitutes for anomalous data, reducing reliance on labeled data. Extensive experiments on real-world datasets demonstrate that UniFORM significantly outperforms state-of-the-art methods across multiple granularities.
BibTeX
@inproceedings{song2025uniform,
  author = {Chuancheng Song and Xixun Lin and Hanyang Shen and Yanmin Shang and Yanan Cao},
  title = {{UniFORM: Towards Unified Framework for Anomaly Detection on Graphs}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2025},
  doi = {10.1609/aaai.v39i12.33369},
}
Figure