欢迎访问《图学学报》 分享到:

图学学报 ›› 2022, Vol. 43 ›› Issue (5): 803-814.DOI: 10.11996/JG.j.2095-302X.2022050803

• 图像处理与计算机视觉 • 上一篇    下一篇

改进 YOLOX 的药品泡罩铝箔表面缺陷 检测方法

  

  1. 1. 华北电力大学控制与计算机工程学院,北京 102206; 

    2. 中国科学院计算技术研究所,北京 100190; 

    3. 太仓中科信息技术研究院,江苏 太仓 215400

  • 出版日期:2022-10-31 发布日期:2022-10-28
  • 基金资助:
    国家自然科学基金项目(61972379);国家重点研发计划课题(2020YFB1710400)

Improved YOLOX method for detecting surface defects of drug blister aluminum foil 

  1. 1. College of Control and Computer Engineering, North China Electric Power University, Beijing 102206, China; 

    2. Institute of Computing Technology, Chinese Academy of Sciences, Beijing 100190, China; 

    3. Taicang Institute of Information Technology, Taicang Jiangsu 215400, China

  • Online:2022-10-31 Published:2022-10-28
  • Supported by:
    National Natural Science Foundation of China (61972379); National Key Research and Development Plan Subject (2020YFB1710400)

摘要:

药品泡罩包装中铝箔表面包含各种字体和图案信息,而且铝箔表面凹凸不平,拍摄中会出现明 暗分布不均的情况,可导致缺陷特征和铝箔表面特征相似度较高。针对 YOLOX 模型无法更加准确区分缺陷特 征和铝箔表面特征的问题,提出一种改进 YOLOX 模型的表面缺陷检测方法。首先,为了使输入到 Prediction 网络的信息更具全局性,需要对 Neck 网络中特征图的全局特征进行分析,于是将 Neck 网络的 CSP 模块替换 成 transformer encoder 模块。同时 YOLOX 模型具有较深的深度,为了有效地提高分类精度,使用 Mish 激活函 数替换 Swish 激活函数。然后针对缺陷特征和铝箔表面特征相似导致缺陷区域和背景区域分类困难的问题,在 损失函数中引入 focal loss。实验结果表明,改进的模型对铝箔表面缺陷检测的 mAP 为 90.17%,比原始的 YOLOX 模型提高了 4.95%,并且改进的模型能够降低和铝箔表面特征相似度较高的缺陷误检和漏检的概率。

关键词: 铝箔表面, 缺陷检测, YOLOX, transformer 编码器, Mish, focal 损失函数

Abstract:

The surface of aluminum foil in drug blister packaging contains various information on fonts and patterns, and the surface of aluminum foil is uneven, leading to the uneven distribution of light and dark. To address the problem that the YOLOX model cannot more accurately distinguish the defect features from the surface features of aluminum foil, a surface defect detection method based on the improved YOLOX model was proposed. Firstly, in order to enhance the globality of the information input to the Prediction, it was necessary to analyze the global features of the feature map in the Neck network, so the CSP module of the Neck network was replaced with the transformer encoder module. At the same time, the YOLOX model has a deep depth, and to effectively improve the classification accuracy, the Mish activation function was utilized to replace the Swish activation function. Then, focal loss was introduced into the loss function to solve the problem of difficulty in classifying defect regions and background regions due to the similarity of defect features and aluminum foil surface features. The experimental results show that the mAP of the improved model for the detection of aluminum foil surface defects was 90.17%, which was 4.95% higher than the original YOLOX model, and that the improved model can reduce the probability of false detection and missed detection of defects with high similarity to the surface features of aluminum foil.

Key words: aluminum foil surface, defect detection, YOLOX, transformer encoder, Mish, focal loss

中图分类号: