티스토리 뷰

AI

[논문 리뷰] DenseNet 간단리뷰

꿈더꿔 2022. 7. 24. 23:37

 

 

구조

논문에서 제시된 DenseNet 구조

DenseNet 이전 Conv 구조는 input이 Layer를 통과하면 이후에는 사용되지 않지만, DenseNet에서는 이전에 입력된 input과 output을 concatenate하여 이후 모든 Layer에 concatenate 되는 방식으로 학습시키는 것이 핵심이다. input이 위의 그림처럼 모든 이후 Layer에 계속해서 적용되는 것을 확인할 수 있다.

Layer depth에 따른 DenseNet 구조

Layer는 크게 Pooling, Dense Block, Transition Layer, Classification Layer로 구성되어있다.

 

 

1. Convolution and Pooling Layer

첫 Conv Layer에서는 output channel 수를 16으로 설정하였고, 7x7 filter, stride 2를 사용하였으며

Pooling Layer에서는 3x3 max pooling, stride 2를 사용하여 size를 반으로 축소하였다.

2. Dense Block

DenseNet 구조의 핵심 Layer

Conv로 적혀져 있는 것은 Batch Norm - ReLU - Conv 가 한쌍으로 이루어져 있으며 ResNet과 다르게 이전에 사용된 모든 Layer의 input을 사용하여 다음 Layer의 output을 업데이트 한다. 수식으로 나타내면 다음과 같다.

$$x_l = H_l ([x_{l-1}, x_{l-2}, \cdots , x_1, x_0])$$

이때 $[x_{l-1}, x_{l-2}, \cdots , x_1, x_0]$ 는 channel dimension을 기준으로 concatenate된 tensor다.

 

Layer의 Output은 항상 k로 고정되어 있으며, $k$는 12 or 24 등으로 customizing 가능하다. 따라서 $i$번째 Layer에서의 input channel dim값은 $k_0 + (i - 1)k$ 가 된다.

 

$k_0$는 맨처음 input의 channel dim값이며, 이후의 output들은 모두 $k$로 고정되어 있으므로 위의 식이 유도된다.

 

1개의 Layer는 1x1 Conv + 3x3 Conv로 구성되어있으며 더 자세하게 나타내면 다음과 같다.

Batch Norm - ReLU - Conv 1x1(input channel = $k_0 + (i - 1)k$, output channel = $4k$) - Batch Norm - ReLU - Conv 3x3(input channel = $4k$, output channel = $k$)

Layer 수는 Customizing할 수 있고, ResNet처럼 Bottleneck Layer 형태로 1x1 Conv - 3x3 Conv - 1x1 Conv 형태로 구성하여 계산을 효율적으로 할 수 있도록 구성할 수 있다.

 

 

 

3. Transition Layer

1x1 Conv - Average Pooling 으로 구성되어 있으며 Parameter 및 Size를 줄이는 목적의 Layer

 

4. Classification Layer

Global State로 제시되어 있는데, 각 feature가 분류에 있어서 어떤 영향을 미치는지 확인하는 구간으로 7x7 Average Pooling과 fc로 구성되어 있다. 각 feature를 Classification Task로 변경하여 Softmax를 취하여 확률값을 구하게된다.

 

논문 : https://arxiv.org/abs/1608.06993

 

Densely Connected Convolutional Networks

Recent work has shown that convolutional networks can be substantially deeper, more accurate, and efficient to train if they contain shorter connections between layers close to the input and those close to the output. In this paper, we embrace this observa

arxiv.org