|
基于注意力机制和多尺度特征融合的卷纸包装缺陷检测算法
|
Abstract:
本文针对卷纸包装缺陷检测问题,提出了一种基于注意力机制和多尺度特征融合的卷纸包装缺陷检测算法FYOLOv5。该方法具有以下特点:以轻量级的YOLOv5s模型为骨干网络结构,在特征提取网络引入卷积注意力模块,提升模型对卷纸缺陷关键特征的提取能力。在颈部网络引入自适应空间特征融合模块,提高模型多尺度特征融合能力,使模型对高层的语义信息以及对底层的轮廓、形状和颜色等视觉信息利用更加充分。在检测头部分利用Decouple模块对目标检测任务进行分解,使模型更易优化。最后,使用αIoU损失函数优化当真实框与预测框重合时的IoU计算退化问题。本文采集并标注了卷纸包装缺陷检测数据集,并在该数据集上进行实验。实验结果表明,改进后的检测模型准确率达到了95.3%,高于原始模型2.1%,同时推理速度能够满足卷纸包装的检测需求。
This thesis aims at the problem of paper roll packaging defect detection, and proposes a paper roll packaging defect detection algorithm FYOLOv5 based on attention mechanism and multi-scale fea-ture fusion. This method has the following characteristics: The algorithm uses the lightweight YOLOv5s model as the backbone network structure, introduces the convolutional attention module in the feature extraction network, and enhances the model’s ability to extract key features of paper roll defects. In the neck network, an adaptive spatial feature fusion module is introduced to improve the model’s multi-scale feature fusion ability, making the model use more fully the high-level semantic information and the low-level visual information such as contour, shape and color. In the detection head part, the Decouple module is used to decompose the target detection task, making the model easier to optimize. Finally, the αIoU loss function is used to optimize the IoU calculation degradation problem when the real box and the predicted box overlap. This thesis collects and an-notates a paper roll packaging defect detection dataset, and conducts experiments on this dataset. The experimental results show that the improved detection model has an accuracy of 95.3%, which is 2.1% higher than the original model, and the inference speed can meet the detection requirements of paper roll packaging.
[1] | 钱桂敬. 新形势下我国造纸工业高质量发展面临的挑战[J]. 造纸信息, 2022(2): 18-21. |
[2] | Zhang, X.-W., Ding, Y.-Q., Lv, Y.-Y., Shi, A.-Y. and Liang, R.-Y. (2011) A Vision Inspection System for the Surface Defects of Strongly Reflected Metal Based on Multi-Class. Expert Systems with Applications, 38, 5930-5939.
https://doi.org/10.1016/j.eswa.2010.11.030 |
[3] | Kuang, H., Ding, Y., Li, R. and Liu, X. (2018) Defect Detection of Bamboo Strips Based on LBP and GLCM Features by Using SVM Classifier. 2018 Chinese Control and Decision Conference (CCDC), Shenyang, 9-11 June 2018, 3341-3345.
https://doi.org/10.1109/CCDC.2018.8407701 |
[4] | 刘贺, 马小燕, 张静. 基于数据挖掘技术的牙刷包装缺陷检测方法研究[J]. 佳木斯大学学报(自然科学版), 2020, 38(3): 48-51. |
[5] | 于惠钧, 吴婉, 成运. 改进Otsu算法在铝塑泡罩药品包装缺陷检测中的应用[J]. 包装工程, 2014, 35(15): 15-18. |
[6] | Wang, C.-Y., Liao, H.-Y.M., Wu, Y.-H., et al. (2020) CSPNet: A New Backbone That Can Enhance Learning Capability of CNN. 2020 IEEE/CVF Con-ference on Computer Vision and Pattern Recognition Workshops (CVPRW), Seattle, 14-19 June 2020, 1571-1580. https://doi.org/10.1109/CVPRW50498.2020.00203 |
[7] | Redmon, J. and Farhadi, A. (2018) YOLOv3: An Incre-mental Improvement. ArXiv Preprint ArXiv: 1804.02767. |
[8] | 刘志赢, 谢春思, 李进军, 桑雨. Cascade R-CNN和YOLOv3在导弹目标识别中的应用[J]. 图像与信号处理, 2020, 9(2): 102-110. |
[9] | 曾秀云, 陆华才, 吕禾丰. 基于改进Faster R-CNN的棉布包装缺陷检测的方法研究[J]. 电子测量与仪器学报, 2022, 36(4): 179-186. |
[10] | 李建明, 杨挺, 王惠栋. 基于深度学习的工业自动化包装缺陷检测方法[J]. 包装工程, 2020, 41(7): 175-184. |
[11] | 李志诚, 曾志强. 基于改进YOLOv3的卷纸包装缺陷实时检测算法[J]. 中国造纸学报, 2022, 37(2): 87-93. |
[12] | 曹义亲, 伍铭林, 徐露. 基于改进YOLOv5算法的钢材表面缺陷检测[J]. 图学学报, 2023, 44(2): 335-345. |
[13] | 许思昂, 李艺杰, 梁桥康, 杨彬. 基于改进YOLOv5算法的PCB裸板缺陷检测[J]. 包装工程, 2022, 43(15): 33-41. |
[14] | Woo, S., Park, J., Lee, J.-Y. and Kweon, I.S. (2018) CBAM: Convolutional Block Attention Module. In: Ferrari, V., Hebert, M., Sminchisescu, C. and Weiss, Y., Eds., Computer Vision—ECCV 2018. ECCV 2018. Lecture Notes in Computer Science, Vol. 11211, Springer, Cham, 3-19. https://doi.org/10.1007/978-3-030-01234-2_1 |
[15] | Alzubaidi, L., Zhang, J., Humaidi, A.J., et al. (2021) Review of Deep Learning: Concepts, CNN Architectures, Challenges, Applications, Future Directions. Journal of Big Data, 8, Arti-cle No. 53.
https://doi.org/10.1186/s40537-021-00444-8 |
[16] | Zhu, X., Lyu, S., Wang, X. and Zhao, Q. (2021) TPH-YOLOv5: Improved YOLOv5 Based on Transformer Prediction Head for Object Detection on Drone-Captured Scenarios. 2021 IEEE/CVF International Conference on Computer Vision Workshops (ICCVW), Montreal, 11-17 October 2021, 2778-2788.
https://doi.org/10.1109/ICCVW54120.2021.00312 |
[17] | Liu, S., Huang, D. and Wang, Y. (2019) Learning Spatial Fusion for Single-Shot Object Detection.
ArXiv Preprint ArXiv: 1911.09516. |
[18] | Ge, Z., Liu, S., Wang, F., Li, Z. and Sun, J. (2021) Yolox: Exceeding Yolo Series in 2021.
ArXiv Preprint ArXiv: 2107.08430. |
[19] | He, J., Erfani, S., Ma, X., et al. (2021) Alpha-IoU: A Family of Power Inter-section over Union Losses for Bounding Box Regression. https://arxiv.org/abs/2110.13675 |