1. Classic networks
- LeNet-5
- CONV-POOL-CONV-POOL-FC-FC-output 형태의 시초 (avg pooling 사용)
- layer를 쌓을수록 $n_{H}, n_{W}$는 줄어들고, $n_{C}$는 증가하는 형태
- 특이사항: nonlinear function으로 sigmoid/tanh 사용 (ReLU X), POOL 다음에 nonlinearity function 사용
- # parameters: 60K
- AlexNet
- LeNet과 유사하지만, 더 깊은 layer를 사용 (3x3, s=2인 max pooling 사용)
- nonlinear function으로 ReLU 사용
- 특이사항: Local Response Normalization (LRN)을 통해, 각 position에서 높은 activation을 가지는 뉴런들이 너무 많지 않도록 함 -> 하지만 후속 연구에서 그리 유용하지 않다는 것이 밝혀져 현재는 잘 사용하지 않음
- # parameters: ~60M
- VGG-16
- CONV layer를 3x3 filter, s=1, same convolution으로 통일
- MAX-POOL은 2x2 filter, s=2로 통일시켜서 매우 simple한 구조를 가짐
- 특이사항: layer를 16개 쌓으면 VGG-16, 19개면 VGG-19 / 이전에 비해 학습해야 할 parameter의 수가 급격하게 늘어남
- # parameters: ~138M
2. ResNets (Residual Networks)
VGG 이후에 layer를 깊게 쌓을수록 성능이 더 좋아진다는 것을 확인했다. 그래서 깊게 쌓으면 무조건 좋겠거니 했는데, 깊게 쌓을수록 gradient vanishing 문제로 인해 성능이 떨어지는 것을 발견.
그래서 skip connection을 활용한 residual block (network)가 등장했고, 이러한 문제를 해결했다.

Residual block을 활용한 ResNet은 왜 효과적인 것일까?
먼저, 깊은 네트워크 (아래 그림에서 B)는 "최소한" 깊지 않은 네트워크 (아래 그림에서 A) 보다는 성능이 저하되지 않기를 바란다.
즉, 최악의 상황(아무것도 학습되지 않는,, Weight=0, bias=0인 상황)에서 "최소한" Identity function의 역할을 하길 바란다. 그렇다면 layer를 깊게 쌓아도 최소한 성능이 더 저하되지는 않을 것이다.

이러한 Identity function의 역할을 할 수 있도록 만들어주는 것이 skip connection이다.
따라서 이러한 residual block을 활용하면, 매우 깊은 NN의 성능 저하를 막을 수 있는 것이다.
여기에 추가로, 중간 layer에서 무언가를 학습할 것이 있다면 추가로 성능 향상도 가능하다는 것이 장점이다.
또한, $a^{[l]}$에서 $a^{[l+2]}$로의 mapping function을 학습하는 것이 아니라 $a^{[l+2]}$과 $a^{[l]}$의 차이 (잔차, Residual)를 학습하는 것이므로, 좀 더 용이한 학습이 가능하다.
Inception Network를 설명하기에 앞서, 1x1 convolution에 대해서 설명한다.
- 1x1 convolution (network in network)의 역할
- 하나의 1x1 conv layer를 더해줌으로써, 더 complex function을 학습할 수 있다.
- output의 channel 수를 조절할 수 있다.

- Inception network의 motivation
- filter의 크기 (1x1으로 할지, 3x3으로 할지, 5x5로 할지)나 pooling을 정하는 대신에, 전부 다 적용해서 출력을 다 concatenation 한 다음에 네트워크가 스스로 원하는 parameter나 filter크기의 조합을 학습할 수 있도록 함.
- 하지만, 이렇게 모든 filter를 사용해서 계산할 경우 computational cost가 너무 커지게 된다.
- 따라서 1x1 conv layer를 bottleneck layer로 사용해서 computational cost를 줄인다.

- Inception module
- 따라서 단순히 "3x3 CONV"나 "5x5 CONV"를 사용하는 것이 아니라, 그전에 "1x1 CONV"를 사용해서 computational cost를 줄인다.

- Inception Network는 이러한 module들과 중간중간 auxiliary branches를 활용해서 좋은 성능을 낸다.
- auxiliary branches는 중간 layer에서 계산된 feature들을 이용해 이미지의 결과를 예측하는데, 나쁘지 않은 결과를 낸다. 이러한 branch들의 추가를 통해 regularization 효과를 얻을 수 있고, overfitting을 방지할 수 있다.
4. MobileNet
: MobileNet은 deployment를 위한 low computational cost을 필요로 하는 목적, 혹은 mobile이나 embedded vision application 활용을 목적으로 제안되었다.
MobileNet의 핵심 아이디어는 Depthwise Seperable Convolution이다.
- Normal Convolution vs. Depthwise Seperable Convolution
Depthwise Seperable Convolution은 normal convolution과 다르게 depthwise convolution과 pointwise convolution으로 나눠져 있다. (2 step)
- 먼저 normal convolution의 computational cost를 계산해 보면 2160이다.

- Depthwise Convolution and Pointwise Convolution (projection operation)

- Depthwise Convoltuion
- Depth-wise convolutiond은 input의 channel 별로 convolution을 진행한다.
- Computational cost = 432
- Pointwise Convolution
- Depth-wise convolution을 진행한 다음, $n \times n \times n_{c}$ 크기를 가지는 $n_{c}'$ 개의 filter를 활용하여 convolution을 수행한다.
- Computational cost = 240
- Computational cost Summary
- Normal convolution의 경우 2160
- Depthwise seperabl convolution의 경우 432 + 240 = 672의 computational cost를 가진다.
- 즉 depthwise seperable conv가 약 normal conv의 30% 정도의 computational cost만 사용한다.
- --> MobileNet이 훨씬 적은 computational cost로 task를 수행가능하다.
- MobileNet v1 and v2
- 첫 번째 그림은 MobileNet v1의 대략적인 architecture
- 두 번째 그림은 MobileNet v2의 대략적인 architecture를 나타낸다.

MobileNet v2의 경우, Residual Connection과 Expansion layer가 추가되었다.
- Residual Connection: gradient를 좀 더 efficiently backward propagate 해준다.
- Expansion layer
- 1x1 convolution을 사용해서 input의 channel 수 (depth)를 expansion 한다. (representation size를 증가시킴)
- NN가 좀 더 richer and complex function을 학습할 수 있도록 도와준다.
- Pointwise (projection)
- 확장된 representation을 다시 작게 만들어줌
- memory의 양을 유지할 수 있도록 도와줌
'ML || DL > 이론' 카테고리의 다른 글
| [Coursera] DLS_C4W3: Semantic Segmentation (0) | 2023.10.08 |
|---|---|
| [Coursera] DLS_C4W3: Object Detection (0) | 2023.10.07 |
| [Coursera] DLS_C4W1: Foundations of CNNs (0) | 2023.10.02 |
| [Coursera] DLS_C3W2: Transfer Learning / Multi-task Learning / End-to-End Learning (0) | 2023.09.26 |
| [Coursera] DLS_C3W2: Error Analysis / Mismatched Training and Dev/Test Set (0) | 2023.09.24 |