摘要
西红柿的成熟度对于采摘、运输和销售至关重要。针对西红柿需要在特定环境下识别问题,从种植现场拍摄图片来制作数据集,提出了一种基于双维度注意力机制的西红柿成熟度分类方法。首先通过tensorflow搭建卷积神经网络,网络中加入了改进的CBAM(convolutional block attention module)模块提取西红柿的成熟度和所在位置信息,即在通道注意力模块中并行一个共享多层感知器后的平均池化层;然后使用Adam优化器更新参数,此方法不仅缓解了网络中直接加入CBAM模块出现的不稳定问题,而且加快了损失函数的下降速度;最后通过调节学习率并使用混淆矩阵计算验证集的准确率获取最佳模型。实验结果表明,本文所提网络在训练了30个Epoch后损失函数稳定下降,搭建软件测试平台进行测试后得到准确率为99%,单张图片检测时间为1.5 s。检测时间和测试准确率均优于AlexNet网络,Grad-CAM可视化结果显示本文所提网络提取目标信息的效果优于AlexNet网络和改进之前的CBAM模块。本文所提方法适用于任意背景下的瓜果品级分类。
The ripeness of tomatoes is crucial for harvesting,transportation and marketing.To address the problem that tomatoes need to be identified in specific environments,a dataset was produced by taking pictures from planting sites and a tomato ripeness classification method based on a two-dimensional attention mechanism was proposed.Firstly,through the construction of a convolutional neural network(CNN)based on TensorFlow,an improved CBAM(convolutional block attention module)module to capture the information of maturity and location was added into the network.That is,an average-pooling layer sharing multi-layer perceptron was paralleling in the channel attention module,Secondly,Adam optimizer was employed to update the parameters,which not only mitigated the instability caused by the direct introduction of CBAM module into the network,but also accelerated the dropping speed of loss function.Finally,an optimal model was obtained through the adjustment of learning rate and the employment of confusion matrix to calculate the accuracy rate of the validation set.The experimental results show that the loss function of the proposed network decreases steadily after training 30 epochs,and the accuracy of the proposed network is 99%after building a software test platform for testing,and the detection time of a single image is 1.5 s.The testing time and testing accuracy rate are both better than those of the AlexNet network.The visualization results of Grad-CAM show that the target information capturing effect of the mentioned network in the literature surpasses those of the AlexNet network and the CBAM module before improvement.The proposed method is suitable for melon grade classification in any context.
作者
赵立新
白银光
何春燕
张程
李雅婧
赵树国
ZHAO Li-xin;BAI Yin-guang;HE Chun-yan;ZHANG Cheng;LI Ya-jing;ZHAO Shu-guo(School of Mechanical and Equipment Engineering,Hebei University of Engineering,Handan 056000,China;Mechanical and Electronic Engineering Department,Handan Polytechnic College,Handan 056000,China)
出处
《科学技术与工程》
北大核心
2023年第11期4571-4578,共8页
Science Technology and Engineering
基金
河北省重点研发计划(19211008D)。
关键词
神经网络
西红柿
注意力
学习率
neural network
tomato
attention
learning rate
作者简介
第一作者:赵立新(1969-),男,汉族,河北邯郸人,博士,教授。研究方向:农业机械自动化、永磁材料。E-mail:zhaolx1120@126.com;通信作者:赵树国(1978-),男,汉族,河北邯郸人,硕士,副教授。研究方向:机械工程。E-mail:1259578713@qq.com。