Abstract:In recent years, there has been an increasing demand for higher quality cigarette pack packaging. While modern production has significantly increased the speed of cigarette box production and made production equipment more intelligent, surface quality inspection of cigarette boxes still relies on manual methods. Addressing the issues of human error such as missed or incorrect detections in surface defect inspection, a cigarette box defect detection algorithm based on improved YOLOv8 is proposed. Firstly, a Gather-and-Distribute mechanism is introduced into the neck network of YOLOv8 to enhance the model′s fusion capability for information across different hierarchies. Secondly, a scale sequence feature fusion module is incorporated to strengthen the network′s ability to extract information from different scales. Finally, the head network of YOLOv8 is replaced with the Decoder of RT-DETR, eliminating the need for complex post-processing steps such as Non-Maximum Suppression, thereby simplifying the detection process and improving efficiency. Experimental results show that the improved algorithm model achieves a detection accuracy of 94.6% and a detection speed of 121.4 FPS on a self-made cigarette box defect dataset compared to YOLOv8. Moreover, compared with other object detection algorithms, the improved algorithm has certain advantages in terms of detection accuracy and speed, making it more suitable for application in cigarette factories for surface quality inspection of cigarette boxes.