| The automatic detection of product defects to replace manual visual inspection is significant to realize the automation and intelligence of injection molding.The existing defect automatic detection algorithms have shortcomings such as weak anti-interference ability,low detection accuracy,and poor real-time performance.Based on machine vision and artificial intelligence technology,this paper carried out research on the online defect detection algorithms of injection molding products,and developed an online defect detection prototype system.The main research works are as follows:(1)A data augmentation algorithm based on the combination of space domain transformation and frequency domain transformation was proposed to solve the problem of difficulty in product collection and lack of defect samples,improving the anti-interference ability of deep learning defect detection models.The product images collected under various environmental interference were synthesized using space domain transformation method to reduce the data distribution deviation of image samples in the dataset.A feature augmentation algorithm based on frequency domain image transform was further proposed to remove redundant data features in image samples to improve the generalization performance of the models.Compared with the models trained on small datasets,the average accuracy of defect detection was improved by 5.5% under the interference of injection production line such as illumination,blur,and noise.(2)Aiming at the training problem of class imbalance caused by more normal products than defective products,a multi-scale convolution neural network model and a two-stage transfer learning training strategy were proposed to improve the accuracy of local defect detection.The convolutional neural network model with multi-scale image feature extraction branch was proposed to improve the representation and discrimination capabilities of image features.In addition,a two-stage transfer learning strategy was proposed to change the sample distribution during model training and solve the problem of class imbalance.Compared with the resampling method and the cost-sensitive loss method,the detection accuracy of four typical local defects,such as bad gate,burr,pinhole,and pit,was improved by 2.8% to 10.5%.(3)A defect region extraction algorithm based on an image generation network model and image subtraction method was proposed to eliminate the inference of complex texture background in product images,resulting in detection accuracy improvement of subtle global defects.An image generation network based on a convolutional autoencoder was proposed to reconstruct clear and complete texture background of product images.The image subtraction method was further used to eliminate the interference of complex textures in the extraction of defect regions,improving the accuracy of global defect segmentation and detection.The average detection recall-rate and average detection precision of black spot defect of an injection molding products reached 99.8% and 98.3% respectively,which increased by 2.8% and 1.3% respectively compared with Faster RCNN model.(4)A defect detection model acceleration method based on lightweight model design and model compression algorithm was proposed to improve the real-time performance,meeting the needs of on-line detection.According to the characteristics of complex defect detection models,structure optimization and parameter reduction methods were proposed to design lightweight models.Then,the image features of original models were compressed into the lightweight models through the proposed model compression algorithm,so that the models could meet the detection accuracy and real-time performance at the same time.When the detection accuracy was maintained at 99%,the calculation time of the defect detection model could be shortened by 66 times.Based on the above research,an online detection prototype system for appearance defects of injection molding products was developed.The enterprise case showed that the average accuracy of various defects detection of 6000 products was 99.4%,and the detection time was 50ms~500ms,which met the requirements of detection accuracy and real-time performance of injection molding products. |