English

Journal of Chinese Agricultural Mechanization

Journal of Chinese Agricultural Mechanization ›› 2024, Vol. 45 ›› Issue (4): 237-243.DOI: 10.13733/j.jcam.issn.2095-5553.2024.04.034

Previous Articles     Next Articles

A method for detecting quality and defects in raw coffee beans based on improved ResNet50 model

Ji Yuanhao1, Xu Jinpu1, Yan Beibei1, Xue Junlong2   

  • Online:2024-04-15 Published:2024-04-28

基于改进ResNet50模型的咖啡生豆质量和缺陷检测方法

纪元浩1,许金普1,严蓓蓓1,薛俊龙2   

  • 基金资助:
    山东省重大科技创新工程(2021LZGC014—3);青岛农业大学研究生创新计划项目(QNYCX22038)

Abstract: The quality of raw coffee beans determines the price of commercial coffee beans. Currently, the screening of raw coffee beans is mainly done manually, which is timeconsuming and laborious.  This paper proposes a method to identify raw coffee beans based on an improved ResNet50 model. Firstly, 8 000 images of raw coffee beans were collected to build a dataset and data enhancement was applied to it. A ResNet50CBAMDW model for coffee bean classification recognition was constructed based on the ResNet50 model by adding a CBAM attention mechanism, by introducing a migration learning mechanism and using deep separable convolution instead of the conventional convolution in the ResNet50 residual unit. In order to evaluate the effectiveness of the model improvement, the accuracy of the improved model was compared with ResNet50, AlexNet, VGG16, MobileNetV2 and other models, and the accuracy of the improved model reached 91.1%, which improved 3.0% compared with the original ResNet50 model and reduced the number of parameters by 39.0%.

Key words: residual networks, coffee beans, attention mechanism, convolutional neural networks, deep separable convolution

摘要: 咖啡生豆的质量决定着商品咖啡豆的价格,目前对咖啡生豆的筛选主要由人工完成,费时费力。提出一种基于改进ResNet50模型来识别咖啡生豆的方法,首先收集8 000张咖啡生豆图像建立数据集,并对其进行数据增强,基于ResNet50模型加入CBAM注意力机制,引入迁移学习机制,并使用深度可分离卷积来代替ResNet50残差单元中的传统卷积,构建适用于咖啡生豆分类识别的ResNet50CBAMDW模型。为评估模型改进的有效性,与ResNet50、AlexNet、VGG16、MobileNetV2等模型进行比较,改进后模型准确率达到91.1%,相较于原ResNet50模型准确率提升3.0%,参数量降低39.0%。

关键词: 残差网络, 咖啡豆, 注意力机制, 卷积神经网络, 深度可分离卷积 

CLC Number: