# Deep Learning-Based Method for Accurate Real-Time Seed Detection in Glass Bottle Manufacturing
## 5 Discussion  
The results shown in Section 4 above reveal a good performance of the proposed method for seed detection and of the whole system itself. The proposed methodology makes feasible the detection of seeds with a degree of precision close to 1.0 and a False Negative Rate close to 0.0. This means that almost all the seeds are detected correctly, that is, no false positives are detected, and besides, the number of real seeds that are not detected is very small, which is of utmost importance in this process. The inclusion of the deep learning-based classification model as an additional stage in the processing pipeline outperforms the results obtained by the baseline (the classical image processing-based approach without the deep learning model). This is evident in:  
* The number of false positives, understood as the detection and counting of grease stains, marks or other elements that appeared in the image and are attributed to seeds in the past, has been drastically reduced;
* The number of false negatives (undetected seeds) is null in most of the images. From the observation of the images, it can be appreciated that the seeds that are occasionally lost are those that are very faint, in which there is very little contrast between the circular crown that characterizes them and the hue of the bottle. The observation of the faint seeds mainly happens in light-color bottles with low thickness. Another aspect that has been verified is that the sizing of the seeds is correct. As explained in introduction, small defects are named as seeds and defects with one dimension larger than 1 mm size are considered as blisters. The image is acquired by a line scan camera that is perfectly synchronized with the electrical signal of the encoder of the manufacturing line and with a verified resolution of up to 0.03 mm/line pulse. Moreover, the processing pipeline calculates dynamically, for every frame, the real resolution in the movement axis, to absorb the possible variation in the speed of the conveyor belt that transports the bottles. This makes feasible the precise estimation of the size in pixels of the seeds detected, and direct conversion to millimeters is achieved through multiplication by real frame resolution. Occasionally, some seeds are not framed perfectly and show a smaller dimension than the real one. This happens in the case of faint bubbles, where part of them, in the faintest area and with less contrast, can be diluted with the background and not be detected. The estimation in size of the seeds is considered to be appropriate. This fact is relevant for the proper calculation of both key indicators in the process, that is, (1) seeds per kilo, where all the detected seeds are considered, and (2) blisters per ton, where only big sized seeds with any dimension larger than 1 mm size are considered. Regarding the implementation of the algorithm, it has been managed to make different tools and environments work together. The camera is controlled by drivers and API through a C environment. This development environment centralizes the control of the camera and  
Figure 14: Example of improvement in detection of seeds: (**a**) the image has been processed with the classical image processing approach; (**b**) the image has also been processed with the deep learning-based model. reception of images, the processing pipeline, the communication with the system in the plant to deliver the obtained results and also the user interface to gather the instructions given by the user. The camera also receives the electric signal from the photocell and encoder of the manufacturing line. All this happens at a processing rate of up to 250 bottles per minute in a manufacturing line that can move up to 50 m per minute, which is really fast so as to detect seeds as small as 0.1 mm\({}^{2}\). This is a real-time system that is working in three sites of Vidrala group 24 h per day and 7 days per week.