SlideShare ist ein Scribd-Unternehmen logo
1 von 7
Convolution
Pointwise convolution
depthwise convolution ?
2017. 6
김홍배
최근 Xception, MobileNtes등에서 사용되는 다양한
convolution 기술 중
일반적인 convolution, Pointwise convolution
(1x1 convolution)과 depthwise convolution의 차이는 ?
목적 : CNN의 계산량 및 매개변수 수를 줄임으로써
Xception은 큰 이미지 인식의 고속화
MobileNets은 정도를 유지하면서 Networks의 경량화
Pointwise convolution과 depthwise convolution의 장점을
이해하기 위해, 우선 일반 convolution의 계산량 및 parameter
수에 대해 생각해보면
어떤 CNN에 대한 입력 특징 맵의 크기를 FxF, 입력 채널 수를 N,
커널 크기를 KxK, 출력 채널 수를 M으로 하면,
이 CNN의 계산량은 F2NK2M이 된다.
이것은 입력 특징 맵 1개당 Convolution의 cost가 K2N으로
이를 입력 특징 맵 F2 개에 적용해서 1 채널의 출력 특성 맵이
생성되기 때문에, 출력 특징 맵이 M개 경우에는
위의 계산과 같다.
parameter 수가 K2N의 Convolution이 M종류이기 때문에,
K2NM이 된다.
Pointwise convolution
Pointwise convolution은 ResNet등의 skip connection에도 이용되는
1x1 convolution이다.
공간 방향의 convolution은 실시하지 않고, 채널 방향에만 convolution을
한다.
특징 맵의 차원을 늘리거나 줄일 때 이용된다.
Pointwise convolution은 일반 convolution에서 K = 1로 한 것이기 때문에,
계산량은 F2NM, parameter 수는 NM이 된다.
Depthwise convolution
Depthwise convolution는 특징맵 채널마다 각각 공간 방향의 convolution
을 수행한다.
채널 방향에 convolution을 수행하지 않기 때문에 일반 convolution 1회의
cost가 K2N에서 K2로 되므로
CNN의 계산량은 F2NK2, parameter 수는 K2N이 된다.
일반적인 convolution이 특징 맵의 공간 방향 및 채널 방향으로 동시에
convolution 을 실 시 하 는 반 면 , 채 널 방 향 의 convolution(pointwise
convolution)과 공간 방향의 convolution (depthwise convolution)을 분리
(factorize)해서 따로 계산한 후 후에 합쳐서 적용하여 공간 방향 및 채널 방
향을 동시에 convolution하는 convolution보다 적은 parameter 및 계산량으
로 근사 할 수있다.
계산량은 F2NK2M에서 F2NM + F2NK2로 감소된다.
비율로 말하면, 1/K2 + 1/M으로 되므로, 통상 M >> K2(e.g. K = 3, M≥32)이므
로, 계산량은 1/9 정도로 감소됨

Weitere ähnliche Inhalte

Was ist angesagt?

Introduction to Deep Learning, Keras, and TensorFlow
Introduction to Deep Learning, Keras, and TensorFlowIntroduction to Deep Learning, Keras, and TensorFlow
Introduction to Deep Learning, Keras, and TensorFlow
Sri Ambati
 

Was ist angesagt? (20)

Variational Autoencoder
Variational AutoencoderVariational Autoencoder
Variational Autoencoder
 
[컴퓨터비전과 인공지능] 6. 역전파 1
[컴퓨터비전과 인공지능] 6. 역전파 1[컴퓨터비전과 인공지능] 6. 역전파 1
[컴퓨터비전과 인공지능] 6. 역전파 1
 
딥러닝의 기본
딥러닝의 기본딥러닝의 기본
딥러닝의 기본
 
Artificial Neural Networks Lect5: Multi-Layer Perceptron & Backpropagation
Artificial Neural Networks Lect5: Multi-Layer Perceptron & BackpropagationArtificial Neural Networks Lect5: Multi-Layer Perceptron & Backpropagation
Artificial Neural Networks Lect5: Multi-Layer Perceptron & Backpropagation
 
Filmic Tonemapping for Real-time Rendering - Siggraph 2010 Color Course
Filmic Tonemapping for Real-time Rendering - Siggraph 2010 Color CourseFilmic Tonemapping for Real-time Rendering - Siggraph 2010 Color Course
Filmic Tonemapping for Real-time Rendering - Siggraph 2010 Color Course
 
Image Classification using deep learning
Image Classification using deep learning Image Classification using deep learning
Image Classification using deep learning
 
K Nearest Neighbor Presentation
K Nearest Neighbor PresentationK Nearest Neighbor Presentation
K Nearest Neighbor Presentation
 
rnn BASICS
rnn BASICSrnn BASICS
rnn BASICS
 
Autoencoders in Deep Learning
Autoencoders in Deep LearningAutoencoders in Deep Learning
Autoencoders in Deep Learning
 
Introduction to Deep Learning, Keras, and TensorFlow
Introduction to Deep Learning, Keras, and TensorFlowIntroduction to Deep Learning, Keras, and TensorFlow
Introduction to Deep Learning, Keras, and TensorFlow
 
Attention
AttentionAttention
Attention
 
Convolutional Neural Networks : Popular Architectures
Convolutional Neural Networks : Popular ArchitecturesConvolutional Neural Networks : Popular Architectures
Convolutional Neural Networks : Popular Architectures
 
Neural Network from Scratch in Python
Neural Network from Scratch in PythonNeural Network from Scratch in Python
Neural Network from Scratch in Python
 
Convolutional Neural Network (CNN) - image recognition
Convolutional Neural Network (CNN)  - image recognitionConvolutional Neural Network (CNN)  - image recognition
Convolutional Neural Network (CNN) - image recognition
 
인공신경망
인공신경망인공신경망
인공신경망
 
Vgg
VggVgg
Vgg
 
Lighting of Killzone: Shadow Fall
Lighting of Killzone: Shadow FallLighting of Killzone: Shadow Fall
Lighting of Killzone: Shadow Fall
 
Variational Autoencoders VAE - Santiago Pascual - UPC Barcelona 2018
Variational Autoencoders VAE - Santiago Pascual - UPC Barcelona 2018Variational Autoencoders VAE - Santiago Pascual - UPC Barcelona 2018
Variational Autoencoders VAE - Santiago Pascual - UPC Barcelona 2018
 
TensorFlow and Keras: An Overview
TensorFlow and Keras: An OverviewTensorFlow and Keras: An Overview
TensorFlow and Keras: An Overview
 
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
 

Andere mochten auch

Andere mochten auch (17)

Learning to remember rare events
Learning to remember rare eventsLearning to remember rare events
Learning to remember rare events
 
InfoGAN: Interpretable Representation Learning by Information Maximizing Gene...
InfoGAN: Interpretable Representation Learning by Information Maximizing Gene...InfoGAN: Interpretable Representation Learning by Information Maximizing Gene...
InfoGAN: Interpretable Representation Learning by Information Maximizing Gene...
 
Knowing when to look : Adaptive Attention via A Visual Sentinel for Image Cap...
Knowing when to look : Adaptive Attention via A Visual Sentinel for Image Cap...Knowing when to look : Adaptive Attention via A Visual Sentinel for Image Cap...
Knowing when to look : Adaptive Attention via A Visual Sentinel for Image Cap...
 
Visualizing data using t-SNE
Visualizing data using t-SNEVisualizing data using t-SNE
Visualizing data using t-SNE
 
알기쉬운 Variational autoencoder
알기쉬운 Variational autoencoder알기쉬운 Variational autoencoder
알기쉬운 Variational autoencoder
 
Learning by association
Learning by associationLearning by association
Learning by association
 
Normalization 방법
Normalization 방법 Normalization 방법
Normalization 방법
 
Explanation on Tensorflow example -Deep mnist for expert
Explanation on Tensorflow example -Deep mnist for expertExplanation on Tensorflow example -Deep mnist for expert
Explanation on Tensorflow example -Deep mnist for expert
 
MNIST for ML beginners
MNIST for ML beginnersMNIST for ML beginners
MNIST for ML beginners
 
A neural image caption generator
A neural image caption generatorA neural image caption generator
A neural image caption generator
 
Meta-Learning with Memory Augmented Neural Networks
Meta-Learning with Memory Augmented Neural NetworksMeta-Learning with Memory Augmented Neural Networks
Meta-Learning with Memory Augmented Neural Networks
 
Binarized CNN on FPGA
Binarized CNN on FPGABinarized CNN on FPGA
Binarized CNN on FPGA
 
Single Shot MultiBox Detector와 Recurrent Instance Segmentation
Single Shot MultiBox Detector와 Recurrent Instance SegmentationSingle Shot MultiBox Detector와 Recurrent Instance Segmentation
Single Shot MultiBox Detector와 Recurrent Instance Segmentation
 
Focal loss의 응용(Detection & Classification)
Focal loss의 응용(Detection & Classification)Focal loss의 응용(Detection & Classification)
Focal loss의 응용(Detection & Classification)
 
딥러닝을 이용한 자연어처리의 연구동향
딥러닝을 이용한 자연어처리의 연구동향딥러닝을 이용한 자연어처리의 연구동향
딥러닝을 이용한 자연어처리의 연구동향
 
머신러닝의 자연어 처리기술(I)
머신러닝의 자연어 처리기술(I)머신러닝의 자연어 처리기술(I)
머신러닝의 자연어 처리기술(I)
 
Q Learning과 CNN을 이용한 Object Localization
Q Learning과 CNN을 이용한 Object LocalizationQ Learning과 CNN을 이용한 Object Localization
Q Learning과 CNN을 이용한 Object Localization
 

Mehr von 홍배 김

Mehr von 홍배 김 (15)

Automatic Gain Tuning based on Gaussian Process Global Optimization (= Bayesi...
Automatic Gain Tuning based on Gaussian Process Global Optimization (= Bayesi...Automatic Gain Tuning based on Gaussian Process Global Optimization (= Bayesi...
Automatic Gain Tuning based on Gaussian Process Global Optimization (= Bayesi...
 
Gaussian processing
Gaussian processingGaussian processing
Gaussian processing
 
Lecture Summary : Camera Projection
Lecture Summary : Camera Projection Lecture Summary : Camera Projection
Lecture Summary : Camera Projection
 
Learning agile and dynamic motor skills for legged robots
Learning agile and dynamic motor skills for legged robotsLearning agile and dynamic motor skills for legged robots
Learning agile and dynamic motor skills for legged robots
 
Robotics of Quadruped Robot
Robotics of Quadruped RobotRobotics of Quadruped Robot
Robotics of Quadruped Robot
 
Basics of Robotics
Basics of RoboticsBasics of Robotics
Basics of Robotics
 
Recurrent Neural Net의 이론과 설명
Recurrent Neural Net의 이론과 설명Recurrent Neural Net의 이론과 설명
Recurrent Neural Net의 이론과 설명
 
Anomaly detection using deep one class classifier
Anomaly detection using deep one class classifierAnomaly detection using deep one class classifier
Anomaly detection using deep one class classifier
 
Optimal real-time landing using DNN
Optimal real-time landing using DNNOptimal real-time landing using DNN
Optimal real-time landing using DNN
 
The world of loss function
The world of loss functionThe world of loss function
The world of loss function
 
Machine learning applications in aerospace domain
Machine learning applications in aerospace domainMachine learning applications in aerospace domain
Machine learning applications in aerospace domain
 
Anomaly Detection and Localization Using GAN and One-Class Classifier
Anomaly Detection and Localization  Using GAN and One-Class ClassifierAnomaly Detection and Localization  Using GAN and One-Class Classifier
Anomaly Detection and Localization Using GAN and One-Class Classifier
 
ARCHITECTURAL CONDITIONING FOR DISENTANGLEMENT OF OBJECT IDENTITY AND POSTURE...
ARCHITECTURAL CONDITIONING FOR DISENTANGLEMENT OF OBJECT IDENTITY AND POSTURE...ARCHITECTURAL CONDITIONING FOR DISENTANGLEMENT OF OBJECT IDENTITY AND POSTURE...
ARCHITECTURAL CONDITIONING FOR DISENTANGLEMENT OF OBJECT IDENTITY AND POSTURE...
 
Brief intro : Invariance and Equivariance
Brief intro : Invariance and EquivarianceBrief intro : Invariance and Equivariance
Brief intro : Invariance and Equivariance
 
Anomaly Detection with GANs
Anomaly Detection with GANsAnomaly Detection with GANs
Anomaly Detection with GANs
 

Convolution 종류 설명

  • 2. 최근 Xception, MobileNtes등에서 사용되는 다양한 convolution 기술 중 일반적인 convolution, Pointwise convolution (1x1 convolution)과 depthwise convolution의 차이는 ? 목적 : CNN의 계산량 및 매개변수 수를 줄임으로써 Xception은 큰 이미지 인식의 고속화 MobileNets은 정도를 유지하면서 Networks의 경량화
  • 3. Pointwise convolution과 depthwise convolution의 장점을 이해하기 위해, 우선 일반 convolution의 계산량 및 parameter 수에 대해 생각해보면 어떤 CNN에 대한 입력 특징 맵의 크기를 FxF, 입력 채널 수를 N, 커널 크기를 KxK, 출력 채널 수를 M으로 하면, 이 CNN의 계산량은 F2NK2M이 된다.
  • 4. 이것은 입력 특징 맵 1개당 Convolution의 cost가 K2N으로 이를 입력 특징 맵 F2 개에 적용해서 1 채널의 출력 특성 맵이 생성되기 때문에, 출력 특징 맵이 M개 경우에는 위의 계산과 같다. parameter 수가 K2N의 Convolution이 M종류이기 때문에, K2NM이 된다.
  • 5. Pointwise convolution Pointwise convolution은 ResNet등의 skip connection에도 이용되는 1x1 convolution이다. 공간 방향의 convolution은 실시하지 않고, 채널 방향에만 convolution을 한다. 특징 맵의 차원을 늘리거나 줄일 때 이용된다. Pointwise convolution은 일반 convolution에서 K = 1로 한 것이기 때문에, 계산량은 F2NM, parameter 수는 NM이 된다.
  • 6. Depthwise convolution Depthwise convolution는 특징맵 채널마다 각각 공간 방향의 convolution 을 수행한다. 채널 방향에 convolution을 수행하지 않기 때문에 일반 convolution 1회의 cost가 K2N에서 K2로 되므로 CNN의 계산량은 F2NK2, parameter 수는 K2N이 된다.
  • 7. 일반적인 convolution이 특징 맵의 공간 방향 및 채널 방향으로 동시에 convolution 을 실 시 하 는 반 면 , 채 널 방 향 의 convolution(pointwise convolution)과 공간 방향의 convolution (depthwise convolution)을 분리 (factorize)해서 따로 계산한 후 후에 합쳐서 적용하여 공간 방향 및 채널 방 향을 동시에 convolution하는 convolution보다 적은 parameter 및 계산량으 로 근사 할 수있다. 계산량은 F2NK2M에서 F2NM + F2NK2로 감소된다. 비율로 말하면, 1/K2 + 1/M으로 되므로, 통상 M >> K2(e.g. K = 3, M≥32)이므 로, 계산량은 1/9 정도로 감소됨