张垚鑫, 朱荣光, 孟令峰, 马蓉, 王世昌, 白宗秀, 崔晓敏. 改进ResNet18网络模型的羊肉部位分类与移动端应用[J]. 农业工程学报, 2021, 37(18): 331-338. DOI: 10.11975/j.issn.1002-6819.2021.18.038
    引用本文: 张垚鑫, 朱荣光, 孟令峰, 马蓉, 王世昌, 白宗秀, 崔晓敏. 改进ResNet18网络模型的羊肉部位分类与移动端应用[J]. 农业工程学报, 2021, 37(18): 331-338. DOI: 10.11975/j.issn.1002-6819.2021.18.038
    Zhang Yaoxin, Zhu Rongguang, Meng Lingfeng, Ma Rong, Wang Shichang, Bai Zongxiu, Cui Xiaomin. Classification of mutton location on the animal using improved ResNet18 network model and mobile application[J]. Transactions of the Chinese Society of Agricultural Engineering (Transactions of the CSAE), 2021, 37(18): 331-338. DOI: 10.11975/j.issn.1002-6819.2021.18.038
    Citation: Zhang Yaoxin, Zhu Rongguang, Meng Lingfeng, Ma Rong, Wang Shichang, Bai Zongxiu, Cui Xiaomin. Classification of mutton location on the animal using improved ResNet18 network model and mobile application[J]. Transactions of the Chinese Society of Agricultural Engineering (Transactions of the CSAE), 2021, 37(18): 331-338. DOI: 10.11975/j.issn.1002-6819.2021.18.038

    改进ResNet18网络模型的羊肉部位分类与移动端应用

    Classification of mutton location on the animal using improved ResNet18 network model and mobile application

    • 摘要: 针对传统图像分类模型泛化性不强、准确率不高以及耗时等问题,该研究构建了一种用于识别不同部位羊肉的改进ResNet18网络模型,并基于智能手机开发了一款可快速识别不同部位羊肉的应用软件。首先,使用数据增强方式对采集到的羊背脊、羊前腿和羊后腿肉的原始手机图像进行数据扩充;其次,在ResNet18网络结构中引入附加角裕度损失函数(ArcFace)作为特征优化层参与训练,通过优化类别的特征以增强不同部位羊肉之间的类内紧度和类间差异,同时将ResNet18网络残差结构中的传统卷积用深度可分离卷积替换以减少网络参数量,提高网络运行速度;再次,探究了不同优化器、学习率和权重衰减系数对网络收敛速度和准确率的影响并确定模型参数;最后,将该网络模型移植到安卓(Android)手机以实现不同部位羊肉的移动端检测。研究结果表明,改进ResNet18网络模型测试集的准确率高达97.92%,相比ResNet18网络模型提高了5.92个百分点;把改进ResNet18网络模型部署到移动端后,每张图片的检测时间约为0.3 s。该研究利用改进ResNet18网络模型结合智能手机图像实现了不同部位羊肉的移动端快速准确分类,为促进羊肉的智能化检测及羊肉市场按质论价提供了技术支持。

       

      Abstract: Abstract: Accurate and timely detection of meat parts has gradually been highly demanding in meat consumption. However, the traditional image classification cannot clearly distinguish the similar color and texture characteristics for different mutton parts under different storage time, particularly with the low generalization and time-consuming. In this study, an improved ResNet18 network model was proposed to classify the different mutton parts, while, the corresponding mobile application software was developed using the optimal model. Firstly, 1 008 mutton images of loin, hind shank, and fore shank under different storage times (0-12 d) were collected, and then 9 types of data-augmentation were used to expand the dataset. After that, 6 000 images were randomly selected from the augmented dataset for modeling, where 80% of the images were used as the training dataset, and the remainder was used as the test dataset. Secondly, Additive Angular Margin Loss (ArcFace) and the depthwise separable convolution were introduced into the ResNet18 network for the improved one. Thirdly, the improved ResNet18 network was trained with the augmented images of different mutton parts. Meanwhile, an evaluation was made to determine the effect of different parameters on the convergence speed and accuracy of improved ResNet18. Optimizers of stochastic gradient descent (SGD) and adaptive moment estimation (Adam), the learning rate of 0.01 and 0.001, weight decay coefficient of 0 and 0.000 5 were adopted for experimental comparison. The optimal classification model was then determined for different mutton parts. Finally, a mobile application software was developed to transplant the TorchScript model that transformed from the improved ResNet18. The results showed that the ArcFace greatly improved the distinguishability of different mutton parts, while the depthwise separable convolution significantly reduced the parameters of the network. Furthermore, the improved ResNet18 network using SGD optimizer presented a higher accuracy and more stable performance than that using the Adam in the test phase. When the learning rate was set to 0.01, the weight decay coefficient was set to 0.000 5, and the SGD optimizer was used to train the improved ResNet18 network, only 25 images of different parts of lamb were classified incorrectly in the 1 200 test sets, where the classification accuracy of the model was 97.92%, while the average classification accuracies of the loin, hind shank, and fore shank were 97.00%, 98.00%, and 98.75%, respectively. Compared with the original, the classification accuracy of the improved ResNet18 was improved by 5.92 percentage points, while the classification accuracies of loin, hind shank, and fore shank were improved by 5.75, 5.50, and 6.50 percentage points, respectively. Compared with the MobileNet model, the classification accuracy of improved ResNet18 was improved by 13.34 percentage points, while the classification accuracies of loin, hind shank, and fore shank were improved by 13.50, 10.75, and 15.75 percentage points, respectively. Moreover, the software using the improved ResNet18 quickly and accurately classified different mutton parts, where the average detection time of each image was about 0.3 s. The finding can provide the technical and theoretical support to improve the level of intelligent detection of meat products for the fair competition of the meat market.

       

    /

    返回文章
    返回