| In recent years,product packaging is essential in daily life.Considering environmental protection,people generally use cotton packaging bags,and their quality has attracted more and more attention.Although the current production technology level of cotton packaging has been improved,it is inevitable to have defects such as damage,stains,holes,impurities and thread ends in the production process.At present,the manual selection method is widely used for the detection of cotton packaging defects.Due to long-time work,it is easy to produce fatigue.In this way,there will be missed or even wrong detection,which makes the detection accuracy and efficiency low,and directly affects the quality of cotton packaging.With the continuous development of image recognition technology,using machine learning instead of manual defect detection can overcome the disadvantages of traditional methods and greatly improve the detection efficiency and accuracy of cotton packaging.The main work of this paper is as follows.Build the data set of damage,stain,hole,impurity and thread end.On this basis,expand the data set through data enhancement to lay the foundation for follow-up work.After comparing several filtering methods,the median filter is selected to preprocess the image,and the OTSU threshold method is used to realize defect segmentation.Then,the SVM is trained and tested by using the three eigenvalues entropy,contrast,inverse variance,length,width and duty cycle obtained from the gray level co-occurrence matrix.According to the DS of the same type of sample data,and the DBS of different types of sample data,the IA,B.In this way,the sample data is sorted,and the defect detection is carried out according to the priority of the label.The experimental results show that the improved SVM algorithm achieves good results.Although the detection ability of small target defects needs to be improved,the overall recognition rate of five defects in cotton packaging is more than 80%.In order to improve the detection ability of small target defects in cotton packaging,this paper uses convolutional neural network to detect defects in cotton packaging.By comparing the one-stage algorithm and the two-stage algorithm,it is found that the accuracy of Faster R-CNN algorithm is better than SSD algorithm.Considering the needs of industrial detection accuracy,Faster R-CNN is improved.Aiming at the irregular shape of cotton packaging defects,based on Res Net50,Deformable Convolution Network is introduced,.The feature pyramid structure is introduced to reduce the aliasing phenomenon in the fusion process and better express the underlying structure information and high-level semantic information.Secondly,the ROI is bilinear interpolated to solve the problem of pixel deviation caused by multiple quantization and improve the detection accuracy of small target defects in cotton packaging.The experimental results show that the m AP value of the model trained by the improved Faster R-CNN algorithm reaches 90.14%,which is 7.36%higher than the original algorithm.Therefore,the improved algorithm has great application prospects and advantages in industrial defect detection. |