AI Differentiation of Bok Choy Seedlings from Weeds
-
摘要:
目的 提出一种基于人工智能的青菜幼苗与杂草识别方法,以期解决杂草识别这一制约精确除草的瓶颈问题。 方法 以青菜幼苗及其伴生杂草为试验对象,通过神经网络模型识别青菜幼苗。青菜幼苗目标之外的绿色像素则认为是杂草,并利用颜色特征对杂草进行分割。为探究主流卷积神经网络(Convolutional Neural Networks,CNN)模型以及新兴Transformer神经网络模型在青菜识别中的效果,分别选取YOLOX模型和Deformable DETR模型,以识别率和识别性能作为评价指标进行对比分析。 结果 基于CNN的YOLOX模型和基于Transformer的Deformable DETR模型都能有效识别青菜幼苗。其中YOLOX模型为最优模型,平均精度和识别速度分别为98.1%和44.8 fps。 结论 将青菜幼苗之外的绿色目标视为杂草的思路不仅简化了杂草识别的复杂性,同时提高了杂草识别的泛化能力。提出的青菜幼苗与杂草识别方法可用于青菜幼苗生长管理的精准作业。 -
关键词:
- 青菜幼苗 /
- 杂草识别 /
- 人工智能 /
- 卷积神经网络 /
- Transformer神经网络
Abstract:Objective An artificial intelligence-based identification method to effectively differentiate bok choy seedlings from weeds was proposed to facilitate vegetable farm weeding operation. Methods Bok choy seedlings were recognized by the neural network models to exclude the green pixels from other vegetations considered as weeds by color differentiation. Effectiveness of the convolutional neural networks (CNN) and the emerging transformer models in correctly separating the seedlings and weeds was evaluated. Result Although both performed acceptable, the YOLOX model delivered a higher average accuracy of 98.1% and a faster speed at 44.8 fps than Deformable DETR in the recognition operation. Conclusion By defining the green pixels of bok choy seedlings as target color, weeds could be rejected by the AI recognition program providing a robust separation for efficient weeding in the field of the random-planting vegetables such as bok choy. -
Key words:
- Bok choy seedling /
- weed detection /
- artificial intelligence /
- CNN /
- Transformer Neural Network
-
表 1 模型超参设置
Table 1. Hyperparameters of models
模型
Model批尺寸
Batch初始学习率
Initial learning
rate优化器
Optimizer衰减值
Decay训练周期
Training epochsYOLOX 4 0.01 SGD 5e-4 300 Deformable DETR 1 2e-4 AdamW 0.0001 120 表 2 不同置信度阈值验证集评价数据
Table 2. Evaluation matrixes of varied confidence scores on val data set
模型
Model置信度
Confidence score精度
Precision召回率
RecallF1值
F1 scoreYOLOX 0.9 1.000 0.04 0.077 0.8 0.993 0.80 0.886 0.7 0.980 0.93 0.954 0.6 0.953 0.97 0.961 0.5 0.940 0.98 0.959 0.4 0.922 0.99 0.955 0.3 0.922 0.99 0.955 0.2 0.877 1.00 0.934 0.1 0.877 1.00 0.934 Deformable DETR 0.9 0.998 0.54 0.701 0.8 0.991 0.77 0.867 0.7 0.981 0.86 0.917 0.6 0.978 0.90 0.938 0.5 0.963 0.94 0.951 0.4 0.958 0.96 0.959 0.3 0.930 0.98 0.954 0.2 0.893 0.99 0.939 0.1 0.893 0.99 0.939 表 3 测试集最优置信度阈值的评价数据
Table 3. Evaluation matrix of highest confidence score on test data set
模型
Model置信度
Confidence score精度
Precision召回率
RecallF1值
F1 score平均精度
Average precision检测速度
Detection speed / fpsYOLOX 0.6 0.943 0.97 0.956 0.981 44.8 Deformable DETR 0.4 0.928 0.97 0.948 0.972 10.2 -
[1] 陈桂芬, 马丽, 陈航. 精准施肥技术的研究现状与发展趋势 [J]. 吉林农业大学学报, 2013, 35(3):253−259.CHEN G F, MA L, CHEN H. Research status and development trend of precision fertilization technology [J]. Journal of Jilin Agricultural University, 2013, 35(3): 253−259.(in Chinese) [2] LANINI W T, STRANGE M L. Low-input management of weeds in vegetable fields [J]. California Agriculture, 1991, 45(1): 11−13. doi: 10.3733/ca.v045n01p11 [3] 金月, 肖宏儒, 曹光乔, 等. 我国叶类蔬菜机械化水平现状与评价方法研究 [J]. 中国农机化学报, 2020, 41(12):196−201.JIN Y, XIAO H R, CAO G Q, et al. Research on status and evaluation methods of leafy vegetable mechanization production level in China [J]. Journal of Chinese Agricultural Mechanization, 2020, 41(12): 196−201.(in Chinese) [4] 洪晓玮, 陈勇, 杨超淞, 等. 有机蔬菜大棚除草机器人研制 [J]. 制造业自动化, 2021, 43(5):33−36, 71. doi: 10.3969/j.issn.1009-0134.2021.05.008HONG X W, CHEN Y, YANG C S, et al. Development of a weeding robot for organic vegetable greenhouse [J]. Manufacturing Automation, 2021, 43(5): 33−36, 71.(in Chinese) doi: 10.3969/j.issn.1009-0134.2021.05.008 [5] 金小俊, 陈勇, 孙艳霞. 农田杂草识别方法研究进展 [J]. 农机化研究, 2011, 33(7):23−27, 33. doi: 10.3969/j.issn.1003-188X.2011.07.005JIN X J, CHEN Y, SUN Y X. Research advances of weed identification in agricultural fields [J]. Journal of Agricultural Mechanization Research, 2011, 33(7): 23−27, 33.(in Chinese) doi: 10.3969/j.issn.1003-188X.2011.07.005 [6] 毛文华, 张银桥, 王辉, 等. 杂草信息实时获取技术与设备研究进展 [J]. 农业机械学报, 2013, 44(1):190−195. doi: 10.6041/j.issn.1000-1298.2013.01.036MAO W H, ZHANG Y Q, WANG H, et al. Advance techniques and equipments for real-time weed detection [J]. Transactions of the Chinese Society for Agricultural Machinery, 2013, 44(1): 190−195.(in Chinese) doi: 10.6041/j.issn.1000-1298.2013.01.036 [7] 王璨, 武新慧, 张燕青, 等. 基于双注意力语义分割网络的田间苗期玉米识别与分割 [J]. 农业工程学报, 2021, 37(9):211−221. doi: 10.11975/j.issn.1002-6819.2021.09.024WANG C, WU X H, ZHANG Y Q, et al. Recognition and segmentation of maize seedlings in field based on dual attention semantic segmentation network [J]. Transactions of the Chinese Society of Agricultural Engineering, 2021, 37(9): 211−221.(in Chinese) doi: 10.11975/j.issn.1002-6819.2021.09.024 [8] 樊湘鹏, 周建平, 许燕, 等. 基于优化faster R-CNN的棉花苗期杂草识别与定位 [J]. 农业机械学报, 2021, 52(5):26−34. doi: 10.6041/j.issn.1000-1298.2021.05.003FAN X P, ZHOU J P, XU Y, et al. Identification and localization of weeds based on optimized faster R-CNN in cotton seedling stage [J]. Transactions of the Chinese Society for Agricultural Machinery, 2021, 52(5): 26−34.(in Chinese) doi: 10.6041/j.issn.1000-1298.2021.05.003 [9] 许燕, 温德圣, 周建平, 等. 基于faster R-CNN的新疆棉花幼苗与杂草识别方法 [J]. 排灌机械工程学报, 2021, 39(6):602−607.XU Y, WEN D S, ZHOU J P, et al. Identification method of cotton seedlings and weeds in Xinjiang based on faster R-CNN [J]. Journal of Drainage and Irrigation Machinery Engineering, 2021, 39(6): 602−607.(in Chinese) [10] 徐涛, 陈勇, 周卫鹏. 基于三维点云的蔬菜大棚杂草识别方法 [J]. 北方园艺, 2021(2):153−158.XU T, CHEN Y, ZHOU W P. A weed identification method in vegetable greenhouses based on three-dimensional point cloud [J]. Northern Horticulture, 2021(2): 153−158.(in Chinese) [11] OSORIO K, PUERTO A, PEDRAZA C, et al. A deep learning approach for weed detection in lettuce crops using multispectral images [J]. AgriEngineering, 2020, 2(3): 471−488. doi: 10.3390/agriengineering2030032 [12] TANG L, TIAN L, STEWARD B L. Color image segmentation with genetic algorithm for in-field weed sensing [J]. Transactions of the ASAE, 2000, 43(4): 1019−1027. doi: 10.13031/2013.2970 [13] HERRERA P, DORADO J, RIBEIRO Á. A novel approach for weed type classification based on shape descriptors and a fuzzy decision-making method [J]. Sensors, 2014, 14(8): 15304−15324. doi: 10.3390/s140815304 [14] BAKHSHIPOUR A, JAFARI A, NASSIRI S M, et al. Weed segmentation using texture features extracted from wavelet sub-images [J]. Biosystems Engineering, 2017, 157: 1−12. doi: 10.1016/j.biosystemseng.2017.02.002 [15] JIANG H Z, JIANG X S, RU Y, et al. Application of hyperspectral imaging for detecting and visualizing leaf lard adulteration in minced pork [J]. Infrared Physics & Technology, 2020, 110: 103467. [16] 仇裕淇, 黄振楠, 阮昭, 等. 机器视觉技术在农业生产智能化中的应用综述 [J]. 机械研究与应用, 2019, 32(2):202−206.QIU Y Q, HUANG Z N, RUAN Z, et al. Review on application of machine vision in intelligent agricultural production [J]. Mechanical Research & Application, 2019, 32(2): 202−206.(in Chinese) [17] LIAKOS K, BUSATO P, MOSHOU D, et al. Machine learning in agriculture: A review [J]. Sensors, 2018, 18(8): 2674. doi: 10.3390/s18082674 [18] WANG A C, ZHANG W, WEI X H. A review on weed detection using ground-based machine vision and image processing techniques [J]. Computers and Electronics in Agriculture, 2019, 158: 226−240. doi: 10.1016/j.compag.2019.02.005 [19] SHI J H, LI Z Y, ZHU T T, et al. Defect detection of industry wood veneer based on NAS and multi-channel mask R-CNN [J]. Sensors, 2020, 20(16): 4398. doi: 10.3390/s20164398 [20] 邓向武, 马旭, 齐龙, 等. 基于卷积神经网络与迁移学习的稻田苗期杂草识别 [J]. 农机化研究, 2021, 43(10):167−171. doi: 10.3969/j.issn.1003-188X.2021.10.030DENG X W, MA X, QI L, et al. Recognition of weeds at seedling stage in paddy fields using convolutional neural network and transfer learning [J]. Journal of Agricultural Mechanization Research, 2021, 43(10): 167−171.(in Chinese) doi: 10.3969/j.issn.1003-188X.2021.10.030 [21] YU J L, SCHUMANN A W, SHARPE S M, et al. Detection of grassy weeds in bermudagrass with deep convolutional neural networks [J]. Weed Science, 2020, 68(5): 545−552. doi: 10.1017/wsc.2020.46 [22] HASAN A S M M, SOHEL F, DIEPEVEEN D, et al. A survey of deep learning techniques for weed detection from images [J]. Computers and Electronics in Agriculture, 2021, 184: 106067. doi: 10.1016/j.compag.2021.106067 [23] 刘天真, 滕桂法, 苑迎春, 等. 基于改进YOLO v3的自然场景下冬枣果实识别方法 [J]. 农业机械学报, 2021, 52(5):17−25. doi: 10.6041/j.issn.1000-1298.2021.05.002LIU T Z, TENG G F, YUAN Y C, et al. Winter jujube fruit recognition method based on improved YOLO v3 under natural scene [J]. Transactions of the Chinese Society for Agricultural Machinery, 2021, 52(5): 17−25.(in Chinese) doi: 10.6041/j.issn.1000-1298.2021.05.002 [24] WOEBBECKE D M, MEYER G E, BARGEN K V, et al. Color indices for weed identification under various soil, residue, and lighting conditions [J]. Transactions of the ASAE, 1995, 38(1): 259−269. doi: 10.13031/2013.27838 [25] GÉE C, BOSSU J, JONES G, et al. Crop/weed discrimination in perspective agronomic images [J]. Computers and Electronics in Agriculture, 2008, 60(1): 49−59. doi: 10.1016/j.compag.2007.06.003 [26] 刘东, 肖宏儒, 金月, 等. 基于ANSYS的鸡毛菜茎秆切割的有限元分析及验证试验 [J]. 中国农业科技导报, 2018, 20(11):85−93.LIU D, XIAO H R, JIN Y, et al. Finite element analysis of stalk cutting of Chinese little greens based on ANSYS and verification test [J]. Journal of Agricultural Science and Technology, 2018, 20(11): 85−93.(in Chinese)