Modeling the Producibility of 3D Printing in Polylactic Acid Using Artificial Neural Networks and Fused Filament Fabrication

Polylactic acid (PLA) is a highly applicable material that is used in 3D printers due to some significant features such as its deformation property and affordable cost. For improvement of the end-use quality, it is of significant importance to enhance the quality of fused filament fabrication (FFF)-printed objects in PLA. The purpose of this investigation was to boost toughness and to reduce the production cost of the FFF-printed tensile test samples with the desired part thickness. To remove the need for numerous and idle printing samples, the response surface method (RSM) was used. Statistical analysis was performed to deal with this concern by considering extruder temperature (ET), infill percentage (IP), and layer thickness (LT) as controlled factors. The artificial intelligence method of artificial neural network (ANN) and ANN-genetic algorithm (ANN-GA) were further developed to estimate the toughness, part thickness, and production-cost-dependent variables. Results were evaluated by correlation coefficient and RMSE values. According to the modeling results, ANN-GA as a hybrid machine learning (ML) technique could enhance the accuracy of modeling by about 7.5, 11.5, and 4.5% for toughness, part thickness, and production cost, respectively, in comparison with those for the single ANN method. On the other hand, the optimization results confirm that the optimized specimen is cost-effective and able to comparatively undergo deformation, which enables the usability of printed PLA objects.


Introduction
Advances in novel additive manufacturing (AM) technologies are of utmost importance due to their higher flexibility, minimization of material wastes, and reduced tooling requirements [1]. Some evidence is emerging, in a number of industries, of the replacement of traditional manufacturing (TM) with AM. FFF is one of the most applicable AM technologies used to fabricate plastic products. An FFF printer directly builds 3D parts from a 3D computer-aided design (CAD) model by fusing successive extruded layers of feedstock material together to produce components layer by layer. Several studies have specifics as well as printed sample quality. According to the results, hybrid ML techniques improved the accuracy and increased performance compared to the single ML techniques.
According to the literature, the ML techniques can be effective tools for modeling the FFF process [14][15][16][17]. In addition, hybrid ML techniques provided higher accuracy and performance compared with single ML techniques [15]. This made us move toward comparing ANN as the frequently used and simple ML technique with ANN-GA as the hybrid ML technique. Therefore, the objectives of the present work can be categorized into two main stages. The first step was to improve the mechanical behavior of the FFF printed PLA under tensile loading and reduce the production cost of the specimens. The second step was to estimate the toughness (N-mm), part thickness (mm), and production cost ($) in the presence of LT, LP, and ET using the ANN and ANN-GA techniques. The honeycomb internal fill pattern was applied to increase the printed samples' ductility and decrease material use. The area under force-extension curve up to fracture was considered the toughness of the printed specimens. The part thickness was measured by a micrometer of 0.01 mm resolution made by Mitutoyo (Mitutoyo Company, Model 500-196-30 AOS Absolute Digimatic Caliper, Kawasaki, Japan). The production cost was calculated using a formula based on reasonable prices in the FFF 3D printing market. The acquired data were analyzed by Design-Expert V8 software via the response surface method. The independent factors were optimized and examined to affirm that the research method was viable.

Response Surface Methodology and Artificial Neural Network-Genetic Algorithm (ANN-GA)
RSM is based on applied mathematics and the statistical techniques to determine functional relationships between output responses that are affected by input factors [17]. RSM generates an empirical polynomial model of approximation for response surface over a factor region [18]. The smaller the region of interest, the better the approximation when all the independent factors are continuous and can be estimated and regulated for experimental studies. Thus, the response surface can be presented through Equation (1) [19]. Y = f(x 1 , x 2 , x 3 , ..., x k ) (1) where k is the number of independent factors. The approximation of its mathematical model is represented through the infinite strings of x Taylor. The quadratic polynomial function expressed in Equation (2) is implemented in RSM [12,13,20].
where β, β i , β ii , and β ij are the constant, linear coefficients, coefficients of quadratic, and interaction coefficients, respectively. Furthermore, ε represents the regression error.
Here, the input factors include extruder temperature, infill percentage layer, and thickness. As discussed by Moradi et al. [19], the data were obtained from an experimental analysis using Design-Expert V8 software. Table 1 shows three factors (i.e., the statistical analysis based on Central Composite Design (CCD), full replication of three agents, and five stages). Based on the previous research [19], each of the factors was set at the significant domain because at these higher and lower ranges, the 3D printer has proper efficiency. Toughness (N-mm), part thickness (mm), and production cost ($) were opted as output responses. The samples were printed by FFF printer model Sizan 3 (Sizan Company, Kashan, Iran). The part thickness was measured by a micrometer of 0.01 mm resolution made by Mitutoyo. The production cost of the specimens was calculated by a formula obtained from the 3D printing market. The cost of the FFF process was evaluated according to Lieneke et al. [21] which calculated the welding cost production. Equation (3) offers the production cost of PLA printed parts in terms of build time and part weight [21]. The design matrix and experimental results are reported in Table 2 [22]. Design experts uses the statistical analysis for input data and in this software, the central point and suggestion plan are proposed to generate proper parameters.
Production Cost = 0.5 Build time (min) + 0.03 Part weight (gr) (3) ANNs are considered as computational intelligence tools inspired by biological neural networks [7,23]. ANNs train to do tasks by considering the existing mapping of the dataset. The architecture of an ANN is based on the interconnected layers through nodes. The nodes or so called neurons and each connection transmits a signal from one neuron to other neurons; the connections are like the synapses in a biological brain [24].
The output values of each neuron are affected by weight and bias values. All links between input layers and hidden layers compose the input weight matrix and all links between hidden layers and output layers compose the output weight matrix. Weight (w), which controls the propagation value (x) and the output value (O), from each node was modified using the value from the preceding layer according to Equation (4), which presents the relation for producing the output values of each neuron [25].
where T is the specific threshold (bias) value for each node and f is a non-linear sigmoid function, which increases monotonically. The architecture of the proposed ANN is presented in Figure 1. The training phase was performed by MATLAB software. For the implementation, LT, IP, and ET were used as input variables for the prediction of toughness, part thickness, and production cost, respectively. Seventy percent of total data were separated randomly for developing the training process by the network. The remaining data were employed for the testing process and to evaluate the accuracy of the network. The training phase was initiated using 10 neurons in the hidden layer and continued up to 16 neurons by intervals of two neurons. For each step, output data were generated and evaluated by the evaluation criteria in comparison with the target values.
Recently, hybrid methods have provided a higher accuracy compared to single techniques [26,27]. These techniques employ a predictor and an optimizer for developing an accurate prediction model. The general mechanism is to employ an optimizer for improving the architecture of the predictor to reach the best response. One of the frequently used and popular hybrid methods is ANN-GA. A population of candidate solutions to an optimization problem has evolved toward an optimal implementation in the GA. Each candidate solution has a set of properties to reduce the cost function errors. In the ANN-GA technique, the cost function is the output of layers as a function of weight and bias values. GA employs population and generation sizes as a set of properties and compounds as a cost function. The optimization of the cost function aims at reducing the error values. In this case, the error value reduction contributes to providing accurate outputs for the network compared to using a single ANN. Figure 2 represents the flowchart of the proposed machine learning hybrid model of ANN-GA, adapted, and reproduced from [28].  Table 3 presents the evaluation criteria that compared the predicted and output values. These factors are also called performance factors that handle the target and output values (the predicted by models). The correlation coefficient is an index to measure the linearity of the target and output values. The root mean square error calculates the deviation error of the output values compared to the target values [29]. These factors are considered the frequently used evaluation metrics in different modeling tasks [30]. Table 3. Model evaluation metrics.

Accuracy and Performance Index Description
− N is the number of data − A is the desired output value and P is the output value.

Experimental Work
The tensile test samples fabricated in PLA were investigated mechanically, dimensionally, and economically. Polylactic acids are generated from renewable sources with numerous benefits and can be divided into categories, for example, PDLA (poly-Dlactic acid), PLLA (poly-L-lactic acid), and PDLLA (poly-DL-lactic acid) [31]. PLA has a low printing temperature and can be printed both with and without a heated print bed. The material properties of PLA are shown in Table 4, which was adapted from [31]. Despite all of these notable characteristics, PLA is brittle and it is not a true choice for items that might be bent, twisted, or dropped.  Table 3 presents the evaluation criteria that compared the predicted and output values. These factors are also called performance factors that handle the target and output values (the predicted by models). The correlation coefficient is an index to measure the linearity of the target and output values. The root mean square error calculates the deviation error of the output values compared to the target values [29]. These factors are considered the frequently used evaluation metrics in different modeling tasks [30]. Table 3. Model evaluation metrics.

Accuracy and Performance Index Description
-N is the number of data -A is the desired output value and P is the output value.

Experimental Work
The tensile test samples fabricated in PLA were investigated mechanically, dimensionally, and economically. Polylactic acids are generated from renewable sources with numerous benefits and can be divided into categories, for example, PDLA (poly-D-lactic acid), PLLA (poly-L-lactic acid), and PDLLA (poly-DL-lactic acid) [31]. PLA has a low printing temperature and can be printed both with and without a heated print bed. The material properties of PLA are shown in Table 4, which was adapted from [31]. Despite all of these notable characteristics, PLA is brittle and it is not a true choice for items that might be bent, twisted, or dropped. Simplify3D software was employed to fine-tune the build parameters of the specimens. Simplify3D includes comprehensive tools to work with 3D printers. The tensile test sample was modeled as a STL file by Solidworks (modeling computer-aided design and computeraided engineering computer program, SolidWorks 2021 SP2.0, Dassault Systèmes, Concord, MA, USA) based on the international standard ISO 527-2 and imported into Simplify3D. Table 5 illustrates the definitions of the FFF build parameters that were permanent for all experiments. Bottom solid layers - 6 5 Default printing speed mm/min 3600 6 Retraction speed mm/min 1800 7 Outline overlap -Full honeycomb 8 Interior fill percentage % 15 The infill pattern may significantly affect the strength of the 3D printed part. The honeycomb internal fill pattern was applied for the production of light-weight and highstrength specimens. The honeycomb internal fill adhered to the top and bottom solid surfaces offered an excellent rigidity. Figure 3 shows the sample size based on the ISO 527-2 standard for the tensile examination. Figure 4 depicts the 20%, 30%, and 40% full honeycomb infill. Figure 5 presents the 3D printed parts in PLA which is adapted from [24].   The SANTAM 150 universal test (SANTAM company, Tehran, Iran) was used to conduct tensile strength tests according to ASTM D638 at the constant rate of 2 mm/min. As Table 2 indicates, the specimens had two types of fracture under in-plane loading. Most of the specimens demonstrated brittle behavior with no visible deformation before fracture. Only five specimens showed a tough fracture and apparent deformation occurred before separation. These specimens had both a higher strength and ductility than that of the brittle specimens.

Results
The effects of the input factors on the outputs can be signified by the analysis of variance (ANOVA) results. The ANOVA is created by assuming that the elements are fixed, not random, and the design is crossed, not nested. The software selects polynomial terms in the mathematical model. However, the terms must be significant to refrain from aliasing of the model. Design-Expert calculates statistics such as the P-values, lack of fit, Adj R-Squared, and Pred R-Square values to appraise the models. The difference between the predicted adjusted R-squared and R-squared indicates whether the model can reliably be used to interpolate data. If the difference is less than 0.2, then the model fits the data and can be used to interpolate the data.

Toughness
The analysis of the variance table showed that LT was the main controlling factor influencing toughness. The amount of P-value in this parameter was very low. Due to statistical analysis, when the P-value goes to the lowest amount, the parameter may has more effective. Interaction between infill percentage and extruder temperature is also crucial because when two parameters are considered at the same time, it is more tangible which one plays the central role. In Figure 6a and Table 6, the interaction of these parameters is shown. For toughness, the interaction between IP and ET was effective because the P-value had been placed in the effective range. Table 6 depicts the ANOVA results of toughness. The difference between predicted R-squared and adjusted R-squared was 0.042, which affirms that the model can efficiently interpolate data. Equation (5) The relative significance of the factors can be obtained by comparing the coefficients of the factors. Figure 6a depicts the perturbation plot of toughness. A, B, and C curves illustrate the sensitivity of toughness to LT, IP, and ET, respectively. The plot indicates that the toughness of specimens was much more sensitive to LT than other controlled factors. The remarkable point is that IP and ET had a similar influence on the toughness while changing one factor and keeping the others constant. Figure 6b demonstrates the 3D surface plot of toughness in terms of ET and IP. The tough behavior in the printed PLA can be achieved by two procedures. The first is to increase the extruder temperature and decrease IP at the same time. The other is to increase IP and to decrease ET concurrently. The plausible arguments for the improvement in the toughness by the first procedure are the enhancement of interlayer adhesion between plastic strings at higher temperature and the reduction of the trapped air pockets between the strings at lower IP. Moreover, the time required to build the inside sections is considerably dependent on the IP. By increasing IP, the nozzle extrudes more hexagonal pattern lines at the inside sections, which takes more time considering the same printing speed for all cases of IP. Therefore, there is less time for heat transfer and variation in LTs using lower IP, which results in better fusion between plastic strings. Figure 6c depicts the 3D surface plot of toughness in terms of LT and ET. The surface plot indicates that increasing LT and ET at a time results in increasing toughness. In a specimen with higher LT, a smaller number of sections are needed to print the part. Therefore, a specimen with a thicker layer consists of less interlayer bonding, which are potential places to raise stress concentration and crack propagation. Figure 7 is beneficial to compare the interlayer bonding and trapped air using thin and thick LT. In addition, higher LT results in lower heat transfer rates and variation in layer temperatures [24] and consequently, better fusion and adhesion of the extruded layers on the solid layers is expected. Figure 8 demonstrates a schematic of temperature variation in lower and higher LT at the same printing speed. It is evident that printing PLA at lower temperatures results in poor layer bonding. The 3D surface plot (3D-SP) of toughness in terms of IP and LT is presented in Figure 9.    The 3D-SP implies that increasing LT and IP leads to an increase in toughness. The IP patterns and IP influence the interior solidity of the printed parts. For uniform stress distribution during the tensile test, hexagonal cells can withstand a mechanical load to impede stress increases on the neighboring cell. Additionally, IP specifies hexagonal cell size, and smaller cell sizes result in higher densities and higher strength. Therefore, it is rational to conceive that higher internal IP results in higher toughness. The 3D-SP implies that increasing LT and IP leads to an increase in toughness. The IP patterns and IP influence the interior solidity of the printed parts. For uniform stress distribution during the tensile test, hexagonal cells can withstand a mechanical load to impede stress increases on the neighboring cell. Additionally, IP specifies hexagonal cell size, and smaller cell sizes result in higher densities and higher strength. Therefore, it is rational to conceive that higher internal IP results in higher toughness.

Part Thickness
The dimensional accuracy of plastic printed parts is affected by many parameters. The melted strings are deposited based on the sliced G-Code file. In addition to the investigated parameters, the part geometry and printing speed may influence the strings' placement and, thus, dimensional accuracy of the part. After it has been deposited out of the nozzle, the plastic behavior depends on plastic temperature, stable temperature, and ambient temperature. Although PLA does not shrink that much, it is essential to study the effects of process parameters on the dimensional accuracy of the printed parts in PLA. The variance table analysis indicates that although all input factors and their interactions influence the part thickness, the interaction between LT and IP is the significant parameter influencing the part thickness. In thickness, all parameters have an effective interaction. For example, by considering the interaction between LT and IP, the P-value is in range and the amount of this criterion is not high, so it leads to having an effective role. For other interactions such as LT, ET, and IP and ET, the P-value is in range, but the amount of the P-value in these two interactions is higher than LT and IP. Table 7 demonstrates the ANOVA results of the part thickness.  (7) represents the anticipating part's model thickness in terms of coded factors as follows.  Figure 10a shows a perturbation plot of the part thickness. The plot shows that part thickness is very sensitive to change in all controlled factors. It can also be observed that the central point of controlled factors (LT = 0.2 mm, IP = 30%, and ET = 210 • C) is a suitable setting to reach the desired part thickness. Figure 10b depicts the 3D surface plot (3D-SP) of part thickness in terms of LT and IP. The 3D-SP of part thickness in phases of ET and LT is presented in Figure 10c. In Figure 10b, by increasing IP the thickness has increased and by decreasing LT, the thickness has decreased. Also in Figure 10c, the thickness has decreased by LT, but the ET may not be very effective to change the thickness.

Production Cost
The ANOVA illustrates that the LT and IP are the most important factor influences the production cost. LT and IP have a proper P-value and their amount is <0.0001. Table 8 depicts the ANOVA outputs of production cost. Additionally, "Adj R-squared" and "Pred R-squared" were in excellent agreement.
As the coded equation shows, LT had the highest coefficients among the equation terms. Figure 11a depicts a perturbation plot of production cost. The plot confirmed that production cost was much more sensitive to LT than other input parameters. Figure 11b shows the effects of LT and IP on the production cost in the form of a 3D surface. Build time had a major impact on the production cost based on the suggested equation. The build time is the sum of the extruding time of top and bottom solid surfaces and inside sections. The parameter that defines the number of sections to produce a part is LT, and the parameter that determines the extruding time of the inside sections is IP.

ANN and ANN-GA Techniques
ANN and ANN-GA techniques were performed to develop an accurate model for the prediction of toughness, part thickness, and production cost. In the first step, an ANN was developed by 10, 12, 14, and 16 neurons in its single hidden layer for choosing the best number of neurons in the hidden layer in the presence of 70% of the total data. Results were evaluated by correlation coefficient and RMSE values and were tabulated in Table 9. The best response was related to neuron number 12, with the values of 734.6853877 and 0.8692 for RMSE and correlation coefficient, respectively. Therefore, the architecture of 3-12-3 was selected as the base ANN architecture to be optimized by GA. In the Table 9.
The following abbreviations, the Pop. Size, Max Gen., and the No. of Neurons stand for population size, maximum generation, and number of neurons, simultaneously.
GA implemented the ANN's selected architecture in four treatments (based on our experiences in previous studies). These treatments included a population size of 50, 100, 150, and 200. The results are tabulated in Table 9. Based on Table 9, a population size of 150 with a maximum generation size of 360 provided higher accuracy for toughness and production cost and a population size of 100 for part thickness compared with other population sizes. This population size increased the accuracy by about 9.7%, 5.8%, and 1.2%, respectively, for toughness, part thickness, and production cost compared with a single ANN.
By considering the training stage, the elected architectures were employed for the testing stage. The results are tabulated in Table 10. As is clear, the accuracy of the testing and training stage for single ANN did not match, in other words, there was a larger difference between the accuracy of the testing and training stages for the single ANN method. This makes ANN an untrusted approach. On the other hand, hybrid ANN-GA benefits higher sustainability by comparing the testing and training results, which provided almost similar accuracy.  Figure 12 presents the plot diagrams for ANN and ANN-GA in the testing stage. This plot presents the predicted values on the vertical axis and target values on the horizontal axis. Line T = P is the reference one-by-one line to determine the correlation values. Devia-tion from this line indicated the error value between the target and predicted values. Based on Figure 12, ANN-GA provided a higher correlation for the target and expected values compared with those of the single ANN method. The part thickness and production costs were due to the higher accuracy of the ANN-GA compared with that for the toughness.  Figure 13 presents the deviation from target values to compare the ANN and ANN-GA. These figures contain the relative deviation error values for testing data in two categoriessingle ANN and hybrid ANN-GA. The horizontal 0 line refers to target values, and columns refer to relative deviations for each predicted testing data from the target values. As is clear for all three variables, a single ANN provided a higher deviation from target values compared with the hybrid ANN-GA method. These observations show that hybrid methods offer higher accuracy and lower error compared with single methods.

Numerical Optimization
The process parameters were optimized based on a criterion defined in Table 11. The standard aimed to increase the toughness, achieve the desired thickness, and decrease the production cost of 3D printed parts. It was anticipated that the optimized specimen would demonstrate tough behavior at the least-possible production cost with the desired part thickness. The predicted and the experimental results for the implementation of the optimized process parameters are shown in Table 12. The optimum solution had a high level of desirability. Figure 14 depicts the force-extension graph of the tensile test specimens fabricated by the optimal setting. The optimized specimen's improved toughness was more due to an increase in ductility rather than the specimen's strength. By overlaying contour maps from multiple responses, RSM can be used to find the ideal window of operability. The overlaying contour maps to create ideal printed samples is shown in Figure 15. In each contour map, regions that did not meet the significations are grayed-out [32].

Conclusions
The present work aimed to enhance the production of PLA printed parts via an investigation of the toughness, thickness, and production cost of the tensile test specimens. Additionally, training was performed by the ANN and ANN-GA techniques for developing an accurate model for the prediction of toughness, part thickness, and production cost. This method was performed by MATLAB software and calculated a superb prediction of output parameters. The tensile test of samples not only provides a deep insight into the main PLA's features, but can also present brilliant results of printed samples that are printed by some criteria such as IP, ET, and LT. The DOE of this study redcued125 tests to only 20 tests, which has a big impact on saving time and production cost. From the results obtained, the following concrete conclusions can be made. Although PLA is brittle in nature, the results confirm that it is feasible to improve the toughness of the printed parts to develop PLA's end-use mechanical applications. Furthermore, as build time plays a major role in determining production cost, it is possible to reduce production cost without a significant impact on the desired properties. It can also be concluded that interaction between LT and IP is the main parameter that has an impact on the thickness of the printed part. It can be conceived that due to little shrinkage of the PLA, extruder temperature has less influence on the dimensional accuracy of the PLA. In addition, the optimized setting to enhance the producibility of PLA printed parts was a layer thickness of 0.28 mm, infill percentage of 34%, and extruder temperature of 222 • C. The improved toughness of the optimized specimen was due more to an increase in ductility rather than the strength of the specimen. The results also showed that a single ANN model could provide a higher deviation from the target values for all three outputs compared with the hybrid ANN-GA method. For future research, comparative analysis of the hybrid, ensemble, and deep learning models is strongly encouraged to improve the accuracy of the models. The research was accomplished under the constraints of PLA compatibility with existing fused filament fabrication installation, in the absence of the functional assistance of the machine. Although the mechanical properties and dimensional accuracy of PLA have already been studied, there is little literature on the toughness of the printed PLA with a honeycomb internal fill pattern.