This repository contains code for the paper, MAD-GAN: Multivariate Anomaly Detection for Time Series Data with Generative Adversarial Networks, by Dan Li, Dacheng Chen, Jonathan Goh, and See-Kiong Ng.
MAD-GAN is a refined version of GAN-AD at Anomaly Detection with Generative Adversarial Networks for Multivariate Time Series The code can be found at https://github.com/LiDan456/GAN-AD
(We are still working on this topic, will upload the completed version later...)
We used generative adversarial networks (GANs) to do anomaly detection for time series data. The GAN framework was RGAN, whihc was taken from the paper, _Real-valued (Medical) Time Series Generation with Recurrent Conditional GANs. Please refer to https://github.com/ratschlab/RGAN for the original code.
-
Python3
-
Please unpack the data.7z file in the data folder before run RGAN.py and AD.py
-
To train the model:
$ python RGAN.py --settings_file kdd99
-
To do anomaly detection:
$ python AD.py --settings_file kdd99_test
We apply our method on the SWaT and WADI datasets in the paper, however, we didn't upload the data in this repository. Please refer to https://itrust.sutd.edu.sg/ and send request to iTrust is you want to try the data.
In this repository we used kdd cup 1999 dataset as an example (please unpack the data.7z file in the data folder before run RGAN.py and AD.py). You can also down load the original data at http://kdd.ics.uci.edu/databases/kddcup99/kddcup99.html