目的 针对铝制品表面反光特性导致的检测难点及现有缺陷检测算法精度与效率不足的问题,提出一种基于YOLOv11n模型的高精度铝制品表面缺陷检测算法MEP-Net(Multi-scale enhanced perception network)。方法 首先,该算法提出一种具有多尺度感知和边缘信息增强能力的新型卷积MSEConv(Multi-scale enhanced convolution),将其嵌入C3K2结构中构建C3K2-MSE模块,通过跨层多尺度特征交互,有效提升模型对多尺度目标和细节特征的捕捉能力;其次,设计结合局部与全局注意力分支(Local_Global Attention)的层次注意力融合模块HAFB(Hierarchical attention fusion block),通过层次化的特征处理路径对输入特征进行精细化融合,在保留空间细节特征的同时,利用自适应加权机制增强全局上下文的语义表达能力;然后,利用DWConv和共享参数卷积设计新型检测头P2S-Detect(Packet sharing parameter detect),在确保精度不变的情况,实现模型轻量化;最后,采用MPDIoU损失函数替换CIoU损失函数,加快模型收敛速度,提升目标定位能力。结果 在铝制金属盖缺陷数据集和NEU-DET公开数据集上,MEP-Net的mAP@0.5分别达到97.5%和78.4%,相较原始YOLOv11n基准模型分别提升了2.9%、1.6%。同时在铝质金属盖缺陷数据集上,召回率R提升了1.7%,检测速度达142.6帧/s。结论 MEP-Net在铝质金属盖缺陷检测上兼备高精度与实时性,为金属瓶盖封装质检提供了一种高效可行的技术方案。
Abstract
To address the detection challenges caused by the surface reflection characteristics of aluminum products and the insufficient accuracy and efficiency of existing defect detection algorithms, the work aims to propose a YOLOv11n model based high-precision surface defect detection algorithm for aluminum products, MEP-Net (Multi-scale Enhanced Perception Network). Firstly, the algorithm proposed a novel multi-scale enhanced convolution (MSEConv) with multi-scale perception and edge information enhancement capabilities. This convolution was embedded into the C3K2 structure to construct the C3K2-MSE module. Through cross-layer multi-scale feature interaction, it effectively improved the model's ability to capture multi-scale targets and detailed features. Secondly, a Hierarchical Attention Fusion Block (HAFB) was designed, integrating local and global attention branches (Local_GlobalAttention). This module performed fine-grained feature fusion through hierarchical processing paths, preserving spatial detail features while enhancing the semantic expression of global context via an adaptive weighting mechanism. Then, a new detection head called P2S-Detect (Packet sharing Parameter Detect) was developed with DWConv and shared parameter convolution. This design achieved model lightweighting without compromising accuracy. Finally, the MPDIoU loss function replaced the CIoU loss function, accelerating model convergence and improving target localization accuracy. On the aluminum metal cap defect dataset and the public NEU-DET dataset, MEP-Net achieved mAP@0.5 values of 97.5% and 78.4% respectively, representing improvements of 2.9% and 1.6% compared to the original YOLOv11n baseline model. Meanwhile, on the aluminum metal cap defect dataset, the recall rate R increased by 1.7%, and the detection speed reached 142.6 FPS. MEP-Net demonstrates both high accuracy and real-time performance in aluminum metal cap defect detection, providing an efficient and feasible technical solution for quality inspection in metal bottle cap packaging.
关键词
YOLOv11n /
MSEConv卷积 /
C3K2-MSE /
层次注意力融合模块 /
P2S-Detect
Key words
YOLOv11n /
MSEConv convolution /
C3K2-MSE /
hierarchical attention fusion module /
P2S-Detect
{{custom_sec.title}}
{{custom_sec.title}}
{{custom_sec.content}}
参考文献
[1] LEE S H, KIM D H, KIM T Y, et al.Investigation on Failure Analysis and Optimization of WC-Co Hard Metals after Long-Term Use in a Bottle Cap Forming Machine[J]. International Journal of Refractory Metals and Hard Materials, 2018, 74: 99-106.
[2] 王银丹. 酒瓶盖印刷板印刷缺陷视觉检测系统的研究[D]. 沈阳: 沈阳工业大学, 2019.
WANG Y D.Research on Visual Inspection System for Printing Defects of Wine Cap Printing Plate[D]. Shenyang: Shenyang University of Technology, 2019.
[3] SONG Y H, ZHOU Z Z, LI Q, et al.Intrusion Detection of Foreign Objects in High-Voltage Lines Based on YOLOv4[C]// 2021 6th International Conference on Intelligent Computing and Signal Processing (ICSP). Xi’an, China. IEEE, 2021: 1295-1300.
[4] REN S, HE K, GIRSHICK R, et al.Faster R-CNN: Towards Real-Time Object Detection with Region Proposal Networks[J]. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2016, 39(6): 1137-1149.
[5] LIU W, ANGUELOV D, ERHAN D, et al.Ssd: Single Shot Multibox Detector[C]// European Conference On Computer Vision. Cham: Springer International Publishing, 2016: 21-37.
[6] REDMON J, DIVVALA S, GIRSHICK R, et al.You Only Look Once: Unified, Real-Time Object Detection[C]// 2016 IEEE Conference on Computer Vision and Pattern Recognition (CVPR). Las Vegas, NV, USA. IEEE, 2016: 779-788.
[7] LIN T Y, GOYAL P, GIRSHICK R, et al.Focal Loss for Dense Object Detection[C]// 2017 IEEE International Conference on Computer Vision (ICCV). Venice, Italy. IEEE, 2017: 2999-3007.
[8] 车璇, 朱文忠, 李韬, 等. 基于改进RetinaNet的白酒瓶盖缺陷检测方法[J]. 国外电子测量技术, 2023, 42(4): 173-180.
CHE X, ZHU W Z, LI T, et al.Defect Detection Method of Liquor Bottle Caps Based on Improved RetinaNet[J]. Foreign Electronic Measurement Technology, 2023, 42(4): 173-180.
[9] 金怡君, 李振宇, 杨絮. 基于机器视觉的啤酒金属盖表面缺陷检测方法[J]. 包装工程, 2023, 44(11): 259-267.
JIN Y J, LI Z Y, YANG X.Surface Defect Detection of Beer Metal Covers Based on Machine Vision[J]. Packaging Engineering, 2023, 44(11): 259-267.
[10] 王军, 万书东, 程勇. 基于改进YOLOv5s的白酒瓶盖瑕疵检测[J]. 包装工程, 2024, 45(7): 180-188.
WANG J, WAN S D, CHENG Y.Liquor Bottle Cap Defect Detection Based on Improved YOLOv5s[J]. Packaging Engineering, 2024, 45(7): 180-188.
[11] HWANG H, HADDAD R A.Adaptive Median Filters: New Algorithms and Results[J]. IEEE Transactions on Image Processing, 1995, 4(4): 499-502.
[12] KHANAM R, HUSSAIN M. Yolov11: An Overview of the Key Architectural Enhancements[J]. arXiv preprint arXiv:2410.17725, 2024.
[13] VARGHESE R, M S. YOLOv8: A Novel Object Detection Algorithm with Enhanced Performance and Robustness[C]// 2024 International Conference on Advances in Data Engineering and Intelligent Computing Systems (ADICS). Chennai, India. IEEE, 2024: 1-6.
[14] CHOLLET F.Xception: Deep Learning with Depthwise Separable Convolutions[C]// 2017 IEEE Conference on Computer Vision and Pattern Recognition (CVPR). Honolulu, HI. IEEE, 2017: 1800-1807.
[15] MA S, XU Y.MPDIoU: A Loss for Efficient and Accurate Bounding Box Regression[J]. 2023.DOI:10.48550/arXiv.2307.07662.
[16] DING X H, ZHANG X Y, MA N N, et al.RepVGG: Making VGG-Style ConvNets Great Again[C]// 2021 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR). Nashville, TN, USA. IEEE, 2021: 13728-13737.
[17] HE Y, SONG K C, MENG Q G, et al.An End-to-End Steel Surface Defect Detection Approach via Fusing Multiple Hierarchical Features[J]. IEEE Transactions on Instrumentation and Measurement, 2020, 69(4): 1493-1504.
[18] WANG A, CHEN H, LIU L H, et al. YOLOv10: Real-Time End-to-End Object Detection[EB/OL].2024: arXiv: 2405.14458. https://arxiv.org/abs/2405.14458
[19] TIAN Y, YE Q, DOERMANN D. Yolov12: Attention-Centric Real-Time Object Detectors[J]. arXiv preprint arXiv:2502. 12524, 2025.
[20] ZHAO Y A, LV W Y, XU S L, et al.DETRs Beat YOLOs on Real-Time Object Detection[C]// 2024 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR). Seattle, WA, USA. IEEE, 2024: 16965-16974.
[21] HUANG S H, LU Z C, CUN X D, et al. DEIM: DETR with Improved Matching for Fast Convergence[EB/OL].2024: arXiv: 2412.04234. https://arxiv.org/abs/2412.04234
[22] 张伟健, 徐向英, 章永龙. 改进RT-DETR的钢材表面缺陷检测算法[J/OL]. 机械科学与技术, 2025: 1-9. https://doi.org/10.13433/j.cnki.1003-8728.20250009.
ZHANG W J, XU X Y, ZHANG Y L. RT-DETR Steel Surface Defect Detection Algorithm[J/OL]. Mechanical Science and Technology, 2025: 1-9. https://doi.org/10.13433/j.cnki.1003-8728.20250009.
[23] 沈冰星, 黄洪琼. 基于ESE-YOLO的钢带表面缺陷检测研究[J/OL]. 电子测量与仪器学报, 2025: 1-12 (2025-05-16). https://kns.cnki.net/kcms/detail/11.2488.TN.20250515.1749.002.html.
SHEN B X, HUANG H Q. Study on Surface Defect Detection of Steel Strip Based on ESE-YOLO[J/OL]. Journal of Electronic Measurement and Instrumentation, 2025: 1-12(2025-05-16). https://kns.cnki.net/kcms/detail/11.2488.TN.20250515.1749.002.html.
[24] 梁礼明, 龙鹏威, 李俞霖. 改进轻量高效FMG-YOLOv8s的钢材表面缺陷检测算法[J]. 计算机工程与应用, 2025, 61(3): 84-93.
LIANG L M, LONG P W, LI Y L.Improved Lightweight and Efficient FMG-YOLOv8s Algorithm for Steel Surface Defect Detection[J]. Computer Engineering and Applications, 2025, 61(3): 84-93.
基金
烟台市2023年校地融合发展项目(2323013-2023XDRH001);山东省科技型中小企业创新能力提升工程计划项目(2023TSGC0823);烟台市科技型中小企业创新能力提升工程计划项目(2023TSGC112)