Add primitives for GAN based time-series anomaly detection
AlexanderGeiger opened this issue · 1 comments
Description
Add a primitive that allows novel GAN based anomaly detection in time series signals.
Approach
- Add a CycleGAN primitive that allows the encoding and decoding of time series signals. This network consists of LSTM based encoder and decoder networks, as well as two critic networks to ensure cycle consistency. Once trained, the network can reconstruct time series signals and the critic network could serve as a direct measure of "how real" a time-series sequence looks.
- Add a corresponding error-calculation primitive that allows to compute anomaly scores using a combination of the reconstruction error and the output of the critic network.
Some comments about the naming and code structure: since we already have several primitives which are specialized in timeseries, let's build this by adding a new subfolder, called timeseries
, which will live for now inside the candidates
one.
Also, since the error-calculation primitive that you suggest is not really calculating errors but rather scoring anomalies, I would suggest to change its name to something related. Also, since it is a function which is specialized and can only work in combination with the cyclegan class, I would put both of them in the same module.
So, the exact structure I suggest is:
└── mlprimitives
└── candidates
└── timeseries
├── __init__.py
└── cyclegan.py
Both the CycleGAN class and the errors function should be placed inside the cyclegan.py
module, and the names I suggest using are:
CycleGAN
, and call the primitivemlprimitives.candidates.timeseries.cyclegan.CycleGAN
score_anomalies
, and call the primitivemlprimitives.candidates.timeseries.cyclegan.score_anomalies