SlideShare a Scribd company logo
Jason Tsai (蔡志順) 2019.11.19
台北市 3A中心 教師研習
Convolutional Neural Networks (CNN)
卷積神經網路的前世今生
*Picture adopted from https://bit.ly/36yLPJL
Copyright Notice:
All figures in this presentation are taken from
miscellaneous sources and their copyrights
belong to the original authors. This
presentation itself adopts Creative Commons
license.
大綱 (Outlines)
• 生物神經元及其模型
• 視覺的研究發現和啟發
• 卷積神經網路原理
• 如何訓練神經網路
• 經典卷積神經網路模型
• 卷積神經網路應用實例
生物神經元及其模型
神經元 (neuron) 示意圖
神經元間的溝通之處
突觸 (synapse)
動作電位 (action potential)
海柏學習法則
(Hebb’s learning rule)
 突觸前神經元向突觸後神經元持續重複的刺激,使得神
經元之間的突觸強度增加。
第一代人工神經元模型
第二代人工神經元模型
第三代人工神經元模型
Spiking Neural Networks (脈衝神經網
路)
視覺的研究發現和啟發
視覺皮質傳導路徑
空間位置 (where pathway)
物體識別 (what pathway)
皮質柱 (cortical column)
感受野 (receptive field)
Simple 和 Complex 細胞
Hubel & Wiesel (1962)
階層稀疏分散表徵 (Hierarchical Sparse
Distributed Representations)
Neocognitron 模型
福島邦彥 (1980)
卷積神經網路原理
全連接網路 (Fully connected
networks)
卷積神經網路 (Convolutional neural
networks)
此圖例為二元分類器
基本原則 (General principle)
局部連接(locally connected)
[區域感受野]
權重共享(weight sharing)
[共用學習參數]
基本組件 (Building block)
(經過學習的) filters (kernels)
階層特徵 (Hierarchy of features)
卷積 (Convolution)
特稱圖(feature map)
輸入(此處為5x5)
此處卷積核(convolution filter)大小為3x3
卷積層 (Convolutional layer)
 Depth (D): filter (或稱 kernel) 數目
 Stride (s): 每一次 kernel 移動的間隔
 Zero padding (p): 每一輸入邊緣填0的寬度
若以 i 表示輸入寬度大小,k 表示 kernel
寬度大小, 卷積運算後 feature map 的寬
度大小 (o) 公式為:
o = D 個 [(i - k + 2p) / s] + 1
以輸入為28x28,5x5卷積核,stride為1,padding為2為
例,輸出大小仍為 28x28 feature map。
卷積運算
非線性變換
激活函數 (Activation function)
正規化 (Normalization)
池化層 (Pooling layer)
平均池化
Average pooling
最大池化
Maximal pooling
區域感受野 (Local receptive field)
稀疏連結 (Sparse connectivity)
全連接網路
Fully connection networks
卷積神經網路
Convolutional neural networks
(輸入)
權重共享 (Weight sharing)
 此處 w1=w4=w7, w2=w5=w8, w3=w6=w9
 具有 translational invariance 的特性
反卷積網路
反卷積 (Transpose convolution /
Deconvolution)
stride (步長) = 1 (p’ = k – p – 1)
公式: o’ = ( i’ – 1) + k – 2p
stride (步長) = 2 (dilation=s)
公式: o’ = s (i’ – 1) + k - 2p
上池化 (Unpooling)
上採樣 (Unsampling)
ConvNet-to-DeconvNet
擴張卷積 (Dilated/Atrous convolution)
Dilation = 2
Kernel = 3x3
Stride = 1
可變形卷積
(Deformable convolution)
典型卷積與可變形卷積
三維卷積 (3D convolution)
如何訓練神經網路
損失函數 (Loss function) / 目標函數
(Objective function)
P(x)為目標機率,Q(x)為
實際機率。
最小化損失函數 L
θ* = arg min L(θ)
 Mean square error (最小均方差)
 Cross entropy (交叉熵)
Video tutorial: https://youtu.be/ErfnhcEV1O8
隨機梯度下降
(Stochastic gradient descent, SGD)
隨機梯度下降 (SGD)
minibatch
梯度下降圖例
倒傳遞演算法 (Back-propagation)
經典卷積神經網路模型
LeNet-5 (1998)
Paper: http://yann.lecun.com/exdb/publis/pdf/lecun-01a.pdf
在 MNIST 手寫數字資料集中圖片大小為 28x28,實作
上常常左右邊緣各補 (padding) 二個 pixels 變成 32x32。
此模型的卷積核 (convolution kernel) 大小為 5x5
使用 PyTorch 實現 LeNet-5 模型
import torch.nn as nn
Import torch.nn.functional as F
class LeNet5(nn.Module):
def __init__(self):
super().__init__()
self.conv1 = nn.Conv2d(in_channels=1, out_channels=6, kernel_size=5)
self.conv2 = nn.Conv2d(in_channels=6, out_channels=16, kernel_size=5)
self.mxpol = nn.MaxPool2d(kernel_size=2, stride=2)
self.fc1 = nn.Linear(16*5*5, 120)
self.fc2 = nn.Linear(120, 84)
self.fc3 = nn.Linear(84, 10)
def forward(self, x):
x = F.relu(self.conv1(x))
x = self.mxpol(x)
x = F.relu(self.conv2(x))
x = self.mxpol(x)
x = x.view(x.size(0), -1)
x = F.relu(self.fc1(x))
x = F.relu(self.fc2(x))
return self.fc3(x)
net = LeNet5()
此處激活函數改用現在普遍被
採用的 ReLU
AlexNet (2012)
Paper: https://www.cs.toronto.edu/~fritz/absps/imagenet.pdf
VGGNet (2015)
Paper: https://arxiv.org/abs/1409.1556
Inception (2015)
Paper: https://www.cs.unc.edu/~wliu/papers/GoogLeNet.pdf
Residual block: y = F(x)+x
Paper: https://arxiv.org/abs/1512.03385
Deep residual networks
ResNet (2015)
ResNet-34
ResNet 的循環形式 (recurrent
form)
生成對抗網路 GAN (2014)
(Generative adversarial networks)
Video tutorial: https://youtu.be/dCKbRCUyop8
純卷積的侷限
Capsule networks (2017)
Paper: https://papers.nips.cc/paper/6975-dynamic-routing-between-capsules
卷積神經網路應用實例
這是什麼?
分類 (Classification)
瑕疵/病徵檢測 (Defect / Symptom
inspection )
圖片(商品)搜索 (Image Retrieval)
目標識別 (Object detection)
圖像分割 (Segmentation)
語義分割 實例分割
自駕車圖像分割應用
腫瘤圖像分割應用
姿態估算 (Skeleton / pose estimation)
風格遷移 (Style transfer)
漫畫風
GAN 生成的擬真照片
超解析度 (Super-resolution)
低解析度→高解析度
照片修整
黑白→彩色
推薦系統 (Recommender system)
商品展示
看圖說故事 (Image captioning)
人臉辨識 (Face recognition)
人臉辨識典型範疇
估計數量 (Count / Estimate)
農產品辨識 / 估量 / 分級
異常偵測 (Anomaly detection)
推薦書單
 科普
 進階
 入門
 高階
Q & A

More Related Content

PPTX
Convolutional Neural Networks (CNN) — 卷積神經網路的前世今生
Jason Tsai
 
PDF
資料結構-20個經典題型
逸 張
 
PDF
Soft computing
Dr Sandeep Kumar Poonia
 
PDF
Hole and shaft-basis systems of fits
Fast SiC Semiconductor Inc.
 
PPTX
英文面試自我介紹
Hsien-Yung Yi
 
PPTX
Fuzzy logic control of washing m achines
pradnya patil
 
PDF
uml20100619
Kevin Wu
 
PDF
企業流程管理BPM
Fast SiC Semiconductor Inc.
 
Convolutional Neural Networks (CNN) — 卷積神經網路的前世今生
Jason Tsai
 
資料結構-20個經典題型
逸 張
 
Soft computing
Dr Sandeep Kumar Poonia
 
Hole and shaft-basis systems of fits
Fast SiC Semiconductor Inc.
 
英文面試自我介紹
Hsien-Yung Yi
 
Fuzzy logic control of washing m achines
pradnya patil
 
uml20100619
Kevin Wu
 
企業流程管理BPM
Fast SiC Semiconductor Inc.
 

What's hot (11)

PPTX
生產進度管理
Fast SiC Semiconductor Inc.
 
PPT
Chaps 1-3-ai-prolog
saru40
 
PDF
NUMERICAL METHODS WITH MATLAB : bisection,mueller's,newton-raphson,false poin...
Parhamsagharchi
 
PDF
從大數據走向人工智慧
Sheng-Wei (Kuan-Ta) Chen
 
PDF
現場料品管理 material control
Fast SiC Semiconductor Inc.
 
PDF
Categorical reparameterization with gumbel softmax
ぱんいち すみもと
 
PDF
PMT-001-中鋼公司生產管理實務經驗分享
handbook
 
PDF
双対性
Yoichi Iwata
 
PPT
一位年輕探索者的建議
Sheng-Wei (Kuan-Ta) Chen
 
PPTX
Soft computing01
university of sargodha
 
PPTX
Agent Based Models
David Sherlock
 
生產進度管理
Fast SiC Semiconductor Inc.
 
Chaps 1-3-ai-prolog
saru40
 
NUMERICAL METHODS WITH MATLAB : bisection,mueller's,newton-raphson,false poin...
Parhamsagharchi
 
從大數據走向人工智慧
Sheng-Wei (Kuan-Ta) Chen
 
現場料品管理 material control
Fast SiC Semiconductor Inc.
 
Categorical reparameterization with gumbel softmax
ぱんいち すみもと
 
PMT-001-中鋼公司生產管理實務經驗分享
handbook
 
双対性
Yoichi Iwata
 
一位年輕探索者的建議
Sheng-Wei (Kuan-Ta) Chen
 
Soft computing01
university of sargodha
 
Agent Based Models
David Sherlock
 
Ad

Similar to Convolutional Neural Networks (CNN) — 卷積神經網路的前世今生 (19)

PPTX
Neural Network Basics
Okis Chuang
 
PDF
Chapter 2 Basic Neural Network Architecture_Claire.pdf
learningfqz
 
PPTX
漫談人工智慧:啟發自大腦科學的深度學習網路
Jason Tsai
 
PDF
Tutorial of cnn 赵子健9.16
Zijian Zhao
 
PPTX
AI Development (Chinese Version Tutorial)
churuihang
 
PDF
人工智慧09_神經網路(TensorFlow+Keras)
Fuzhou University
 
PPTX
Chapter: Introduction to Recurrent Neural Networks and Their Applications
huqishuangs
 
PPTX
樣形識別期末報告
Hero Jeng
 
PPT
動態類神經網路~電機大師黃聰亮教授演講投影片
vincent8899
 
PDF
NTC_Tensor flow 深度學習快速上手班_Part2 -深度學習
NTC.im(Notch Training Center)
 
PDF
Le net5 study_20180520
穗碧 陳
 
PPT
7 第七章 学习与进化模型ann
zhang shuren
 
PDF
Pytorch cnn netowork introduction 20240318
FEG
 
PPTX
漫談人工智慧:啟發自大腦科學的深度學習網路
Jason Tsai
 
PDF
Hands-on tutorial of deep learning (Keras)
Chun-Min Chang
 
PDF
從 NN 到 嗯嗯
Heng-Xiu Xu
 
PPT
漫談人工智慧:啟發自大腦科學的深度學習網路
Jason Tsai
 
PDF
卷積神經網路(Python+TensorFlow+Keras)
Fuzhou University
 
PDF
人工智慧10_卷積神經網路
Fuzhou University
 
Neural Network Basics
Okis Chuang
 
Chapter 2 Basic Neural Network Architecture_Claire.pdf
learningfqz
 
漫談人工智慧:啟發自大腦科學的深度學習網路
Jason Tsai
 
Tutorial of cnn 赵子健9.16
Zijian Zhao
 
AI Development (Chinese Version Tutorial)
churuihang
 
人工智慧09_神經網路(TensorFlow+Keras)
Fuzhou University
 
Chapter: Introduction to Recurrent Neural Networks and Their Applications
huqishuangs
 
樣形識別期末報告
Hero Jeng
 
動態類神經網路~電機大師黃聰亮教授演講投影片
vincent8899
 
NTC_Tensor flow 深度學習快速上手班_Part2 -深度學習
NTC.im(Notch Training Center)
 
Le net5 study_20180520
穗碧 陳
 
7 第七章 学习与进化模型ann
zhang shuren
 
Pytorch cnn netowork introduction 20240318
FEG
 
漫談人工智慧:啟發自大腦科學的深度學習網路
Jason Tsai
 
Hands-on tutorial of deep learning (Keras)
Chun-Min Chang
 
從 NN 到 嗯嗯
Heng-Xiu Xu
 
漫談人工智慧:啟發自大腦科學的深度學習網路
Jason Tsai
 
卷積神經網路(Python+TensorFlow+Keras)
Fuzhou University
 
人工智慧10_卷積神經網路
Fuzhou University
 
Ad

More from Jason Tsai (9)

PPTX
基於深度學習的人臉辨識技術簡介
Jason Tsai
 
PPTX
Neural Network Design: Chapter 17 Radial Basis Networks
Jason Tsai
 
PPTX
Neural Network Design: Chapter 18 Grossberg Network
Jason Tsai
 
PPTX
Introduction to Spiking Neural Networks: From a Computational Neuroscience pe...
Jason Tsai
 
PPTX
Introduction to Spiking Neural Networks: From a Computational Neuroscience pe...
Jason Tsai
 
PPTX
Introduction to Spiking Neural Networks: From a Computational Neuroscience pe...
Jason Tsai
 
PPTX
Reinforcement Learning: Chapter 15 Neuroscience
Jason Tsai
 
PPTX
Deep Learning: Chapter 11 Practical Methodology
Jason Tsai
 
PPTX
Deep Learning: Introduction & Chapter 5 Machine Learning Basics
Jason Tsai
 
基於深度學習的人臉辨識技術簡介
Jason Tsai
 
Neural Network Design: Chapter 17 Radial Basis Networks
Jason Tsai
 
Neural Network Design: Chapter 18 Grossberg Network
Jason Tsai
 
Introduction to Spiking Neural Networks: From a Computational Neuroscience pe...
Jason Tsai
 
Introduction to Spiking Neural Networks: From a Computational Neuroscience pe...
Jason Tsai
 
Introduction to Spiking Neural Networks: From a Computational Neuroscience pe...
Jason Tsai
 
Reinforcement Learning: Chapter 15 Neuroscience
Jason Tsai
 
Deep Learning: Chapter 11 Practical Methodology
Jason Tsai
 
Deep Learning: Introduction & Chapter 5 Machine Learning Basics
Jason Tsai
 

Convolutional Neural Networks (CNN) — 卷積神經網路的前世今生