| Quality control of textile products is an important part of the development of related production enterprises.Affected by various uncertain factors,defects may occur in every link of the production process.Defects seriously affect the quality and service life of fabric products,so the surface defect detection of fabric products is very important in product quality control.In the early stage,fabric surface defects were detected by human eyes,but the detection speed was slow.The frequency of false detection and missed inspection was high.It was easily affected by the subjective influence of workers,and the cost was high.Based on the traditional image processing method,the detection speed and effect are better than manual,but the adaptive ability is poor.And the defect detection in the complex background is not good.In recent years,the deep learning method has developed rapidly,and the defect detection algorithm model based on deep learning has been continuously improved.However,in the case of insufficient training samples,the deep defect detection model trained on a large amount of data is limited.This thesis proposes a generative adversarial model based on this problem.A network-based fabric defect detection algorithm.The main work and innovations are as follows:(1)Since fabric defects rarely occur in actual production lines and defect samples are difficult to collect and label,an unsupervised defect detection method based on deep convolutional generative adjunctive network with an encoder component is proposed.Firstly,an encoder is added to the original deep convolutional generative adversarial network to encode the image into a vector,which is fed into the model to reconstruct the original image.Secondly,to adapt to model training,a new adversarial loss function is constructed,which adds reconstruction loss and characteristic loss based on the original adversarial loss function.And a triple constraint loss function is designed.Finally,in the testing phase,the trained model can reconstruct the original image of the positive sample well.But the model cannot perfectly reconstruct the defective image of the negative sample.The reconstructed image is subtracted from the original defect image to obtain a residual image,and the defect area is located by image threshold segmentation.The experiment results show that the fabric defect detection performance of this method is better than that of similar typical models Ano GAN and GANomaly.(2)For fabric defects with complex background,the method based on unsupervised reconstruction is insufficient in detection ability.Based on the supervised idea,this thesis proposes a fabric defect detection algorithm integrating Seg Net and generative adversarial network,using the adversarial idea of generative adversarial network to improve the ability of Seg Net for fabric defect detection.Firstly,Seg Net is used as the network structure of the generative model,and the result of the defect image segmentation is generated by the generative model.Second,an attention module is added to the generator to improve the detection performance of the algorithm.Experiments on two different types of datasets verify the effectiveness of the algorithm for fabric defect detection.(3)Taking advantage of the adversarial training of generative adversarial network,a fabric defect detection algorithm based on U-Net and generative adversarial network is proposed,which improves the performance of fabric defect segmentation based on U-Net’s original segmentation ability.Firstly,the generator uses U-Net as the backbone network to segment defects.With continuous training,the generator can generate segmentation images that are not much different from the real segmentation images.The discriminator is used to determine whether the generated segmentation map or the ground-truth map.Secondly,the designed multi-feature enhancement module and integrated attention module are embedded in the model to improve the feature extraction ability of the generator and the detection sensitivity and accuracy of the algorithm for fabric defects.The experiment results show that compared with other typical detection models,the algorithm has better performance in fabric defect detection. |