As a traditional Chinese medicine preparation,oral liquid has become closer to people’s lives in recent years.With the rapid development of the economy,people’s demand for health has gradually increased,and the demand for oral liquid has also increased.In recent years,while people have paid more and more attention to food and drug safety issues,they have also placed higher demands on oral liquid manufacturers.For oral liquid products,the quality of the capping has an important impact on the safety of the liquid,and the capping quality test is urgently needed before the oral liquid products leave the factory.In this paper,the quality inspection of oral hydraulic caps is researched.According to the inspection requirements,a capping quality inspection system based on machine vision is researched and designed.At the same time,the application of deep learning in capping quality inspection is studied.The main research contents of this paper are as follows:(1)In response to the quality inspection requirements of oral hydraulic caps,a mechanical hardware structure for capping quality inspection based on machine vision is designed.This article designs the mechanical structure from three aspects: mechanical transmission design,image acquisition design and rejection design.Finally,the imaging scheme design is introduced,including camera lens selection and light source selection.(2)A detection algorithm based on machine vision is studied for the quality detection of oral hydraulic caps.First introduced the common gland defect features,followed by median filtering for preprocessing,and then designed a method based on row and column search to determine the upper boundary of the Region of interest(ROI),and row and column search based on threshold The method determines the left and right boundaries of the ROI area.Then perform edge extraction,replace the Gaussian filter in the Canny edge algorithm with median filter,and use the improved Canny edge detection operator to extract the edge of the cover image,and then according to the extracted edge image,the surface is scratched,the cover is damaged,and the cover is damaged.Different algorithms are designed to detect defects such as poor gland.Finally,in the defect detection algorithm for poor capping,template matching is used to detect the complete absence of capping defects,and the sum of absolute differences between the template and the image(Sum of Absolute Differences,SAD)is used for detection.)As a similarity measure.(3)For the quality detection of oral hydraulic caps,a detection method based on deep learning is studied.Aiming at the problem that the detection of deep neural networks requires manual annotation of defects,a detection method based on convolutional denoising autoencoder(CDAE)is proposed.This method uses only qualified product images to train the CDAE network.In the inspection process,the defective image is reconstructed into a defect-free image,and then subtracted from the defective image to obtain a residual image containing defect information,thereby realizing the quality inspection of the gland.Then for the choice of loss function in the CDAE network,a structural similarity(Structural SIMilarity,SSIM)is proposed as the loss function of the optimization model.Finally,through a comparative experiment with the VGG16 network,the experimental results show that the method can well identify the capping defect of the oral liquid bottle,with an accuracy rate of95.2%,and has good generalization ability and robustness. |