Raster Angle Prediction of Additive Manufacturing Process Using Machine Learning Algorithm

: As additive manufacturing (AM) processes become integrated with artificial intelligence systems, the time and cost of the fabrication process decrease. In this study, the raster angle, an important parameter in the manufacturing process, was examined using fused deposition modeling (FDM), an AM method. The optimal value of this parameter varies depending on the designed product geometry. By changing the raster angle, the distribution of stresses and strains within the printed object can be modified, potentially influencing the mechanical behavior of the object. Thus, the correct estimation of the raster angle is essential for obtaining parts with high mechanical properties. The focus of this study is to reduce the fabrication time and cost of products by intertwining machine learning (ML) systems with mechanical systems. Its novelty is that ML has never been applied for FDM raster angle estimation. The estimation and modeling of the raster angle were performed using five different ML algorithms. These algorithms include a support vector machine (SVM), Gaussian process regression (GPR), an artificial neural network (ANN), decision tree regression (DTR), and random forest regression (RFR). Data for training were generated using various shapes and geometries, then trained in the MATLAB software, and a prediction model between the input parameters and the raster angle was created. The predicted model was evaluated using five performance criteria. The RFR model predicts the raster angle in the FDM test data with R-squared (R 2 ) = 0.92, an explained variance score (EVS) = 0.92, a mean absolute error (MAE) = 0.012, a root mean square error (RMSE) = 0.056, and a mean squared error (MSE) = 0.0032. These values are R 2 = 0.93, EVS = 0.93, MAE = 0.010, RMSE = 0.051, and MSE0.0025 for the training data. RFR is significantly superior to the other prediction algorithms. The proposed model predicts the optimum raster angle for any geometry.


Introduction
In additive manufacturing (AM), manufacturing processes necessitate the optimal use of raw materials and time factors, as well as physical and operational processes.The performance of the fabrication stages in this manufacturing method can be developed by estimating the optimum printing parameters, which results in less material consumption, a shorter fabrication time, and lower fabrication costs [1,2].Machine learning (ML) technology is a verification and prediction method that includes systems that learn from data.The verification and prediction capabilities of this technology can be employed in AM to determine optimal printing parameters that will ultimately provide low costs while improving the quality of the final product.The prediction and optimization of printing parameters using software will help in the development of modern fabrication methods [3,4].In parameter optimization, instead of searching for an optimum continuous function, the optimum values of the design variables for a specific problem are obtained [5].Thus, by Appl.Sci.2024, 14, 2046 2 of 16 determining the optimum priming parameters in the AM process, better quality products with higher mechanical properties can be obtained.
AM is a manufacturing method that allows for flexibility in design, resource efficiency, and the production of parts made of multiple materials [6].The advantages of AM include design freedom, rapid prototyping, reduced material waste, and custom manufacturing capability.This method can be particularly effective in the fabrication of parts with a complex geometry, the creation of special designs, or the fabrication of small batches [7].AM allows for the direct the integration of sensors into the fabrication process, enabling the creation of complex and customized components with embedded sensing capabilities.Sensor-integrated parts fabricated by AM have several applications [8].In particular, with its AM applications, it can constitute key elements by being applied in the biomedical, electronics, and aviation industries within the framework of Industry 4.0 [9,10].
Fused deposition modeling (FDM) is a popular method in 3D printing [11], especially for fabricating metal parts with complex geometries [12].It offers flexibility over traditional machining methods, making it suitable for various industries like drones, medicine, robotics, and defense [13,14].The FDM printers use thermoplastic materials melted in a print head, which applies the material layer by layer onto the surface following a specific pattern [15].Objects can be created from physical ones through 3D scanning and digital modeling, typically exported in an STL format [16].The model is then converted into code containing print head movements and filament heating parameters to produce the final part by extruding the material at a specific speed and location, initiating the manufacturing process.
The FDM processing parameters include wall thickness, build orientation, printing speed, infill density, raster angle, and layer thickness [17,18].Depending on the application for which the part is manufactured, the careful selection of these process parameters is required.Despite the simplicity and flexibility of FDM, it has some mechanical limitations, such as material usage depending on the raster angle.The raster angle holds significant importance in the printing of materials, particularly in AM processes, such as FDM.This angle dictates the orientation of successive layers of material as they are deposited during the printing process.The choice of raster angle directly influences various aspects of the final part, including its mechanical properties, surface finish, and dimensional accuracy.Researchers have extensively studied the effects of the raster angle on material printing, recognizing its pivotal role in determining the overall quality and performance of printed parts.For instance, studies by Birch et al. [19] and Ahn et al. [20] have demonstrated that the selection of an appropriate raster angle can significantly impact the mechanical integrity and surface quality of FDM-produced parts, emphasizing the critical need for careful consideration during the design and fabrication stages.Furthermore, the raster angle plays a crucial role in optimizing the strength and durability of printed components.Consequently, understanding and effectively managing the raster angle is essential for achieving the desired part characteristics and ensuring the successful implementation of AM technologies.Current FDM-based 3D printers cannot detect the optimal raster angle [21].Traditional optimization and estimation methods can estimate the raster angle for limited design processes.Thus, in this study, ML-based algorithms are proposed to verify and estimate the optimum raster angle of different geometric parts.The input parameters required for training the algorithms were obtained from different model geometries.The proposed prediction model reduces fabrication costs without affecting product quality.An estimation of the raster angle parameter with different ML algorithms will be performed for the first time in this study.This feature makes this study unique.
There are many studies that estimate the mechanical properties of products fabricated with FDM using ML methods [22][23][24][25].Sharma et al. studied the impact of important parameters on the dimensional accuracy of various geometries such as holes and rectangular slots [26].They used a decision tree algorithm to predict the dimensional change.As a result, this algorithm makes accurate predictions.In addition, the effectiveness of the developed model was confirmed with an R 2 score of 0.67.Ramiah and Pandian investigated the effects of 3D printing parameters and determined the optimal combination of these parameters [27].The abovementioned process parameters were found to have a good effect on the strength of the constructed models.Ulkir and Akgun aimed to determine the optimal combination of input parameters to predict and minimize the surface roughness of samples fabricated by FDM on a 3D printer using a cascaded forward neural network and genetic algorithm [28].Li et al. developed an ensemble ML approach for predicting the surface roughness of FDM parts [29].In this study, raw data were processed according to feature importance using RF-based methods before training the ML models.Azahara et al. used machine learning algorithms for classification to create different models that can predict the surface roughness of parts produced from polyvinyl butyral through FDM [30].Five input variables were defined (layer height, printing speed, number of perimeters, wall angle, and extruder temperature) and 16 parts were produced, each with three different surfaces.The average value of the surface roughness Ra on each surface was obtained.From these experimental values, 40 models were trained and validated.The model with the best prediction results was the model generated by the Bagging and Multilayer Perceptron (BMLP) with a Kappa statistic of 0.9143.
The use of ML algorithms is expanding day by day in the AM process.These algorithms will significantly contribute to improving the fabrication process [31,32].In this study, we used ML algorithms to estimate the raster angle to ensure the minimum material usage and fabrication time in the FDM, regardless of the model.The prediction and modeling processes were performed using five different ML algorithms.These algorithms include a support vector machine (SVM), Gaussian process regression (GPR), an artificial neural network (ANN), decision tree regression (DTR), and random forest regression (RFR).The implementation of advanced ML algorithms for the prediction of the best raster angle for different geometries conclusively reduces a product's cost without manipulating its quality.The training data created using different shapes and geometries was trained in the software, and a prediction model between the input parameters and the raster angle was created.A total of 50 model designs were made, and as a result, a dataset of 1050 lines was created.According to the performance criteria applied to the prediction models, the accuracy of RFR was determined to be higher than that of the other ML algorithms.The novelty of this study is that the implementation of ML for FDM raster angle prediction has never been implemented.The findings of the study will contribute to the growth of the AM industry by reducing the product lead time and cost without compromising accuracy.The proposed model can predict the optimum raster angle for any geometry, which will further increase the applicability of digitally fabricated parts.

Data Collection
It is necessary to use the slice program to calculate material consumption and fabrication time according to different raster angles of 3D models created in the computer environment.In this study, the Zaxe XDesktop commercial slicing program was used, and the training data required for ML was created.Pieces with different geometries (rectangle, cylinder, and sphere, etc.) were used as models (Figure 1).Data were created by changing seven different raster angles (0 • , 15 • , 30 • , 45 • , 60 • , 75 • , and 90 • ) and three infill densities (30%, 60%, and 90%) for the Zaxe Z1 Plus open-source 3D printer.
Process time (min), weight of the material (g), and length of the material wire (m) were calculated for each model according to the change in these two parameters.While process time refers to the time required to produce the model, the weight of the material defines the amount of material used during fabrication.Finally, the length of the material wire refers to the length of the filament consumed relative to the amount of material used.Other printing parameters were kept constant in the slicing program.These parameters are layer thickness 200 µm, nozzle temperature 220 • C, wall thickness 5 mm, and printing speed 60 mm/s.Process time (min), weight of the material (g), and length of the material wire (m) were calculated for each model according to the change in these two parameters.While process time refers to the time required to produce the model, the weight of the material defines the amount of material used during fabrication.Finally, the length of the material wire refers to the length of the filament consumed relative to the amount of material used.Other printing parameters were kept constant in the slicing program.These parameters are layer thickness 200 μm, nozzle temperature 220 °C, wall thickness 5 mm, and printing speed 60 mm/s.

Experimental Procedure
In this study, five different ML algorithms were applied using the MATLAB software in the prediction process.The aim of this study is to determine the model's estimation efficiency for suggesting the appropriate raster angle of a new part.Five performance criteria, including mean squared error, mean absolute error, root mean squared error, Rsquared, and explained variance score, were employed to test the performance of the proposed model using the cross-validation technique.Algorithms must be trained using experimental data to develop the ML-based process shown in Figure 2. Models with different structures, some of which are shown in Figure 1, were used to generate experimental data.Twenty-one data points were calculated for each model.A total of 50 model designs were made, and as a result, a dataset of 1050 lines was created.The material weight, length of wire, and process time values were recorded for all datasets.Ten sample datasets are given in Table 1.When the data are collected, ML algorithms are trained to estimate the best raster angle.

Experimental Procedure
In this study, five different ML algorithms were applied using the MATLAB software in the prediction process.The aim of this study is to determine the model's estimation efficiency for suggesting the appropriate raster angle of a new part.Five performance criteria, including mean squared error, mean absolute error, root mean squared error, R-squared, and explained variance score, were employed to test the performance of the proposed model using the cross-validation technique.Algorithms must be trained using experimental data to develop the ML-based process shown in Figure 2. Process time (min), weight of the material (g), and length of the material wire (m) were calculated for each model according to the change in these two parameters.While process time refers to the time required to produce the model, the weight of the material defines the amount of material used during fabrication.Finally, the length of the material wire refers to the length of the filament consumed relative to the amount of material used.Other printing parameters were kept constant in the slicing program.These parameters are layer thickness 200 μm, nozzle temperature 220 °C, wall thickness 5 mm, and printing speed 60 mm/s.

Experimental Procedure
In this study, five different ML algorithms were applied using the MATLAB software in the prediction process.The aim of this study is to determine the model's estimation efficiency for suggesting the appropriate raster angle of a new part.Five performance criteria, including mean squared error, mean absolute error, root mean squared error, Rsquared, and explained variance score, were employed to test the performance of the proposed model using the cross-validation technique.Algorithms must be trained using experimental data to develop the ML-based process shown in Figure 2. Models with different structures, some of which are shown in Figure 1, were used to generate experimental data.Twenty-one data points were calculated for each model.A total of 50 model designs were made, and as a result, a dataset of 1050 lines was created.The material weight, length of wire, and process time values were recorded for all datasets.Ten sample datasets are given in Table 1.When the data are collected, ML algorithms are trained to estimate the best raster angle.Models with different structures, some of which are shown in Figure 1, were used to generate experimental data.Twenty-one data points were calculated for each model.A total of 50 model designs were made, and as a result, a dataset of 1050 lines was created.The material weight, length of wire, and process time values were recorded for all datasets.Ten sample datasets are given in Table 1.When the data are collected, ML algorithms are trained to estimate the best raster angle.

Support Vector Machine
A support vector machine (SVM) is a learning method introduced by Vapnik to solve classification and curve fitting problems [33,34].This learning method falls under the supervised learning method.In supervised learning, during the training phase, the class labels of the data, i.e., to which class they belong, are clear [35].The operation of the SVM estimator (y) is expressed as follows: If the kernel function is K xi , b is the bias term of the SVM network.The W jk is called the weight vector [36].The K x and W denote Lagrange multipliers.The K xi is a nonlinear function that maps input vectors to a high-dimensional feature space.The equation of the nonlinear function method can be expressed as follows:

Gaussian Process Regression
Gaussian process regression (GPR) is a successful and flexible ML method generally employed to solve nonlinear multivariate regression and classification problems [37].The most important advantage of GPR is that uncertainty measurements can be made on its results; thus, it can produce successful predictions even in small non-parametric datasets [38].It assumes that the underlying function generating the results is a Gaussian process, which is a completely stochastic process.The mean function of the GPR can be any function that maps input variables to output variables, while the covariance function encodes the smoothness and similarity of the function [39].
Given a set of input-output pairs (x 1 ,y 1 ,), (x 2 ,y 2 ,), • • • , (x n ,y n ,), the probability of the data is: The purpose of GPR is to find the function f (x) given below.This function is the distribution of y over x.Here, x refers to the input parameters in the Gaussian process.The y represents a finite number of outputs connected to x [40].
By choosing different mean and covariance functions, different types of datasets can be modeled.The exponential kernel function, a commonly used covariance functions, was used for the GPR model developed in this study.The main disadvantage of GPR is that it can be computationally slow and costly, especially for large datasets.However, several approximation methods can be used to speed up the calculation [41].

Artificial Neural Network
Artificial neural networks (ANN) are methods developed to automatically realize the abilities of the human brain, such as acquiring and discovering new information by learning, without any help [42].ANNs have advantages, such as not requiring a mathematical definition for the relevant event and being able to make predictions using a limited number of experiments.The layers that make up the ANNs are as follows [43].
The artificial nerve cell structure is shown in Figure 3.The x n signal at the input of the n synapse is multiplied by the synaptic weight w nj and connected to the n neuron.The summation function adds the input signals and the corresponding synapses of the neuron via a linear combiner [44].Threshold, piecewise linear, sigmoid, and Gaussian functions ber of experiments.The layers that make up the ANNs are as follows [43].
The artificial nerve cell structure is shown in Figure 3.The x signal at the input of the n synapse is multiplied by the synaptic weight w and connected to the n neuron.The summation function adds the input signals and the corresponding synapses of the neuron via a linear combiner [44].Threshold, piecewise linear, sigmoid, and Gaussian functions are used as activation functions in the literature.The relationships in an artificial neural network can be expressed mathematically as follows: Here,  is the linear combiner output,  ,⋯,  are the synaptic weights of neuron k,  ,⋯,  are input signals,  is the output signal of the neuron, (… ) is the activation function, and  is the bias value.If artificial neurons are represented by nodes and neuron inputs and outputs are connected by directed arrows, ANNs become weighted directed graphs.ANNs can be divided into two classes according to the structure of the graph.The first is feedforward networks without loops, and the second is recurrent networks with loops due to feedback connections.In feed forward ANNs, the information transferred only moves forward, i.e., there is a movement from input to output [45].

Decision Tree Regression
Decision tree regression (DTR) is among the important data mining techniques used in classification and prediction.A decision tree is a directed tree consisting of a root node that has no input and internal nodes that each receive one input [46].Nodes whose outputs are taken as input by another node are called internal or test nodes, and nodes whose outputs are not an input to another node are called leaf nodes.In the decision tree, each internal node divides the sample space into two or more parts on the basis of the input attribute values being subjected to a certain function [47].ANNs can be divided into two classes according to the structure of the graph.The first is feedforward networks without loops, and the second is recurrent networks with loops due to feedback connections.In feed forward ANNs, the information transferred only moves forward, i.e., there is a movement from input to output [45].

Decision Tree Regression
Decision tree regression (DTR) is among the important data mining techniques used in classification and prediction.A decision tree is a directed tree consisting of a root node that has no input and internal nodes that each receive one input [46].Nodes whose outputs are taken as input by another node are called internal or test nodes, and nodes whose outputs are not an input to another node are called leaf nodes.In the decision tree, each internal node divides the sample space into two or more parts on the basis of the input attribute values being subjected to a certain function [47].
A DTR is a flowchart-like tree structure in which each internal node represents a feature (or attribute), each branch represents a decision rule, and each leaf node represents the outcome.The decision tree algorithm starts from the root node and progresses along the tree, making a decision based on the input feature values until it reaches a leaf node.The value at the leaf node represents the predicted output value [48].

Random Forest Regression
The random forest regression (RFR) algorithm produces various models and creates classification by training each decision tree on a different observation sample through multiple decision trees [49].The most appreciated point about the algorithm is that it Appl.Sci.2024, 14, 2046 7 of 16 provides the opportunity to re-explore your dataset more deeply by creating various models of your dataset.RFR attracts attention because of its features, such as being applied to both regression and classification problems, being trained faster than other methods, and having a higher prediction speed, having fewer regulation parameters, and being directly applicable to multidimensional problems.Figure 4 presents the steps of the RFR [50].
The value at the leaf node represents the predicted output value [48].

Random Forest Regression
The random forest regression (RFR) algorithm produces various models and create classification by training each decision tree on a different observation sample through multiple decision trees [49].The most appreciated point about the algorithm is that it pro vides the opportunity to re-explore your dataset more deeply by creating various model of your dataset.RFR attracts attention because of its features, such as being applied to both regression and classification problems, being trained faster than other methods, and having a higher prediction speed, having fewer regulation parameters, and being directly applicable to multidimensional problems.Figure 4 presents the steps of the RFR [50].RFR is a solution to the problem of overlearning the training data, which is seen a the most important disadvantage of decision trees.Independent decision trees are based on sampling both observations and variables in the training data.When RFR is used fo classification problems, it classifies according to the majority vote by taking a class vot from each tree.In regression problems, the average of the estimates is taken.RFR has two editing parameters [51].These are the parameters of the number of randomly selected predictors at each node (m).In classification, the default m value is m = p, where p indi cates the total number of predictors.On the other hand, in RFR, this value is taken as p/3

Proposed Machine Learning Algorithms
In this research, we suggest a model to estimate the raster angle, which is one of th printing parameters in FDM technology, from data obtained from models with differen RFR is a solution to the problem of overlearning the training data, which is seen as the most important disadvantage of decision trees.Independent decision trees are based on sampling both observations and variables in the training data.When RFR is used for classification problems, it classifies according to the majority vote by taking a class vote from each tree.In regression problems, the average of the estimates is taken.RFR has two editing parameters [51].These are the parameters of the number of randomly selected predictors at each node (m).In classification, the default m value is m = p, where p indicates the total number of predictors.On the other hand, in RFR, this value is taken as p/3.

Proposed Machine Learning Algorithms
In this research, we suggest a model to estimate the raster angle, which is one of the printing parameters in FDM technology, from data obtained from models with different geometric structures.A block diagram of the proposed system is shown in Figure 5.In the first stage, normalization between 0 and 1 was applied to the data to make the classification process more efficient.The min-max method given in Equation ( 9) below was used as the normalization method.
x ′ = x i − x min x max − x min (9) first stage, normalization between 0 and 1 was applied to the data to make the classification process more efficient.The min-max method given in Equation ( 9) below was used as the normalization method.In this equation,  represents the normalized data,  is the input value,  is the smallest number in the input set, and  refers to the largest number in the input set.After the normalization phase, the data selection phase was initiated.During the data selection phase, training-test data were selected.At this stage, the cross-validation method was used 10 times.In this study, 80% of all data were used for training and 20% for testing.In the next stage, the ML algorithms were applied.Five different regression algorithms were used.These algorithms are SVM, GPR, ANN, DTR, and RFR.Finally, the performance analysis of the predictive models was conducted.

Machine Learning Algorithm Results
Values corresponding to the actual raster angle were written to evaluate the results of the analyzed data in the range of 0-1 during normalization.The minimum raster angle corresponds to 0°, while the maximum value corresponds to 90°.The model results, which were developed on the basis of the process parameters in Table 1 and an estimate connecting the raster angle to the process parameters, are shown in Figure 6.In this equation, x ′ represents the normalized data, x i is the input value, x min is the smallest number in the input set, and x max refers to the largest number in the input set.After the normalization phase, the data selection phase was initiated.During the data selection phase, training-test data were selected.At this stage, the cross-validation method was used 10 times.In this study, 80% of all data were used for training and 20% for testing.In the next stage, the ML algorithms were applied.Five different regression algorithms were used.These algorithms are SVM, GPR, ANN, DTR, and RFR.Finally, the performance analysis of the predictive models was conducted.

Machine Learning Algorithm Results
Values corresponding to the actual raster angle were written to evaluate the results of the analyzed data in the range of 0-1 during normalization.The minimum raster angle corresponds to 0 • , while the maximum value corresponds to 90 • .The model results, which were developed on the basis of the process parameters in Table 1 and an estimate connecting the raster angle to the process parameters, are shown in Figure 6.
A graphical comparison process is shown between the actual and estimated raster angle values for each part using different ML algorithms.The model based on the RFR method predicted the raster angle very well with little deviation.A graphical comparison process is shown between the actual and estimated raster angle values for each part using different ML algorithms.The model based on the RFR method predicted the raster angle very well with little deviation.
Various performance metrics have been used to measure the prediction performance of the proposed ML algorithms.The statistic we use with the abbreviation root mean square error (RMSE) is the square root of the difference between the estimated parameter value and the actual parameter value divided by the sample size.This method is expressed by the following equation: Various performance metrics have been used to measure the prediction performance of the proposed ML algorithms.The statistic we use with the abbreviation root mean square error (RMSE) is the square root of the difference between the estimated parameter value and the actual parameter value divided by the sample size.This method is expressed by the following equation: R-squared (R 2 ) is a statistical measure used to evaluate the performance of the model.A value close to 1 for this metric is a measure of success for the model.
The mean absolute error (MAE) is obtained by dividing the result by the number of samples as the sum of the absolute values of the differences between the actual and predicted values in the dataset.The lower the MAE value, the better the performance achieved.
The mean squared error (MSE) is the difference between the model prediction and the target value.If the magnitudes of the error values are similar, MSE can be used.However, if one or more of the predicted values (large errors above the average) are obtained, this measurement may not be appropriate.As the MSE statistic takes the squares of the errors, it gives exaggerated results in the case of large deviations.
The explained variance score (EVS) is a statistical measurement that shows how the sub-dimensions affect the variables in the dataset because of factor analysis.As the score values approach one, the success of the algorithm increases.
The performance analysis results of the ML algorithms are presented in Table 2.Although 80% of the total data were used for training and 20% for testing, the lowest R 2 values were calculated in the SVM method as 0.692 and 0.685 in the training and test sets, respectively.Among the ML models examined, the SVM model performed worse than all other models on both the training and testing sets, as suggested by the performance metrics in Table 2.For a prediction model to be successful, the MSE, MAE, and RMSE criteria must be low, and the R 2 and EVS criteria must be close to one.The best-performing method in all sets is the RFR model.This model has the highest R 2 and EVS values and the lowest MSE, MAE, and RMSE values.In other ML algorithms, although the error rates are within the acceptable range, the success ranking according to the performance criteria is GPR, ANN, DTR, and SVM.The statistical metrics for the RFR model are 0.00324 (MSE), 0.0125 (MAE), 0.0569 (RMSE), 0.922 (R 2 ), and 0.920 (EVS) on the test set, as listed in Table 2.The value of the R 2 for the DTR, SVM, GPR, and ANN models was 0.711, 0.685, 0.843, and 0.789, respectively, compared to the R 2 value of 0.922 for the RFR model on the test set, as presented in Table 2. Figure 7a-e shows the scatter plots for the predicted versus experimental raster angle using ML models.Generally, all developed ML models showed a good correlation between the experimental and predicted raster angle.Among the models, SVM demonstrated the least predictive performance on both test sets, while RFR demonstrated the highest predictive performance, as can be seen in Figure 7.The predicted raster angles are well concentrated around the diagonal line, representing an excellent match between the predicted raster angle and the corresponding experimental values (Figure 7e). Figure 7a-e shows the scatter plots for the predicted versus experimental raster angle using ML models.Generally, all developed ML models showed a good correlation between the experimental and predicted raster angle.Among the models, SVM demonstrated the least predictive performance on both test sets, while RFR demonstrated the highest predictive performance, as can be seen in Figure 7.The predicted raster angles are well concentrated around the diagonal line, representing an excellent match between the predicted raster angle and the corresponding experimental values (Figure 7e).

Hyperparameter Optmization and Cross Validation
The predictive performance and generalization capability of a model is determined by the values assigned to its hyperparameters [52].The optimal values of the hyperparameters are chosen with the help of hyperparameter optimization.Bayesian is a widely used hyperparameter optimization technique.Bayesian optimization is a probabilistic modelbased optimization technique that efficiently searches for the optimal hyperparameters by constructing a probabilistic surrogate model of the objective function.It iteratively selects hyperparameter configurations to evaluate based on an acquisition function, which balances exploration and exploitation.To prevent over-fitting problems, a K-fold cross-validation method is adopted during the optimization.Firstly, the dataset is split into training and testing datasets comprised of 80% and 20% of the completed dataset, respectively.
Notice that the performance of the RFR model is superior to the available methods when tested using the K-fold cross-validation technique (K = 10) with different predictive performance evaluation metrics like MSE, MAE, RMSE, and R 2 .In this study, a 10-fold cross-validation is combined with a Bayesian algorithm to optimize the hyperparameters.
The results of MSE, MAE, RMSE, and R 2 using K-fold cross-validation in every fold on the 3D training and testing sets are presented in Figure 8. Figure 8a presents the mean squared error of RFR in a ten-fold cross-validation while Figure 8b shows the mean absolute error performance on every ten-fold K cross-validation test.Similarly, Figure 8c shows the root mean square error, and Figure 8d shows the R-squared.The results show that the prediction model predicts the raster angle with high accuracy.
The raster angle prediction study may face several limitations that could impact the accuracy and generalizability of its findings.Firstly, the complexity of the FDM process and its dependence on various factors, such as the material properties, printing parameters, and geometric characteristics of printed objects, can pose challenges in accurately predicting raster angles.This complexity may result in difficulties in capturing all relevant variables and their interactions within the predictive models, potentially leading to suboptimal performance or limited predictive power.
Secondly, the study's reliance on specific predictive models, such as RFR, may introduce limitations in terms of model assumptions and flexibility.These models typically require the careful tuning of hyperparameters and feature selection, and their performance may vary depending on the characteristics of the dataset and the underlying relationships between variables.Consequently, the predictive models developed in the study may not fully capture the nuances of raster angle prediction across different printing scenarios, thus restricting the applicability of the findings in real-world settings.Addressing these limitations would require the thorough validation of the models on diverse datasets and the consideration of alternative modeling approaches to enhance the robustness and reliability of raster angle prediction studies.
For future raster angle prediction research, it is recommended to focus on several key areas to overcome current limitations and advance the field.Firstly, researchers should prioritize the collection of high-quality and diverse datasets that encompass a wide range of printing conditions, materials, and geometric complexities.This will enable more comprehensive model training and validation, leading to improved prediction accuracy and generalizability across different FDM systems.Additionally, exploring advanced machine learning techniques, such as deep learning architectures or ensemble methods, could offer new avenues for capturing intricate patterns and dependencies within the data, thereby enhancing the predictive capabilities of the models.Moreover, conducting systematic studies to investigate the impact of various factors, such as the printing speed, temperature, and layer thickness, on raster angle formation would provide valuable insights into the underlying mechanisms and facilitate the development of more sophisticated predictive models.Finally, fostering collaboration between researchers, industry stakeholders, and end-users can facilitate the translation of research findings into practical applications, ultimately driving innovation and advancements in raster angle prediction for AM processes.
facilitate the translation of research findings into practical applications, ultimately driving innovation and advancements in raster angle prediction for AM processes.

Conclusions
Nowadays, the application of machine learning (ML) in fabrication technologies is increasing.In this study, the raster angle, an important parameter in the fabrication process, was examined using fused deposition modeling (FDM), an additive manufacturing (AM) method.The estimation process for this parameter was performed using ML algorithms.Training data were collected on the basis of material and time consumption values on 3D models with different geometries using 3D printer's slicing software.Performance analysis was conducted to evaluate the performance of the ML algorithms.Among these algorithms, the RFR model predicted the raster angle in the FDM process with high accuracy: R 2 = 0.92, EVS = 0.92, MAE = 0.012, RMSE = 0.056, and MSE = 0.0032.The other methods provided controllable responses within the requirements of the error.The ML method successfully verified and predicted raster angles in the FDM process.This suggests the potential application of similar prediction models to different printing parameters in future research.The method shows promise, outperforming existing techniques according

Conclusions
Nowadays, the application of machine learning (ML) in fabrication technologies is increasing.In this study, the raster angle, an important parameter in the fabrication process, was examined using fused deposition modeling (FDM), an additive manufacturing (AM) method.The estimation process for this parameter was performed using ML algorithms.Training data were collected on the basis of material and time consumption values on 3D models with different geometries using 3D printer's slicing software.Performance analysis was conducted to evaluate the performance of the ML algorithms.Among these algorithms, the RFR model predicted the raster angle in the FDM process with high accuracy: R 2 = 0.92, EVS = 0.92, MAE = 0.012, RMSE = 0.056, and MSE = 0.0032.The other methods provided controllable responses within the requirements of the error.The ML method successfully verified and predicted raster angles in the FDM process.This suggests the potential application of similar prediction models to different printing parameters in future research.The method shows promise, outperforming existing techniques according to state-of-the-art classifiers.This indicates the classifiers' capability to predict raster angles effectively in FDM.Implementing advanced ML tools to predict the optimal raster angle for various geometries conclusively decreases fabrication costs without compromising quality.The novelty of this study is that the implementation of ML for FDM raster angle prediction has never been implemented before.This study's findings contribute to the growth of the AM industry by reducing product lead times and costs without sacrificing accuracy.Future studies could focus on developing a web application utilizing deep neural networks to predict the optimal raster angle for any given 3D image, offering a promising avenue for further exploration.

Figure 1 .
Figure 1.Data specimen employed to train the ML model.

Figure 2 .
Figure 2. Proposed structure for estimation of the raster angle.

Figure 1 .
Figure 1.Data specimen employed to train the ML model.

Figure 1 .
Figure 1.Data specimen employed to train the ML model.

Figure 2 .
Figure 2. Proposed structure for estimation of the raster angle.

Figure 2 .
Figure 2. Proposed structure for estimation of the raster angle.
activation functions in the literature.The relationships in an artificial neural network can be expressed mathematically as follows:

Figure 3 .
Figure 3. Basic component of the artificial neural network.

Figure 3 .
Figure 3. Basic component of the artificial neural network.Here, u k is the linear combiner output, w k1 ,• • • , w km are the synaptic weights of neuron k, x 1 ,• • • , x m are input signals, y k is the output signal of the neuron, f (. . . is the activation function, and b k is the bias value.If artificial neurons are represented by nodes and neuron inputs and outputs are connected by directed arrows, ANNs become weighted directed graphs.ANNs can be divided into two classes according to the structure of the graph.The first is feedforward networks without loops, and the second is recurrent networks with loops due to feedback connections.In feed forward ANNs, the information transferred only moves forward, i.e., there is a movement from input to output[45].

Figure 4 .
Figure 4. Structure of the RFR prediction model.

Figure 4 .
Figure 4. Structure of the RFR prediction model.

Figure 6 .
Figure 6.Actual and predicted values obtained using different ML algorithms.

Figure 6 .
Figure 6.Actual and predicted values obtained using different ML algorithms.

Figure 7 .
Figure 7. Experimental versus predicted raster angle based on ML models.

Table 1 .
Analysis of variance for a one-factor experiment.

Table 1 .
Analysis of variance for a one-factor experiment.

Table 1 .
Analysis of variance for a one-factor experiment.

Table 2 .
Performance comparison of the proposed machine learning models.