# Welding Bead Inspection Using Image and Multi-Sensor Fusion
## 3 Proposed Algorithm  
As previously mentioned, among the various welding quality inspections, inspections using sensor data offer speed and high accuracy, but suffer from the limitation of not being able to determine the exact welding location. On the other hand, inspections using 2D image data can identify the welding location, but they face several challenges, such as low accuracy when the image contains noise and measurement errors, as well as high computational costs. In this paper, to address these issues, we proposed an inspection method that combines sensor data inspection with 2D image data inspection. For 2D image data inspection, we utilized the image projection method proposed by [PERSON] et al. [16]. This proposed method complements the strengths and weaknesses of sensor and image data inspections, effectively resolving the existing accuracy issues. Furthermore, if a defect is determined in the sensor data inspection, the inspection skips the image data inspection and directly concludes it as bad, reducing unnecessary computation and time to improve the inspection speed. The procedure of the proposed method is shown in Figure 2.  
In sensor data inspection, welding bead defects are assessed using average current, average voltage, and mixed gas flow data. The mixed gas used is a combination of argon and carbon dioxide gas (CO\({}_{2}\)) to prevent contamination. Therefore, we displayed the three values generated during one welding operation on a single graph, as shown in Figure 3. When plotting some of the measured sensor data values for a single product welding, as shown in Figure 3a, the blue line represents the average current value, the orange line represents the average voltage value, and the gray line represents the mixed gas value. The current average and voltage average represent the average values obtained from the current and voltage, respectively. The \(x\)-axis represents the welding time, and the \(y\)-axis represents the values. In Figure 3a, the work took place from 12:05:08.44 to 12:05:11.23. At 12:05:08.44, the current average value was 0, the voltage average was 1.2, and the gas value was 0. Figure 3a represents the normal data. However, Figure 3b depicts the gas defective data, with all values being 0 due to an issue with gas, while Figure 3c displays the current defective data, where the current becomes problematic and results in a value of zero from the middle. In other words, when defects occur in the sensor data, the values tend to either be zero or very small. Figure 3: _Cont._  
Figure 2: Procedures of the proposed algorithm. In each sensor dataset, the approximated three values at the beginning and end were unstable, so these values were first removed. Then, the average value (\(m_{i}\)) was calculated for each of the three sensor datasets, where \(i=1,\ 2,\ 3\) represents the average current, average voltage, and mixed gas flow, respectively. The lower bounds (\(C_{i}\)) were calculated for the previously calculated average values (\(m_{i}\)) using a threshold value (\(\alpha\)), and the formula is as follows:  
\[C_{i}=m_{i}\times\alpha, \tag{1}\]  
The error counts (\(EC_{i}\)) were calculated for each of the three sensor datasets, as shown in Equation (2), for sensor data (\(x_{ij}\)) that were smaller than the sensor's lower bounds (\(C_{i}\)), which were calculated using Equation (1). Next, the error counts (\(EC_{i}\)) calculated in Equation (2) were then evaluated against a threshold value (\(\beta\)), as described in Equation (3). If \(EC_{i}<\beta\), it was considered as a good product, whereas if \(EC_{i}\geq\beta\), it was considered as a bad product. \[EC_{i}=\sum_{i}^{3}\sum_{j}^{N}\big{(}x_{ij}<C_{i}\big{)},\ \text{where}\ j=1,\ 2, \ldots,\ N \tag{2}\]  
Figure 3: Sensor results: (**a**) good; (**b**) bad—gas; (**c**) bad—current avg. and horizontal directions, the dimensions of the welding bead were measured in the extracted region of the welding bead. Then, the threshold values \(T_{hor}\) and \(T_{ver}\) were used in Equations (7) and (8) below.