USAD - UnSupervised Anomaly Detection on multivariate time series

Related tags

Deep Learning usad
Overview

USAD - UnSupervised Anomaly Detection on multivariate time series

Scripts and utility programs for implementing the USAD architecture.

Implementation by: Francesco Galati.

Additional contributions: Julien Audibert, Maria A. Zuluaga.

How to cite

If you use this software, please cite the following paper as appropriate:

Audibert, J., Michiardi, P., Guyard, F., Marti, S., Zuluaga, M. A. (2020).
USAD : UnSupervised Anomaly Detection on multivariate time series.
Proceedings of the 26th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, August 23-27, 2020

Requirements

  • PyTorch 1.6.0
  • CUDA 10.1 (to allow use of GPU, not compulsory)

Running the Software

All the python classes and functions strictly needed to implement the USAD architecture can be found in usad.py. An example of an application deployed with the SWaT dataset is included in USAD.ipynb.

Copyright and licensing

Copyright 2020 Eurecom.

This software is released under the BSD-3 license. Please see the license file_ for details.

Publication

Audibert et al. USAD : UnSupervised Anomaly Detection on multivariate time series. 2020

Comments
  • Question about the Loss functions (L2 norm?)

    Question about the Loss functions (L2 norm?)

    Hello. May I ask about the loss functions inside the training_step? The paper states that ||x||2 denotes L2 Norm. As I understand, L2 norm is the "square root of sum of squares of elements inside x". However, the loss of the training step seems to be using MSE (mean((batch-w3)**2) etc). Was this a change from the paper or did I not understand L2 norm correctly? Thanks in advance!

    opened by htakatsuka 2
  • execution class error

    execution class error

    Thank you for your git project.

    I run the code but the execution error is occured. Could you help me?


    PS D:\deep_learning\anomaly_detection> python main.py --model USAD --action train C:\miniconda3\envs\yolov5\lib\site-packages\statsmodels\tools_testing.py:19: FutureWarning: pandas.util.testing is deprecated. Use the fun ctions in the public API at pandas.testing instead. import pandas.util.testing as tm D:\deep_learning\anomaly_detection\dataPreprocessing.py:111: DtypeWarning: Columns (6,26,28,36,38,39,40,45,46,47) have mixed types.Specify dtype option on import or set low_memory=False. origin_normal, origin_attack, labels = self.SWAT_loadData(normal_data_path, attack_data_path) normal data.shape (495000, 51) #####data info######## number of anomaly : 54621 number of normal : 395298 ################
    windows_normal.shape (494989, 12, 51) window_attack.shape (449908, 12, 51) w_size 612
    z_size 480
    self.train_loader <torch.utils.data.dataloader.DataLoader object at 0x00000156D30B19C8>
    self.val_loader <torch.utils.data.dataloader.DataLoader object at 0x000001568A74FC08>
    Traceback (most recent call last): File "main.py", line 154, in
    executionObj.train(args.model) File "main.py", line 91, in train
    history = self.model.training_all(self, n_epochs, self.train_loader, self.val_loader) File "D:\deep_learning\anomaly_detection\model.py", line 197, in training_all for epoch in range(epochs):
    TypeError: 'execution' object cannot be interpreted as an integer

    opened by leejunghan 0
  • Threshold Definition

    Threshold Definition

    Hi @manigalati , I am wondering how did you implement the threshold as AUC score? Isn't the AUC score is the kinda accuracy of the model. If you check the maximum value of y_pred, it is lower than the AUC score thus In the paper, they don't explain how did they set the threshold.

    opened by ServetKocak 3
  • Fix memory usage during model validation

    Fix memory usage during model validation

    What was the problem: I couldn't train the model on my laptop with 4GB of VRAM.

    What I have done: I disabled gradient calculation during model validation (gradients were stored in VRAM). Now, training full model as is (USAD.ipynb) takes about 1.8 GB of VRAM.

    This PR should fix #6 .

    opened by finloop 0
  • RuntimeError: CUDA out of memory.

    RuntimeError: CUDA out of memory.

    I run this USAD.ipynb in jupyter-notebook.

    train is ok. test is error. error message is below.

    RuntimeError: CUDA out of memory. Tried to allocate 38.00 MiB (GPU 0; 10.76 GiB total capacity; 8.95 GiB already allocated; 17.06 MiB free; 9.61 GiB reserved in total by PyTorch)

    =================================

    How should I change the Parameter to solve this problem?

    my gpu is GPU 0: GeForce RTX 2080 Ti, GPU 1: GeForce RTX 2080 Ti

    Thank you.

    opened by hongym7 2
  • Question about the parameters

    Question about the parameters

    Hello, can I ask why you set the batch_size=7919, and whether the z_size means latent space or not? Did you use the down-sampling rate mentioned in the article USAD? Thanks for your answer.

    opened by JinchuanZ 27
  • Website visit 404

    Website visit 404

    Hello, dear author, in usad.ipybn [12] WGet in file https://raw.githubusercontent.com/matthuisman/files.matthuisman.nz/master/gdrivedl . I can't find the website in https://raw.githubusercontent.com/matthuisman/files.matthuisman.nz/master/gdrivedl Website visit 404

    opened by JunShengB 0
Owner
null
Spectral Temporal Graph Neural Network (StemGNN in short) for Multivariate Time-series Forecasting

Spectral Temporal Graph Neural Network for Multivariate Time-series Forecasting This repository is the official implementation of Spectral Temporal Gr

Microsoft 306 Dec 29, 2022
Ian Covert 130 Jan 1, 2023
Code for the CIKM 2019 paper "DSANet: Dual Self-Attention Network for Multivariate Time Series Forecasting".

Dual Self-Attention Network for Multivariate Time Series Forecasting 20.10.26 Update: Due to the difficulty of installation and code maintenance cause

Kyon Huang 223 Dec 16, 2022
Library for implementing reservoir computing models (echo state networks) for multivariate time series classification and clustering.

Framework overview This library allows to quickly implement different architectures based on Reservoir Computing (the family of approaches popularized

Filippo Bianchi 249 Dec 21, 2022
The source code and data of the paper "Instance-wise Graph-based Framework for Multivariate Time Series Forecasting".

IGMTF The source code and data of the paper "Instance-wise Graph-based Framework for Multivariate Time Series Forecasting". Requirements The framework

Wentao Xu 24 Dec 5, 2022
Multivariate Time Series Forecasting with efficient Transformers. Code for the paper "Long-Range Transformers for Dynamic Spatiotemporal Forecasting."

Spacetimeformer Multivariate Forecasting This repository contains the code for the paper, "Long-Range Transformers for Dynamic Spatiotemporal Forecast

QData 440 Jan 2, 2023
This repo contains the code required to train the multivariate time-series Transformer.

Multi-Variate Time-Series Transformer This repo contains the code required to train the multivariate time-series Transformer. Download the data The No

Gregory Duthé 4 Nov 24, 2022
Official PyTorch code for WACV 2022 paper "CFLOW-AD: Real-Time Unsupervised Anomaly Detection with Localization via Conditional Normalizing Flows"

CFLOW-AD: Real-Time Unsupervised Anomaly Detection with Localization via Conditional Normalizing Flows WACV 2022 preprint:https://arxiv.org/abs/2107.1

Denis 156 Dec 28, 2022
Code for the paper "TadGAN: Time Series Anomaly Detection Using Generative Adversarial Networks"

TadGAN: Time Series Anomaly Detection Using Generative Adversarial Networks This is a Python3 / Pytorch implementation of TadGAN paper. The associated

Arun 92 Dec 3, 2022
Time-series-deep-learning - Developing Deep learning LSTM, BiLSTM models, and NeuralProphet for multi-step time-series forecasting of stock price.

Stock Price Prediction Using Deep Learning Univariate Time Series Predicting stock price using historical data of a company using Neural networks for

Abdultawwab Safarji 7 Nov 27, 2022
This is an unofficial implementation of the paper “Student-Teacher Feature Pyramid Matching for Unsupervised Anomaly Detection”.

This is an unofficial implementation of the paper “Student-Teacher Feature Pyramid Matching for Unsupervised Anomaly Detection”.

haifeng xia 32 Oct 26, 2022
MvtecAD unsupervised Anomaly Detection

MvtecAD unsupervised Anomaly Detection This respository is the unofficial implementations of DFR: Deep Feature Reconstruction for Unsupervised Anomaly

null 0 Feb 25, 2022
Demo project for real time anomaly detection using kafka and python

kafkaml-anomaly-detection Project for real time anomaly detection using kafka and python It's assumed that zookeeper and kafka are running in the loca

Rodrigo Arenas 36 Dec 12, 2022
(JMLR'19) A Python Toolbox for Scalable Outlier Detection (Anomaly Detection)

Python Outlier Detection (PyOD) Deployment & Documentation & Stats Build Status & Coverage & Maintainability & License PyOD is a comprehensive and sca

Yue Zhao 6.6k Jan 3, 2023
Streaming Anomaly Detection Framework in Python (Outlier Detection for Streaming Data)

Python Streaming Anomaly Detection (PySAD) PySAD is an open-source python framework for anomaly detection on streaming multivariate data. Documentatio

Selim Firat Yilmaz 181 Dec 18, 2022
A Python Library for Graph Outlier Detection (Anomaly Detection)

PyGOD is a Python library for graph outlier detection (anomaly detection). This exciting yet challenging field has many key applications, e.g., detect

PyGOD Team 757 Jan 4, 2023
Multivariate Boosted TRee

Multivariate Boosted TRee What is MBTR MBTR is a python package for multivariate boosted tree regressors trained in parameter space. The package can h

SUPSI-DACD-ISAAC 61 Dec 19, 2022
Real-world Anomaly Detection in Surveillance Videos- pytorch Re-implementation

Real world Anomaly Detection in Surveillance Videos : Pytorch RE-Implementation This repository is a re-implementation of "Real-world Anomaly Detectio

seominseok 62 Dec 8, 2022
Paper list of log-based anomaly detection

Paper list of log-based anomaly detection

Weibin Meng 411 Dec 5, 2022