一些是运行中打印出的网络结构代码,与上图完全对应。
LAYER GROUP 1 #卷积层组1
# 下面有两个卷积层,一个池化层,relu为线性整流层,每次卷积后,都relu一下
--conv1_1 | shape=(1, 663, 1000, 64) | weights_shape=(3, 3, 3, 64)
--relu1_1 | shape=(1, 663, 1000, 64) | bias_shape=(64,)
--conv1_2 | shape=(1, 663, 1000, 64) | weights_shape=(3, 3, 64, 64)
--relu1_2 | shape=(1, 663, 1000, 64) | bias_shape=(64,)
--pool1 | shape=(1, 332, 500, 64)
LAYER GROUP 2 #卷积层组2
# 下面有两个卷积层,一个池化层
--conv2_1 | shape=(1, 332, 500, 128) | weights_shape=(3, 3, 64, 128)
--relu2_1 | shape=(1, 332, 500, 128) | bias_shape=(128,)
--conv2_2 | shape=(1, 332, 500, 128) | weights_shape=(3, 3, 128, 128)
--relu2_2 | shape=(1, 332, 500, 128) | bias_shape=(128,)
--pool2 | shape=(1, 166, 250, 128)
LAYER GROUP 3 # 卷积层组3
# 下面有四个卷积层,一个池化层
--conv3_1 | shape=(1, 166, 250, 256) | weights_shape=(3, 3, 128, 256)
--relu3_1 | shape=(1, 166, 250, 256) | bias_shape=(256,)
--conv3_2 | shape=(1, 166, 250, 256) | weights_shape=(3, 3, 256, 256)
--relu3_2 | shape=(1, 166, 250, 256) | bias_shape=(256,)
--conv3_3 | shape=(1, 166, 250, 256) | weights_shape=(3, 3, 256, 256)
--relu3_3 | shape=(1, 166, 250, 256) | bias_shape=(256,)
--conv3_4 | shape=(1, 166, 250, 256) | weights_shape=(3, 3, 256, 256)
--relu3_4 | shape=(1, 166, 250, 256) | bias_shape=(256,)
--pool3 | shape=(1, 83, 125, 256)
LAYER GROUP 4 # 卷积层组4
# 下面有四个卷积层,一个池化层
--conv4_1 | shape=(1, 83, 125, 512) | weights_shape=(3, 3, 256, 512)
--relu4_1 | shape=(1, 83, 125, 512) | bias_shape=(512,)
--conv4_2 | shape=(1, 83, 125, 512) | weights_shape=(3, 3, 512, 512)
--relu4_2 | shape=(1, 83, 125, 512) | bias_shape=(512,)
--conv4_3 | shape=(1, 83, 125, 512) | weights_shape=(3, 3, 512, 512)
--relu4_3 | shape=(1, 83, 125, 512) | bias_shape=(512,)
--conv4_4 | shape=(1, 83, 125, 512) | weights_shape=(3, 3, 512, 512)
--relu4_4 | shape=(1, 83, 125, 512) | bias_shape=(512,)
--pool4 | shape=(1, 42, 63, 512)
LAYER GROUP 5 # 卷积层组5
# 下面有四个卷积层,一个池化层
--conv5_1 | shape=(1, 42, 63, 512) | weights_shape=(3, 3, 512, 512)
--relu5_1 | shape=(1, 42, 63, 512) | bias_shape=(512,)
--conv5_2 | shape=(1, 42, 63, 512) | weights_shape=(3, 3, 512, 512)
--relu5_2 | shape=(1, 42, 63, 512) | bias_shape=(512,)
--conv5_3 | shape=(1, 42, 63, 512) | weights_shape=(3, 3, 512, 512)
--relu5_3 | shape=(1, 42, 63, 512) | bias_shape=(512,)
--conv5_4 | shape=(1, 42, 63, 512) | weights_shape=(3, 3, 512, 512)
--relu5_4 | shape=(1, 42, 63, 512) | bias_shape=(512,)
--pool5 | shape=(1, 21, 32, 512)
vgg 本身还是一个卷积神经网络(CNN)(详细介绍),卷积神经网络由输入层、卷积层、激活函数、池化层、全连接层组成,即INPUT(输入层)-CONV(卷积层)-RELU(激活函数)-POOL(池化层)-FC(全连接层)。
vgg19在卷积☛池化部分做了扩充修改。
由图及code,可以观察到,vgg19一共有五个卷积层组(conv layer),卷积层使用的卷积核均为3×3卷积核,三个全连接层(FC layer)。
共计一共19个隐藏层,其中16个卷积层,1个池化层。
其中绝大多数的参数都是来自于第一个全连接层。VGG可是有3个全连接层
未写其反向传播过程,不太理解他那张图。待填坑。