Real-Time Weld Gap Monitoring and Quality Control Algorithm during Weaving Flux-Cored Arc Welding Using Deep Learning

: In the ﬂux-cored arc welding process, which is most widely used in shipbuilding, a constant external weld bead shape is an important factor in determining proper weld quality; however, the size of the weld gap is generally not constant, owing to errors generated during the shell forming process; moreover, a constant external bead shape for the welding joint is difﬁcult to obtain when the weld gap changes. Therefore, this paper presents a method for monitoring the weld gap and controlling the weld deposition rate based on a deep neural network (DNN) for the automation of the hull block welding process. Welding experiments were performed with a welding robot synchronized with the welding machine, and the welding quality was classiﬁed according to the experimental results. Welding current and voltage signals, as the robot passed through the weld seam, were measured using a trigger device and analyzed in the time domain and frequency domain, respectively. From the analyzed data, 24 feature variables were extracted and used as input for the proposed DNN model. Consequently, the ofﬂine and online performance veriﬁcation results for new experimental data using the proposed DNN model were 93% and 85%, respectively.


Introduction
Welding is widely applied in heavy industries, such as the automobile and aerospace industries [1][2][3][4]. It plays a critical role in shipbuilding, accounting for approximately 50% of the entire shipbuilding process [5]. In the manufacture of automobile bodies using spot welding, automated manufacturing lines using robots have advanced while maintaining a low defect rate [6]. However, when unexpected disturbances such as welding deformation and weld shape changes occur in large and complex hull block fillet welding processes, welding defects, such as the attainment of values greater or less than the required theoretical throat thickness standard, may occur, thereby failing to ensure consistent welding quality [7]. In addition, it is necessary to exercise caution with the control microdefects as that can lead to the formation of fatigue cracks [8]. Therefore, the majority of operations in the hull welding process are still dependent on the experience of skilled welders, and the development of an automated welding process remains an important task [9].
Recently, research on welding condition monitoring using artificial intelligence and camera vision devices has gained increasing attention because of the increasing demand for manufacturing intelligence, cost reduction, efficiency, and quality. This research can be classified into three areas of application: weld defect prediction [10][11][12], weld bead shape prediction [13,14], and weld seam tracking [15][16][17]. For instance, Zhang et al. [10] developed a convolutional neural network (CNN) algorithm based on a multi-sensor system, including an auxiliary illumination (AI) visual sensor system, UVV band visual sensor system, spectrometer, and two photodiodes to detect three different welding defects during highpower disk laser welding. Yu et al. [11] proposed a deep neural network (DNN)-based quality assessment method based on a spectrometer in the laser beam welding (LBW) process. Shin et al. [12] proposed a DNN-based nondestructive testing method for the detection and prediction of porosity defects in real time based on welding voltage signals. Nagesh and Datta [13] used back-propagation neural networks to associate welding process variables with the features of bead geometry and penetration. Pinto-Lopera et al. [14] presented a novel technique for real-time measurement of the width and height of weld beads during gas metal arc welding (GMAW) using a single high-speed camera and a long-pass optical filter in a passive vision system. Xu et al. [15] presented a technology for real-time seam tracking to overcome the limitations of teaching-playback welding robots in seam tracking control during gas tungsten arc welding (GTAW). Zou et al. [16] studied and analyzed the feature point tracking method and the adaptive fuzzy control algorithm for the welding process and designed a set of six-degree-of-freedom robotic welding automatic tracking platforms to realize real-time tracking of the weld seam. Ting et al. [17] developed a detection-compensation-tracking system and improved the contact-type displacement and angular sensors for use in weld seam trajectory detection.
According to the reviewed literature, charge-coupled-device (CCD) cameras, vision sensors, and artificial intelligence techniques have been applied to successfully monitor the weld defects and weld bead shape during welding, and effective methodologies for tracking curved weld seams have been presented. However, most studies using CCD cameras and vision sensors are not applicable to large, welded structures, such as ships. Hitherto, no study has reported on the monitoring of welding conditions in real-time or via robot control based on AI model decisions.
In general, the welding current and voltage signals measured during welding processes effectively represent the physical phenomenon of welding, and numerous studies have been conducted to determine welding quality and evaluate weldability [18][19][20][21][22][23]. In addition, many studies have been conducted to analyze the correlations between the frequencies of the measured signals for condition monitoring, such as defect detection; these studies could accurately distinguish between normal and defective target signals [24][25][26]. Chu et al. presented time-frequency analysis as an effective method to determine welding quality and performed frequency analysis to distinguish between normal and defective welding process signals [27]. Based on the advantages of DNNs, such as their capabilities of nonlinear combination, learning between nonlinear variables, and understanding the potential structure of data, excellent results have been achieved in welding monitoring [11,12].
To this end, this study proposes a DNN-based welding condition monitoring and quality control method using feature variables extracted from the time and frequency domains of the welding signal measured in a hull welding process. First, a signal measurement system synchronized with the motion of a welding robot in the welding process was developed, and then repeated experiments were performed by varying the welding gap. The measured welding current and voltage signals were analyzed in the time and frequency domains, respectively, and the feature variables that were most correlated with the weld gap variables were extracted. The weld gap detection model was designed using a DNN and learned based on the time and frequency feature variables of the welding signal. A decision-making system (the classification result of the DNN model output is transmitted to the robot controller in the form of an analog voltage, and the motion of the robot is controlled) was developed to control the weld composition rate to meet the quality requirements for each weld gap.
The remainder of this paper is organized as follows. In Section 2, the procedures for the welding experiments and experimental system are detailed. The experimental results and weld gap monitoring performance of the proposed DNN-based algorithm are discussed in Section 3. Finally, conclusions are presented in Section 4.

Materials
In this study, SS 400 was used as the base material (test plate). The thickness of the selected welding material was 15 mm, and the maximum tensile strength was 400 MPa. The mechanical properties and chemical components are listed in Table 1. Figure 1 depicts the dimensions and schematics of the test plates to be welded on the filet joint. All welding experiments were conducted in a 3F vertical up position in the same manner as the block welding process performed in an actual shipyard. To minimize thermal deformation during welding, tack welding was performed at the beginning and end of the test plates, and the length of the entire welding section was 200 mm.  REVIEW 3 and weld gap monitoring performance of the proposed DNN-based algorithm are cussed in Section 3. Finally, conclusions are presented in Section 4.

Materials
In this study, SS 400 was used as the base material (test plate). The thickness of selected welding material was 15 mm, and the maximum tensile strength was 400 M The mechanical properties and chemical components are listed in Table 1. Figure 1 dep the dimensions and schematics of the test plates to be welded on the filet joint. All weld experiments were conducted in a 3F vertical up position in the same manner as the b welding process performed in an actual shipyard. To minimize thermal deformation ing welding, tack welding was performed at the beginning and end of the test plates, the length of the entire welding section was 200 mm.

Experimental Equipment and Procedure
As illustrated in Figure 2, the welding experiments were performed using a const voltage direct current (DC) inverter welding machine (Fronius TPS-4000, Fronius, W Austria) and a six-axis robot (Neuromeka, Seoul, Korea). The signal input/output of welding monitoring system developed in this study used an NI module, as depicte Figure 2b. The NI-9229 (National Instruments, Austin, TX, USA) module measured welding current and voltage analog signal, and the NI-9375 (National Instruments, A tin, TX, USA) module transmitted the digital voltage signal to the ROB 5000 OC (Fron Wels, Austria) module to control the arc ON/OFF of the welding machine. An NI-9 (National Instruments, Austin, TX, USA) module connected to the robot controller r the robot motion information and acted as a trigger to measure the synchronization si according to the robot motion in a real-time control system. Finally, an NI-9263 (Nati Instruments, Austin, TX, USA) module transmitted the decision of the gap detection to the robot controller in the form of a digital voltage. The optimal trajectory (motion 2, and 3) for each weld gap that was stored in advance by the welding robot SDK prog was changed by the digital voltage input. After the welding experiment, each test p was subjected to a cross-sectional analysis. The middle part of the welded test plates

Experimental Equipment and Procedure
As illustrated in Figure 2, the welding experiments were performed using a constantvoltage direct current (DC) inverter welding machine (Fronius TPS-4000, Fronius, Wels, Austria) and a six-axis robot (Neuromeka, Seoul, Korea). The signal input/output of the welding monitoring system developed in this study used an NI module, as depicted in Figure 2b. The NI-9229 (National Instruments, Austin, TX, USA) module measured the welding current and voltage analog signal, and the NI-9375 (National Instruments, Austin, TX, USA) module transmitted the digital voltage signal to the ROB 5000 OC (Fronius, Wels, Austria) module to control the arc ON/OFF of the welding machine. An NI-9423 (National Instruments, Austin, TX, USA) module connected to the robot controller read the robot motion information and acted as a trigger to measure the synchronization signal according to the robot motion in a real-time control system. Finally, an NI-9263 (National Instruments, Austin, TX, USA) module transmitted the decision of the gap detection unit to the robot controller in the form of a digital voltage. The optimal trajectory (motions 1, 2, and 3) for each weld gap that was stored in advance by the welding robot SDK program was changed by the digital voltage input. After the welding experiment, each test plate was subjected to a cross-sectional analysis. The middle part of the welded test plates was cut, ground, sanded, polished, and then etched with 5% Nital HNO 3 solution, and the shape, quality, and size of the welds were recorded. The cross-section of the weld was analyzed and photographed in detail using an optical microscope.
Metals 2021, 11, x FOR PEER REVIEW cut, ground, sanded, polished, and then etched with 5% Nital HNO3 solution, an shape, quality, and size of the welds were recorded. The cross-section of the wel analyzed and photographed in detail using an optical microscope.  Figure 3 illustrates the shape of the fillet weld bead as the weld gap parame creases under fixed welding conditions. As the weld gap increases, more molten m sucked into the gap, and the weld bead becomes smaller; therefore, the theoretical thickness required in this case cannot be satisfied. Three types of weld gaps were c ered in this study: 0, 2, and 4 mm. The optimum welding speed that could satis theoretical throat thickness required for each gap condition was selected based on ous experiments. The optimal welding speed for the 0 mm gap was 16 cm/min, th the 2 mm gap was 13.8 cm/min, and that for the 4 mm gap was 10.8. The motion traj of the robot was created. However, to detect the welding gap in real time and contr robot motion accurately, it is necessary to consider the case of cross-applying the op welding conditions for each welding gap. Therefore, although there were three gap experiments and analyses were performed by considering a total of nine cases, incl welding conditions and cross-verification of the weld gap.  Figure 3 illustrates the shape of the fillet weld bead as the weld gap parameter increases under fixed welding conditions. As the weld gap increases, more molten metal is sucked into the gap, and the weld bead becomes smaller; therefore, the theoretical throat thickness required in this case cannot be satisfied. Three types of weld gaps were considered in this study: 0, 2, and 4 mm. The optimum welding speed that could satisfy the theoretical throat thickness required for each gap condition was selected based on previous experiments. The optimal welding speed for the 0 mm gap was 16 cm/min, that for the 2 mm gap was 13.8 cm/min, and that for the 4 mm gap was 10.8. The motion trajectory of the robot was created. However, to detect the welding gap in real time and control the robot motion accurately, it is necessary to consider the case of cross-applying the optimal welding conditions for each welding gap. Therefore, although there were three gap sizes, experiments and analyses were performed by considering a total of nine cases, including welding conditions and cross-verification of the weld gap.  In this study, repeated welding experiments were performed, including cross-conditions experiments with each welding condition and weld gap, and nine welding experiments were considered as one set. Thus, three sets of welding experiments (i.e., 27 experiments) were performed to obtain the data. The welding current signal and arc voltage signal generated during welding were measured in real-time at a sampling rate of 2 kHz using a current clamp and an analog-to-digital converter. The welding conditions used in the experiment are presented in Table 2, and conditions such as shielding gas, CTWD, welding wire specifications, welding feed rate, and welding contact pressure values were set similar to those used in actual shipyards. The tool center point (TCP) value of the robot was set to the end of the welding torch, including the wire protrusion length.  Table 3 presents the cross-sectional images of the test plates for a total of nine welding experiments wherein cross-conditions were applied. The ideal theoretical throat thickness was confirmed in the experiment in which the optimum welding condition was applied to each weld gap; however, in the experiments performed under other welding conditions, the required theoretical throat thickness was found to be larger or smaller. As a result of applying robot motion 1, which is the optimal condition for a 0 mm gap, to the 2 and 4 mm gaps, the size of the generated weld bead was small because additional penetration occurred in accordance with the size of the gap. In contrast, as a result of applying robot motion 2, which is the optimal condition for the 2 mm gap, to the 0 and 4 mm gaps, the leg length and theoretical throat thickness were found to be larger than the normal standard in the 0 mm gap, and owing to the additional penetration in the 4 mm gap, the size of the generated weld bead was smaller. Finally, as a result of applying robot motion 3, which is the optimal condition for a 4 mm gap, to the 0 and 2 mm gaps, a large weld deposit rate at a low welding speed resulted in large weld beads in the two welding sections. In this study, repeated welding experiments were performed, including cross-conditions experiments with each welding condition and weld gap, and nine welding experiments were considered as one set. Thus, three sets of welding experiments (i.e., 27 experiments) were performed to obtain the data. The welding current signal and arc voltage signal generated during welding were measured in real-time at a sampling rate of 2 kHz using a current clamp and an analog-to-digital converter. The welding conditions used in the experiment are presented in Table 2, and conditions such as shielding gas, CTWD, welding wire specifications, welding feed rate, and welding contact pressure values were set similar to those used in actual shipyards. The tool center point (TCP) value of the robot was set to the end of the welding torch, including the wire protrusion length.  Table 3 presents the cross-sectional images of the test plates for a total of nine welding experiments wherein cross-conditions were applied. The ideal theoretical throat thickness was confirmed in the experiment in which the optimum welding condition was applied to each weld gap; however, in the experiments performed under other welding conditions, the required theoretical throat thickness was found to be larger or smaller. As a result of applying robot motion 1, which is the optimal condition for a 0 mm gap, to the 2 and 4 mm gaps, the size of the generated weld bead was small because additional penetration occurred in accordance with the size of the gap. In contrast, as a result of applying robot motion 2, which is the optimal condition for the 2 mm gap, to the 0 and 4 mm gaps, the leg length and theoretical throat thickness were found to be larger than the normal standard in the 0 mm gap, and owing to the additional penetration in the 4 mm gap, the size of the generated weld bead was smaller. Finally, as a result of applying robot motion 3, which is the optimal condition for a 4 mm gap, to the 0 and 2 mm gaps, a large weld deposit rate at a low welding speed resulted in large weld beads in the two welding sections.

Feature Parameter Extraction from Welding Current and Voltage Signals
In this study, to monitor the welding gap, the welding current and voltage signals were analyzed in the time and frequency domains, respectively, and the pattern change of the welding signal waveform with changes in the weld gap was confirmed. Figure 4a depicts the welding current and voltage signals measured when the welding robot passes through the welding seam once based on the trigger device. For these signals, the feature variable extraction in the time domain was performed based on the median filter, as illustrated in Figure 4b. A median filter was applied to the welding current and voltage signals to derive the average value points for 20 samples in the original signal raw data, and the points were connected to generate a guideline for the welding current and voltage signals. Peak values above and below the median filter criteria were derived and displayed, and feature variables for the welding current and voltage were extracted based on the peak values. Figures 4c,d depict the results of the fast Fourier transform (FFT) analysis of the current and voltage signals measured in the robot weaving section, respectively. As a result of analyzing the welding current voltage signal in the time and frequency domains, a total of six characteristic variables were extracted from each domain for each welding current and voltage, and a total of 24 characteristic variables are listed in Table 4.

Feature Parameter Extraction from Welding Current and Voltage Signals
In this study, to monitor the welding gap, the welding current and voltage signals were analyzed in the time and frequency domains, respectively, and the pattern change of the welding signal waveform with changes in the weld gap was confirmed. Figure 4a depicts the welding current and voltage signals measured when the welding robot passes through the welding seam once based on the trigger device. For these signals, the feature variable extraction in the time domain was performed based on the median filter, as illustrated in Figure 4b. A median filter was applied to the welding current and voltage signals to derive the average value points for 20 samples in the original signal raw data, and the points were connected to generate a guideline for the welding current and voltage signals. Peak values above and below the median filter criteria were derived and displayed, and feature variables for the welding current and voltage were extracted based on the peak values. Figures 4c,d depict the results of the fast Fourier transform (FFT) analysis of the current and voltage signals measured in the robot weaving section, respectively. As a result of analyzing the welding current voltage signal in the time and frequency domains, a total of six characteristic variables were extracted from each domain for each welding current and voltage, and a total of 24 characteristic variables are listed in Table 4.

Feature Parameter Extraction from Welding Current and Voltage Signals
In this study, to monitor the welding gap, the welding current and voltage signals were analyzed in the time and frequency domains, respectively, and the pattern change of the welding signal waveform with changes in the weld gap was confirmed. Figure 4a depicts the welding current and voltage signals measured when the welding robot passes through the welding seam once based on the trigger device. For these signals, the feature variable extraction in the time domain was performed based on the median filter, as illustrated in Figure 4b. A median filter was applied to the welding current and voltage signals to derive the average value points for 20 samples in the original signal raw data, and the points were connected to generate a guideline for the welding current and voltage signals. Peak values above and below the median filter criteria were derived and displayed, and feature variables for the welding current and voltage were extracted based on the peak values. Figures 4c,d depict the results of the fast Fourier transform (FFT) analysis of the current and voltage signals measured in the robot weaving section, respectively. As a result of analyzing the welding current voltage signal in the time and frequency domains, a total of six characteristic variables were extracted from each domain for each welding current and voltage, and a total of 24 characteristic variables are listed in Table 4.

Feature Parameter Extraction from Welding Current and Voltage Signals
In this study, to monitor the welding gap, the welding current and voltage signals were analyzed in the time and frequency domains, respectively, and the pattern change of the welding signal waveform with changes in the weld gap was confirmed. Figure 4a depicts the welding current and voltage signals measured when the welding robot passes through the welding seam once based on the trigger device. For these signals, the feature variable extraction in the time domain was performed based on the median filter, as illustrated in Figure 4b. A median filter was applied to the welding current and voltage signals to derive the average value points for 20 samples in the original signal raw data, and the points were connected to generate a guideline for the welding current and voltage signals. Peak values above and below the median filter criteria were derived and displayed, and feature variables for the welding current and voltage were extracted based on the peak values. Figures 4c,d depict the results of the fast Fourier transform (FFT) analysis of the current and voltage signals measured in the robot weaving section, respectively. As a result of analyzing the welding current voltage signal in the time and frequency domains, a total of six characteristic variables were extracted from each domain for each welding current and voltage, and a total of 24 characteristic variables are listed in Table 4.

Feature Parameter Extraction from Welding Current and Voltage Signals
In this study, to monitor the welding gap, the welding current and voltage signals were analyzed in the time and frequency domains, respectively, and the pattern change of the welding signal waveform with changes in the weld gap was confirmed. Figure 4a depicts the welding current and voltage signals measured when the welding robot passes through the welding seam once based on the trigger device. For these signals, the feature variable extraction in the time domain was performed based on the median filter, as illustrated in Figure 4b. A median filter was applied to the welding current and voltage signals to derive the average value points for 20 samples in the original signal raw data, and the points were connected to generate a guideline for the welding current and voltage signals. Peak values above and below the median filter criteria were derived and displayed, and feature variables for the welding current and voltage were extracted based on the peak values. Figures 4c,d depict the results of the fast Fourier transform (FFT) analysis of the current and voltage signals measured in the robot weaving section, respectively. As a result of analyzing the welding current voltage signal in the time and frequency domains, a total of six characteristic variables were extracted from each domain for each welding current and voltage, and a total of 24 characteristic variables are listed in Table 4.

Feature Parameter Extraction from Welding Current and Voltage Signals
In this study, to monitor the welding gap, the welding current and voltage signals were analyzed in the time and frequency domains, respectively, and the pattern change of the welding signal waveform with changes in the weld gap was confirmed. Figure 4a depicts the welding current and voltage signals measured when the welding robot passes through the welding seam once based on the trigger device. For these signals, the feature variable extraction in the time domain was performed based on the median filter, as illustrated in Figure 4b. A median filter was applied to the welding current and voltage signals to derive the average value points for 20 samples in the original signal raw data, and the points were connected to generate a guideline for the welding current and voltage signals. Peak values above and below the median filter criteria were derived and displayed, and feature variables for the welding current and voltage were extracted based on the peak values. Figures 4c,d depict the results of the fast Fourier transform (FFT) analysis of the current and voltage signals measured in the robot weaving section, respectively. As a result of analyzing the welding current voltage signal in the time and frequency domains, a total of six characteristic variables were extracted from each domain for each welding current and voltage, and a total of 24 characteristic variables are listed in Table 4.

Feature Parameter Extraction from Welding Current and Voltage Signals
In this study, to monitor the welding gap, the welding current and voltage signals were analyzed in the time and frequency domains, respectively, and the pattern change of the welding signal waveform with changes in the weld gap was confirmed. Figure 4a depicts the welding current and voltage signals measured when the welding robot passes through the welding seam once based on the trigger device. For these signals, the feature variable extraction in the time domain was performed based on the median filter, as illustrated in Figure 4b. A median filter was applied to the welding current and voltage signals to derive the average value points for 20 samples in the original signal raw data, and the points were connected to generate a guideline for the welding current and voltage signals. Peak values above and below the median filter criteria were derived and displayed, and feature variables for the welding current and voltage were extracted based on the peak values. Figures 4c,d depict the results of the fast Fourier transform (FFT) analysis of the current and voltage signals measured in the robot weaving section, respectively. As a result of analyzing the welding current voltage signal in the time and frequency domains, a total of six characteristic variables were extracted from each domain for each welding current and voltage, and a total of 24 characteristic variables are listed in Table 4.

Feature Parameter Extraction from Welding Current and Voltage Signals
In this study, to monitor the welding gap, the welding current and voltage signals were analyzed in the time and frequency domains, respectively, and the pattern change of the welding signal waveform with changes in the weld gap was confirmed. Figure 4a depicts the welding current and voltage signals measured when the welding robot passes through the welding seam once based on the trigger device. For these signals, the feature variable extraction in the time domain was performed based on the median filter, as illustrated in Figure 4b. A median filter was applied to the welding current and voltage signals to derive the average value points for 20 samples in the original signal raw data, and the points were connected to generate a guideline for the welding current and voltage signals. Peak values above and below the median filter criteria were derived and displayed, and feature variables for the welding current and voltage were extracted based on the peak values. Figures 4c,d depict the results of the fast Fourier transform (FFT) analysis of the current and voltage signals measured in the robot weaving section, respectively. As a result of analyzing the welding current voltage signal in the time and frequency domains, a total of six characteristic variables were extracted from each domain for each welding current and voltage, and a total of 24 characteristic variables are listed in Table 4.

Feature Parameter Extraction from Welding Current and Voltage Signals
In this study, to monitor the welding gap, the welding current and voltage signals were analyzed in the time and frequency domains, respectively, and the pattern change of the welding signal waveform with changes in the weld gap was confirmed. Figure 4a depicts the welding current and voltage signals measured when the welding robot passes through the welding seam once based on the trigger device. For these signals, the feature variable extraction in the time domain was performed based on the median filter, as illustrated in Figure 4b. A median filter was applied to the welding current and voltage signals to derive the average value points for 20 samples in the original signal raw data, and the points were connected to generate a guideline for the welding current and voltage signals. Peak values above and below the median filter criteria were derived and displayed, and feature variables for the welding current and voltage were extracted based on the peak values. Figures 4c,d depict the results of the fast Fourier transform (FFT) analysis of the current and voltage signals measured in the robot weaving section, respectively. As a result of analyzing the welding current voltage signal in the time and frequency domains, a total of six characteristic variables were extracted from each domain for each welding current and voltage, and a total of 24 characteristic variables are listed in Table 4.

Feature Parameter Extraction from Welding Current and Voltage Signals
In this study, to monitor the welding gap, the welding current and voltage signals were analyzed in the time and frequency domains, respectively, and the pattern change of the welding signal waveform with changes in the weld gap was confirmed. Figure 4a depicts the welding current and voltage signals measured when the welding robot passes through the welding seam once based on the trigger device. For these signals, the feature variable extraction in the time domain was performed based on the median filter, as illustrated in Figure 4b. A median filter was applied to the welding current and voltage signals to derive the average value points for 20 samples in the original signal raw data, and the points were connected to generate a guideline for the welding current and voltage signals. Peak values above and below the median filter criteria were derived and displayed, and feature variables for the welding current and voltage were extracted based on the peak values. Figure 4c,d depict the results of the fast Fourier transform (FFT) analysis of the current and voltage signals measured in the robot weaving section, respectively. As a result of analyzing the welding current voltage signal in the time and frequency domains, a total of six characteristic variables were extracted from each domain for each welding current and voltage, and a total of 24 characteristic variables are listed in Table 4.  Now, X1 ( ) denotes the average value of the current measured in one weaving section, X2 ( ) denotes the average value of the peaks derived below the median filter guideline, X3 ( ) denotes the standard deviation of the peaks derived below the median filter guideline, X4 ( ) denotes the average value of the peaks derived above the median filter guideline, X5 ( ) denotes the average of all the values connected from the highest peak to the lowermost peak with respect to the median filter guideline, and X6 ( ) denotes the average of all the values connected from the lowermost peak to the highest peak with respect to the median filter guideline. The feature variables were extracted from the voltage signal in the same way as those from the current signal, and they are listed as X7-X12. Based on the information obtained in the frequency domain during the frequency analysis process for welding current and voltage signals, six feature variables related to the frequency components were extracted from the welding current signal.      Now, X1 (I) denotes the average value of the current measured in one weaving section, X2 (I(P b )) denotes the average value of the peaks derived below the median filter guideline, X3 (s[I(P b )]) denotes the standard deviation of the peaks derived below the median filter guideline, X4 (I(P t )) denotes the average value of the peaks derived above the median filter guideline, X5 (I f ) denotes the average of all the values connected from the highest peak to the lowermost peak with respect to the median filter guideline, and X6 (I r ) denotes the average of all the values connected from the lowermost peak to the highest peak with respect to the median filter guideline. The feature variables were extracted from the voltage signal in the same way as those from the current signal, and they are listed as X7-X12. Based on the information obtained in the frequency domain during the frequency analysis process for welding current and voltage signals, six feature variables related to the frequency components were extracted from the welding current signal. X13 (max( f c )) denotes the maximum peak value of the frequency, X14 ( f c ) denotes the average value of the top five frequency peaks, X15 (s( f c )) denotes the standard deviation of the top five frequency peak values, X16 (max(A c )) denotes the maximum amplitude (welding current frequency), X17 (A c ) denotes the average value of the top five frequency amplitudes, and X18 (s(A c )) denotes the standard deviation of the top five frequency amplitudes. From the voltage signal, the same feature variables as those from the current were extracted and are listed in Table 4 (X19-X24). Figure 5 depicts the extracted characteristic variables (i.e., X1, X2, and X4). It was confirmed that the features identified in this process were accurately extracted from the welding signal analysis, and the characteristic variables demonstrated a constant trend in terms of the welding gap.
were extracted and are listed in Table 4 (X19-X24). Figure 5 depicts the extracted characteristic variables (i.e., X1, X2, and X4). It was confirmed that the features identified in this process were accurately extracted from the welding signal analysis, and the characteristic variables demonstrated a constant trend in terms of the welding gap.

Training and Validation of the Proposed DNN-Based Weld Gap Monitoring and Weld
Deposition Rate Control Model Figure 6 illustrates the structure of the DNN-based weld gap detection framework proposed in this study, which includes signal pre-processing, feature variable extraction, DNN model learning and prediction, and welding robot control. In the first step, a welding experiment was performed while the welding machine and robot were synchronized, and the welding current and voltage signals were acquired. In the second step, the signal during the robot's weaving time was extracted and analyzed in the time and frequency domains, and 24 feature variables were extracted during this process. In the third step, the DNN model was trained based on the extracted feature variables. In this process, labels were assigned as class 0 when the weld gap was 0 mm, class 1 when the weld gap was 2 mm, and class 2 when the weld gap was 4 mm, and the DNN model was trained. In the fourth step, the classification result of the DNN model for the feature variable derived by real-time signal processing as a verification process for the process signal, which is included in the training data based on the stored DNN learning model, was sent to the robot through the NI-9263 analog output module. The motion change command was transmitted to the controller and the robot's motion was controlled simultaneously. Figure 6 illustrates the structure of the DNN-based weld gap detection framework proposed in this study, which includes signal pre-processing, feature variable extraction, DNN model learning and prediction, and welding robot control. In the first step, a welding experiment was performed while the welding machine and robot were synchronized, and the welding current and voltage signals were acquired. In the second step, the signal during the robot's weaving time was extracted and analyzed in the time and frequency domains, and 24 feature variables were extracted during this process. In the third step, the DNN model was trained based on the extracted feature variables. In this process, labels were assigned as class 0 when the weld gap was 0 mm, class 1 when the weld gap was 2 mm, and class 2 when the weld gap was 4 mm, and the DNN model was trained. In the fourth step, the classification result of the DNN model for the feature variable derived by real-time signal processing as a verification process for the process signal, which is included in the training data based on the stored DNN learning model, was sent to the robot through the NI-9263 analog output module. The motion change command was transmitted to the controller and the robot's motion was controlled simultaneously. To select the optimal DNN model structure for monitoring the weld gap, five DNN structures were selected by adjusting parameters such as the number of hidden layers and the number of nodes in the hidden layer, and these five structures were trained during 2000 epochs. Values such as training loss, validation loss, training accuracy, and validation accuracy were derived after the completion of training, and are listed in Table 5.  To select the optimal DNN model structure for monitoring the weld gap, five DNN structures were selected by adjusting parameters such as the number of hidden layers and the number of nodes in the hidden layer, and these five structures were trained during 2000 epochs. Values such as training loss, validation loss, training accuracy, and validation accuracy were derived after the completion of training, and are listed in Table 5. Batch normalization [28] and dropout [29] were introduced to solve the problem of internal covariate shift, which is difficult for DNN models to learn, and to prevent overfitting. In this study, DNN Structure 3 with the lowest validation loss and highest accuracy was adopted, based on the performance results derived after completion of the learning of five DNN structures, as illustrated in Figure 7. The training network structure in the learning process of the DNN model is presented in Table 6. In this process, the weights were initialized randomly using rectified linear unit (ReLU) [30] as the activation function and Adam [31] as the optimizer. In addition, batch normalization and dropout were placed in the next layer following the dense and activation function layers to prevent overfitting. The dropout rate was set to 0.5. Batch normalization [28] and dropout [29] were introduced to solve the problem of internal covariate shift, which is difficult for DNN models to learn, and to prevent overfitting. In this study, DNN Structure 3 with the lowest validation loss and highest accuracy was adopted, based on the performance results derived after completion of the learning of five DNN structures, as illustrated in Figure 7. The training network structure in the learning process of the DNN model is presented in Table 6. In this process, the weights were initialized randomly using rectified linear unit (ReLU) [30] as the activation function and Adam [31] as the optimizer. In addition, batch normalization and dropout were placed in the next layer following the dense and activation function layers to prevent overfitting. The dropout rate was set to 0.5.     The total data used in the training process were 4060 samples; the data were sent to the GPU with a batch size of 32. The entire dataset was divided into a training set (3248 samples) and a validation set (812 samples) in the ratio of 8:2. The number of iterations for training the proposed DNN model (epoch) was set to 2000, and the plot of training loss and validation loss according to the epoch is illustrated in Figure 8. Evidently, the validation loss converged to a final value of 0.2, and no overfitting phenomenon was observed. The total data used in the training process were 4060 samples; the data were sent to the GPU with a batch size of 32. The entire dataset was divided into a training set (3248 samples) and a validation set (812 samples) in the ratio of 8:2. The number of iterations for training the proposed DNN model (epoch) was set to 2000, and the plot of training loss and validation loss according to the epoch is illustrated in Figure 8. Evidently, the validation loss converged to a final value of 0.2, and no overfitting phenomenon was observed.

Bead Shape Control for Gap Compensation Using DNN
Additional welding experiments were performed to verify the performance of the proposed DNN-based weld gap monitoring and the weld deposition rate control algorithm. The test plate used for the additional experiments is depicted in Figure 9. Figure 9a depicts a test plate in which the weld gap changes in a stepwise manner based on the welding section, and Figure 9b depicts a test plate with a shape wherein the weld gap linearly changes from 0 to 5 mm. The setup in Figure 9a was used for the offline test, whereas that in Figure 9b was used for the real-time test.

Bead Shape Control for Gap Compensation Using DNN
Additional welding experiments were performed to verify the performance of the proposed DNN-based weld gap monitoring and the weld deposition rate control algorithm. The test plate used for the additional experiments is depicted in Figure 9. Figure 9a depicts a test plate in which the weld gap changes in a stepwise manner based on the welding section, and Figure 9b depicts a test plate with a shape wherein the weld gap linearly changes from 0 to 5 mm. The setup in Figure 9a was used for the offline test, whereas that in Figure 9b was used for the real-time test.

Weld Gap Monitoring Performance Evaluation (Offline)
To verify the performance of the proposed DNN-based weld gap detection model, the verification was performed through an offline test and online test. The data used in the verification process were new welding experiment data that were not included in the training data. The welding test plates used as the offline test data are shown in Figure 9a. Different gap sections were created for each section in a welding seam. A total of three test experiments were performed, and the results of the verification by the proposed DNN model for the corresponding test data are presented in Table 7 and Figures 10-12.
The DNN gap detection model exhibited an excellent detection accuracy of approximately 93.7% in relation to the three robot motions. Based on these excellent verification results, real-time tests were performed as described in the next section. The test plates used in the real-time verification experiments are shown in Figure 9b. The real-time verification was performed using test plates in which the weld gap linearly increased from 0 to 5 mm.

Weld Gap Monitoring Performance Evaluation (Offline)
To verify the performance of the proposed DNN-based weld gap detection model, the verification was performed through an offline test and online test. The data used in the verification process were new welding experiment data that were not included in the training data. The welding test plates used as the offline test data are shown in Figure 9a. Different gap sections were created for each section in a welding seam. A total of three test experiments were performed, and the results of the verification by the proposed DNN model for the corresponding test data are presented in Table 7 and Figures 10-12.     To verify the performance of the proposed DNN-based weld gap detection model, the verification was performed through an offline test and online test. The data used in the verification process were new welding experiment data that were not included in the training data. The welding test plates used as the offline test data are shown in Figure 9a. Different gap sections were created for each section in a welding seam. A total of three test experiments were performed, and the results of the verification by the proposed DNN model for the corresponding test data are presented in Table 7 and Figures 10-12.     The DNN gap detection model exhibited an excellent detection accuracy of approximately 93.7% in relation to the three robot motions. Based on these excellent verification results, real-time tests were performed as described in the next section. The test plates used in the real-time verification experiments are shown in Figure 9b. The real-time verification was performed using test plates in which the weld gap linearly increased from 0 to 5 mm.

Real-Time Welding Quality Control
The DNN-based weld gap monitoring and robot control system developed in this study was implemented based on LabVIEW software, and the entire system flowchart is illustrated in Figure 13. The system includes the signal measurement, robot motion trigger, feature extraction from new and frequency domains for welding current and voltage signals, normalization process for extracted features, and control of the robot based on the classification result of the saved DNN weight model.

Real-Time Welding Quality Control
The DNN-based weld gap monitoring and robot control system developed in this study was implemented based on LabVIEW software, and the entire system flowchart is illustrated in Figure 13. The system includes the signal measurement, robot motion trigger, feature extraction from new and frequency domains for welding current and voltage signals, normalization process for extracted features, and control of the robot based on the classification result of the saved DNN weight model.  Figure 14a depicts the experimental result of applying robot motion 1 to the w gap, which increases linearly from 0 to 5 mm. In this process, control of the welding ro was not performed. Figure 14b depicts the results of monitoring the weld gap in real t and controlling the robot with the proposed DNN-based model under the same weld conditions. The weld bead by the welding robot controlled according to the change in weld gap had a more uniform appearance than that of the uncontrolled weld bead, a the pressed weld bead did not appear. However, as shown in Figures 14b,c, a con shape was observed at the center of the bead owing to an error in the gap classificat result. This was considered as an enlarged bead because the welding speed was redu owing to the misclassification of class 2 (4 mm gap) in the 2 mm gap section. In contr in the uncontrolled weld bead, a concave shape was observed in the 3 mm-gap secti and the shape of the controlled weld bead was constant in all sections. The case, wher the weld gap not only increased linearly from 0 to 5 mm but also decreased, was verif as shown in Figure 15. In the real-time verification of the test plate with a decreasing w gap, the uncontrolled weld bead had a large size in the 0 mm gap section, and the siz the controlled weld bead was constant in all sections. However, in the real-time weld monitoring results shown in Figure 15c, it was confirmed that the weld bead was sligh  Figure 14a depicts the experimental result of applying robot motion 1 to the weld gap, which increases linearly from 0 to 5 mm. In this process, control of the welding robot was not performed. Figure 14b depicts the results of monitoring the weld gap in real time and controlling the robot with the proposed DNN-based model under the same welding conditions. The weld bead by the welding robot controlled according to the change in the weld gap had a more uniform appearance than that of the uncontrolled weld bead, and the pressed weld bead did not appear. However, as shown in Figure 14b,c, a convex shape was observed at the center of the bead owing to an error in the gap classification result. This was considered as an enlarged bead because the welding speed was reduced owing to the misclassification of class 2 (4 mm gap) in the 2 mm gap section. In contrast, in the uncontrolled weld bead, a concave shape was observed in the 3 mm-gap section, and the shape of the controlled weld bead was constant in all sections. The case, wherein the weld gap not only increased linearly from 0 to 5 mm but also decreased, was verified, as shown in Figure 15. In the real-time verification of the test plate with a decreasing weld gap, the uncontrolled weld bead had a large size in the 0 mm gap section, and the size of the controlled weld bead was constant in all sections. However, in the real-time weld gap monitoring results shown in Figure 15c, it was confirmed that the weld bead was slightly larger during a short period as it was misclassified as a 4 mm gap in the section where the weld gap decreased from 2 to 0 mm. In the real-time verification performed based on the DNN model trained with the experimental data obtained through the crossover experiment, although a detection error occurred, it was confirmed that the weld gap could be accurately recognized again after the occurrence of the error. As a result, when the gap increased and then decreased, the verification accuracies were confirmed to be 86% and 89.4%, respectively; therefore, it is considered that the proposed DNN-based quality management system through weld gap monitoring and real-time quality control can be applied to the field. Noticeably, an excellent performance was obtained under the 0 and 4 mm gap conditions under increasing gap conditions; however, the weld gap detection accuracy in the 2 mm gap section was slightly lower. In the 0 and 4 mm gap sections, an accuracy in excess of 90% was confirmed; however, in the 2 mm gap section, an accuracy of approximately 70% was confirmed. As shown in Figure 14c and Table 8, many prediction errors occurred at the point where the 0 mm gap section changed to 2 mm; hence, it can be confirmed that the welding speed was reduced and a larger bead was generated. In this process, the detection accuracy was also slightly lower at the beginning of the welding process from a section without a weld gap to a section with a weld gap. When the weld gap section was changed from 2 to 4 mm, there were almost no prediction errors. In this process, the detection accuracy was also slightly lower at the beginning of the welding process from a section without a weld gap to a section with a weld gap. When the weld gap section was changed from 2 to 4 mm, there were almost no prediction errors.     The same point can be confirmed in Figure 15c and Table 9; that is, the weld gap decreased. An accuracy of 93% was confirmed in the 2 and 4 mm gap sections, respectively, while an accuracy of 82% was confirmed in the 0 mm gap section. In this process, the prediction accuracy also decreased during the change from a section with a weld gap to a section without a weld gap, and the detection error increased at the beginning of the section change. The weld bead cross-sectional analysis results with and without weld deposition rate control are depicted in Figures 16 and 17, respectively. Figure 16    The same point can be confirmed in Figure 15c and Table 9; that is, the weld gap decreased. An accuracy of 93% was confirmed in the 2 and 4 mm gap sections, respectively, while an accuracy of 82% was confirmed in the 0 mm gap section. In this process, the prediction accuracy also decreased during the change from a section with a weld gap to a section without a weld gap, and the detection error increased at the beginning of the section change. The weld bead cross-sectional analysis results with and without weld deposition rate control are depicted in Figures 16 and 17, respectively. Figure 16 shows the weld cross-section for each section with a linearly increasing gap. Figure 16a-c depict cross-sectional images of the weld without weld deposition rate control, and Figure 16d-f depict cross-sectional images of the weld with controlled weld deposition rate based on the proposed DNN-based gap detection algorithm. Figure 17a-c depict the cross-sections of the weld without welding deposition rate control under the decreasing gap condition, and Figure 17d-f depict cross-sections of the weld with controlled weld deposition rate. As a result, from Figures 16 and 17, it was confirmed that the weld bead controlled by the proposed DNN-based weld gap monitoring and weld deposition rate control algorithm derived a constant leg length and theoretical throat thickness in each section regardless of the change in the weld gap. A real-time test was conducted to derive uniform weld beads through the use of the weld deposition rate control. At the beginning of the welding process, robot motions 1 and 3 were used, but the other welding conditions were kept constant. The experimental results for controlling the weld deposition rate are presented in Tables 10 and 11. The A real-time test was conducted to derive uniform weld beads through the use of the weld deposition rate control. At the beginning of the welding process, robot motions 1 and 3 were used, but the other welding conditions were kept constant. The experimental results for controlling the weld deposition rate are presented in Tables 10 and 11. The A real-time test was conducted to derive uniform weld beads through the use of the weld deposition rate control. At the beginning of the welding process, robot motions 1 and 3 were used, but the other welding conditions were kept constant. The experimental results for controlling the weld deposition rate are presented in Tables 10 and 11. The tables confirm that the proposed DNN-based weld gap detection model could accurately detect the increased and decreased weld gap, appropriately control the motion of the welding robot, and regulate the weld deposition rate to generate uniform beads. Furthermore, the cross-section of the test plates was analyzed to assess the welding quality. A weld bead of approximately 7 mm was generated for each weld gap region. Based on this real-time verification, the proposed DNN-based model can accurately detect gaps and achieve a suitable classification performance.

Conclusions
In this paper, we proposed a new welding gap-monitoring system based on a DNN without using additional devices. The robot and welding machine were synchronized, and a LabVIEW software-based signal measurement, analysis, determination, and control system was developed. The welding current and voltage signals were analyzed in the time and frequency domains, respectively. A total of 24 feature variables were derived and used as inputs to the proposed DNN model to train the model. In addition, a signal preprocessing software was developed to extract the corresponding feature variables in real time. The notable developments and results of this study are as follows: 1.
The proposed DNN-based gap detection model was trained based on the feature variables extracted from the welding current and voltage signals, leading to a training accuracy of approximately 94.3%.

2.
For both offline and online cases, the verification process was performed with data that were not included in the training data (obtained through additional experiments). In this process, average accuracies of 93.7% and 87.7% were obtained for offline and online cases, respectively. In the online test, the weld gap detection performance decreased slightly at the beginning of the section where the weld gap changed.

3.
The trained DNN model for weld gap detection and weld deposition rate control was verified using test plates with linear changing gaps (0-5 mm). The results indicate that uniform external welding beads were achieved by controlling the welding robot based on real-time weld gap detection results.
The real-time weld gap monitoring and weld deposition rate control system proposed in this study contribute to automation in shipbuilding; however, this study has certain limitations. Although the proposed DNN-based weld gap monitoring system exhibited excellent performance, the application of the model is limited owing to the welding conditions and welding experiments. Therefore, in future research, we plan to focus on the generalization of the proposed model and further improve the proposed weld gap monitoring and weld deposition rate control algorithm using additional data and an upgraded deep learning model.