Hierarchical Object Detection with Deep Reinforcement Learning
Abstract
关键的思想在于关注图像中包含更丰富信息的那些部分并放大它们。
Introduction
Hierarchical Object Detection Model
1. Markov Decision Process(马尔科夫决策过程)
State:当前区域描述符(the descriptor of current region)和记忆向量(memory vector)
Actions:move actions和terminal actions
Reward:
保证move action都是朝着更靠近ground truth的方向移动;
当IOU超过threshold,则终止移动。
2. Q-learning
$$
Q(s,a) = r+\lambda{max}_{a’}Q(s’,a’)
$$
3. Model
the Image-Zooms model
使用VGG-16提取图像区域特征向量$(77512)$,
拼接区域特征向量与记忆向量(memory vector)$(77512+24=25088+24)$,
经过两个1024维的全连接层,输出6个可能的动作(actions),
反复迭代,直到终止动作the Pool45-Crops model

4. Training
Experiments
1. Qualitative Results

Implementation
1. keras实现
- 提取区域特征

state不断更新,并作为model的输入
1
(7*7*512)
代码问题总结
- 数据类型错误TypeError: slice indices must be integers or None or have an index method
这是由于数组,矩阵等类型数据的下标是整数,而在
1 | region_mask[offset[0]:offset[0] + size_mask[0] |
offset是float类型,所以报错,解决方法就是数据类型转换:
1 | region_mask[int(offset[0]):int(offset[0] + size_mask[0]) |
- VGG16提取图像特征尺寸不对

解决方法:在图片提取特征之前,对图像进行resize;
1 | im = images[z].resize((224, 224)) |
- 除0错误

对图像进行resize的位置错误
问题总结
- 问题:记忆向量的哪儿来的?
- 问题:哪6个动作?
move actions:左上、右上、左下、右下和中;
terminal actions - 问题:每个类训练一个模型?
是的,这篇文章中只训练了飞机类(aeroplane)的检测模型