GithubHelp home page GithubHelp logo

yzfxmu / sagod Goto Github PK

View Code? Open in Web Editor NEW

This project forked from kaslanarian/sagod

0.0 0.0 0.0 15.99 MB

A library for static attributed graph outlier detection. 静态属性图节点的异常检测模型集。

Python 100.00%

sagod's Introduction

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

sagod's People

Contributors

kaslanarian avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.