China is a major consumer of cotton,and as the largest cotton producing area in China,Xinjiang’s cotton production and quality play a crucial role in the processing,production,and development of China’s cotton textile industry.In recent years,with the large-scale promotion of the machine picking cotton model,a large amount of foreign fibers such as cotton leaves and cotton stems have been mixed into the raw cotton,resulting in a variety of impurities in the raw cotton.How to quickly and effectively detect impurities in the raw cotton,and then remove them,is currently the primary problem.This study selects raw cotton impurity images as the research object and proposes a raw cotton impurity detection algorithm based on YOLOv5 and U-Net++models.By collecting raw cotton foreign fiber images,the detection of foreign fiber targets is achieved.The specific content and results of the study are as follows:(1)Establish an image acquisition system and collect images of raw cotton fibers.According to the technical specifications of actual production,a cotton fiber image acquisition system was designed,and the internal CCD camera,light source,lens,and other main equipment of the system were selected.The cotton layer width was determined to be 178.24 mm,and the lens distance to the cotton layer was 440 mm to obtain raw cotton fiber images.A total of 2787 images of 8 types of cotton impurities were collected,including cotton leaves,cotton stems,dead cotton,hair,white paper,cotton thread,woven bags,and iron wire.The collected raw cotton fiber images were enhanced to obtain 16709 raw cotton fiber images,which were divided into the target detection dataset PD-Dataset and the image segmentation dataset CRACK200.(2)Propose improvements to YOLOv5 and U-Net++models.According to the characteristics of different fibers,add convolutional attention in YOOv5 network structure,improve the size of K-means clustering anchor frame,and use GIo U Loss as loss function to detect different fibers.In the YOLOv5 model,the detection accuracy of block shaped and pseudo shaped fibers reached 98.80%,while the accuracy of strip shaped fibers was below 80%,indicating that the improved YOLOv5 can detect block shaped fibers and has good detection performance.In response to the issues of false detection,missed detection,and low accuracy of cotton fibers in strips,a U-Net++model with convolutional attention was introduced to detect the strips,with an accuracy rate of 96.22%.(3)Propose YOLOv5 and U-Net++models.Firstly,input the target detection dataset into the YOLOv5 model for detection,and then use images with a confidence level of less than 90% for foreign fiber detection as input data for detection in the U-Net++model.Finally,YOLOv5-U-Net++was optimized and improved,and the YOLOv5-U-Net++cotton foreign fiber detection model can effectively identify various foreign fibers.The experimental results show that the improved model has an accuracy of 98.80%,m AP@0.5 The value is 97.70%,with fast convergence speed and small error,effectively improving the resolution ability for cotton background and foreign fibers.In summary,the improved YOLOv5-U-Net++model has high detection accuracy and is more suitable for cotton fiber detection tasks. |