Towards Machine Learning for Error Compensation in Additive Manufacturing

Featured Application: In this work, a comprehensive review on how data-driven modelling and machine learning for error compensation in additive manufacturing is conferred


Introduction
In recent years, Additive Manufacturing (AM) is one of the more recent and advanced manufacturing technologies which is expected to escalate the progress for the next-generation manufacturing industry with lean manufacturing being its main principle. It involves the process of layer-basis additive manufacturing of three-dimensional object using 3D Computer Automated/Aided Design (CAD) models opposing the approaches used in subtractive manufacturing like Computer Numerical Control (CNC) machining. In additive manufacturing, the prefabrication stage aims to enhance the reliability and feasibility of the process. A 3D printable model designed either via CAD or directly from 3D scanned object is presented as triangle meshes usually in Stereolithography (STL) format as an example and then converted into sliced layers with Numerical Control (NC) programming language to instruct the fabrication process. Other 3D representation of a model includes voxels, octree point cloud and graph based [1]. The prefabrication of image-based slicing, path arrangement, orientation, support formation, repairing and packaging can significantly speed up the construction time and reduce both cost and material wastes [2]. By definition, additive manufacturing refers to a process by which digital 3D design data is used to build up a component in layers by depositing material [3,4] according to American Society for Testing and Materials (ASTM), an international standards organization. The process typically uses extruder, binder, laser or electron beam to solidify materials such as polymer, metal, and ceramic [5] one layer at a time. Usually, an extruder wheel or a mobile bed can control the flow rate of fused material [6,7]. Throughout its inception, AM has offered an improved mechanical strength throughout the years with new plastics and alloys being tested out to balance both customisability of a design and the required mechanical properties suited for its applications [8,9]. Figure 1 lists the attributes additive manufacturing offers. One of the major benefits AM could utilise is cloud manufacturing. Cloud manufacturing is the concept of distributing manufacturing capabilities and resources on a cloud platform capable of offering intelligent decisions to deliver the most sustainable and robust manufacturing route available [10]. In the additive manufacturing paradigm, Social Manufacturing (SM) is realised by seamless connectivity with the Internet and logistical networks where prosumers can directly participate in the entire cycle of the production process through crowdsourcing. From an idea proposed in [11], a service oriented networked product development model is proposed in which service consumers are enabled to configure, select, and utilise customised product realisation resources and services ranging from expertise support to pay-as-you-go concept.
rication of image-based slicing, path arrangement, orientation, support formation, repairing and packaging can significantly speed up the construction time and reduce both cost and material wastes [2].
By definition, additive manufacturing refers to a process by which digital 3D design data is used to build up a component in layers by depositing material [3,4] according to American Society for Testing and Materials (ASTM), an international standards organization. The process typically uses extruder, binder, laser or electron beam to solidify materials such as polymer, metal, and ceramic [5] one layer at a time. Usually, an extruder wheel or a mobile bed can control the flow rate of fused material [6,7]. Throughout its inception, AM has offered an improved mechanical strength throughout the years with new plastics and alloys being tested out to balance both customisability of a design and the required mechanical properties suited for its applications [8,9]. Figure 1 lists the attributes additive manufacturing offers. One of the major benefits AM could utilise is cloud manufacturing. Cloud manufacturing is the concept of distributing manufacturing capabilities and resources on a cloud platform capable of offering intelligent decisions to deliver the most sustainable and robust manufacturing route available [10]. In the additive manufacturing paradigm, Social Manufacturing (SM) is realised by seamless connectivity with the Internet and logistical networks where prosumers can directly participate in the entire cycle of the production process through crowdsourcing. From an idea proposed in [11], a service oriented networked product development model is proposed in which service consumers are enabled to configure, select, and utilise customised product realisation resources and services ranging from expertise support to pay-as-you-go concept.
Lately, AM has been widely used in a list of domains including medical [12,13], materials engineering [14][15][16][17], communication [18,19], pre-fabrication construction [20], aeronautic [21,22], power electronic [23][24][25], food [26] and even making its way into the space industry [27,28]. However, the limitations hindering the proliferation of AM still exist in the current manufacturing operation. Excessive time consumption, lack of real-time control, potential deviation, and the transition from mass production to mass real-time customisation are principal problems that require being solved by computational aptitude, widely known known as Artificial Intelligence (AI).
AI provides various algorithms and methods as well as offers great potential to transform the current manufacturing technique under the situation of ever-increasing data repository. Machine Learning (ML) for example, opens the possibility for machines to learn Lately, AM has been widely used in a list of domains including medical [12,13], materials engineering [14][15][16][17], communication [18,19], pre-fabrication construction [20], aeronautic [21,22], power electronic [23][24][25], food [26] and even making its way into the space industry [27,28].
However, the limitations hindering the proliferation of AM still exist in the current manufacturing operation. Excessive time consumption, lack of real-time control, potential deviation, and the transition from mass production to mass real-time customisation are principal problems that require being solved by computational aptitude, widely known known as Artificial Intelligence (AI).
AI provides various algorithms and methods as well as offers great potential to transform the current manufacturing technique under the situation of ever-increasing data repository. Machine Learning (ML) for example, opens the possibility for machines to learn and improve autonomously with little or no human intervention at all. Applying ML in manufacturing allows the system to derive the useful information from existing data sets, which will provide a basis for approximations or predictions to operate machines with future behaviours such as decision-making and automatic system improvement. It is also beneficial to detect certain patterns or explore regularities in a dynamic manufacturing environment [29].
Many authors have invoked the notion of the process to be called a disruptive technology that will inevitably influence the majority of the established production processes [5,[30][31][32], and [33]. AM has a potential to reduce production cost by more than USD 170 billion and reduce carbon footprint by 130.5 Mt [34]. It is also estimated that AM could generate up to USD 200-USD 600 billion in transaction by 2025 [35]. General Electric has announced significant investment over a billion dollars in metal AM for jet engine components of aircrafts with one specific advantage being their future 3D printed jet engine fuel nozzle can improve the efficiency of their jet engines by increasing the allowable combustion temperature [36,37]. Other companies like Airbus are 3D printing bracket for use in aircraft such as a cargo door bracket [38]. The flexibility of 3D printing lets these companies achieve the same function at a lighter weight which in-turn reducing the use of fuel in aircrafts [21].
AM is also used in the entertainment industry to create special effect [39]. In fact, Hollywood was one of the earliest users of MIT's 3D printer for the creation of the replicas of the Aston Martin DB7. On a more personal application in medical devices, a study that was published in the New England Journal of Medicine, where doctors and engineers at the University of Michigan collaborated and 3D printed an implant for an infant with a collapsed airway which was printed using a biocompatible material and was strapped around the infant's airway [40]. There are also great applications tooling wise, where AM is not making parts but instead is improving the performance of tooling, for instance, enabling conformal cooling channels close to the surface of an injection mould that would result in improved part quality by reducing cycle time and minimising shrinking [41,42]. Table 1 describes the main additive manufacturing types with their respective attributes. In this paper, we aim to provide a review on the prospect of how AI application will provide a sustainable improvement in AM from various aspects and phases of this manufacturing technique. Table 1. Major types of additive manufacturing.

Method Description Material(s) Technology
Material extrusion [43,44] Molten material is selectively dispensed through a nozzle or orifice Metals [45] • Fused deposition modelling (FDM) Powder bed fusion [46,47] Thermal energy selectively fuses regions of a powder bed Various composites [48] • Electron beam melting (EBM) [ The terms additive manufacturing and 3D printing have been colloquially used interchangeably. Nevertheless, AM is the more broad and all-inclusive term in the industrial or manufacturing field. AM also reflects large-scale production of components while 3D printing is commonly referred to anything that is ornate be it functional or non-functional, though no standards have yet to be established regarding this matter. The structure of this paper is as follows: the overview of different approaches in manufacturing and the advancement in additive manufacturing is presented in Section 2 while Section 3 gives the background of data-driven modelling in additive manufacturing. Section 4 presents the implemented approach of the recent works of error generation and compensation in AM as well as the performance metrics whenever available. Section 5 discussed the deep learning for error compensation as well as the future prospects in the application domain followed by the conclusion in Section 6.

Advancements in Additive Manufacturing
Additive manufacturing is a process of creating a physical object from digital design and is typically used for rapid prototyping. The process starts with the creation of a design using CAD software, the design is then digitally sliced into thin layers and uploaded to an additive manufacturing machine. The manufacturing process begins once an extremely thin layer of metal powder is spread across the platform. A heat source such as laser or extruder melts the first layer of the 3D design. Subsequently, another layer of material is spread across the platform. The layering or melting process is repeated until the part is completed. The support materials are then removed, and the physical object that has taken shape is revealed. Additive manufacturing allows us to produce parts that are lighter, stronger, and more durable than traditionally made parts. Overall build times are reasonably faster as the designers can add precise features and complex geometry with minimal work is spent on tooling thus drastically reduced the cost overhead associated with it. In DMLS, there has been substantial leap on resourcing new materials in practice as new studies have been conducted to study on the inclusion of materials and their characteristics such as composite alloys in AM for different types of applications [61][62][63].
In fact, additive manufacturing has allowed industry players to revolutionise the way they work. The level of design customization that was previously unthinkable of with conventional manufacturing, is no longer an issue in additive manufacturing which also offers reduction in both material resource and the turnaround time, which are significantly reduced with the introduction of machine learning based manufacturing frameworks. Generally, a checklist that has been compiled need to be referred to for structural design works and design reviews. These checklists are usually prepared from an accumulation of previous experiences and know-how of experienced engineers or designers working on similar products. The accumulated experience and know-how increase day by day leading to amplified work time in verification tasks, which also substantiates manual labour required on a design. For example, in structural design, custom shapes being modelled will reflect the intentions of a designer to fulfil the standard requirement and functionality of a model or design and would reflect on how suited the design is with the available machining capabilities in conventional manufacturing. This is where machine learning techniques could benefit a design process by eliminating the need for designers to undergo a redundant process of verification which can be considered as legwork tasks.

Additive Manufacturing in Industry 4.0
The fourth industrial revolution or Industry 4.0 is the current trend in the manufacturing sector connoting the gradual fusion of traditional manufacturing and practices with automation and data exchange. Additive manufacturing is considered as an essential and prospective element in the recent movement of Industry 4.0 where cyber-physical systems monitor the physical processes of the factory and decentralized decisions are bolstered. As a whole, Industry 4.0 focuses on manufacturing technology's intelligent automation and data exchange merger aiming to redefine humans' role in the latest generation of smart factories thus offering profitable cooperation of the cyber and physical systems [64]. automation and data exchange. Additive manufacturing is considered as an essential and prospective element in the recent movement of Industry 4.0 where cyber-physical systems monitor the physical processes of the factory and decentralized decisions are bolstered. As a whole, Industry 4.0 focuses on manufacturing technology's intelligent automation and data exchange merger aiming to redefine humans' role in the latest generation of smart factories thus offering profitable cooperation of the cyber and physical systems [64].  Its essential concepts are associated with virtual environment that comprises Big Data, Internet of Things (IoT), Cloud Computing, wireless networks, cloud infrastructure along with artificial intelligence to name a few, whereas its physical side includes additive manufacturing, autonomous vehicles, smart materials, nanotechnology, and intelligent robots. In contrast, the physical part is bound by the capability of the current mainstream systems which makes a fresh manufacturing technology similar to AM a very enticing route in the Industry 4.0 concept. Researchers in academia and in the industry have rec- Its essential concepts are associated with virtual environment that comprises Big Data, Internet of Things (IoT), Cloud Computing, wireless networks, cloud infrastructure along with artificial intelligence to name a few, whereas its physical side includes additive manufacturing, autonomous vehicles, smart materials, nanotechnology, and intelligent robots. In contrast, the physical part is bound by the capability of the current mainstream systems which makes a fresh manufacturing technology similar to AM a very enticing route in the Industry 4.0 concept. Researchers in academia and in the industry have recognized that the Fourth Industrial Revolution initiation will change our practices completely in products manufacturing, business transaction, administration of healthcare and even how we will live our daily lives [65].
In the cyber-physical system's perspective, IoT can be described as the concept of gathering information from physical objects using computers and accelerated wireless connections. The extracted information from the 3D printers, prototype CAD models and even the end products themselves constitutes to a substantial amount of statistical data to be exchanged and analysed.
Together, this large quantity of data is defined as Big Data, which is another fundamental element in Industry 4.0. Furthermore, cloud computing, which is related to the gathered information processing, can be in the virtual industrial world as one of the most significant paradigms. All of these current technologies help to ensure the effective utilization of existing information for a sustainable future in smart AM [66,67].

Transformations from Conventional Manufacturing
One of the biggest advantages that additive manufacturing has got to offer over traditional manufacturing approaches is that no special new tooling is required in additive manufacturing in creating a part. This would highly improve the turnaround time in rapid prototyping other than reducing resources that would be normally allocated in tooling [68]. In addition, preparation of the production line and getting an assembly process set up could be potentially avoided. Conventional manufacturing comprises formative manufacturing which involves techniques like injection moulding [69]; a process that removes material from a larger piece of material employing standard machining processes such as milling and lathing until the prototype part is created.
Additive manufacturing has a clear advantage in rapid prototyping which is a speedy process of creating a three-dimensional model of a physical part or product before being manufactured in higher quantities [70]. Currently, prototypes are usually done by layered manufacturing technology in the likes of polymers and various metal types [71].
One of the known perks of additive manufacturing over conventional manufacturing processes is the lean nature of the source required in printing the product [72]. In additive manufacturing like polymer extrusion, only material intended to be in the exact representation of the CAD model is estimated beforehand and fully utilised with minimal waste. In injection moulding, the use of extra material is required in order to fill the mould [73]. In sheet metal assembly, a by-product in the form of scrap metal will be produced [74]. The scrap metal is often recyclable, but it would involve an upfront cost for the material to be salvaged. In most instances, additive manufacturing will produce almost zero material wastage in rapid prototyping process when a correct process configuration is followed. The types of additive and conventional manufacturing types are described in Figure 3.  However, additive manufacturing is rather less efficient in the post prototyping phase. Albeit the unnecessary and irrelevant retooling, the rate at which the printer could complete a whole assembly of a finished product leaves much to be desired if we were to compare to the most conventional manufacturing process like CNC milling and moulding. This is because only a single layer will be laid out or fused together at one time to accommodate the customizable nature of the process.
Although additive manufacturing has a much shorter lead time in prototyping tasks, with the current technology available, it cannot sustain the rate that is required to be used for a full-fledged manufacturing line [75]. So, when it comes to making a limited-run prototype of a part, 3D printing has a clear edge over the traditional method of tooling an entire production line but not suited for a high output production. All in all, although additive manufacturing has a very short turnaround, it is only suitable to cater to the need of a manufacturing process like the prototyping phase due to the intricate steps involved and the resolution of details it can offer. To justify the cost of tooling, manufacturers do not require to produce as much of the volume required due to the high rate of reproduction of a single design.
Traditional manufacturing like machining and casting provides high quality level parts, good surface finishing, and very high dimensional accuracy for all sorts of materials. Nonetheless, 3D printing technologies like Aerosol Jet has recently made significant gains against traditional manufacturing processes by offering better material selection, ranging from ceramics to dielectric adhesives [76,77]. However, when it comes to making a limited-run prototype of a part, 3D printing has a clear edge over the traditional method which requires tooling for the entire production line. Table 2 incorporates the pros and cons of both additive manufacturing with traditional manufacturing.
The widespread deployment of low-cost sensors and the improvement of internet infrastructure have boosted the interest and excitement on the topic of future of manufacturing. This is where data-driven manufacturing comes in offering responsive and efficient production system integration [78]. Table 3 highlights the multitude of challenges for its successful implementation. In the dawn of shifting from industry 3.0 to 4.0, offering interconnected systems will benefit the previously overlooked collection of data to further However, additive manufacturing is rather less efficient in the post prototyping phase. Albeit the unnecessary and irrelevant retooling, the rate at which the printer could complete a whole assembly of a finished product leaves much to be desired if we were to compare to the most conventional manufacturing process like CNC milling and moulding. This is because only a single layer will be laid out or fused together at one time to accommodate the customizable nature of the process.
Although additive manufacturing has a much shorter lead time in prototyping tasks, with the current technology available, it cannot sustain the rate that is required to be used for a full-fledged manufacturing line [75]. So, when it comes to making a limited-run prototype of a part, 3D printing has a clear edge over the traditional method of tooling an entire production line but not suited for a high output production. All in all, although additive manufacturing has a very short turnaround, it is only suitable to cater to the need of a manufacturing process like the prototyping phase due to the intricate steps involved and the resolution of details it can offer. To justify the cost of tooling, manufacturers do not require to produce as much of the volume required due to the high rate of reproduction of a single design.
Traditional manufacturing like machining and casting provides high quality level parts, good surface finishing, and very high dimensional accuracy for all sorts of materials. Nonetheless, 3D printing technologies like Aerosol Jet has recently made significant gains against traditional manufacturing processes by offering better material selection, ranging from ceramics to dielectric adhesives [76,77]. However, when it comes to making a limitedrun prototype of a part, 3D printing has a clear edge over the traditional method which requires tooling for the entire production line. Table 2 incorporates the pros and cons of both additive manufacturing with traditional manufacturing. The widespread deployment of low-cost sensors and the improvement of internet infrastructure have boosted the interest and excitement on the topic of future of manufacturing. This is where data-driven manufacturing comes in offering responsive and efficient production system integration [78]. Table 3 highlights the multitude of challenges for its successful implementation. In the dawn of shifting from industry 3.0 to 4.0, offering interconnected systems will benefit the previously overlooked collection of data to further improve sustainability level of the manufacturing ecosystem. Data-driven systems will undoubtedly yield new opportunities for a highly fine-tuned control and monitoring system in newer manufacturing systems like AM which has the promise to simplify supply chains. Table 3. Underlying challenges of data driven manufacturing.

Challenges Details
From Time-Triggered to Event-Triggered Control Systems -On-demand based production process that is deterministic with no external randomness factor. All events are time-triggered based. - A new paradigm of event-triggered control with high customization being its key factor.
A Unified Data Model: Data Sharing, Not Just Data Exchange -Previously, transaction-oriented resource planning system processes data independently since they are not designed to communicate and share information with the other sub-components in a manufacturing line. -Data sharing will enable quick changes to real-time demand required in a production line process from design to distribution.
The Integration of Legacy Systems -In newer factories, multiple systems can be found including logic controllers and data acquisition systems even at the machine level. - The notion of starting everything from a clean sheet should not be the focus but rather the integration within the existing operable manufacturing and design environment efficiently is the appropriable solution.
Security Challenges -Unauthorized access by malicious attackers can cause outages since recent IoT devices installed in a factory which in turn connected via gateways might introduce a risk of its own. -These gateways will impose a cost most manufacturers often overlooked to cope with the demanding computing power in tackling networking and security tasks.

Data-Driven Modelling in Additive Manufacturing
Additive manufacturing for three-dimensional designs is being realized more throughout the years, considered as an evolutional paradigm in the manufacturing industry [79,80]. Artificial intelligence is currently finding wide applications to 3D printing for an intelligent, efficient, high quality, mass customised and service-oriented production process.
Several data-driven analytics that depend on architectures in the likes of Artificial Neural Networks (ANN) and Genetic Algorithms (GA) are renowned for their quality prediction in a variety of applications [29,81,82]. However, AI implementation has yet to be fully utilized in AM to maximize its chance of successfully achieving its productivity and sustainability goals. The advantages of identifying the various predictive deviations and classifications tasks using machine learning models are discussed in this chapter.

Artificial Neural Network Framework
In AM, the thermal nature of materials and processes may cause uncertainties in the temperature gradients during construction phase. As a result, the parts being built undergo irregular deformations that usually leads to dimensional inaccuracies from the modelled to finished parts. An ANN based approach is proposed in [83], to tackle the problem of unwanted thermal deformations in manufactured parts adapting FDM.
ANN is a computation system loosely inspired on how human brains process information. A feedforward neural network has three types of neurons composed of input neurons, hidden neurons and output neurons. There is only one input and output layer, but there can be multiple hidden layers in between. Every connection of neurons is assigned with weights where weighted outputs from previous nodes are introduced with activation function [84].
The proposed model is a feedforward ANN which is trained using backpropagation algorithm [85,86] to obtain the information on deformity. Previously, slice and stereolithography (STL) based compensation approaches are showcased for geometric errors in fabricated parts using the Rapid Prototyping (RP) method [87,88].
On the proposed thermal geometry compensation method, finite element model is used to simulate the creation of solid materials in AM process. Two sequential steps are involved, firstly the temperature history together with the thermal gradients across all layers are computed using finite element analysis, next, the overall deformation induced in the part is determined using ANN implementing Lavenberg-Marquardt variant of error backpropagation algorithm for training. Two sample parts were tested using the proposed method showing a significant error reduction of manufactured parts conforming to the original CAD file with a reduction in conformity error by 58.86% to 63.99% using an ANN setup shown in Figure 4.

Markov Decision Process
The lack in the ability to monitor real-time quality control in AM can be seen as a limitation since quality assurance is provided by a more traditional offline data-driven techniques and optimization approaches such as design of experiments, which poses great challenges for widespread applications. In order to fully utilize the potential of sensing data for AM, effective analytical tools and methods that are able to handle complex image data to reflect the microstructure and mechanical properties of AM builds are seen as a key factor.
By extracting useful information on the process dynamic and defect conditions, an optimal control approach for AM parts is proposed in [89] using Laser Powder Bed Fusion technique. Quality assurance in AM is laid out by first measuring in-situ measuring, then estimating real-time defect states in layer wise AM images, and finally optimising layer-by-layer control actions. A formulation on the in-situ AM control problem adapting Markov Decision Process (MDP) is simulated with the objective of finding an optimal control plan.
Markov Decision Process (MDP) is a decision-making model working in a discrete and stochastic manner in sequential environments. The core principle of the model is that a decision maker, or agent, inhabits an environment, which changes the state randomly in response to action choices made by it [90].
algorithm [85,86] to obtain the information on deformity. Previously, slice and stereolithography (STL) based compensation approaches are showcased for geometric errors in fabricated parts using the Rapid Prototyping (RP) method [87,88].
On the proposed thermal geometry compensation method, finite element model is used to simulate the creation of solid materials in AM process. Two sequential steps are involved, firstly the temperature history together with the thermal gradients across all layers are computed using finite element analysis, next, the overall deformation induced in the part is determined using ANN implementing Lavenberg-Marquardt variant of error backpropagation algorithm for training. Two sample parts were tested using the proposed method showing a significant error reduction of manufactured parts conforming to the original CAD file with a reduction in conformity error by 58.86% to 63.99% using an ANN setup shown in Figure 4.  The defect level is characterized in the corresponding layer images with nonhomogeneous patterns or irregularities. Then, layer-by-layer control actions are taken by extracting The Hoteling T 2 information [91,92] from the multifractal spectrum. A stochastic dynamic model is represented as Markov process to determine the optimized control policy where experimental results signifies that the proposed method has a huge potential for an on-thefly build quality and real-time defect mitigation assessment in AM. Figure 5 encapsulates the basis of a Markov Decision Process model discussed.

Markov Decision Process
The lack in the ability to monitor real-time quality control in AM can be seen as a limitation since quality assurance is provided by a more traditional offline data-driven techniques and optimization approaches such as design of experiments, which poses great challenges for widespread applications. In order to fully utilize the potential of sensing data for AM, effective analytical tools and methods that are able to handle complex image data to reflect the microstructure and mechanical properties of AM builds are seen as a key factor.
By extracting useful information on the process dynamic and defect conditions, an optimal control approach for AM parts is proposed in [89] using Laser Powder Bed Fusion technique. Quality assurance in AM is laid out by first measuring in-situ measuring, then estimating real-time defect states in layer wise AM images, and finally optimising layerby-layer control actions. A formulation on the in-situ AM control problem adapting Markov Decision Process (MDP) is simulated with the objective of finding an optimal control plan.
Markov Decision Process (MDP) is a decision-making model working in a discrete and stochastic manner in sequential environments. The core principle of the model is that a decision maker, or agent, inhabits an environment, which changes the state randomly in response to action choices made by it [90].
The defect level is characterized in the corresponding layer images with nonhomogeneous patterns or irregularities. Then, layer-by-layer control actions are taken by extracting The Hoteling 2 information [91,92] from the multifractal spectrum. A stochastic dynamic model is represented as Markov process to determine the optimized control policy where experimental results signifies that the proposed method has a huge potential for an on-the-fly build quality and real-time defect mitigation assessment in AM. Figure 5 encapsulates the basis of a Markov Decision Process model discussed. In additive manufacturing, microstructures created from the process can be quite complex than conventional counterparts like CNC deductive manufacturing. With the introduction of impermanent and spatial heat sources [93,94], microstructural heterogeneity in the processed part is imminent. In a study conducted in 2017, a kinetic Monte Carlo model is proposed to predict three-dimensional grain structure in AM [95], Figure 6 illustrates the flowchart of the Monte Carlo model being used. In additive manufacturing, microstructures created from the process can be quite complex than conventional counterparts like CNC deductive manufacturing. With the introduction of impermanent and spatial heat sources [93,94], microstructural heterogeneity in the processed part is imminent. In a study conducted in 2017, a kinetic Monte Carlo model is proposed to predict three-dimensional grain structure in AM [95], Figure 6 illustrates the flowchart of the Monte Carlo model being used. Appl. Sci. 2021, 11, x FOR PEER REVIEW 11 of 28 The model proposed uses molten zone shape, surrounding temperature gradient, and scan pattern to represent the evolution in the microstructural level. The microstructural variation is rather prominent in metal-based additive manufacturing process is due to the non-uniform local solidification behaviour occurring throughout the process [96,97]. A cost ratio, / , using the value of failure cost over corrective action cost is being implemented to evaluate the performance of the proposed method. The results show that the model was able to reproduce distinct and varied classes of AM microstructures with a relatively low computation requirement.

Genetic Algorithm
In Selective Laser Melting (SLM), the parameter settings will impact the outcome of the processed material. Properties such as the bead width, tensile strength, compressive strength and wear are some of the properties affected by the SLM configuration imposed. A multi-gene genetic programming is proposed in [98], to optimize the parameter setting with the evolutionary stage of the method called the Modified Multi-gene Genetic Programming (M-MGGP).
Genetic Algorithms (GA) works on the basic principles of evolution as it is a meta heuristic to natural selection and the various subprocesses that occur spontaneously. The cycle of GA is initiated by the assessment of fitness score of all the agents in the current generation as shown in Figure 7, then with the selection of the top percentile of all models, the models are crossed over with one another arbitrarily and finally, mutated in order to introduce randomness. The cycle stops if the criteria is met or resets from the mutation phase onwards [99].  The model proposed uses molten zone shape, surrounding temperature gradient, and scan pattern to represent the evolution in the microstructural level. The microstructural variation is rather prominent in metal-based additive manufacturing process is due to the non-uniform local solidification behaviour occurring throughout the process [96,97]. A cost ratio, c f /c a , using the value of failure cost over corrective action cost is being implemented to evaluate the performance of the proposed method. The results show that the model was able to reproduce distinct and varied classes of AM microstructures with a relatively low computation requirement.

Genetic Algorithm
In Selective Laser Melting (SLM), the parameter settings will impact the outcome of the processed material. Properties such as the bead width, tensile strength, compressive strength and wear are some of the properties affected by the SLM configuration imposed. A multi-gene genetic programming is proposed in [98], to optimize the parameter setting with the evolutionary stage of the method called the Modified Multi-gene Genetic Programming (M-MGGP).
Genetic Algorithms (GA) works on the basic principles of evolution as it is a meta heuristic to natural selection and the various subprocesses that occur spontaneously. The cycle of GA is initiated by the assessment of fitness score of all the agents in the current generation as shown in Figure 7, then with the selection of the top percentile of all models, the models are crossed over with one another arbitrarily and finally, mutated in order to introduce randomness. The cycle stops if the criteria is met or resets from the mutation phase onwards [99]. The model proposed uses molten zone shape, surrounding temperature gradient, and scan pattern to represent the evolution in the microstructural level. The microstructural variation is rather prominent in metal-based additive manufacturing process is due to the non-uniform local solidification behaviour occurring throughout the process [96,97]. A cost ratio, / , using the value of failure cost over corrective action cost is being implemented to evaluate the performance of the proposed method. The results show that the model was able to reproduce distinct and varied classes of AM microstructures with a relatively low computation requirement.

Genetic Algorithm
In Selective Laser Melting (SLM), the parameter settings will impact the outcome of the processed material. Properties such as the bead width, tensile strength, compressive strength and wear are some of the properties affected by the SLM configuration imposed. A multi-gene genetic programming is proposed in [98], to optimize the parameter setting with the evolutionary stage of the method called the Modified Multi-gene Genetic Programming (M-MGGP).
Genetic Algorithms (GA) works on the basic principles of evolution as it is a meta heuristic to natural selection and the various subprocesses that occur spontaneously. The cycle of GA is initiated by the assessment of fitness score of all the agents in the current generation as shown in Figure 7, then with the selection of the top percentile of all models, the models are crossed over with one another arbitrarily and finally, mutated in order to introduce randomness. The cycle stops if the criteria is met or resets from the mutation phase onwards [99].  M-MGGP is in the form of weighted sum of several genes with least square method for regression phase. Figure 8 shows gene 3 with p value lower than 0.05 is eliminated with the other two genes combined using the stepwise regression method. In the simulation tested together with two other methods namely ANN and normal Multi-gene Genetic Programming (MGGP), root mean square (RMSE) error shown in the proposed method is 63.8% lower than ANN and 47.9% lower relative to the normal MGGP method. The relatively better generalization ability of the M-MGGP method proposed is beneficial for rapid prototyping users in which the production time can be further decreased by optimizing the SLM process beforehand. In addition, the bead width increases with the increase in laser power and powder layer thickness meaning that by regulating the scanning speed of the SLM machine, a higher variation in bead width can be obtained. A squared correlation coefficient, R 2 , of up to 0.98 was recorded indicating good agreement with the experimental data. A mean standard error of 0.25 was recorded, outperforming ANN and the normal MGPP being benchmarked against.
. 2021, 11, x FOR PEER REVIEW 12 of 28 M-MGGP is in the form of weighted sum of several genes with least square method for regression phase. Figure 8 shows gene 3 with value lower than 0.05 is eliminated with the other two genes combined using the stepwise regression method. In the simulation tested together with two other methods namely ANN and normal Multi-gene Genetic Programming (MGGP), root mean square (RMSE) error shown in the proposed method is 63.8% lower than ANN and 47.9% lower relative to the normal MGGP method. The relatively better generalization ability of the M-MGGP method proposed is beneficial for rapid prototyping users in which the production time can be further decreased by optimizing the SLM process beforehand. In addition, the bead width increases with the increase in laser power and powder layer thickness meaning that by regulating the scanning speed of the SLM machine, a higher variation in bead width can be obtained. A squared correlation coefficient, 2 , of up to 0.98 was recorded indicating good agreement with the experimental data. A mean standard error of 0.25 was recorded, outperforming ANN and the normal MGPP being benchmarked against.

Genetic Algorithm
Although additive manufacturing offers a number of unique capabilities like design freedom, its full potential might be hindered by a number of factors including the lack of available predictive models that correlate the properties of the processed parts to the processing parameters [100].
It includes part quality, repeatability, and the lack of material and process standards. A predictive model for learning and prediction of metallic part's porosity is developed using a Gaussian Process (GP) regression model in [101] using SLM based AM.
GP is a discriminative machine learning process with the additional advantage of providing a full conditional, statistical description for the predicted variable that can primarily be used to establish confidence intervals and set hyperparameters which gives an alternative to regression problems [102]. GP models are formed from classical statistical models by substituting latent functions of parametric form by random processes with Gaussian prior.
The Gaussian-based predictive model expresses the porosity as a function of laser power and scanning speed identified as two of the most influencing parameters on part porosity. The use of spatial covariance functions is extended with re-parameterization from the rather limited application in geographical spaces to generalize 2-dimensional spaces with different physical units. Then, a Bayesian updating methodology was adapted to estimate the statistical model's parameters and Kriging prediction [103] was employed to estimate the resulting porosity at various power-speed combinations. Figure 9 summarises the prediction methodology using the proposed model. It is demonstrated that the proposed method offers accurate predictions in part porosity of stainless-steel specimen

Genetic Algorithm
Although additive manufacturing offers a number of unique capabilities like design freedom, its full potential might be hindered by a number of factors including the lack of available predictive models that correlate the properties of the processed parts to the processing parameters [100].
It includes part quality, repeatability, and the lack of material and process standards. A predictive model for learning and prediction of metallic part's porosity is developed using a Gaussian Process (GP) regression model in [101] using SLM based AM.
GP is a discriminative machine learning process with the additional advantage of providing a full conditional, statistical description for the predicted variable that can primarily be used to establish confidence intervals and set hyperparameters which gives an alternative to regression problems [102]. GP models are formed from classical statistical models by substituting latent functions of parametric form by random processes with Gaussian prior.
The Gaussian-based predictive model expresses the porosity as a function of laser power and scanning speed identified as two of the most influencing parameters on part porosity. The use of spatial covariance functions is extended with re-parameterization from the rather limited application in geographical spaces to generalize 2-dimensional spaces with different physical units. Then, a Bayesian updating methodology was adapted to estimate the statistical model's parameters and Kriging prediction [103] was employed to estimate the resulting porosity at various power-speed combinations. Figure 9 summarises the prediction methodology using the proposed model. It is demonstrated that the proposed method offers accurate predictions in part porosity of stainless-steel specimen with parameter combinations resulting in low porousness of 0.325% at 50 W laser power consumption and scanning speed of 275 mm/s.  This section discussed how data driven AI is impacting various AM methods and has proven to provide improvements in several ways. Table 4 compiles the findings and possible improvement that could be taken in the data driven AI methods discussed. Table 4. Major findings on data-driven AI based methods and their potential improvements.

Method Major Finding(s) Potential Improvement(s) Type of AM Manufacturing Task(s)
Artificial Neural Network [83] Pre-defined tolerances are applied to the extremities of the bounding box to account for part deformations.
Surface data from manufactured AM prototypes extracted using 3D scanning techniques may be used for creating the training datasets for the ANN. Additional intermediate steps will also be needed to refine the data from 3D scans.

Material Extrusion
Quality assurance Markov Decision Process [89,95] The optimal policy derived from the proposed MDP framework yields the smallest expected total cost under different cost ratios since corrective action is conducted only when the defect signal is beyond the upper limit.
Simple algorithm could be introduced to further reduce the number of updates where graph partitioning method can be included.

Powder Bed Fusion
Process monitoring and optimal control Genetic Algorithm [98] Focused on the study of the bead width of an Al-powder-based fabricated prototype in the SLM process subjected to a continuous laser power mode.
Other vital characteristics such as surface roughness, waviness, and bead width using a pulse laser mode in the SLM to identify and evaluate any differences.
Selective Laser Melting Optimal control This section discussed how data driven AI is impacting various AM methods and has proven to provide improvements in several ways. Table 4 compiles the findings and possible improvement that could be taken in the data driven AI methods discussed. Table 4. Major findings on data-driven AI based methods and their potential improvements.

Artificial Neural
Network [83] Pre-defined tolerances are applied to the extremities of the bounding box to account for part deformations.
Surface data from manufactured AM prototypes extracted using 3D scanning techniques may be used for creating the training datasets for the ANN. Additional intermediate steps will also be needed to refine the data from 3D scans.

Material Extrusion Quality assurance
Markov Decision Process [89,95] The optimal policy derived from the proposed MDP framework yields the smallest expected total cost under different cost ratios since corrective action is conducted only when the defect signal is beyond the upper limit.
Simple algorithm could be introduced to further reduce the number of updates where graph partitioning method can be included.

Powder Bed Fusion Process monitoring and optimal control
Genetic Algorithm [98] Focused on the study of the bead width of an Al-powder-based fabricated prototype in the SLM process subjected to a continuous laser power mode.
Other vital characteristics such as surface roughness, waviness, and bead width using a pulse laser mode in the SLM to identify and evaluate any differences.

Selective Laser Melting Optimal control
Gaussian Process [101] Metal-based AM is characterized by low repeatability due to the complexity of the underlying physical transformations that take place during fabrication, the proposed method offers a systematic approach that enhances the determination of these parameter settings while keeping the number of experiments to a minimum.
Generalizing the model to a higher dimensional space accounting for additional SLM processing parameters (e.g., hatch distance, layer thickness, among others) and considering the effect of the characteristics of the raw powder (e.g., powder morphology, particle size distribution, fabrication procedure) on the part porosity.

Selective Laser Melting
Optimal control and quality assurance

Error Compensation in Additive Manufacturing
Unlike other manufacturing processes, AM defects' analysis and modelling has yet to be fully established and explored. 3D printing which can be considered as non-linear system possess a rather difficult error control generally [104]. The research field of error compensation in 3D printing is still in its inception stage, however, it benefits from the maturing techniques of various data mining analytics and machine learning. Their successful applications in a list of engineering fields proved that similar approaches could be applied in additive manufacturing processes specifically for error compensation which in turn, provide congruous end products.
AM geometric deviation modelling has been investigated for various AM processes from various aspects, including characterization of geometric approximation errors during conversion from CAD model to standard input files, parametric modelling of machine errors and identification of influential process factors on shape shrinkage ratio. The focus of these methods is concentrated on a global improvement of geometrical accuracy. To derive more specific models of shape deviation, Huang et al. decompose an AM shape deviation into in-plane and out-of-plane deviation, and developed deviation models incorporating only the shape parameters based on statistical methods [105].
In an AM process, the error generation mechanism can be explained by three main error sources:

•
Material related error such as thermal shrinkage and material distortion arising from the rapid heating and cooling process [106,107]. • Production process induced error resulting from machine errors and process characteristics [108,109]. • Error due to conversion from scanned/CAD model to the standard file input as mathematical geometry approximation [110,111].
Due to the nature of AM which lays out one layer at a time, the effect of error sources could arise in both inside each layer and between layers, resulting in in-plane and out-ofplane deviations of the product shape from its nominal design [105]. An in-plane situation is considered in this research [112], where small layer thickness allows the authors to reduce the problem into a two-dimensional (2D) problem by approximating the boundary of a layer with a 2D shape. Calculation of the variation effects on the designed 2D shape is essential to the effective modelling of AM shape deviation, thus motivating us to investigate the transformations of the designed shape resulting from the complex error sources. Mechanical wise, AM methods like LSTM benefits from error compensation by predicting the tensile strength of the printed parts by utilizing in-process layer wise features acquired by infrared sensing data [113], with a prediction RMSE of 1.8 × 10 −2 kN.
The transformation perspective can be reasonably justified since, the process-induced error, such as unexpected displacement of machine axes or variation in electrical components, may cause slight translation and rotation of shape with respect to the original machine coordinate system, and a material-related error, such as thermal shrinkage, may cause local variations of shape from its original software form. The accumulation of these deviations can a result in the deviation in dimensionality from the original CAD dimensions.
The stack-up of layers will accumulate these deviations and affect the overall product form. Therefore, three kinds of transformations can be defined on a 2D shape in the xy building plane: translations in xand ydirection ∆x, ∆y, rotation with respect to the origin and scaling in xand y-direction φx, φy. Figure 10 illustrates the transformation effects on the designed shape during AM process.
these deviations can a result in the deviation in dimensionality from the original CAD dimensions.
The stack-up of layers will accumulate these deviations and affect the overall product form. Therefore, three kinds of transformations can be defined on a 2D shape in thebuilding plane: translations in -and -direction ∆ , ∆ , rotation with respect to the origin and scaling in -and -direction ϕ , ϕ . Figure 10 illustrates the transformation effects on the designed shape during AM process. A mathematical relationship between the designed shape Ω• and the final shape Ω* can be established based on the transformation parameter set C = {ϕ , ϕ , α, ∆ , ∆ }. Suppose corresponding points on Ω• and Ω* are denoted as (°,°) and ( * , * ) in the Cartesian coordinate system, this relationship is defined as Equation (1), in which , , are homogeneous transformation matrices composed of scaling, rotation and translation parameters, respectively: resolving Equation (1) yields: (°,°) = (ℎ 1 ( * , * , Ψ), ℎ 2 ( * , * , Ψ)) Transformation parameters can be applied to the overall shape where the parametric function can capture the global trend of an in-plane shape deviation. However, to characterize variations along a shape boundary that are location dependent which includes far more complex patterns, a learning capability should be incorporated in the deviation model to simultaneously learn deviation of data represented in different shapes. Here is where a multi-task Gaussian Process (GP) learning algorithm as discussed in previous chapter comes in for local variations modelling.
In a study conducted, overlapping detection and removal algorithm to improve repositioned-fragments of the 3D bone model that significantly affect the assembled quality of 3D-printed bones was proposed in [114]. It focused on developing an overlapping finding and removal algorithm to improve the 3D bone model for supporting the assembly and disassembly of 3D printed bones. The study also shows that the averaged gap error between two 3D-printed fragments is less than 3 mm, a significant reduction compared to that of 3D printed bones before mesh overlapping was removed. Contours overlap in measurements utilisation is considered with the matching properties observed.
Material extrusion or Fused Deposition Modelling (FDM) is the process of fabricating three-dimensional parts with deposition of layer-by-layer formation of liquefied thermoplastic filament. Acrylonitrile-co-butadiene-co-styrene (ABS) is the most used type of polymer in FDM. ABS possesses rigid and amorphous engineering thermoplastic copolymer meaning it has a list of useful properties for prototype build. Some of these traits include durability, toughness, and its relatively low cost [115]. Other polymer types have been resolving Equation (1) yields: Transformation parameters can be applied to the overall shape where the parametric function can capture the global trend of an in-plane shape deviation. However, to characterize variations along a shape boundary that are location dependent which includes far more complex patterns, a learning capability should be incorporated in the deviation model to simultaneously learn deviation of data represented in different shapes. Here is where a multi-task Gaussian Process (GP) learning algorithm as discussed in previous chapter comes in for local variations modelling.
In a study conducted, overlapping detection and removal algorithm to improve repositioned-fragments of the 3D bone model that significantly affect the assembled quality of 3D-printed bones was proposed in [114]. It focused on developing an overlapping finding and removal algorithm to improve the 3D bone model for supporting the assembly and disassembly of 3D printed bones. The study also shows that the averaged gap error between two 3D-printed fragments is less than 3 mm, a significant reduction compared to that of 3D printed bones before mesh overlapping was removed. Contours overlap in measurements utilisation is considered with the matching properties observed.
Material extrusion or Fused Deposition Modelling (FDM) is the process of fabricating three-dimensional parts with deposition of layer-by-layer formation of liquefied thermoplastic filament. Acrylonitrile-co-butadiene-co-styrene (ABS) is the most used type of polymer in FDM. ABS possesses rigid and amorphous engineering thermoplastic copolymer meaning it has a list of useful properties for prototype build. Some of these traits include durability, toughness, and its relatively low cost [115]. Other polymer types have been tested to be used hand in hand in FDM such as Semi-crystalline polymers, they are often considered deformable, have high service temperatures relative to amorphous polymers [116,117]. However, Semi-crystalline when used in FDM tends to deform under varying temperatures during part cooling. During the crystallization phase that occur during the cooling down phase of such material, polymer chains will be drawn very closely together which form a higher density area on the printed part. This will cause the lower layer of the bind to be prone to warps. In tackling this problem, researchers have proposed many solutions such as addition of fillers to improve the actual FDM on its building pro-cess itself where carbon fibre is introduced. This dramatically improved the stiffness of the final components being formed other than their perceived strength value. Moreover, the carbon fibre enhanced the coefficient of thermal expansion (CTE) of the polymer which leads to reduction of distortion, more apparent in large scale productions [118]. Relative to conventional injection moulding of PLA materials, FDM printed parts are tested with different strain rates with 45 • raster angle (angle at which the materials are laid at every layers) [119], achieved higher ultimate tensile strength (UTS) of 61.42 MPa than injection moulding (49.45 MPa) with 24.2% UTS improvement at 2.5 × 10 −4 s −1 strain rate. Nowadays, online model regression techniques are required by the manufacturers to assist in the increase of productivity and reduce quality defects by tracking the system variations promptly. Model regression is used to improve the product quality or do failure prognosis for the machines. Very few of these algorithms have considered the regression of time-varying systems. The proposed model in [120], addresses the online model regression for time-varying manufacturing systems with random unknown model variations during production. For comparison, the suboptimal method is also tested in another scenario and defined the following average MSE over all points as the metric to compare the performance of the two methods. In this study, a standard Gaussian Process Regression (GPR) method was adapted for the model regression of time varying manufacturing systems with shift and drift parameters unknown. In addition, a suboptimal GPR method was proposed which ignores the correlation between the latest measurement and the historical data as a trade-off between the storage expense and the estimation optimality. Verification of the effectiveness of the two proposed methods have been simulated and compared.
A new method of predictive model based on Gaussian process approach is proposed by Tapia et al. using selective laser melting [121]. The estimate of statistical model parameters is collected via Bayesian inference framework, and porosity of the parts predicted using the Kriging method for a range of pre-defined setting. A predictive modeling framework is proposed based on Gaussian process models to predict the resulting density in parts manufactured using selective laser melting as a function of the processing parameters. The most impactful parameters that have been reported on SLM parts' porosity include laser power, scanning speed, powder layer thickness, hatch distance and laser beam size. A Gaussian process-based predictive model that assumes the porosity of the fabricated part as a function of laser power and scanning speed is formulated, which have been identified as two of the most significant processing parameters affecting part porosity. The proposed methodology was validated using a real-world case study of predicting the porosity of 17-4 PH stainless steel specimens manufactured on a ProX 100TM SLM system.

Deep Learning for Error Compensation in Additive Manufacturing
Accuracy and finishing of 3D printed objects are relatively at lower levels compared to traditional mass manufacturing methods. The main reason behind this is that the models to be printed are usually arbitrary and are printed in small quantities. The deformation is affected by the shape of the object and there is a lack of a widely accepted universal method for the error compensation. It is neither easy nor economical to perform the compensation manually. Several AI methods including emerging technique like deep learning, are currently being widely investigated for a wide variety of manufacturing systems. To give an overview, the applications of the state-of-the-art deep learning techniques in manufacturing are discussed, in this chapter. We will highlight the present framework for automatic error compensation implementing AI based algorithms.

Learning-Based Framework with 3D Deep Learning
The finished shape of a 3D printed object can be acquired by technologies, such as scanning. In this method proposed by Shen et al., '3D deep learning' method is used to train a deep neural network [122]. This method is demonstrated for a specific task which is dental crown printing, where the network can learn the function of distortion when a large amount of data is used for training. According to the authors, it is the first application of the deep neural network to the error compensation in 3D printing. The "inverse function network" to compensate for the error is also adapted in the overall framework. Four deformations of the dental crowns are used to verify the performance of the neural network:
Based on a standard encoding method in [123], it represents a 3D model as a probability distribution of binary variables on a 3D voxel grid, with '1' indicating the voxel is inside the mesh and '0 is not. This way, the model is digitised. The 3D convolutional operation is rather similar to a 2D convolutional operation. However, the input, output, and filters are 3D matrix with width, height, and depth. Kernels move at a certain step in the 3D space, and the overlap of the kernel and the input executes a convolution operation to form a voxel in the output. Post convolution with the input, the value of the voxel in output is summed up. According to the authors, the network follows the idea of an auto-encoder with Unet architecture [124], where the network contains an encoder and a decoder. The encoder and the decoder are concatenated by the structure of "U-net" and the fully connected layers are not used. A latent representation of the input volume is extracted by the encoder, and the decoder outputs a prediction according to spatial knowledge gathered by the encoder.
The cross-entropy loss function is common. However, an improved cross-entropy loss function with α as the weighting penalty parameter is applied. It is set at 0.85 to punish more false negative case. This idea is inspired from [125], due to the sparsity of voxel data, it may be more probable that the neural network recognizes 1 as 0. The value of α is gained by experiments. The y is the target value in {0, 1} and the y' is the output of the neural network in (0, 1) for each voxel. From the results presented, the inverse deformation approximate performance is proven to be able to compensate the changes from the nominal model used in the tests solely from the voxel representation of STL form of the 3D build.

Long Short-Term Memory for Layer Manufacturing Analytics
A data-driven predictive model is proposed by Jhang et al., taking the printing process into account in a deep learning network structure, using Fused Deposition Modeling (FDM) as a demonstrative case study [113]. Temperature and vibration data are measured to reveal the layer-wise thermal and mechanical activities as well as the process variations, and the inter-relationship among different printing layers is characterized by a Long Shortterm Memory (LSTM) network. Process parameters and material property data combined with data collected from sensors are fused in order to estimate the tensile strength of manufactured parts. A modified Layer-wise Relevance Propagation (LRP) is applied to calculate the effect of each process parameters on the prediction result.
In a previous work adapting Design of Experiment (DoE) approach [126], additional machine setting played a big role in the surface roughness where the slice height and width played major roles whereas factors like temperature was insignificant. In another study [127], consideration of material properties and machine settings taking into account factors like tool path and layer thickness on warp deformation is scrutinised. However, these methods are highly dependent on quantitative correlations to support the proposition of thinner printing layers alongside the preferred setup for FDM manufacturing.
In order to improve part tensile strength prediction performance in FDM, a machine learning method has been developed based on an LSTM network and in-process sensing data. The main goal is to better understand the effect of sequential layer-by-layer printing process which is the main trait of FDM. Firstly, a set of sensors including IR sensor, a thermocouple and an accelerometer capture the layer-wise activities. The sensing data is taken as input to the individual LSTM cells that reflect the individual printing layers. The inter-cell communication through the LSTM forward path is used to model the layer-wise thermal history. The processed sensing data from each LSTM cell, representing the contribution from each of the printing layers to the part property, are then combined with the process parameters and material property to predict the tensile strength of manufactured parts hand in hand. Additionally, Layer-wise Relevance Propagation (LRP) algorithm has been modified and adapted in analysing the extent of process parameters' impact in tensile strength prediction.
Experimental results show that the LSTM-based predictive model outperforms several machine learning techniques, such as Support Vector Regression and Random Forest.
In process sensing, it shows that significant improvement was made in part tensile strength prediction. Specifically, it reduces the prediction RMSE by 44% and improves the prediction of variation by 22.6% reflected by the R2 value over the model that only uses the process parameters and material property as network input. From the relevance analysis, it is proven that three process parameters namely extruder temperature, printing speed and layer height, massively contribute to the tensile strength prediction in the model. The proposed LSTM model managed to outperform the RF and SVR models for part tensile strength prediction, with improvement of 9.8% and 24.3%, respectively. This further approves the efficacy of the sequential layer-by-layer modelling of the FDM process via the LSTM network.

Wear Prediction for Component Production
In FDM characteristics such as surface roughness, mechanical strength and dimensional accuracy are found to influence the wear strength of components manufactured via FDM. The wear strength of the FDM fabricated prototypes is measured based on five input variables as demonstrated in [128]. The variables are:
Air gap.
Wear strength is a crucial attribute for the durability of part and little work has been done to better understand the wear characteristic of the rapid prototyping processed part.
For each of the input process variables, values at varied levels are considered as per guidelines of machine manufacturer and industrial application. Wear volume is determined by the difference in height by multiplying it to the cross-sectional area, while sliding distance is obtained by multiplying time with speed of rotation. For the wear testing, pin on disk apparatus is used. The proposed method using Improved approach of Multigene Genetic Programming (Im-MGGP) is compared to that of the other three potential models; standardised MGGP, SVR and ANN [129].
To understand the concepts of MGGP method, the basics of Genetic Programming (GP) is discussed in brief. GP generates models automatically based on the given data using Darwinian's principle of survival of the fittest [130]. The same working principle applies in GP with Genetic Algorithm (GA) but the only difference between them is that, GA evolves solutions represented by strings (binary or real number) of fixed length, however GP generates solutions represented by tree structures of varying sizes. GP algorithm initiates by randomly generating models. The number of models generated is represented by the population size. The models are formed by combining the elements randomly from the functional and terminal set. A function set which usually comprises elements such as basic arithmetic operations, Boolean operators or other operators predefined by the user. The terminal set comprises elements such as numerical constants and input decision variables of the process. Dissimilar to GP, the evolutionary phase of the MGGP algorithm evolves models, where every model is formed by the combination of trees or genes.
It is validated that the robustness of the model by unveiling dominant input parameters and hidden non-linear relationships. It was found that the wear strength decreases with an increase in layer thickness, raster width but strength increases with increase in air gap. The high generalisation ability of the Im-MGGP model is highly beneficial for rapid prototyping process, where it requires contingency that involves high-fidelity models that can predict wear strength in ambiguous input process conditions. The model provides an explicit functional relationship between wear strength and the input process parameters, and thus can be further extended for offline prediction. Table 5 summarises the three error compensation approaches incorporating different deep learning algorithms and the major findings. Table 5. Summary for error compensation methods in additive manufacturing.

Error Compensation Method Approach Major Finding(s)
Learning-Based Framework with 3D Deep Learning [123] Four deformation parameters are used to estimate finishing errors presented by the means of voxelised representation of dental crown adapting U-net auto encoder.
Inverse deformation approximate performance is proven to be able to compensate the changes from the nominal model used in the tests solely from the voxel representation of STL form of the 3D model.

Long Short-Term Memory for Layer
Manufacturing Analytics [113] Temperature and vibration data are collected to estimate process variations adapting Long Short-term Memory network.
Inverse deformation approximate performance is proven to be able to compensate the changes from the nominal model used in the tests solely from the voxel representation of STL form of the 3D model.

Wear Prediction for Component
Production [129] Difference in height product with its cross-sectional area is used to calculate the wear volume adapting. Improved approach of Multi-gene Genetic Programming.
Robustness of the model is validated by unveiling dominant input parameters and hidden non-linear relationships. Wear strength decreases as layer thickness and air gap decreases.

Future Directions
Of late, we see a steady increase in awareness in the industrial segments on the different applications AM can support. The application driven approach is getting more and more attention and we see that coming from the financing world [131], where today several investment funds are claiming that interest to invest in traditional machine manufacturing is slowly declining, instead they opt for start-ups that apply 3D printing in certain domains [132,133]. The acquisition of Makerbot by Stratsys for USD 403 million is one of the indicators for the proliferation of market interest and confidence in this manufacturing technology [134]. Today they are looking at methodologies to simulate consultancy and co-creation in a wide group of industries that started using 3D printing. This is the way that they create a market and a demand for a product rather than a supply for a non-existing market. That is why the application driven approach and the stimulation of the users' demand is going to really simulate 3D printing or AM further.
With regards to materials, 3D printing in the near future will more work in the opposite direction of the well-known phrase of "less is more", we will be seeing more different materials and we will be able to target more application-based approach rather than an available manufacturing technology driven approach. 3D printing and materials have always been an unending cycle, whereas you see that materials are not being developed because they are not processable on commercially available machines. However, there is a drive now that is fuelled by the willingness and the versatility in large materials supply from producers to enable the push in this technology. This means that there is still a steadfast growth in the importance of 3D printed products. Many highly demanding industries like the aerospace and automotive sectors have a demand that are different than the ones being supplied, at the moment they are willing to make compromises to make advances in additive manufacturing in various ways, but in the future with new materials developments it will not be necessary anymore for such compromises. Designers can go towards the materials that they want to use for their exact application either in functional prototypes or even in series manufacturing. In practical manufacturing industry, the printability or complexity calculation of a product is not based on a single indicator but rather an integration of multiple indicators for instance, time, cost, raw material, model size, and geometry. The problems on how to test and determine multi-indicators and the effects of the indicators have proportionately transformed into an optimization problem solved by Genetic Algorithms (GA) and genetics-based ML method to achieve an optimal effect proportionate to the aim of minimising the complexity value that has been a focus as of late. The motivation as to why GA is adapted is due to the ability of large data could to be expressed in string binary format [135]. In relation to other methods, this probabilistic search method requires less assumptions in the objective functions as shown in [136]. Moreover, the scheme being highlighted is developed on the basis of the current level of 3D printing. To further popularize 3D printing, more research should be focused on printing technique optimization in order to dramatically lower the complexity threshold in a multi-indicative setting. As a result, by combining the assistance of the printability checker and the improved printing method, more and more products are in the printable state than earlier.
When we look at the revolution of 3D printing has undergone over the past years, it is clearly proven that there is a big impact in rapid prototyping architecture and from there had evolve into other aspects in design and manufacturing process as a whole. The big evolution that we are beginning to observe nowadays is that 3D printing is being adopted for serial manufacturing. A number of mass manufacturers have been looking at 3D printing and are actually integrating it into their ecosystem [137]. In order for AM to become a part of the mass manufacturing ecosystem, productivity of the technology is a key element. The industry is always trying to increase the productivity, so software plays a big role in this day and age by looking at a number of innovative ways of automating tasks. Automation of steps that are not just intending to reduce labour time but more importantly to improve the efficiency of the entire process by automating legwork steps, and by doing so, we can enhance the number of parts that are being built at a specific time on a specific machine. This can be done by working on the simulation process before the build is started or even in real-time in the software department. Nowadays, a new direction that is getting more attention is to incorporate the 3D printing process with edge computing to hinder bottlenecking of unnecessary information from being bundled up and processed. Another advantage of simulating prior to production is the possibility of reducing any incoming errors and most importantly preventing them from happening in the first place by taking the countermeasures. Though the computational simulation has verified the scheme shown in [6], it is possible to simplifying and accelerate a 3D printing process, evidently, there are still some defects which may be affecting the printing precision and optimal solution. In the case of the Christofides algorithm utilising the distance as a criterion, it can only prove that a nozzle traversing distance or time is optimal. However, it has yet to be proven that the total time consumption is the shortest under the circumstance of neglecting the retraction time. In [6], it points out that a retraction method has to be considered due to the generation of excess filament leaking, which usually happens in a typical printer. Moreover, in the effort to reduce the computing and printing time, researchers proposed a simplified method to unite the small, connected print segments into integrated segments based on the consolidation threshold rate.
Regarding the connectivity of AM process, the biggest change expected is that new players entering the market have a new set of paradigms by default since 3D printing technologies are becoming more accessible by the years. Whereas companies having traditional grounds in traditional manufacturing tend to have a pre-set of an old and proven perspectives that are usually not as environmentally friendly as AM. However, there are a lot of complementarity and opportunities that these major companies can bridge with more proven techniques expected to be infused with the core principles of AM.
By making the process smoother, AM can provide a more cost effective and efficient solutions, hence enabling more designers getting up to a speed that is not usually possible with the current knowledge that we have on AM today. In a lot if instances, ordering a 3D printed part is not easy because of the way 3D printing process is set up. In terms of 3D printing manufacturing we are still in an early stage of the product lifecycle, working with the early adaptors and innovators. Another important element in connectivity nowadays is the cloud platform. A comprehensive cloud platform is not only about the collection of abundant resources. Much research still focus on the technical innovation, resulting in the lack of attention to system security and safety for future deployment and adaptation of 3D printing in major companies. Even though the sharing platform may highly improve the resource usage and provides the opportunity to middle or small-scale manufacturers to accomplish their production, it also leads to the malicious attacks from unexpected parties, causing the risks of information leak in these competitive and harsh environment [138]. A method of establishment of a private cloud platform, offering benefits and services from public platform environment and self-management is proposed in [139]. Although it may reduce the risk to some extent, the specific criteria and standard to implement still requires extensive research.
Governments globally [138,139] are getting more involved in 3D printing way of manufacturing because the developers have reached a level of maturity in creating more sustainable and energy efficient 3D printers. The AM sector is leaning more towards various manufacturing technology approaches providing a more significant impact in the lives of people especially in the research and education sectors. Currently the term '3D printing' is widely being adapted for additive manufacturing from polymer based to metal and concrete, so the expectation of what can and cannot be done is still vague with the colloquial term, meaning there is not a limit to what can be produced by this particular method at least on the perspective level. This can be challenging towards government bodies to estimate what the possible risks and benefits are for this means of manufacturing. The two main concerns are basically, the Intellectual Property (IP) and the other one is the product liability, causing the same effect as the Internet has brought to the music and movie industries. Nonetheless, it will disrupt the traditional supply chains and part of the value will shift from the material objects to the digital file, thus solutions on how to protect and regulate CAD files needs to be a focus in the near future. With every parties being on the same page, it is possible to create a good and safe regulatory framework that protects their designers and programmers from malicious forms of attacks relating to cybersecurity issues. Social cloud manufacturing comes into the picture as it enables large firms to outsource a portion of their manufacturing tasks to smaller independent companies to allow the phases of ideation and fabrication in co-creating a product design while protecting the confidentiality of the design [140]. Cloud manufacturing (CM) provides a list of breakthroughs for challenges faced in sustainable manufacturing. Some of the major challenges faced by companies are namely; insufficient niche expertise present within an enterprise and the lack of information on quantitative environmental impact on a specified manufacturing process [141]. One key factor of cloud manufacturing is the basis of collective knowledge of data retrieval, storage and sharing in a supply chain. The parties which share a data can determine what type, how much, to whom the data is shared with. Initially, a partnership between cloud users only allows specific type of data to be shared, but as the requirement and trust progresses, it may involve various forms of classified information being disclosed. In Social Manufacturing, manufacturers and selected individuals touted as prosumers contribute to the actual design of a product [142] by crowdsourcing information to simulate innovative designs and ideas. Cloud manufacturing platform can be used to match developers to relevant expertise thus allowing ubiquitous access to sensitive design information [143]. Even with the uncertainty of how far intellectual property's barriers could be stretched, cloud manufacturing will benefit from CM's principles from a share-to-gain philosophy [144].
Thus, a comprehensive cloud platform is not only about the collection of abundant resources. A lot of research still focus on the technical innovation, resulting in the lack of attention to system security and safety for future deployment and adaptation of 3D printing in major companies. Though the sharing platform may highly improve the resource usage and provides the opportunity to middle or small-scale manufacturers to accomplish their production. It also leads to the malicious attacks from unexpected parties, causing the risks of information leak in these competitive and harsh environment [145].
A method of establishment of a private cloud platform, offering benefits and services from public platform environment but self-managed is reported in [146]. Although it may lower the risk to some extent, the specific criteria and standard to implement still require extensive research.
All in all, in the coming years we do not need to expect for a major explosion of the market, but at the same time we do not have to be pessimistic since the study growth will continue steadily. A steady growth will ensure an increasing number of customers and end users in AM and an increased number of companies that are willing to convert or at least merge AM with traditional methods in their manufacturing lines.

Conclusions
This paper provides a comprehensive review of present works bridging machine learning and additive manufacturing in overcoming various manufacturing and design process challenges. Error prediction in additive manufacturing is presented, ranging from various techniques to tackle the issue of variations in manufactured model from the initial designed form. Error compensation methods through quality assurance, process monitoring and optimal control could further improve the final product's build quality and the production timeline with the inclusion of computerized algorithms has been summarized with significant improvements observed especially in FDM and DMLS. Although a lot of simulations are carried out by researchers, there are still a huge gap to be filled in the efforts to implement AI in additive manufacturing to further build the confidence of major manufacturers around the globe to apply this technique as an integral part of the design and manufacturing process of a product. As additive manufacturing is expected to become the mainstream mode of production soon, further developments on AI architectures in this relatively new field are necessary to accelerate the proliferation of this manufacturing solution in the Industry 4.0 umbrella in providing a reliable cyber-physical system to be tested out and ultimately implemented. This paper would hopefully give a constructive step by step overview on people who are new to AM and the inclusivity of AI frameworks in different AM tasks could efficiently improve the overall process of this new form of manufacturing.

Institutional Review Board Statement:
The study in the paper did not involve humans or animals.

Informed Consent Statement: Not applicable.
Data Availability Statement: This paper is a scientific review paper that provides a detailed analysis and summary of machine learning for error compensation in additive manufacturing, independent of the data.