徹底搞懂SSD網路結構

2021-09-23 18:52:20 字數 3111 閱讀 7708

還是得從下圖說起,之前一直沒實際搞清楚。

ssd的網路結構流程如下圖所示:

ssd總共11個block,相比較於之前的vgg16,改變了第5個block的第4層,第6、7、8卷積層全部去掉,分別增加了紅框、黑框、黃框、藍框。

tensorflow**如下:

with tf.variable_scope(scope, 'ssd_300_vgg', [inputs], reuse=reuse):

# original vgg-16 blocks.

net = slim.repeat(inputs, 2, slim.conv2d, 64, [3, 3], scope='conv1')

end_points['block1'] = net

net = slim.max_pool2d(net, [2, 2], scope='pool1')

# block 2.

net = slim.repeat(net, 2, slim.conv2d, 128, [3, 3], scope='conv2')

end_points['block2'] = net

net = slim.max_pool2d(net, [2, 2], scope='pool2')

# block 3.

net = slim.repeat(net, 3, slim.conv2d, 256, [3, 3], scope='conv3')

end_points['block3'] = net

net = slim.max_pool2d(net, [2, 2], scope='pool3')

# block 4.

net = slim.repeat(net, 3, slim.conv2d, 512, [3, 3], scope='conv4')

end_points['block4'] = net

net = slim.max_pool2d(net, [2, 2], scope='pool4')

# block 5.

net = slim.repeat(net, 3, slim.conv2d, 512, [3, 3], scope='conv5')

end_points['block5'] = net

#注意處

net = slim.max_pool2d(net, [3, 3], stride=1, scope='pool5')

# additional ssd blocks.

# block 6: let's dilate the hell out of it!

#注意處

net = slim.conv2d(net, 1024, [3, 3], rate=6, scope='conv6')

end_points['block6'] = net

net = tf.layers.dropout(net, rate=dropout_keep_prob, training=is_training)

# block 7: 1x1 conv. because the ****.

#注意處

net = slim.conv2d(net, 1024, [1, 1], scope='conv7')

end_points['block7'] = net

net = tf.layers.dropout(net, rate=dropout_keep_prob, training=is_training)

# block 8/9/10/11: 1x1 and 3x3 convolutions stride 2 (except lasts).

end_point = 'block8'

with tf.variable_scope(end_point):

net = slim.conv2d(net, 256, [1, 1], scope='conv1x1')

#注意點:實際上相當於下面的卷積操作進行padding了

net = custom_layers.pad2d(net, pad=(1, 1))

net = slim.conv2d(net, 512, [3, 3], stride=2, scope='conv3x3', padding='valid')

end_points[end_point] = net

end_point = 'block9'

with tf.variable_scope(end_point):

net = slim.conv2d(net, 128, [1, 1], scope='conv1x1')

#注意點:實際上相當於下面的卷積操作進行padding了

net = custom_layers.pad2d(net, pad=(1, 1))

net = slim.conv2d(net, 256, [3, 3], stride=2, scope='conv3x3', padding='valid')

end_points[end_point] = net

end_point = 'block10'

with tf.variable_scope(end_point):

net = slim.conv2d(net, 128, [1, 1], scope='conv1x1')

net = slim.conv2d(net, 256, [3, 3], scope='conv3x3', padding='valid')

end_points[end_point] = net

end_point = 'block11'

with tf.variable_scope(end_point):

net = slim.conv2d(net, 128, [1, 1], scope='conv1x1')

net = slim.conv2d(net, 256, [3, 3], scope='conv3x3', padding='valid')

end_points[end_point] = net

經典網路結構梳理 SSD目標檢測演算法。

ssd全稱 single shot multibox detector 是2016年iccv的一篇 是目前為止主要的目標檢測演算法。演算法的主要優點 1.速度比faster rcnn快,精度比yolo高。在兼顧速度的同時,精度也很高。在不同的測試集下面結果都很不錯 2.為提高準確率在不同的特徵圖下面...

c s網路結構

採用c s 客戶端和服務端模式進行檔案和命令資料的傳輸,以及資料的交換。c s 和b s p2p等多種技術想結合。一,cs 網路的實現 採用傳統的客戶端和服務端模式,用tcp ip 協議進行資料的互動和傳遞。二,cs網路開發 模仿著名的灰鴿子軟體,灰鴿子的到來,給網路世界,帶來了新的活力,給人們帶來...

GPRS網路結構

gprs網路結構圖 bts base transceiver station,基站收發臺 bts可看作乙個無線數據機,負責移動訊號的接收和傳送處理 bsc base station controller,基站控制器 msc mobile switching center,移動交換中心 整個gprs網...