Skip to main content

SAGOD : Static Attributed Graph Outlier Detection

Project description

SAGOD:Static Attributed Graph Outlier Detection

中文README : cnREADME.md.

SAGOD (Static Attributed Graph Outlier Detection) is an implementation of anomaly detection models on static attributed graph. Inspierd by PyOD and PyGOD, we designed convenient interface to train model and make prediction. SAGOD support the following models:

  • AdONE : Adversarial Outlier Aware Network Embedding;
  • ALARM : A deep multi-view framework for anomaly detection;
  • ANOMALOUS : A Joint Modeling Approach for Anomaly Detection on Attributed Networks;
  • AnomalyDAE : Anomaly Detection through a Dual Autoencoder;
  • ComGA : Community-Aware Attributed Graph Anomaly Detection;
  • DeepAE : Anomaly Detection with Deep Graph Autoencoders on Attributed Networks.
  • DOMINANT : Deep Anomaly Detection on Attributed Networks;
  • DONE : Deep Outlier Aware Network Embedding;
  • GAAN : Generative Adversarial Attributed Network;
  • OCGNN : One-Class GNN;
  • ONE : Outlier Aware Network Embedding;
  • Radar : Residual Analysis for Anomaly Detection in Attributed Networks.
  • ResGCN : Residual Graph Convolutional Network.
  • SADAG : Semi-supervised Anomaly Detection on Attributed Graphs.

We are still updating and adding models. It's worth nothing that the original purpose of SAGOD is to implement anomaly detection models on graph, in order to help researchers who are interested in this area (including me).

Overview

In test.py, we generate anomaly data from MUTAG, and use different models to train it. The ROC curve is shown below:

eval

Install

pip3 install sagod

or

git clone https://github.com/Kaslanarian/SAGOD
cd SAGOD
python3 setup.py install

Example

Here is an example to use SAGOD:

from sagod.models import DOMINANT
from sagod.utils import struct_ano_injection, attr_ano_injection

data = ... # Graph data, type:torch_geometric.data.Data
data.y = torch.zeros(data.num_nodes)
data = struct_ano_injection(data, 10, 10) # Structrual anomaly injection.
data = attr_ano_injection(data, 100, 50) # Attributed anmaly injection.

model = DOMINANT(verbose=True).fit(data, data.y)
fpr, tpr, _ = roc_curve(data.y.numpy(), model.decision_scores_)[:2]  
plt.plot(fpr, tpr, label='DOMINANT') # plot ROC curve
plt.legend()
plt.show()

Highlight

Though SAGOD is similar to PyGOD, we keep innovating and improving:

  • The model "ONE" in PyGOD was implemented based on authors' responsitory. We improved it with vectorization, achieving a 100% performance improvement;
  • We implemented ALARM, which can detect anomaly in multi-view graph;
  • We implemented more models including ComGA, DeepAE, etc, which is not included in PyGOD;
  • ...

Future Plan

  • Support batch mechanism and huge graph input;
  • Support GPU;
  • More models implementation;
  • ...

Reference

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sagod-0.0.3.tar.gz (19.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sagod-0.0.3-py3-none-any.whl (33.7 kB view details)

Uploaded Python 3

File details

Details for the file sagod-0.0.3.tar.gz.

File metadata

  • Download URL: sagod-0.0.3.tar.gz
  • Upload date:
  • Size: 19.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.8

File hashes

Hashes for sagod-0.0.3.tar.gz
Algorithm Hash digest
SHA256 4863ae7189be8b30b2c80bf1b893dc83e9fdcee14d396fbe2305ffeef1c39589
MD5 1a3d59a7fd89403d428320ec5b57e6c7
BLAKE2b-256 79eca85aed4c3e83f245bfaf065c6a2205d7cc69019942c36cfa4eb235043abb

See more details on using hashes here.

File details

Details for the file sagod-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: sagod-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 33.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.8

File hashes

Hashes for sagod-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 85fc153db9eebfd32b40cfef1f6e2ca27a55a58f5549adc040b8789cf532de15
MD5 98aac4583ea2703bf00878e7fa4195ab
BLAKE2b-256 bfcc2f8c700101577f03bdad779a35118448b36f11876d9692eee0cadacdfddf

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page