AnomalyGFM
Official PyTorch implementation of KDD2025 paper "AnomalyGFM: Graph Foundation Model for Zero/Few-shot Anomaly Detection"
Install / Use
/learn @mala-lab/AnomalyGFMREADME
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 significantly better 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}
}
Related Skills
node-connect
352.0kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
111.1kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
352.0kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
352.0kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
