본문 바로가기

DeepLearning

LeNet-5 (Basic CNN)

1. LeNet-5

Yann LeCun 라는 분이 1998년 Paper submit 하셨던 

'Gradient-Based Learning Applied to Document Recognition' 에 담긴 신경망의 구조를 LeNet-5 라고 한다.

전반적인 내용은 이전에 있었던 Convolutional Neural Network 의 Conv filter 의 사용배경에서 다루었던 내용이 었으므로 본론으로 들어가보자.

 

LeNet-5 의 구조

http://lushuangning.oss-cn-beijing.aliyuncs.com/CNN%E5%AD%A6%E4%B9%A0%E7%B3%BB%E5%88%97/Gradient-Based_Learning_Applied_to_Document_Recognition.pdf

전체적인 구조는 굉장히 간단하다.

입력으로 이미지를 받아 Convolutional layer 를 통과하여 depth 를 높이고, 이미지의 특징을 잡아내며 Subsampling (Average Pooling) 방법으로 그 이미지의 width, height 를 줄여가며 학습하고 끝으로 Fully connected Layer 를 두 층을 사용하여 output을 출력하는 구조이다.

 

이 논문에서 사용했던 특징들에서 약간의 수정을 통하여 사용했음을 밝힌다.

 

실습 코드에서 사용된 Network 의 구조이다.

1) Convolution1 [ Input = 32x32x1 Output = 28x28x6 ] (Activation = 'ReLU')

2) SubSampling 1 [ Input = 28x28x6 Output = 14x14x6 ]  (Average Pooling)

3) Convolution 2 [ Input = 14x14x6 Output = 10x10x16 ] (Activation = 'ReLU')

4) SubSampling 2 [ Input = 10x10x6 Output = 5x5x16 ] (Average Pooling)

5) Fully Connected 1 [ Input = 5x5x16 Output = 120 ] (Activation = 'ReLU')

6) Fully Connected 2 [ Input = 120 Output = 84 ] (Activation = 'ReLU')

7) Fully Connected 3 [ Input = 84 Output = 10 ] (Activation = 'SoftMax')

 

 

 

Model Summary

간단하게, epochs = 10 으로 설정하였다.

running time 은 1분 정도이고 GPU 를 이용하였다.

lenet-5.py
0.00MB

'DeepLearning' 카테고리의 다른 글

VGGNet  (0) 2021.12.23
AlexNet  (0) 2021.12.23
Why Convolutions ?  (0) 2021.12.23
Convolutional Neural Networks  (0) 2021.12.23
Neural Network - DeepLearning  (0) 2021.08.29