real-time anomaly detection using lstm auto-encoders with deep learning4j on apache spark

64
Unless stated otherwise all images are taken from wikipedia.org or openclipart.org Cognitive IoT Anomaly Detector with DeepLearning4J on IoT Sensor Data

Upload: dataworks-summithadoop-summit

Post on 13-Apr-2017

22 views

Category:

Technology


2 download

TRANSCRIPT

Page 1: Real-Time Anomaly Detection using LSTM Auto-Encoders with Deep Learning4J on Apache Spark

Unless stated otherwise all images are taken from wikipedia.org or openclipart.org

Cognitive IoT Anomaly Detector with DeepLearning4J on IoT Sensor Data

Page 2: Real-Time Anomaly Detection using LSTM Auto-Encoders with Deep Learning4J on Apache Spark
Page 3: Real-Time Anomaly Detection using LSTM Auto-Encoders with Deep Learning4J on Apache Spark

Why IoT (now) ?• 15 Billion connected devices in 2015

• 40 Billion connected devices in 2020

• World population 7.4 Billion in 2016

Page 4: Real-Time Anomaly Detection using LSTM Auto-Encoders with Deep Learning4J on Apache Spark
Page 5: Real-Time Anomaly Detection using LSTM Auto-Encoders with Deep Learning4J on Apache Spark
Page 6: Real-Time Anomaly Detection using LSTM Auto-Encoders with Deep Learning4J on Apache Spark
Page 7: Real-Time Anomaly Detection using LSTM Auto-Encoders with Deep Learning4J on Apache Spark
Page 8: Real-Time Anomaly Detection using LSTM Auto-Encoders with Deep Learning4J on Apache Spark
Page 9: Real-Time Anomaly Detection using LSTM Auto-Encoders with Deep Learning4J on Apache Spark
Page 10: Real-Time Anomaly Detection using LSTM Auto-Encoders with Deep Learning4J on Apache Spark
Page 11: Real-Time Anomaly Detection using LSTM Auto-Encoders with Deep Learning4J on Apache Spark
Page 12: Real-Time Anomaly Detection using LSTM Auto-Encoders with Deep Learning4J on Apache Spark
Page 13: Real-Time Anomaly Detection using LSTM Auto-Encoders with Deep Learning4J on Apache Spark
Page 14: Real-Time Anomaly Detection using LSTM Auto-Encoders with Deep Learning4J on Apache Spark
Page 15: Real-Time Anomaly Detection using LSTM Auto-Encoders with Deep Learning4J on Apache Spark
Page 16: Real-Time Anomaly Detection using LSTM Auto-Encoders with Deep Learning4J on Apache Spark
Page 17: Real-Time Anomaly Detection using LSTM Auto-Encoders with Deep Learning4J on Apache Spark

Machine Learning on historic data

Source: deeplearning4j.org

Page 18: Real-Time Anomaly Detection using LSTM Auto-Encoders with Deep Learning4J on Apache Spark

Online Learning

Source: deeplearning4j.org

Page 19: Real-Time Anomaly Detection using LSTM Auto-Encoders with Deep Learning4J on Apache Spark

online vs. historic• Pros

• low storage costs

• real-time model update

• Cons

• algorithm support

• software support

• no algorithmic improvement

• compute power to be inline with data rate

• Pros

• all algorithms

• abundance of software

• model re-scoring / re-parameterisation (algorithmic improvement)

• batch processing

• Cons

• high storage costs

• batch model update

Page 20: Real-Time Anomaly Detection using LSTM Auto-Encoders with Deep Learning4J on Apache Spark
Page 21: Real-Time Anomaly Detection using LSTM Auto-Encoders with Deep Learning4J on Apache Spark

DeepLearningDeepLearning

Apache Spark

Hadoop

Page 22: Real-Time Anomaly Detection using LSTM Auto-Encoders with Deep Learning4J on Apache Spark

Neural Networks

Page 23: Real-Time Anomaly Detection using LSTM Auto-Encoders with Deep Learning4J on Apache Spark

Neural Networks

Page 24: Real-Time Anomaly Detection using LSTM Auto-Encoders with Deep Learning4J on Apache Spark

Deeper (more) Layers

Page 25: Real-Time Anomaly Detection using LSTM Auto-Encoders with Deep Learning4J on Apache Spark

Convolutional

Page 26: Real-Time Anomaly Detection using LSTM Auto-Encoders with Deep Learning4J on Apache Spark

Convolutional

+ =

Page 27: Real-Time Anomaly Detection using LSTM Auto-Encoders with Deep Learning4J on Apache Spark

Convolutional

Page 28: Real-Time Anomaly Detection using LSTM Auto-Encoders with Deep Learning4J on Apache Spark
Page 29: Real-Time Anomaly Detection using LSTM Auto-Encoders with Deep Learning4J on Apache Spark

Learning of a function

A neural network can basically learn any mathematical function

Page 30: Real-Time Anomaly Detection using LSTM Auto-Encoders with Deep Learning4J on Apache Spark

Recurrent

Page 31: Real-Time Anomaly Detection using LSTM Auto-Encoders with Deep Learning4J on Apache Spark

LSTM

“vanishing gradient problem” == influence of past inputs decay quickly over time

Page 32: Real-Time Anomaly Detection using LSTM Auto-Encoders with Deep Learning4J on Apache Spark

http://karpathy.github.io/2015/05/21/rnn-effectiveness/

Page 33: Real-Time Anomaly Detection using LSTM Auto-Encoders with Deep Learning4J on Apache Spark
Page 34: Real-Time Anomaly Detection using LSTM Auto-Encoders with Deep Learning4J on Apache Spark
Page 35: Real-Time Anomaly Detection using LSTM Auto-Encoders with Deep Learning4J on Apache Spark
Page 36: Real-Time Anomaly Detection using LSTM Auto-Encoders with Deep Learning4J on Apache Spark

https://m.soundcloud.com/optometrist-prime/recurrence-music-written-by-a-recurrent-neural-network

Page 37: Real-Time Anomaly Detection using LSTM Auto-Encoders with Deep Learning4J on Apache Spark

• Outperformed traditional methods, such as• cumulative sum (CUSUM)• exponentially weighted moving average (EWMA)• Hidden Markov Models (HMM)

• Learned what “Normal” is• Raised error if time series pattern haven't been seen before

Page 38: Real-Time Anomaly Detection using LSTM Auto-Encoders with Deep Learning4J on Apache Spark
Page 39: Real-Time Anomaly Detection using LSTM Auto-Encoders with Deep Learning4J on Apache Spark
Page 40: Real-Time Anomaly Detection using LSTM Auto-Encoders with Deep Learning4J on Apache Spark

Learning of an algorithm

A LSTM network is Turing complete 1

1: http://binds.cs.umass.edu/papers/1995_Siegelmann_Science.pdf

Page 41: Real-Time Anomaly Detection using LSTM Auto-Encoders with Deep Learning4J on Apache Spark

Problems• Neural Networks are computationally very complex• especially during training• but also during scoring

CPU (2009) GPU (2016) IBM TrueNorth (2017)

Page 42: Real-Time Anomaly Detection using LSTM Auto-Encoders with Deep Learning4J on Apache Spark

IBM TrueNorth• Scalable• Parallel• Distributed• Fault Tolerant• No Clock ! :)• IBM Cluster• 4.096 chips• 4 billion neurons• 1 trillion synapses

• Human Brain• 100 billion neurons• 100 trillion synapses

• 1.000.000 neurons• 250.000.000 synapses

Page 43: Real-Time Anomaly Detection using LSTM Auto-Encoders with Deep Learning4J on Apache Spark
Page 44: Real-Time Anomaly Detection using LSTM Auto-Encoders with Deep Learning4J on Apache Spark
Page 45: Real-Time Anomaly Detection using LSTM Auto-Encoders with Deep Learning4J on Apache Spark

Watson IoTWatson

Cognitive Services

Analytics

Model + API Driver Behaviour Personality Insights

Trainable Model + API IoT for Insurance Visual

Recognition

Customizable Model + API

Watson Machine Learning

Data Science Platform as a

Service

Data Science Experience

Page 46: Real-Time Anomaly Detection using LSTM Auto-Encoders with Deep Learning4J on Apache Spark

DeepLearning4J

Page 47: Real-Time Anomaly Detection using LSTM Auto-Encoders with Deep Learning4J on Apache Spark

Components

• DeepLearning4JEnterprise Grade DeepLearning Library

• DataVec CSV/Audio/Video/Image/… => Vector

• ND4J / ND4S (NumPy for the JVM)

Page 48: Real-Time Anomaly Detection using LSTM Auto-Encoders with Deep Learning4J on Apache Spark

ND4J

• Tensor support (Linear Buffer + Stride)

• Multiple implementations, one interface

• vectorized c++ code (JavaCPP), off-heap data storage, BLAS (OpenBLAS, Intel MKL, cuBLAS)

• GPU (CUDA 7.5)

Page 49: Real-Time Anomaly Detection using LSTM Auto-Encoders with Deep Learning4J on Apache Spark

turn on GPU

Page 50: Real-Time Anomaly Detection using LSTM Auto-Encoders with Deep Learning4J on Apache Spark

DL4J parallelisation• TensorFlow on ApacheSpark =>

• Scoring

• Multi-model hyper-parameter tuning

• Parallel training since V r0.8

• DeepLearning4J =>

• Scoring, Multi-model hyper-parameter tuning

• Parallel training“Jeff Dean style parameter averaging”

Page 51: Real-Time Anomaly Detection using LSTM Auto-Encoders with Deep Learning4J on Apache Spark

“Code local vs spark”

vs.

Page 52: Real-Time Anomaly Detection using LSTM Auto-Encoders with Deep Learning4J on Apache Spark

DemoIoT / Industry / Predictive Maintenance Use Case

Page 53: Real-Time Anomaly Detection using LSTM Auto-Encoders with Deep Learning4J on Apache Spark
Page 54: Real-Time Anomaly Detection using LSTM Auto-Encoders with Deep Learning4J on Apache Spark
Page 55: Real-Time Anomaly Detection using LSTM Auto-Encoders with Deep Learning4J on Apache Spark
Page 56: Real-Time Anomaly Detection using LSTM Auto-Encoders with Deep Learning4J on Apache Spark
Page 57: Real-Time Anomaly Detection using LSTM Auto-Encoders with Deep Learning4J on Apache Spark

data

https://github.com/romeokienzler/pmqsimulator https://ibm.biz/joinIBMCloud

Page 58: Real-Time Anomaly Detection using LSTM Auto-Encoders with Deep Learning4J on Apache Spark
Page 59: Real-Time Anomaly Detection using LSTM Auto-Encoders with Deep Learning4J on Apache Spark
Page 60: Real-Time Anomaly Detection using LSTM Auto-Encoders with Deep Learning4J on Apache Spark
Page 61: Real-Time Anomaly Detection using LSTM Auto-Encoders with Deep Learning4J on Apache Spark
Page 62: Real-Time Anomaly Detection using LSTM Auto-Encoders with Deep Learning4J on Apache Spark
Page 63: Real-Time Anomaly Detection using LSTM Auto-Encoders with Deep Learning4J on Apache Spark
Page 64: Real-Time Anomaly Detection using LSTM Auto-Encoders with Deep Learning4J on Apache Spark