【问题标题】:Feature extraction using caffe model使用 caffe 模型进行特征提取
【发布时间】:2017-07-10 17:15:10
【问题描述】:

我想讨论使用名为 GoggleNet 的 Caffe 模型进行特征提取。 我指的是这篇论文"End to end people detection in crowded scenes"。熟悉caffe的朋友,应该能应付我的疑问。

论文有自己的library使用Python,我也跑过这个库但是不能应付论文中提到的一些点。

输入图像通过GoogleNet till inception_5b/output层传递。

然后输出形成 15x20x1024 的多维数组。所以每个 1024 向量代表一个位于 64x64 区域中心的边界框。由于 50% 重叠,640x480 图像有 15x20 矩阵,每个单元格的第三维长度为 1024 个向量。

我的查询是

(1)这个15x20x1024的数组输出是怎么得到的?

(2)这个 1x1x1024 的数据如何代表图像中的 64x64 区域? 源码中有描述为

"""Takes the output from the decapitated googlenet and transforms the output
    from a NxCxWxH to (NxWxH)xCx1x1 that is used as input for the lstm layers.
    N = batch size, C = channels, W = grid width, H = grid height."""

该转换是使用 Python 中的函数 as 实现的

def generate_intermediate_layers(net):
    """Takes the output from the decapitated googlenet and transforms the output
    from a NxCxWxH to (NxWxH)xCx1x1 that is used as input for the lstm layers.
    N = batch size, C = channels, W = grid width, H = grid height."""

    net.f(Convolution("post_fc7_conv", bottoms=["inception_5b/output"],
                      param_lr_mults=[1., 2.], param_decay_mults=[0., 0.],
                      num_output=1024, kernel_dim=(1, 1),
                      weight_filler=Filler("gaussian", 0.005),
                      bias_filler=Filler("constant", 0.)))
    net.f(Power("lstm_fc7_conv", scale=0.01, bottoms=["post_fc7_conv"]))
    net.f(Transpose("lstm_input", bottoms=["lstm_fc7_conv"]))

我无法处理每个 1x1x1024 如何代表边界框矩形的大小。

【问题讨论】:

    标签: neural-network computer-vision deep-learning caffe


    【解决方案1】:

    由于您正在网络中非常深地查看 1x1 单元格,因此 recptive field 非常大并且在原始图像中可以(并且可能是)64x64 像素是有效的。
    也就是说,"inception_5b/output" 中的每个特征都受到输入图像中 64x64 像素的影响。

    【讨论】:

    • 表示电平输出可以是 15x20x1024。由于感受野,每个1x1x1024代表图像中64x64大小的矩形?
    • 这个解释有什么好的参考吗?感谢 Quora 中的参考,还有比这更深入的讨论吗?
    • @batuman 没有我现在能想到的“规范”参考。如果您找到一个好的答案,请随时使用链接编辑答案:)
    • 感谢您提到的同一页面上的链接 (cs231n.github.io/convolutional-networks) 有相当长的解释,非常值得阅读该文档。阅读文档后我明白的是,15x20x1024 代表原始图像中的 139x139 各自的字段大小。由于原始图像是 640x480,那么 15x20 的空间输出表示 64x64 的边界框,重叠率为 50%。这就是我为论文中的描述所应付的。这意味着,如果我尝试生成 30x60 的空间输出,如果我想缩小,则将代表 32x32 的边界框。
    猜你喜欢
    • 1970-01-01
    • 2016-12-13
    • 1970-01-01
    • 2019-06-07
    • 2020-08-06
    • 2012-10-19
    • 2018-08-18
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多