OHEM在线难样例挖掘的两个细节

在这里插入图片描述
代码上如何实现Read-only Layer与R _hard-sel权限共享?
https://github.com/abhi2610/ohem/blob/master/models/pascal_voc/VGG_CNN_M_1024/fast_rcnn_ohem/train.prototxt
下面代码对应(a),前向传播过程

## Readonly RoI Network 
layer {
  name: "roi_pool5_readonly"
  type: "ROIPooling"
  bottom: "conv5"
  bottom: "rois"
  top: "pool5_readonly"
  propagate_down: false
  propagate_down: false
  roi_pooling_param {
    pooled_w: 6
    pooled_h: 6
    spatial_scale: 0.0625 # 1/16
  }
}

其中:propagate_down设置为false,可实现forward inference

下面代码对应(b),前向和反向传播过程

layer {
  name: "roi_pool5"
  type: "ROIPooling"
  bottom: "conv5"
  bottom: "rois_hard"
  top: "pool5"
  propagate_down: true
  propagate_down: false
  roi_pooling_param {
    pooled_w: 6
    pooled_h: 6
    spatial_scale: 0.0625 # 1/16
  }
}

其中:propagate_down设置为True,可实现前向和后向传播,减小难样例的损失,同时可以调整卷积层的参数

为什么要hard mining?

  • 1 减少fg和bg的ratio,而且不需要人为设计这个ratio
  • 2 加速收敛,减少显存需要这些硬件的条件依赖,原因是直接训练难样例,使损失最大的函数对应的样例经过训练后loss 直接减小
  • 3 hard-mining已经证实了是一种booststrapping的方式, 尤其当数据集较大而且较难的时候;
  • 4 eliminates several heuristics and hyperparameters in common use by automatically selecting hard examples, thus simplifying training。 放宽了定义negative example的bg_lo threshold,即从[0.1, 0.5)变化到[0, 0.5)。
    取消了正负样本在mini-batch里的ratio(原Fast-RCNN的ratio为1:3)

参考:https://blog.csdn.net/qq_36302589/article/details/84998509

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值