# Real-Time Foreign Object and Production Status Detection of Tobacco Cabinets Based on Deep Learning
###### Abstract  
Visual inspection plays an important role in industrial production and can detect product defects at the production stage to avoid major economic losses. Most factories mainly rely on manual inspection, resulting in low inspection efficiency, high costs, and potential safety hazards. A real-time production status and foreign object detection framework for smoke cabinets based on deep learning is proposed in this paper. Firstly, the tobacco cabinet is tested for foreign objects based on the YOLOX, and if there is a foreign object, all production activities will be immediately stopped to avoid safety and quality problems. Secondly, the production status of tobacco cabinet is judged to determine whether it is in the feeding state by the YOLOX position locating method and canny threshold method. If it is not in the feeding state, then the three states of empty, full, and material status of the tobacco cabinet conveyor belt are judged based on the ResNet-18 image classification network. Utilizing our proposed method, the accuracy of foreign object detection, feeding state detection and the conveyor belt of tobacco cabinet state detection are 99.13%, 96.36% and 95.30%, respectively. The overall detection time was less than 1 s. The experimental results show the effectiveness of our method. It has important practical significance for the safety, well-being and efficient production of cigarette factories. deep learning; foreign object detection; production status detection; tobacco cabinet; cigarette factory +
Footnote †: journal:  
Artificial Intelligence (AI) techniques such as Deep Learning (DL) and Machine Learning (ML) have been applied in many related fields related to object detection and image classification. With the development of object detection, the You Only Look Once (YOLO) series [1; 2; 3; 4; 5; 6] always pursues the best trade-off between speed and accuracy in real-time applications. It plays an important role in facial recognition, industrial visual inspection and other fields. [PERSON] et al. [7] used the YOLOX [6] object detection network to count holly fruits and achieved a superior detection rate and excellent robustness in complex orchard scenarios. [PERSON] et al. [8] improved the YOLOV4 [4] network to detect uneaten feed pellets in real time from underwater images. Compared with the past, the average precision is improved by 27.21%, and the amount of computation is reduced by approximately 30%. [PERSON] et al. [9] improved the YOLOV4 network to detect face mask wearing. The results of the comparisons show that the accuracy of face mask recognition can reach 98.3%, and the frame rate is high at 54.57 FPS. [PERSON] [10] proposed a face detection method based on YOLO [1]. It has stronger robustness and faster detection speed and can ensure higher detection accuracy in complex environments. It can be seen that YOLO object detection has the advantages of high recognition rate and fast recognition speed, and has been widely used in various visual detection tasks. In recent years, object detection and classification have been applied to various fields. [PERSON] [11] uses the LeNet-5 network to recognize handwritten Arabic numerals, which brings significant improvements compared to machine learning classification algorithms. [PERSON] [12] improved the LeNet-5 convolutional neural network for pedestrian detection, which is better than the SA-Fast R-CNN algorithm. [PERSON] [13] improved the LeNet-5 network to analyze and classify the recognizable shapes in the urine sample image. It has wide applicability in the analysis of urine samples. [PERSON] [14] proposed an effective smile detection method based on improved LeNet-5 and Support Vector Machine methods. The accuracy rates of the public MTFL database [15] and GENKI-4K database [16] reached 87.81% and 86.80%. [PERSON] [17] et al. proposed Mask R-CNN, which extended Faster R-CNN by adding a branch for predicting an object mask in parallel with the existing branch for bounding box recognition.