/
Anomaly Detection on Streaming Data using Anomaly Detection on Streaming Data using

Anomaly Detection on Streaming Data using - PowerPoint Presentation

elena
elena . @elena
Follow
68 views
Uploaded On 2023-12-30

Anomaly Detection on Streaming Data using - PPT Presentation

Hierarchical Temporal Memory and LSTM Jaime Coello de Portugal Many thanks to Jochem Snuverink Motivation Global outlier Level change Pattern deviation Pattern change Plots from Ted ID: 1036203

anomaly memory input temporal memory anomaly temporal input detection cells context cell connections score hierarchical space active time column

Share:

Link:

Embed:

Download Presentation from below link

Download Presentation The PPT/PDF document "Anomaly Detection on Streaming Data usin..." is the property of its rightful owner. Permission is granted to download and print the materials on this web site for personal, non-commercial use only, and to display it on your personal computer provided you do not modify the materials and that you retain all copyright notices contained in the materials. By downloading content from our website, you accept the terms of this agreement.


Presentation Transcript

1. Anomaly Detection on Streaming Data usingHierarchical Temporal Memory (and LSTM)Jaime Coello de PortugalMany thanks to Jochem Snuverink

2. MotivationGlobal outlierLevel changePattern deviationPattern changePlots from: Ted D’Ottavio et al, Experience Using NuPIC to DetectAnomalies in Controls Data, ICALEPCS 2019“An observation which deviates so much from other observations as to arouse suspicions that it was generated by a different mechanism." ― Hawkins, 1980Try to find observation or sequences that deviate from the “normal behaviour”.Experts would recognize these anomalous patterns easily, but cannot be monitoring the huge amount of data some systems produce.E.g: Credit card fraud detection, intrusion detection in cybersecurity, or fault diagnosis in industry.Specific e.g: At HIPA the MHB7R:ILOG:2 temperature detector broke down without anyone noticing.

3. Hierarchical Temporal Memory: IntroductionModel of the organization of “pyramidal neurons” in the neocortex of mammals.Tries to explain how neuronal structures remember sequences.J. Hawkins and S. Ahmad, Why Neurons Have Thousands of Synapses, a Theory of Sequence Memory in Neocortexhttps://doi.org/10.3389/fncir.2016.00023Neural network neuronPyramidal neuronHTM neuron modelPyramidal neurons connect forming “columns” that share input and output.

4. Hierarchical Temporal Memory: Sparse Distributed Representations (SDR)Scalar variables:0:111000000000001:011100000000002:00111000000000………Categorical variables:111000000000001110000000000011100000000000No overlap between different categoriesSimilar values overlap ->Encodes “proximity” between values.Produces some resistance to noise. Discrepancies due to noise will get the same or close representation.3:000111000000001

5. Hierarchical Temporal Memory: Sparse Distributed Representations (SDR)Several variables can share an SDR.Can also encode periodic proximity.E.g. power consumption in a gym:00111000000011100000000111000Power consumption (scalar)Time of day (scalar)Is weekend?(categorical)3 kWNo0011100000001110000000011100011:00Yes3.8 kW23:0023:00The input to the HTM network is one of these SDR per time unit.

6. Hierarchical Temporal Memory: Spatial Pooler (SP)Input Space:00111000000000Spatial Pooler:3002001100030000Each cell on the SP gets random weighted connections to the input space.If the weight is over some threshold the cell gets connected to a bit of the input space.The N cells that have the most connection overlap to the input space become “active”.Target:0.70.60.80.80.20.10.30.90.10.4Weights:Overlap scores:Maintain the semantic information from the input space with a fixed (~2%) sparsity.Active cells learn by updating their weights.

7. CCCCCCCCCCCCCCCCCCCCCCCCCCCCHierarchical Temporal Memory: Temporal Memory (TM)CCCCCCCCCCCCCCCCCCCCA -> B -> CA without contextTemporal Memory:Each cell of the SP is actually made of several cells that respond to the same input, forming “mini-columns”.These cells have connections with cells in other columns.If enough of these connections are active, the cell goes into “predictive” state.Predictive

8. CCCCCCCCCCCCCCCCCCCCCCCCCCCCHierarchical Temporal Memory: Temporal Memory (TM)CCCCCCCCCCCCCCCCCCCCA -> B -> CTemporal Memory:B on the context of AOn the next input, if a column containing a predictive cell becomes active only the predictive cell becomes active.

9. CCCCCCCCCCCCCCCCCCCCCCCCCCCCHierarchical Temporal Memory: Temporal Memory (TM)CCCCCCCCCCCCCCCCCCCCA -> B -> CTemporal Memory:C on the context of BWhen an unexpected input happens, the whole column activates.One of the cells of the column is then chosen as the “winner” and grows connections to the previous state.Old unused connections are slowly forgotten.Winner cellsNewly created connections

10. Hierarchical Temporal Memory: Temporal Memory (TM)A without context? -> AB on the context of AD on the context of A? -> A -> B and DWhen several cells in a column are activated, many columns might predictive.This allows the model to “doubt” in case of unknown or ambiguous context.In the next cycle, the next input will reveal the correct prediction and the model will learn.

11. Anomaly detectionHTM Anomaly Score:LSTM Anomaly Score:001110000000000111000000.20.5010.8Previous N samplesMask with:Current sampleInto bins1 – 0.8 = Anomaly Score = 0.2Training penalty = Anomaly Score +  Previous sampleHTMPredictive columnsCurrent sample11100000000000Anomaly Score =Correctly predicted inputs Number of connectionsLSTMSDR

12. Anomaly detection implementationEPICS / ArchiverKeras / Tensorflow LSTMNUPIC RPC clientAnomaly scoreAverageNUPIC RPC server (Python 2)DBPlotly Dash ServerInterlock forecastingTemperature prediction…?NUPIC is a Python 2 (wrapping C++) implementation of the HTM algorithm by Numenta (numenta.com).They provide a set of hyperparameters that works good for anomaly detection out of the box

13. Anomaly detection in HIPASensor signal:MHB7R:ILOG:2Anomaly score

14. Anomaly detection in HIPAUCN Kick(every 5 minutes)Interlock

15. Anomaly detection in HIPASensor breakdown

16. Live anomaly detection in PROSCANAnomalies detected live in the vacuum level in the cyclotron:

17. Conclusions and further workThe combination of the HTM network and the LSTM seems to provide a good real time anomaly detection system.The system works well on archived and live data, adapts to both stable and periodic behaviour.It would have alerted the experts of the failure of the MHB7R:ILOG:2 sensor tenths of minutes in advance.Tested on real time on PROSCAN, ready for the restart of HIPA.A third anomaly detection based in Isolation Forest: “Robust Random Cut Forest” is being tested in combination with the other two.Conclusions:Robust Random Cut Forest: https://proceedings.mlr.press/v48/guha16.pdfA nice video series to learn about the HTM: https://www.youtube.com/playlist?list=PL3yXMgtrZmDqhsFQzwUC9V8MeeVOQ7eZ9