<?xml-model href='http://www.tei-c.org/release/xml/tei/custom/schema/relaxng/tei_all.rng' schematypens='http://relaxng.org/ns/structure/1.0'?><TEI xmlns="http://www.tei-c.org/ns/1.0">
	<teiHeader>
		<fileDesc>
			<titleStmt><title level='a'>Generative adversarial networks (GAN) model for dynamically adjusted weld pool image toward human-based model predictive control (MPC)</title></titleStmt>
			<publicationStmt>
				<publisher>Elsevier</publisher>
				<date>05/01/2025</date>
			</publicationStmt>
			<sourceDesc>
				<bibl> 
					<idno type="par_id">10616213</idno>
					<idno type="doi">10.1016/j.jmapro.2025.02.053</idno>
					<title level='j'>Journal of Manufacturing Processes</title>
<idno>1526-6125</idno>
<biblScope unit="volume">141</biblScope>
<biblScope unit="issue">C</biblScope>					

					<author>Tianpu Li</author><author>Yue Cao</author><author>Qiang Ye</author><author>YuMing Zhang</author>
				</bibl>
			</sourceDesc>
		</fileDesc>
		<profileDesc>
			<abstract><ab><![CDATA[Gas Metal Arc Welding (GMAW) is a critical industrial technique known for its high productivity, flexibility, and adaptability to automation. Despite the significant advancements in robotic welding, challenges remain in fully automating the arc welding process, particularly due to the complex dynamics of the weld pool associated with GMAW. A human-robot collaborative (HRC) system where humans operate robots may conveniently provide the needed adaptive control to the complex GMAW. While in conventional HRC systems humans receive process feedback to make adaptive adjustments, we propose provide humans with predictive future feedback to further ease the human decision and reduce the needed skills/trainings. To this end, this study explores the integration of deep learning models, specifically Generative Adversarial Networks (GANs) combined with Gated Recurrent Units (GRUs), to model and predict the dynamic behavior of the weld pool during GMAW. By leveraging time-series data of torch movement and corresponding weld pool images, the proposed GRU-GAN model generates high-fidelity weld pool images, capturing the intricate relationship between speed variations and weld pool morphology. Through extensive experimentation, including the design of an acceptable Encoder-Decoder structure for the GAN, we demonstrate that incorporating both temporal and speed sequence information significantly enhances the model's predictive capabilities. The findings validate the hypothesis that dynamic torch speed adjustments, akin to those performed by skilled human welders, can be effectively modeled to improve the quality of automated welding processes. Future work will be devoted to human-based model predictive control (MPC) in an HRC environment.]]></ab></abstract>
		</profileDesc>
	</teiHeader>
	<text><body xmlns="http://www.tei-c.org/ns/1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xlink="http://www.w3.org/1999/xlink">
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="1.">Introduction</head><p>According to the International Federation of Robotics, "50% of the world's robots are used for welding. Specifically, 33% are used for spot welding, 16% perform arc welding, and 1% perform other types of welding operations" <ref type="bibr">[1]</ref> . While this clearly indicates that welding is a major application of robots, it also suggests that the robotization of arc welding processes lags behind, as there are far more arc welding operations than spot welding ones. This is primarily due to the lack of generalizable methods for robots to intelligently adapt to the process to ensure the quality of the welds produced. However, due to the slower-changing dynamics of arc welding processes compared to spot welding, skilled human welders are able to make adaptive adjustments to overcome the effect from process uncertainty to produce quality welds through observing the process <ref type="bibr">[2]</ref>. Human-robot collaboration (HRC) combining robot advantages with human welder flexibility and cognitive skills <ref type="bibr">[3]</ref> provides a generalizable method to robotize arc welding through human making high-level decision while robot performing high-precision and adaptive welding based on this decision. To be effective, humans are provided with immersive process feedback so that they can observe the process as at the site <ref type="bibr">[4]</ref>. For gas tungsten arc welding (GTAW) where the process is less fluctuating, weld pool image provides an immersive feedback <ref type="bibr">[5]</ref> so that HRC has been effectively used to robotize the process.</p><p>Gas metal arc welding (GMAW) is much more dynamic than GTAW and its fine control is difficult even for skilled welders. As such, despite its high productivity, GMAW is used for applications where the required welds may be made without fine adaptive control. For critical applications, GTAW is currently the primary choice despite the lower productivity. To extend GMAW and other highly dynamic welding processes beyond their current capability in making high quality welds, we propose to provide humans with predictive immersive process feedback so that the human can perform predictive control similar like a model predictive control which has proved to be effective in many applications <ref type="bibr">[6,</ref><ref type="bibr">7]</ref>. To this end, we propose to generate future process feedback. For GMAW, this will be the future weld pool images.</p><p>We can consider an arc welding process as a dynamic system</p><p>) where the process output &#119910;&#119910; is the weld pool (image). The input &#119906;&#119906; is the welding parameters that are adaptively adjusted. Welding conditions and other welding parameters that are not intentionally adjusted during welding process are reflected in the model &#119891;&#119891; . For a human operated GMAW process, the wire feed speed which dictates the welding current &#119868;&#119868; <ref type="bibr">[8]</ref> and welding voltage &#119881;&#119881; are pre-determined, thus fixed during welding process. The arc power &#119875;&#119875; = &#119881;&#119881;&#119868;&#119868; (&#119869;&#119869;/&#119904;&#119904;) and wire melting speed &#119872;&#119872; &#775; (g/s) are thus considered not adjustable during the process. As the welding process is primarily controlled by the heat input &#8462; = &#119875;&#119875;/&#119907;&#119907; (J/mm), the heat supplied in the workpiece along a unit length of weld, and the mass input &#119898;&#119898; = &#119872;&#119872; &#775;/&#119907;&#119907; (g/mm), the welding speed &#119907;&#119907; is the primary variable to realize the real-time control. Its adjustment can be conveniently realized by the welder through manipulating the welding torch. We note that human welder can also manipulate the torch to change the torch angle to provide more complex control on the process. In this study, we will only adjust the welding speed with the torch being vertical to the workpiece similar as in most robotic GMAW processes. As such, the input will be &#119906;&#119906; = &#119907;&#119907;.</p><p>We envision that in an HRC welding system, a human observes the welding process through the real-time captured weld pool image and adjusts a virtual tool to command the robot to change the welding speed.</p><p>In addition to this typical way of HRC, we propose that the system also predicts the future weld pool (image) per the change in the virtual tool (welding speed). If the future weld pool is not desirable (is not in the desired trajectory to converge to the desired output &#119910;&#119910; * ), the human will keep his/her fine adjustment. In this way, the human performs a model predictive control on a complex process whose output (weld pool image) is unconventional. The future output as a function of the input is predicted through the generated future weld pool image. The optimized input corresponding to the desirable future weld pool is realized by the human through stopping the adjustment of the virtual tool. Section 2 and 3 will review related works to analyze the state of the art to identify the challenges and then outline our overall strategy to address the complexity of underlying modeling problem. The experimental system and experimental data will be introduced in Section 4 before Section 5 is devoted to the details of the modeling methodology. The results are presented and discussed in Section 6, before the conclusions are drawn in Section 7.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>This study aims at developing a model &#119910;&#119910;[&#119905;&#119905;</head></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="2.">Related Works</head><p>HRC welding may provide a solution to enable a quick response to dynamic changes in the GMAW process.</p><p>Since HRC has already been recognized in micro-manufacturing, which refers to the processes of manufacturing, aligning, connecting, packaging, and testing devices across multiple size scales (typically from 1 micron to 1 centimeter) <ref type="bibr">[9]</ref>, theoretically, using HRC in welding offers sufficient precision. A fundamental function of HRC is that humans control the machine/robot. Therefore, the robot needs to perceive human instructions and provide feedback to the human operator to assist in making better decisions <ref type="bibr">[4]</ref>. An important question is what information the machine should provide to the human, and how this information should be presented to maximize its effectiveness. Typically, in HRC environments, information feedback and AI assistance are presented to humans through various devices and technologies.</p><p>Since the welding process is complex and dynamic, using high-definition multimedia can better help humans perceive and interpret the environment around the robot for high-precision welding trajectory planning. We believe that using virtual reality technology to present information to humans is the best option. Wang et al. <ref type="bibr">[5]</ref> were among the first to use virtual reality technology for coordinated control in human-robot collaborative welding. By using an HDR (high dynamic range) camera in front of the welding torch to construct a digital twin welding system, it allows humans to be immersive as in the welding site.</p><p>Conventional HRC welding as in <ref type="bibr">[5]</ref> provides human welders with the welding process feedback at the present time, either directly by the weld pool images and or by enhanced weld pool images. The predictions are made in welders mind to decide on the control. The performance of the resultant control largely depends on welder skills which require significant training and many years of practices to gain. Providing process prediction as proposed in this work can reduce the skill levels required. However, the predictive model needed and its complexity are process dependent. In GMAW, the weld pool, as process feedback to humans, is not only influenced by many input parameters, but also by the impact of the welding torch's movement speed on the pool. This is a complex dynamic process, as the fluid dynamics of the pool itself are intricate, and the speed's effect on the pool's morphology exhibits both lag and limitations <ref type="bibr">[10]</ref>.</p><p>Therefore, developing a predictive model for human welders in HCR appears to be challenging and an innovative approach is needed.</p><p>The incorporation of machine learning techniques to make welding systems intelligent is a solution that can result in high product quality and cost-effective solutions, which has led to extensive consideration by researchers and industrialists <ref type="bibr">[11]</ref>. Yu et al. <ref type="bibr">[12]</ref> studied how the deep learning has been a game changer in predicting the weld penetration occurring underneath the workpiece from other measurable phenomena.</p><p>Mucllari et al. <ref type="bibr">[13]</ref> used GAN models to correlate measurable weld pool as represented by weld pool images to the images on the back-side of the workpiece representing the weld penetration state. It shows that the current weld pool is not, but the history of the weld pool is, sufficient to predict the back-side image. As such, it suggests that the human welders control the weld penetration based on the dynamic evaluation of their observed weld pool. Liu et al. <ref type="bibr">[14]</ref> concluded that the empirical skills of the human welders have a crucial role in the production of high quality welding, and proposed an Adaptive Neuro-Fuzzy Inference System (ANFIS) to model the response of the skilled human welders to the molten pool surface. Hu et al. <ref type="bibr">[15]</ref> described the behavior and forming appearance of the molten pool on a complex surface by developing a computational fluid dynamics model of the molten pool that considers droplet impact, gravity, arc force, heat and mass transfer. Fewer current studies have considered the idea of dynamic adjustment of the welding process by human welders. Although Mucllari et al. <ref type="bibr">[13]</ref> constructed a reverse model to validate the forward process, they focused on the GTAW process as well as the effects of the top image and current parameters. While the GMAW process is more complex compared to the GTAW welding molten pool state, the speed of the torch movement has a greater impact on the welding molten pool state. So it is meaningful to explore the effect of welding speed on the weld pool in the GMAW process, and the HRC system constructed by this model allows the human welder to optimize the speed by adjusting the speed in real time according to the state of the weld pool. However, there is a lack of in-depth exploration of the process to build the model, for example, if the welding speed information is sufficient to be responsible to changes in the weld pool, and how long a time series of welding speed information is needed to account for such changes.</p><p>The development of deep learning models based on Convolutional Neural Networks (CNNs) has given robotic welding the opportunity to acquire and process the dynamic behavior of the welding process and construct plausible models based on a simplified computational fluid dynamics process. For the welding process with temporal characteristics, Recurrent Neural Network (RNN) <ref type="bibr">[16]</ref> solved the problem that traditional neural networks cannot handle sequential data. In order to overcome the shortcomings of RNN in long sequence processing, Hochreiter and Schmidhuber <ref type="bibr">[17]</ref> proposed Long Short-Term Memory Network (LSTM) in 1997. In order to improve the computational efficiency, Cho et al. <ref type="bibr">[18]</ref> proposed the gated recurrent unit (GRU) in 2014 that simplifies the structure of LSTM by combining the input and forgetting gates of LSTM into an update gate, while omitting the output gate. This makes GRU more efficient with similar performance to LSTM. Li et al. <ref type="bibr">[7]</ref> used an LSTM cell integrated into a U-Net network to obtain complex information contained in the time-series welding process and used it to reconstruct the complex state of the weld pool. Exploring the effect of torch movement speed (welding speed) on the dynamics of the weld pool involves the use of low-dimensional features to predict high-dimensional complex image information. Generative Adversarial Networks (GANs, Generative Adversarial Networks) are widely used in generating high-dimensional images from low-dimensional information. GANs were developed by Ian Goodfellow et al. <ref type="bibr">[19]</ref> in 2014, and its basic idea is to gradually improve the ability of the generator through the mutual confrontation of two networks, Generator and Discriminator, so that it can generate highdimensional data similar to the distribution of real data. The low-dimensional information of the welding torch moving speed in the input is used to obtain the high-dimensional information of the dynamic behavioral image of the welding pool using the GAN network in fact to construct a plausible model by avoiding the influence of complex hydrodynamic calculations and other welding parameters.</p><p>Accurately modeling the dynamic system of the weld pool is crucial for optimizing welding processes and improving weld quality. It is necessary to dynamically model the controlled welding process in order to predict the state of the weld pool at the next moment. Common methods for building such models are based on fundamental theories of thermodynamics, fluid mechanics, and heat transfer, using mathematical equations to describe the temperature field, velocity field, and shape changes of the weld pool. Rosenthal, D <ref type="bibr">[20]</ref>, proposed a mathematical theory to describe heat distribution during welding, building a dynamic model of the welding process based on experimental data. Wu et al. <ref type="bibr">[21]</ref> further digitized the physical processes, using numerical simulation to model fluid flow and heat transfer within the weld pool. They developed a transient numerical model to study the dynamic behavior of full-penetration GTAW. Building on previous efforts, for the issue of controlling the depth of the weld pool in the GMAW process, a dynamic model of the weld pool was established, and an MPC (Model Predictive Control) strategy was used to predict and control the pool depth in real time. This brought the accuracy and stability of dynamic weld pool state control to a new level <ref type="bibr">[6]</ref>. MPC can handle the complex nonlinearities and system uncertainties in the GMAW process. It has been applied to control the backside weld bead width in pulsed GMAW, optimizing heat input through feedback from electrical characteristic signals to achieve the desired weld geometry <ref type="bibr">[22]</ref>.</p><p>Additionally, MPC has been used to regulate droplet detachment frequency and arc length, allowing consistent weld quality across different operating conditions <ref type="bibr">[23]</ref>. Further, a robust MPC algorithm has been developed to control a process where the model parameters are uncertain with the uncertainty being quantified using intervals <ref type="bibr">[24]</ref> and been used to control the complex welding processes <ref type="bibr">[25]</ref><ref type="bibr">[26]</ref><ref type="bibr">[27]</ref> including GMAW <ref type="bibr">[26]</ref> and its novel modification double-electrode GMAW <ref type="bibr">[27]</ref>. However, in all previous MPC-based welding process controls, the welding process has been represented by carefully chosen states and outputs.</p><p>It has not been applied to an "original" welding process where the "original" states and outputs are highdimensional-specifically, approximately infinite-dimensional raw phenomena like welding pool images that have not been reduced to low-dimensional variables.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="3.">Overall Modeling Strategy</head><p>Most deep learning-based weld penetration monitoring studies use observable complex phenomena &#926; (high dimensional data) as input to predict low dimensional labels. The high-dimensional data contains both correlated and uncorrelated features that may be extracted to match with the labels. Validation data may also contain the same irrelevant features, and using the validation results to measure model quality is a compromise since there is no other better measure. However, in generative modeling, low-dimensional data is used to predict complex high-dimensional data. The fundamental role of simple inputs in determining complex outputs can be better secured if modeling is successful <ref type="bibr">[2]</ref>. In the images we have captured experimentally, we can clearly see the changes in the size and shape of the resulting molten pool with the change in the moving speed of the torch, as shown in Fig. <ref type="figure">1</ref>. We can preliminarily conclude that there is a certain relationship between the moving speed of the torch and the size of the molten pool formed. Therefore, we can establish a preliminary hypothesis that the low-dimensional data of the change in speed will have a correlation with the high-dimensional data of the image of the change in the size of the weld pool. Our initial aim is to validate this model in some way.</p><p>On this base, we propose conducting research through generative modeling. We denote the weld pool as represented by its image as &#119910;&#119910;[&#119905;&#119905;], and welding speed as &#119906;&#119906; <ref type="bibr">[&#119905;&#119905;]</ref>. We intend to establish a GAN <ref type="bibr">[16]</ref>  The image &#119910;&#119910;[&#119905;&#119905; + 1] displayed to the human operator will continuously update in real-time as long as the human adjustment continues. The &#119906;&#119906;[&#119905;&#119905;] will be sent to the robot for execution once the adjustment is below the pre-set threshold. Since the original GAN model lacks direct control over specific attributes of the generated samples during the generation process, we employ a Conditional GAN <ref type="bibr">[28]</ref>. When designing a generator for Conditional GAN (CGAN) [28], the first thing that should be considered is whether the depth and breadth of the generating structure can generate a clear enough image of the weld pool. If a too deep network is chosen directly it may lead to overfitting or unstable training. We propose to use a symmetric Encoder-Decoder structure and test it with different depths to generate &#119910;&#119910;[&#119905;&#119905;] from itself.</p><p>Using the same image as the input and output assures the raw input information is 100 percent sufficient so that the acceptability of the proposed structure will only depend on if the Encoder can adequately extract the image features and the Decoder can generate the same image from the features. Because this also allows the high dimension information (image) directly compared, the generatability of the proposed structure can be accurately assessed. Further, as the features extraction from the image and the same image is generated from the same features are inverse mappings, we propose to use the same depth for the Encoder and Decoder so that we can gradually increase the depth to find the optimal depth. This makes the process/effort to determine the optimal structure/depth more manageable. In case there is a difference in the optimal depths for them, as long as it is not too significant, the resultant depth is still optimal in balancing the sufficiency with overfitting/training instability (caused by excessive depth).</p><p>We have two types of conditions, image and signal (welding speed). As we have decided an optimal structure to introduce the image condition, we will use it and consider a separate way to introduce the signal (welding speed) condition and then concatenate them together. This results in a change in the Decoder (input) and theoretically may call for an increase in its depth. However, in this first study of this kind, we will still use the same depth with an eye open for the possibility to slightly increase it. Further, the two conditions both dynamically contribute the underlying welding process. We propose to apply a RNN (Recurrent Neural Network) to each of them to form the two separate information/features and finally concatenate them together as the input condition of the Decoder. The final model structure is illustrated in Fig. <ref type="figure">2</ref> and details will be discussed in Section 5.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="4.">Experiments</head><p>GMAW process <ref type="bibr">[8]</ref> can be simply explained by Figure <ref type="figure">3</ref>. The heat for melting the metal is generated by the arc between the consumable electrode and the metal. The electrode is a wire that is continuously fed/melt through the arc. During welding, an inert gas (such as helium and argon) or its mixture with of other gases is supplied to the welding area to shield and protect the arc, the weld pool, the electrode, and the base material nearby from interacting with the atmosphere. The weld pool is formed by the heat from the arc generated between the continuously fed filler metal (electrode) and the workpiece. The arc also melts the electrode, forming droplets at the electrode tip. These droplets detach from the electrode tip and are transferred to the workpiece through the arc. Under the heat from the arc and droplets as well as the periodic impact from the droplets, the weld pool gradually forms. The formation of droplets, their detachment and transfer, and the resultant dynamic changes in the weld pool are controlled in an extremely way by the fluid flow, forces, heat within the droplets and the weld pool, and the arc (thus heat and forces imposed on the weld pool) that fluctuates in association with the periodic formation, growth, detachment, and flight of the droplets. In particular, the arc length, thus the distribution of the arc (heat and force distributions), is subject to a periodic change. The welding current (thus the arc pressure which is proportional to the square of the welding current) is also continuously adjusted by the welding system to balance the melting and feeding of the wire, thus to maintain the arc stability <ref type="bibr">[29]</ref>. The state of the weld pool is thus controlled affected by multiple parameters and reflect the state of the welding process and the quality of the resultant welds. Figure 3 Gas Metal Arc Welding (GMAW) [8] The question arises why a mapping like &#119910;&#119910;[&#119905;&#119905;] = &#119891;&#119891;(&#119910;&#119910;[&#119905;&#119905; -1], &#8230; &#119910;&#119910;[&#119905;&#119905; -&#119901;&#119901;], &#119906;&#119906;[&#119905;&#119905; -1], &#8230; &#119906;&#119906;[&#119905;&#119905; -&#119902;&#119902;]) or its derivation &#119910;&#119910;[&#119905;&#119905; + 1] = &#119891;&#119891;(&#119909;&#119909;[&#119905;&#119905;], &#119906;&#119906;[&#119905;&#119905;]</p><p>) may model such a complex process as aforementioned. We note that the wire feed speed, which is fixed, dictates the welding current needed for the welding machine to maintain the balance between the feeding and melting of the wire and the current controls the arc force and the electromagnetic force to detect the droplet. The current and arc length (thus the arc voltage) determined by the phase of the droplet in its forming, growing and detaching period decide the power of the arc. The arc power and welding speed decide the heat input into the weld pool. As such, the wire feed speed and welding speed are the source control variables to determine the fluctuating periodical dynamic process of the weld pool. The weld pool reflects the results of the welding process as well as the influence from other uncontrolled variables and the sate of the welding process in the periodical fluctuations. When the wire feed speed is fixed, the source control variable is the welding speed. In the meantime, the dynamically changing welding process state as reflected in the weld pool image history captures the phase in the periodical change. The proposed model inputs are thus expected to be sufficient to predict the next weld pool (image) and the success in obtaining the mapping will depend on the modeling approach for which we have proposed using CGAN.</p><p>We used two 6-degree-of-freedom (DOF) robots, the UR10e and UR16e, as a welding robot and a monitoring robot, respectively (Fig. <ref type="figure">4</ref>). The Xiris HDR weld camera XVC-1100, a high dynamic range (HDR) camera for monitoring of open-arc processes, was mounted on the monitoring robot to capture images of the arc and the weld pool. A bandpass filter centered at 650 nm was mounted on the lens to filter out strong arc light. We used a PC to control the speed and direction of the welding robot and to monitor the robot's movement according to the control instructions. We set the welding power source to operate at a high voltage of 40.8V in constant voltage mode to ensure minimal spatter and good bead appearance in the spray transfer mode. Under these conditions, the welding circuit can be simply regarded as an inductive load, with current undergoing periodic highfrequency variations. The fluctuations in current parameters have negligible effects during this process. The welding parameters were controlled by a computer using a PCI-6229 National Instruments data acquisition card running in C++. We conducted a total of 19 experiments, capturing 30 images per second, resulting in a usable image dataset of 19,184 images after preliminary processing. </p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="5.">Modeling Methodology</head></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="5.1">Conditional GAN</head><p>In 2014, Mirza et al. <ref type="bibr">[28]</ref> proposed the Conditional GAN (CGAN), as illustrated in Figure <ref type="figure">5</ref>. The core idea of CGAN is to introduce additional conditional information into the original GAN architecture, allowing the generator and discriminator to consider conditional variables simultaneously during training. CGAN extends the input space of both the generator and discriminator by incorporating a conditional variable &#119888;&#119888;. In the generator, the input consists of noise &#119911;&#119911; combined with the conditional variable &#119888;&#119888;, enabling the generation of samples &#119866;&#119866;(&#119911;&#119911;|&#119888;&#119888;) that are related to the condition &#119888;&#119888;. The conditional variable &#119888;&#119888; can take various forms, such as class labels, text descriptions, or image attributes. In the discriminator, the task is not only to judge the authenticity of the input sample but also to predict according to the corresponding conditional variable. The objective function of CGAN has two components: first, the ability to distinguish between real and fake samples, and second, the accurate prediction of the conditional variable &#119888;&#119888;. Therefore, the loss function consists of two parts: the generator loss &#119871;&#119871; &#119866;&#119866; , which encourages the discriminator &#119863;&#119863; to classify the generated sample &#119866;&#119866;(&#119911;&#119911;|&#119888;&#119888;) with the corresponding condition &#119888;&#119888; as "fake" maximizing &#119897;&#119897;&#119897;&#119897;&#119897;&#119897;(1 -&#119863;&#119863;(&#119866;&#119866;(&#119911;&#119911;|&#119888;&#119888;), &#119888;&#119888;)); and the discriminator loss &#119871;&#119871; &#119866;&#119866; , which encourages &#119863;&#119863; to correctly differentiate between the real sample (&#119883;&#119883;, &#119888;&#119888;) and the generated sample (&#119866;&#119866;(&#119911;&#119911;|&#119888;&#119888;), &#119888;&#119888;) , minimizing &#119864;&#119864; (&#119883;&#119883;,&#119888;&#119888;)&#8764;&#119875;&#119875;(&#119883;&#119883;,&#119888;&#119888;) &#65533;&#119897;&#119897;&#119897;&#119897; &#119897;&#119897;&#65533;&#119863;&#119863;(&#119883;&#119883;, &#119888;&#119888;)&#65533;&#65533; + &#119864;&#119864; &#119911;&#119911;&#8764;&#119875;&#119875;(&#119911;&#119911;) [&#119897;&#119897;&#119897;&#119897;&#119897;&#119897; (1 -&#119863;&#119863;(&#119866;&#119866;(&#119911;&#119911; | &#119888;&#119888;), &#119888;&#119888;))]. In this work, we will implement the Wasserstein GAN and use the Wassetstein loss <ref type="bibr">[39]</ref> &#8466; &#119863;&#119863; = &#119864;&#119864; &#119909;&#119909;~&#119901;&#119901; &#119889;&#119889;&#119889;&#119889;&#119889;&#119889;&#119889;&#119889; (&#119909;&#119909;) [&#119863;&#119863;(&#119909;&#119909;)] -&#119864;&#119864; &#119911;&#119911;~&#119901;&#119901; &#119911;&#119911; &#65533;&#119863;&#119863;&#65533;&#119866;&#119866;(&#119911;&#119911;)&#65533;&#65533; (4)</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="5.2">Encoder-Decoder</head><p>We use an Encoder-Decoder structure to extract information and then to generate weld pool image. The Encoder-Decoder structure was initially proposed by Ilya Sutskever et al. <ref type="bibr">[30]</ref> in 2014 for handling sequence-to-sequence (Seq2Seq) tasks, and it has demonstrated strong expressiveness when adapted to image data. Due to the complexity of weld pool images, traditional Multi-Layer Perceptrons (MLP) <ref type="bibr">[31]</ref> struggle to generate usable images. An MLP is a type of feedforward neural network typically consisting of an input layer, multiple hidden layers, and an output layer. Each neuron in a layer is fully connected to the neurons in the previous layer, and the network performs nonlinear transformations using activation functions such as ReLU or Sigmoid. The design of MLPs is relatively simple, and they are generally used for tasks like classification and regression, where both the input and output have fixed dimensions.</p><p>However, the Encoder-Decoder structure is more suited for handling complex data like images. It generally consists of two main components: the encoder and the decoder. The encoder's task is to compress the input data into a low-dimensional latent space representation, typically achieved using Convolutional Neural Network (CNN) (Fig. <ref type="figure">6</ref>). The decoder is then responsible for reconstructing this latent representation into the output data (Fig. <ref type="figure">6</ref>), such as an image or a label map.</p><p>Figure <ref type="figure">6</ref> Encoder-Decoder structure <ref type="bibr">[30]</ref> The Encoder-Decoder structure is viable for reconstructing weld pool images. Silva et al. <ref type="bibr">[32]</ref> studied the role of the Encoder-Decoder design in machine learning (ML) from an information-theoretic perspective.</p><p>They validated the usefulness of predictive structures in ML by examining information sufficiency and mutual information loss. In our study, we use 64x64x1 weld pool images as input and propose constructing Encoder-Decoder models with varying depths to determine the necessary depth for reconstructing usable weld images. We configure each convolutional/deconvolutional layer with a kernel size of 4x4, a stride of 2x2, and padding of 1. We test Encoder-Decoder models with depths of 4, 5, 6, 9, 11, and 13 layers. Since the goal is to assess the model's ability to reconstruct image information, we input a single weld pool image and output a reconstructed image to evaluate the model's effectiveness. The CGAN used in this study (Figure <ref type="figure">7</ref>) employs an Encoder-Decoder structure for the generator, while the discriminator uses an Encoder structure. The parameters for the GAN are set as shown in Table <ref type="table">1</ref>.</p><p>Figure <ref type="figure">7</ref> Validating GAN with Encoder-Decoder Layers Table <ref type="table">1</ref>. GAN parameters.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>Parameters Values</head></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>&#119885;&#119885;-dim 100</head><p>Epoch 300</p><p>Learning rate 9e-5</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>Loss function Wasserstein</head><p>Batch size 64 We set the learning rate appropriately and chose a sufficient number of training epochs, as it is clear from the training loss of the most structurally complex Encoder-Decoder model with 13 layers of depth that the generator loss has stabilized at around 0.06 in about 50 Epochs (Fig. <ref type="figure">8</ref>).</p><p>Only use the generator loss to judge the adequacy of the information in the generated images is not a comprehensive measure of the quality of the generated images. Zhao et al <ref type="bibr">[33]</ref> pointed out that the generator loss is not sufficient to assess the quality of the generated images because the generator loss usually focuses on pixel-level differences or the discriminative ability of the model and does not adequately reflect the perceptual quality of the images, especially in preserving the image structure and details. Meanwhile, the most widely used full-reference quality metric, mean square error (MSE), is easy to compute and optimize but does not match well with the perceived visual quality of the human visual system <ref type="bibr">[34]</ref>. So, we add the parameter Structural Similarity Index Metric (SSIM), which was proposed by Wang et al <ref type="bibr">[35]</ref> in 2004 as a metric to measure the similarity between two images. It evaluates the quality of an image by comparing its brightness, contrast and structural information and is an important tool in image quality assessment. The value of SSIM ranges from 0 to 1, where 1 means that the two images are exactly the same and 0 means that the two images are completely different. Unlike the traditional MSE, SSIM is more in line with the human visual system's perception of image quality. The SSIM is defined as:</p><p>where, &#120583;&#120583; &#119909;&#119909; , &#120583;&#120583; &#119910;&#119910; , &#120590;&#120590; &#119909;&#119909; , &#120590;&#120590; &#119910;&#119910; denote respectively the mean and standard deviation of the images &#119909;&#119909;: = &#119868;&#119868; &#119905;&#119905; and &#119910;&#119910; &#8788; &#119868;&#119868; &#770;&#119905;&#119905; , &#119862;&#119862; 1 = (&#119870;&#119870; 1 &#119871;&#119871;) 2 and &#119862;&#119862; 2 = (&#119870;&#119870; 2 &#119871;&#119871;) 2 with &#119870;&#119870; 1 , &#119870;&#119870; 2 &#8810; 1 and L = pixel max value. In order to avoid instability when &#120583;&#120583; &#119909;&#119909; 2 + &#120583;&#120583; &#119910;&#119910; 2 and &#120590;&#120590; &#119909;&#119909; 2 + &#120590;&#120590; &#119910;&#119910; 2 are very close to zero, we employ &#119862;&#119862; 1 and &#119862;&#119862; 2 , which are constants, to prevent division by a small number. SSIM was first introduced in <ref type="bibr">[35]</ref> to measure the difference between two images by considering the luminance, contrast and the structure. DSSIM (Difference Structural Similarity Index Measure) is a variant or complement of the SSIM, which is used to measure the difference between two images, defined as:</p><p>Also, the loss function we designed to train the generator is the following weighted loss:</p><p>The number of layers of Encoder and Decoder under the same structure is the same. After training the models with different structures, we get the final SSIM values as shown in Table <ref type="table">2</ref>. From the SSIM values, with the increase in the number of layers the image information is more adequately restored, which is reasonable since the depth and complexity of the network is increasing. It also proves that the generation of images of weld pool requires a deep network. However, the SSIM values for models with more than 6 layers do not change significantly while humans can observe the increase in the details when the generated images approach the real (Fig. <ref type="figure">9</ref>). So, we need to refer to human perception vision as the final measure, in particular for the intended application in HRC systems.</p><p>From Fig. <ref type="figure">9</ref>, it can be observed that the images generated in the 4-layer, 5-layer, and 6-layer models are very similar and fuzzy, and lack detailed information, indicating that the depth of the network is not sufficient to accurately extract and accurately restore the image information. After exceeding 9 layers, the image clarity increases to a usable state, indicating that the depth of the network at this point is sufficient to extract and restore the information of the original image. Based on the experimental results, we conclude that an Encoder-Decoder model with a depth of at least 9 layers is required to generate the weld pool image. It is also observed that there is little difference in the results at 9 layers compared to 11 layers and 13 layers, but in practice, training with 11 and 13 layers requires exponentially more resources, especially a large amount of GPU memory. Choosing the appropriate depth of the network can reduce the consumption of computational resources while guaranteeing the performance of the model <ref type="bibr">[36]</ref>, and the Encoder-Decoder model with a 9-layer structure is thus chosen for generating weld pool images.</p><p>Figure <ref type="figure">9</ref> Generate results for different layers</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="5.3">GRU-GAN Model</head></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="5.3.1">GRU Model</head><p>We will use a GRU to process the time series of the extracted image features (hidden state). GRU (Figure <ref type="figure">10</ref>) is a simplified version of LSTM <ref type="bibr">[37]</ref>, proposed by Cho et al. <ref type="bibr">[18]</ref> in 2014. Compared to LSTM, GRU merges the input gate and forget gate into a single update gate and uses a reset gate to control the influence of the previous state on the current state. The update gate determines the extent to which the hidden state at the current time step inherits information from the previous hidden state. The reset gate controls the influence of the previous hidden state on the current candidate hidden state. The candidate hidden state is a candidate value calculated based on the current input and the reset hidden state, and the updated hidden state combines the candidate hidden state with the hidden state of the previous time</p><p>step to some extent. There are many noteworthy GRU variants with excellent performance, such as GORU <ref type="bibr">[38]</ref>, etc.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="5.3.2">GRU-GAN Generator</head><p>We have determined to use a 9-layer Encoder-Decoder structure and thus design the Encoder shown in Fig. <ref type="figure">10</ref> to process image inputs, first resizing each input to 64x64x1, followed by 9 layers of Conv2D, where all convolutional layers use a kernel size of 4, a stride of 2, and a padding size of 1. Batch normalization is applied after the 3rd and 6th layers. Finally, all &#119910;&#119910;[&#119905;&#119905; -&#119894;&#119894;]&#8242;s are concatenated together.</p><p>The speed data is processed using the same method as the CNN 1D approach employed by Mucllari et al. <ref type="bibr">[2]</ref>. This input consists of &#119906;&#119906;[&#119905;&#119905; -&#119895;&#119895;]&#8242;s, which are passed through two 1D convolutional layers (CNN 1D). Both layers use a kernel size of 3, with the number of channels set to 3 and 6, respectively. The output of these layers is then merged with the output of the GRU and reshaped into a 512x1x1 format. This output is then used as the input to the Decoder. The Decoder model consists of 9 layers of 2D transposed convolution, with each layer using a kernel size of 4, a stride of 2, and a padding size of 1. Batch normalization is applied after the third and sixth layers. Finally, the output is resized to 64x64x1, which is the predicted weld pool image &#119910;&#119910;[&#119905;&#119905;] (Fig. <ref type="figure">11</ref>). The loss function for training the GRU model is based on the "Wasserstein" loss <ref type="bibr">[39]</ref>: see (??).</p><p>In our training, an additional setting was set to apply exponential learning rate decay every 10 epochs with a decay coefficient of 0.9.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="5.3.4">GRU-GAN Discriminator</head><p>The discriminator uses a 5-layer Encoder structure, where all convolutional layers have a kernel size of 4 and a stride of 2. The padding size is set to 0 for the final layer and 1 for the other layers. Batch normalization <ref type="bibr">[40]</ref> is applied between layers, and a Leaky ReLU with a coefficient of 0.2 is used. The last layer of the discriminator employs a sigmoid activation function. This architecture is illustrated in Figure <ref type="figure">12</ref>. The inputs to the discriminator are the real image at time &#119910;&#119910;[&#119905;&#119905;] and the generated image created by the generator using the previous images and speed data.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="6.">Results and Discussion</head></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="6.1">Dataset</head><p>The training was conducted using two datasets: a large dataset with 19,184 images and a small dataset with 1,000 images. To demonstrate that the impact of speed and temporal information on the weld pool is significant and easily identifiable, it is equivalent to proving that our model performs well even when trained on the small dataset. We divided the datasets into training and testing subsets, with 80% used for training and the remaining 20% for testing. We conducted comparative experiments on these two datasets, using generator loss (&#8466; &#119866;&#119866; ) and SSIM <ref type="bibr">[35]</ref> as evaluation metrics. Figure <ref type="figure">13</ref> shows the changes in &#8466; &#119866;&#119866; and SSIM for both the Large Dataset and Small Dataset across epochs. It is clear that the &#8466; &#119866;&#119866; for the small dataset is only slightly larger than that for the large dataset, by less than 0.01, which can be considered negligible. The SSIM values for both datasets fluctuate around 0.915, with the small dataset generally exhibiting slightly higher SSIM values. The most notable difference between the two datasets is that the &#8466; &#119866;&#119866; for the small dataset stabilizes more quickly. Therefore, using the small dataset for this model over 300 epochs is sufficient. (Fig. <ref type="figure">14</ref>)</p><p>Figure <ref type="figure">14</ref> Generate results with different dataset sizes</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="6.2">Effects of Time-series Images</head><p>To study the effect from previous images, we need first determining the appropriate length &#119901;&#119901; which has been introduced in the Introduction. Clearly, calculating this theoretically is very difficult because too many factors influence the dynamic process. We observed that, whenever there was a significant change in speed, the weld pool would exhibit the expected changes within 1 to 2 seconds. Our camera captures 30 images per second, so we designed a comparative experiment with &#119901;&#119901; being 1, 10, 30, and 60. We compared the MSE and SSIM metrics for each &#119901;&#119901; (Table <ref type="table">3</ref>). It can be observed that when &#119901;&#119901; is 10, 30, and 60, the MSE values are all lower than when &#119901;&#119901;=1, while the SSIM values are all higher. This validates the hypothesis that the image information from previous time sequences contains hidden information about the current image. At the same time, it can be observed that the model's performance does not increase with longer time sequences. Although the MSE value for the sequence length of 60 is lower than that for 30, its SSIM value is nearly 0.01 lower than that of 30. This difference is even more pronounced when comparing the sequences of 10 and 30. The sequence length &#119901;&#119901; of 10 not only has a lower MSE value than the sequence length of 30 but also lower than that of 60. Additionally, the SSIM value reaches 0.9537, the highest among the four sequences.</p><p>From the generated images (Fake Images) in Figure <ref type="figure">15</ref>, it can be observed that although the differences in SSIM and MSE values between the sequence lengths are small, the image generated with a sequence length of 10 contains more detailed information about the weld pool. This indicates that a sequence length of 10 provides the best predictive performance. This phenomenon might suggest that there is a limit to the significant impact of time sequences on the weld pool. It is also possible that using longer sequences causes the GRU to lose important hidden information relevant to that specific moment.</p><p>However, since this study focuses on the impact of speed rather than on the weld pool, we will introduce the speed parameter to observe changes in the model's performance.</p><p>Figure <ref type="figure">15</ref> Results of time series images as input</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="6.3">Effects of Time-series Speed</head><p>Using the same method to incorporate speed, we concatenated the previous time sequence image information with the speed sequence information and then input this combined data into the GRU. The output of the GRU was used as the input for the Decoder to generate realistic weld pool images. In the comparative experiments, the selected image sequences were &#119901;&#119901; =1, 10, 30, and 60, corresponding to speed sequences of &#119902;&#119902; =1, 10, 30, and 60 (Table <ref type="table">4</ref>). It can be observed that after introducing the speed sequence, the model's two evaluation metrics, MSE and SSIM, showed significant improvement. Additionally, when the image sequence length was 10, the results were the same as those with an image sequence length of 30. However, while the MSE value was lower with an image sequence length of 60, the SSIM value did not perform as well, possibly due to model overfitting <ref type="bibr">[41]</ref>.</p><p>From the generated images (Fake Image) in Figure <ref type="figure">16</ref>, it can be observed that the weld pool images generated with an image sequence length of 30 contain more detailed information than those generated with a sequence length of 60, which aligns with the SSIM value trends. The difference between the images generated with sequence lengths of 30 and 10 is not significant. This may be because the introduction of two time sequence datasets enhanced the model's robustness, allowing it to focus more effectively on important latent information. This demonstrates that incorporating the speed sequence is effective for generating weld pool images with the model.</p><p>We believe this result also indirectly confirms that experienced welders can adjust the speed of the torch based on real-time feedback from the weld pool to achieve high-quality welds. In the dynamic welding process, the information from speed changes is sufficient to generate the corresponding changes in the weld pool under the given conditions (wire feed speed and arc voltages setting etc. in GMAW).</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="7.">Conclusions</head><p>We argue that HRC (human-robot collaboration) can ease the robotization of complex welding processes where both human adaptation and physical strength are required, and propose to reduce the reliance on human skills through a human-based model predictive control (MPC). The basic question is whether a complex welding process can be effectively modeled using a generalizable approach so that the future output can be predicted in terms of human perception. This study predicts the weld pool image as the future output of human perception under the control of welding speed in the complex GMAW process. We tested the feasibility using a conditional GAN with a GRU structure, allowing us to account for the history of the output (weld pool image) and control (welding speed) without prior knowledge of the dynamics of the welding process. To this end, we first explored the depth needed to verify the Encoder-Decoder structure of the generator in the GAN to generate an image containing sufficient information about the weld pool.</p><p>According to our experimental results, it is necessary to have more than nine layers in the Encoder-Decoder structure, and considering efficiency, we believe that a nine-layer structure is optimal. We then constructed a conditional GAN with a GRU structure to generate an image of the weld pool using its previous timeseries information, demonstrating that this time-series information is useful for predicting the dynamic welding process. Furthermore, we showed that adding control data (the time series of welding speed) significantly improved our predictions. The dynamic time series of the output (weld pool images) and control (welding speed) together effectively predict the future output (weld pool image).</p></div></body>
		</text>
</TEI>
