【发布时间】:2018-05-18 16:13:02
【问题描述】:
我正在使用基于检测的 CNN 进行手部姿势估计(在单手的深度图像中查找手部关节)。我的计划是首先使用 FCN 找到所有 16 个关键点的 2D 坐标。主干是 ResNet-50-FPN,计算图可见here。 res2a~res5c的结构如图here。
当我使用 ICVL 手部姿势数据集训练此模型时,输出特征图收敛为所有像素值几乎为零的全黑图像。基本事实是深度图和热图,例如this。如果我在最后一个卷积层之后添加一个 sigmoid 激活函数(如图所示),输出热图将类似于白噪声。反正检测 FCN 完全没用,而 loss 根本不会下降。
我的 CNN 模型可以用下面的代码简单演示一下:
heat_chain = TensorChain(image_tensor) \
.convolution_layer_2d(3, 16, 1, 'conv1') \
.batch_normalization() \
.relu('relu1') \
.max_pooling_layer_2d(2, 'pool1') \
.bottleneck_2d(64, 256, 'res2a') \
.bottleneck_2d(64, 256, 'res2b') \
.bottleneck_2d(64, 256, 'res2c') \
.branch_identity_mapping() \
.bottleneck_2d(128, 512, 'res3a', stride=2) \
.bottleneck_2d(128, 512, 'res3b') \
.bottleneck_2d(128, 512, 'res3c') \
.bottleneck_2d(128, 512, 'res3d') \
.branch_identity_mapping() \
.bottleneck_2d(256, 1024, 'res4a', stride=2) \
.bottleneck_2d(256, 1024, 'res4b') \
.bottleneck_2d(256, 1024, 'res4c') \
.bottleneck_2d(256, 1024, 'res4d') \
.bottleneck_2d(256, 1024, 'res4e') \
.bottleneck_2d(256, 1024, 'res4f') \
.branch_identity_mapping() \
.bottleneck_2d(512, 2048, 'res5a', stride=2) \
.bottleneck_2d(512, 2048, 'res5b') \
.bottleneck_2d(512, 2048, 'res5c') \
.upsampling_block_2d(2, [-1, 30, 40, 512], 'upsample1') \
.merge_identity_mapping_2d('merge1') \
.upsampling_block_2d(2, [-1, 60, 80, 256], 'upsample2') \
.merge_identity_mapping_2d('merge2') \
.upsampling_block_2d(2, [-1, 120, 160, 64], 'upsample3') \
.merge_identity_mapping_2d('merge3') \
.upsampling_block_2d(2, [-1, 240, 320, 16], 'upsample4') \
.convolution_layer_2d(3, 16, 1, 'conv2') \
.convolution_layer_2d(3, 16, 1, 'conv3')
heatmaps = tf.identity(heat_chain.output_tensor, name='heatmaps')
heat_loss = tf.reduce_mean(
tf.reduce_sum(tf.pow(heatmaps - heat_ground_truth, 2), axis=[1, 2, 3]), name='heat_loss')
其中 branch_identity_mapping() 将最后一个张量推入堆栈,merge_identity_mapping_2d() 弹出存储的张量并将其添加到当前张量(也可以与 1x1 卷积层的尺寸匹配)。
我完全不知道哪里出了问题。我的 ResNet-50-FPN 实现是否不正确,或者缺少一些重要的东西?
【问题讨论】:
标签: tensorflow feature-detection pose-estimation keypoint