Main Content

vgg19

VGG-19 컨벌루션 신경망

  • VGG-19 network architecture

설명

VGG-19는 19개 계층으로 구성된 컨벌루션 신경망입니다. ImageNet 데이터베이스의 1백만 개가 넘는 영상에 대해 훈련된 신경망의 사전 훈련된 버전을 불러올 수 있습니다 [1]. 사전 훈련된 신경망은 영상을 키보드, 마우스, 연필, 각종 동물 등 1,000가지 사물 범주로 분류할 수 있습니다. 그 결과 이 신경망은 다양한 영상을 대표하는 다양한 특징을 학습했습니다. 신경망의 영상 입력 크기는 224×224입니다. MATLAB®의 여타 훈련된 신경망에 대한 자세한 내용은 사전 훈련된 심층 신경망 항목을 참조하십시오.

VGG-19 신경망을 사용하여 classify로 새 영상을 분류할 수 있습니다. GoogLeNet을 사용하여 영상 분류하기 항목의 단계를 따르되 GoogLeNet을 VGG-19로 바꾸어서 수행하십시오.

새로운 분류 작업에서 신경망을 다시 훈련시키려면 새로운 영상을 분류하도록 딥러닝 신경망 훈련시키기 항목의 단계를 수행하고 GoogLeNet 대신 VGG-19를 불러오십시오.

예제

net = vgg19는 ImageNet 데이터 세트에서 훈련된 VGG-19 신경망을 반환합니다.

이 함수를 사용하려면 Deep Learning Toolbox™ Model for VGG-19 Network 지원 패키지가 필요합니다. 이 지원 패키지가 설치되어 있지 않으면 함수에서 다운로드 링크를 제공합니다.

net = vgg19('Weights','imagenet')은 ImageNet 데이터 세트에서 훈련된 VGG-19 신경망을 반환합니다. 이 구문은 net = vgg19와 동일합니다.

layers = vgg19('Weights','none')은 훈련되지 않은 VGG-19 신경망 아키텍처를 반환합니다. 훈련되지 않은 모델에는 지원 패키지가 필요하지 않습니다.

예제

모두 축소

이 예제에서는 Deep Learning Toolbox Model for VGG-19 Network 지원 패키지를 다운로드하고 설치합니다.

명령줄에 vgg19를 입력합니다.

vgg19

Deep Learning Toolbox Model for VGG-19 Network 지원 패키지가 설치되어 있지 않은 경우, 필요한 지원 패키지로 연결되는 애드온 탐색기 링크를 함수에서 제공합니다. 지원 패키지를 설치하려면 링크를 클릭한 다음 설치를 클릭하십시오. 명령줄에 vgg19를 입력하여 설치가 성공적으로 완료되었는지 확인하십시오.

vgg19
ans = 

  SeriesNetwork with properties:

    Layers: [47×1 nnet.cnn.layer.Layer]

심층 신경망 디자이너를 사용하여 신경망을 시각화합니다.

deepNetworkDesigner(vgg19)

새로 만들기를 클릭하여 심층 신경망 디자이너에서 사전 훈련된 다른 신경망을 살펴봅니다.

Deep Network Designer start page showing available pretrained neural networks

신경망을 다운로드해야 할 경우에는 원하는 신경망에서 잠시 멈추고 설치를 클릭하여 애드온 탐색기를 엽니다.

사전 훈련된 VGG-19 컨벌루션 신경망을 불러와서 계층과 클래스를 살펴봅니다.

사전 훈련된 VGG-19 신경망을 vgg19를 사용하여 불러옵니다. 출력값 netSeriesNetwork 객체입니다.

net = vgg19
net = 
  SeriesNetwork with properties:

    Layers: [47×1 nnet.cnn.layer.Layer]

Layers 속성을 사용하여 신경망 아키텍처를 표시합니다. 이 신경망에는 47개의 계층이 있습니다. 학습 가능한 가중치를 갖는 계층은 19개입니다. 16개는 컨벌루션 계층이고, 3개는 완전 연결 계층입니다.

net.Layers
ans = 
  47x1 Layer array with layers:

     1   'input'     Image Input             224x224x3 images with 'zerocenter' normalization
     2   'conv1_1'   Convolution             64 3x3x3 convolutions with stride [1  1] and padding [1  1  1  1]
     3   'relu1_1'   ReLU                    ReLU
     4   'conv1_2'   Convolution             64 3x3x64 convolutions with stride [1  1] and padding [1  1  1  1]
     5   'relu1_2'   ReLU                    ReLU
     6   'pool1'     Max Pooling             2x2 max pooling with stride [2  2] and padding [0  0  0  0]
     7   'conv2_1'   Convolution             128 3x3x64 convolutions with stride [1  1] and padding [1  1  1  1]
     8   'relu2_1'   ReLU                    ReLU
     9   'conv2_2'   Convolution             128 3x3x128 convolutions with stride [1  1] and padding [1  1  1  1]
    10   'relu2_2'   ReLU                    ReLU
    11   'pool2'     Max Pooling             2x2 max pooling with stride [2  2] and padding [0  0  0  0]
    12   'conv3_1'   Convolution             256 3x3x128 convolutions with stride [1  1] and padding [1  1  1  1]
    13   'relu3_1'   ReLU                    ReLU
    14   'conv3_2'   Convolution             256 3x3x256 convolutions with stride [1  1] and padding [1  1  1  1]
    15   'relu3_2'   ReLU                    ReLU
    16   'conv3_3'   Convolution             256 3x3x256 convolutions with stride [1  1] and padding [1  1  1  1]
    17   'relu3_3'   ReLU                    ReLU
    18   'conv3_4'   Convolution             256 3x3x256 convolutions with stride [1  1] and padding [1  1  1  1]
    19   'relu3_4'   ReLU                    ReLU
    20   'pool3'     Max Pooling             2x2 max pooling with stride [2  2] and padding [0  0  0  0]
    21   'conv4_1'   Convolution             512 3x3x256 convolutions with stride [1  1] and padding [1  1  1  1]
    22   'relu4_1'   ReLU                    ReLU
    23   'conv4_2'   Convolution             512 3x3x512 convolutions with stride [1  1] and padding [1  1  1  1]
    24   'relu4_2'   ReLU                    ReLU
    25   'conv4_3'   Convolution             512 3x3x512 convolutions with stride [1  1] and padding [1  1  1  1]
    26   'relu4_3'   ReLU                    ReLU
    27   'conv4_4'   Convolution             512 3x3x512 convolutions with stride [1  1] and padding [1  1  1  1]
    28   'relu4_4'   ReLU                    ReLU
    29   'pool4'     Max Pooling             2x2 max pooling with stride [2  2] and padding [0  0  0  0]
    30   'conv5_1'   Convolution             512 3x3x512 convolutions with stride [1  1] and padding [1  1  1  1]
    31   'relu5_1'   ReLU                    ReLU
    32   'conv5_2'   Convolution             512 3x3x512 convolutions with stride [1  1] and padding [1  1  1  1]
    33   'relu5_2'   ReLU                    ReLU
    34   'conv5_3'   Convolution             512 3x3x512 convolutions with stride [1  1] and padding [1  1  1  1]
    35   'relu5_3'   ReLU                    ReLU
    36   'conv5_4'   Convolution             512 3x3x512 convolutions with stride [1  1] and padding [1  1  1  1]
    37   'relu5_4'   ReLU                    ReLU
    38   'pool5'     Max Pooling             2x2 max pooling with stride [2  2] and padding [0  0  0  0]
    39   'fc6'       Fully Connected         4096 fully connected layer
    40   'relu6'     ReLU                    ReLU
    41   'drop6'     Dropout                 50% dropout
    42   'fc7'       Fully Connected         4096 fully connected layer
    43   'relu7'     ReLU                    ReLU
    44   'drop7'     Dropout                 50% dropout
    45   'fc8'       Fully Connected         1000 fully connected layer
    46   'prob'      Softmax                 softmax
    47   'output'    Classification Output   crossentropyex with 'tench' and 999 other classes

신경망에서 학습한 클래스의 이름을 보려면 분류 출력 계층(마지막 계층)의 Classes 속성을 보면 됩니다. 처음 10개의 요소를 지정하여 처음 10개의 클래스를 표시합니다.

net.Layers(end).Classes(1:10)
ans = 10×1 categorical array
     tench 
     goldfish 
     great white shark 
     tiger shark 
     hammerhead 
     electric ray 
     stingray 
     cock 
     hen 
     ostrich 

출력 인수

모두 축소

사전 훈련된 VGG-19 컨벌루션 신경망으로, SeriesNetwork 객체로 반환됩니다.

훈련되지 않은 VGG-19 컨벌루션 신경망 아키텍처로, Layer 배열로 반환됩니다.

참고 문헌

[1] ImageNet. http://www.image-net.org

[2] Russakovsky, O., Deng, J., Su, H., et al. “ImageNet Large Scale Visual Recognition Challenge.” International Journal of Computer Vision (IJCV). Vol 115, Issue 3, 2015, pp. 211–252

[3] Simonyan, Karen, and Andrew Zisserman. "Very deep convolutional networks for large-scale image recognition." arXiv preprint arXiv:1409.1556 (2014).

[4] Very Deep Convolutional Networks for Large-Scale Visual Recognition http://www.robots.ox.ac.uk/~vgg/research/very_deep/

확장 기능

버전 내역

R2017a에 개발됨