LarryJiang134 / Image_manipulation_detection

Paper: CVPR2018, Learning Rich Features for Image Manipulation Detection
MIT License
358 stars 99 forks source link

bbx_pred的预测流不太对 #23

Closed wwb306 closed 4 years ago

wwb306 commented 4 years ago

按照源论文的描述,最终bbox的预测使用的rgb流出来的Rol feature,但看代码中使用的是Bilinear polling出来的结果既做了cls_pred,也做了bbox_pred,见lib/net/vgg16.py

cls_score = slim.fully_connected(fc7_cbp, self._num_classes, weights_initializer=initializer, trainable=is_training, activation_fn=None, scope='cls_score')
cls_prob = self._softmax_layer(cls_score, "cls_prob")
bbox_prediction = slim.fully_connected(fc7_cbp, self._num_classes * 4, weights_initializer=initializer_bbox, trainable=is_training, activation_fn=None, scope='bbox_pred')

是否应该改为:

# bbox的预测使用rgb流来做
pool5_flat = slim.flatten(pool5, scope='rgb_flatten')
# Fully connected layers
fc6 = slim.fully_connected(pool5_flat, 4096, scope='rgb_fc6')
if is_training:
fc6 = slim.dropout(fc6, keep_prob=0.5, is_training=True, scope='rgb_dropout6')

fc7 = slim.fully_connected(fc6, 4096, scope='rgb_fc7')
if is_training:
fc7 = slim.dropout(fc7, keep_prob=0.5, is_training=True, scope='rgb_dropout7')

bbox_prediction = slim.fully_connected(fc7, self._num_classes * 4, weights_initializer=initializer_bbox,
trainable=is_training, activation_fn=None, scope='bbox_pred')
wwb306 commented 4 years ago

额,注释里面有,按注释更改即可