Research on Fabric Defect Detection Algorithm Based on Lightweight YOLOv7-Tiny
Tang Li,Mei Shunqi,Shi Yishan,Zhou Shi,Zheng Quan,Hongkai Jiang,Xu Qiao,Zhang Zhiming
DOI: https://doi.org/10.1080/15440478.2024.2352753
2024-06-14
Journal of Natural Fibers
Abstract:The current advanced neural network models are expanding in size and complexity to achieve improved detection accuracy. This study designs a lightweight fabric defect detection algorithm based on YOLOv7-tiny, called YOLOv7-tiny-MGCK. Its objectives are to improve the performance of fabric defect detection against complex backgrounds and to find a balance between the algorithm's lightweight nature and its accuracy. The algorithm utilizes the Mish activation function, known for its superior nonlinear performance capability and smoother curve, enabling the neural network to manage more complex challenges. The Ghost convolution module is also incorporated to reduce computation and model parameters. The lightweight upsampling technique CARAFE facilitates the flexible extraction of deep features, coupled with their integration with shallow features. In addition, an improved K-Means clustering algorithm, KMMP, is employed to select appropriate anchor box for fabric defects. The experimental results show: a reduction in the number of parameters by 45.5% and computational volume by 41.0%, along with increases in precision by 3.9%, recall by 7.0%, and mAP by 3.0%. These results indicated that the improved algorithm achieves a more effective balance between detection performance and the requirement for a lightweight solution. 目前先进的神经网络模型在规模和复杂度上都在扩展,以提高检测精度. 本研究设计了一种基于YOLOv7-tiny 的轻量级织物缺陷检测算法,称为YOLOv7-tiny-MGCK.其目标是提高织物缺陷检测在复杂背景下的性能,并在算法的轻量级和准确性之间找到平衡. 该算法利用了Mish激活函数,该函数以其卓越的非线性性能和更平滑的曲线而闻名,使神经网络能够应对更复杂的挑战. 还加入了鬼卷积模块,以减少计算和模型参数. 轻量级的上采样技术CARAFE有助于灵活提取深层特征,并将其与浅层特征相结合. 此外,还采用改进的K-Means聚类算法KMMP来选择合适的锚盒来解决织物缺陷. 实验结果表明:参数数量减少了45.5%,计算量减少了41.0%,精度提高了3.9%,召回率提高了7.0%,mAP提高了3.0%. 这些结果表明,改进的算法在检测性能和对轻量级解决方案的要求之间实现了更有效的平衡.
materials science, textiles