Code Monkey home page Code Monkey logo

anomaly_detection_mthl's Introduction

Anomaly_Detection_MTHL

MTHL (Multi-view Time-Series Hypersphere Learning) is a new algorithm for detecting anomalous patterns from dynamic and multi-attributed networks. It has been shown to have superior performance compared to existing methods. Here is the python code that implements the algorithm described in the following paper:

Anomaly Detection in Dynamic Networks Using Multi-View Time-Series Hypersphere Learning, CIKM 2017

Abstract

Detecting anomalous patterns from dynamic and multi-attributed network systems has been a challenging problem due to the complication of temporal dynamics and the variations reflected in multiple data sources. We propose a Multi-view Time-Series Hypersphere Learning (MTHL) approach that leverages multi-view learning and support vector description to tackle this problem. Given a dynamic network with time-varying edge and node properties, MTHL projects multi-view time-series data into a shared latent subspace, and then learns a compact hypersphere surrounding normal samples with soft constraints. The learned hypersphere allows for effectively distinguishing normal and abnormal cases. We further propose an efficient, two-stage alternating optimization algorithm as a solution to the MTHL. Extensive experiments are conducted on both synthetic and real datasets. Results demonstrate that our method outperforms the state-of-the-art baseline methods in detecting three types of events that involve (i) time-varying features alone, (ii) time-aggregated features alone, as well as (iii) both features. Moreover, our approach exhibits consistent and good performance in face of issues including noises, anomaly pollution in training phase and data imbalance.

Dependency (packages)

cPickle, numpy, time, sklearn, math

Parameters

p: the reduced dimensionality for feature

q: the reduced dimensionality for timesteps

lambda1: tradeoff parameter for anomaly pollution in hypersphere learning item

lambda2: tradeoff parameter for the temporal smoothing item

gamma: update step

s: the time window parameter to guarantee temporal smoothing

convergence: convergence tolerance

tolerance: anomaly tolerance, e.g. only if a data point meets d^2 >= r^2*(1+tolerance) we can say it is anomalous

Usage

"train.pkl" and "test.pkl" are two example datasets, which contains both data and ground truth labels (for evaluation). To run MTHL algorithm on them, please try:

python main.py

Citation

If you make use of this code, please kindly cite our paper:

Teng, X., Lin, Y.-R., Wen, X. (2017). "Anomaly Detection in Dynamic Networks using Multi-view Time-Series Hypersphere Learning." In Proceedings of the 26th ACM International Conference on Information and Knowledge Management (CIKM 2017) https://doi.org/10.1145/3132847.3132964

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.