mala-lab/AnomalyGFM
Official PyTorch implementation of KDD2025 paper "AnomalyGFM: Graph Foundation Model for Zero/Few-shot Anomaly Detection"
About mala-lab/AnomalyGFM
mala-lab/AnomalyGFM is an open-source project on GitHub, mainly written in Python. Official PyTorch implementation of KDD2025 paper "AnomalyGFM: Graph Foundation Model for Zero/Few-shot Anomaly Detection" It currently holds 55 stars and 4 forks with 0 open issues, and was last pushed on an unknown date (repository created unknown).
Project Overview
AI Homed tracks it on the AI Prompt Engineering board.
GitHub Repository Details
README
Promotional Video
📢 We are excited to share that our paper presentation video is now available on YouTube!
🎬 Watch it here: [YouTube Link]
📌 Your feedback and support are greatly appreciated!
Main Contributions
1️⃣ AnomalyGFM is the first GAD-oriented GFM with strong zero-shot and few-shot generalization abilities.
2️⃣ AnomalyGFM is pre-trained to learn discriminative, graph-agnostic class prototypes with normal and abnormal residual features, and it supports few-shot graph prompt tuning for better adaptation.
3️⃣ A comprehensive benchmark on both zero-shot and few-shot settings using 11 real-world GAD datasets is established, on which i) AnomalyGFM performs significantlybetter the state-of-the-art unsupervised, supervised, and generalist GAD methods, and ii) AnomalyGFM can scale up to very large graphs
The GAD datasets after feature alignment can be obtained from google drive link.
Requirements
To install requirements:
pip install -r requirements.txt
Training and Zero-shot Inference
To run the model(s), run this command:
python run_abnormal.py
Training and Few-shot Inference
Run this command:
python run_finetune_normal.py
For few-shot labeled normal nodes fine-tuning.
Run this command:
python run_finetune_abnormal.py
for few-shot labeled abnormal nodes fine-tuning.
Large-scale Graph Generalization
Run this command:
python run_inference.py
Citation
If you find this repo useful, please cite our paper.@inproceedings{qiao2025anomalygfm,
title={AnomalyGFM: Graph foundation model for zero/few-shot anomaly detection},
author={Qiao, Hezhe and Niu, Chaoxi and Chen, Ling and Pang, Guansong},
booktitle={Proceedings of the 31st ACM SIGKDD Conference on Knowledge Discovery and Data Mining V. 2},
pages={2326--2337},
year={2025}
}