| It is important for academic and engineering applications to improve the accuracy and efficiency of fabric blemish detection to perfect the blemish detection method and improve the quality of textiles.In order to solve the problem of the shortage of accuracy in the detection of fabric defects with complex patterns,proposing an image reconstruction method for the detection of fabric defects.The core idea is to consider the defect as a damage to the fabric texture,and use the conditional generation adversarial neural network to reconstruct the defective area of the image,so that it can be restored to the normal fabric texture,and then carry out the calculation of the difference between the reconstructed image and the defective image,and the result of the difference is segmented to achieve the purpose of defect detection.In order to solve the problem of poor reconstruction accuracy of defective images due to the weak ability of the convolutional neural network to establish image remote dependencies in the generator,the self-attention mechanism is introduced into the Pix2 pix neural network,and an optimized Pix2 pix neural network model is proposed to solve the problem of poor reconstruction accuracy of defective images.In order to solve the problem that the loss function of Pix2 pix neural network is weak in dealing with image details,the L1 loss function and the improved structural loss function are introduced to construct a loss function for defective image reconstruction,which can solve the problem that the network is weak in tackling image details.In this paper,the Re Net-D model,SDDM-PS model and the optimized Pix2 pix model are compared in an experimental study,in which five different complex patterns of fabric defects are detected respectively.The results show that the optimized Pix2 pix method has higher detection accuracy for defects compared with the Re Net-D model and SDDM-PS model.To address the problem that the self-attentive mechanism cannot capture the position information leading to the lack of accuracy of reconstructed images,the Transformer module is imported into the pix2 pix neural network to explore the influence of the Transformer module on the accuracy of image reconstruction,illustrating the way that the global features of images influence the accuracy of image reconstruction,and proposing the Trans Pix2 pix model.To address the problem that the Transformer module in the Trans Pix2 pix model is weak in processing image details,the L1 loss function and the multiscale structural loss function are introduced,the interconnection between the L1 loss function and the multiscale structural loss function and the accuracy of pattern detail reconstruction is explored,and the loss function for the Trans Pix2 pix model is proposed.Finally,the Trans Pix2 pix model and the improved Pix2 pix model were studied in an experimental comparison,and the results showed that the Trans Pix2 pix model has a certain improvement in detection accuracy but a decrease in detection efficiency. |