Deep Learning For Vision Analytics - SAS: Analytics, Artificial Intelligence … · 2018-04-19 ·...

24
Copyright © SAS Institute Inc. All rights reserved. Deep Learning For Vision Analytics SAS User Group Malaysia 12 th April, 2018

Transcript of Deep Learning For Vision Analytics - SAS: Analytics, Artificial Intelligence … · 2018-04-19 ·...

Page 1: Deep Learning For Vision Analytics - SAS: Analytics, Artificial Intelligence … · 2018-04-19 · assessment of motor vehicles, using image recognition software that will enable

Copyright © S AS Inst i tute Inc. A l l r i ghts reserved.

Deep Learning For Vision AnalyticsSAS User Group Malaysia

12th April, 2018

Page 2: Deep Learning For Vision Analytics - SAS: Analytics, Artificial Intelligence … · 2018-04-19 · assessment of motor vehicles, using image recognition software that will enable

Copyright © S AS Inst i tute Inc. A l l r i ghts reserved.

Agenda

• What?

• Use cases

• How?

• Image classification

• Basic CNN architecture

• Layer explanation (convolution/pooling/fully connected)

• Deploy

• Create/train/score/deploy model using Jupyter Notebook

Page 3: Deep Learning For Vision Analytics - SAS: Analytics, Artificial Intelligence … · 2018-04-19 · assessment of motor vehicles, using image recognition software that will enable

Copyright © S AS Inst i tute Inc. A l l r i ghts reserved.

What?Use Cases

Page 4: Deep Learning For Vision Analytics - SAS: Analytics, Artificial Intelligence … · 2018-04-19 · assessment of motor vehicles, using image recognition software that will enable

Copyright © S AS Inst i tute Inc. A l l r i ghts reserved.

Manufacturing Defect Detection: High Tech Manufacturing

Testing machines are expensive, slow and is usually the bottleneck!

Costs accumulates as chips go further into the production process

Page 5: Deep Learning For Vision Analytics - SAS: Analytics, Artificial Intelligence … · 2018-04-19 · assessment of motor vehicles, using image recognition software that will enable

Copyright © S AS Inst i tute Inc. A l l r i ghts reserved.

Convolutional Neural

Network: Defect

Classification

Manufacturing Defect Detection: High Tech Manufacturing

Page 6: Deep Learning For Vision Analytics - SAS: Analytics, Artificial Intelligence … · 2018-04-19 · assessment of motor vehicles, using image recognition software that will enable

Copyright © S AS Inst i tute Inc. A l l r i ghts reserved.

Manufacturing Defect Detection: Reduction in cost and increase in productivity

Eliminate chips with visual defectsRework chips where possible

Page 7: Deep Learning For Vision Analytics - SAS: Analytics, Artificial Intelligence … · 2018-04-19 · assessment of motor vehicles, using image recognition software that will enable

Copyright © S AS Inst i tute Inc. A l l r i ghts reserved.

More Use CasesFinancial Services Industry

Cognitive computing…

• Some insurers are experimenting with the idea of on-the-spot damage assessment of motor vehicles, using image recognition software that will enable damage assessment, by identifying the make and model of the car, and the extent of damage.

• Imaging technology is being used for identifying and removing fake social accounts and such image-based fake-identification has immense potential in enriching credit-scoring and risk-modelling of banks.

• Authenticating consumer identity documents for banking purposes.

• X-rays, scans, medical reports for insurance underwriting or policy management.

• Etc…

Page 8: Deep Learning For Vision Analytics - SAS: Analytics, Artificial Intelligence … · 2018-04-19 · assessment of motor vehicles, using image recognition software that will enable

Copyright © S AS Inst i tute Inc. A l l r i ghts reserved.

Workplace Safety Example: Hard hat image detection

Page 9: Deep Learning For Vision Analytics - SAS: Analytics, Artificial Intelligence … · 2018-04-19 · assessment of motor vehicles, using image recognition software that will enable

Copyright © S AS Inst i tute Inc. A l l r i ghts reserved.

Image Classification

• For us, identifying whether someone is wearing a hard hat or not is effortless

• How do we create and train a machine to do the same???

Page 10: Deep Learning For Vision Analytics - SAS: Analytics, Artificial Intelligence … · 2018-04-19 · assessment of motor vehicles, using image recognition software that will enable

Copyright © S AS Inst i tute Inc. A l l r i ghts reserved.

How?

Page 11: Deep Learning For Vision Analytics - SAS: Analytics, Artificial Intelligence … · 2018-04-19 · assessment of motor vehicles, using image recognition software that will enable

Copyright © S AS Inst i tute Inc. A l l r i ghts reserved.

Image Classification using Deep LearningConvolutional Neural Network (CNN)

• Convolutional neural network to analyse images.

• Why?• Powerful (analyse and classify

images very well)

• Efficient (less parameters than previous methods)

• CNN takes image (volume of pixels of varying values) and outputs probabilitySource: http://sww.sas.com/saspedia/Future_documentation_of_deep_learning

Page 12: Deep Learning For Vision Analytics - SAS: Analytics, Artificial Intelligence … · 2018-04-19 · assessment of motor vehicles, using image recognition software that will enable

Copyright © S AS Inst i tute Inc. A l l r i ghts reserved.

Types of CNN Architecture

• LeNet-5

• AlexNet

• VGG16

• Etc…

Page 13: Deep Learning For Vision Analytics - SAS: Analytics, Artificial Intelligence … · 2018-04-19 · assessment of motor vehicles, using image recognition software that will enable

Copyright © S AS Inst i tute Inc. A l l r i ghts reserved.

Example CNN architectureConvolution Layer

Source: https://www.packtpub.com/mapt/book/big_data_and_business_intelligence/9781788397872/6/ch06lvl1sec69/common-cnn-architecture---lenet

Page 14: Deep Learning For Vision Analytics - SAS: Analytics, Artificial Intelligence … · 2018-04-19 · assessment of motor vehicles, using image recognition software that will enable

Copyright © S AS Inst i tute Inc. A l l r i ghts reserved.

Convolution LayerEnables parameter sharing in a CNN

https://www.analyticsvidhya.com/blog/2017/06/architecture-of-convolutional-neural-networks-simplified-demystified/

Page 15: Deep Learning For Vision Analytics - SAS: Analytics, Artificial Intelligence … · 2018-04-19 · assessment of motor vehicles, using image recognition software that will enable

Copyright © S AS Inst i tute Inc. A l l r i ghts reserved.

Convolution LayerHow is it done?

Source: https://hackernoon.com/visualizing-parts-of-convolutional-neural-networks-using-keras-and-cats-5cc01b214e59

SWAT.deeplearn.addlayer(layer={‘type’:’convo’,‘nfilters’:1,‘height’:3,‘width’:3,‘stride’:1}

Page 16: Deep Learning For Vision Analytics - SAS: Analytics, Artificial Intelligence … · 2018-04-19 · assessment of motor vehicles, using image recognition software that will enable

Copyright © S AS Inst i tute Inc. A l l r i ghts reserved.

Feature ‘Detector’ & Feature Maps

Video example: https://www.youtube.com/watch?v=Gu0MkmynWkw

Source: https://adeshpande3.github.io/adeshpande3.github.io/A-Beginner's-Guide-To-Understanding-Convolutional-Neural-Networks/

Page 17: Deep Learning For Vision Analytics - SAS: Analytics, Artificial Intelligence … · 2018-04-19 · assessment of motor vehicles, using image recognition software that will enable

Copyright © S AS Inst i tute Inc. A l l r i ghts reserved.

Example CNN architecturePooling Layer

Source: https://www.packtpub.com/mapt/book/big_data_and_business_intelligence/9781788397872/6/ch06lvl1sec69/common-cnn-architecture---lenet

Page 18: Deep Learning For Vision Analytics - SAS: Analytics, Artificial Intelligence … · 2018-04-19 · assessment of motor vehicles, using image recognition software that will enable

Copyright © S AS Inst i tute Inc. A l l r i ghts reserved.

Pooling LayerReduces the number of trainable parameters in a CNN

https://www.analyticsvidhya.com/blog/2017/06/architecture-of-convolutional-neural-networks-simplified-demystified/

Page 19: Deep Learning For Vision Analytics - SAS: Analytics, Artificial Intelligence … · 2018-04-19 · assessment of motor vehicles, using image recognition software that will enable

Copyright © S AS Inst i tute Inc. A l l r i ghts reserved.

Pooling LayerHow is it done?

Video example: https://www.youtube.com/watch?v=mW3KyFZDNIQ

SWAT.deeplearn.addlayer(layer={‘type’:’pool’,‘height’:2,‘width’:2,‘stride’:2,‘pool’:’MAX’}

Source: https://en.wikipedia.org/wiki/Convolutional_neural_network

Page 20: Deep Learning For Vision Analytics - SAS: Analytics, Artificial Intelligence … · 2018-04-19 · assessment of motor vehicles, using image recognition software that will enable

Copyright © S AS Inst i tute Inc. A l l r i ghts reserved.

Example CNN architectureFully Connected Layer

Source: https://www.packtpub.com/mapt/book/big_data_and_business_intelligence/9781788397872/6/ch06lvl1sec69/common-cnn-architecture---lenet

Page 21: Deep Learning For Vision Analytics - SAS: Analytics, Artificial Intelligence … · 2018-04-19 · assessment of motor vehicles, using image recognition software that will enable

Copyright © S AS Inst i tute Inc. A l l r i ghts reserved.

Fully Connected LayerEnables high-level reasoning

• Neurons in a fully connected layer have connections to all activations in the previous layer(s), as seen in regular neural networks.

• Information flows through a neural network in 2 ways:

• Normal (Feedforward)

• Learning (Backpropogation)

https://www.youtube.com/watch?v=aircAruvnKk

Page 22: Deep Learning For Vision Analytics - SAS: Analytics, Artificial Intelligence … · 2018-04-19 · assessment of motor vehicles, using image recognition software that will enable

Copyright © S AS Inst i tute Inc. A l l r i ghts reserved.

Deployment

SAS VDMML(Model studio)

SAS ESP(Event streaming)

Training

Operational

Page 23: Deep Learning For Vision Analytics - SAS: Analytics, Artificial Intelligence … · 2018-04-19 · assessment of motor vehicles, using image recognition software that will enable

Copyright © S AS Inst i tute Inc. A l l r i ghts reserved.

Creating/training/scoring/deploying a CNNUsing deepLearn action sets in Jupyter Notebook on SAS Viya 3.3

Page 24: Deep Learning For Vision Analytics - SAS: Analytics, Artificial Intelligence … · 2018-04-19 · assessment of motor vehicles, using image recognition software that will enable

Copyright © S AS Inst i tute Inc. A l l r i ghts reserved.

Useful Links

• What’s New In SAS Deep Learning (Documentation)

http://go.documentation.sas.com/?docsetId=casdlpg&docsetTarget=p0uhs7ywfs6e4kn160kru9w97fyz.htm&docsetVersion=8.2&locale=en

• Understanding Convolutional Neural Networks

https://adeshpande3.github.io/A-Beginner%27s-Guide-To-Understanding-Convolutional-Neural-Networks/

• CS231n Convolutional Neural Networks for Visual Recognition

http://cs231n.github.io/