Code Monkey home page Code Monkey logo

lunar's Introduction

LUNAR

Official Implementation of "LUNAR: Unifying Local Outlier Detection Methods via Graph Neural Networks", Adam Goodge, Bryan Hooi, Ng See Kiong and Ng Wee Siong (AAAI2022)

Many well-established anomaly detection methods use the distance of a sample to those in its local neighbourhood: so-called `local outlier methods', such as LOF and DBSCAN. They are popular for their simple principles and strong performance on unstructured, feature-based data that is commonplace in many practical applications. However, they cannot learn to adapt for a particular set of data due to their lack of trainable parameters. In this paper, we begin by unifying local outlier methods by showing that they are particular cases of the more general message passing framework used in graph neural networks. This allows us to introduce learnability into local outlier methods, in the form of a neural network, for greater flexibility and expressivity: specifically, we propose LUNAR, a novel, graph neural network-based anomaly detection method. LUNAR learns to use information from the nearest neighbours of each node in a trainable way to find anomalies. We show that our method performs significantly better than existing local outlier methods, as well as state-of-the-art deep baselines. We also show that the performance of our method is much more robust to different settings of the local neighbourhood size.


News: LUNAR has been implemented in the anomaly detection benchmark library PyOD.

Files

  • main.py
  • variables.py : hyperparameters
  • utils.py : functions for loading datasets, pre-processing, graph construction, negative-sampling
  • LUNAR.py : GNN model and training procedure
  • requirements.txt : packages for virtualenv
  • data.zip : files for the HRSS dataset
  • saved_models.zip : pretrained LUNAR models for HRSS with neighbour count k = 100 and "Mixed" negative sampling

Data

Experiments

Datasets can be extracted from data.zip

To replicate the results on the HRSS dataset with neighbour count k = 100 and "Mixed" negative samples

  • Extract saved_models.zip
  • Run:
python3 main.py --dataset HRSS --samples MIXED --k 100

To train a new model:

  • Run:
python3 main.py --dataset HRSS --samples MIXED --k 100 --train_new_model

Citation

@inproceedings{goodge2022lunar,
  title={LUNAR: Unifying Local Outlier Detection Methods via Graph Neural Networks},
  author={Goodge, Adam and Hooi, Bryan and Ng, See Kiong and Ng, Wee Siong},
  journal={AAAI Conference on Artificial Intelligence (AAAI)},
  year={2022}
}

lunar's People

Contributors

agoodge avatar

Watchers

 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.