欢迎您访问《智慧农业(中英文)》官方网站! English

Smart Agriculture ›› 2023, Vol. 5 ›› Issue (2): 115-125.doi: 10.12133/j.smartag.SA202303011

• 专题--机器视觉与农业智能感知 • 上一篇    下一篇

基于改进残差网络模型的不同部位牦牛肉分类识别方法

朱海鹏1(), 张玉安1(), 李欢欢1, 王建文1, 杨英魁2, 宋仁德3   

  1. 1.青海大学 计算机技术与应用系,青海 西宁 810016
    2.青海大学 畜牧兽医科学院,青海 西宁 810016
    3.青海省玉树州动物疫病预防控制中心,青海 玉树 815000
  • 收稿日期:2023-03-26 出版日期:2023-06-30
  • 基金资助:
    青海省科技计划项目(2020-QY-218);国家现代农业产业技术体系资助(CARS-37)
  • 作者简介:朱海鹏,研究方向为深度学习、智慧畜牧。E-mail:2633866477@qq.com
  • 通信作者: 张玉安,博士,教授,研究方向为进化计算、智慧畜牧。E-mail:2011990029@qhu.edu.cn

Classification and Recognition Method for Yak Meat Parts Based on Improved Residual Network Model

ZHU Haipeng1(), ZHANG Yu'an1(), LI Huanhuan1, WANG Jianwen1, YANG Yingkui2, SONG Rende3   

  1. 1.Department of Computer Technology and Application, Qinghai University, Xining 810016, China
    2.Academy of Animal Husbandry and Veterinary Sciences, Qinghai University, Xining 810016, China
    3.Animal Disease Prevention and Control Center of Yushu Prefecture, Qinghai Province, Yushu 815000, China
  • Received:2023-03-26 Online:2023-06-30

摘要:

[目的/意义] 为实现不同部位牦牛肉快速、准确识别,本研究提出了一种改进的残差网络模型,并开发了一种基于智能手机的牦牛肉部位识别软件。 [方法] 首先对于采集到的牦牛里脊、上脑、腱子、胸肉的原始图像数据集采用数据增强的方式对其进行扩充,共得到的牦牛肉部位图像17,640张;其次,采用在原网络模型残差块之后融入轻量级卷积块注意力模块(Convolutional Block Attention Module,CBAM),以加强对不同部位牦牛肉图像关键细节特征的提取;将原模型最后的全连接层进行改进,以减少后续网络层的连接数,防止出现过拟合,减少识别图像所需的时间;然后,采用不同的学习率、权重衰减系数和优化器来验证对网络收敛速度和准确率的影响;最后,开发了移动端App,将改进后的模型部署到移动端。[结果和讨论]通过消融实验,探究出在CBAM、SENet、NAM、SKNet四种注意力机制模块中,改进效果最好的是CBAM。将改进后的ResNet18_CBAM模型在包含牦牛里脊、上脑、腱子、胸肉4种不同牦牛肉部位的数据集上进行了试验测试,结果表明,改进后的残差网络模型在测试集上的识别准确率为96.31%,比改进前的原网络模型提高了2.88%。在手机端的实际场景测试中,牦牛里脊、上脑、腱子、胸肉的识别准确率分别达到了96.30%、94.92%、98.04%、96.49%。该结果表明,改进后的ResNet18_CBAM模型可在实际应用中识别不同部位牦牛肉且具有良好的结果。 [结论] 本研究成果有助于保障牦牛肉产业的食品质量安全,也为青藏高原地区的牦牛肉产业智能化发展提供技术支撑。

关键词: 图像分类, 注意力机制, 残差网络, 移动端应用, 牦牛肉部位分类, 迁移学习

Abstract:

[Objective] Conducting research on the recognition of yak meat parts can help avoid confusion and substandard parts during the production and sales of yak meat, improve the transparency and traceability of the yak meat industry, and ensure food safety. To achieve fast and accurate recognition of different parts of yak meat, this study proposed an improved residual network model and developed a smartphone based yak meat part recognition software. [Methods] Firstly, the original data set of 1960 yak tenderloin, high rib, shank and brisket were expanded by 8 different data enhancement methods, including horizontal flip, vertical flip, random direction rotation 30°, random direction rotation 120°, random direction rotation 300°, contrast adjustment, saturation adjustment and hue adjustment. After expansion, 17,640 yak meat images of different parts were obtained. The expanded yak meat images of different parts were divided according to the 4:1 ratio, resulting in 14,112 yak meat sample images in the training set and 3528 yak meat sample images in the test set. Secondly, the convolutional block attention module (CBAM) was integrated into each residual block of the original network model to enhance the extraction of key detail features of yak images in different parts. At the same time, introducing this mechanism into the network model could achieve greater accuracy improvement with less computational overhead and fewer parameters. In addition, in the original network model, the full connection layer was directly added after all residual blocks instead of global average pooling and global maximum pooling, which could improve the accuracy of the network model, prevent overfitting, reduce the number of connections in subsequent network layers, accelerate the execution speed of the network model, and reduce the computing time when the mobile phone recognized images. Thirdly, different learning rates, weight attenuation coefficients and optimizers were used to verify the influence of the improved ResNet18_CBAM network model on convergence speed and accuracy. According to the experiments, the stochastic gradient descent (SGD) algorithm was adopted as the optimizer, and when the learning rate was 0.001 and the weight attenuation coefficient was 0, the improved ReaNet18_CBAM network model had the fastest convergence speed and the highest recognition accuracy on different parts of yak data sets. Finally, the PyTorch Mobile module in PyTorch deep learning framework was used to convert the trained ResNet18_CBAM network model into TorchScript model and saved it in *.ptl. Then, the yak part recognition App was developed using the Android Studio development environment, which included two parts: Front-end interface and back-end processing. The front-end of the App uses *.xml for a variety of price control layout, and the back-end used Java language development. Then TorchScript model in *.ptl was used to identify different parts of yak meat. Results and Discussions] In this study, CBAM, SENet, NAM and SKNet, four popular attentional mechanism modules, were integrated into the original ResNet18 network model and compared by ablation experiments. Their recognition accuracy on different parts of yak meat dataset were 96.31%, 94.12%, 92.51% and 93.85%, respectively. The results showed that among CBAM, SENet, NAM and SKNet, the recognition accuracy of ResNet18 CBAM network model was significantly higher than that of the other three attention mechanism modules. Therefore, the CBAM attention mechanism module was chosen as the improvement module of the original network model. The accuracy of the improved ResNet18_CBAM network model in the test set of 4 different parts of yak tenderloin, high rib, shank and brisket was 96.31%, which was 2.88% higher than the original network model. The recognition accuracy of the improved ResNet18_CBAM network model was compared with AlexNet, VGG11, ResNet34 and ResNet18 network models on different parts of yak test set. The improved ResNet18_CBAM network model had the highest accuracy. In order to verify the actual results of the improved ResNet18_CBAM network model on mobile phones, the test conducted in Xining beef and mutton wholesale market. In the actual scenario testing on the mobile end, a total of 54, 59, 51, and 57 yak tenderloin, high rib, shank and brisket samples were collected, respectively. The number of correctly identified samples and the number of incorrectly identified samples were counted respectively. Finally, the recognition accuracy of tenderloin, high rib, shank and brisket of yak reached 96.30%, 94.92%, 98.04% and 96.49%, respectively. The results showed that the improved ResNet18_CBAM network model could be used in practical applications for identifying different parts of yak meat and has achieved good results. [Conclusions] The research results can help ensure the food quality and safety of the yak industry, improve the quality and safety level of the yak industry, improve the yak trade efficiency, reduce the cost, and provide technical support for the intelligent development of the yak industry in the Qinghai-Tibet Plateau region.

Key words: image classification, attention mechanism, residual network, mobile applications, recognition of yak meat parts, transfer learning

中图分类号: