Hands-on Time Series Anomaly Detection using Autoencoders, with Python
Anomalous time series are a very serious business.
If you think about earthquakes, anomalies are the irregular seismic signals of sudden spikes or drops in data that hint that something bad is going on.
In financial data, everyone remembers the Wall Street Crush in 1929, and that was a clear example of a signal with anomaly in the financial domain. In engineering, signals with spikes can represent a reflection of an ultrasound to a wall or a person.
All these stories stem from a very well-defined problem:
If I have a bank of normal signals, and a new signal comes in, how can I detect if that signal is anomalous or not?
Note that this problem is slightly different than the problem of detecting the anomaly in a given signal (which is also a well-known problem to solve). In this case, we assume that we get a whole new signal and we want to know if the signal is sufficiently different than the ones that are considered "normal" in our datasets.
So how would you approach a problem like that?
The powerful Neural Networks give us a solution for the problem, and this solution has been around since 2016. Implementing a Neural Network per se is now a fairly easy game, but understanding how to use NNs for Anomaly Detection can get a little tricky.
The scope of this blog post is to guide the reader towards the idea of anomaly detection with Neural Networks, combining the two subjects in one unique piece of code, from A to Z. We will also do our own anomaly detection case study for Time Series on a synthetic dataset.
Hopefully the intro was interesting enough