Image generation is an important way to enhance image data,and the research of defective cloth image generation is of great significance to expand the dataset of cloth defect automatic detection model in industrial production.The existing image generation mainly includes two ways: encoding-decoding models and Generate adversarial networks(Generative Adversarial Networks,GAN)-based models,which have been able to generate a variety of clear and high-quality images.Partial convolutional networks,as a typical encoding-decoding model,can produce high-quality images like Big GAN,but when Big GAN generates a defective cloth image,the defective part will have unclear texture and cannot control the location of the defect generation.Therefore,this paper proposes an EC-PConv algorithm for generating defective cloth images with defect location information based on improved partial convolutional networks.Due to the blurring of images during acquisition,this paper proposes a de-blurring algorithm for defective cloth images that fuse spatial attention mechanism,multi-scale channel attention and Deblur GAN-v2 for the preprocessing of defective cloth images.The research content and work of this article include:(1)Aiming at the problem of blurring during the acquisition of defective cloth images,this paper proposes SDBGAN,a de-blur algorithm for defective cloth images that combines spatial attention mechanism,multi-scale channel attention and Deblur GAN-v2 network.The algorithm adds a spatial attention mechanism on the basis of the generator,which can better extract the blurred defective cloth image features by calculating the relationship between the defective cloth image features;adds a multi-scale channel attention subsystem on the basis of the discriminator to help the discriminant network extract and compare the main features of the defective image;finally,the generator and discriminator are trained against each other to generate high-quality deblurring image of defective cloth.The Peak Signal-to-Noise Ratio(PSNR)and Structure Similarity Index Measure(SSIM)of SDBGAN have been improved,respectively 0.32 db and 0.007,which were declared by the experiments with better deblurring effect.(2)In response to the problem that when Big GAN generates defective cloth images,the texture of the defective part is not clear and the position of the defect is not controlled,this paper proposes the defective cloth image generation algorithm EC-PConv based on the improved partial convolutional network with defect location information.The algorithm introduces a small size defect feature extraction network,stitches the small size defect texture feature and the blank mask into a mask with position information and defect texture features,and then generates a defective cloth image with defect location information in a repaired manner,this paper also proposes a hybrid loss function that combines mean squared error(Mean Squared Error,MSE)losses to produce sharper artifact textures.It can be seen from the results of the experiments,compared with Big GAN,the Structure Similarity Index Measure(FID)value of EC-PConv is reduced by 0.05;the precision(P)and Mean Average Precision(MAP)values of the generated defective cloth image in the cloth defect detection model are increased by 0.118 and 0.116,respectively,indicating that the algorithm EC-PConv is effective in generating defective cloth.The image generation is more stable than other algorithm,and can generate higher-quality defective cloth images with defect location information.(3)The image enhancement system for defective cloth is designed and implemented.The system mainly consists of four functions: user registration/login,user management,deblurring of defective cloth images,and generation of defective cloth images with defect location information.The deblurring function uses the SDBGAN algorithm which was proposed in this paper,and the generation function is developed based on the EC-PConv algorithm,the system can better solve the problem of lack of data sets in the training of the automatic detection model of cloth defects in industrial production... |