To address the issue of low accuracy in detecting fabric defects using lightweight models,a fabric defect detection algorithm based on YOLOv5n was proposed,which combines context enhancement and mixed receptive fields.Firstly,a module of Spatial Pyramid for Lightweight Atrous was designed for the backbone network,and the down-sampling ratio of the backbone network was increased to 64,enhancing contextual information while extracting deeper semantic information to improve the recognition performance of the model;Secondly,a hybrid receptive field fusion module was designed for the neck network to replace the original C3 module for feature fusion,improving the detection accuracy of extreme aspect ratio targets.The experiment shows that the mAP50,Precision,and Recall of this algorithm on the Tianchi fabric dataset have reached 93.1%,91.6%,and 89.1%,respectively.Compared with the original YOLOv5n,it has improved by 4.9%,7.3%,and 5.0%,and the model file size is only 6.28 MB,making it more suitable for the field of fabric defect detection.
关键词
疵点检测/深度学习/YOLOv5n/空间金字塔/感受野融合
Key words
defects detection/deep learning/YOLOv5n/spatial pyramid/receptive field fusion