SlideShare a Scribd company logo
Convolutional Neural Networks
RTSS JUN YOUNG PARK
What is Covnet(CNN) ?
C R C R P
…
DOG
POLAR BEAR
WOLF
ELEPHANT
FC
Reduce
Dimension
Discrete Convolution
1 2 3 0
0 1 2 3
3 0 1 2
2 3 0 1
2 0 1
0 1 2
1 0 2
*
15 16
6 15
2 0 3
0 1 4
3 0 2
- FMA(Fused Multiply-Add) for each area to get each ‘Value’
Multiply for each elements
Input data Kernel Output data
Σ
Padding
SAME VALID
0 0 0 0 0 0
0 12 27 7 3 0
0 31 9 6 8 0
0 9 15 3 12 0
0 6 3 30 13 0
0 0 0 0 0 0
12 27 7 3
31 9 6 8
9 15 3 12
6 3 30 13
Padding = 1
Stride - 1
KERNEL = 3X3, STRIDE = 1, PADDING = SAME
0 0 0 0 0 0 0
0 7 10 2 9 3 0
0 12 27 7 3 2 0
0 31 9 6 8 6 0
0 9 15 3 12 4 0
0 6 3 30 13 5 0
0 0 0 0 0 0 0
a b c d e
f g h i j
k l m n o
p .. .. .. ..
.. .. .. .. ..
2 0 1
0 1 2
1 0 2
* =
Stride
Stride - 2
KERNEL = 3X3, STRIDE = 2, PADDING = SAME
0 0 0 0 0 0 0
0 7 10 2 9 3 0
0 12 27 7 3 2 0
0 31 9 6 8 6 0
0 9 15 3 12 4 0
0 6 3 30 13 5 0
0 0 0 0 0 0 0
A B C
D E F
G H I
2 0 1
0 1 2
1 0 2
* =
Stride
Output Size
𝑆𝑆𝑍𝑍𝑜𝑜𝑜𝑜𝑜𝑜𝑜𝑜𝑜𝑜𝑜𝑜 =
𝑁𝑁−𝐹𝐹
𝑆𝑆𝑆𝑆𝑆𝑆𝑆𝑆 𝑆𝑆𝑆𝑆
+ 1
𝑉𝑉𝑉𝑉𝑉𝑉𝑉𝑉𝑉𝑉 𝑤𝑤𝑤𝑤𝑤𝑤𝑤 𝑆𝑆𝑍𝑍𝑜𝑜𝑜𝑜𝑜𝑜𝑜𝑜𝑜𝑜𝑜𝑜 ∈ 𝑁𝑁
0 0 0 0 0 0 0
0 7 10 2 9 3 0
0 12 27 7 3 2 0
0 31 9 6 8 6 0
0 9 15 3 12 4 0
0 6 3 30 13 5 0
0 0 0 0 0 0 0
Fully Connected Layer
C R C R P
…
DOG
POLAR BEAR
WOLF
ELEPHANT
FC
Reduce
Dimension
By previous procedures …
P
32 x 32 x 3
x Build Classifier
<Feature extraction> <Classification>
Convolution Layers
Filter
(28, 28, 6)(32, 32, 3)
Convolution,
ReLU
With
6 (5,5,3)
filters
With
10 (5,5,6)
filters
(24, 24, 10)
……
𝑁𝑁𝑝𝑝𝑝𝑝𝑝𝑝𝑝𝑝𝑝𝑝𝑝𝑝 = 5 ∗ 5 ∗ 3 ∗ 6 + 5 ∗ 5 ∗ 6 ∗ 10
Convolution,
ReLU
Pooling layer
Convolution layer
Size Reduction
Pooling
Slice !
Pooling (Subsampling)
◦ Object
◦ To reduce Rows/Cols from the matrix
◦ Advantage
◦ No parameters to train
◦ Invariable channels
◦ Not affected by variance of input
◦ Method
◦ Max Pooling
Use maximum value of the target area
◦ Mean Pooling
Use average value of the target area
31 8
15 30
12 27 7 3
31 9 6 8
9 15 3 12
6 3 30 13
12 27 7 3
31 9 6 8
9 15 3 12
6 3 30 13
12.25 6.00
8.25 14.50
<Max Pooling>
<Mean Pooling>
Kernel : 2x2
Stride : 2
Applications
◦ LeNet-5 (1998)
◦ AlexNet (2012)
◦ GoogLeNet (2014)
◦ Inception module : Parallel composition of layers.
◦ 1x1 convolution : Mathematically equivalent to a multi-layer perceptron.
◦ ResNet (2015)
◦ Fast Forward : Step over to skip some layers (Residual Net)
Practical Use
◦ Build NN with simplified API and Class by TensorFlow
◦ Training with MNIST dataset
◦ Test with MNIST dataset and ‘Hand-Written’ own data.
◦ Applying some techniques that we discussed before
◦ Ensemble, Dropout, Batch
Define class for a model
Model
+ keep_prop
+ X, Y
+ sess
+ name
+ bool training
+ layers(conv, pool, dropout, dense …)
+ __init__(self, sess, name)
+ _build_net(self)
+ predict(self,x_test,training)
+ get_accuracy(self,x_test,y_test,training=False)
+ train(self,x_data_y_data_training=True)
Shape of Layers
IMG
[32, 32, 1] FILTER1
[32, 32, 32]
POOL1
[16, 16, 32]
FILTER2
[16, 16, 64]
POOL2
[8, 8, 64]
FILTER3
[8, 8, 128] POOL3
[4, 4, 128]
ReLU
ReLU ReLU
[4*4*128, 625]
Flatten ReLU
Drop
Drop
[625,
10]
Logits : 0 ~ 9
# of filters
Stride = 2
Stride = 2
Stride = 2
Implement Layers
Implement Ensemble
Model 1 . . . Model 10
Predict Predict
+
Predictions
mean
Test Result
◦ Model : 5
◦ Epoch : 15
◦ Ensemble Accuracy : 99.05%
Test ‘Hand-Written’ Data
Scan & Resample for
each numbers
Image to Test
[28,28,1] - Bitmap
Load Image
Self Assignment
◦ 미완성된 자필 숫자 인식기를 완성하라.
◦ 문제점
◦ pyplot.imshow() 메소드가 이미지를 자동으로 4채널(RGBA) 로 읽어 들임. (해결)
◦ Type Mismatch 오류, TensorFlow 에서 필요로 하는 Type을 제대로 설정하지 못하였을 가능성.
Trial and Error
◦ Convert RGB image to mono(gray) bitmap
Troubleshooting
◦ Content of MNIST dataset
……
Black (Background)
White (Content)
# of Test Images
Size of each image
(784 = 28*28)
Troubleshooting
◦ Causes of failure
◦ Different from MNIST dataset, Hand-Written data have black content and white background.
◦ After convert to grayscale, each pixel has too large value different from MNIST dataset.
◦ Solutions
◦ Invert Hand-Written data to have black background and white content.
◦ Normalize grayscale converted image.
Troubleshooting
◦ Read each image from the floder
◦ Convert to grayscale (28x28x3 -> 28x28)
◦ Reshape (28x28 -> 784)
◦ Append the image to the list.
◦ Convert the list to ndarray.
◦ Apply normalization.
◦ Get sum of predictions from models.
◦ Print the index of the max prediction value of each image.
Test Result
8
5
4
Self Test
◦ Discrete Convolution 에 대해 설명하라.
◦ Pooling 의 대표적인 두가지 방법을 설명하라.
◦ Stride, Padding 에 대하여 설명하고 크기 변화가 어떻게 일어나는지 설명하라.

More Related Content

What's hot

Faster Practical Block Compression for Rank/Select Dictionaries
Faster Practical Block Compression for Rank/Select DictionariesFaster Practical Block Compression for Rank/Select Dictionaries
Faster Practical Block Compression for Rank/Select Dictionaries
Rakuten Group, Inc.
 
Using Deep Learning (Computer Vision) to Search for Oil and Gas
Using Deep Learning (Computer Vision) to Search for Oil and GasUsing Deep Learning (Computer Vision) to Search for Oil and Gas
Using Deep Learning (Computer Vision) to Search for Oil and Gas
Sorin Peste
 
Generative Adversarial Nets
Generative Adversarial NetsGenerative Adversarial Nets
Generative Adversarial Nets
Jinho Lee
 
Let’s talk about microbenchmarking
Let’s talk about microbenchmarkingLet’s talk about microbenchmarking
Let’s talk about microbenchmarking
Andrey Akinshin
 
peRm R group. Review of packages for r for market data downloading and analysis
peRm R group. Review of packages for r for market data downloading and analysispeRm R group. Review of packages for r for market data downloading and analysis
peRm R group. Review of packages for r for market data downloading and analysisVyacheslav Arbuzov
 
畳み込みについて
畳み込みについて畳み込みについて
畳み込みについて
HironoriKanazawa
 
Response Surface in Tensor Train format for Uncertainty Quantification
Response Surface in Tensor Train format for Uncertainty QuantificationResponse Surface in Tensor Train format for Uncertainty Quantification
Response Surface in Tensor Train format for Uncertainty Quantification
Alexander Litvinenko
 
A successful maximum likelihood parameter estimation in skewed distributions ...
A successful maximum likelihood parameter estimation in skewed distributions ...A successful maximum likelihood parameter estimation in skewed distributions ...
A successful maximum likelihood parameter estimation in skewed distributions ...
Hideo Hirose
 
MTH3101 Tutor 7 lagrange multiplier
MTH3101  Tutor 7 lagrange multiplierMTH3101  Tutor 7 lagrange multiplier
MTH3101 Tutor 7 lagrange multiplierDrradz Maths
 
CLIM Undergraduate Workshop: Tutorial on R Software - Huang Huang, Oct 23, 2017
CLIM Undergraduate Workshop: Tutorial on R Software - Huang Huang, Oct 23, 2017CLIM Undergraduate Workshop: Tutorial on R Software - Huang Huang, Oct 23, 2017
CLIM Undergraduate Workshop: Tutorial on R Software - Huang Huang, Oct 23, 2017
The Statistical and Applied Mathematical Sciences Institute
 
Numpy tutorial(final) 20160303
Numpy tutorial(final) 20160303Numpy tutorial(final) 20160303
Numpy tutorial(final) 20160303
Namgee Lee
 
Fast indexes with roaring #gomtl-10
Fast indexes with roaring #gomtl-10 Fast indexes with roaring #gomtl-10
Fast indexes with roaring #gomtl-10
Daniel Lemire
 
SciSmalltalk: Doing Science with Agility
SciSmalltalk: Doing Science with AgilitySciSmalltalk: Doing Science with Agility
SciSmalltalk: Doing Science with Agility
ESUG
 
Kristhyan kurtlazartezubia evidencia1-metodosnumericos
Kristhyan kurtlazartezubia evidencia1-metodosnumericosKristhyan kurtlazartezubia evidencia1-metodosnumericos
Kristhyan kurtlazartezubia evidencia1-metodosnumericos
KristhyanAndreeKurtL
 
Pytorch and Machine Learning for the Math Impaired
Pytorch and Machine Learning for the Math ImpairedPytorch and Machine Learning for the Math Impaired
Pytorch and Machine Learning for the Math Impaired
Tyrel Denison
 
[신경망기초] 합성곱신경망
[신경망기초] 합성곱신경망[신경망기초] 합성곱신경망
[신경망기초] 합성곱신경망
jaypi Ko
 
[신경망기초]오류역전파알고리즘구현
[신경망기초]오류역전파알고리즘구현[신경망기초]오류역전파알고리즘구현
[신경망기초]오류역전파알고리즘구현
jaypi Ko
 
The secrets of inverse brogramming
The secrets of inverse brogrammingThe secrets of inverse brogramming
The secrets of inverse brogramming
Richie Cotton
 

What's hot (20)

Faster Practical Block Compression for Rank/Select Dictionaries
Faster Practical Block Compression for Rank/Select DictionariesFaster Practical Block Compression for Rank/Select Dictionaries
Faster Practical Block Compression for Rank/Select Dictionaries
 
Using Deep Learning (Computer Vision) to Search for Oil and Gas
Using Deep Learning (Computer Vision) to Search for Oil and GasUsing Deep Learning (Computer Vision) to Search for Oil and Gas
Using Deep Learning (Computer Vision) to Search for Oil and Gas
 
Generative Adversarial Nets
Generative Adversarial NetsGenerative Adversarial Nets
Generative Adversarial Nets
 
Let’s talk about microbenchmarking
Let’s talk about microbenchmarkingLet’s talk about microbenchmarking
Let’s talk about microbenchmarking
 
peRm R group. Review of packages for r for market data downloading and analysis
peRm R group. Review of packages for r for market data downloading and analysispeRm R group. Review of packages for r for market data downloading and analysis
peRm R group. Review of packages for r for market data downloading and analysis
 
畳み込みについて
畳み込みについて畳み込みについて
畳み込みについて
 
Response Surface in Tensor Train format for Uncertainty Quantification
Response Surface in Tensor Train format for Uncertainty QuantificationResponse Surface in Tensor Train format for Uncertainty Quantification
Response Surface in Tensor Train format for Uncertainty Quantification
 
A successful maximum likelihood parameter estimation in skewed distributions ...
A successful maximum likelihood parameter estimation in skewed distributions ...A successful maximum likelihood parameter estimation in skewed distributions ...
A successful maximum likelihood parameter estimation in skewed distributions ...
 
MTH3101 Tutor 7 lagrange multiplier
MTH3101  Tutor 7 lagrange multiplierMTH3101  Tutor 7 lagrange multiplier
MTH3101 Tutor 7 lagrange multiplier
 
CLIM Undergraduate Workshop: Tutorial on R Software - Huang Huang, Oct 23, 2017
CLIM Undergraduate Workshop: Tutorial on R Software - Huang Huang, Oct 23, 2017CLIM Undergraduate Workshop: Tutorial on R Software - Huang Huang, Oct 23, 2017
CLIM Undergraduate Workshop: Tutorial on R Software - Huang Huang, Oct 23, 2017
 
Numpy tutorial(final) 20160303
Numpy tutorial(final) 20160303Numpy tutorial(final) 20160303
Numpy tutorial(final) 20160303
 
Fast indexes with roaring #gomtl-10
Fast indexes with roaring #gomtl-10 Fast indexes with roaring #gomtl-10
Fast indexes with roaring #gomtl-10
 
SciSmalltalk: Doing Science with Agility
SciSmalltalk: Doing Science with AgilitySciSmalltalk: Doing Science with Agility
SciSmalltalk: Doing Science with Agility
 
Kristhyan kurtlazartezubia evidencia1-metodosnumericos
Kristhyan kurtlazartezubia evidencia1-metodosnumericosKristhyan kurtlazartezubia evidencia1-metodosnumericos
Kristhyan kurtlazartezubia evidencia1-metodosnumericos
 
Pytorch and Machine Learning for the Math Impaired
Pytorch and Machine Learning for the Math ImpairedPytorch and Machine Learning for the Math Impaired
Pytorch and Machine Learning for the Math Impaired
 
[신경망기초] 합성곱신경망
[신경망기초] 합성곱신경망[신경망기초] 합성곱신경망
[신경망기초] 합성곱신경망
 
Lec 3-mcgregor
Lec 3-mcgregorLec 3-mcgregor
Lec 3-mcgregor
 
[신경망기초]오류역전파알고리즘구현
[신경망기초]오류역전파알고리즘구현[신경망기초]오류역전파알고리즘구현
[신경망기초]오류역전파알고리즘구현
 
Parte 2 matemáticas
Parte 2 matemáticasParte 2 matemáticas
Parte 2 matemáticas
 
The secrets of inverse brogramming
The secrets of inverse brogrammingThe secrets of inverse brogramming
The secrets of inverse brogramming
 

Similar to Convolutional Neural Network

Digit recognizer by convolutional neural network
Digit recognizer by convolutional neural networkDigit recognizer by convolutional neural network
Digit recognizer by convolutional neural network
Ding Li
 
Eye deep
Eye deepEye deep
Eye deep
sveitser
 
Idea for ineractive programming language
Idea for ineractive programming languageIdea for ineractive programming language
Idea for ineractive programming language
Lincoln Hannah
 
DeepXplore: Automated Whitebox Testing of Deep Learning
DeepXplore: Automated Whitebox Testing of Deep LearningDeepXplore: Automated Whitebox Testing of Deep Learning
DeepXplore: Automated Whitebox Testing of Deep Learning
Masahiro Sakai
 
Logic Design - Chapter 5: Part1 Combinattional Logic
Logic Design - Chapter 5: Part1 Combinattional LogicLogic Design - Chapter 5: Part1 Combinattional Logic
Logic Design - Chapter 5: Part1 Combinattional LogicGouda Mando
 
Lecture 2.A: Convolutional Networks - Full Stack Deep Learning - Spring 2021
Lecture 2.A: Convolutional Networks - Full Stack Deep Learning - Spring 2021Lecture 2.A: Convolutional Networks - Full Stack Deep Learning - Spring 2021
Lecture 2.A: Convolutional Networks - Full Stack Deep Learning - Spring 2021
Sergey Karayev
 
Solution of simplified neutron diffusion equation by FDM
Solution of simplified neutron diffusion equation by FDMSolution of simplified neutron diffusion equation by FDM
Solution of simplified neutron diffusion equation by FDM
Syeilendra Pramuditya
 
Xgboost
XgboostXgboost
Deep learning
Deep learningDeep learning
Deep learning
DrBaljitSinghKhehra
 
The Ring programming language version 1.8 book - Part 53 of 202
The Ring programming language version 1.8 book - Part 53 of 202The Ring programming language version 1.8 book - Part 53 of 202
The Ring programming language version 1.8 book - Part 53 of 202
Mahmoud Samir Fayed
 
alexnet.pdf
alexnet.pdfalexnet.pdf
alexnet.pdf
BhautikDaxini1
 
SCIPY-SYMPY.pdf
SCIPY-SYMPY.pdfSCIPY-SYMPY.pdf
SCIPY-SYMPY.pdf
FreddyGuzman19
 
Unit 1 PDF.pptx
Unit 1 PDF.pptxUnit 1 PDF.pptx
Unit 1 PDF.pptx
ChandraV13
 
Introduction to MATLAB
Introduction to MATLABIntroduction to MATLAB
Introduction to MATLAB
Damian T. Gordon
 
Arna Friend Controls II Final
Arna Friend Controls II FinalArna Friend Controls II Final
Arna Friend Controls II FinalArna Friend
 
Understanding Reed-Solomon code
Understanding Reed-Solomon codeUnderstanding Reed-Solomon code
Understanding Reed-Solomon code
继顺(Jeffrey) 王
 

Similar to Convolutional Neural Network (20)

Digit recognizer by convolutional neural network
Digit recognizer by convolutional neural networkDigit recognizer by convolutional neural network
Digit recognizer by convolutional neural network
 
presentazione
presentazionepresentazione
presentazione
 
Eye deep
Eye deepEye deep
Eye deep
 
Idea for ineractive programming language
Idea for ineractive programming languageIdea for ineractive programming language
Idea for ineractive programming language
 
DeepXplore: Automated Whitebox Testing of Deep Learning
DeepXplore: Automated Whitebox Testing of Deep LearningDeepXplore: Automated Whitebox Testing of Deep Learning
DeepXplore: Automated Whitebox Testing of Deep Learning
 
Logic Design - Chapter 5: Part1 Combinattional Logic
Logic Design - Chapter 5: Part1 Combinattional LogicLogic Design - Chapter 5: Part1 Combinattional Logic
Logic Design - Chapter 5: Part1 Combinattional Logic
 
Lecture 2.A: Convolutional Networks - Full Stack Deep Learning - Spring 2021
Lecture 2.A: Convolutional Networks - Full Stack Deep Learning - Spring 2021Lecture 2.A: Convolutional Networks - Full Stack Deep Learning - Spring 2021
Lecture 2.A: Convolutional Networks - Full Stack Deep Learning - Spring 2021
 
Solution of simplified neutron diffusion equation by FDM
Solution of simplified neutron diffusion equation by FDMSolution of simplified neutron diffusion equation by FDM
Solution of simplified neutron diffusion equation by FDM
 
Learn Matlab
Learn MatlabLearn Matlab
Learn Matlab
 
Xgboost
XgboostXgboost
Xgboost
 
Deep learning
Deep learningDeep learning
Deep learning
 
The Ring programming language version 1.8 book - Part 53 of 202
The Ring programming language version 1.8 book - Part 53 of 202The Ring programming language version 1.8 book - Part 53 of 202
The Ring programming language version 1.8 book - Part 53 of 202
 
Extreme dxt compression
Extreme dxt compressionExtreme dxt compression
Extreme dxt compression
 
alexnet.pdf
alexnet.pdfalexnet.pdf
alexnet.pdf
 
SCIPY-SYMPY.pdf
SCIPY-SYMPY.pdfSCIPY-SYMPY.pdf
SCIPY-SYMPY.pdf
 
Unit 1 PDF.pptx
Unit 1 PDF.pptxUnit 1 PDF.pptx
Unit 1 PDF.pptx
 
Introduction to MATLAB
Introduction to MATLABIntroduction to MATLAB
Introduction to MATLAB
 
Arna Friend Controls II Final
Arna Friend Controls II FinalArna Friend Controls II Final
Arna Friend Controls II Final
 
microprocessors
microprocessorsmicroprocessors
microprocessors
 
Understanding Reed-Solomon code
Understanding Reed-Solomon codeUnderstanding Reed-Solomon code
Understanding Reed-Solomon code
 

More from Jun Young Park

Introduction to PyTorch
Introduction to PyTorchIntroduction to PyTorch
Introduction to PyTorch
Jun Young Park
 
Using Multi GPU in PyTorch
Using Multi GPU in PyTorchUsing Multi GPU in PyTorch
Using Multi GPU in PyTorch
Jun Young Park
 
Trial for Practical NN Using
Trial for Practical NN UsingTrial for Practical NN Using
Trial for Practical NN Using
Jun Young Park
 
PyTorch and Transfer Learning
PyTorch and Transfer LearningPyTorch and Transfer Learning
PyTorch and Transfer Learning
Jun Young Park
 
Recurrent Neural Networks
Recurrent Neural NetworksRecurrent Neural Networks
Recurrent Neural Networks
Jun Young Park
 
Deep Neural Network
Deep Neural NetworkDeep Neural Network
Deep Neural Network
Jun Young Park
 
Introduction to Neural Network
Introduction to Neural NetworkIntroduction to Neural Network
Introduction to Neural Network
Jun Young Park
 
GPU-Accelerated Parallel Computing
GPU-Accelerated Parallel ComputingGPU-Accelerated Parallel Computing
GPU-Accelerated Parallel Computing
Jun Young Park
 

More from Jun Young Park (8)

Introduction to PyTorch
Introduction to PyTorchIntroduction to PyTorch
Introduction to PyTorch
 
Using Multi GPU in PyTorch
Using Multi GPU in PyTorchUsing Multi GPU in PyTorch
Using Multi GPU in PyTorch
 
Trial for Practical NN Using
Trial for Practical NN UsingTrial for Practical NN Using
Trial for Practical NN Using
 
PyTorch and Transfer Learning
PyTorch and Transfer LearningPyTorch and Transfer Learning
PyTorch and Transfer Learning
 
Recurrent Neural Networks
Recurrent Neural NetworksRecurrent Neural Networks
Recurrent Neural Networks
 
Deep Neural Network
Deep Neural NetworkDeep Neural Network
Deep Neural Network
 
Introduction to Neural Network
Introduction to Neural NetworkIntroduction to Neural Network
Introduction to Neural Network
 
GPU-Accelerated Parallel Computing
GPU-Accelerated Parallel ComputingGPU-Accelerated Parallel Computing
GPU-Accelerated Parallel Computing
 

Recently uploaded

Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
Frank van Harmelen
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Albert Hoitingh
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Thierry Lestable
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Jeffrey Haguewood
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
UiPathCommunity
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Product School
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
ThousandEyes
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
OnBoard
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
Thijs Feryn
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
Cheryl Hung
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Inflectra
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
Elena Simperl
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
Product School
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Product School
 

Recently uploaded (20)

Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
 

Convolutional Neural Network

  • 2. What is Covnet(CNN) ? C R C R P … DOG POLAR BEAR WOLF ELEPHANT FC Reduce Dimension
  • 3. Discrete Convolution 1 2 3 0 0 1 2 3 3 0 1 2 2 3 0 1 2 0 1 0 1 2 1 0 2 * 15 16 6 15 2 0 3 0 1 4 3 0 2 - FMA(Fused Multiply-Add) for each area to get each ‘Value’ Multiply for each elements Input data Kernel Output data Σ
  • 4. Padding SAME VALID 0 0 0 0 0 0 0 12 27 7 3 0 0 31 9 6 8 0 0 9 15 3 12 0 0 6 3 30 13 0 0 0 0 0 0 0 12 27 7 3 31 9 6 8 9 15 3 12 6 3 30 13 Padding = 1
  • 5. Stride - 1 KERNEL = 3X3, STRIDE = 1, PADDING = SAME 0 0 0 0 0 0 0 0 7 10 2 9 3 0 0 12 27 7 3 2 0 0 31 9 6 8 6 0 0 9 15 3 12 4 0 0 6 3 30 13 5 0 0 0 0 0 0 0 0 a b c d e f g h i j k l m n o p .. .. .. .. .. .. .. .. .. 2 0 1 0 1 2 1 0 2 * = Stride
  • 6. Stride - 2 KERNEL = 3X3, STRIDE = 2, PADDING = SAME 0 0 0 0 0 0 0 0 7 10 2 9 3 0 0 12 27 7 3 2 0 0 31 9 6 8 6 0 0 9 15 3 12 4 0 0 6 3 30 13 5 0 0 0 0 0 0 0 0 A B C D E F G H I 2 0 1 0 1 2 1 0 2 * = Stride
  • 7. Output Size 𝑆𝑆𝑍𝑍𝑜𝑜𝑜𝑜𝑜𝑜𝑜𝑜𝑜𝑜𝑜𝑜 = 𝑁𝑁−𝐹𝐹 𝑆𝑆𝑆𝑆𝑆𝑆𝑆𝑆 𝑆𝑆𝑆𝑆 + 1 𝑉𝑉𝑉𝑉𝑉𝑉𝑉𝑉𝑉𝑉 𝑤𝑤𝑤𝑤𝑤𝑤𝑤 𝑆𝑆𝑍𝑍𝑜𝑜𝑜𝑜𝑜𝑜𝑜𝑜𝑜𝑜𝑜𝑜 ∈ 𝑁𝑁 0 0 0 0 0 0 0 0 7 10 2 9 3 0 0 12 27 7 3 2 0 0 31 9 6 8 6 0 0 9 15 3 12 4 0 0 6 3 30 13 5 0 0 0 0 0 0 0 0
  • 8. Fully Connected Layer C R C R P … DOG POLAR BEAR WOLF ELEPHANT FC Reduce Dimension By previous procedures … P 32 x 32 x 3 x Build Classifier <Feature extraction> <Classification>
  • 9. Convolution Layers Filter (28, 28, 6)(32, 32, 3) Convolution, ReLU With 6 (5,5,3) filters With 10 (5,5,6) filters (24, 24, 10) …… 𝑁𝑁𝑝𝑝𝑝𝑝𝑝𝑝𝑝𝑝𝑝𝑝𝑝𝑝 = 5 ∗ 5 ∗ 3 ∗ 6 + 5 ∗ 5 ∗ 6 ∗ 10 Convolution, ReLU
  • 10. Pooling layer Convolution layer Size Reduction Pooling Slice !
  • 11. Pooling (Subsampling) ◦ Object ◦ To reduce Rows/Cols from the matrix ◦ Advantage ◦ No parameters to train ◦ Invariable channels ◦ Not affected by variance of input ◦ Method ◦ Max Pooling Use maximum value of the target area ◦ Mean Pooling Use average value of the target area 31 8 15 30 12 27 7 3 31 9 6 8 9 15 3 12 6 3 30 13 12 27 7 3 31 9 6 8 9 15 3 12 6 3 30 13 12.25 6.00 8.25 14.50 <Max Pooling> <Mean Pooling> Kernel : 2x2 Stride : 2
  • 12. Applications ◦ LeNet-5 (1998) ◦ AlexNet (2012) ◦ GoogLeNet (2014) ◦ Inception module : Parallel composition of layers. ◦ 1x1 convolution : Mathematically equivalent to a multi-layer perceptron. ◦ ResNet (2015) ◦ Fast Forward : Step over to skip some layers (Residual Net)
  • 13. Practical Use ◦ Build NN with simplified API and Class by TensorFlow ◦ Training with MNIST dataset ◦ Test with MNIST dataset and ‘Hand-Written’ own data. ◦ Applying some techniques that we discussed before ◦ Ensemble, Dropout, Batch
  • 14. Define class for a model Model + keep_prop + X, Y + sess + name + bool training + layers(conv, pool, dropout, dense …) + __init__(self, sess, name) + _build_net(self) + predict(self,x_test,training) + get_accuracy(self,x_test,y_test,training=False) + train(self,x_data_y_data_training=True)
  • 15. Shape of Layers IMG [32, 32, 1] FILTER1 [32, 32, 32] POOL1 [16, 16, 32] FILTER2 [16, 16, 64] POOL2 [8, 8, 64] FILTER3 [8, 8, 128] POOL3 [4, 4, 128] ReLU ReLU ReLU [4*4*128, 625] Flatten ReLU Drop Drop [625, 10] Logits : 0 ~ 9 # of filters Stride = 2 Stride = 2 Stride = 2
  • 17. Implement Ensemble Model 1 . . . Model 10 Predict Predict + Predictions mean
  • 18. Test Result ◦ Model : 5 ◦ Epoch : 15 ◦ Ensemble Accuracy : 99.05%
  • 19. Test ‘Hand-Written’ Data Scan & Resample for each numbers Image to Test [28,28,1] - Bitmap
  • 21. Self Assignment ◦ 미완성된 자필 숫자 인식기를 완성하라. ◦ 문제점 ◦ pyplot.imshow() 메소드가 이미지를 자동으로 4채널(RGBA) 로 읽어 들임. (해결) ◦ Type Mismatch 오류, TensorFlow 에서 필요로 하는 Type을 제대로 설정하지 못하였을 가능성.
  • 22. Trial and Error ◦ Convert RGB image to mono(gray) bitmap
  • 23. Troubleshooting ◦ Content of MNIST dataset …… Black (Background) White (Content) # of Test Images Size of each image (784 = 28*28)
  • 24. Troubleshooting ◦ Causes of failure ◦ Different from MNIST dataset, Hand-Written data have black content and white background. ◦ After convert to grayscale, each pixel has too large value different from MNIST dataset. ◦ Solutions ◦ Invert Hand-Written data to have black background and white content. ◦ Normalize grayscale converted image.
  • 25. Troubleshooting ◦ Read each image from the floder ◦ Convert to grayscale (28x28x3 -> 28x28) ◦ Reshape (28x28 -> 784) ◦ Append the image to the list. ◦ Convert the list to ndarray. ◦ Apply normalization. ◦ Get sum of predictions from models. ◦ Print the index of the max prediction value of each image.
  • 27. Self Test ◦ Discrete Convolution 에 대해 설명하라. ◦ Pooling 의 대표적인 두가지 방법을 설명하라. ◦ Stride, Padding 에 대하여 설명하고 크기 변화가 어떻게 일어나는지 설명하라.