杨蜀秦,王 帅,王鹏飞,宁纪锋,奚亚军
改进YOLOX检测单位面积麦穗
杨蜀秦1,2,3,王 帅1,2,3,王鹏飞1,2,3,宁纪锋3,4,奚亚军5
(1. 西北农林科技大学机械与电子工程学院,杨凌 712100;2. 农业农村部农业物联网重点实验室,杨凌 712100;3. 陕西省农业信息感知与智能服务重点实验室,杨凌 712100;4. 西北农林科技大学信息工程学院,杨凌 712100;5. 西北农林科技大学农学院,杨凌 712100)
单位面积麦穗数是估算小麦产量的重要指标,对于作物表型参数计算、产量预测和大田管理都具有重要的意义。目前的研究均未以单位面积麦穗图像为研究对象,为准确获取单位面积麦穗数,该研究提出了基于改进YOLOX的单位面积麦穗检测方法,利用采样框直接实现单位面积麦穗计数。首先,设计了一种简单的单位面积采样框,通过训练角点检测网络识别采样框,以提取单位面积小麦区域;其次,针对麦穗检测中存在的目标密集和相互遮挡问题,在麦穗检测网络的特征融合层,采用上下文信息进行特征重组的上采样方法(Content-Aware ReAssembly of Features,CARAFE)代替YOLOX-m模型中的上采样算法,同时结合迭代注意力特征融合模块(iterative Attentional Feature Fusion,iAFF),增加对麦穗空间信息和语义信息的提取。试验结果表明,改进的YOLOX-m模型明显改善了对密集麦穗和遮挡麦穗的检测效果,其精确率、召回率、平均精确度和1值分别为96.83%、91.29%、92.29%和93.97%,与SSD、CenterNet和原YOLOX-m模型相比,平均精确度分别提升了10.26、8.2和1.14个百分点。该研究方法能够直接对复杂大田场景下的单位面积麦穗进行准确检测和计数,为实际生产小麦产量预测中的麦穗智能化计数提供了一种方法参考。
模型;目标检测;深度学习;单位面积;麦穗
小麦产量关系到国家的粮食安全[1-2]。产量预测为农业生产管理决策提供参考[3-4],为政府在农村土地政策、粮食价格等方面的宏观调控提供支撑[5-6]。田间测产时,小麦产量主要与单位面积麦穗数、千粒质量和穗粒数[7]有关。其中,单位面积麦穗数是最重要的指标,直接反映小麦的生长状况和品质好坏[8-9]。
传统的单位面积麦穗检测计数主要依靠人工计数和传统图像处理的方法。人工计数方法繁琐,对人力物力消耗较大且主观性较强[10]。传统图像处理方法首先从RGB图像中人工提取麦穗的形状、纹理和颜色等特征,之后通过分类器进行模型构建,实现对麦穗的自动识别计数[11]。李毅念等[12]将RGB转换到HSI,提取色彩饱和度特征后,再利用基于凹点检测匹配连线的方法实现粘连麦穗的分割,计算麦穗数量;Fernandez-Gallego等[13]利用滤波和寻找最大值的方法来检测田间麦穗图像中的麦穗数,其识别精度达到90%。刘哲等[14]以颜色特征聚类为基础改进k均值聚类算法,将聚类区域内的子区域数作为麦穗数估计值,计数精度达到94.69%。以上方法由于人工提取特征需要依靠大量经验,对复杂大田场景下的光照、土壤等条件鲁棒性表现不足[15-17],且均未以单位面积麦穗图像为研究对象,故无法获得泛化模型和直接实现单位面积麦穗计数,检测准确率仍有待提升。
近年来,随着作物表型组学研究的快速发展,通过结合深度学习对单位面积麦穗检测计数的研究也有了较大的进展[18-20]。深度学习从数据集中自动学习特征代替了传统的人工提取特征。Lu等[21]提出深度卷积神经网络TasselNet建立麦穗计数回归模型。Hasan等[22]使用相同的R-CNN结构在4个不同生长阶段捕获的不同数据集上生成4个不同的模型,研究不同生长阶段的麦穗计数。鲍文霞等[23]采集数据时制作40 cm×50 cm的纸盒,用以固定0.2 m2范围内的小麦,同时引入CSRNet网络构建麦穗密度图估计模型,实现对复杂拥挤场景下的麦穗计数。章权兵等[24]采集数据时使用长宽高分别为0.5、0.5、1.2 m的硬纸板围成一个长方体框,将目标区域与外界小麦隔离开,并在Faster R-CNN[25]中引入注意力机制和加权区域建议网络对麦穗进行检测。文献[23]和文献[24]为便于图像获取,采集时使用硬纸板围成一个小面积长方体框,将目标区域与外界小麦隔离开,但均未利用固定面积计算单位面积麦穗数,不能直接实现麦穗的实际测产计数。文献[1]针对单位面积育种小区实现麦穗计数,但不适用于大面积农田场景下的测产。
综上所述,前人针对大面积农田场景下单位面积麦穗图像的研究较少,且在复杂条件下,密集麦穗和遮挡麦穗仍存在识别精度低等问题。因此,本研究以智能手机拍摄含采样框的小麦冠层图像为研究对象,构建一种基于改进YOLOX的单位面积麦穗检测方法。采样框角点特征明显,因此利用模型深度和特征图宽度较小的YOLOX-s训练采样框角点检测网络,获取单位面积区域。改进深度和特征图宽度进一步加深和加宽的YOLOX-m模型,在特征提取层采用上下文信息进行特征重组的上采样方法(Content-Aware ReAssembly of Features,CARAFE)和迭代注意力特征融合模块,有效减少了麦穗漏检情况,提高密集麦穗和遮挡麦穗的检测精度。最后,将其与SSD[26]、CenterNet[27]和原YOLOX-m模型进行对比,验证了本文方法的有效性。
本文试验区域位于陕西省杨凌农业高新技术产业示范区(简称杨凌区)曹新庄试验基地,地理坐标介于东经107°59′~108°08′,北纬34°14′~34°20′之间,如图1所示,杨凌区平均海拔530 m,属东亚暖温带半湿润半干旱气候区。试验区域长约175 m,宽约98 m,面积约17 150 m2,种植的冬小麦为一年一熟制,试验田为小麦育种区,种植多种不同品种的小麦。
图1 试验区域图
为了实现在自然环境下直接对单位面积麦穗进行检测计数,使用两组数据集进行了训练和测试,一组是实地拍摄的不含采样框的麦穗图像,一组是含1 m×1 m采样框的麦穗图像。图像数据是通过华为智能手机(honor V20)在小麦试验田中收集,将智能手机固定在自拍杆上,蓝牙控制手机后置摄像头朝向下方采集图像,试验者手持自拍杆,保持在距离小麦冠层上方0.9~1.1 m处拍摄。数据采集时间为2021年5月21日-2022年6月3日,在晴、阴和多云3种天气状况下,分别对灌浆期和成熟期小麦图像进行采集。共采集不含采样框的麦穗图像600张(图像分辨率为4 000像素×3 000像素),原始图像随机裁剪为3 072张800像素×800像素的麦穗图像。另外采用镜像和旋转对数据集进行增强,将训练集的图像数据从3 072张扩增至9 216张。含采样框的麦穗图像共218张(图像分辨率为4 000像素×3 000像素),2021年采集121张,2022年采集97张,采样框内包含350~520个目标小麦穗,如图2所示。
注:矩形框为单位面积采样框。
结合地面调查,采用开源标注软件LabelImg对采样框内角点和麦穗进行人工标注,标注数据集以PASCAL VOC[28]数据集的格式存储,包括:图像尺寸(长宽以及通道数)、检测物体类别、检测框坐标(对应图像中、轴坐标值)等。
采样框角点的标注,以采样框内角点为中心点标注矩形框,用于训练采样框角点检测网络。麦穗的标注分为含采样框和不含采样框的麦穗图像标注,用矩形框标注不含采样框的麦穗图像中所有麦穗目标。对于含采样框的麦穗图像,只标注采样框内的麦穗,用于对单位面积麦穗检测模型的评估。
YOLO[29-32]系列是目标检测算法的代表性工作,其中的YOLO V3[32]在不同领域得到了广泛的应用。以YOLO V3-SPP作为基础,结合耦合检测头、Mosaic和MixUp数据增强策略、无锚框机制(Anchor-free)的YOLOX目标检测模型,具有检测精确度高和部署灵活的优点[33]。
单位面积麦穗的计数,需同时考虑检测单位面积采样框和麦穗数量两个问题,即算法只需统计在单位面积框内的小麦麦穗数量。因此,本文提出一个基于改进YOLOX的单位面积麦穗检测方法。YOLOX-s是YOLOX系列中模型深度和特征图宽度较小的网络,YOLOX-m是在其基础上进行了加深和加宽。由于采样框角点特征明显,因此利用YOLOX-s模型训练采样框角点检测网络,实现对采样区域的准确提取。同时,利用改进的YOLOX-m模型训练麦穗检测网络,实现对麦穗的精准检测。最后,基于提取的采样区域,统计位于单位面积框内部的麦穗,实现对单位面积麦穗检测的目的。
2.1.1 基于YOLOX-s的采样框角点检测网络
为了获取单位面积麦穗数,需要对采样框进行检测。传统的基于颜色阈值的分割方法和角点检测方法鲁棒性不足,光照条件、天气和地块等因素都会影响模型的检测效果,不适应于复杂大田场景下采样框的检测。因此,针对采样框角点目标小、数量少且没有明显边界等问题,本文利用YOLOX-s模型,训练单位面积采样框角点检测网络,利用检测到的采样框的4个内角点,连接4个角点形成采样框的内部区域,仅裁取位于采样框区域内部的麦穗,以实现单位面积麦穗检测计数的目的。
2.1.2 基于改进YOLOX-m的麦穗检测网络
YOLOX-m模型中的最邻近插值上采样难以利用麦穗特征图的语义信息且感知域较小,特征融合模块仅是对特征图的简单拼接。因此,本文通过对YOLOX-m模型的上采样和特征融合模块进行改进,以提高密集麦穗和遮挡麦穗检测精度。改进的YOLOX-m模型的主干分为Input、Backbone、Neck和Prediction 4个部分,每个框表示一个部分。在特征融合网络中,首先采用特征图上采样(CARAFE)方法代替模型原始的上采样方法,利用特征重组模块完成上采样,以保留更多麦穗细节;其次,添加迭代注意力特征融合模块(iAFF),增强对麦穗语义信息的提取。网络结构图如图3所示。
注:Focus为切片操作,CBS为CONV+BN+SiLU,CONV为卷积操作,BN为归一化操作,SiLU为激活函数,SPP为空间金字塔池化结构,CARAFE为特征图上采样操作,Concat为特征融合函数,iAFF为迭代注意力特征融合模块,slice为切片后的特征图。
1)CARAFE特征图上采样
Wang等[34]在2019年提出了CARAFE上采样算法,其主要分为上采样预测模块和特征重组模块两个模块。在上采样预测模块中,先利用输入的特征图预测上采样核,在特征重组模块中基于上采样核进行特征重组。与以前的上采样方法相比,CARAFE可以在更大的感知邻域内聚合麦穗的上下文信息。每个位置都有相对应的不同上采样核,且仅带来很小的参数量。本研究针对麦穗密集问题,在YOLOX-m算法网络中的特征融合层使用CARAFE上采样方式,更好地聚合了麦穗目标上下文信息,以有效提升对密集麦穗的检测精度。
2)iAFF迭代注意力特征融合
特征融合是来自不同层或分支的特征组合,一般通过求和或拼接来实现,但是均不能对麦穗特征达到最佳的融合效果。Dai等[35]提出了注意力特征融合,为了更好地融合语义和尺度不一致的特征,提出了多尺度通道注意力模块,阐明了特征图的初始集成可能会成为瓶颈,并且可以通过添加迭代注意力特征融合来缓解此问题。
注意力特征融合模块(Attentional Feature Fusion,AFF)主要针对不同网络结构中,不同尺度特征融合时的注意力问题。iAFF针对初始特征集成对于注意力特征融合影响比较大的问题,使用额外一层AFF生成更好的初始特征。本研究针对麦穗相互遮挡的问题,在YOLOX-m算法网络中下采样后的特征融合层使用iAFF,使用了注意力进行特征融合以增加对麦穗空间信息和语义信息的提取,有效提升网络对遮挡麦穗的检测性能。
试验环境操作系统为Ubuntu 16.04,深度学习框架为Pytorch 1.4,显卡为NVIDIA Tesla P100,显存16GB。基于改进YOLOX的单位面积麦穗检测模型训练分为两部分。第一部分为训练采样框角点检测网络,将2021年采集的121张包含采样框的麦穗图像,按8∶1∶1随机划分训练集、验证集和测试集,模型训练50个周期,采用Adam优化器。第二部分为训练麦穗检测网络,9 216张800像素×800像素的麦穗图像,按9∶1随机划分训练集和验证集,121张包含采样框的麦穗图像作为测试集,模型训练100个周期,采用Adam优化器。前50个周期冻结骨干网络参数,只训练模型分类器参数,初始学习率为1×10-3,批处理尺寸为8,权重衰减为5×10-4;后50个周期解冻骨干网络参数,初始学习率为1×10-4,批处理尺寸为8,权重衰减为5×10-4,共迭代850 500次。
本研究采用精确率(Precision,)、召回率(Recall,)、平均精确度(Average Precision,AP)、1分数、交并比(Intersection over Union,IoU)和平均帧率(Frame per Second,FPS)来评估模型的性能。召回率被定义为所有正样本被正确检出的比例;精确率是预测结果中正确的比例;平均精确度和1分数综合考虑精确率和召回率两个指标;IoU用于测量真实框与检测框之间的重叠度,重叠度越高该值越大,相关度越高;本研究对单位面积小麦麦穗进行检测,选择IoU大于50%作为判断是否正确识别麦穗的阈值。在上述评价指标中,模型性能参数的重要性依次为平均精确度、召回率、精确率、1分数和平均帧率。
为了评估模型的计数性能,采用决定系数(2)和均方根误差(Root Mean Square Error,RMSE)评价指标。2表示趋势线拟合程度,它的数值大小可以反映麦穗计数的估计值与对应的实际人工计数之间的拟合程度,数值越接近1,拟合程度越高,趋势线的可靠性就越高;RMSE为预测值与真实值的偏差,表示算法的准确性,RMSE越小,算法准确度越高。
采用SSD、CenterNet和YOLOX-s模型进行采样框内角点的检测,并对不同模型进行对比,检测结果如表1所示,由于采样框角点颜色特征明显,YOLOX-s模型精确率、召回率、平均准确度和1分数都能达到100%,FPS为20帧/s,各项评价指标均高于SSD和CenterNet模型,能够快速精确地对采样框的内角点进行检测。
表1 不同模型对采样框内角点检测试验结果
注:为精确率;为召回率;AP为平均精确度;1为1分数;FPS为平均帧率。下同。
Note:isprecision;is recall;AP is average precision;1 is1score; FPS is frame per second. Same below.
用9 216张不含采样框的麦穗图像分别在SSD、CenterNet和原始YOLOX模型的m、l和x版本以及基于YOLOX-m的改进模型进行同批次的训练。结合YOLOX-s模型对采样框内角点的检测,对比不同模型对单位面积麦穗检测效果,检测结果如表2所示。
表2 不同模型对单位面积麦穗检测试验结果
综合对比不同模型性能,由表2可以看出,改进的YOLOX-m模型在单位面积麦穗检测上的效果优于其他模型。本文使用CARAFE上采样方式和iAFF特征融合方式的YOLOX-m模型,相较于原始YOLOX-m模型,虽然精确率稍有下降,但AP值提升了1.14个百分点;与SSD和CenterNet模型相比,虽然检测效率下降,但AP值分别提升了10.26个百分点和8.2个百分点。总的来说,在特征融合网络中改变上采样方式和特征融合方式能够有效提升单位面积麦穗检测的精确度,从而验证了本文提出方法的有效性和可行性。
图4为检测结果的部分细节展示图。其中,CenterNet检测结果最差,正确检测40个,漏检14个;SSD正确检测42个,漏检12个;YOLOX-m模型正确检测50个,漏检4个;改进后模型正确检测53个,漏检1个。
注:绿色框和红色框分别代表正确检测和漏检。
本文进行消融试验以验证模块混合使用对于模型性能的影响。结合YOLOX-s模型对采样框内角点的检测,以含单位面积采样框的图像为测试集,验证不同改进模型的有效性。表3列出了改进的YOLOX-m模型中各个部分的试验结果。
表3 改进的YOLOX-m算法麦穗检测消融试验
以原始YOLOX-m为基础,只在特征融合层中用CARAFE算法代替原上采样,AP值提升了0.75个百分点;只在特征融合层引入iAFF在AP值上提升0.46个百分点;综合各项评价指标,将这两种改进结合起来的YOLOX-m模型,虽然检测效率稍有下降,但AP值提升了1.14个百分点,1值提升了0.46个百分点,验证了本文方案的可行性。
将2022年采集的97张含采样框的麦穗图像进行单位面积麦穗检测计数,并与人工计数真实值进行比较,来验证本文方法的泛化性能,结果如图5所示。
图5 麦穗预测值与真实值的拟合结果
从图5可以看出,2为0.91, RMSE为29.61株/m2,线性拟合线可以有效反映预测值与真实值的关系,拟合程度较高,但是所有图像预测麦穗数量小于真实数量,这是由于严重遮挡情况下依然存在漏检情况导致的。因此,本文提出的基于改进YOLOX的单位面积麦穗检测方法可以准确地对包含单位面积采样框的图像进行麦穗计数,进而实现精准的小麦估产。
1)为准确预测小麦的单位面积麦穗数,本文提出一种基于改进YOLOX的单位面积麦穗检测方法。该方法同时检测采样框角点和小麦麦穗,可直接估计单位面积中的小麦麦穗数。在麦穗检测网络中,采用上下文信息进行特征重组的上采样方法和迭代注意力特征融合模块,增强对麦穗空间信息和语义信息的提取,有效地提升了对密集麦穗和遮挡麦穗的检测性能。
2)试验结果表明,基于YOLOX的模型在相同的数据集条件下,在采样框角点检测方面和麦穗检测方面均优于SSD、CenterNet模型。麦穗检测方面,改进的YOLOX-m模型平均精确度分别高于SSD、CenterNet模型10.26个百分点和8.2个百分点,平均精确度较原始YOLOX-m模型也提升了1.14个百分点,其精确率、召回率、平均精确度和1分别达96.83%、91.29%、92.29%、93.97%,改善了对密集麦穗和遮挡麦穗的检测效果。本文方法比其他麦穗检测计数方法准确率更高,能够在自然环境下直接对单位面积麦穗进行检测计数,为实际生产小麦产量预测中的麦穗计数提供了一种有效的方法。
3)改进的YOLOX-m模型对于轻微遮挡和密集情况下的麦穗检测精度有所提高,但由于麦穗目标较小,对于严重遮挡情况下麦穗依然存在漏检的情况而且精确率稍有下降。在麦穗计数中,在对单位面积采样框内小麦检测应用中,存在采样框内小麦越界到框外、框外小麦进入采样框内的情况,导致真实小麦麦穗数和预测小麦麦穗数有偏差。针对以上问题,拟在实际测产中根据种植密度不同进行微调,更符合实际测产的需要。
[1] 陈佳玮,李庆,谭巧行,等. 结合轻量级麦穗检测模型和离线Android软件开发的田间小麦测产[J]. 农业工程学报,2021,37(19):156-164.
Chen Jiawei, Li Qing, Tan Qiaoxing, et al. Combining lightweight wheat spikes detecting model and offline Android software development for in-field wheat yield prediction[J]. Transactions of the Chinese Society of Agricultural Engineering (Transactions of the CSAE), 2021, 37(19): 156-164. (in Chinese with English abstract)
[2] Liu H, Wang Z, Yu R, et al. Optimal nitrogen input for higher efficiency and lower environmental impacts of winter wheat production in China[J]. Agriculture Ecosystems & Environment, 2016, 224: 1-11.
[3] Jin X, Liu S, Baret F, et al. Estimates of plant density of wheat crops at emergence from very low altitude UAV imagery[J]. Remote Sensing of Environment, 2017, 198: 105-114.
[4] 鲍烈,王曼韬,刘江川,等. 基于卷积神经网络的小麦产量预估方法[J]. 浙江农业学报,2020,32(12):2244-2252.
Bao Lie, Wang Mantao, Liu Jiangchuan, et al. Estimation method of wheat yield based on convolution neural network[J]. Acta Agriculturae Zhejiangensis, 2020, 32(12): 2244-2252. (in Chinese with English abstract)
[5] 欧文浩,苏伟,薛文振,等. 基于HJ-1卫星影像的三大农作物估产最佳时相选择[J]. 农业工程学报,2010,26(11):176-182.
Ou Wenhao, Su Wei, Xue Wenzhen, et al. Selection of optimum phase for yield estimation of three major crops based on HJ-1 satellite images[J]. Transactions of the Chinese Society of Agricultural Engineering (Transactions of the CSAE), 2010, 26(11): 176-182. (in Chinese with English abstract)
[6] 郝王丽,尉培岩,韩猛,等. 基于YOLOv3网络的小麦麦穗检测及计数[J]. 湖北农业科学,2021,60(2):158-160.
Hao Wangli, Wei Peiyan, Han Meng, et al. Detection and counting of wheat ears based on YOLOv3 network[J]. Hubei Agricultural Sciences, 2021, 60(2): 158-160. (in Chinese with English abstract)
[7] Ghahremani M, Ghassemian H. Remote-sensing image fusion based on curvelets and ICA[J]. International Journal of Remote Sensing, 2015, 36(16): 4131-4143.
[8] 谢元澄,何超,于增源,等. 复杂大田场景中麦穗检测级联网络优化方法[J]. 农业机械学报,2020,51(12):212-219.
Xie Yuancheng, He Chao, Yu Zengyuan, et al. Optimization method for cascade network of wheat ear detection in complex filed scene[J]. Transactions of the Chinese Society for Agricultural Machinery, 2020, 51(12): 212-219. (in Chinese with English abstract)
[9] 刘航,刘涛,李世娟,等. 基于深度残差网络的麦穗回归计数方法[J]. 中国农业大学学报,2021,26(6):170-179.
Liu Hang, Liu Tao, Li Shijuan, et al. Research on wheat ear regression counting based on deep residual network[J]. Journal of China Agricultural University, 2021, 26(6): 170-179. (in Chinese with English abstract)
[10] Xiong H, Cao Z, Lu H, et al. TasselNetv2: In-field counting of wheat spikes with context-augmented local regression networks[J]. Plant Methods, 2019, 15(2): 150.
[11] 赵锋,王克俭,苑迎春. 基于颜色特征和AdaBoost算法的麦穗识别的研究[J]. 作物杂志,2014(1):141-144,161.
Zhao Feng, Wang Kejian, Yuan Yingchun. Study on wheat spike identification based on color features and AdaBoost algorithm[J]. Crops, 2014(1): 141-144, 161. (in Chinese with English abstract)
[12] 李毅念,杜世伟,姚敏,等. 基于小麦群体图像的田间麦穗计数及产量预测方法[J]. 农业工程学报,2018,34(21):185-194.
Li Yinian, Du Shiwei, Yao Min, et al. Method for wheatear counting and yield predicting based on image of wheatear population in field[J]. Transactions of the Chinese Society of Agricultural Engineering (Transactions of the CSAE), 2018, 34(21): 185-194. (in Chinese with English abstract)
[13] Fernandez-Gallego J A, Kefauver S C, Gutiérrez N, et al. Wheat ear counting in-field conditions: High throughput and low-cost approach using RGB images[J]. Plant Methods, 2018, 14(1): 22.
[14] 刘哲,黄文准,王利平. 基于改进K-means聚类算法的大田麦穗自动计数[J]. 农业工程学报,2019,35(3):174-181.
Liu Zhe, Huang Wenzhun, Wang Liping. Field wheat ear counting automatically based on improved K-means clustering algorithm[J]. Transactions of the Chinese Society of Agricultural Engineering (Transactions of the CSAE), 2019, 35(3): 174-181. (in Chinese with English abstract)
[15] 刘涛,孙成明,王力坚,等. 基于图像处理技术的大田麦穗计数[J]. 农业机械学报,2014,45(2):282-290.
Liu Tao, Sun Chengming, Wang Lijian, et al. In-field wheatear counting based on image processing technology[J]. Transactions of the Chinese Society for Agricultural Machinery, 2014, 45(2): 282-290. (in Chinese with English abstract)
[16] 刘东,曹光乔,李亦白,等. 基于颜色特征的小麦抽穗扬花期麦穗识别计数[J]. 中国农机化学报,2021,42(11):97-102.
Liu Dong, Cao Guangqiao, Li Yibai, et al. Recognition and counting of wheat ears at flowering stage of heading poplar based on color features[J]. Journal of Chinese Agricultural Mechanization, 2021, 42(11): 97-102. (in Chinese with English abstract)
[17] 孙俊,杨锴锋,罗元秋,等. 基于无人机图像的多尺度感知麦穗计数方法[J]. 农业工程学报,2021,37(23):136-144.
Sun Jun, Yang Kaifeng, Luo Yuanqiu, et al. Method for the multiscale perceptual counting of wheat ears based on UAV images[J]. Transactions of the Chinese Society of Agricultural Engineering (Transactions of the CSAE), 2021, 37(23): 136-144. (in Chinese with English abstract)
[18] 王宇歌,张涌,黄林雄,等. 基于卷积神经网络的麦穗目标检测算法研究[J]. 软件工程,2021,24(8):6-10.
Wang Yuge, Zhang Yong, Huang Linxiong, et al. Research of wheat ear target detection based on convolutional neural network[J]. Software Engineering, 2021, 24(8): 6-10. (in Chinese with English abstract)
[19] 魏超宇,韩文,刘辉军. 基于深度学习的温室大棚小番茄果实计数方法[J]. 中国计量大学学报,2021,32(1): 93-100.
Wei Chaoyu, Han Wen, Liu Huijun. Counting method of small tomato fruit in greenhouse based on deep learning[J]. Journal of China University of Metrology, 2021, 32(1): 93-100. (in Chinese with English abstract)
[20] Mohanty S P, Hughes D P, Salathe M. Using deep learning for image-based plant disease detection[J]. Frontiers in Plant Science, 2016, 7: 1419.
[21] Lu H, Cao Z, Xiao Y, et al. TasselNet: Counting maize tassels in the wild via local counts regression network[J]. Plant Methods, 2017, 13(1): 1-17.
[22] Hasan M M, Chopin J P, Laga H, et al. Detection and analysis of wheat spikes using convolutional neural networks[J]. Plant Methods, 2018, 14(1): 100.
[23] 鲍文霞,张鑫,胡根生,等. 基于深度卷积神经网络的田间麦穗密度估计及计数[J]. 农业工程学报,2020,36(21),186-193.
Bao Wenxia, Zhang Xin, Hu Gensheng, et al. Estimation and counting of wheat ears density in field based on deep convolutional neural network[J]. Transactions of the Chinese Society of Agricultural Engineering (Transactions of the CSAE), 2020, 36(21): 186-193. (in Chinese with English abstract)
[24] 章权兵,胡姗姗,舒文灿,等. 基于注意力机制金字塔网络的麦穗检测方法[J]. 农业机械学报,2021,52(11):253-262.
Zhang Quanbing, Hu Shanshan, Shu Wencan, et al. Wheat spikes detection method based on pyramidal network of attention mechanism[J]. Transactions of the Chinese Society for Agricultural Machinery, 2021, 52(11): 253-262. (in Chinese with English abstract)
[25] Ren S, He K, Girshick R, et al. Faster R-CNN: Towards real-time object detection with region proposal networks[J]. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2017, 39(6): 1137-1149.
[26] Liu W, Anguelov D, Erhan D, et al. SSD: Single shot multiBox detector[C]// European Conference on Computer Vision.Amsterdam, the Netherlands: Springer: 2016: 21-37.
[27] Zhou X, Wang D, Krhenbühl P. Objects as points[EB/OL]. arXiv preprint arXiv: 1904.07850v2, 2019. (2022-03-10). https://arxiv.org/abs/1904.07850.
[28] Everingham M, Eslami S, Gool L V, et al. The pascal visual object classes challenge: A retrospective[J]. International Journal of Computer Vision, 2015, 111: 98-136.
[29] Bochkovskiy A, Wang C Y, Liao H Y M. YOLOv4: Optimal speed and accuracy of object detection[EB/OL]. arXiv preprint arXiv: 2004.10934,2020. (2022-03-10). https://arxiv.org/abs/2004.10934.
[30] Redmon J, Divvala S, Girshick R, et al. You only look once: Unified, real-time object detection[C]//Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition. Las Vegas, USA: IEEE, 2016: 779-788.
[31] Redmon J, Farhadi A. YOLO9000: Better, faster, stronger[C]// Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition. Honolulu, HI, USA: IEEE, 2017: 6517-6525.
[32] Redmon J, Farhadi A. Yolov3: An incremental improvement[EB/OL]. arXiv preprint arXiv: 1804.02767, 2018. (2022-03-10). https://arxiv.org/abs/1804.02767v1.
[33] 陈民,吴观茂. 基于改进YOLOX的交通标志检测与识别[J]. 现代信息科技,2022,6(2):101-103,106.
Chen Min, Wu Guanmao. Traffic sign detection and recognition based on improved YOLOX[J]. Modern Information Technology, 2022, 6(2): 101-103,106. (in Chinese with English abstract)
[34] Wang J, Chen K, Xu R, et al. CARAFE: Content-Aware ReAssembly of Features[C]// International Conference on Computer Vision. Seoul, Korea (South): IEEE, 2019: 3007-3016.
[35] Dai Y, Gieseke F, Oehmcke S, et al. Attentional feature fusion[EB/OL]. arXiv preprint arXiv: 2009.14082v2, 2020. (2022-03-10). https://arxiv.org/abs/2009.14082.
Detecting wheat ears per unit area using an improved YOLOX
Yang Shuqin1,2,3, Wang Shuai1,2,3, Wang Pengfei1,2,3, Ning Jifeng3,4, Xi Yajun5
(1.712100,; 2.712100,; 3.712100,; 4.712100,;5.712100)
Wheat production is closely related to the food security in world. The yield forecast of wheat can provide a strong reference for the agricultural production and management, particularly for the decision-making on the rural land policy and grain market. Among them, the number of wheat ears per unit area is one of the most important indicators to estimate the wheat yield, including the crop phenotypic parameters, yield prediction, and field management. However, the traditional image processing and manual counting of wheat ears cannot fully meet the large-scale production in recent years. Particularly, the manual counting is cumbersome, labor-intensive, and highly subjective. It is a high demand to improve the detection accuracy of the traditional image processing. A generalized model is also required for a lot of experience, the robustness to lighting, and sufficient soil conditions in complex scenes. Much effort has been made to combine the deep learning for the detection and counting of the wheat ears per unit area, particularly with the rapid development of crop phenotype research. It is still lacking on the recognition accuracy of dense and occluded wheat ears under complex conditions. Taking the image of wheat ears per unit area as the research object, this study aims to accurately obtain the number of wheat ears per unit area using the improved YOLOX. Firstly, a simple sampling frame was designed to directly realize the counting of wheat ears per unit area. The corner detection network was trained to identify the sampling frame, further to extract the unit area of wheat. The Content-Aware ReAssembly of Features (CARAFE) map was used in the feature fusion layer of the wheat ear detection network. Secondly, the sampling was replaced with the up-sampling in the YOLOX-m model. The iterative attention feature fusion module was also used to increase the extraction of spatial information and semantic information of wheat ears. Thirdly, the wheat canopy images captured by the smartphone were taken as the research object. The images were selected at the wheat grain filling and mature stages under three weather conditions of clear, overcast, and cloudy. A total of 600 images of wheat ears without the sampling frame (image resolution of 4 000 × 3 000 pixels) were collected, where the original images were randomly cropped into the 3 072 images of wheat ears of 800 × 800 pixels. Fourthly, the dataset was augmented after the mirroring and rotation operation, where the image data of the training set was expanded from 3 072 to 9 216 images. There were 218 wheat ears images with the sampling frame (image resolution was 4 000 × 3 000 pixels). Among them, the sampling frame was contained 350-520 target wheat ears. Finally, the performance of the model was evaluated using the precision, recall, Average Precision (AP),1 score, Frame per Second (FPS), determination coefficient(2) and Root Mean Square Error (RMSE). The experimental results show that the improved YOLOX-m model was significantly improved the detection performance of dense and occluded wheat ears. Specifically, the AP value was improved by 10.26, 8.2 and 1.14 percentage points, respectively, compared with the SSD, CenterNet, and original YOLOX-m model. Consequently, the wheat ears per unit area were accurately detected and counted in the natural environment. The finding can provide a strong reference for the intelligent counting of wheat ears in the actual production of wheat yield prediction.
models; target detection; deep learning; unit area; wheat ear
10.11975/j.issn.1002-6819.2022.15.015
TP391.41
A
1002-6819(2022)-15-0143-07
杨蜀秦,王帅,王鹏飞,等. 改进YOLOX检测单位面积麦穗[J]. 农业工程学报,2022,38(15):143-149.doi:10.11975/j.issn.1002-6819.2022.15.015 http://www.tcsae.org
Yang Shuqin, Wang Shuai, Wang Pengfei, et al. Detecting wheat ears per unit area using an improved YOLOX[J]. Transactions of the Chinese Society of Agricultural Engineering (Transactions of the CSAE), 2022, 38(15): 143-149. (in Chinese with English abstract) doi:10.11975/j.issn.1002-6819.2022.15.015 http://www.tcsae.org
2022-04-30
2022-06-30
陕西省自然科学基础研究计划项目(2022JM-128)
杨蜀秦,博士,副教授,研究方向为计算机视觉在农业信息领域中的应用。Email:yangshuqin1978@163.com