计算机工程与设计2024,Vol.45Issue(5) :1572-1579.DOI:10.16208/j.issn1000-7024.2024.05.038

改进YOLOv5算法对售药机中药盒检测计数

Improved YOLOv5 algorithm to detect and count medicine boxes in vending machine

李宏生 陈波 钱俊磊 曾凯
计算机工程与设计2024,Vol.45Issue(5) :1572-1579.DOI:10.16208/j.issn1000-7024.2024.05.038

改进YOLOv5算法对售药机中药盒检测计数

Improved YOLOv5 algorithm to detect and count medicine boxes in vending machine

李宏生 1陈波 1钱俊磊 1曾凯1
扫码查看

作者信息

  • 1. 华北理工大学电气工程学院,河北唐山 063210
  • 折叠

摘要

为解决自动售药机中药盒传统机器视觉算法检测正确率低的问题,提出一种改进的YOLOv5-CBE算法.通过Imgaug数据增强方法对现有682张自动售药机拍摄的药品图片数据集进行数据增强,训练前采用Mosaic算法,对数据集裁剪、拼接,生成新的样本图片.在YOLOv5的backbone中嵌入CA机制提升对药盒特征的提取能力;在head层中使用BIFPN结构,实现双向跨尺度连接和加权特征融合;采用EIOU替代CIOU提升算法的收敛速度和检测精度.经过682张数据样本150轮的测试,改进后的YOLOv5-CBE算法平均精度达到了 98.7%,相比于YOLOv5s准确率提高了 3.0%,召回率提高了 2.6%.

Abstract

The traditional machine vision algorithm used in the medicine box of the vending machine leads to low detection accuracy rate.To solve the problem,an improved YOLOv5-CBE algorithm was proposed.Using the Imgaug data enhancement method,data enhancement was performed on the existing 682 drug picture data sets taken by vending machines to add training samples.Before training,the Mosaic algorithm was used to crop and splice the data set pictures to generate new sample pictures.The CA attention mechanism was embedded in the backbone of YOLOv5 to improve the extraction ability of the me-dicine box features.The BIFPN structure was used in the head layer to achieve efficient bidirectional cross-scale connection and weighted feature fusion.The EIOU was used to replace the CIOU to improve the convergence speed and detection accuracy.After 150 rounds of testing on 682 data samples,the average precision of the improved YOLOv5-CBE algorithm reaches 98.7%,which is 3.0%higher than that of YOLOv5s,and 2.6%higher in recall.

关键词

药盒/计数/目标检测/加权双向金字塔/坐标注意力机制/EIOU损失函数/马赛克增强

Key words

pill kit/detection count/object detection/BIFPN/coordinate attention mechanism/EIOU/mosaic

引用本文复制引用

基金项目

河北省省属高等学校基本科研业务费研究基金(JYG2020004)

唐山市科技计划(22130204G)

出版年

2024
计算机工程与设计
中国航天科工集团二院706所

计算机工程与设计

CSTPCD北大核心
影响因子:0.617
ISSN:1000-7024
参考文献量19
段落导航相关论文