计算机与现代化 ›› 2023, Vol. 0 ›› Issue (10): 53-58.doi: 10.3969/j.issn.1006-2475.2023.10.008

• 图像处理 • 上一篇    下一篇

基于NAM-YOLO网络的苹果缺陷检测算法

  

  1. (青岛科技大学自动化与电子工程学院,山东 青岛 266061)
  • 出版日期:2023-10-26 发布日期:2023-10-26
  • 作者简介:张嘉琪(1996—),男,浙江宁波人,硕士研究生,研究方向:模式识别与机器视觉,E-mail: 862557867@qq.com; 通信作者:徐啟蕾(1980—),女,山东青岛人,副教授,博士,研究方向:图像处理,路径规划,E-mail: xuqilei@qust.edu.cn。

Apple Defect Detection Algorithm Based on NAM-YOLO Network

  1. (College of Automation and Electronic Engineering, Qingdao University of Science and Technology, Qingdao 266061, China)
  • Online:2023-10-26 Published:2023-10-26

摘要: 针对苹果缺陷检测经常误检漏检、缺陷易混淆等问题,提出一种基于改进YOLOv5的苹果缺陷检测算法。苹果缺陷检测对苹果分拣至关重要,现有检测苹果缺陷的方法主要是通过机器学习或卷积神经网络提取颜色和纹理特征,存在错误检测、漏检和特征提取能力不足等问题,不能满足缺陷检测精度与实时性的需求。NAM-YOLO算法主要有3个核心思想:1)通过将TRANS模块添加到骨干网络,更好地融合特征与全局信息;2)通过加权双向特征金字塔网络融合不同尺度的特征;3)将基于归一化的注意力机制NAM注意机制引入颈部网络,强化目标区域的关键特征,提高网络的检测精度。实验结果表明,改进算法的mAP达到98.90%,准确度为98.73%。与其他模型相比,该模型具有较好的特征融合能力,可较好地满足苹果分拣的实际需要。

关键词: 关键词:NAM-YOLO, YOLOv5, TRANS, 注意力机制, 缺陷检测

Abstract: Aiming at the problems of apple defect detection, such as frequent false detection, leakage detection and easy confusion of defects, we propose an apple defect detection algorithm based on improved YOLOv5. Apple defect detection is very important for apple sorting. The existing methods of apple defect detection mainly extract color and texture features through machine learning or convolutional neural network, but there are problems such as error detection, missing detection and insufficient feature extraction ability. It can not meet the requirements of accuracy and real-time defect detection. NAM-YOLO algorithm mainly has three core ideas: 1) By adding TRANS module to the backbone network, features and global information can be better integrated; 2) The weighted bidirectional feature pyramid network is used to fuse features of different scales; 3) The NAM attention mechanism based on normalization is introduced into the neck network to strengthen the key features of the target region and improve the detection accuracy of the network. Experimental results show that the mAP of the improved algorithm reaches 98.90% and the accuracy is 98.73%. Compared with other models, this model has better feature fusion ability and can better meet the actual needs of apple sorting.

Key words: Key words: NAM-YOLO, YOLOv5, TRANS, attention mechanism, defect detection

中图分类号: