**3. Inspection pipeline**

Quality inspection systems based on vision techniques in most cases follow the workflow depicted in **Figure 2**. The process starts by collecting the sample images using a set of cameras or sensors exploiting an adequate source of illumination. Such samples are then processed to improve images quality. Therefore, once the features are extrapolated, the evaluation of the quality and the classification of the defect are performed. Measurement and classification could either be implemented with traditional computer vision algorithms, with modern DNN architectures, or with a fusion of both of them, as in the case presented in the following. Usually, the inspection system also provides an actuation step that triggers actions, depending on the analysis result, to the production lines that directly communicate with the control unit (commonly based on programmable logic controllers (PLCs)).

The work discussed in the study by Sassi et al. [36] originated from industrial demands with the specific target of detecting welding defects on diesel injectors in the production line. Such a project focused on realizing the most effective combination of

### **Figure 2.** *Typical visual inspection workflow.*

## **Figure 3.**

*Examples of defect classes. IN D3, green and red circles show the detected inner and outer edges of the welding joint. In D4, the red arrows highlight thin welding, while the green ones are standard ones.*

traditional computer vision methods and deep neural network architecture for identifying the defects in the welding. In particular, the aim was to substitute the existing vision inspection system extending the classes of detectable defects in the analysis phase.

Welding joint defects may appear in different typologies: some are related to anomalies on the surface of the joint, while others are related to its geometrical properties, such as its thickness and position. Four categories have been defined for the analysis of the welding joint, as depicted graphically in **Figure 3** showing an example from each category:


• D4 (*Large/Thin welding joint*): When the amount of melt welding material is excessive or limited, the joint could be larger or thinner.

Defects D3 and D4 are quantitative measurable and are examined employing an algorithm based on traditional computer vision techniques (similar to the existing commercial solution). On the contrary, the others (D1 and D2) are more qualitative and are recognized through a method based on deep learning.

Furthermore, the analysis of the defects must be performed within a time slot that depends on the actual production line (1.8 seconds cycle time in the depicted scenario) to avoid interferences with the manufacturing process. This amount of time is required for the actuation system and the welding stage to process a new injector as input to the system.
