Abstract:
For the automation of cigar appearance inspection, a cigar appearance inspection device was developed, and a cigar appearance inspection model based on machine vision technology and deep learning was established. The images of defects of the cylindrical surface of cigars were captured by a test device. The captured images were equilibrated and augmented by random panning and flipping to create a data set. The K-means clustering algorithm was used to generate appropriate anchors for the cigar defect dataset. The YOLOv5 model was trained and verified. The optimal threshold was obtained using the OTSU method to segment the images of loose end cigars. The loose end defect was identified by statistically computing the proportion of tobacco loss from the cigar end. The results showed that: 1) Using the YOLOv5 model to identify the defects of cylindrical surface, the mean average precision (MAP) reached 87.7% and the time for going through a single image was 13.1 ms. The YOLOv5 model featured strong anti-interference and advantages over other models in terms of inspection accuracy and efficiency. 2) The YOLOv5 model was able to accurately identify and locate multi-size, multi-category and densely distributed defects with strong generalization ability and robustness. 3) The loose end defect could be identified under different luminance lighting environments. This method supports the promotion of cigar quality.