anomaly detection using deep auto-encoders | gianmario spacagna

22
Anomaly Detection using Deep Auto-Encoders GIANMARIO SPACAGNA DATA SCIENCE MILAN - 18/05/2017

Upload: data-science-milan

Post on 22-Jan-2018

1.787 views

Category:

Technology


2 download

TRANSCRIPT

Page 1: Anomaly Detection using Deep Auto-Encoders | Gianmario Spacagna

Anomaly Detection using

Deep Auto-Encoders

GIANMARIO SPACAGNA

DATA SCIENCE MILAN - 18/05/2017

Page 2: Anomaly Detection using Deep Auto-Encoders | Gianmario Spacagna

What you will (briefly) learn

▶ What is an anomaly (and an outlier)

▶ Popular techniques used in shallow machine

learning

▶ Why deep learning can make the difference

▶ Anomaly detection using deep auto—

encoders

▶ H2O overview

▶ ECG pulse detection PoC example

Page 3: Anomaly Detection using Deep Auto-Encoders | Gianmario Spacagna

1. Machine Learning – An

Introduction

2. Neural Networks

3. Deep Learning

Fundamentals

4. Unsupervised Feature

Learning

5. Image Recognition

6. Recurrent Neural Networks

and Languages Models

7. Deep Learning for Board

Games

8. Deep Learning for

Computer Games

9. Anomaly Detection 10.Building a Production-ready

Intrusion Detection System

Page 4: Anomaly Detection using Deep Auto-Encoders | Gianmario Spacagna

Why this use case?

▶ Anomaly detection is crucial to many business

applications

▶ Smart feature representation => better anomaly detection

▶ Deep Learning works very well on learning relationships in

the underlying raw data

(will see how…)

Page 5: Anomaly Detection using Deep Auto-Encoders | Gianmario Spacagna

Outlier vs Anomaly

“An outlier is a legitimate data point that’s far

away from the mean or median in a distribution. It

may be unusual, like a 9.6-second 100-meter dash,

but still within the realm of reality. An anomaly is an

illegitimate data point that’s generated by a

different process than whatever generated the

rest of the data.”

Ravi Parikh

http://data.heapanalytics.com/garbage-in-garbage-out-how-anomalies-

can-wreck-your-data

Page 6: Anomaly Detection using Deep Auto-Encoders | Gianmario Spacagna

Data modeling

▶ Point anomaly

(e.g. black sheep)

■ Contextual anomaly (e.g. selling ice-creams in January)

■ Collective anomaly (e.g. sequence of suspected credit card activities)

Page 7: Anomaly Detection using Deep Auto-Encoders | Gianmario Spacagna

Detection modeling (and its

limitations)

▶ Supervised (classification)

▶ Data skewness, lack of counter examples

▶ Unsupervised (clustering)

▶ Curse of dimensionality

▶ Semi-supervised (novelty detection)

▶ Require a “normal” training dataset

Page 8: Anomaly Detection using Deep Auto-Encoders | Gianmario Spacagna

Real world applications

▶ Manufacturing => hardware faults

▶ Law-enforcement => reveal criminal activities

▶ Network system => detect intrusions or anomalous

behaviors

▶ Internet Security => malware detection

▶ Financial services => frauds

▶ Marketing / business strategy => spotting profitable

customers

▶ Healthcare => Medical diagnosis

Page 9: Anomaly Detection using Deep Auto-Encoders | Gianmario Spacagna

What’s the challenge?

“Coming up with features is difficult, time-

consuming, requires expert knowledge.

When working applications of learning, we

spend a lot of time tuning features.“

Andrew Ng, Machine Learning and AI via Brain simulations, Stanford

University

Page 10: Anomaly Detection using Deep Auto-Encoders | Gianmario Spacagna

Hierarchical Feature Learning

NVIDIA Deep Learning Course: Class #1 – Introduction to Deep Learning

https://www.youtube.com/watch?v=6eBpjEdgSm0

Page 11: Anomaly Detection using Deep Auto-Encoders | Gianmario Spacagna

Structural representation

Advanced Topics, http://slideplayer.com/slide/3471890/

Page 12: Anomaly Detection using Deep Auto-Encoders | Gianmario Spacagna

Signal propagation

Schematic diagram of back-propagation neural networks with two hidden layers.Factor selection for delay analysis using Knowledge Discovery in Databases

Page 13: Anomaly Detection using Deep Auto-Encoders | Gianmario Spacagna

Auto-encoders• Signal propagation output: approximate an identity function

• Error back propagation: Mean Squared Error MSE (*)

between the original datum and the reconstructed one

(*) in case of numerical data

Page 14: Anomaly Detection using Deep Auto-Encoders | Gianmario Spacagna

Novelty detection using auto-encoders

1. Identify a training dataset of what is considered “normal”

2. Learn what “normal” means, aka. learn the structures of normal

behavior

3. Try to reconstruct never-seen points re-using the same structure, if the

error is high means the point deviates from the normal distribution

TRAIN

Auto-

Encoder

RECONSTRUCT Low

error

RECONSTRUCT High

error

Page 15: Anomaly Detection using Deep Auto-Encoders | Gianmario Spacagna

Features compression

■ Use just the encoder to compress data

into a reduced dimensional space then

use traditional unsupervised learning

Tom Mitchell’s example of an auto-encoder:

You can represent any combination of the 8 binary inputs using only 3 decimal

values

Page 16: Anomaly Detection using Deep Auto-Encoders | Gianmario Spacagna
Page 17: Anomaly Detection using Deep Auto-Encoders | Gianmario Spacagna

PoC examples

▶ ECG Anomaly Pulse Detection

▶ MNIST Anomaly Digit Recognition

(Optional)

▶ Jupyter notebooks available on

https://github.com/packtmayur/Python-

Deep-Learning/tree/master/chapter_9

Page 18: Anomaly Detection using Deep Auto-Encoders | Gianmario Spacagna

Summary

▶ We listed a few real-world applications of anomaly

detection

▶ We covered some of the most popular techniques in

the literature with their limitations

▶ We proposed an overview of how deep neural

networks work and why they are great for learning

smart feature representations

▶ We proposed 2 semi-supervised approaches using

deep auto-encoders:

▶ Novel detection

▶ Feature compression

Page 19: Anomaly Detection using Deep Auto-Encoders | Gianmario Spacagna

Going deeper

▶ Advanced modeling:

▶ Denoising auto-encoders

▶ Contractive auto-encoders

▶ Sparse auto-encoders

▶ Variational auto-encoders (for better novelty detection)

▶ Stacked auto-encoders (for better feature compression)

▶ Building a production-ready intrusion detection system:

▶ Validating and testing with labels and in absence of ground truth

▶ Evaluation KPIs for anomaly detection

▶ A/B(C/D) testing

Page 20: Anomaly Detection using Deep Auto-Encoders | Gianmario Spacagna

E-book discount

▶ Use the code KVGRSF30and get 30% discount on e-

book

▶ Only valid for 500 uses

until 31st October, 2017

▶ https://www.packtpub.com/b

ig-data-and-business-

intelligence/python-deep-

learning

Page 21: Anomaly Detection using Deep Auto-Encoders | Gianmario Spacagna

"Data scientists realize that their best days

coincide with discovery of truly odd features in

the data."

Haystacks and Needles: Anomaly Detection By:

Gerhard Pilcher & Kenny Darrell, Data Mining

Analyst, Elder Research, Inc.

Page 22: Anomaly Detection using Deep Auto-Encoders | Gianmario Spacagna

Deep Neural networks