基于改进DenseNet的田间杂草识别

2021-11-24 10:08曹宇航岳有军王红君
农业工程学报 2021年18期
关键词:除草田间杂草

赵 辉,曹宇航,岳有军,王红君

基于改进DenseNet的田间杂草识别

赵 辉,曹宇航,岳有军,王红君

(天津理工大学电气电子工程学院,天津市复杂系统控制理论与应用重点实验室,天津 300384)

精确、快速地获取作物和杂草的类别信息是实现自动化除草作业的重要前提。为解决复杂环境下农作物田间杂草种类的高效准确识别问题,该研究提出一种基于改进DenseNet的杂草识别模型。首先,在DenseNet-121网络的基础上,通过在每个卷积层后引入高效通道注意力(Efficient Channel Attention,ECA)机制,增加重要特征的权重,强化杂草特征并抑制背景特征;其次,通过DropBlock正则化随机隐藏杂草图像部分特征块,以提升模型的泛化能力,增强模型识别不同类型杂草的适应性;最后,以自然环境下玉米幼苗和6类伴生杂草作为样本,在相同试验条件下与VggNet-16、ResNet-50和未改进的DenseNet-121模型进行对比试验。结果表明,改进的DenseNet模型性能最优,模型大小为26.55 MB,单张图像耗时0.23 s,平均识别准确率达到98.63%,较改进前模型的平均识别准确率提高了2.09个百分点,且综合性能高于VggNet-16、ResNet-50模型;同时,通过采用梯度加权类激活映射图(Gradient-weighted Class Activation Mapping,Grad-CAM)可视化热度图方法分析,得出改进前后模型的类别判断概率分别为0.68和0.99,本文模型明显高于未改进模型,进一步验证了改进模型的有效性。该模型能够很好地解决复杂环境下农作物和杂草的种类精准识别问题,为智能除草机器人开发奠定了坚实的技术基础。

图像识别;卷积神经网络;高效通道注意力;DropBlock;田间杂草

0 引 言

伴生杂草严重影响作物的产量和质量,因此,抑制杂草生长是农业的主要作业之一[1]。国内目前主要的除草方式是人工作业,农民在除草过程中往往使用大面积随机喷洒除草剂的方式进行除草,这会造成极大的环境污染和化学残留,也对人们的身体健康产生极大的危害。而且大面积除草作业没有针对性,除草效率往往不高,需要反复进行除草[2-4]。近年来,为提高田间作业效率及解决农业劳动力不足问题,自动精确除草系统成为研究热点[5-6],其中,基于机器视觉和图像处理的杂草自动识别技术是难点[7]。

传统图像处理方法通常根据杂草颜色、形状、纹理和空间分布等特征以及这些特征的组合,使用小波分析、贝叶斯判别模型和支持向量机(Support Vector Machines,SVM)等[8-10]方法实现农作物与杂草的识别[11-15]。这些方法虽然检测难度较低,但是一般农作物的种植区域环境复杂,使用杂草特定特征进行识别的方法的鲁棒性较差,识别准确率不高。

随着深度学习技术的发展,卷积神经网络(Convolutianal Neural Network,CNN)在机器视觉领域逐渐得到广泛应用并取得良好效果[16-19]。在杂草识别方面,Dos等[20]将AlexNet与SVM和随机林模型进行了比较,得出AlexNet架构比其他模型能更好地辨别大豆、土壤和阔叶杂草;Potena等[21]提出基于RGB+NIR(Near Infrared)图像的多步视觉系统,使用2种不同的CNN架构对农作物和杂草进行分类;Jiang等[22]在AlexNet、VGG16和ResNet-101网络模型[23-25]上使用图卷积神经网络对3类农作物及杂草进行识别,其中ResNet-101的平均识别准确率达到96.51%;彭文等[26]以水稻田间杂草为研究对象,在深度卷积神经网络训练时,使用随机梯度下降(Stochastic Gradient Descent,SGD)优化器优化参数,其中VGG16-SGD模型精度最高,其平均F(F-measure)值为0.977;邓向武等[27]使用预训练CNN模型结合迁移学习方法,对水稻幼苗田间杂草进行识别,其中,VGG16模型的正确识别率达到97.8%;徐艳蕾等[28]通过在Xception网络基础上引入指数线性单元(Exponential Linear Unit,ELU)激活函数和全局最大池化层提高对杂草的识别能力,最终平均识别准确率达到98.63%。通过以上文献可以看出,基于深度学习的杂草识别方法可以很好地解决传统图像处理中需要提取特定特征的问题,并且在准确率上也有一定程度的提高,但仍然存在以下问题:1)在复杂环境下的农作物田间,当杂草周围环境发生变化时,已有深度学习模型对杂草识别存在泛化能力不强问题;2)卷积神经网络在特征提取过程中,因背景多样且图像像素占比较多,从而提取大量无效背景信息,影响识别结果,不能保持较高的识别准确率。

针对以上问题,本文提出一种基于改进DenseNet-121网络的杂草识别模型,通过引入高效通道注意力(Efficient Channel Attention,ECA)机制和DropBlock正则化,在加强杂草特征提取的同时,抑制无效背景特征的提取,从而提高识别准确率和网络的泛化能力,确保在复杂环境下杂草的高效准确识别。

1 杂草识别流程

本文通过改进DenseNet进行田间杂草识别。步骤如图1所示。首先,对收集到的农作物和杂草图像进行数据扩增以确保数据的多样性,完成杂草数据集的建立,并划分训练集和测试集;其次,将训练集输入到杂草识别模型中完成模型训练,再载入训练好的权重得到预测模型;最后,输入测试集得到预测结果。

2 数据处理

本文训练样本数据集包括2部分,一部分为文献[22]公开的玉米与杂草数据集;一部分为自建杂草数据集,于2020年6月10日,采集于山西省垣曲县上官村中自然环境下的玉米田间,分别在早上6:00、中午12:00和下午18:00实地拍摄玉米幼苗图像和杂草图像。包括莎草、刺儿草、牛筋草、藜、早熟禾、小飞蓬6种常见的杂草和玉米图像。经过筛选后,本文所用数据集共有1 522幅图片,其中莎草270张,刺儿草244张,牛筋草114张,藜220张,早熟禾265张,小飞蓬119张以及玉米290张。在实际训练过程中,考虑到数据集有限和图像尺寸的问题,对原始数据集进行以下处理:

1)为了防止由于图片数量有限而造成过拟合,本文采用深度学习中的数据扩增技术,对已有的数据集进行几何变换,通过扩充玉米和杂草图像的数量,增加数据的多样性,避免出现网络学习不相关特征,进而学习更多与数据有关的特征,提升模型的识别能力。本文对收集到的杂草和玉米图片,采用亮度增强、对比度增强、添加噪声和随机方向翻转4种数据扩增方法,使数据集扩充到原数据集的4倍,共7 610张图片。其中,训练集6 088张,测试集1 522张。

2)为满足网络对图像像素的输入要求,训练时,首先将图像像素调整为256×256,再从中心开始裁剪得到224×224像素的图像,裁剪后的部分杂草数据集图像见图 2。

3 模型构建

3.1 DenseNet-121

Densenet-121[29]网络使用旁路设置和特征重用2种结构,采用特征重复拼接,既可以减少网络的参数量,又可以缓解梯度消失的问题。网络主要由DenseBlock和Transition Layer两部分组成。

DenseBlock结构如图3所示。

DenseBlock的输出公式为

3.2 DenseNet改进

3.2.1 注意力机制

由此可得:

3.2.2 DropBlock正则化

考虑到周围环境变化可能导致识别准确率降低以及 DenseNet-121网络可能会造成过拟合等问题,本文采用DropBlock[31]正则化模型,通过随机隐藏部分特征图的方法,防止过拟合的出现,以提取更具有鲁棒性的特征。

Dropout[32]正则化一般通过在全连接层上随机隐藏神经元发挥作用,但是在卷积层使用却效果不佳,原因是随着特征提取的加深,特征图逐渐变小,感受野逐渐变大,特征图上的每一个特征对应一个感受野范围,均可以通过相邻位置元素学习对应的语义信息,进而失去作用。而DropBlock通过设置整块元素隐藏特征图,阻断相邻位置学习语义信息,并对未被隐藏的特征图进行归一化,从而实现对卷积层的正则化效果。图5为正则化效果图。

3.2.3 杂草识别模型

图6为模型的整体结构,输入为R、G、B三通道图像。首先,图像经过一个7×7大卷积核的卷积层调整通道数并提取有效的信息,后接一个DropBlock正则化层,用以模拟噪声和防止过拟合,并提高模型的泛化能力;其次,ECA-DenseBlock为模型的核心部分,如图7所示,在每一个密集连接后添加ECA注意力机制,增大杂草特征的权重,提取更为重要的信息。网络共包含4个ECA-DenseBlock块,改进后的密集连接的数量分别为6、12、24、16,而且每一个ECA-DenseBlock后面都连接一个Transition Layer,其中,1×1卷积和平均池化用来调整通道数,避免特征维度增长过快。经过添加注意力机制的密集连接结构提取特征后,添加DropBlock正则化,防止过拟合问题。最后,使用全局平均池化和Linear分类器得到类别输出。

城乡水利基础设施再上新台阶。重点水利项目建设全面加快,全力实施福建大水网规划和“十百千万”水利工程,截至2013年10月底,全省完成水利建设投资202亿元,漳州古雷引水、长泰枋洋水库等102个重大水利项目持续推进,建溪三期防洪、莆田金钟引水等19个重点水利枢纽、水资源配置工程相继建成并发挥效益。农村水利基础设施条件持续改善,已解决324万农村人口饮水安全问题,年内可完成400万人以上;加快实施40处大中型灌区(灌排泵站)节水改造、41个小型农田水利重点县建设以及2013—2014年度冬春水利工程水毁修复工作;启动实施首批280座农村水电增效扩容改造,将新增装机容量79万kW。

注:ECA-DenseBlock为添加ECA后的DenseBlock。

4 杂草识别试验

4.1 试验环境

为保证试验的规范与高效,以Ubuntu 18.04作为试验操作系统,采用Intel Xeon(R) CPUE5-2650V4 @2.20Hz×48、12 GB的Ge Force GTX 1080Ti × 2 GPU并且运行内存为64 GB的计算机作为试验硬件平台,采用CUDNN7.6.0为深度神经网络加速库,并使用Python语言在深度学习PyTorch框架上实现。

4.2 参数设置

在训练CNN模型时,本文采用SGD优化算法,batch size设置为64,训练轮数为100,初始学习率设置为0.01,并且在两个轮次的损失值不变时,学习率变为原来的一半。

4.3 模型评价指标

本文采用平均识别准确率(Accuracy)作为模型的评价指标:

4.4 结果与分析

在相同试验条件下,将VggNet-16、ResNet-50、DenseNet-121与改进模型进行准确率、模型大小、实时性及可视化热度图的比较,以验证改进模型的有效性。

4.4.1 分类精度

此次试验共训练100轮,从图8可以看出,相比于其他模型,改进后的模型在第20轮迭代左右趋于收敛,较早稳定在最高值附近,而其他模型一直处于震荡,并且VggNet-16、ResNet-50、DenseNet-121和改进后模型在训练集上的平均分类准确率分别为95.85%、96.40%、96.83%和98.89%,改进后的DenseNet模型在训练集上的平均分类准确率明显高于其他模型。这是因为在特征提取过程中,添加ECA注意力机制和DropBlock正则化,可以有效加强复杂背景下杂草特征的提取,防止模型在训练阶段识别能力较好,而在测试阶段的识别能力较差的过拟合现象的出现,保证网络学习到正确的特征信息,大幅度提升数据集的准确率。

4.4.2 分类准确率

表1为各个模型在测试集上对玉米和不同杂草的分类准确率对比。从表1中可看出,VggNet-16、ResNet-50、DenseNet-121和改进后模型的平均分类准确率分别为95.5%、96.22%、96.54%和98.63%。在平均分类准确率上,与其他3种模型相比,改进后的模型有着明显的提升,较改进前提升了2.09个百分点。其中,藜在每个模型上的识别准确率都比较高,原因是因为藜为菱状卵形,与其他杂草形状差别比较大,较容易识别;而小飞蓬和牛筋草之所以在其他3种模型上的识别准确率都不高,是由于训练集数量略少于其他几种杂草而造成数据的不平衡问题引起的,而改进后模型却可以很好的解决这个问题,凸显出本文模型在杂草识别方面的优越性。

表1 不同模型的分类准确率

4.4.3 模型大小及实时性对比

为了进一步验证文中模型的有效性,表2为不同模型的大小及单张图预测时间。从参数量和模型大小上看,VggNet-16最大,ResNet-50网络次之,DenseNet-121网络最少,计算效率更高,而本文的改进网络ECA-DenseNet仅增加了极少的参数量,不但取得了非常可观的效果,而且保持了比较高的计算效率;从单张图预测时间上看,VggNet-16所用时间最长,ResNet-50、DenseNet-121和改进后的模型不相上下,综合考虑之下,本文的改进模型更适合应用在复杂环境下的杂草识别中。

表2 不同模型的大小及预测时间

4.4.4 Grad-CAM可视化分析

CAM可视化热度图,包括在输入图像上生成类激活的热图,计算并显示每个位置相对于所考虑类别的重要性;通过CAM可视化热度图可以了解输入杂草识别模型的图像中,哪些部分对识别结果起关键作用,彩色部分表示为对识别结果起到关键作用的部分。改进前后模型提取特征的可视化过程图如图9所示。从图9可以看出,未改进模型彩色部分的位置分布在杂草四周,而改进后模型彩色部分的位置位于杂草主体部分,并且改进前后的DenseNet模型值分别为0.68和0.99,改进后模型明显高于改进前模型,添加ECA注意力机制和DropBlock正则化后的模型,加强了重要杂草特征的提取,抑制了背景特征的提取,提取重要特征的能力明显强于未改进的模型,对正确分类的判断效果也更好。所以,本文改进模型可以很好地解决杂草识别准确率低和泛化性不高的问题。

5 结 论

为解决复杂环境下农作物田间杂草种类识别准确率低和泛化能力不强的问题,本研究提出一种基于改进DenseNet的杂草识别方法,通过在DenseNet-121网络的基础上,引入高效通道注意力机制和DropBlock正则化,加强杂草特征的提取,增强模型鲁棒性和泛化能力,实现了对复杂环境下杂草种类的高效准确识别功能。

1)本文提出的模型对自然环境下玉米幼苗和6类伴生杂草平均识别准确率可以达到98.63%,均高于VggNet-16、ResNet-50和没有改进的DenseNet-121模型,且较于改进前模型,提高了2.09个百分点,验证了本文模型在杂草识别上的有效性。

2)改进后的DenseNet网络模型大小为26.55 MB,单张图耗时为0.23 s,均优于VggNet-16和ResNet-50网络,可便于部署到智能除草机器人中。

3)通过梯度加权类激活映射图可视化分析可以得到,改进后的DenseNet网络模型比原DenseNet模型可以更多地关注图像中杂草主体部分,且改进前后模型的类别判断概率分别为0.68和0.99,改进后模型正确分类的判断效果明显高于改进前模型,加强了杂草特征的提取,提高了对杂草的识别能力,进一步凸显出了本文模型在杂草识别方面的优越性。

本文研究成果对于其他作物与伴生杂草的识别具有借鉴意义,通过测试并改进现有算法,可提高模型在杂草识别问题上的通用性。

[1] Harker K N, O'Donovan J T. Recent weed control, weed management, and integrated weed management[J]. Weed Technology, 2013, 27(1): 1-11.

[2] Patches K M, Curran W S, Lingenfelter D D. Effectiveness of herbicides for control of common pokeweed (Phytolacca Americana) in corn and soybean[J]. Weed Technology, 2017, 31(2): 193-201.

[3] 段小贺,韩建国,巴金磊,等. 玉米田化学除草现状及发展趋势[J]. 园艺与种苗,2019,39(8):54-56.

Duan Xiaohe, Han Jianguo, Ba Jinlei, et al. The current situation and development trend of chemical weeding in corn fields[J]. Horticulture and Seedlings, 2019, 39(8): 54-56. (in Chinese with English abstract)

[4] 李香菊. 近年我国农田杂草防控中的突出问题与治理对策[J]. 植物保护,2018,44(5):77-84.

Li Xiangju. Main problems and management strategies of weeds in agricultural fields in China in recent years[J]. Plant Protection, 2018, 44(5): 77-84. (in Chinese with English abstract)

[5] 孙君亮,闫银发,李法德,等. 智能除草机器人的研究进展与分析[J]. 中国农机化学报,2019,40(11):73-80.

Sun Junliang, Yan Yinfa, Li Fade, et al. Research progress and analysis of intelligent weeding robots[J]. Chinese Journal of Agricultural Machinery Chemistry, 2019, 40(11): 73-80. (in Chinese with English abstract)

[6] Utstumo T, Urdal F, Brevik A, et al. Robotic in-row weed control in vegetables[J]. Computers and Electronics in Agriculture, 2018, 154: 36-45.

[7] 袁洪波,赵努东,程曼. 基于图像处理的田间杂草识别研究进展与展望[J]. 农业机械学报,2020,51(S2):323-334.

Yuan Hongbo, Zhao Nudong, Cheng Man. Research progress and prospect of field weed recognition based on image processing[J]. Transactions of the Chinese Society for Agricultural Machinery, 2020, 51(S2): 323-334. (in Chinese with English abstract)

[8] 黄林生,刘文静,黄文江,等. 小波分析与支持向量机结合的冬小麦白粉病遥感监测[J]. 农业工程学报,2017,33(14):188-195.

Huang Linsheng, Liu Wenjing, Huang Wenjiang, et al. Remote sensing monitoring of winter wheat powdery mildew based on wavelet analysis and support vector machine[J]. Transactions of the Chinese Society of Agricultural Engineering (Transactions of the CSAE), 2017, 33(14): 188-195. (in Chinese with English abstract)

[9] 翟治芬,徐哲,周新群,等. 基于朴素贝叶斯分类器的棉花盲椿象危害等级识别[J]. 农业工程学报,2015,31(1):204-211.

Zhai Zhifen, Xu Zhe, Zhou Xinqun, et al. Identification of cotton blind stink bug hazards based on naive Bayes classifier[J]. Transactions of the Chinese Society of Agricultural Engineering (Transactions of the CSAE), 2015, 31(1): 204-211. (in Chinese with English abstract)

[10] 梁习卉子,陈兵旗,李民赞,等. 基于HOG特征和SVM的棉花行数动态计数方法[J]. 农业工程学报,2020,36(15):173-181.

Liang Xihuizi, Chen Bingqi, Li Minzan, et al. Dynamic counting method of cotton rows based on HOG feature and SVM[J]. Transactions of the Chinese Society of Agricultural Engineering (Transactions of the CSAE), 2020, 36(15): 173-181. (in Chinese with English abstract)

[11] Zheng Y, Zhu Q, Huang M, et al. Maize and weed classification using color indices with support vector data description in outdoor fields[J]. Computers and Electronics in Agriculture, 2017, 141: 215-222.

[12] 侯雨,曹丽英,丁小奇,等. 基于边缘检测和BP神经网络的大豆杂草识别研究[J]. 中国农机化学报,2020,41(7):185-190.

Hou Yu, Cao Liying, Ding Xiaoqi, et al. Research on soybean weed recognition based on edge detection and BP neural network[J]. Chinese Journal of Agricultural Machinery Chemistry, 2020, 41(7): 185-190. (in Chinese with English abstract)

[13] 王璨,李志伟. 利用融合高度与单目图像特征的支持向量机模型识别杂草[J]. 农业工程学报,2016,32(15):165-174.

Wang Can, Li Zhiwei. Using support vector machine model fusion height and monocular image features to identify weeds[J]. Transactions of the Chinese Society of Agricultural Engineering (Transactions of the CSAE), 2016, 32(15): 165-174. (in Chinese with English abstract)

[14] 胡盈盈,王瑞燕,郭鹏涛,等. 基于近地光谱特征的玉米田间杂草识别研究[J]. 江苏农业科学,2020,48(8):242-246.

Hu Yingying, Wang Ruiyan, Guo Pengtao, et al. Research on the identification of weeds in corn fields based on near ground spectral characteristics[J]. Jiangsu Agricultural Sciences, 2020, 48(8): 242-246. (in Chinese with English abstract)

[15] Elstone L, How K Y, Brodie S, et al. High speed crop and weed identification in lettuce fields for precision weeding[J]. Sensors, 2020, 20(2): 455.

[16] 周亮,慕号伟,马海姣,等. 基于卷积神经网络的中国北方冬小麦遥感估产[J]. 农业工程学报,2019,35(15):119-128.

Zhou Liang, Mu Haowei, Ma Haijiao, et al. Remote sensing yield estimation of winter wheat in northern China based on convolutional neural network[J]. Transactions of the Chinese Society of Agricultural Engineering (Transactions of the CSAE), 2019, 35(15): 119-128. (in Chinese with English abstract)

[17] 吴赛赛,周爱莲,谢能付,等. 基于深度学习的作物病虫害可视化知识图谱构建[J]. 农业工程学报,2020,6(24):177-185.

Wu Saisai, Zhou Ailian, Xie Nengfu, et al. Construction of visual knowledge graph of crop diseases and insect pests based on deep learning[J]. Transactions of the Chinese Society of Agricultural Engineering (Transactions of the CSAE), 2020, 36(24): 177-185. (in Chinese with English abstract)

[18] 陈善雄,伍胜,于显平,等. 基于卷积神经网络结合图像处理技术的荞麦病害识别[J]. 农业工程学报,2021,37(3):155-163.

Chen Shanxiong, Wu Sheng, Yu Xianping, et al. Buckwheat disease recognition based on convolutional neural network combined with image processing technology[J]. Transactions of the Chinese Society of Agricultural Engineering (Transactions of the CSAE), 2021, 37(3): 155-163. (in Chinese with English abstract)

[19] 徐建鹏,王杰,徐祥,等. 基于RAdam卷积神经网络的水稻生育期图像识别[J]. 农业工程学报,2021,37(8):143-150.

Xu Jianpeng, Wang Jie, Xu Xiang, et al. Rice growth period image recognition based on RAdam convolutional neural network[J]. Transactions of the Chinese Society of Agricultural Engineering (Transactions of the CSAE), 2021, 37(8): 143-150. (in Chinese with English abstract)

[20] Dos Santos F A, Freitas D M, Da Silva G G, et al. Weed detection in soybean crops using ConvNets[J]. Computers and Electronics in Agriculture, 2017, 143: 314-324.

[21] Potena C, Nardi D, Pretto A. Fast and accurate crop and weed identification with summarized train sets for precision agriculture[C]. International Conference on Intelligent Autonomous Systems. Switzerland: Springer, Cham, 2016: 105-121.

[22] Jiang H, Zhang C, Qiao Y, et al. CNN feature based graph convolutional network for weed and crop recognition in smart farming[J]. Computers and Electronics in Agriculture, 2020, 174: 105450.

[23] Krizhevsky A, Sutskever I, Hinton G E. ImageNet classification with deep convolutional neural networks[J]. Communications of the ACM, 2017, 60(6): 84-90.

[24] 李小占,马本学,喻国威,等. 基于深度学习与图像处理的哈密瓜表面缺陷检测[J]. 农业工程学报,2021,37(1):223-232.

Li Xiaozhan, Ma Benxue, Yu Guowei, et al. Surface defect detection of cantaloupe based on deep learning and image processing[J]. Transactions of the Chinese Society of Agricultural Engineering (Transactions of the CSAE), 2021, 37(1): 223-232. (in Chinese with English abstract)

[25] 王春山,周冀,吴华瑞,等. 改进Multi-scale ResNet的蔬菜叶部病害识别[J]. 农业工程学报,2020,36(20):209-217.

Wang Chunshan, Zhou Ji, Wu Huarui, et al. Improved Multi-scale ResNet for vegetable leaf disease identification[J]. Transactions of the Chinese Society of Agricultural Engineering (Transactions of the CSAE), 2020, 36(20): 209-217. (in Chinese with English abstract)

[26] 彭文,兰玉彬,岳学军,等. 基于深度卷积神经网络的水稻田杂草识别研究[J]. 华南农业大学学报,2020,41(6):75-81.

Peng Wen, Lan Yubin, Yue Xuejun, et al. Research on weed recognition in rice field based on deep convolutional neural network[J]. Journal of South China Agricultural University, 2020, 41(6): 75-81. (in Chinese with English abstract)

[27] 邓向武,马旭,齐龙,等. 基于卷积神经网络与迁移学习的稻田苗期杂草识别[J]. 农机化研究,2021,43(10):167-171.

Deng Xiangwu, Ma Xu, Qi Long, et al. Recognition of weeds in rice seedling stage based on convolutional neural network and transfer learning[J]. Journal of Agricultural Mechanization Research, 2021, 43(10): 167-171. (in Chinese with English abstract)

[28] 徐艳蕾,何润,翟钰婷,等. 基于轻量卷积网络的田间自然环境杂草识别方法[J]. 吉林大学学报:工学版,2021,2:1-10.

Xu Yanlei, He Run, Zhai Yuting, et al. Weed identification method in field natural environment based on lightweight convolutional network[J]. Journal of Jilin University: Engineering Edition, 2021, 2: 1-10. (in Chinese with English abstract)

[29] Huang G, Liu Z, Maaten L, et al. Densely connected convolutional networks[C]. Computer Vision and Pattern Recognition. Hawaii: IEEE, 2017: 4700-4708.

[30] Wang Q, Wu B, Zhu P, et al.ECA-Net: Efficient channel attention for deep convolutional neural networks[C]. Computer Vision and Pattern Recognition, Long Beach: IEEE, 2020: 11534-11542.

[31] Ghiasi G, Lin T Y, Le Q V. Drop Block: A regularization method for convolutional networks[C]. Proceedings of the 32ndInternational Conference on Neural Information Processing Systems. Red Hook, New York: Curran Associates Inc, 2018: 10750-10760.

[32] Alex K, Ilya S, Geoffrey E H. Image net classification with deep convolutional neural networks[J]. Communications of the ACM, 2017, 60(6): 84-90.

Field weed recognition based on improved DenseNet

Zhao Hui, Cao Yuhang, Yue Youjun, Wang Hongjun

(,,,300384,)

Accurate and rapid acquisition of crop and weed category information has been one of the most important steps for automatic weeding operations. In this research, a weed recognition model was proposed using improved DenseNet, particularly for the efficient and accurate identification of weeds in crop fields under complex environments. Firstly, data augmentation was utilized to expand the number of images for the collected crop and weed pictures, thereby increasing the diversity of data, but avoiding network learning irrelevant features, and finally enhancing the recognition ability of the model. Secondly, Efficient Channel Attention (ECA) was introduced into the DenseNet-121 network after each convolutional layer. As such, the accuracy of weed recognition was improved to effectively focus the attention on the weeds in the main part of images, where the weight of important features increased further to strengthen the weed features, but to suppress the extraction of background features. At the same time, DropBlock regularization was also added after each DenseBlock block, further to randomly hide some feature maps and noise. Correspondingly, the generalization, robustness, and adaptability of the model were improved to identify different types of weeds. Finally, taking maize seedlings and six types of associated weeds in natural environments as samples, a comparison test was performed on the test set using VggNet-16, ResNet-50, and the unimproved DenseNet-121 model, where the batch size was 64, and the initial learning rate was 0.01. More importantly, an Stochastic Gradient Descent (SGD) optimizer was used to train the CNN model, and the batch size was set to 64, the initial learning rate was set to 0.01, and the VggNet-16, ResNet-50 and the unimproved DenseNet-121 model was compared and tested on the test set. The results show that the improved DenseNet model presented the best performance, where the model size was 26.55 MB, the single image took 0.23 s, and the average recognition accuracy reached 98.63%, increased by 2.09 percentage points before the improvement. It infers that the overall performance of improved DenseNet-121 was significantly higher than that of VggNet-16 and ResNet-50. Gradient-weighted Class Activation Mapping (Grad-CAM) was also used to visualize the heat map for the subsequent comparison. The improved DenseNet decision was obtained, where the important weight position of classification was more focused on the main part of weeds than before. Specifically, the category judgment probability was 0.99, significantly higher than that of the unimproved model, further verifying the effectiveness of the improved model. Consequently, the DenseNet network with ECA attention and DropBlock regularization can widely be expected to improve the recognition accuracy and the generalization of the model, further to ensure the efficient and accurate recognition of weeds in complex environments. The findings can provide a strong reference for the accurate identification of other crops and associated weeds. The versatility of the model in weed identification can also be improved for the technical development of intelligent weeding robots.

image recognition; convolutional neural network; efficient channel attention mechanism; DropBlock; field weed

赵辉,曹宇航,岳有军,等. 基于改进DenseNet的田间杂草识别[J]. 农业工程学报,2021,37(18):136-142.doi:10.11975/j.issn.1002-6819.2021.18.016 http://www.tcsae.org

Zhao Hui, Cao Yuhang, Yue Youjun, et al. Field weed recognition based on improved DenseNet[J]. Transactions of the Chinese Society of Agricultural Engineering (Transactions of the CSAE), 2021, 37(18): 136-142. (in Chinese with English abstract) doi:10.11975/j.issn.1002-6819.2021.18.016 http://www.tcsae.org

2021-05-17

2021-09-12

天津市科技支撑计划项目(19YFZCSN00360)

赵辉,博士,教授,研究方向为复杂系统智能控制理论及应用、农业信息化与精准农业智能监控理论与技术等。Email:zhaohui3379@126.com

10.11975/j.issn.1002-6819.2021.18.016

TP391.41

A

1002-6819(2021)-18-0136-07

猜你喜欢
除草田间杂草
20220508 水田除草机的研制及对水稻生长、产量和品质的影响试验
玉米除草、追肥 记住这些“黄金时段”
强降雨过后 田间自救指南来了
拔杂草
田间地头“惠”果农
洪洞:立即防除麦田杂草
小麦播种后 除草最佳时间别错过
“码”上办理“田间一件事”
田间地头有了“新绿”
拔掉心中的杂草