PyGOD is a Python library for graph outlier detection (anomaly detection). This exciting yet challenging field has many key applications, e.g., detecting suspicious activities in social networks [DLS+20] and security systems [CCL+21].
PyGOD includes 10+ graph outlier detection algorithms. For consistency and accessibility, PyGOD is developed on top of PyTorch Geometric (PyG) and PyTorch, and follows the API design of PyOD. See examples below for detecting outliers with PyGOD in 5 lines!
PyGOD is featured for:
Unified APIs, detailed documentation, and interactive examples across various graph-based algorithms.
Comprehensive coverage of 10+ graph outlier detectors.
Full support of detections at multiple levels, such as node-, edge-, and graph-level tasks.
Scalable design for processing large graphs via mini-batch and sampling.
Streamline data processing with PyG–fully compatible with PyG data objects.
Outlier Detection Using PyGOD with 5 Lines of Code:
# train a dominant detector
from pygod.detector import DOMINANT
model = DOMINANT(num_layers=4, epoch=20) # hyperparameters can be set here
model.fit(train_data) # input data is a PyG data object
# get outlier scores on the training data (transductive setting)
score = model.decision_score_
# predict labels and scores on the testing data (inductive setting)
pred, score = model.predict(test_data, return_score=True)
Implemented Algorithms¶
Abbr |
Year |
Backbone |
Sampling |
Class |
---|---|---|---|---|
SCAN |
2007 |
Clustering |
No |
|
GAE |
2016 |
GNN+AE |
Yes |
|
Radar |
2017 |
MF |
No |
|
ANOMALOUS |
2018 |
MF |
No |
|
ONE |
2019 |
MF |
No |
|
DOMINANT |
2019 |
GNN+AE |
Yes |
|
DONE |
2020 |
MLP+AE |
Yes |
|
AdONE |
2020 |
MLP+AE |
Yes |
|
AnomalyDAE |
2020 |
GNN+AE |
Yes |
|
GAAN |
2020 |
GAN |
Yes |
|
DMGD |
2020 |
GNN+AE |
Yes |
|
OCGNN |
2021 |
GNN |
Yes |
|
CoLA |
2021 |
GNN+AE+SSL |
Yes |
|
GUIDE |
2021 |
GNN+AE |
Yes |
|
CONAD |
2022 |
GNN+AE+SSL |
Yes |
|
GADNR |
2024 |
GNN+AE |
Yes |