|
发布时间: 2017-05-16 |
第十八届全国图像图形 |
|
|
收稿日期: 2016-11-19; 修回日期: 2017-02-08
基金项目: 国家自然科学基金项目(91120009)
第一作者简介: 曹诗雨 (1989-), 女, 西安交通大学软件工程专业硕士研究生, 主要研究方向为深度学习, 图像目标检测。E-mail:caokajia@outlook.com
中图法分类号: TP391
文献标识码: A
文章编号: 1006-8961(2017)05-0671-07
|
摘要
目的 在传统车辆目标检测问题中,需要针对不同图像场景选择适合的特征。为此提出一种基于快速区域卷积神经网络(Fast R-CNN)的场景图像车辆目标发现方法,避免传统车辆目标检测问题中需要设计手工特征的问题。 方法 该方法基于深度学习卷积神经网络思想。首先使用待检测车辆图像定义视觉任务。利用选择性搜索算法获得样本图像的候选区域,将候选区域坐标与视觉任务示例图像一起输入网络学习。示例图像经过深度卷积神经网络中的卷积层,池化层计算,最终得到深度卷积特征。在输入时没有规定示例图像的规格,此时得到的卷积特征规格不定。然后,基于Fast R-CNN网络结构,通过感兴趣区域池化层规格化特征,最后将特征输入不同的全连接分支,并行回归计算特征分类,以及检测框坐标值。经过多次迭代训练,最后得到与指定视觉任务强相关的目标检测模型,具有训练好的权重参数。在新的场景图像中,可以通过该目标检测模型检测给定类型的车辆目标。 结果 首先确定视觉任务包含公交车,小汽车两类,背景场景是城市道路。利用与视觉任务强相关的测试样本集对目标检测模型进行测试,实验表明,当测试样本场景与视觉任务相关度越高,且样本中车辆目标的形变越小,得到的车辆目标检测模型对车辆目标检测具有良好的检测效果。 结论 本文提出的车辆目标检测方法,利用卷积神经网络提取卷积特征代替传统手工特征提取过程,通过Fast R-CNN对由示例图像组成定义的视觉任务训练得到了效果良好的车辆目标检测模型。该模型可以对与视觉任务强相关新场景图像进行效果良好的车辆目标检测。本文结合深度学习卷积神经网络思想,利用卷积特征替代传统手工特征,避免了传统检测问题中特征选择问题。深层卷积特征具有更好的表达能力。基于Fast R-CNN网络,最终通过多次迭代训练得到车辆检测模型。该检测模型对本文规定的视觉任务有良好的检测效果。本文为解决车辆目标检测问题提供了更加泛化和简洁的解决思路。
关键词
快速区域卷积神经网络; 深度学习; 车辆; 视觉任务; 目标检测
Abstract
Objective The traditional vehicle target detection problem is typically divided into two steps:the first step is generating assumptions, that is, the image may exist in the vehicle target, thus reducing the need to calculate the area; the second step is verifying the hypothesis, that is, testing to verify whether there is a vehicle target in the image. In the first step, different features must be designed for different scenes. Among the features commonly used in vehicle detection problems are symmetry, color, shadows, corners, edges, textures, and lights. In the second step, verifying the hypothesis is typically based on the template method or on the appearance of the characteristics of the method. In addition to the above basic features, HOG, Harris, SIFT, and other manual features are also typically used. Finally, the test results are obtained through the support vector machine and other classifiers that classify the feature matrix. The whole process appears to be very detrimental to the generalization of detection problems; thus, it is necessary to select suitable characteristics for the case of unreasonable samples. This paper proposes a vehicle detection method based on Fast R-CNN, which can find vehicle objects in scene images. Method The method is based on the idea of deep learning convolution neural network. First, define the visual task using the vehicle image to be detected. The candidate region of the sample image is obtained by the selective search algorithm, and the candidate region coordinates are inputted to the network learning together with the visual task sample image. The sample image is calculated by the convolution layer and the pool layer in the deep convolution neural network. Finally, the deep convolution feature is obtained. The specifications of the sample image are not specified at the time of input, and the convolution characteristics obtained at this time are variable. Subsequently, the feature is normalized by the pooling region of the region of interest based on the Fast R-CNN network structure. Finally, the feature is inputted into different full-connection branches, parallel regression calculation feature classification, and detection frame coordinate values. After several iterations and training, the target detection model, which is strongly related to the specified visual task is obtained, and the trained weight parameters are trained. In a new scene image, a given type of vehicle target can be detected by the target detection model. Result The method uses a test dataset that is relative to the vision task to test the object detection model. The experiment suggests that it will achieve effective detection result by the vehicle detection model in the situation where the scenes of test samples are strongly correlated to the vision task. Conclusion First, determine the visual tasks that include the bus and car as the two categories. The background scene is the city road. Experimental results show that when the correlation between the test sample scene and the visual task is higher and the deformation of the vehicle target in the sample is smaller, the vehicle target detection model is obtained for the vehicle. Target detection has a good detection effect. Conclusion The vehicle target detection method proposed in this paper uses the convolution neural network to extract the convolution feature instead of the traditional manual feature extraction process. Fast R-CNN obtained the vehicle target detection model with good effect on the visual task training defined by the sample image. The model can achieve well-performing vehicle target detection on new scene images that are strongly related to visual tasks. In this paper, the convolution characteristics are used to replace the traditional manual features in combination with the depth of learning convolution neural network to avoid the traditional detection problems in the feature selection problem. Deep convolution features have better expression ability. Based on the Fast R-CNN network, the vehicle detection model is obtained by several iterations. The detection model has a good detection effect on the visual task specified in this paper. This paper provides a more general and concise solution of vehicle detection problems.
Key words
fast region convolutional neural network (Fast R-CNN); deep learning; vehicle; vision tasks; object detection
0 引言
车辆目标检测是一种在场景图像中指出车辆目标的研究问题。它是人工智能应用领域中一个很重要的组成模块。近些年,在道路场景监控系统,无人车系统,智能停车缴费系统中有着广泛的应用。所以,优化车辆目标检测问题有着重要的意义。
最近,有很多关于在静态场景中进行车辆目标检测的研究工作。他们用不同的方式试图更好地解决问题。通常,会提取手工特征[1],组合特征,分类。或者将车辆目标拆分成局部再进一步提取特征,以便得到更精确的检测结果。但是,手工设计特征进行提取,依赖于研究人员的经验,缺乏对问题的泛化能力,存储这些手工特征也需要一定的存储空间,再者,对分类器的选择也十分影响最后的检测效果。当问题变换检测目标,或者延伸到复杂场景中,传统方式将面临更加严峻的挑战。为了达到更好的检测效果,整个系统框架将变得更加复杂。
任何的场景目标发现问题,都可以看做是一个和该目标相关的视觉任务。提出一种不依赖手工特征,在静态场景中进行车辆目标检测的方法。
视觉任务定义为:在某一场景中对一类或几类目标进行目标检测的任务描述。视觉任务是由和检测目标强相关的场景样本图像构成。当希望检测某一场景中的某种类型目标时,可以通过收集一系列该场景下的目标图像样本,组成视觉任务。本文视觉任务是:检测在城市道路背景下的正面车辆。如图 1,通过对视觉任务学习得到一种稳定的,与任务强相关的目标检测模型。将新的样本图像输入目标检测模型便可以得到检测结果。本文将利用深度学习思想解决视觉任务的训练过程。通过卷积神经网络对样本进行计算得到卷积特征,利用Fast R-CNN网络解决目标检测定位的问题。对车辆目标检测的问题提供了更泛化和简洁的解决思路。
1 相关工作
在传统模型中,基于手工设计特征[2]的检测模型被广泛应用于车辆目标检测问题。Tsai等人[3]利用新型的颜色变换模型对颜色特征计算,快速找到重要的车辆颜色,定位可能的候选物。然后,通过边缘地图的小波变换系数来构建多通道分类器,从而验证候选物。Jazayeri等人[4]在做视频流中的车辆目标检测时,将临时的底层几何特征的时间信息与车辆的动态信息结合,并利用隐马尔可夫模型从背景中区分出目标车辆。
可以看出,在传统检测模型中,提取图像的底层特征是至关重要的一步。
传统模型有以下的缺点:
1) 需要针对不通的检测问题进行特征设计;
2) 需要对特征进行组合,选定分类器进行训练,其过程较为复杂;
3) 需要存储空间对特征进行存储。
近些年,深度卷积神经网络被成功地应用于物体识别与目标检测[5-6]。2012年,Krizhevsky等人在ImageNet大规模视觉识别的挑战 (ILSVRC) 中展现了CNN显著提高的图像分类精确度的能力。2014年,Girshick等人[7]将Region proposals和CNNs结合,并在网络最后利用SVM对卷积特征进行训练分类,得到了利用CNN进行图像检测的方法R-CNN。2015年Ross Girshick进一步将SPPnet[8]的思想和R-CNN结合提出卷积神经网络模型Fast R-CNN[9],用softmax[10]回归替代SVM分类器降低空间和时间的开销。整个训练过程不需要分级进行,检测过程更加高效,准确度更高。
2 车辆检测的Fast R-CNN过程
本文方法过程分为两个阶段,训练阶段和测试阶段。
训练阶段,用我们定义的视觉任务对预训练后具有初始参数的卷积神经网络进行训练,得到目标检测模型;
测试阶段,将新样本输入目标检测模型得到检测结果。
如图 2所示,方法整个计算流程包含以下5个步骤:
1) 定义车辆视觉任务;
2) 对样本图像进行object proposals提取,可以利用selective search[11]或edgebox[12]等方法,本文使用selective search方法;
3) 选定CNN网络结构,利用ImageNet数据集进行预训练,得到预训练参数;
4) 将训练集,其对应的标定值,以及object proposals作为输入,通过Fast R-CNN对预训练模型进行二次训练,得到最终的车辆目标检测模型;
5) 利用新样本对车辆目标检测模型进行测试,得到新样本的检测结果。
2.1 车辆视觉任务的构建
本文的视觉任务是在城市道路场景中检测正面车辆目标。车辆目标的类型包括小汽车 (car) 和公交车 (bus)。车辆视觉任务确定之后需要采集示例图像构建训练集,采集被测图像构建测试集。被检测的场景图像和目标是与视觉任务强相关的,所以在采集示例图像和被测图像应在相同环境下以相同的方式进行采集。将样本采集地点设定在天桥上,方便采集正面车辆。利用普通相机进行拍摄,相机的变焦保持一致。为了充分训练卷积神经网络上的参数,应采集足够多的图像样本。采集后的图像场景如图 3所示。
最后对数据集样本进行标定,标定时记录车辆目标左上和右下的坐标值构成矩形框的坐标值
2.2 Fast R-CNN的核心过程
Fast R-CNN的输入,包含3个部分:样本图像、其标定值 (groundtruth)、object proposals。通过计算每个样本图像的标定框与object proposals的覆盖率,可以得到每个样本图像对应的一组感兴趣区域 (RoIs)。每个图像的
表 1
RoIs的来源
Table 1
RoIs sources
类别 | 比例 | 方式 |
1 | 25% | IoU在[0.5, 1]的区域, 作为背景 |
2 | 75% | IoU在[0.1, 0.5) 中值较大的区域, 作为前景 |
2.3 RoI池化层计算
RoI池化层在固定的空间幅度
RoI坐标用四元组 (
2.4 输出层回归计算
如图 4所示,最终要得到两个输出层,分别计算分类结果以及检测框坐标结果。第1个输出层计算了每个RoI在
$ \begin{align} & L(p,u,{{t}^{u}},v)={{L}_{\text{cls}}}\left( p,u \right)+ \\ & \ \ \ \lambda \left[ u\ge 1 \right]{{L}_{\text{loc}}}({{t}^{u}},v) \\ \end{align} $ | (1) |
$ {{L}_{\text{cls}}}\left( p,u \right)=-\text{log}\ {{p}_{u}} $ | (2) |
式中,[
$ {{L}_{\text{loc}}}({{t}^{u}},v)=\sum\limits_{i\in \left\{ x,y,w,h \right\}}{{{s}_{L1}}(t_{i}^{u}-{{v}_{i}})} $ | (3) |
$ {{S}_{L1}}\left( x \right)=\left\{ \begin{align} & 0.5{{x}^{2}}\ \ \ \ \ ~\ \ \left| x \right|<1 \\ & \left| x \right|-0.5\ \ \ \ \left| x \right|\ge 1 \\ \end{align} \right. $ | (4) |
在训练过程中,定义一个随机梯度下降 (SGD) mini-batches,它由
在反向传播过程中经过RoI池化层时,进行反向传播的计算,即
$ \frac{\partial L}{\partial {{x}_{i}}}=\sum\limits_{r}{\sum\limits_{j}{\left[ i={{i}^{*}}\left( r,j \right) \right]}}\frac{\partial L}{\partial {{y}_{rj}}} $ | (5) |
式中,[·]表示当残差在ROI层反向传播时,需判断该残差所在节点
3 实验结果与分析
通过采集得到训练集
表 2
样本数量
Table 2
Sample quantity
数据集 | 数量 | 水平翻转 | 分辨率/像素 |
训练集 | car 9 500 bus 1 500 | car 19 000 bus 3 000 | |
测试集 | car 8 500 bus 1 500 | - | 480×640 |
测试集 | car 1 300 | - |
本文使用Caffe框架,在Nvidia K5200下进行GPU加速计算。预训练模型结构VGG16,预训练模型参数权重来自于VGG16在ImageNet下的训练结果。对自己的视觉任务训练集进行训练,在GPU加速下经过14 h训练,得到了目标检测模型。
首先,选定一些样本图像进行单张图像检测测试,并在图像样本上显示检测框。将检测框类型的概率
然后,在测试集
表 3
测试结果
Table 3
Test result
测试集 | 数量 | 分辨率/像素 | AP | AUC | mAP |
测试集 | Bus 1 500 Car 8 500 | 480×640 480×640 | 0.889 0.768 | 0.905 0.791 | 0.83 |
测试集 | Car 1 300 | 480×640 | 0.992 | 0.996 | 0.99 |
4 结论
通过构建视觉任务,利用深度卷积神经网络提取视觉任务示例图像的卷积特征,并基于Fast R-CNN对特征进行规格化和并行的回归计算,最终得到视觉任务相关的车辆目标检测模型。该方法利用深度卷积特征,有效避免了传统车辆目标检测模型对手工特征的依赖问题,以及大量手工特征矩阵的存储问题。经过实验,该检测模型能够实现较好的检测效果。然而,视觉任务需要大量的有效样本进行构建,前期样本object proposals提取过程较为费时,并且无法和Fast R-CNN形成一种端到端的检测过程。在保证检测效果的前提下,解决上述问题是未来需要研究的重点问题。
参考文献
-
[1] Wang X Y, Yang M, Zhu S H, et al. Regionlets for generic object detection[J]. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2015, 37(10): 2071–2084. [DOI:10.1109/TPAMI.2015.2389830]
-
[2] Wang C C R, Lien J J J. Automatic vehicle detection using local features-a statistical approach[J]. IEEE Transactions on Intelligent Transportation Systems, 2008, 9(1): 83–96. [DOI:10.1109/TITS.2007.908572]
-
[3] Tsai L W, Hsieh J W, Fan K C. Vehicle detection using normalized color and edge map[J]. IEEE Transactions on Image Processing, 2007, 16(3): 850–864. [DOI:10.1109/TIP.2007.891147]
-
[4] Jazayeri A, Cai H, Zheng J Y, et al. Vehicle detection and tracking in car video based on motion model[J]. IEEE Transactions on Intelligent Transportation Systems, 2011, 12(2): 583–595. [DOI:10.1109/TITS.2011.2113340]
-
[5] Le Cun Y, Kavukcuoglu K, Farabet C. Convolutional networks and applications in vision[C]//Proceedings of 2010 IEEE International Symposium on Circuits and Systems. Paris:IEEE, 2010:253-256.[DOI:10.1109/ISCAS.2010.5537907]
-
[6] Ouyang W L, Wang X G. Joint deep learning for pedestrian detection[C]//Proceedings of 2013 IEEE International Conference on Computer Vision. Sydney, VIC:IEEE, 2013:2056-2063.[DOI:10.1109/ICCV.2013.257]
-
[7] Girshick R, Donahue J, Darrell T, et al. Rich feature hierarchies for accurate object detection and semantic segmentation[C]//Proceedings of 2014 IEEE International Conference on Computer Vision and Pattern Recognition. Columbus, OH:IEEE, 2014:580-587.[DOI:10.1109/CVPR.2014.81]
-
[8] He K M, Zhang X Y, Ren S Q, et al. Spatial pyramid pooling in deep convolutional networks for visual recognition[J]. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2015, 37(9): 1904–1916. [DOI:10.1109/TPAMI.2015.2389824]
-
[9] Girshick R. Fast R-CNN[C]//Proceedings of 2015 IEEE International Conference on Computer Vision. Santiago:IEEE, 2015:1440-1448.[DOI:10.1109/ICCV.2015.169]
-
[10] Bouchard G. Clustering and Classification Employing Softmax Function Including Efficient Bounds:US, 8065246[P]. 2011-11-22
-
[11] Uijlings J R R, van de Sande K E A, Gevers T, et al. Selective search for object recognition[J]. International Journal of Computer Vision, 2013, 104(2): 154–171. [DOI:10.1007/s11263-013-0620-5]
-
[12] Zitnick C L, Dollár P. Edge boxes:locating object proposals from edges[C]//Proceedings of the 13th European Conference on Computer Vision-ECCV 2014. Switzerland:Springer International Publishing, 2014:391-405.[DOI:10.1007/978-3-319-10602-1_26]