Main Content

このページの内容は最新ではありません。最新版の英語を参照するには、ここをクリックします。

vgg19

VGG-19 畳み込みニューラル ネットワーク

  • VGG-19 network architecture

説明

VGG-19 は、深さが 19 層の畳み込みニューラル ネットワークです。100 万個を超えるイメージで学習させた事前学習済みのネットワークを、ImageNet データベース[1]から読み込むことができます。この事前学習済みのネットワークは、イメージを 1000 個のオブジェクト カテゴリ (キーボード、マウス、鉛筆、多くの動物など) に分類できます。結果として、このネットワークは広範囲のイメージに対する豊富な特徴表現を学習しています。ネットワークのイメージ入力サイズは 224 x 224 です。MATLAB® の他の事前学習済みのネットワークについては、事前学習済みの深層ニューラル ネットワークを参照してください。

classify を使用すると、VGG-19 ネットワークを使用して新しいイメージを分類できます。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 畳み込みニューラル ネットワークを読み込み、層およびクラスを確認します。

vgg19 を使用して事前学習済みの VGG-19 ネットワークを読み込みます。出力 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 で導入