Using an LSTM (Long Short-Term Memory) algorithm on synthetic time series data for unsupervised anomaly detection. It uses the Mean Squared Error as a measure of outliers in this type of data.
Diagram of original signal, smoothed signal and anomaly detection via MSE.
- Install the Python dependencies (please use Python 3.6+).
pip install -r requirements.txt
- Run the program (creates its own synthetic data, creates an LSTM model, trains it and predicts with it).
python run.py
That's it!
Some TODO:
- Keras (TF backend)
- Estimates on real-world data (e.g. this Kaggle rain dataset)
- PyTorch port
Other Approaches:
- Finite state automaton with state transitions for time series data segmentation (Ref)
- One-class NN (Code)
- TBD
- https://github.com/aurotripathy/lstm-anomaly-detect
- https://github.com/Vict0rSch/deep_learning/tree/master/keras/recurrent
- http://simaaron.github.io/Estimating-rainfall-from-weather-radar-readings-using-recurrent-neural-networks/
- https://github.com/khundman/telemanom/tree/no-labels
This work is partially based upon the Telemanom project with code and information found at https://github.com/khundman/telemanom.
If you use this work, please cite:
title={Detecting Spacecraft Anomalies Using LSTMs and Nonparametric Dynamic Thresholding},
author={Hundman, Kyle and Constantinou, Valentino and Laporte, Christopher and Colwell, Ian and Soderstrom, Tom},
journal={arXiv preprint arXiv:1802.04431},
year={2018}
}