SlideShare a Scribd company logo
Intro to CNN
By Vincent Tatan
Google Data Analyst (Machine Learning)
Meet Vincent
Data Analyst (Machine Learning)
Trust & Safety
Disclaimer
This disclaimer informs readers that the views, thoughts, and opinions
expressed in the text belong solely to the author, and not necessarily to the
author’s employer, organization, committee or other group or individual.
This article was made purely as the author’s initiatives and in no way driven by
any other hidden agenda.
Path to Google
Visa
Business Intelligence Intern
May 16 - Jul 16
Lazada Group
Data Scientist Intern
Dec 16 - Apr 17B.Sc., Management Information
Systems and Services
Aug 13 - July 17
Visa
Data & Architecture
Engineer
Jun 17 - Aug 19
Google
Data Analyst, Machine Learning
Aug 19 - Present
Understanding CNN
Medium Articles
https://towardsdatascience.com/understanding-cnn-convolutional-neural-network-69fd626ee7d4
Colab Demonstration
Cat v.s. Dog using CNN
https://colab.sandbox.google.com/github/tensorflow/docs/blob/master/site/en/tutorials/images/classification.ipynb
Proprietary + Confidential
Today’s Agenda
1
2
3
4
Machine Learning in Image Recognition
Principles behind CNN: Convolution, ReLU, Max Pooling
CNN stacks + Fully Connected Layer
Avoiding Overfitting + Transfer Learning
1
Machine Learning in Image
Recognition
Classify objects in images1
Image Recognition is hard -- Are all of these cats?
My search for the word “cat”.
Warning -- Not all of these are cats.
We need an automatic way to determine critical features to identify cats or other objects.
Black color
Sharp ears
We need a way to determine the features scalably
2 Principles behind CNN
Convolution, ReLU, Max Pooling
Introducing Convolutional Neural Network (CNN)
Type of neural network comprising of different layers of convolutions
and max pooling mainly for image recognition
1. Convolution
2. ReLU Activation
3. Max Pooling
Intuition of Convolutional Neural Network
What do you see?
Young lady or old grandma or
both?
Intuition of Convolutional Neural Network
Psychologist Edwin Boring
introduced the painting of “My Wife
and My Mother-in-Law” where the
figure seems to morph from young
lady to old woman, to the public in
1930. (Source)
These boxes determined the features of the object that you would classify.
● The curve that changed into (ears/eyes)
● The straight line that changed into (choker/mouth)
Intuition of Convolutional Neural Network
CNN distinguishes meaningful features from a sequence of
pixels rather than pixel per pixel to classify the image
1 1 1 1
0 0 1 1
0 1 0 1
1 1 1 1
0 0 0 0
1 1 1 1
1 1 1 1
0 0 0 0
Principle of CNN: Convolution (1-D)
Which order of the element where I see there is a change from 1 to 0?
[1,1,1,1,0,0]
Hint: answer is [0,0,0,1,0]
Principle of CNN: Convolution (1-D)
Which order of the element where I see 1 becomes -1?
1 -11 1 1 1 0 0
1st element : 1*1 + 1*-1 = 0
2nd element : 1*1 + 1*-1 = 0
3rd element : 1*1 + 1*-1 = 0
4th element : 1*1 + 0*-1 = 1
5th element : 0*1 + 0*-1 = 0
End Result: 0 0 0 1 0
Principle of CNN: Convolution (2-D)
Same principle also applies to 2-D where you derive the feature map using the kernels (acts as
weights in NN). With this kernel you can find diagonal patterns
>
Principle of CNN: Convolution (2-D), 3 stacks
Feature Maps
Principle of CNN: Activation Function ReLU
The ReLU function introduces non linearity to activate on a “big enough” stimulus (sparse
activation). This method has been effective to solve vanishing gradients due to its constant 1 for
weight more than 1. Weights that are very small will remain as 0 after the ReLU activation
function.
Principle of CNN: Maxpooling(2-D)
CNN uses max pooling to replace output with a max summary to reduce data size and
processing time. This allows you to determine features that produce the highest impact
and reduces the risk of overfitting.
Recap
Understanding CNN
1. Convolution
2. ReLU Activation Function
3. Maxpooling
3
CNN Stacks + Fully Connected
Layer
Generating Real Results
CNN Stacks + Fully Connected Layer(2-D)
Take the Feature maps from CNN as the inputs and insert it into NN models which will calculate the
probabilities of the image to the labels assigned.
Finally, we will serve the convolutional and max pooling feature map outputs with Fully Connected Layer
(FCL). We flatten the feature outputs to column vector and feed-forward it to FCL. Every node in the previous
layer is connected to the last layer and represents which distinct label to output. FCL represents Artificial
Neural Network and has the final layer as MultiLayer Perceptron (MLP)
CNN Stacks: Cats vs Dogs
The discovery of curves
Fully Connected Layer Activation: Softmax
softmax activation function squashes the probability scores to add up to 1.0.
CNN Big Picture: Cats vs Dogs
The sensors of the neural
network might start by
understanding what edges
and colors it is looking at.
The last layer, called the fully
connected layer,
summarizes this analysis and
gives the probability of
whether it is looking at a dog.
A third layer is trying to
conceptualize what these
shapes represent (for
instance, is it an animal or
something else?).
Another layer is trying to
understand what shapes it is
looking at.
Using Tensorflow + Keras
Create and Compile our CNN
Change to
‘categorical_crossentropy’ for
softmax
CNN Stacks
Fully Connected Layer
Train our CNN
Results: Cats vs Dogs
Results: Cats vs Dogs
Overfitting!
loss: 0.0134
acc: 0.9965
val_loss: 3.5137
val_acc: 0.7290
4
Avoiding Overfitting + Transfer
Learning
Improve Generalization and leverage pretrained
model
Overfitting Mistakes: CNN
Common Mistakes Solutions
Using test set as the validation set to test the
model
Use validation sets as validation tests and test
models as final tests
Dataset is relatively small Image augmentations to add new variants of
images
Over Memorization Dropout/ reduce epochs/layers/neurons per layer
to increase generalizations
Overfitting Solutions: Data Augmentation
In the case of small training data set, you need to artificially boost the diversity and number of training examples.
One way of doing this is to add image augmentations and creating new variants. These include translating
images and creating dimension changes such as zoom, crop, flips, etc.
Overfitting Solutions: Data Augmentation
Overfitting Solutions: Dropout
You could also use regularization techniques such as Dropout to remove activation unit in every gradient step training.
Each epoch training deactivates different neurons.
Since the number of gradient steps is usually high, all neurons will averagely have same occurrences for dropout.
Intuitively, the more you drop out, the less likely your model memorizes.
Overfitting Solutions: Dropout
Overfitting Solutions: Dropout
Results: Cats vs Dogs
Much better
loss: 0.5622
acc: 0.7145
val_loss: 0.5090
val_acc: 0.7650
Results: Cats vs Dogs
Overfitting CNN
CNN with Dropout and Image
Augmentation
loss: 0.5622
acc: 0.7145
val_loss: 0.5090
val_acc: 0.7650
loss: 0.0134
acc: 0.9965
val_loss: 3.5137
val_acc: 0.7290
Transfer Learning: ImageNet
Transfer learning is a technique that reuses an existing model to the current model. You could produce on top of existing models that were
carefully designed by experts and trained with millions of pictures. You can freeze the model, then only apply the training for the high level
layers.
Proprietary + Confidential
Today’s Summary
1
2
3
4
Machine Learning in Image Recognition
Principles behind CNN: Convolution, ReLU, Max Pooling
CNN stacks + Fully Connected Layer
Avoiding Overfitting + Transfer Learning
Proprietary + Confidential
Today’s Summary
Machine Learning in Image Recognition
Principles behind CNN: Convolution, ReLU, Max Pooling
CNN stacks + Fully Connected Layer
Transfer Learning
Avoiding Overfitting + Transfer Learning
04
● Data Augmentation: artificially boost diversity and number of training examples
● Dropout: Regularization Techniques to remove activation unit in every gradient
step training. Each epoch training deactivates different neurons.
● Transfer learning is a technique that reuses an existing model to the current
model. You could produce on top of existing models that were carefully
designed by experts and trained with millions of pictures.
CNN Stacks +Fully Connected Layer
03
● Fully Connected Layer: Take the Feature maps from CNN as the inputs and
insert it into NN models which will calculate the probabilities of the image to the
labels assigned.
● Softmax activation function which assign decimal probabilities for each
possible label which add up to 1.0.
Principles behind CNN: Convolution, ReLU, and
Max Pooling02
● Convolution: Same principle also applies to 2-D where you derive from the
feature map using the kernels (acts as weights in NN).
● The ReLU function introduces non linearity to activate on a “big enough”
stimulus (sparse activation).
● Max pooling to replace output with a max summary to reduce data size and
processing time.
Machine Learning in Image Recognition
01
● Classical Image Recognition Allows you to extract features and derive
characteristics.
● Convolution Neural Network (CNN) Deep learning techniques using
convolutions, max pooling to share weights, produce critical features, and
classify labels. Commonly used in image classifications
Reach out to me :)
Medium : towardsdatascience.com/@vincentkernn
Linkedin : linkedin.com/in/vincenttatan/
1-1 Mentorship: https://bit.ly/328Dp8k
Referrals open for engineers, analysts, interns!
https://forms.gle/iyo4oJtqKpQ1MgWy5

More Related Content

What's hot

Transfer Learning
Transfer LearningTransfer Learning
Transfer Learning
Hichem Felouat
 
Understanding cnn
Understanding cnnUnderstanding cnn
Understanding cnn
Rucha Gole
 
Convolutional neural network
Convolutional neural networkConvolutional neural network
Convolutional neural network
Ferdous ahmed
 
Skin Lesion Detection from Dermoscopic Images using Convolutional Neural Netw...
Skin Lesion Detection from Dermoscopic Images using Convolutional Neural Netw...Skin Lesion Detection from Dermoscopic Images using Convolutional Neural Netw...
Skin Lesion Detection from Dermoscopic Images using Convolutional Neural Netw...
Universitat Politècnica de Catalunya
 
Artificial Neural Networks Lect3: Neural Network Learning rules
Artificial Neural Networks Lect3: Neural Network Learning rulesArtificial Neural Networks Lect3: Neural Network Learning rules
Artificial Neural Networks Lect3: Neural Network Learning rules
Mohammed Bennamoun
 
Transfer Learning: An overview
Transfer Learning: An overviewTransfer Learning: An overview
Transfer Learning: An overview
jins0618
 
Transfer Learning and Fine-tuning Deep Neural Networks
 Transfer Learning and Fine-tuning Deep Neural Networks Transfer Learning and Fine-tuning Deep Neural Networks
Transfer Learning and Fine-tuning Deep Neural Networks
PyData
 
Random Forest Classifier in Machine Learning | Palin Analytics
Random Forest Classifier in Machine Learning | Palin AnalyticsRandom Forest Classifier in Machine Learning | Palin Analytics
Random Forest Classifier in Machine Learning | Palin Analytics
Palin analytics
 
CONVOLUTIONAL NEURAL NETWORK
CONVOLUTIONAL NEURAL NETWORKCONVOLUTIONAL NEURAL NETWORK
CONVOLUTIONAL NEURAL NETWORK
Md Rajib Bhuiyan
 
NeRF: Representing Scenes as Neural Radiance Fields for View Synthesis
NeRF: Representing Scenes as Neural Radiance Fields for View Synthesis NeRF: Representing Scenes as Neural Radiance Fields for View Synthesis
NeRF: Representing Scenes as Neural Radiance Fields for View Synthesis
taeseon ryu
 
Recurrent neural networks rnn
Recurrent neural networks   rnnRecurrent neural networks   rnn
Recurrent neural networks rnn
Kuppusamy P
 
Multi tasking learning
Multi tasking learningMulti tasking learning
Multi tasking learning
ShreyusPuthiyapurail
 
Autoencoder
AutoencoderAutoencoder
Autoencoder
HARISH R
 
Meta-Learning Presentation
Meta-Learning PresentationMeta-Learning Presentation
Meta-Learning Presentation
AkshayaNagarajan10
 
Deep Learning - Convolutional Neural Networks
Deep Learning - Convolutional Neural NetworksDeep Learning - Convolutional Neural Networks
Deep Learning - Convolutional Neural Networks
Christian Perone
 
Convolutional Neural Networks : Popular Architectures
Convolutional Neural Networks : Popular ArchitecturesConvolutional Neural Networks : Popular Architectures
Convolutional Neural Networks : Popular Architectures
ananth
 
Artificial Neural Network
Artificial Neural NetworkArtificial Neural Network
Artificial Neural Network
Muhammad Ishaq
 
1. Introduction to deep learning.pptx
1. Introduction to deep learning.pptx1. Introduction to deep learning.pptx
1. Introduction to deep learning.pptx
Omer Tariq
 
cnn ppt.pptx
cnn ppt.pptxcnn ppt.pptx
cnn ppt.pptx
rohithprabhas1
 
Artificial neural networks
Artificial neural networksArtificial neural networks
Artificial neural networks
stellajoseph
 

What's hot (20)

Transfer Learning
Transfer LearningTransfer Learning
Transfer Learning
 
Understanding cnn
Understanding cnnUnderstanding cnn
Understanding cnn
 
Convolutional neural network
Convolutional neural networkConvolutional neural network
Convolutional neural network
 
Skin Lesion Detection from Dermoscopic Images using Convolutional Neural Netw...
Skin Lesion Detection from Dermoscopic Images using Convolutional Neural Netw...Skin Lesion Detection from Dermoscopic Images using Convolutional Neural Netw...
Skin Lesion Detection from Dermoscopic Images using Convolutional Neural Netw...
 
Artificial Neural Networks Lect3: Neural Network Learning rules
Artificial Neural Networks Lect3: Neural Network Learning rulesArtificial Neural Networks Lect3: Neural Network Learning rules
Artificial Neural Networks Lect3: Neural Network Learning rules
 
Transfer Learning: An overview
Transfer Learning: An overviewTransfer Learning: An overview
Transfer Learning: An overview
 
Transfer Learning and Fine-tuning Deep Neural Networks
 Transfer Learning and Fine-tuning Deep Neural Networks Transfer Learning and Fine-tuning Deep Neural Networks
Transfer Learning and Fine-tuning Deep Neural Networks
 
Random Forest Classifier in Machine Learning | Palin Analytics
Random Forest Classifier in Machine Learning | Palin AnalyticsRandom Forest Classifier in Machine Learning | Palin Analytics
Random Forest Classifier in Machine Learning | Palin Analytics
 
CONVOLUTIONAL NEURAL NETWORK
CONVOLUTIONAL NEURAL NETWORKCONVOLUTIONAL NEURAL NETWORK
CONVOLUTIONAL NEURAL NETWORK
 
NeRF: Representing Scenes as Neural Radiance Fields for View Synthesis
NeRF: Representing Scenes as Neural Radiance Fields for View Synthesis NeRF: Representing Scenes as Neural Radiance Fields for View Synthesis
NeRF: Representing Scenes as Neural Radiance Fields for View Synthesis
 
Recurrent neural networks rnn
Recurrent neural networks   rnnRecurrent neural networks   rnn
Recurrent neural networks rnn
 
Multi tasking learning
Multi tasking learningMulti tasking learning
Multi tasking learning
 
Autoencoder
AutoencoderAutoencoder
Autoencoder
 
Meta-Learning Presentation
Meta-Learning PresentationMeta-Learning Presentation
Meta-Learning Presentation
 
Deep Learning - Convolutional Neural Networks
Deep Learning - Convolutional Neural NetworksDeep Learning - Convolutional Neural Networks
Deep Learning - Convolutional Neural Networks
 
Convolutional Neural Networks : Popular Architectures
Convolutional Neural Networks : Popular ArchitecturesConvolutional Neural Networks : Popular Architectures
Convolutional Neural Networks : Popular Architectures
 
Artificial Neural Network
Artificial Neural NetworkArtificial Neural Network
Artificial Neural Network
 
1. Introduction to deep learning.pptx
1. Introduction to deep learning.pptx1. Introduction to deep learning.pptx
1. Introduction to deep learning.pptx
 
cnn ppt.pptx
cnn ppt.pptxcnn ppt.pptx
cnn ppt.pptx
 
Artificial neural networks
Artificial neural networksArtificial neural networks
Artificial neural networks
 

Similar to Dssg talk CNN intro

[Revised] Intro to CNN
[Revised] Intro to CNN[Revised] Intro to CNN
[Revised] Intro to CNN
Vincent Tatan
 
Classification case study + intro to cnn
Classification case study + intro to cnnClassification case study + intro to cnn
Classification case study + intro to cnn
Vincent Tatan
 
Deep Neural Network DNN.docx
Deep Neural Network DNN.docxDeep Neural Network DNN.docx
Deep Neural Network DNN.docx
jaffarbikat
 
Deep learning
Deep learningDeep learning
Deep learning
Aman Kamboj
 
Introduction to convolutional networks .pptx
Introduction to convolutional networks .pptxIntroduction to convolutional networks .pptx
Introduction to convolutional networks .pptx
ArunNegi37
 
Introduction to Convolutional Neural Networks
Introduction to Convolutional Neural NetworksIntroduction to Convolutional Neural Networks
Introduction to Convolutional Neural Networks
ParrotAI
 
SeRanet introduction
SeRanet introductionSeRanet introduction
SeRanet introduction
Kosuke Nakago
 
AI and Deep Learning
AI and Deep Learning AI and Deep Learning
AI and Deep Learning
Subrat Panda, PhD
 
IRJET-Multiclass Classification Method Based On Deep Learning For Leaf Identi...
IRJET-Multiclass Classification Method Based On Deep Learning For Leaf Identi...IRJET-Multiclass Classification Method Based On Deep Learning For Leaf Identi...
IRJET-Multiclass Classification Method Based On Deep Learning For Leaf Identi...
IRJET Journal
 
11_Saloni Malhotra_SummerTraining_PPT.pptx
11_Saloni Malhotra_SummerTraining_PPT.pptx11_Saloni Malhotra_SummerTraining_PPT.pptx
11_Saloni Malhotra_SummerTraining_PPT.pptx
SaloniMalhotra23
 
Comparison of Various RCNN techniques for Classification of Object from Image
Comparison of Various RCNN techniques for Classification of Object from ImageComparison of Various RCNN techniques for Classification of Object from Image
Comparison of Various RCNN techniques for Classification of Object from Image
IRJET Journal
 
Classification of Images Using CNN Model and its Variants
Classification of Images Using CNN Model and its VariantsClassification of Images Using CNN Model and its Variants
Classification of Images Using CNN Model and its Variants
IRJET Journal
 
Java and Deep Learning
Java and Deep LearningJava and Deep Learning
Java and Deep Learning
Oswald Campesato
 
Android and Deep Learning
Android and Deep LearningAndroid and Deep Learning
Android and Deep Learning
Oswald Campesato
 
Diving into Deep Learning (Silicon Valley Code Camp 2017)
Diving into Deep Learning (Silicon Valley Code Camp 2017)Diving into Deep Learning (Silicon Valley Code Camp 2017)
Diving into Deep Learning (Silicon Valley Code Camp 2017)
Oswald Campesato
 
Separating Hype from Reality in Deep Learning with Sameer Farooqui
 Separating Hype from Reality in Deep Learning with Sameer Farooqui Separating Hype from Reality in Deep Learning with Sameer Farooqui
Separating Hype from Reality in Deep Learning with Sameer Farooqui
Databricks
 
Ultrasound Nerve Segmentation
Ultrasound Nerve Segmentation Ultrasound Nerve Segmentation
Ultrasound Nerve Segmentation
Sneha Ravikumar
 
Deep Computer Vision - 1.pptx
Deep Computer Vision - 1.pptxDeep Computer Vision - 1.pptx
Deep Computer Vision - 1.pptx
JawadHaider36
 
DL.pdf
DL.pdfDL.pdf
DL.pdf
ssuserd23711
 
Convolutional Neural Network and Its Applications
Convolutional Neural Network and Its ApplicationsConvolutional Neural Network and Its Applications
Convolutional Neural Network and Its Applications
Kasun Chinthaka Piyarathna
 

Similar to Dssg talk CNN intro (20)

[Revised] Intro to CNN
[Revised] Intro to CNN[Revised] Intro to CNN
[Revised] Intro to CNN
 
Classification case study + intro to cnn
Classification case study + intro to cnnClassification case study + intro to cnn
Classification case study + intro to cnn
 
Deep Neural Network DNN.docx
Deep Neural Network DNN.docxDeep Neural Network DNN.docx
Deep Neural Network DNN.docx
 
Deep learning
Deep learningDeep learning
Deep learning
 
Introduction to convolutional networks .pptx
Introduction to convolutional networks .pptxIntroduction to convolutional networks .pptx
Introduction to convolutional networks .pptx
 
Introduction to Convolutional Neural Networks
Introduction to Convolutional Neural NetworksIntroduction to Convolutional Neural Networks
Introduction to Convolutional Neural Networks
 
SeRanet introduction
SeRanet introductionSeRanet introduction
SeRanet introduction
 
AI and Deep Learning
AI and Deep Learning AI and Deep Learning
AI and Deep Learning
 
IRJET-Multiclass Classification Method Based On Deep Learning For Leaf Identi...
IRJET-Multiclass Classification Method Based On Deep Learning For Leaf Identi...IRJET-Multiclass Classification Method Based On Deep Learning For Leaf Identi...
IRJET-Multiclass Classification Method Based On Deep Learning For Leaf Identi...
 
11_Saloni Malhotra_SummerTraining_PPT.pptx
11_Saloni Malhotra_SummerTraining_PPT.pptx11_Saloni Malhotra_SummerTraining_PPT.pptx
11_Saloni Malhotra_SummerTraining_PPT.pptx
 
Comparison of Various RCNN techniques for Classification of Object from Image
Comparison of Various RCNN techniques for Classification of Object from ImageComparison of Various RCNN techniques for Classification of Object from Image
Comparison of Various RCNN techniques for Classification of Object from Image
 
Classification of Images Using CNN Model and its Variants
Classification of Images Using CNN Model and its VariantsClassification of Images Using CNN Model and its Variants
Classification of Images Using CNN Model and its Variants
 
Java and Deep Learning
Java and Deep LearningJava and Deep Learning
Java and Deep Learning
 
Android and Deep Learning
Android and Deep LearningAndroid and Deep Learning
Android and Deep Learning
 
Diving into Deep Learning (Silicon Valley Code Camp 2017)
Diving into Deep Learning (Silicon Valley Code Camp 2017)Diving into Deep Learning (Silicon Valley Code Camp 2017)
Diving into Deep Learning (Silicon Valley Code Camp 2017)
 
Separating Hype from Reality in Deep Learning with Sameer Farooqui
 Separating Hype from Reality in Deep Learning with Sameer Farooqui Separating Hype from Reality in Deep Learning with Sameer Farooqui
Separating Hype from Reality in Deep Learning with Sameer Farooqui
 
Ultrasound Nerve Segmentation
Ultrasound Nerve Segmentation Ultrasound Nerve Segmentation
Ultrasound Nerve Segmentation
 
Deep Computer Vision - 1.pptx
Deep Computer Vision - 1.pptxDeep Computer Vision - 1.pptx
Deep Computer Vision - 1.pptx
 
DL.pdf
DL.pdfDL.pdf
DL.pdf
 
Convolutional Neural Network and Its Applications
Convolutional Neural Network and Its ApplicationsConvolutional Neural Network and Its Applications
Convolutional Neural Network and Its Applications
 

More from Vincent Tatan

Life of a ML Engineer [Redacted].pptx
Life of a ML Engineer [Redacted].pptxLife of a ML Engineer [Redacted].pptx
Life of a ML Engineer [Redacted].pptx
Vincent Tatan
 
Introduction to ml ops in daily apps
Introduction to ml ops in daily appsIntroduction to ml ops in daily apps
Introduction to ml ops in daily apps
Vincent Tatan
 
[Master] unboxing design docs for data scientists
[Master] unboxing design docs for data scientists[Master] unboxing design docs for data scientists
[Master] unboxing design docs for data scientists
Vincent Tatan
 
Listen, check, and pay
Listen, check, and payListen, check, and pay
Listen, check, and pay
Vincent Tatan
 
Intro to ml lesson vincent
Intro to ml lesson vincentIntro to ml lesson vincent
Intro to ml lesson vincent
Vincent Tatan
 
Overcoming Imposter Syndrome
Overcoming Imposter SyndromeOvercoming Imposter Syndrome
Overcoming Imposter Syndrome
Vincent Tatan
 
SAS Slides FINALE (2)
SAS Slides FINALE (2)SAS Slides FINALE (2)
SAS Slides FINALE (2)
Vincent Tatan
 
Doc 14 Jan 2016%2c 1014-rotated (1)
Doc 14 Jan 2016%2c 1014-rotated (1)Doc 14 Jan 2016%2c 1014-rotated (1)
Doc 14 Jan 2016%2c 1014-rotated (1)Vincent Tatan
 

More from Vincent Tatan (8)

Life of a ML Engineer [Redacted].pptx
Life of a ML Engineer [Redacted].pptxLife of a ML Engineer [Redacted].pptx
Life of a ML Engineer [Redacted].pptx
 
Introduction to ml ops in daily apps
Introduction to ml ops in daily appsIntroduction to ml ops in daily apps
Introduction to ml ops in daily apps
 
[Master] unboxing design docs for data scientists
[Master] unboxing design docs for data scientists[Master] unboxing design docs for data scientists
[Master] unboxing design docs for data scientists
 
Listen, check, and pay
Listen, check, and payListen, check, and pay
Listen, check, and pay
 
Intro to ml lesson vincent
Intro to ml lesson vincentIntro to ml lesson vincent
Intro to ml lesson vincent
 
Overcoming Imposter Syndrome
Overcoming Imposter SyndromeOvercoming Imposter Syndrome
Overcoming Imposter Syndrome
 
SAS Slides FINALE (2)
SAS Slides FINALE (2)SAS Slides FINALE (2)
SAS Slides FINALE (2)
 
Doc 14 Jan 2016%2c 1014-rotated (1)
Doc 14 Jan 2016%2c 1014-rotated (1)Doc 14 Jan 2016%2c 1014-rotated (1)
Doc 14 Jan 2016%2c 1014-rotated (1)
 

Recently uploaded

“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
Edge AI and Vision Alliance
 
Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
DianaGray10
 
UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
DianaGray10
 
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial IntelligenceAI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
IndexBug
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
mikeeftimakis1
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
Zilliz
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
KAMESHS29
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Safe Software
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Malak Abu Hammad
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc
 
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
SOFTTECHHUB
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
panagenda
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
Octavian Nadolu
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
innovationoecd
 
GenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizationsGenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizations
kumardaparthi1024
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
danishmna97
 
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Speck&Tech
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
Kari Kakkonen
 
UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
DianaGray10
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Paige Cruz
 

Recently uploaded (20)

“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
 
Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
 
UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
 
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial IntelligenceAI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
 
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
 
GenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizationsGenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizations
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
 
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
 
UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
 

Dssg talk CNN intro

  • 1. Intro to CNN By Vincent Tatan Google Data Analyst (Machine Learning)
  • 2. Meet Vincent Data Analyst (Machine Learning) Trust & Safety
  • 3. Disclaimer This disclaimer informs readers that the views, thoughts, and opinions expressed in the text belong solely to the author, and not necessarily to the author’s employer, organization, committee or other group or individual. This article was made purely as the author’s initiatives and in no way driven by any other hidden agenda.
  • 4. Path to Google Visa Business Intelligence Intern May 16 - Jul 16 Lazada Group Data Scientist Intern Dec 16 - Apr 17B.Sc., Management Information Systems and Services Aug 13 - July 17 Visa Data & Architecture Engineer Jun 17 - Aug 19 Google Data Analyst, Machine Learning Aug 19 - Present
  • 6. Colab Demonstration Cat v.s. Dog using CNN https://colab.sandbox.google.com/github/tensorflow/docs/blob/master/site/en/tutorials/images/classification.ipynb
  • 7. Proprietary + Confidential Today’s Agenda 1 2 3 4 Machine Learning in Image Recognition Principles behind CNN: Convolution, ReLU, Max Pooling CNN stacks + Fully Connected Layer Avoiding Overfitting + Transfer Learning
  • 8. 1 Machine Learning in Image Recognition Classify objects in images1
  • 9. Image Recognition is hard -- Are all of these cats? My search for the word “cat”.
  • 10. Warning -- Not all of these are cats. We need an automatic way to determine critical features to identify cats or other objects. Black color Sharp ears
  • 11. We need a way to determine the features scalably
  • 12. 2 Principles behind CNN Convolution, ReLU, Max Pooling
  • 13. Introducing Convolutional Neural Network (CNN) Type of neural network comprising of different layers of convolutions and max pooling mainly for image recognition 1. Convolution 2. ReLU Activation 3. Max Pooling
  • 14. Intuition of Convolutional Neural Network What do you see? Young lady or old grandma or both?
  • 15. Intuition of Convolutional Neural Network Psychologist Edwin Boring introduced the painting of “My Wife and My Mother-in-Law” where the figure seems to morph from young lady to old woman, to the public in 1930. (Source) These boxes determined the features of the object that you would classify. ● The curve that changed into (ears/eyes) ● The straight line that changed into (choker/mouth)
  • 16. Intuition of Convolutional Neural Network CNN distinguishes meaningful features from a sequence of pixels rather than pixel per pixel to classify the image 1 1 1 1 0 0 1 1 0 1 0 1 1 1 1 1 0 0 0 0 1 1 1 1 1 1 1 1 0 0 0 0
  • 17. Principle of CNN: Convolution (1-D) Which order of the element where I see there is a change from 1 to 0? [1,1,1,1,0,0] Hint: answer is [0,0,0,1,0]
  • 18. Principle of CNN: Convolution (1-D) Which order of the element where I see 1 becomes -1? 1 -11 1 1 1 0 0 1st element : 1*1 + 1*-1 = 0 2nd element : 1*1 + 1*-1 = 0 3rd element : 1*1 + 1*-1 = 0 4th element : 1*1 + 0*-1 = 1 5th element : 0*1 + 0*-1 = 0 End Result: 0 0 0 1 0
  • 19. Principle of CNN: Convolution (2-D) Same principle also applies to 2-D where you derive the feature map using the kernels (acts as weights in NN). With this kernel you can find diagonal patterns >
  • 20. Principle of CNN: Convolution (2-D), 3 stacks Feature Maps
  • 21. Principle of CNN: Activation Function ReLU The ReLU function introduces non linearity to activate on a “big enough” stimulus (sparse activation). This method has been effective to solve vanishing gradients due to its constant 1 for weight more than 1. Weights that are very small will remain as 0 after the ReLU activation function.
  • 22. Principle of CNN: Maxpooling(2-D) CNN uses max pooling to replace output with a max summary to reduce data size and processing time. This allows you to determine features that produce the highest impact and reduces the risk of overfitting.
  • 23. Recap Understanding CNN 1. Convolution 2. ReLU Activation Function 3. Maxpooling
  • 24. 3 CNN Stacks + Fully Connected Layer Generating Real Results
  • 25. CNN Stacks + Fully Connected Layer(2-D) Take the Feature maps from CNN as the inputs and insert it into NN models which will calculate the probabilities of the image to the labels assigned. Finally, we will serve the convolutional and max pooling feature map outputs with Fully Connected Layer (FCL). We flatten the feature outputs to column vector and feed-forward it to FCL. Every node in the previous layer is connected to the last layer and represents which distinct label to output. FCL represents Artificial Neural Network and has the final layer as MultiLayer Perceptron (MLP)
  • 26. CNN Stacks: Cats vs Dogs The discovery of curves
  • 27. Fully Connected Layer Activation: Softmax softmax activation function squashes the probability scores to add up to 1.0.
  • 28. CNN Big Picture: Cats vs Dogs The sensors of the neural network might start by understanding what edges and colors it is looking at. The last layer, called the fully connected layer, summarizes this analysis and gives the probability of whether it is looking at a dog. A third layer is trying to conceptualize what these shapes represent (for instance, is it an animal or something else?). Another layer is trying to understand what shapes it is looking at.
  • 30. Create and Compile our CNN Change to ‘categorical_crossentropy’ for softmax CNN Stacks Fully Connected Layer
  • 33. Results: Cats vs Dogs Overfitting! loss: 0.0134 acc: 0.9965 val_loss: 3.5137 val_acc: 0.7290
  • 34. 4 Avoiding Overfitting + Transfer Learning Improve Generalization and leverage pretrained model
  • 35. Overfitting Mistakes: CNN Common Mistakes Solutions Using test set as the validation set to test the model Use validation sets as validation tests and test models as final tests Dataset is relatively small Image augmentations to add new variants of images Over Memorization Dropout/ reduce epochs/layers/neurons per layer to increase generalizations
  • 36. Overfitting Solutions: Data Augmentation In the case of small training data set, you need to artificially boost the diversity and number of training examples. One way of doing this is to add image augmentations and creating new variants. These include translating images and creating dimension changes such as zoom, crop, flips, etc.
  • 38. Overfitting Solutions: Dropout You could also use regularization techniques such as Dropout to remove activation unit in every gradient step training. Each epoch training deactivates different neurons. Since the number of gradient steps is usually high, all neurons will averagely have same occurrences for dropout. Intuitively, the more you drop out, the less likely your model memorizes.
  • 41. Results: Cats vs Dogs Much better loss: 0.5622 acc: 0.7145 val_loss: 0.5090 val_acc: 0.7650
  • 42. Results: Cats vs Dogs Overfitting CNN CNN with Dropout and Image Augmentation loss: 0.5622 acc: 0.7145 val_loss: 0.5090 val_acc: 0.7650 loss: 0.0134 acc: 0.9965 val_loss: 3.5137 val_acc: 0.7290
  • 43. Transfer Learning: ImageNet Transfer learning is a technique that reuses an existing model to the current model. You could produce on top of existing models that were carefully designed by experts and trained with millions of pictures. You can freeze the model, then only apply the training for the high level layers.
  • 44. Proprietary + Confidential Today’s Summary 1 2 3 4 Machine Learning in Image Recognition Principles behind CNN: Convolution, ReLU, Max Pooling CNN stacks + Fully Connected Layer Avoiding Overfitting + Transfer Learning
  • 45. Proprietary + Confidential Today’s Summary Machine Learning in Image Recognition Principles behind CNN: Convolution, ReLU, Max Pooling CNN stacks + Fully Connected Layer Transfer Learning Avoiding Overfitting + Transfer Learning 04 ● Data Augmentation: artificially boost diversity and number of training examples ● Dropout: Regularization Techniques to remove activation unit in every gradient step training. Each epoch training deactivates different neurons. ● Transfer learning is a technique that reuses an existing model to the current model. You could produce on top of existing models that were carefully designed by experts and trained with millions of pictures. CNN Stacks +Fully Connected Layer 03 ● Fully Connected Layer: Take the Feature maps from CNN as the inputs and insert it into NN models which will calculate the probabilities of the image to the labels assigned. ● Softmax activation function which assign decimal probabilities for each possible label which add up to 1.0. Principles behind CNN: Convolution, ReLU, and Max Pooling02 ● Convolution: Same principle also applies to 2-D where you derive from the feature map using the kernels (acts as weights in NN). ● The ReLU function introduces non linearity to activate on a “big enough” stimulus (sparse activation). ● Max pooling to replace output with a max summary to reduce data size and processing time. Machine Learning in Image Recognition 01 ● Classical Image Recognition Allows you to extract features and derive characteristics. ● Convolution Neural Network (CNN) Deep learning techniques using convolutions, max pooling to share weights, produce critical features, and classify labels. Commonly used in image classifications
  • 46. Reach out to me :) Medium : towardsdatascience.com/@vincentkernn Linkedin : linkedin.com/in/vincenttatan/ 1-1 Mentorship: https://bit.ly/328Dp8k Referrals open for engineers, analysts, interns! https://forms.gle/iyo4oJtqKpQ1MgWy5