본문 바로가기

DeepLearning

DenseNet

https://openaccess.thecvf.com/content_cvpr_2017/papers/Huang_Densely_Connected_Convolutional_CVPR_2017_paper.pdf

리뷰할 논문의 제목은 Densely Connected Convolutional Networks 이며 위의 논문입니다.

 

해당 리뷰를 작성하기 위해 나의 이해와 더불어 감사하게도 큰 도움을 준 곳.

https://towardsdatascience.com/paper-review-densenet-densely-connected-convolutional-networks-acf9065dfefb

 

Key Points:

1. Alleviates vanishing gradient

2. Stronger feature propagation

3. Feature reuse

4. Reduced Parameters Count

 

먼저, 익숙하게도 이전 ResNet, Inception network 에서 다루었고 많은 네트워크 구조가 개선하기 위해 노력하였던 문제점에 대하여 생각해볼 필요가 있다.

네트워크의 구조가 깊어질수록, 초기네트워크의 gradients 가 충분히 의미있게 backpropagation 되지 못하는 점. 

위의 이 문제점을 위해 skipconnection, gradient highway 등 network 구조로는 ResNet, Highway Network, Fractal Net, Stochastic depth Network 등이 문제점의 해결을 위해 방법론을 제시하였던 연구들이다.

 

이 논문에서 제시되는 방법을 살펴보면 

 

Dense Connections 

Concatenation of feature maps
Dense connections

이전 처리되었던 feature map 을 연속적으로 다음 레이어의 결과값에 concatenation 하는 것으로 이전 기울기 소실이나 앞선 레이어에서 처리된 feature information 을 연속적으로 전달하는 방법을 제시하였다.

주목할 점은 ResNet 에서는 elementwise 하게 add 하였던 반면 channelwise 하게 concatenate 하는 방법이다.

 

구성요소

Composite function

BatchNorm --> Activate(ReLU) --> Conv (3x3) 의 구조를 명칭한다.

 

Dense Block

Dense layer 들을 연속적으로 연결해주는 하나의 block이다. (특징으로는 width, height 은 고정적이지만 channel 을 늘려가는 방법)

Dense block (DB) with six Dense Layers (DL)

Pooling layer

재미있게도 Dense Block 이 끝난 후 한번의 Conv layer 를 통과한후 downsampling 하는 구조이다.

 

Dense layer

1x1 Conv (conventional conv operation for extracting features)

3x3 Conv (bringing down the feature depth / channel count)

가정으로 예를 들면)

64channel input --> 1x1 conv (increase channel) --> 128 channel --> 3x3 conv --> 32 channel

 

Growth rate

각 Dense Block 에 적용되는데,

예를들어, H1 : Conv1 input channel = 10, H2 Conv2 input channel = 10 + 4 = 14 - - - H4 Conv4 input channel = 10+4+4+4 = 22 마지막 Transition Layer input channel 은 10+4+4+4+4 = 26 이 된다. 그래서 동일한 Denseblock 의 channel의 개수를 growth rate (k) 라고 부른다.

 

Transition layer

 

Dense block 끝에 항상 붙는 층으로 Dense block 의 최종 출력은 input_feature + ( # dense layers x growth rate) 의 channel 의 수를 갖게 된다.  급격한 채널의 증가는 연산량의 증가로 귀속될 수 있기 때문에 해당 층에서는 channel 을 감소하는 작업과 동시에 downsampling 을 진행한다.

1 x 1 conv (redunction channel count to half) ,  2 x 2 Average PooL (downsampling width and height)

 

DenseNet - 121 의 전체 네트워크 구조

위의 구조를 cifar10 을 사용하여 구현한 파일 (densenet121.py)

densenet121.py
0.00MB

 

 

Advanced Deep Learning with TensorFlow 2 and Keras 의 책에 있는 소스코드 (Bottelneck + Compression)

densenetbc.py
0.01MB

'DeepLearning' 카테고리의 다른 글

Face Recognition  (0) 2021.12.29
Semantic Segmentation  (0) 2021.12.28
ResNet  (0) 2021.12.24
Inception Network (GoogleNet)  (0) 2021.12.23
VGGNet  (0) 2021.12.23