Template for MATLAB EXPO 2019 · What Type of Question? 10 For each (trip, day, serial #, customer,...

45
© 2018 The MathWorks, Inc. Machine Learning Proven Applications and New Features SHAYONI DUTTA Senior Application Engineer

Transcript of Template for MATLAB EXPO 2019 · What Type of Question? 10 For each (trip, day, serial #, customer,...

Page 1: Template for MATLAB EXPO 2019 · What Type of Question? 10 For each (trip, day, serial #, customer, etc) in the fleet data set, calculate some Key Performance Indicator (KPI*) given

© 2018 The MathWorks, Inc.

Machine LearningProven Applications and New Features

SHAYONI DUTTA

Senior Application Engineer

Page 2: Template for MATLAB EXPO 2019 · What Type of Question? 10 For each (trip, day, serial #, customer, etc) in the fleet data set, calculate some Key Performance Indicator (KPI*) given

How to Get Started with Machine Learning?

2

Page 3: Template for MATLAB EXPO 2019 · What Type of Question? 10 For each (trip, day, serial #, customer, etc) in the fleet data set, calculate some Key Performance Indicator (KPI*) given

Machine Learning Success Stories

Kinesis Health Technologies

Predicting a patient’s fall risk with

machine learning.

3

Page 4: Template for MATLAB EXPO 2019 · What Type of Question? 10 For each (trip, day, serial #, customer, etc) in the fleet data set, calculate some Key Performance Indicator (KPI*) given

Machine Learning+

X4

Page 5: Template for MATLAB EXPO 2019 · What Type of Question? 10 For each (trip, day, serial #, customer, etc) in the fleet data set, calculate some Key Performance Indicator (KPI*) given

Machine Learning+

Industry Knowledge Application Knowledge

Your Own Expertise

5

Page 6: Template for MATLAB EXPO 2019 · What Type of Question? 10 For each (trip, day, serial #, customer, etc) in the fleet data set, calculate some Key Performance Indicator (KPI*) given

Examples of Successful Machine Learning Applications

Fleet Data Analytics

Energy Forecasting

Manufacturing Analytics

6

New Capabilities

▪ MATLAB apps

▪ AutoML

▪ Signal Processing with

Machine Learning

▪ C/C++ Code Generation

Page 7: Template for MATLAB EXPO 2019 · What Type of Question? 10 For each (trip, day, serial #, customer, etc) in the fleet data set, calculate some Key Performance Indicator (KPI*) given

Examples of Successful Machine Learning Applications

Fleet Data Analytics

Energy Forecasting

Manufacturing Analytics

7

Page 8: Template for MATLAB EXPO 2019 · What Type of Question? 10 For each (trip, day, serial #, customer, etc) in the fleet data set, calculate some Key Performance Indicator (KPI*) given

Fleet Data Analytics

8

Design Decisions

Test Plans

0.15

0.0

7

Temperature

0 50 100 150 200 250 300 350

Temperature (oF)

0

2

4

6

8

10

12

14

16

Cou

nt

Page 9: Template for MATLAB EXPO 2019 · What Type of Question? 10 For each (trip, day, serial #, customer, etc) in the fleet data set, calculate some Key Performance Indicator (KPI*) given

What Level of Data?

Equipment

Signals

Messages

Trip/Session

Time – Value pairs

9

Page 10: Template for MATLAB EXPO 2019 · What Type of Question? 10 For each (trip, day, serial #, customer, etc) in the fleet data set, calculate some Key Performance Indicator (KPI*) given

What Type of Question?

10

For each (trip, day, serial #, customer,

etc) in the fleet data set, calculate

some Key Performance Indicator

(KPI*) given parameters XYZ".

Across All (data) in the fleet data set,

calculate descriptive statistics of

specific variables (min, max, median,

count, etc.) to summarize and

visualize (histograms).

Question Type “Across All”“For Each”

Page 11: Template for MATLAB EXPO 2019 · What Type of Question? 10 For each (trip, day, serial #, customer, etc) in the fleet data set, calculate some Key Performance Indicator (KPI*) given

Scale to Large Collections of Data with Datastore

11

Available Datastores

General datastore

spreadsheetDatastore

tabularTextDatastore

fileDatastore

Database databaseDatastore

Image imageDatastore

denoisingImageDatastore

randomPatchExtractionDatastore

pixelLabelDatastore

augmentedImageDatastore

Audio audioDatastore

Predictive

Maintenance

fileEnsembleDatastore

simulationEnsembleDatastore

Simulink SimulationDatastore

Automotive mdfDatastore

Custom subclass matlab.io.Datastore

Transformed transform an existing datastore

Page 12: Template for MATLAB EXPO 2019 · What Type of Question? 10 For each (trip, day, serial #, customer, etc) in the fleet data set, calculate some Key Performance Indicator (KPI*) given

Performing “Across All” Calculations with Tall

12

▪ Visualizations

▪ Data preprocessing

▪ Machine Learning

Page 13: Template for MATLAB EXPO 2019 · What Type of Question? 10 For each (trip, day, serial #, customer, etc) in the fleet data set, calculate some Key Performance Indicator (KPI*) given

Exploring Fleet Data with Unsupervised Learning

13

Page 14: Template for MATLAB EXPO 2019 · What Type of Question? 10 For each (trip, day, serial #, customer, etc) in the fleet data set, calculate some Key Performance Indicator (KPI*) given

Unsupervised Learning for Operational Mode Clustering

14

Page 15: Template for MATLAB EXPO 2019 · What Type of Question? 10 For each (trip, day, serial #, customer, etc) in the fleet data set, calculate some Key Performance Indicator (KPI*) given

“Cold Storage” “Hot Storage”

Data

Historic data:

• Batch processing

• Large data on cluster

• Explore long term trends

• Build models

Streaming data:

• Near real-time

• Test and implement model

for new data

• Stream processing

Vehicle data, driver

profiles

Deploying Fleet Analytics

15

Page 16: Template for MATLAB EXPO 2019 · What Type of Question? 10 For each (trip, day, serial #, customer, etc) in the fleet data set, calculate some Key Performance Indicator (KPI*) given

Fleet Analytics Streaming Architecture

16

Page 17: Template for MATLAB EXPO 2019 · What Type of Question? 10 For each (trip, day, serial #, customer, etc) in the fleet data set, calculate some Key Performance Indicator (KPI*) given

Fleet Analytics in Practice: Volkswagen Data Lab

Develop technology building block for tailoring

car features and services to individual

▪ Driver and Fleet Safety

▪ Driver Coaching

▪ Driver-Specific Insurance

Data sources

▪ Logged CAN bus data and travel record

Results

▪ Proof-of-concept model for “telematic fingerprint”

▪ Basis for the “pay-as-you-drive” concept

Source: “Connected Car – Fahrererkennung mit MATLAB“

Julia Fumbarev, Volkswagen Data Lab

MATLAB EXPO Germany, June 27, 2017, Munich Germany

17

Page 18: Template for MATLAB EXPO 2019 · What Type of Question? 10 For each (trip, day, serial #, customer, etc) in the fleet data set, calculate some Key Performance Indicator (KPI*) given

Machine Learning + X

18

Fleet Analytics

Equipment Expertise

Design Specs

Operating Modes

Operating Conditions

Machine Learning

Statistical Analysis

Unsupervised Learning

Energy Forecasting

Electrical Grid Expertise

Seasonality

Weather Effects

Generator Characteristics

Machine Learning

Time Series Modeling

Regression

Manufacturing Analytics

Manufacturing Expertise

Process Equipment

Process Variables

Performance Metrics

Machine Learning

Anomaly Detection

Regression

Classification

Page 19: Template for MATLAB EXPO 2019 · What Type of Question? 10 For each (trip, day, serial #, customer, etc) in the fleet data set, calculate some Key Performance Indicator (KPI*) given

Examples of Successful Machine Learning Applications

Fleet Data Analytics

Energy Forecasting

Manufacturing Analytics

19

Page 20: Template for MATLAB EXPO 2019 · What Type of Question? 10 For each (trip, day, serial #, customer, etc) in the fleet data set, calculate some Key Performance Indicator (KPI*) given

The Need for Energy Forecasts

20

Jul 01 Jul 02 Jul 03 Jul 04 Jul 05 Jul 06 Jul 07 Jul 08 Jul 09 Jul 10 Jul 11 Jul 12 Jul 13

Time 2019

0

1

2

3

4

5

6

7

8

9

10

Win

d S

pe

ed

(m

/s)

Wind

Aug 04 Aug 05 Aug 06 Aug 07 Aug 08 Aug 09 Aug 10 Aug 11

Time 2019

2000

2500

3000

3500

4000

4500

5000

5500

6000

6500

Lo

ad

(M

W)

Demand

Price

Jun 01 Jun 02 Jun 03 Jun 04 Jun 05 Jun 06 Jun 07 Jun 08 Jun 09 Jun 10 Jun 11 Jun 12

Time of day 2018

0

50

100

150

200

250

En

erg

y p

rodu

ctio

n (

kW

)

Solar

Page 21: Template for MATLAB EXPO 2019 · What Type of Question? 10 For each (trip, day, serial #, customer, etc) in the fleet data set, calculate some Key Performance Indicator (KPI*) given

How Energy Forecasting Works

21

Electricity Demand

Weather

Electricity Prices

Combine

Historical Data

Preprocess Features

Machine

Learning

Jul 01 Jul 02 Jul 03 Jul 04 Jul 05 Jul 06 Jul 07 Jul 08 Jul 09 Jul 10 Jul 11 Jul 12 Jul 13

Time 2019

0

1

2

3

4

5

6

7

8

9

10

Win

d S

pe

ed

(m

/s)

Aug 04 Aug 05 Aug 06 Aug 07 Aug 08 Aug 09 Aug 10 Aug 11

Time 2019

2000

2500

3000

3500

4000

4500

5000

5500

6000

6500

Lo

ad

(M

W)

load

temp

wind

daymonth

24hr

1week

Page 22: Template for MATLAB EXPO 2019 · What Type of Question? 10 For each (trip, day, serial #, customer, etc) in the fleet data set, calculate some Key Performance Indicator (KPI*) given

Building Forecast Models with Regression Techniques

22

Page 23: Template for MATLAB EXPO 2019 · What Type of Question? 10 For each (trip, day, serial #, customer, etc) in the fleet data set, calculate some Key Performance Indicator (KPI*) given

Using Energy Forecasting Models

23

New Data

Electricity Demand

Weather

Electricity Prices

Jul 01 Jul 02 Jul 03 Jul 04 Jul 05 Jul 06 Jul 07 Jul 08 Jul 09 Jul 10 Jul 11 Jul 12 Jul 13

Time 2019

0

1

2

3

4

5

6

7

8

9

10

Win

d S

pe

ed

(m

/s)

Aug 04 Aug 05 Aug 06 Aug 07 Aug 08 Aug 09 Aug 10 Aug 11

Time 2019

2000

2500

3000

3500

4000

4500

5000

5500

6000

6500

Lo

ad

(M

W)

Combine Features Trained

Machine

Learning

Model

Forecast

load

temp

wind

daymonth

24hr

1week

Page 24: Template for MATLAB EXPO 2019 · What Type of Question? 10 For each (trip, day, serial #, customer, etc) in the fleet data set, calculate some Key Performance Indicator (KPI*) given

Deploying Energy Forecasts

Dashboards for operators

and traders

24

API for App Developers

Page 25: Template for MATLAB EXPO 2019 · What Type of Question? 10 For each (trip, day, serial #, customer, etc) in the fleet data set, calculate some Key Performance Indicator (KPI*) given

ChallengeMaximize margins in energy trading by predicting

available supply and peak demand

SolutionUse MATLAB to build and optimize models

that incorporate historical data, weather forecasts,

and regulatory rules

Results▪ Response time reduced by months

▪ Productivity doubled

▪ Program maintenance simplified

“Because we need to rapidly respond to shifting production

constraints and changing demands, we cannot depend on

closed or proprietary solutions. With MathWorks tools we get

more accurate results — and we have the flexibility to develop,

update, and optimize our models in response to changing

needs.”

- Angel Caballero, Gas Natural FenosaLink to user story

Portomouros hydroelectric dam.

Energy Forecasting in Practice: Naturgy Energy Group S.A.

26

Page 26: Template for MATLAB EXPO 2019 · What Type of Question? 10 For each (trip, day, serial #, customer, etc) in the fleet data set, calculate some Key Performance Indicator (KPI*) given

Machine Learning + X

27

Fleet Analytics

Equipment Expertise

Design Specs

Operating Modes

Operating Conditions

Machine Learning

Statistical Analysis

Unsupervised Learning

Energy Forecasting

Electrical Grid Expertise

Seasonality

Weather Effects

Generator Characteristics

Machine Learning

Time Series Modeling

Regression

Manufacturing Analytics

Manufacturing Expertise

Process Equipment

Process Variables

Performance Metrics

Machine Learning

Anomaly Detection

Regression

Classification

Page 27: Template for MATLAB EXPO 2019 · What Type of Question? 10 For each (trip, day, serial #, customer, etc) in the fleet data set, calculate some Key Performance Indicator (KPI*) given

Machine Learning apps

▪ Try out many models

▪ Compare Results

▪ Get to a reasonable model

without worrying about the

details

28

Perform

Hyperparameter

Optimization in apps

Page 28: Template for MATLAB EXPO 2019 · What Type of Question? 10 For each (trip, day, serial #, customer, etc) in the fleet data set, calculate some Key Performance Indicator (KPI*) given

AutoML

▪ Build many machine learning models

▪ Find a good model without becoming

an expert

29

Preprocess

DataDeploy &

Integrate

Train

Model

Extract

Features

Import

Data

Wavelet

Scattering

Decision Tree?

SVM?

KNN?

Ensemble?

…?

fitcauto

Wavelet

Scattering

Hyper-

parameter

Optimization

Feature

Selection

Model

Selection

Wavelet

Scattering

Page 29: Template for MATLAB EXPO 2019 · What Type of Question? 10 For each (trip, day, serial #, customer, etc) in the fleet data set, calculate some Key Performance Indicator (KPI*) given

Examples of Successful Machine Learning Applications

Fleet Data Analytics

Energy Forecasting

Manufacturing Analytics

31

Page 30: Template for MATLAB EXPO 2019 · What Type of Question? 10 For each (trip, day, serial #, customer, etc) in the fleet data set, calculate some Key Performance Indicator (KPI*) given

What is Manufacturing Analytics?

Definition: Apply modeling (AI) to process and sensor data to maximize operational

performance

Key Use Cases:

1. Automate the monitoring of manufacturing process

2. Ensure product quality

3. Optimize yield of complex production processes

32

Page 31: Template for MATLAB EXPO 2019 · What Type of Question? 10 For each (trip, day, serial #, customer, etc) in the fleet data set, calculate some Key Performance Indicator (KPI*) given

Challenges in Applying AI to Manufacturing

Lots of Data – much in “Data Historians” (SCADA, LIMS, OSISoft PI)

Reliable measurements or modeling

– Sensor failures

– Hidden variables

Use of many different tools

– Limited Predictive modeling

– Handle streaming data

– Customization

33

Page 32: Template for MATLAB EXPO 2019 · What Type of Question? 10 For each (trip, day, serial #, customer, etc) in the fleet data set, calculate some Key Performance Indicator (KPI*) given

Uncover Hidden Variables with Process Modeling

34

pretty big →

Page 33: Template for MATLAB EXPO 2019 · What Type of Question? 10 For each (trip, day, serial #, customer, etc) in the fleet data set, calculate some Key Performance Indicator (KPI*) given

Case Study: Anomaly Detection

35

Page 34: Template for MATLAB EXPO 2019 · What Type of Question? 10 For each (trip, day, serial #, customer, etc) in the fleet data set, calculate some Key Performance Indicator (KPI*) given

Case Study: Anomaly Detection

2. One-class SVM1. Cluster with DBSCAN

36

Page 35: Template for MATLAB EXPO 2019 · What Type of Question? 10 For each (trip, day, serial #, customer, etc) in the fleet data set, calculate some Key Performance Indicator (KPI*) given

Deployment

Integration with Data Historians

▪ OPC Toolbox (Database tbx via ODBC

or JDBC) connects with PI Server

▪ Access MATLAB analytics within the

PI Asset Framework

Customize Analytics

Delivery

▪ Accessing insights via

GUI critical for plant staff

and process engineers

▪ Build a custom dashboard

with App Designer

37

PI Data

Archive

OPC, ODBC,

JDBC

MATLAB Production Server

Calls

MATLAB

function

PI Asset

Framework

Write

result to

PI point

PI System

Explorer

Page 36: Template for MATLAB EXPO 2019 · What Type of Question? 10 For each (trip, day, serial #, customer, etc) in the fleet data set, calculate some Key Performance Indicator (KPI*) given

Case Study:

Application: “Virtual sensor” for accurate

prediction of ore bin levels

Objectives:

– Reduce downtimes

– Maximize throughput

Approach:

– Sensor Fusion using Kalman filters

– Sys ID outperformed traditional models

Results: 5% prediction accuracy over 3 hr time horizon

– Reduced downtime, saving $100k for each sensor failure

– Integration with OSI Soft and Azure IoT+CI Do NOT use with customers until

user story published

38

Page 37: Template for MATLAB EXPO 2019 · What Type of Question? 10 For each (trip, day, serial #, customer, etc) in the fleet data set, calculate some Key Performance Indicator (KPI*) given

Machine Learning + X

39

Fleet Analytics

Equipment Expertise

Design Specs

Operating Modes

Operating Conditions

Machine Learning

Statistical Analysis

Unsupervised Learning

Energy Forecasting

Electrical Grid Expertise

Seasonality

Weather Effects

Generator Characteristics

Machine Learning

Time Series Modeling

Regression

Manufacturing Analytics

Manufacturing Expertise

Process Equipment

Variables & Set Points

Parameter Impact

Machine Learning

Anomaly Detection

Regression

Multivariate Statistics

Page 38: Template for MATLAB EXPO 2019 · What Type of Question? 10 For each (trip, day, serial #, customer, etc) in the fleet data set, calculate some Key Performance Indicator (KPI*) given

Machine Learning + Signal Processing

40

Data Preprocessing Feature Engineering

Frequency domain

Time domain

Bandwidth measurements Spectral statisticsDetrending Smoothing

Resampling Filtering

Page 39: Template for MATLAB EXPO 2019 · What Type of Question? 10 For each (trip, day, serial #, customer, etc) in the fleet data set, calculate some Key Performance Indicator (KPI*) given

Kinesis Health Technologies

Predicting a patient’s fall risk with

machine learning.

41

Page 40: Template for MATLAB EXPO 2019 · What Type of Question? 10 For each (trip, day, serial #, customer, etc) in the fleet data set, calculate some Key Performance Indicator (KPI*) given

From Desktop to Production

Reasons for Updates:

▪ Found a better model

▪ New data became available

▪ Business needs change

▪ …

42

C/C++

Page 41: Template for MATLAB EXPO 2019 · What Type of Question? 10 For each (trip, day, serial #, customer, etc) in the fleet data set, calculate some Key Performance Indicator (KPI*) given

Automatic C/C++ Code Generation

1. Prediction for most Classification and Regression models

2. Update deployed models without regenerating code

– SVM, Decision Trees, Linear Models

1. Fixed-Point support

– SVM, Decision Trees, Ensemble of Trees

– Shallow Neural Network (through Simulink)

1. Integrate with Simulink models as

MATLAB Function Block

43

Integrate MATLAB

with Other Languages

Page 42: Template for MATLAB EXPO 2019 · What Type of Question? 10 For each (trip, day, serial #, customer, etc) in the fleet data set, calculate some Key Performance Indicator (KPI*) given

Examples of Successful Machine Learning Applications

Fleet Data Analytics

Energy Forecasting

Manufacturing Analytics

44

New Capabilities

▪ MATLAB apps

▪ AutoML

▪ Signal Processing with Machine Learning

▪ C/C++ Code Generation

Page 43: Template for MATLAB EXPO 2019 · What Type of Question? 10 For each (trip, day, serial #, customer, etc) in the fleet data set, calculate some Key Performance Indicator (KPI*) given

Machine Learning+

XFleet Data Analytics

Energy Forecasting

Manufacturing Analytics

Signal Processing

Industry Knowledge

Application Knowledge

Medical Devices Mining

AppsC/C++ Code

GenerationAutoML

45

Page 44: Template for MATLAB EXPO 2019 · What Type of Question? 10 For each (trip, day, serial #, customer, etc) in the fleet data set, calculate some Key Performance Indicator (KPI*) given

Learn More

- Exploratory Data Analysis- Data Processing and Feature Engineering- Predictive Modeling and Machine Learning- Data Science Project

Training Courses

MATLAB Fundamentals (3 days)

MATLAB for Data Processing and

Visualization (1 day)

Processing Big Data with MATLAB (1 day)

Statistical Methods in MATLAB (2 days)

Machine Learning with MATLAB (2 days)

Signal Preprocessing and Feature

Extraction with MATLAB (1 day)

Deep Learning with MATLAB (2 days)

Accelerating and Parallelizing MATLAB

Code (2 days)

46

Page 45: Template for MATLAB EXPO 2019 · What Type of Question? 10 For each (trip, day, serial #, customer, etc) in the fleet data set, calculate some Key Performance Indicator (KPI*) given