目的 针对目前编织袋缺陷检测算法目标检测精度低,漏检及误检率高的问题,提出了基于改进YOLOv8的编织袋缺陷检测方法。方法 首先,设计了DMA-CBAM注意力机制,该机制采用双池化结构增强通道特征,从而降低背景纹理干扰。同时,结合自适应特征融合策略,强化模型对多尺度缺陷的感知能力。其次,引入四检测头的特征网络金字塔结构,通过跨层级的信息融合,减少小目标在特征传递过程中的信息丢失。最后,结合Inner-Shape思想对原损失函数进行改进,提升边界框对缺陷的拟合精度与收敛速度。结果 该算法能够有效识别划痕、破洞、污渍类缺陷,相比基准模型,检测的精确率提高11.4%,召回率提高5.7%,mAP@0.5和mAP@0.5-0.95分别达到94.0%和66.9%,检测速度达到65.6 fps。结论 该方法显著降低了编织袋缺陷的漏检、误检问题,对提升包装行业缺陷检测水平和产品质量控制具有重要意义。
Abstract
The work aims to propose a woven bag defect detection method based on an improved YOLOv8 to address the issues of low object detection accuracy, high missed detection, and false detection rates in current woven bag defect detection algorithms. Firstly, a DMA-CBAM attention mechanism was designed, which enhanced channel features through dual pooling, effectively suppressing background texture interference. At the same time, it integrated adaptive multi-scale spatial feature fusion to strengthen the model's perception capability for defects of multiple scales. Secondly, a feature network pyramid structure with four detection heads was introduced. By fusing information across layers, it reduced information loss of small targets during feature transmission. Finally, the original loss function was improved by incorporating the Inner-Shape concept to enhance the bounding box's fitting accuracy and convergence speed for defects. Experimental results showed that the algorithm could effectively identify defects such as scratches, holes, and stains. Compared with the baseline model, the detection precision increased by 11.4%, recall increased by 5.7%, mAP@0.5 and mAP@0.5-0.95 reached 94.0% and 66.9%, respectively, and the detection speed reached 65.6 fps. In conclusion, this method significantly reduces the problems of missed and false detection in woven bag defects, and it is of great significance for improving defect detection levels and product quality control in the woven bag industry.
关键词
编织袋 /
YOLOv8 /
并行卷积 /
AFPN /
损失函数
Key words
woven bags /
YOLOv8 /
parallel convolution /
AFPN /
loss function
中图分类号:
TB487
TP391.4
TB48
{{custom_sec.title}}
{{custom_sec.title}}
{{custom_sec.content}}
参考文献
[1] WULANDARI T, FAWCETT D, MAJUMDER B S, et al.Lithium-Based Batteries, History, Current Status, Challenges, and Future Perspectives[J]. Battery Energy, 2023, 2(6).
[2] 杨李平, 吴静静, 张一鸣. 基于边缘增强和注意力机制的晶圆表面微弱缺陷检测[J]. 激光与光电子学进展, 2026, 63(08): 311-322.
YANG L P, WU J J, ZHANG Y M.Weak Defect Detection on Wafer Surfaces Based on Edge Enhancement and Attention Mechanism[J]. Laser & Optoelectronics Progress, 2026, 63(8): 311-322.
[3] 白先浪, 张群利, 辛志强. 融合注意力机制和加权双向特征网络的皮革包装缺陷检测方法[J]. 包装工程, 2025, 46(17): 232-242.
BAI X L, ZHANG Q L, XIN Z Q.Leather Packaging Defect Detection Method Integrating Attention Mechanisms and Weighted Bidirectional Feature Network[J]. Packaging Engineering, 2025, 46(17): 232-242.
[4] 钟飞, 赵子丹, 夏军勇, 等. 基于机器视觉的编织袋表面缺陷检测系统设计与实现[J]. 包装工程, 2022, 43(13): 247-256.
ZHONG F, ZHAO Z D, XIA J Y, et al.Design and Implementation of Woven Bag Surface Defect Detection System Based on Machine Vision[J]. Packaging Engineering, 2022, 43(13): 247-256.
[5] 迟欢. 基于机器视觉的编织袋缺陷在线检测方法[J]. 激光与光电子学进展, 2020, 57(20): 320-327.
CHI H.Online Detection Method of Woven Bag Defects Based on Machine Vision[J]. Laser & Optoelectronics Progress, 2020, 57(20): 320-327.
[6] 张启哲, 彭国政, 谈元鹏, 等. 基于改进YOLOv5网络的输电线路缺陷检测方法研究[J/OL]. 电力信息与通信技术, 1-8.
ZHANG Q Z, PENG G Z, TAN Y P, et al.Research on Defect Detection Method for Transmission Lines Based on Improved YOLOv5[J/OL]. Electric Power Information and Communication Technology, 1-8.
[7] 罗鑫, 李加强, 何超. 基于改进YOLOv4的澳洲坚果视觉监测方法[J]. 中国农机化学报, 2024, 45(5): 217-222.
LUO X, LI J Q, HE C.A Visual Monitoring Method for Macadamia Nuts Based on Improved YOLOv4[J]. Journal of Chinese Agricultural Mechanization, 2024, 45(5): 217-222.
[8] LIU Z, ZHANG Y, CAI J, et al.A CBAM-Enhanced U-Net Model for Predicting Acoustic Transmission Loss under Internal Solitary Waves[J]. Ocean Engineering, 2026, 360: 126131.
[9] SARIHADDU K C, RAAZA A, LODHA S, et al.Cognitive-Workload Detection through Superlet Transform for 2D-EEG and MLP Mixer[J]. Arabian Journal for Science and Engineering, 2026, (prepublish): 1-12.
[10] LIU Y, YAN Z, MA Z, et al.Enhancing Multi-Scale Feature Fusion in YOLOv5 with ASFF and SimAM for Robust Defect Detection[J]. Journal of Big Data and Computing, 2025, 3(2).
[11] 彭有有, 李维刚, 胡佳琪. 基于DMI-YOLO算法的带钢表面缺陷检测[J]. 钢铁研究学报, 2026, 38(3): 373-383.
PENG Y Y, LI W G, HU J Q.Strip Steel Surface Defect Detection Based on DMI-YOLO Algorithm[J]. Journal of Iron and Steel Research, 2026, 38(03): 373-383.
[12] HE M, CHEN S, TONG J, et al.Optimization of a Hybrid Microplastic Model Method Based on Grad-CAM Combined with Convolutional Neural Networks[J]. Spectrochimica Acta Part A, Molecular and Biomolecular Spectroscopy, 2026, 36: 1128060.
[13] LIANG Y H, SHEN L S, ZHOU A.ECA-Enhanced YOLO Integrated with SAHI for Multi-Defect Inspection of Tunnel Linings[J]. Tunnelling and Underground Space Technology Incorporating Trenchless Technology Research, 2026, 174: 107705.
[14] WANG H L, ZHANG Y L, ZHU C.DAFPN-YOLO: An Improved UAV-Based Object Detection Algorithm Based on YOLOv8s[J]. Computers, Materials & Continua, 2025, 83(2): 1929-1949.
[15] SONG F, BAO K, DENG M, et al.Steel Surface Defect Detection Based on PSO-Gabor and an Improved Faster RCNN[J]. Nondestructive Testing and Evaluation, 2026, 41(5): 2607-2630.
[16] 郑新科, 钮焱, 李军. 基于改进SSD的遥感目标检测算法[J]. 计算机应用与软件, 2025, 42(12): 289-296.
ZHENG X K, NIU Y, LI J.Remote Sensing Target Detection Algorithm Based on Improved SSD[J]. Computer Applications and Software, 2025, 42(12): 289-296.
基金
河北省高等学校科学研究项目(CXY2024044)