| In the production of textile industry,surface defects of textiles are very important issues,because these defects can directly affect the quality of the product and market competitiveness.Although traditional manual inspection methods can detect defects,they are time-consuming and labor-intensive,and have problems such as subjectivity and instability.Now,with the development of computer vision technology,more and more automated textile defect detection algorithms are proposed to improve production efficiency and product quality.However,current defect detection algorithms still have some problems,such as limitations in detection accuracy,speed,and hardware configuration,which need to be further addressed to meet the needs of industrial real-time detection.Therefore,this thesis will explore efficient fabric defect detection algorithms by combining the features of visual attention and convolutional neural networks proposed by bio-vision systems.The algorithm can quickly search and locate regions of interest in an image and extract features from them that are suitable for classification and recognition.Compared with traditional detection algorithms,this algorithm can better characterize the semantic information and texture detail features of the image with higher robustness and accuracy.In this thesis,the following three aspects of work are carried out:(1)For the fabric defects of many kinds and different shapes and sizes,and the traditional manual detection of low efficiency and high cost,a fabric defect detection algorithm HEYOLOv5 based on YOLOv5 is proposed.Firstly,the nearest neighbor method is used for upsampling in the YOLOv5 model,which is fast and simple to implement,but prone to information loss.In addition,the sensory field of the feature map is relatively small,so a new upsampling operator is introduced to increase the perceptual field and make full use of the semantic information of the feature map without increasing the number of multiple parameters and the computational effort.Then,a joint attention mechanism is used to suppress redundant features and increase the weight of beneficial features to improve the accuracy of the algorithm.Finally,the global feature extraction module based on the multi-head self-attention mechanism is used to capture the global feature information,suppress the fabric background,and highlight the defective areas from the overall image perspective to enhance the final detection effect.The results show that compared with the original YOLOv5 algorithm,the proposed HE-YOLOv5 algorithm improves the accuracy by 4.2% to 48.9% m AP,and the detection speed is greater than 60 FPS,which can process 68 images per second,basically meeting the industrial realtime requirements.(2)Although HE-YOLOv5 algorithm has a good improvement in detection accuracy,the detection speed is not outstanding compared to other algorithms.There is still a lot of room for improvement,so a high-speed detection algorithm HS-YOLOv5 is proposed.The Faster Net framework is introduced in this algorithm,which can simultaneously reduce redundant computing and memory access,making better use of the equipment on the computational power,thus achieving faster processing speed.The speedup often results in a loss of accuracy,so a new self-attention module is used for the feature concatenation phase,which not only optimizes the inference efficiency of the model,but also reflects the global features through local features and local receptive domains,thus improve the detection effect.In addition,an Alpha-Io U loss function with an adjustable parameter is used to balance the matching degree between the real frame and the predicted frame and evaluate the performance of the target detection model more accurately.Finally,the K-Means++ algorithm is used to optimize the initial anchor frame,so that the calculated anchor frame can be more accurately matched with the defective target to improve the detection performance.Validated on the same dataset as last method,the experimental results show that the HS-YOLOv5 algorithm has a significant improvement in detection speed,which is 35% higher than the HE-YOLOv5 model,reaching 92 FPS,while the detection accuracy is only reduced by 1.5% m AP,which is in line with the original intention of the improvement.(3)Despite the complex and diverse fabric textures,the defect areas are significant compared to the background texture in complex backgrounds.The proposed visual saliency method based on bio-vision system can quickly locate the salient targets,while convolutional neural networks can efficiently characterize texture detail features and high-level semantic information.Therefore,this thesis combines the advantages of both and proposes a visual saliency-based method for fabric defect detection.The method uses VGG-16 as the backbone network,a context-aware feature extraction module,and a local contrast processing module to extract multi-scale low-level features.Then a modified receptive field module with five branches is used to integrate high-level features at different scales and to obtain larger receptive fields.Then an holistic attention module is introduced to make the model focus more on the defect area and effectively suppress unimportant or even interfering information to achieve more accurate fabric defect detection.Finally,the joint loss of boundary Io U loss and crossentropy loss is used to guide the network to learn more detailed information.The validation is carried out on a plain fabric defect dataset with 1600 original images,and the maximum Max F and the minimum MAE values are better than the other seven advanced methods w.r.t.five metrics.And from the visualization results,it can be seen that the method of this thesis not only highlights the defect areas clearly,but also outlines the boundaries of the defects well. |