# Deep Learning-Based Method for Accurate Real-Time Seed Detection in Glass Bottle Manufacturing
## 6 Conclusions  
This paper presents a new system capable of detecting bubbles (named seeds) of 0.1 mm\({}^{2}\) size in glass bottles in their manufacturing process 24 h per day and 7 days per week. These seeds are considered blisters if their dimensions in width or height exceeds 1 mm. The identification of seeds and their dimensions is relevant to control the quality of the process in relation to the quality of the bottle for further filling with liquid, for both aesthetic and quality-related reasons. There are two KPI in the process; the number of seeds per kilo, and the number of blisters per ton, which are relevant to regulate the temperature of the furnace and the process itself.  
The bottles are of different sizes, shapes and colors, and they move over the conveyor belt at 50 m/min at a production rate of 250 bottles/min. The detection of the seeds requires a system that processes in real time and that must be fully synchronized with the manufacturing line and its control system.  
The system we propose in this paper has met all these criteria. The acquisition of the images is made by means of a high-speed linear camera that has been synchronized with the manufacturing line through a line encoder that indicates the conveyor speed, and a photo sensor that activates whenever a bottle passes in front of the camera, and thus the acquisition starts. The images are processes by means of the new proposed method that includes deep learning-based artificial intelligence techniques and the classical image processing approach. The algorithm comprises three stages.  
First, the bottle is identified in the input image to only work in the relevant Region Of Interest (ROI) and to discard the other possible areas of adjacent bottles that might appear in the image. Next, an algorithm based in thresholding and morphological operations is applied over this ROI to locate potential candidates for seeds. This stage usually detects more candidates than real seeds. This is due to the fact that there may appear stains, joints and marks in the surface of the bottles that look very similar to seeds, regarding size, shape and pixel values. Therefore, it is very difficult to distinguish real seeds from these stains and marks, which would be identified as false positives if a third stage is not executed. Finally, a deep learning-based model has been developed that can classify with high accuracy whether the proposed candidates are real seeds or not. The method manages to filter out most of false positives due to stains and others in the glass surface, and at the same time, no real seeds are lost. The F1 achieved is 0.97, which is considered to be more than acceptable by the Vidrala quality team.  
The proposed method reveals the advantages of the application of deep learning techniques to problems where the classical image processing algorithms are not enough because of the difficulty in finding meaningful features that help distinguish two classes that are really similar, as it is the case with seeds vs. greasy stains.  
The processing method has been embedded in a C environment and it can perform 24/7 in real time at a speed of 50 m/min, with a production rate of 250 bottles/min. It inspects 100% of the production.  
A.B.-P.: Conceptualization, Formal analysis, Investigation, Software, Writing--original draft. G.D.: Investigation, Software, Writing--review & editing. J.E.: Conceptualization, Investigation, Methodology, Writing--review & editing. F.J.G.: Conceptualization, Investigation. A.S.: Conceptualization, Investigation. L.I.: Conceptualization, Formal analysis, Methodology, Investigation, Writing--review & editing. All authors have read and agreed to the published version of the manuscript. This work was partially supported by OPENZDM project. This is a project from _the European Union's Horizon Europe_ research and innovation programme under Grant Agreement No. 101058673 in the call HORIZON-CL4-2021-TWIN-TRANSITION-01.  
Not applicable.  
The authors declare no conflict of interest.