Research on Fabric Defect Detection Algorithm Based on Improved YOLOv8n Algorithm

Shunqi Mei,Yishan Shi,Heng Gao,Li Tang
DOI: https://doi.org/10.3390/electronics13112009
IF: 2.9
2024-05-22
Electronics
Abstract:In the process of fabric production, various types of defects affect the quality of a fabric. However, due to the wide variety of fabric defects, the complexity of fabric textures, and the concealment of small target defects, current fabric defect detection algorithms suffer from issues such as having a slow detection speed, low detection accuracy, and a low recognition rate of small target defects. Therefore, developing an efficient and accurate fabric defect detection system has become an urgent problem that needs to be addressed in the textile industry. Addressing the aforementioned issues, this paper proposes an improved YOLOv8n-LAW algorithm based on the YOLOv8n algorithm. First, LSKNet attention mechanisms are added to both ends of the C2f module in the backbone network to provide a broader context area, enhancing the algorithm's feature extraction capability. Next, the PAN-FPN structure of the backbone network is replaced by the AFPN structure, so that the different levels of features of the defects are closer to the semantic information in the progressive fusion. Finally, the CIoU loss is replaced with the WIoU v3 loss, allowing the model to dynamically adjust gradient gains based on the features of fabric defects, effectively focusing on distinguishing between defective and non-defective regions. The experimental results show that the improved YOLOv8n-LAW algorithm achieved an accuracy of 97.4% and a detection speed of 46 frames per second, while effectively increasing the recognition rate of small target defects.
engineering, electrical & electronic,computer science, information systems,physics, applied
What problem does this paper attempt to address?
### Problems Addressed by the Paper This paper primarily addresses various defects that occur during the textile production process and proposes an improved YOLOv8n-LAW algorithm to enhance the efficiency and accuracy of fabric defect detection. Specifically, the current fabric defect detection algorithms have the following issues: 1. **Slow detection speed**: Existing fabric defect detection algorithms are slow when processing complex textures. 2. **Low detection accuracy**: The recognition rate for small target defects is not high, leading to many false positives and missed detections. 3. **Insufficient feature extraction capability**: Existing algorithms struggle to effectively capture defect features of different scales and types. To tackle these issues, the paper proposes the YOLOv8n-LAW algorithm, an improvement based on the YOLOv8n algorithm, with the following enhancements to improve fabric defect detection: - Incorporating the LSKNet attention mechanism in the C2f module to enhance feature extraction capability. - Replacing the original PAN-FPN structure with the AFPN structure to optimize multi-scale feature fusion. - Using the WIoU v3 loss function instead of the CIoU loss function to dynamically adjust gradient gain and improve the detection rate of small target defects. Experimental results show that the improved YOLOv8n-LAW algorithm achieves an accuracy of 97.4% in fabric defect detection, with a detection speed of 46 frames per second, and significantly improves the recognition rate of small target defects.