Rice panicle recognition in field based on improved YOLOv5l model
-
摘要:目的
引入YOLOv5l算法模型并对其进行改进,以实现大田环境下水稻稻穗的精准、高效、无损检测。
方法以田间水稻为研究对象,通过数码单镜反光相机采集水稻图像样本,人工标注后对原始图像进行离线数据增强扩充,构建田间水稻图像数据集;对YOLOv5l算法进行适应性改进,在空间金字塔池化(Spatial pyramid pooling,SPP)层前以及Cross-stage-sartial-connections (CSP) 层中置入有效通道注意力(Efficient channel attention,ECA)机制,并进行对比试验。选取最优算法作为基准模型进行注意力机制和数据增强消融试验,并测试得到性能最优模型。将改进YOLOv5l与YOLOv5l、YOLOv5x、SSD和Faster R-CNN进行对比试验。
结果在改进YOLOv5l的水稻识别框架中,将ECA置入网络SPP层前有更出色的性能。利用测试集图像检验模型,识别结果的平均精确率为93.63%,平均召回率为90.94%,总体平均精度可达95.05%。与未融合YOLOv5l算法相比,改进的YOLOv5l算法平均精度高3.03个百分点,图像的检测速率快8.20帧/ms;与YOLOv5x算法相比,改进的YOLOv5l算法平均精度提高0.62个百分点,图像的检测速率快5.41帧/ms,内存占用减少74.1MB,在田间水稻稻穗检测方面,改进YOLOv5l算法的综合性能优于其他算法。
结论将改进后的YOLOv5l算法引入大田环境下的水稻稻穗检测是可行的,具有较高的精确率、较快的检测速度和较小的内存占用,能够避免传统人工检测的主观性,对稻穗检测和水稻的无损估产具有重要意义。
Abstract:ObjectiveYOLOv5l algorithm model was introduced and improved to realize accurate, efficient and nondestructive detection of rice panicles in field environment.
MethodTaking rice in the field as the research object, rice image samples were collected by digital single-mirror reflex camera. The original image data were augmented and expanded offline after manual labeling, so as to construct an image data set for field rice. The YOLOv5l algorithm was improved adaptively, the effective channel attention (ECA) mechanism was put in front of the spatial pyramid pooling (SPP) layer and in the cross-stage-partial-connections (CSP) layer, and a comparative experiment was conducted. The optimal algorithm was selected as the benchmark model to carry out attention mechanism and data-enhanced ablation experiments, and the optimal performance model was obtained by testing. The improved YOLOv5l was compared with YOLOv5l, YOLOv5x, SSD and Faster R-CNN.
ResultIn the improved rice recognition framework of YOLOv5l, placing ECA before the network SPP layer resulted in better performance. Using test set images to verify the model, the average accuracy of recognition results was 93.63%, the average recall rate was 90.94%, and the overall average accuracy reached 95.05%. Compared with the non-fused YOLOv5l algorithm, the average accuracy of the improved YOLOv5l algorithm was 3.03 percent higher and the detection rate was 8.20 frames per ms faster. Compared with the YOLOv5x algorithm, the average precision of the improved YOLOv5l algorithm was improved by 0.62 percent, the detection rate was faster by 5.41 frames per ms, and the memory occupation was reduced by 74.1 MB. The results showed that the comprehensive performance of the improved YOLOv5l algorithm was better than other algorithms in rice panicle detection in the field.
ConclusionIt is feasible to introduce the improved YOLOv5l algorithm into rice panicle detection in field environment. The algorithm has high accuracy, fast detection speed and small memory occupation, which can avoid the subjectivity of traditional manual detection and is of great significance for rice panicle detection and non-destructive yield estimation.
-
Keywords:
- Rice /
- Yield estimation /
- Rice panicle detection /
- YOLOv5l /
- Efficient channel attention /
- Attention mechanism
-
-
表 1 ECA模块融合结果对比
Table 1 Comparison of ECA module fusion results
% 网络模型
Network model精确率
Precision召回率
Recall平均精度
Average precisionYOLOv5l 90.19 88.99 92.02 ECA-YOLOv5l-Backbone 93.58 89.56 94.47 ECA-YOLOv5l-SPP 93.63 90.94 95.05 ECA-YOLOv5l-Neck 92.64 90.46 94.33 表 2 YOLOv5l消融试验1)
Table 2 YOLOv51 ablation experiment
% 注意力
机制
ECA数据增强
Data
augmentation精确率
Precision召回率
Recall平均精度
Average
precision× × 88.32 84.21 88.18 × √ 90.19 88.99 92.02 √ √ 93.63 90.94 95.05 1) “√”和“×”分别表示使用和未使用
1) “√” and “×” indicates used and unused respectively表 3 不同网络模型检测性能对比
Table 3 Comparison of different networks
网络模型
Network
model平均精度/%
Average
precision检测速率/
(帧·ms−1)
Detection rate内存/MB
Memory
sizeFaster R-CNN 86.65 11.72 109.0 SSD 88.43 10.83 100.0 YOLOv5l 92.02 15.30 89.3 YOLOv5x 94.43 18.09 166.0 改进 YOLOv51
Improved YOLOv5195.05 23.50 91.9 -
[1] 郭雷风. 面向农业领域的大数据关键技术研究[D]. 北京: 中国农业科学院, 2016. [2] 章元, 许庆, 邬璟璟. 一个农业人口大国的工业化之路: 中国降低农村贫困的经验[J]. 经济研究, 2012, 47(11): 76-87. [3] 辛良杰, 李鹏辉. 中国居民口粮消费特征变化及安全耕地数量[J]. 农业工程学报, 2017, 33(13): 1-7. [4] 杨仕华, 廖琴. 中国水稻品种试验与审定[M]. 北京: 中国农业科学技术出版社, 2005. [5] IKEDA M, HIROSE Y, TAKASHI T, et al. Analysis of rice panicle traits and detection of QTLs using an image analyzing method[J]. Breeding Science, 2010, 60(1): 55-64. doi: 10.1270/jsbbs.60.55
[6] ZHOU X G. First report of bacterial panicle blight of rice caused by Burkholderia glumae in South Africa[J]. Plant Disease, 2014, 98(4): 566.
[7] ZHANG Y, LIU M, DANNENMANN M, et al. Benefit of using biodegradable film on rice grain yield and N use efficiency in ground cover rice production system[J]. Field Crops Research, 2017, 201: 52-59. doi: 10.1016/j.fcr.2016.10.022
[8] BOIL K, KANG S K, SANG W G, et al. Variation of panicle differentiation stage by leaf growth according to rice cultivars and transplanting time[J]. Korean Journal of Crop Science, 2013, 58(4): 353-361. doi: 10.7740/kjcs.2013.58.4.353
[9] 赵锋, 王克俭, 苑迎春. 基于颜色特征和AdaBoost算法的麦穗识别的研究[J]. 作物杂志, 2014(1): 141-144. doi: 10.3969/j.issn.1001-7283.2014.01.033 [10] 范梦扬, 马钦, 刘峻明, 等. 基于机器视觉的大田环境小麦麦穗计数方法[J]. 农业机械学报, 2015, 46(S1): 234-239. doi: 10.6041/j.issn.1000-1298.2015.S0.038 [11] ZHOU C Q, LIANG D, YANG X D, et al. Wheat ears counting in field conditions based on multi-feature optimization and TWSVM[J]. Frontiers in Plant Science, 2018, 9: 1024. doi: 10.3389/fpls.2018.01024.
[12] DUAN L F, HUANG C L, CHEN G X, et al. Determination of rice panicle numbers during heading by mufti-angle imaging[J]. The Crop Journal, 2015, 3(3): 211-219. doi: 10.1016/j.cj.2015.03.002
[13] LI Q Y, CAI J H, BERGER B, et al. Detecting spikes of wheat plants using neural networks with laws texture energy[J]. Plant methods, 2017, 13(1): 1-13. doi: 10.1186/s13007-016-0152-4
[14] OLSEN P A, RAMAMURTHY K N, RIBERA J, et al. Detecting and counting panicles in sorghum images[C]//2018 IEEE 5th International Conference on Data Science and Advanced Analytics (DSAA). Turin, Italy: IEEE, 2019: 400-409.
[15] 李静, 陈桂芬, 安宇. 基于优化卷积神经网络的玉米螟虫害图像识别[J]. 华南农业大学学报, 2020, 41(3): 110-116. [16] 顾伟, 王巧华, 李庆旭, 等. 基于改进SSD的棉种破损检测[J]. 华中农业大学学报, 2021, 40(3): 278-285. [17] 周云成, 许童羽, 邓寒冰, 等. 基于面向通道分组卷积网络的番茄主要器官实时识别[J]. 农业工程学报, 2018, 34(10): 153-162. [18] KOIRALA A, WALSH K B, WANG Z, et al. Deep learning for real-time fruit detection and orchard fruit load estimation: Benchmarking of ‘MangoYOLO’[J]. Precision Agriculture, 2019, 20(6): 1107-1135. doi: 10.1007/s11119-019-09642-0
[19] TIAN Y N, YANG G D, WANG Z, et al. Apple detection during different growth stages in orchards using the improved YOLO-V3 model[J]. Computers and Electronics in Agriculture, 2019, 157: 417-426. doi: 10.1016/j.compag.2019.01.012
[20] 张领先, 陈运强, 李云霞, 等. 基于卷积神经网络的冬小麦麦穗检测计数系统[J]. 农业机械学报, 2019, 50(3): 144-150. doi: 10.6041/j.issn.1000-1298.2019.03.015 [21] 彭文, 兰玉彬, 岳学军, 等. 基于深度卷积神经网络的水稻田杂草识别研究[J]. 华南农业大学学报, 2020, 41(6): 75-81. [22] 黄小杭, 梁智豪, 何子俊, 等. 基于YOLOv2的莲蓬快速识别研究[J]. 现代农业科技, 2018(13): 164-167. [23] 彭红星, 黄博, 邵园园, 等. 自然环境下多类水果采摘目标识别的通用改进SSD模型[J]. 农业工程学报, 2018, 34(16): 155-162. doi: 10.11975/j.issn.1002-6819.2018.16.020 [24] 张洋. 基于深度学习的水稻种粒缺陷识别及重叠分布千粒重测量研究[D]. 扬州: 扬州大学, 2021. [25] 马志宏, 贡亮, 林可, 等. 基于稻穗几何形态模式识别的在穗籽粒数估测[J]. 上海交通大学学报, 2019, 53(2): 239-246. [26] WANG Q L, WU B G, ZHU P F, et al. ECA-Net: Efficient channel attention for deep convolutional neural networks[C]//2020 IEEE/CVF Conference on Computer Vision and Pattern Recognition. Seattle, USA: IEEE, 2020: 11531-11539.
[27] HU J, SHEN L, ALBANIE S, et al. Squeeze-and-excitation networks[J]. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2020, 42(8): 2011-2023. doi: 10.1109/TPAMI.2019.2913372