Thermal Deformation Defect Prediction for Layered Printing Using Convolutional Generative Adversarial Network

: This paper presents a Thermal Deformation defect prediction method for layered printing using Convolutional Generative Adversarial Network (CGAN). Firstly, the original manifold mesh is converted into layered image in Printing Coordinate System (PCS). The trajectory inside layered image with various inﬁll patterns are generated for making comparisons. Inspired by monocular vision and even binocular vision, the mathematical model of thermal defect prediction via infrared thermogram is built via virtual printing of Digital Twins to preset the initial parameters of Artiﬁcial Neural Network (ANN). Particularly, the depth convolution is used to extract multi-scale features of layered image. By using transfer learning techniques to identify small sample data, the CGAN is employed to build the nonlinear implicit relations between thermal deformation and multi-scale features. The binocular stereo vision laser scanner is used to determine the actual thermal deformation of the target printed objects. The shape deformation dissimilarity can be succinctly calculated by evaluating the surface proﬁle error via mesh registration between the original source and target mesh model. The proposed method is veriﬁed by physical experiments. The experiment proved that the proposed method can deal with the thermal deformation with more optimal parameters, which contributes to performance forward design of irregular complex parts regarding diversiﬁed customized requirements.


Introduction
Additive manufacturing (AM), a representative of superfield manufacturing, enables quick freeform fabrication of complex-geometry components directly from the 3D models [1]. Due to its layer-by-layer additive process, which is the common feature of AM, it can be simpler and quicker to produce complex-geometry components at one time compared with conventional manufacturing process. Most frontier research integrate virtual reality, digital twin, transfer learning, cloud computing, and Internet of Things (Iot) with AM. What is known to us all is that there are many factors which have remarkable effects on quality and efficiency, such as geometry measurement, thermal characteristics, and thermoforming.
The earlier publications studied geometry measurement and trajectory planning. Zhang et al. [2] presented a method to find printing directions that avoid placing supports in perceptually significant regions to prevent the visual impact of artifacts. Mao et al. [3] introduced a method to efficiently generate slicing plans by a new metric profile that can characterize the distribution of deviation errors along the building direction. Shen et al. [4] proposed a toolpath interpolation method for 5-degree-of-freedom (5-DoF) parallel kinematic machines which can realize the smoothness of acceleration in all toolpath components, decrease the shock to the system, and reduce the surface error after cutting. Wang et al. [5] proposed a novel 5-axis dynamic slicing algorithm to achieve non-supporting material printing.
Most research has focused on thermal engineering and thermoforming. Bugeda et al. [6] developed a finite element model for the 3D simulation of the sintering of a single track during a Selective Laser Sintering (SLS) process which takes into account both the thermal and the sintering phenomena involved in the process. Based on a series of single tracks, Song et al. [7] firstly proposed the processing windows corresponding to different melting mechanisms in terms of microstructure, roughness, densification and microhardness. In order to study these dynamic interactions, such as heat conduction, convection, radiation, melting and solidification, dynamic phase changes, and evaporation, a finite element model has been developed which uses a dynamic mesh with spatial non-linear thermal properties to track the point of laser exposure on the powder bed to study thermal evolution during Selective Laser Melting (SLM) by Zeng et al. [8]. Li et al. [9] studied the phase evolution of laser Additive Manufacture (LAM) in producing Al-5Si-1Cu-Mg alloy in detail by characterization along the deposition direction.
In the research of optimal trajectory, Yang et al. [10] proposed a fractal scanning path which is a space-filling, self-avoiding, simple, and self-similar curve for selective laser sintering (SLS). Selvakumar et al. [11] proposed an extension of a specialized solution approach, which transforms the pursuit-evasion game (in which terminal time is free) via a special state transformation into a family of games with fixed terminal time. Liu et al. [12] presented how to apply second-order cone programming, a subclass of convex optimization, to rapidly solve a highly nonlinear optimal control problem arisen from smooth entry trajectory planning with high lift/drag ratios. Bonami et al. [13] have solved the mixed-integer nonlinear programming problem using a nonlinear programming-based branch-and-bound algorithm specifically tailored to the problem.
Some researchers studied AM technology using some novel methods. Jin et al. [14] studied autonomous in-situ correction of fused deposition modeling printers using computer vision and deep learning. He et al. [15] studied machine learning for continuous liquid interface production. Liu et al. [16] studied warpage deformation mechanism and control method of fused deposition parts. Xiong et al. [17] studied online measurement of bead geometry in gas metal arc welding based AM using passive vision. Teng et al. [18] studied the effects of material property assumptions on predicted meltpool shape for laser powder bed fusion based additive manufacturing. Paul et al. developed a three-dimensional thermomechanical finite element (FE) model to [19] calculate the thermal deformation in AM parts based on slice thickness, part orientation, scanning speed, and material properties.
There has been related research in 4D printing (4DP) concerning shape deformation. Rastogi et al. [20] proposed the complexity and inflexible design that had barricaded their dimension were vanquished by 4D printing with its dynamic structures. Wang et al. [21] proposed that deformation of arbitrary deployable surface can be realized by designing the fiber trajectories. Abuzaid et al. [22] was dedicated to study the stability and shape recovery properties of 4D printed honeycomb structures using thermoplastic Shape Memory Polymer (SMP). Bodaghi et al. [23] proposed that a Finite Element (FE) formulation based on the non-linear Green-Lagrange kinematic relations coupled with a robust SMP constitutive model established to describe material tailoring in 4D printing. Sossou et al. [24] proposed a modeling framework for simulating smart materials (SMs) and conventional materials behaviors on a voxel basis for 4D printing. Ding et al. [25] designed and demonstrated several 4D rod structures with the use of a nonlinear thermomechanical computational model using 4D printing.
Aiming at improving geometric precision for 3D printing (3DP) and even 4DP, based on the previous representative work [26][27][28][29], the antecedent research background is deepened and continued, the upshot is that this paper proposed a method of deformation-induced defect prediction for layered printing using Convolutional Generative Adversarial Network (CGAN).

Printing Coordinate System (PCS)
For a polyhedron manifold model M to be printed in Euclidean space R 3 , let A i , i = 0, · · · , N − 1 be the N triangular faces, with vertices (a i , b i , c i ), which are assumed to be ordered counter clockwise (CCW) on A i . The Axis-aligned Bounding Boxes (AABB) of M is calculated to define the scale of M. Meanwhile, the stroke length x b , y b , z b of the AABB along x, y, z direction can be reckoned. The maximum print space of a printer along x, y, z direction are, respectively, x p , y p , z p .
For any 3D component to be fabricated, the object is sliced into a number of 2D layers of defined layer thickness. In a printing coordinate system (PCS), the layer height sequence Z about n layers can be expressed as where z i < z j , for ∀ i < j.
The layer thickness sequence d can be obtained: where di f f means 1st order forward difference, For uniform slicing, layer thickness is equal to each other, ∀ di f f (d) = 0. For adaptive slicing, layer thickness varies, ∃ di f f (d) 0.
In PCS, the normalized height h n of i-th layer can be calculated hereby to represent relative height of the slicing plane: There exists the inherent staircase effect (SE) in 3DP. The SE can be manifested by various geometric parameters, for instance, cusp height δ and volume error V e . The cusp height is defined as where d is layer thickness, and α is the included angle between the z normal vector n Z and facet normal vector n f . Adaptive slicing is generally realized via variable thickness using iteration. Therefore, the calculation process of layer thicknesses can be expressed in the following mathematical model.
where card(d) is the cardinality of the d, d ∈ [d min , d max ]. f (d) is the constraint function which presents the accuracy requirement, and δ max can be the maximum cusp height of each layer. The Printing Coordinate System (PCS) of 3D reconstructed manifold model (right human knee distal femur) is shown in Figure 1.

Trajectory Inside Layered Image with Various Infill Patterns
In order to prepare the 3D printing experiment and simulate the manufacturing process, the femur model is sliced in different layers with special infill patterns shown in Figure 2

Trajectory Inside Layered Image with Various Infill Patterns
In order to prepare the 3D printing experiment and simulate the manufacturing process, the femur model is sliced in different layers with special infill patterns shown in Figure 2. Let L be total length of open-loop trajectory, and n point be amount of turning points among all points P.

Infrared Camera and Digital Camera
The 3D printing is realized by stacking between the multilayers with various and uneven temperatures along the trajectory. Discriminating visibility is the key technology to realize virtual printing. The visible primitives including points and facets are obtained based on convex hull principles. For the mathematical description of the three-dimensional heat conduction problem, it is necessary to combine the Fourier law and the principle of conservation of energy in order to analyze the multilayer thermodynamic equilibriums state. Inspired by monocular vision and even binocular vision, Figure 3 shows the schematic binocular stereo vision measurement of layered printing.

Infrared Camera and Digital Camera
The 3D printing is realized by stacking between the multilayers with various and uneven temperatures along the trajectory. Discriminating visibility is the key technology to realize virtual printing. The visible primitives including points and facets are obtained based on convex hull principles. For the mathematical description of the three-dimensional heat conduction problem, it is necessary to combine the Fourier law and the principle of conservation of energy in order to analyze the multilayer thermodynamic equilibriums state. Inspired by monocular vision and even binocular vision, Figure 3 shows the schematic binocular stereo vision measurement of layered printing. Appl. Sci. 2020, 10, x FOR PEER REVIEW 6 of 20 The melting energy consumption as follows: where is the melting energy consumption (kJ); is the material specific heat capacity (J • kg • K ); is the weight of the filament (kg); is the material melting point (K); is the environment temperature (K); is the latent heat (kJ • kg). The thermodynamic equilibriums equation for multilayer satisfies the following classical 3D heat conduction equation.
where is the material density (kg • ); is the material specific heat capacity (J • kg • K ); is the temperature (K); is the interaction time (s); , , are thermal conductivities (W • m • K )) along the directions of x, y, z axes; and is the internal heat density (W • ). When , , are the same value as a constant, the thermodynamic equilibriums equation for multilayer can be obtained from the basic principles of heat transfer and the first law of thermodynamics, as follows: where is the thermal diffusivity (m • s ), is the thermal conductivity (W • m • K ); is the material specific heat capacity (J • kg • K ) as a constant.
The heat conduction equation is a partial differential equation of first order for time. But it is a partial differential equation of second order for space. Thus, solving the equation requires a time condition for temperature and two spatial conditions. These conditions are given as the initial conditions at t = 0 and the boundary conditions of the space. The melting energy consumption as follows: where E thermal is the melting energy consumption (kJ); c is the material specific heat capacity (J·kg −1 ·K −1 ); m is the weight of the filament (kg); T m is the material melting point (K); T a is the environment temperature (K); X is the latent heat (kJ·kg). The thermodynamic equilibriums equation for multilayer satisfies the following classical 3D heat conduction equation.
where ρ is the material density (kg·m −3 ); c is the material specific heat capacity (J·kg −1 ·K −1 ); T is the temperature (K); t is the interaction time (s); k x , k y , k z are thermal conductivities W·m −1 ·K −1 ) along the directions of x, y, z axes; and . q is the internal heat density (W·m −3 ). When k x , k y , k z are the same value as a constant, the thermodynamic equilibriums equation for multilayer can be obtained from the basic principles of heat transfer and the first law of thermodynamics, as follows: where α is the thermal diffusivity m 2 ·s −1 , k is the thermal conductivity W·m −1 ·K −1 ; c is the material specific heat capacity (J·kg −1 ·K −1 ) as a constant. The heat conduction equation is a partial differential equation of first order for time. But it is a partial differential equation of second order for space. Thus, solving the equation requires a Appl. Sci. 2020, 10, 6860 7 of 20 time condition for temperature and two spatial conditions. These conditions are given as the initial conditions at t = 0 and the boundary conditions of the space.
The first type of boundary condition for the temperature is defined as follows: When the temperature T s on the boundary surface is independent of time as a constant, it is called constant wall temperature condition.
For the case where the heat flux on the boundary is specified, it can be expressed by When the heat flux density on the boundary is independent of time as a constant, it is called constant heat flux condition. In the case of q = 0, which is the adiabatic condition, can be expressed as follows: When the convection heat transfer coefficient h is given on the boundary surface, which means the heat transfer between the object and the surrounding fluid, the surface heat transfer coefficient is used according to the Newton cooling formula. The boundary condition is expressed as follows: where h is the thermal convection coefficient W·m −2 ·K −1 ; T ∞ is the final temperature when time tends to infinity, which means T ∞ is the temperature of ambient environment T a . Interface continuous conditions refer to two objects in full contact. The two objects of the contact surface and the temperature and heat flux values were equal. Therefore, the boundary condition is expressed as follows: ( where T 1 and T 2 are the temperatures of two contacted objects, and k 1 and k 2 are the thermal conductivities of two contacted objects. The end-effector moves at a constant speed of V F in the region when extruding which leads to regional sensitivity. In fact, the highest temperature in each layer is always below the end-effector. Considering only heat conduction and convection, the multilayer thermodynamic equilibriums equation can be expressed as where q f is the input heat of extruded filament (kJ); q f +d f is the conduction heat from extruded filament to interactive element (kJ); q A is the convection heat to ambient air (kJ); q S is the convection heat to substrate (kJ); ∆q is internal energy change of filament microelement (kJ). For most of 3D trajectory in the process of 3D printing, it can be simplified to one-dimensional problem due to the end-effector which usually moves in one direction. According to previous boundary conditions, it can be converted to the partial differential equation (PDE).
∂T ∂x equals to the temperature gradient ∇T.
As long as the initial temperature of filament T 0 when x = 0 is obtained: As long as the temperature gradient ∇T is obtained, the analysis of the process parameters is supposed to be considered in manufacturing process.

Infrared Temperature Measurement
In the actual radiation model, in addition to the energy radiated by the object itself, it can also reflect and transmit the environment radiation, so the energy reaching the infrared optical system mainly consists of three parts.
where E is radiant energy reaching the infrared optical system (kJ), E 1 is energy radiated by the object itself (kJ), E 2 is environmental radiation energy reflected by the target surface (kJ), E 3 is environmental radiation energy transmitted by target surface (kJ).
Assuming that the target emissivity is ε and the reflectivity is ρ r , the transmissivity is τ, and the total environmental radiation energy is E a (kJ), and the radiation energy of blackbody at the same temperature with the target surface is E b (kJ), E is determined as follows.
where σ s = 5.67 × 10 −8 W·m −2 ·K −4 is Stefan constant, T r is radiation temperature of target surface (K), T a is ambient temperature (K), and T b is actual temperature of target surface (K). Then, actual temperature T b of target surface can be obtained as follows.
The thermographs using thermal field measurement is shown in Figure 4. The noise equivalent The instantaneous field of view (IFOV) of thermal infrared imager instrument is IFOV < 1.25 mRad. The detector resolution of the thermal infrared imager is more than 320 × 240 (76,800 pixels). The measurable temperature range is [−20 • C, 1200 • C]. The ε = 0.95 and τ = 100% for measured target.

Layered Deformation of the Printed Objects
The thermal effect plays an important role in thermoplastic forming. Apparently, thermal deformation is the main part of printing deformation.
The initialization probability ( ∈ [0,1]) of customized layer before defect prediction using convolutional generative adversarial network is shown in Figure 5. Specifically, in Figure 5a

Layered Deformation of the Printed Objects
The thermal effect plays an important role in thermoplastic forming. Apparently, thermal deformation is the main part of printing deformation.
The initialization probability P init (P init ∈ [0, 1]) of customized layer before defect prediction using convolutional generative adversarial network is shown in Figure 5. Specifically, in Figure 5a

Surface Profile Error to Evaluate Deformation
The profile of the curve is expressed not by mathematical equation but by discrete points, which makes it difficult to evaluate the profile error. Therefore, the profile error of surface mesh can be measured by calculating the dissimilarity deviation between the source surface and the target surface based on the Surface Subdivision Method. According to the definition of the profile tolerance in International Organization for Standardization (ISO) 1101 [30], the surface profile error can be defined by the minimum diameter covering all measured points of the cluster spheres in which centers lie on the source model. Let be source model and be target model. The key points can be selected from the measured model by using many methods, such as K-nearest neighbors (KNN) search, Least Squares (LS), etc. The deviation between the source surface S and the i-th key point is defined by the minimum Euclidean distance from to the closest point ( , ) on the model surface S.
The closest point ( , ) can be searched by solving the minimum distances.
Arg min

Surface Profile Error to Evaluate Deformation
The profile of the curve is expressed not by mathematical equation but by discrete points, which makes it difficult to evaluate the profile error. Therefore, the profile error of surface mesh can be measured by calculating the dissimilarity deviation between the source surface and the target surface based on the Surface Subdivision Method. According to the definition of the profile tolerance in International Organization for Standardization (ISO) 1101 [30], the surface profile error can be defined by the minimum diameter covering all measured points of the cluster spheres in which centers lie on the source model.
Let M source be source model and M target be target model. The key points can be selected from the measured model M target by using many methods, such as K-nearest neighbors (KNN) search, Least Squares (LS), etc. The deviation between the source surface S and the i-th key point P The closest point S(u i , v i ) can be searched by solving the minimum distances.
Arg min Assuming that the i-th measured point is expressed as P i = [x i , y i , z i ] T , and P i = [x i , y i , z i ] T is the point on the source surface S which is closest to the i-th localized measured point P i the mathematical model of the surface profile error s error can be described as follows: where d i is the deviation between the i-th localized measured point and the source surface S, P * i is the homogeneous coordinate of P * i , and P i is the homogeneous coordinate of the measured point P i . The surface profile error can be evaluated by iteratively aligning and non-rigidly deforming a measured mesh to an original source mesh. The final transformation matrix T rotates and translates the measuring coordinate system using six parameters α, β, γ, ∆x, ∆y, ∆z. Hence, T can be expressed as follows: cos β cos γ sin α sin β cos γ − cos α sin γ cos α sin β cos γ + sin α sin γ ∆x cos β sin γ sin α sin β sin γ + cos α cos γ cos α sin β sin γ − sin α cos γ ∆y − sin β sin α cos β cos α cos β ∆z where α, β, γ are the angles rotating the measuring coordinate system around the X, Y, and Z axis, respectively, and ∆x, ∆y, ∆z are translations along the X, Y, and Z axes, respectively. The thermal deformation comparison before and after improvement is shown in Figure 6.
where is the deviation between the i-th localized measured point and the source surface S, * is the homogeneous coordinate of * , and is the homogeneous coordinate of the measured point . The surface profile error can be evaluated by iteratively aligning and non-rigidly deforming a measured mesh to an original source mesh. The final transformation matrix rotates and translates the measuring coordinate system using six parameters α, β, γ, Δx, Δy, Δz. Hence, can be expressed as follows: * = • , i = 1,2, ⋯ , , where α, β, γ are the angles rotating the measuring coordinate system around the X, Y, and Z axis, respectively, and Δx, Δy, Δz are translations along the X, Y, and Z axes, respectively. The thermal deformation comparison before and after improvement is shown in Figure 6.

Convolutional Generative Neural Network (CGAN) of Layer Customized Map (LCM)
The feature map of the -th layer is determined according to the following equation: where is the convolution kernel of the -th layer, namely weight assigned, is the bias, is the feature map of the -th layer, and is activation function. ⨂ is the convolutional operator.

Convolutional Generative Neural Network (CGAN) of Layer Customized Map (LCM)
The feature map H i of the i-th layer is determined according to the following equation: where W i is the convolution kernel of the i-th layer, namely weight assigned, b i is the bias, H i−1 is the feature map of the i-th layer, and f is activation function. ⊗ is the convolutional operator. In convolutional neural network, the definition of receptive field is the size of the region mapped by the pixels on the feature map output from each layer of the convolutional neural network on the input image. It represents the size of the perception range of neurons in different positions in the network to the original image as follows.
where R i is receptive field of the i-th layer, R i−1 is receptive field of the (i − 1)-th layer, k i is convolution kernel size of the i-th layer, and s l is convolution kernel stride of l-th layer. When the training data is sufficient, the neural network based on deep learning is introduced. The value for the j-th neuron of the k-th layer (x k j ) is determined according to the following equation: where w k ji is the weight assigned in the j-th neuron of the k-th layer to the input from i-th neuron of the previous layer, and b k j is the bias, and n is the number of neurons in (k − 1)-th layer. The bias b k j acts as an independent polynomial term, and its value is adjusted in a similar manner to that of the weights w k ji . σ is hyperbolic tangent Tanh activation function expressed by The training procedure is similar to a two-player min-max game with the following loss function.
where z is a noise vector sampled from distribution p z (e.g., uniform or Gaussian distribution), and x is a real data from the distribution p data . The stochastic gradient of discriminator D is updated by ascending in where ∇ θ d is gradient solving operator of discriminator D, m is the amount of data in a single minibatch, and i is the data index. Meanwhile, the stochastic gradient of generator G is updated by descending in where ∇ θ g is gradient solving operator of generator G, m is the amount of data in a single minibatch, and i is the data index. For output layer Lr, the error evaluation function C Lr of generator G is defined as where y(x) is expected output in output layer Lr, and a Lr (x) is predicted output by the activation function σ. The depth convolution with minimum residual is used to extract features of each layer shown in Figure 7.

Mathematical Model of MOO
Heat on the multilayer of the structure gradually decreases due to thermal convection and external radiation, and the temperature gradually decreases. The CGAN model takes each layer endeffector temperature, temperature gradient, printing velocity as the optimization parameters and solved MOO using Non-dominated Sorting Genetic Algorithm-II to calculate thermal deformation using minimum residual depth convolution.

Mathematical Model of MOO
Heat on the multilayer of the structure gradually decreases due to thermal convection and external radiation, and the temperature gradually decreases. The CGAN model takes each layer end-effector temperature, temperature gradient, printing velocity as the optimization parameters and solved MOO using Non-dominated Sorting Genetic Algorithm-II to calculate thermal deformation using minimum residual depth convolution.
Find : x = T n , ∇T, V p , d Minimize : f (x) = s error , t p Subject to : where x-parameters of printing process; d-layer thickness (mm); V p -printing velocity (mm·s −1 ); T n -end-effector temperature (K); ∇T-temperature gradient (K·mm −1 ); t T -total print time (s); f (x)-objective function of printing process.
The total print time can also be estimated as follows: where t p is the total print time (s); L is the length of trajectory (mm); V p is the printing velocity mm·s −1 ; r in f ill is infill rate; V object is volume of object to be printed; S A is cross area of filament.

MOO Results
The proposed method has been implemented using open source C++, OpenGL and Open Cave. The proposed method was tested in a 64-bit Windows 10 system PC environment with Intel(R) Core(TM) i5-2400 CPU@3.1G and 32G RAM.
The Pareto Optimal Solutions (POS) using convolutional Generative Adversarial Network is shown in Figure 8 where Figure 8a shows an initial set of POS and Figure 8b shows a further optimized set of POS. By using the CGAN method, the 10 POS with best Y are, respectively, ( where -parameters of printing process; -layer thickness (mm); -printing velocity (mm • s ); -end-effector temperature (K); ∇ -temperature gradient (K • mm ); -total print time (s); ( )-objective function of printing process. The total print time can also be estimated as follows: where is the total print time ( ); is the length of trajectory ( ); is the printing velocity (mm • s ); is infill rate; is volume of object to be printed; S is cross area of filament.

MOO Results
The proposed method has been implemented using open source C++, OpenGL and Open Cave. The proposed method was tested in a 64-bit Windows 10 system PC environment with Intel(R) Core(TM) i5-2400 CPU@3.1G and 32G RAM.
The Pareto Optimal Solutions (POS) using convolutional Generative Adversarial Network is shown in Figure 8 where Figure 8a shows an initial set of POS and Figure 8b shows a further optimized set of POS. By using the CGAN method, the 10 POS with best Y are, respectively, ( The average thermal energy consumption (from Equation (22)) is decreased from 8.1582e + 04 J to 7.5606e + 04 J with ratio of 7.32% using the proposed method.

Physical Experiments and Results comparison
The specimens considered in the present work were fabricated on a 3DP 3D printer by using the commercial Polylactic Acid (PLA) as the fabrication material and the support material. As shown in Figure 9, the laser reconstruction equipment includes trilinear coordinates measuring instrument and binocular stereo vision laser scanner. The scanning mode has turntable scanning and fixed scanning. The scanning precision is less than 0.05 mm. The scan size can vary from 30 mm × 30 mm × 30 mm to 1200 mm × 1200 mm × 1200 mm. The average thermal energy consumption (from Equation (22)) is decreased from 8.1582e + 04 J to 7.5606e + 04 J with ratio of 7.32% using the proposed method.

Physical Experiments and Results comparison
The specimens considered in the present work were fabricated on a 3DP 3D printer by using the commercial Polylactic Acid (PLA) as the fabrication material and the support material. As shown in Figure 9, the laser reconstruction equipment includes trilinear coordinates measuring instrument and binocular stereo vision laser scanner. The scanning mode has turntable scanning and fixed scanning. The scanning precision is less than 0.05 mm. The scan size can vary from 30 mm × 30 mm × 30 mm to 1200 mm × 1200 mm × 1200 mm. The Figure 10 shows the virtual printing via digital twins considering manufacturing error. The amount of layer is thereafter same (herein 52) to enhance comparability. The lateral surface area indicates more evenly distribution after adaptive optimization. The Figure 10 shows the virtual printing via digital twins considering manufacturing error. The amount of layer is thereafter same (herein 52) to enhance comparability. The lateral surface area indicates more evenly distribution after adaptive optimization. The Figure 10 shows the virtual printing via digital twins considering manufacturing error. The amount of layer is thereafter same (herein 52) to enhance comparability. The lateral surface area indicates more evenly distribution after adaptive optimization. The Figure 11 shows the comparison before and after optimization. Hereby, the maximum is marked with magenta , and the minimum is marked with green (similarly hereinafter). Before optimization, max(δ)= 2.075594e-02 at h n = 1.9608%, min(δ)= 4.795815e-03 at h n = 90.1961%, mean(δ)= 0.0155, std(δ)= 0.0044, var(δ) = 0.0000. After optimization, max(δ)= 2.695928e-02 at h n = 1.9231%, min(δ)= 0 at h n = 100.0000%%, mean(δ)= 0.0143, std(δ)= 0.0050, var(δ)= 0.0000. The Figure 11 shows the comparison before and after optimization. Hereby, the maximum is marked with magenta ▲, and the minimum is marked with green ▇ (similarly hereinafter). Before optimization, max( ) = 2.075594e-02 at ℎ = 1.9608%, min ( ) = 4.795815e-03 at ℎ = 90.1961%, mean ( )= 0.0155, std( )= 0.0044, var ( ) = 0.0000. After optimization, max( )= 2.695928e-02 at ℎ = 1.9231%, min ( )= 0 at ℎ = 100.0000%%, mean ( )= 0.0143, std ( )= 0.0050, var ( )= 0.0000. The results comparison for various layer amounts are listed in Table 1.

Conclusions
(1) A method of thermal Deformation defect deformation prediction for 3DP using Convolutional Generative Adversarial Network (CGAN) is put forward.
The multiscale Convolutional Generative Adversarial Network (CGAN) is employed to build the nonlinear implicit relations between thermal deformation and multi-scale features. The thermal deformation of each layer can be predicted with high precision for various shapes. The CGAN method is especially suitable for complex structures with diversified region-based requirements.
(2) The depth convolution is used to extract multi-scale features of LCM in each layer. The CGAN model takes each layer end-effector temperature, temperature gradient, printing velocity as the optimization parameters and solved MOO using Non-dominated Sorting Genetic Algorithm-II to calculate thermal deformation using minimum residual depth convolution. The average thermal deformation can be decreased via CGAN. The visible primitives including points and facets are obtained based on convex hull principles, which paves the way for virtual printing via Digital Twins technology.
(3) The proposed CGAN method is verified by physical experiment. The proposed method is verified by serialized physical experiments. The thermographs are firstly obtained using thermal field measurement to determine the temperature and temperature difference. The trilinear coordinates measuring instrument and binocular stereo vision laser scanner are then used to determine the actual thermal deformation of the printed objects. Compared with The results comparison for various layer amounts are listed in Table 1.

Conclusions
(1) A method of thermal Deformation defect deformation prediction for 3DP using Convolutional Generative Adversarial Network (CGAN) is put forward.
The multiscale Convolutional Generative Adversarial Network (CGAN) is employed to build the nonlinear implicit relations between thermal deformation and multi-scale features. The thermal deformation of each layer can be predicted with high precision for various shapes. The CGAN method is especially suitable for complex structures with diversified region-based requirements.
(2) The depth convolution is used to extract multi-scale features of LCM in each layer. The CGAN model takes each layer end-effector temperature, temperature gradient, printing velocity as the optimization parameters and solved MOO using Non-dominated Sorting Genetic Algorithm-II to calculate thermal deformation using minimum residual depth convolution. The average thermal deformation can be decreased via CGAN. The visible primitives including points and facets are obtained based on convex hull principles, which paves the way for virtual printing via Digital Twins technology.
(3) The proposed CGAN method is verified by physical experiment. The proposed method is verified by serialized physical experiments. The thermographs are firstly obtained using thermal field measurement to determine the temperature and temperature difference. The trilinear coordinates measuring instrument and binocular stereo vision laser scanner are then used to determine the actual thermal deformation of the printed objects. Compared with traditional methods, the CGAN method can deal with the thermal deformation with more optimal parameters which contributes to forward design of irregular complex parts.
In future, encouraged by the artificial intelligence technology, the proposed method will be planned to be more suitable for AM of more complex part structures, such as mechanical grooves, convex shoulders, matching holes, and inner cavity microfluidic channels, supported by knowledgebase big data. natural base E radiant energy reaching the infrared optical system (kJ) E 1 energy radiated by the object itself (kJ) E 2 radiant energy of the environment reflected by the target surface (kJ) E 3 environmental radiation energy transmitted by target surface (kJ) E a environmental radiation energy (kJ) E b radiation energy of blackbody at the same temperature with the target surface (kJ) E melting thermal energy consumption (kJ) G generator h n normalized printing height ratio of the i-th slicing plane H i feature map of the i-th layer L length of trajectory (mm) P j multi-polygons sign signum function S section signed area of the 2D cross-section S P i signed area of i-th polygons P i t T total print time (s) T a environment temperature (K) T b actual temperature of target surface (K) T m material melting point (K) T n temperature of the end-effector (K) T r radiation temperature of target surface (K) V total volume of object to be printed V p printing velocity (mm·s −1 ) x parameters of printing process x k j the j-th neuron of the k-th layer X latent heat (kJ·kg −1 ) y(x) expected output in output layer Lr z a noise vector from the distribution p z z i layer height (mm) z b total height (mm) ε A i,x geometric error of i-th facet A i in x direction ε A i,y geometric error of i-th facet A i in y direction w i, j weight of the vertex w k ji weight assigned in the j-th neuron of the k-th layer to the input from i-th neuron of the previous layer W i convolution kernel of the i-th layer namely assigned weight ∇T temperature gradient (K·mm −1 ) σ hyperbolic tangent Tanh activation function σ s Stefan constant W·m −2 ·K −4 ρ material density (kg·m −3 ) ε target emissivity ρ r reflectivity τ transmissivity L i total servo trajectory ∇ θ d gradient solving operator of discriminator D ∇ θ g gradient solving operator of generator G h thermal convection coefficient W·m −2 ·K −1 k thermal conductivity W·m −1 ·K −1 k 1 , k 2 thermal conductivities of two contacted objects W·m −1 ·K −1 k x , k y , k z thermal conductivities along the directions of x, y, z axes W·m −1 ·K −1 P cross-sectional perimeter of filament (mm) . q heat density inside the object (W·m −3 ) q f input heat of extruded filament (kJ) q f +d f conduction heat from extruded filament to interactive element (kJ) q A convection heat to ambient air (kJ) q S convection heat to substrate (kJ) t interaction time (s) T temperature (K) T 1 ,T 2 temperatures of two contacted objects (K) T s boundary surface temperature (K) T ∞ final temperature when time tends to infinity (K) ∆q internal energy change of filament microelement (kJ) ∇T n temperature difference (K) α thermal diffusivity (m 2 ·s −1 ) R i receptive field of the i-th layer R i−1 receptive field of the (i − 1)-th layer k i convolution kernel size of the i-th layer s l convolution kernel stride of l-th layer d i deviation between the i-th localized measured point and the design surface S P * i homogeneous coordinate of P * i P i homogeneous coordinate of the measured point P i T transformation matrix; α, β, γ angles rotating the measuring coordinate system around the X, Y, and Z axis, respectively ∆x, ∆y, ∆z translations along the X, Y and Z axes, respectively