GoogLeNet (InceptionV1)
- Paper Implementation : "Going deeper with convolutions.(2014)"
- Code Practice : 아래 Colab과 Git 링크를 통해 어떻게 구현 되었는지 구체적으로 확인해 보실 수 있습니다.
Description
- GoogLeNet의 특징:
1. GoogLeNet Architecture:
- GoogLeNet은 네트워크의 depth와 width를 늘리면서도 내부적으로 Inception Module을 활용해 computational efficiency를 확보하였습니다.VGGNet은 깊은 네트워크(deeper network)로 AlexNet보다 높은 성능을 얻었지만, 파라미터 측면에서 효율성이 떨어집니다.반면 GoogLeNet의 경우 Inception Module과 Auxiliary Classifier를 적용해 computational efficiency를 증대 시켰습니다.
Figure 1.GoogLeNet Architecture : C. Szegedy et al.(2014)
2. Issue and Solution:
- 네트워크의 성능을 올리는 직접적인 방법은 사이즈 증대와 층(layer)을 깊게 설계 하는 방법이 있습니다. 하지만 파라미터(Parameter)가 증가하면 계산해야 할 연산량이 늘어나 모델 학습 시 과적합(overfitting)이 나타날 가능성이 증가합니다. 게다가, RAM을 너무 많이 사용하고 시간이 오래 걸려 비효율적입니다.GoogLeNet에서 제시한 3가지 대안 (Sparsely Connected Network, Inception Module, Auxiliary Classifier)을 살펴보겠습니다.
먼저, Fully connected Network에서 Sparsely connected Network로 변경 하였습니다. 기존에 CNN 모델들은 Dense층이 밀집되어 연결되어 있습니다. 이런 경우 연산량이 급격히 늘어나 효율성이 떨어집니다. 문제 해결을 위해 연관성이 높은 노드들을 추출하여 Sparse하게 Network를 구성하였습니다. 결국 파라미터 수와 연산량이 줄어들게 되고 과적합(Overfitting)도 방지 하게 되었습니다. - 다음으로, Inception Module이 적용되었습니다. 3개의 inception blocks (3a,3b), (4a~4e), (5a,5b), 총 9개의 inception modules 추가하여 Feature Map(특성맵)을 효과적으로 추출하였습니다. 마지막으로, Auxiliary Classifier는 gradient vanishing 문제 해결 위해 2개의 auxiliary classifier 적용하였습니다.
- 그렇다면 적은 연산량으로 모델의 특징을 추출하는 효율적인 방법을 있을까?
3. Global Average Pooling(GAP):
- Global Average Pooling은 전 층(Previous layer)에서 산출된 특성맵들을 각각 평균냅니다.다음으로 1차원 벡터로 만듭니다.Why? 1차원 벡터로 만들어야 softmax층으로 연결 가능하고, 최종적으로 이미지 분류가 가능 합니다.게다가 FIne Tuning의 용이성이 있습니다. Patch size 는 7x7 , stride는 1 로 설정하였습니다.
4. Max Pooling:
- Max Pooling은 다음과 같이 구성되었습니다. 3x3 patch size, 2 strides, 4 max pooling(number of max pooling)
5. Inception Module:
- Inception Module의 구성은 다음과 같습니다.
- 1x1 Convolution: kernel_size=1, stride= 1, padding=0
- 3x3 Convolution: kernel_size=3, stride= 1, padding=1
- 5x5 Convolution: kernel_size=5, stride= 1, pading=2
- Max-Pooling: kernel_size=3, stride=1, padding=1
6. Auxiliary Classifier:
- Auxiliary Classifier는 다음과 같이 적용되었습니다.
- 1x1 convolution output channel = 128 적용
- dropout rate = 0.7 적용, auxiliary Classifier의 input dimensioin = aux1(512), aux2(528)
7. Fully Connected Layer(FC Layer):
- FC층의 설계는 다음과 같습니다: 1개의 1024 FC layer, 1개의 Softmax layer
8. Image Preprocessing:
- 이미지 전처리는 input shape, resize, mean subtraction으로 진행되었습니다. Input image shape은 224 x 224 x 3으로 적용하였으며, resize는 224 x 224로 맞춰주었습니다. 마지막으로 RGB 채널 마다 mean subtraction을 적용하였습니다.
9. Hyperparameter:
- 논문에서 제시한 하이퍼 파라미터 적용 방법과 실제 구현에 사용한 방법은 다음과 같습니다.
- Optimizer = SGD -> Adam으로 변경
- Momentum = 0.9 -> 적용하지 않음
- Batch size = 64 -> 128 변경
- learning rate = learning rate scheduler 사용 -> 0.0001으로 변경
- Epoch = not mentioned -> 20 적용
- Dropout = 0.4(FC layer)
10. Test Results:
- Test 결과는 Accuracy, Loss, Classification Report, Confusion Matrix로 확인해 보실 수 있습니다.
11. Dataset
- 논문에서 ImageNet 데이터셋을 사용했지만 개발환경의 제한으로 CIFAR-10을 사용했습니다.
- 논문 : ImageNet Large Scale Visual Recognition Challenge(ILSVRC)-2014
- 구현 : CIFAR-10
12. System Environment:
- Google Colab Pro Plus GPU : K80(Kepler), T4(Turing), and P100(Pascal)
- Jupyter Notebook, Visual Studio Code
Reference
[1] "[논문구현]GoogLeNet 파이토치로 구현하기", For a better world, 2022년 9월 12일 수정, 2023년 1월 10일 접속, https://roytravel.tistory.com/338.
[2] "Auxiliary classifier란?/GoogLeNet에서 Auxiliary classifer를 사용한 이유?", Technical Support, 2020년 5월 8일 수정, 2023년 1월 10일 접속, https://technical-support.tistory.com/87.
[3] "[📚GoogLeNet (2014)] Going Deeper with Convolutions", paragonyun, 2022년 10월 30일 수정, 2023년 1월 10일 접속, https://blog.naver.com/paragonyun/222914679046.
[4] "GoogLeNet", paragonyun, 2022년 11월 4일 수정, 2023년 1월 10일 접속,
https://github.com/paragonyun/Papers_I_must_read/tree/main/GoogLeNet.
[5] "[CNN 알고리즘들]GoogLeNet(inception v1)의 구조", 코딩재개발, 2019년 10월 7일 수정, 2023년 1월 12일 접속, https://bskyvision.com/entry/CNN-%EC%95%8C%EA%B3%A0%EB%A6%AC%EC%A6%98%EB%93%A4-GoogLeNetinception-v1%EC%9D%98-%EA%B5%AC%EC%A1%B0.
[6] "8.4.Multi-Branch Networks(GoogLeNet)", DIVE INTO DEEP LEARNING, 2023년 1월 13일 접속, https://d2l.ai/chapter_convolutional-modern/googlenet.html.
[7] "[논문리뷰]GoogLeNet(2014)설명", inhovation97, 2021년 10월 3일 수정, 2023년 1월 13일 접속, https://inhovation97.tistory.com/45?category=920765.
[8] "GoogLeNet의 Inception Module 1x1 컨볼루션의 의미와 구현", 테디노트, 2023년 1월 8일 수정, 2023년 1월 13일 접속, https://teddylee777.github.io/pytorch/inception-module/.
[9] "구글 인셉션 Google Inception(GoogLeNet) 알아보기", 이끼의 생각, 2019년 6월 5일 수정, 2023년 1월 13일 접속, https://ikkison.tistory.com/86.
[10] C. Szegedy et al., "Going deeper with convolutions," 2015 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), Boston, MA, USA, 2015, pp. 1-9, doi: 10.1109/CVPR.2015.7298594. https://arxiv.org/pdf/1409.4842.pdf
[11] Krizhevsky, A., & Hinton, G. (2009). Learning multiple layers of features from tiny images.
http://www.cs.utoronto.ca/~kriz/learning-features-2009-TR.pdf
[12] "The CIFAR-10 dataset", Alex Krizhevsky's home page, 2009년 작성, 2023년 1월 13일 접속,
https://www.cs.toronto.edu/~kriz/cifar.html.
'Artificial Intelligence > 컴퓨터 비전 (CV)' 카테고리의 다른 글
[PyTorch] Vision Transformer(ViT) 논문구현 (4) | 2023.02.16 |
---|---|
[PyTorch] ResNet 논문구현 (0) | 2023.02.12 |
[PyTorch] VGGNet 논문구현 (0) | 2023.02.08 |
[PyTorch] AlexNet 논문구현 (0) | 2023.02.06 |
댓글