# Deep Learning-Based Method for Accurate Real-Time Seed Detection in Glass Bottle Manufacturing
## 3 Materials and Methods
### System Design  
This system has to analyze 100% of the bottles automatically and in real time. According to quality requirements and expert knowledge, it is not necessary to inspect the whole bottle in order to have the total number of seeds. It is enough to have the seed density information in a specified region and analyze its trend over time. An increase in the number of seeds per kilogram may indicate a problem in the furnace (oven) that has to be solved. A low or decreasing trend in the number of seeds per kilogram indicates a good, optimized manufacturing process. To this end, only a specified and fixed region of interest is inspected in every bottle, and the number of seeds per kilogram (or blisters per ton) are the indicators calculated. Bubbles are named in two different ways depending on the size. Seeds refer to bubbles with bounding box with both sides smaller than 1 mm. Blister refers to a big bubble having at least one dimension of the circumscribing bounding box higher than 1 mm. To this end, a region for inspection approximately 60 mm in height by the diameter of the bottle is established. The seeds/blisters that are displayed in said region will be detected, their shape and size will be evaluated and the results of said analysis will be reported, so that the operator can take the appropriate actions based on the information received. The number of seeds detected in said inspection region will be related to a value of the number of seeds per kilo and per ton, which is the variable usually used in the plant to control the quality of the bottle manufacturing process. Figure 1: Examples of bottles of different shapes and colors. The proposed system includes mechanical, electrical, vision and software development. The vision subsystem and the software subsystem are described in detail in the following sections. The general description of each module is as follows:  
* Vision subsystem: This module includes the set of elements that capture images of the bottles. It is further described below. * Mechanical subsystem: This module includes the set of mechanical devices that support the vision subsystem. * Electrical subsystem: This module includes the electrical cabinet as well as the additional elements and electrical signals needed for the synchronization of the different modules and the communication with the control computer. The electrical and mechanical elements are housed in a cabinet, as shown in Figure 2. The only element outside the cabinet is the illumination system that is placed opposite the camera for a backlight layout. Moreover, the system receives the encoder signals to synchronize the line scan acquisition with the speed of the manufacturing line in order to properly reconstruct the image of every bottle. An additional photo sensor placed in the line indicates whether a bottle has passed and activates the acquisition process. The PC communicates with the camera through the Ethernet connection. * Software subsystem: The SW module was specifically designed for this application and it performs the control and configuration of the camera; the reception, processing and analysis of the images; the launching of the detection process whenever an image is available; and the display and storage of the results and other auxiliary tasks of configuration and verification of the status of the different elements of the system. The layout of the system and the vision module is shown in Figure 2.  
By means of an easy-to-use graphical interface, the user can start the process. The inspection process, once started, will automatically continue until stopped by the user. The software subsystem is responsible for collecting the camera lines to reconstruct the image, estimating the extremes of the diameter of each bottle from the captured images, and analyzing the presence of seeds in each identified bottle. If seeds are detected, their dimensions will be calculated.