Introduction

Additive manufacturing (AM) is a relatively new technology, and most common use is for prototyping purposes. However, during the last decades, AM has found increased use for fabrication of functional parts, and this has led to an increased attention to this technology from both researchers and the various industries. One of the most attractive features of AM is the flexibility of design. Complex shapes are manufactured directly from 3D CAD model.

There have been several examples of benefits of AM creating lighter structures, combining several components into one as well, as the possibility to customize products for personal use. One area where AM has found much use is in the dental industry, where the potential to make dental protheses adapted to patients’ anatomy is utilized. This is caused by the flexibility in design, achieving a lighter product, adding more functionality into the product, and the ability of customization of each product for small production batches.

Nowadays, additive manufacturing has already been used to produce end user products in electronics, automotive, medical and aerospace industries (Wohlers 2016; Stoyanov and Bailey 2017). Management and control of variations in additive manufacturing are, however, one of the challenges of today’s AM processes. “Fist-time-right” and consistency of the parts’ properties are one of the major issues that researchers attempt to address in order to make additive manufacturing more attractive for end user parts production.

Dimensional accuracy is already presented as an important issue in different studies (Baturynska et al. 2018; Caulfield et al. 2007; De Ciurana et al. 2013; Paras et al 2016; Wohlers 2016; Zhu et al. 2018). Zhu et al. (2018) have presented three main mechanism of error generation in AM processes, which are the mathematical geometry approximation error (conversion from CAD to STL file), error due to machine and process parameters, and material-related error (thermal shrinkage and material distortion). Typically, research focus is set on the investigation of how machine process parameters influence the shrinkage effect, while the investigation of an effect of build layout design on dimensional accuracy is not presented in the literature.

For example, Singh et al. (2012) reported that shrinkage effect is connected to such process-related parameters as scan spacing, optimization of laser power, bed temperature, and hatch length of a polymer powder bed fusion process (3D Systems). Delgado et al. (2012) also evaluated significance of the process parameters’ effects on dimensional error, surface roughness, and mechanical properties for metal powder bed fusion systems. The authors also reported that research on dimensional accuracy for two metal materials is very limited comparing with surface roughness and mechanical properties. Another study on part quality of parts fabricated with selective laser sintering (SLS) was statistically investigated concerning various machine parameters by Dingal et al. (2008), but dimensional accuracy was not mentioned.

While other researchers focused on the investigation of how part placement (Yang et al. 2002; Zhang et al. 2017) and different build strategies (Senthilkumaran et al. 2009a) may affect the dimensional accuracy, Yang et al. (2002) reported that application of Taguchi and Analysis of Variance allowed authors optimizing shrinkage ratio for three orientation groups, which they call X, Y, and Z orientation.

Investigation of different build strategies performed by Senthilkumaran et al. (2009a) pointed out to the importance of contouring and hatching, beam compensation, inertia of scanning mirror, scan direction and compensation of positioning errors with regards to shrinkage effect. Moreover, the authors highlighted the impact of part orientation on deviations per unit length.

Later, Senthilkumaran et al. (2009b) introduced a new model for shrinkage compensation based on the results and gained knowledge from the previous study. This model was developed for compensation of shrinkage “at every layer and at every hatch length, unlike a uniform compensation scheme applied to entire part” (Senthilkumaran et al. 2009b). Results were compared with suggested compensation by machine manufacturer, and improvements of dimensional accuracy approximately by 55–62% were observed for newly developed compensation scheme.

To date, the role of STL model properties, which are the number of mesh triangles, number of mesh points, surface and volume of the CAD model, with respect to shrinkage effect is not known. Moreover, compensation of shrinkange effect is usually performed by using scaling ratio for the whole build layout. In the previous study (Baturynska 2018) the authors have already made an attempt to predict scaling ratio for each part separately and investigate these parameters in combination with part placement and part orientation. The results obtained from a Pearson correlation test showed that abovelisted parameters are significant with respect to dimensional features. In addition to central part placement coordinates, maximal and minimal coordinates have also been included in the analysis (see Fig. 11). However, prediction of dimensional features (thickness, width, and length of the part) required improvement by applying more advanced techniques.

Therefore, in this paper, the authors describe a preliminary study of using four machine learning techniques to predict dimensional accuracy based on the collected data. The results of multi-layer perceptron neural network, decision tree regressor, gradient boosting regressor and support vector regressor compared with findings from the previous report, where solely linear regression models were used to make a prediction ( Baturynska 2018).

In order to be able to compare the results of machine learning techniques with linear regression models, data analyzed in this study is the same as in Baturynska (2018). This data was gathered from an EOS P395 polymer powder bed fusion system, with more details on practical experiment and data gathering are described in “Experimental work and data gathering” section.

This work addresses the following aims:

  • Investigate effect of part placement, part orientation and STL model properties on dimensional accuracy by applying more advanced methods and compare them with results of the previous study.

  • Develop non-linear models (a result of machine learning techniques) for prediction of thickness, width and length for each part separately.

  • Compare the performance of non-linear models and linear regression models based on the prediction accuracy and define which one(s) could be used in the future.

  • Discuss how the predicted dimensional features can be used to compensate geometry deviations for every part separately instead of using scaling ration in x, y and z axes for the whole build.

  • Provide recommendations on how proposed models could be used in the future within the manufacturing industry.

Results of this study are also considered as the first step towards the development of an intelligent system for quality assurance in additive manufacturing. This system will be used as a decision support tool for designers and operators in manufacturing. The proposed models will be incorporated as separate modules, which would be executed in different orders based on the requirements.

Due to the high importance of mechanical properties in the end user products, improvements of dimensional features may contribute to the improvements in mechanical properties. How this may be executed is discussed in the “Recommendations” section.

Experimental work and data gathering

An EOS P395 polymer powder bed fusion system was used in the experiment performed to collect data. Two identical runs were executed in order to evaluate the repeatability of the results for the build layout presented in Fig. 1. By identical runs it is meant that a build layout, material and process parameters were the same for both runs (for details see Table 1). Polyamide 2200, also known as PA12, was used in both runs with virgin/aged powder ratio of 50/50 %. In order to be able to control material properties and keep them constant in both runs, polymer powder was self-aged, with more details presented in the previous study Baturynska 2018).

Fig. 1
figure 1

Build layout in Magics 20.0

Table 1 Material and process parameters used in experiment

The results presented by Rüsenberg et al. (2014) was used as the reference. Although placement and orientation of specimens were chosen to be different, the authors assumed that build layout should be designed similarly to real manufacturing conditions. Based on this assumption, the maximum number of parts is chosen to be the main criterion for design of the build layout. It means that the parts are placed as close to each other as possible, and the minimum distance between the specimens is set to 5 mm based on the recommendations from Magics 20.0 software. Additional attention was paid to the specimens placed in the same orientation for verification and validation of the results. In other words, more than five specimens in the same orientation were placed as close to each other as possible for better control of potential coordinate variations.

In total, 358 specimens were produced in one run (or 716 specimens for the two runs combined). However, in this paper, data were analyzed from 217 (or 434 in total) specimens of type ISO 527-2 1BA for mechanical testing. Since the first attempt to predict dimensional features with the help of statistical methods were performed based on the data from Baturynska (2018), the same data is used in this work in order to be able to compare the results of linear regression modeling with the machine learning techniques.

The schematic represenation of software and hardware components is depicted in Fig. 2. This representation shows the main steps and attributes the authors performed for development of the predictive models.

Fig. 2
figure 2

The schematic representation of the process from build layout design to predicted models

Description of specimens’ orientation

All investigated parts were placed in four different orientations (see Fig. 3), and the names of the orientations were defined according to the ISO/ASTM 52921:2013(E) (2013) standard:

  • Group 1 XYZ (XY on Fig. 3 )-oriented parts

  • Group 2 XZY (XZ on Fig. 3)-oriented parts

  • Group 3 ZYX (Z on Fig. 3)-oriented parts

  • Group 4 Angle-oriented parts

By the Angle-oriented parts, the authors mean parts oriented at \(45^{\circ }\) between X and Z axes.

Since the design of the experiment defined the requirement to fit as many specimens as possible, the number of specimens in each orientation differ. Thus, 65 parts (the word “parts” is used as a synonym) are placed in XY orientation, 24 parts in XZ orientation, 84 parts in Z orientation, and 44 in Angle orientation.

To identify parts and be able to connect the results of testing and measurements by part placement, every part has its label, which is placed on two sides of the part. This led to variations in the number of mesh triangles, surface and volume values for each part within the build layout (see Table 2). Therefore, it is critical to evaluate whether these variations can influence the quality of the parts with more advanced methods. In addition, it is important to mention that there is no variation in STL model properties between Run 1 and Run 2 due to the usage of the same build layout.

Table 2 Comparison of STL model data in XZY orientation and all specimens together including values of standard deviation (\(\sigma \))

Data gathering

The data is collected from two identical runs and is used to evaluate the dimensional accuracy of the produced specimens. Length value was measured using a Digital ABS Caliper CoolantProof IP67 with the accuracy of \(\pm \,0.02\) mm. Width and thickness were measured using a Digital Micrometer QuantuMike IP65 with the accuracy of \(\pm \, 1 \upmu \mathrm{{m}}\).

In addition, to minimize measurement error, the final value of each dimensional feature (see Fig. 3) was calculated as a mean of three repeated measurements.

Distributions of measured thickness, width and length are shown in Figs. 4, 5, 6 respectively, desired (nominal) values shown as a straight line. Kernel density estimation was used to estimate the density probability function for the illustrated dimensional features. In addition, measurements from Run 1 and Run 2 are presented separately to show the variations between runs.

Machine learning techniques: theoretical background

MLP using backpropagation

A feed-forward multi-layer perceptron using backpropagation is one of the machine learning techniques. This method can be applied for modeling of complex tasks, where more conventional mathematical modeling is difficult or unsuitable. A performance of MLP neural network can be described based on its operational unit, the perceptron. The perceptron takes a set of features as an input vector. Typically, it is represented as a vector \(\mathbf {x} \in \mathbb {R}^n\) where n is a number of features. A set of features should be preliminary collected describing an event that MLP algorithm is learning to approximate. However, an output vector \(y \in \mathbb {R}\) should also be provided beforehand. Thus, an algorithm will map the input values to output as a function \(f: \mathbb {R}^n \rightarrow \mathbb {R}\). The function f is evaluated based on the sum of weighted inputs and bias factor \(\sum _{i=1}^{n} x_i w_i +b\).

The most common MLP is a three-layer neural network that uses different layers for processing information sequentially. These layers are an input layer, a hidden layer and an output layer, which are schematically represented in Fig. 7. Each hidden unit approximates an input layer to the output layer using activation function:

$$\begin{aligned} h_j=f\left( \sum _{i=1}^{n} x_i w_{ji}+b_j\right) \end{aligned}$$
(1)

where \(h_j\) is the output of jth hidden unit, n is a number of inputs, \(w_{ji}\) is a weight (connection link) for ith neuron, and \(b_j\) is a bias.

The approximated output is calculated by using the output from Eq. 1 as an input:

$$\begin{aligned} \hat{y_k}=f\left( \sum _{j=1}^{N} h_j w_{kj}+b_k\right) \end{aligned}$$
(2)

where \(\hat{y_k}\) is an approximated value of the kth output unit, N is a number of neurons in a hidden layer, and \(b_k\) is a bias.

Fig. 3
figure 3

Schematic visualization of parts’ orientation and dimensional features (where t—thickness, w—width and L—length )

Fig. 4
figure 4

Distribution of measured thickness for run 1 and run 2 based on kernel density estimation (The nominal value is 2 mm)

Fig. 5
figure 5

Distribution of measured width for run 1 and run 2 based on kernel density estimation (The nominal value is 10 mm)

Fig. 6
figure 6

Distribution of measured length for run 1 and run 2 based on kernel density estimation (The nominal value is 75 mm)

Fig. 7
figure 7

Schematical representation of three-layer feed-forward backpropagation MLP

Optimization of weights needs to be performed until difference (e) between observed and approximated outcomes is minimized:

$$\begin{aligned} e = \underset{w_{ji},b_j, w_{kj}, b_k}{\arg \min } \left( \frac{1}{2}\sum _{k=1}^{m}(y_k-\hat{y_k})^2\right) \end{aligned}$$
(3)

where \(y_k\) refers to the observed outcome, \(\hat{y_k}\) is the approximated outcome, and m is a number of outcomes.

The collected dataset needs to be randomly divided into training and testing sets as 70/30 % respectively. A training of MLP neural network should be performed on training dataset, while testing should be done on a testing dataset.

Decision tree regressor

A decision tree is also one of the machine learning techniques. Typically, this method is used for classification tasks, but there is a possibility of applying it for a regression task. Opposite to using an artificial neural network as a black-box, a decision tree method is an open and easy to understand method.

For a given training vector \(\mathbf {x} \in \mathbb {R}^n\) (where n is a number of features) and a training label \(\mathbf {y} \in \mathbb {R}^l\) (\(i=1,2,\ldots l\) represents a number of labels) the regression tree algorithm recursively partions the features domain into smaller regions (separate classes). It is important to choose correct metrics for best data split and determining when a tree node should become a terminal.

Since in this work a decision tree algorithm is used for a regression task, then the target is a continuous value.Thus, for node m, which represents a region \(R_m\) with \(N_m\) observations, mean squared error (MSE) or mean absolute error (MAE) are possible regression criteria to minimize impurity function H() as for determining locations for future data splits. Minimization ofan error can be done by using mean values of the terminal nodes for MSE (Smola and Schölkopf 2004):

$$\begin{aligned} H(X_m)= \frac{1}{N_m}\sum _{i=1}^{N_m} (y_i -\tilde{y}_m)^2 \end{aligned}$$
(4)

and for MAE:

$$\begin{aligned} H(X_m)=\frac{1}{N_m}\sum _{i=1}^{N_m} |y_i -\tilde{y}_m| \end{aligned}$$
(5)

where \(X_m\) is training data in node m.

However, when it comes to analysis of the big amount of data, this method has issues with scalability, stability and robustness (Aluja-Banet and Nafria 2003; Kotsiantis 2013). Another issue that should be addressed is an increase of the complexity when large data samples are used. The total number of nodes, total number of leaves, tree depth and the number of attributes are metrics that can be controlled in order to minimize the complexity of decision tree (Kotsiantis 2013). Since these issues not always can be addressed, ensemble decision trees are used instead and are more robust.

Gradient boosting regressor

Gradient boosting regression machine learning method can be described as an ensemble of decision trees (see Fig. 8). Instead of building one tree, this method predicts the desired outcome based on the additive regression model that uses decision trees as a weak learner (Ye et al. 2009). Sequential fitting of a parameterized function (base learner) to current “pseudo”-residuals is done at each iteration by optimizing regression loss (e.g., least squares, absolute error) Friedman 2002). Friedman (2002) describes “pseudo” residuals as minimization of the gradient of a loss function with respect to values of the regression model at each training data point for the current step.

Fig. 8
figure 8

Schematical representation of gradient boosting regression in regards to algorithm iterations

Introduction of randomization in the process of training data set selection allows to improve accuracy and reduce the possibility of overfitting. This way of compiling a decision tree allows to minimize the errors at each next step, and therefore boosting regressor is considered as more reliable and robust method comparing to classic decision tree regressor.

Support vector regression

Support vector regression (SVR) is a type of Support Vector Machine techniques that tackle the regression tasks. This machine learning method is less sensitive to the dimensionality of the input and has greater ability to achieve lower generalization error of regression model (Drucker et al. 1997; Gunn et al. 1998). Gunn et al. (1998) explains that better generalization is due to minimization of upper bound on the expected risk, also called as structural risk minimization (SRM) principle, although optimization of error on the training data is typically used (Empirical Risk Minimization principle). The former principle is employed by support vector machines, while neural network algorithms apply the latter.

If to assume that input data is presented as a space of the input patterns, then the main goal in SVR is to find such function \(f(x) = \langle w, x \rangle + b\) that has the largest deviations from the observed outcome \(y_i\) for all training data and at the same time is as flat as possible (Smola and Schölkopf 2004). By flatness is meant determining the smallest weight w (Smola and Schölkopf 2004):

$$\begin{aligned} minimize \quad \frac{1}{2} \Vert w\Vert ^2 \end{aligned}$$
(6)

where \(w \in \chi \) and \(b \in \mathbb {R}\).

In order to map inputs into high-dimensional feature spaces, different kernel functions (e.g., linear, polynomial, radial basis function or sigmoid) are used. In addition, tuning of algorithm parameters is a critical task for SVR performance, and therefore, one should pay attention to the choice of a subset of training data and parameters defined in kernel functions.

Model’s evaluation with 5-fold cross-validation

Typically, the five-fold cross-validation (CV) is a process when all data is randomly split into k folds, in our case \(k=5\), and then the model is trained on the \(k-1\) folds, while one fold is left to test a model (an example is illustrated on Fig. 9). This procedure is repeated k times. However, in this work, all data first is split into training and testing datasets, and a training dataset is used for cross-validation. The repeated cross-validation technique is used for the estimation of models’ accuracy and 95% confidence intervals (CI) (Vanwinckelen and Blockeel 2012).

The 5-fold cross-validation is repeated for each model 50 times. An average of all repetitions is used as CV accuracy, and 95% confidence intervals are calculated based on the results of the repeated cross-validation. The final evaluation of the model performance is conducted by looking at whether testing accuracy is in the range of 95% CI. If testing accuracy is in the 95% CI, the model is considered as acceptable, if testing accuracy is outside of the range and difference is significant, the underfitting or overfitting is considered to be present. The testing data is an isolated dataset that is not used in the cross-validation procedure.

Fig. 9
figure 9

Description of 5-fold cross-validation

Architecture of used machine learning techniques

The development of machine learning models is conducted in several steps. First of all, data preprocessing is performed in two stages: (i) cleaning the collected data and (ii) normalization of investigated features, which are described in “Description of investigated parameters” section. More details about data preprocessing are described in the following section, while the data analysis pipeline is illustrated in Fig. 10. The preprocessed data is split into training and testing datasets to evaluate the generalization ability of the model and to detect overfitting. If prediction accuracy (\(R^{2}\)—determination coefficient) obtained from the model’s training is significantly larger than the testing prediction accuracy, then overfitting is present. The model should be retrained with new hyperparameters. In addition, k-fold cross-validation is typically used to detect the overfitting. The resulting models’ architectures are described in “MLP using backpropagation”, “Decision tree regressor”, “Gradient boosting regressor”, “Support vector regression” sections.

Fig. 10
figure 10

Respresentation of data analysis pipeline

Data preprocessing

Data analysis always requires clean and normalized data beforehand. This step is especially important in a case when parameters’ values are different. The application of machine learning requires the normalization of features in the training data. In this study, an impact of 13 different parameters on three-dimensional features (thickness, width, and length) is investigated (see Table 3). For example, thickness has a value ca. 1.8–2.5 mm, while the value of the number of mesh triangles starts at ca. 1200 and increases up to ca. 7000. These ranges in parameters’ values have to be scaled to zero mean and unit variance.

Table 3 Investigated parameters

The work underlying this paper is based on SPSS statistics (Pearson correlation test) and Scikit-learn (Pedregosa et al. 2011). The authors performed data preprocessing for Scikit-learn applications. In the case of analyzing all orientations as one dataset, the original data is split into training (347 samples) and testing (87 samples) sets using train_test_split.

However, each orientation has different data points used for training and testing. Thus, for the XYZ orientation group, the training set consists of 104 samples and 26 samples in the testing set. For XZY orientation, 38 samples in the training set and ten samples in the testing set. For ZYX orientation 134 and 34 samples in training and testing sets respectively, while for Angle orientation, these numbers are lower, the training sample consists of 70 samples and 18 samples in the testing sample. Before training the models, the training data is scaled to zero mean and unit variance using StandardScaler.

The training and testing of models were performed with the help of Scikit-learn in the conda environment on macOS.

Description of investigated parameters

In order to evaluate the performance of proposed prediction models, there is a need for describing parameters that are used to predict thickness, width, and length. All parameters that are listed in Table 3 can be clustered into two groups. The first group corresponds to STL model properties (number of mesh triangles and mesh points, surface, and volume), while the second group describes part placement in the build chamber with respect to build chamber global coordinate system (world coordinate system—WCS).

Since Magics 20.0 software provides information about part placement in terms of central, minimal, and maximal coordinates (see Fig. 11), it is important to define what these coordinates mean. Minimal coordinate corresponds to a point on the part that is placed closest to the origin of WCS of the build chamber, while maximal coordinate describes the position on the part that is farthest from the origin of WCS.

Fig. 11
figure 11

Example of part placement description in the build chamber through maximal, central and minimal coordinates for Angle and XZY orientation using Magics 20.0

Figure 11 illustrates how minimal and maximal coordinates are defined for a part that is placed in the build chamber in two different orientations. For the part in XZY orientation, the difference between maximal and minimal coordinates corresponds to its dimensional features. However, a distance between maximal and minimal coordinates for parts in Angle orientation will not correspond to the value of a dimensional feature. In other words, the authors show that part placement coordinates are used to describe the part placement in the build but not the dimensional features of parts.

MLP using backpropagation

The multilayer perceptron algorithm using backpropagation was used both on all datasets and orientation groups separately. Model parameter optimization was done by evaluating different combinations of hyperparameters of a model. A number of nodes in a hidden layer were varied from 2 to 27, ’relu’ and logistic activation functions were considered, and ’lbfgs’ (a weight optimizer from the family of quasi-Newton methods) was used as a solver for weight optimization.

In this work, the architecture of MLP models that outperformed other methods are the following: for thickness, the model consists of one hidden layer with a size of 11 nodes and relu activation function, and for length, the model consists of 17 nodes and logistic activation function. The 13 parameters used as input and one-dimensional feature as output (see Table 3).

Decision tree regressor

The architecture of the decision tree is very complex and differs based on the size of the input. For example, for the XYZ orientation group, a number of nodes is 111, while the decision tree in XZY orientation has 43 nodes, and this number was defined automatically by the algorithm. When the author set a limit, the performance of the algorithm was unsatisfactory with law prediction accuracy (close to 0), therefore allowing the algorithm to define a number of nodes and leaves based on the provided data led to improvements in algorithm performance.

It is also observed that for larger input, the decision tree consists of a larger number of nodes. Since the algorithm was tuned manually by the authors in this work, one of the future tasks will be to add optimization of decision trees by defining hyperparameters for robust and satisfactory performance. This task is complicated, and therefore, it is out of the scope for the current article.

Gradient boosting regressor

Gradient boosting regressor (GBR) has even more complicated architecture than decision tree regressor, and therefore a number of nodes and leaves will not provide enough information about the algorithm. However, initial parameters are critical for algorithm performance. Optimization of hyperparameters for GBR models has been conducted considering a different set of hyperparameters. A number of estimators was chosen from the following list [5, 8, 9, 10, 11, 14, 20, 25, 30, 50, 80, 100, 150, 200, 250, 300]. A learning rate was chosen from the following list [0.01, 0.001, 0.05, 0.1], and three loss functions were considered, namely ’ls’ (least squares), ’lad’ (least absolute deviation), and ’huber’ (combination of ’ls’ and ’lad’).

In this work, a number of iteration was set to 100 /150 /100 (thickness in XYZ/thickness in Angle/length in ZYX orientations, respectively). The maximum depth is chosen to be 3, and the minimal samples split selected to be 2. The learning rate is chosen as 0.05. The loss function is set to ’ls’ for thickness in the XYZ orientation model, and the ’lad’ loss function was chosen for thickness in Angle orientation and length in ZYX orientation models.

Support vector regression

The main parameters, which are used to define support vector regression algorithm, are the type of kernel (radial basis function kernel is used in this work) and type of kernel cash size (used a default value of 200 MB due to RAM limitations). Besides, typically, two kernel-related coefficients should be optimized while training a support vector machine. The parameter c is responsible for trading off misclassifications, and in this work is set to its highest value 1.0. The parameter gamma controls how much influence each training sample has, and it is auto-defined by the algorithm.

Significance of parameters with regards to dimensional features

Two techniques are used in this work in order to estimate the significance of parameters. The first one is the Pearson correlation test, which is used for linear models. The second technique is a feature importance property incorporated into earlier described machine learning algorithms. Since gradient boost regressor is compared with the Pearson correlation test results, it is important to describe in more detail how feature importance in gradient boost regressor works.

As was described earlier, the GBR is an ensemble of decision trees. Feature importance is derived from the evaluation of how each parameter contributes to predicting the response. The feature importance is calculated separately for each parameter. The evaluation consists of two main stages; (1) evaluation of which parameters provide maximal prediction improvements for each node, and (2) averaging over the sum of nodes where one parameter has contributed the most overall trees in the machine learning model (Hastie et al. 2009). The parameter with the highest score is assigned to 100 % relative importance, and then the relative importance of other parameters is scaled accordingly.

Orientation-based significance of parameters

Distribution of specimens in the build chamber

Since it is already well-known from the previous studies (Caulfield et al. 2007; Dingal et al. 2008; Hur et al. 2001; Lee et al. 2014; Senthilkumaran et al. 2009a) that orientation of specimens has a significant impact on the part quality, a more detailed description of how specimens are distributed in the build chamber is an important step in the analysis of the results. In this study, four different orientation groups have been introduced in the “Experimental work and data gathering” section, which are XYZ-orientation group shown in Fig. 12; XZY-orientation group illustrated in Fig. 13; ZYX-orientation group shown in Fig. 14; and Angle-orientation group presented in Fig. 15.

The distribution of the specimens in the build chamber has a different concentration for each orientation group. As can be seen from Figs. 12, 13, 14 and 15, specimens from XYZ- and ZYX-orientation groups are positioned mainly in the center of the build chamber, with some on the sides. However, specimens from XZY- and Angle-orientation groups are mostly placed close to the sides of the build chamber.

The main benefit of positioning the specimens in such a way is due to the possibility of fitting in a larger number of specimens, and thus reducing their cost and gaining more information about different regions in the build chamber. However, this uneven distribution of the specimens can influence dimensional accuracy for each specimen and the whole build in general. In the regions where samples are more concentrated, cooling time will be longer than for areas where specimens are spread with a larger distance from each other. Thus, different temperature distribution and cooling time for different groups of specimens can lead to different shrinkage and expansion effects (more details are presented in Baturynska 2018).

In order to compare which parameters are significant for minimization of geometry variations for each specimen within one build layout, collected data is analyzed based on the orientation groups and without division for orientations groups (when all the orientations groups form a combined dataset).

In the following analysis of the results, the authors use abbreviations XYZ, XZY, ZYX, and Angle for describing the orientation groups. The axes of the coordinate system will be denoted as x, y, and z axes. When minimal, maximal, and central coordinates have the same meaning, the term “all x, y and z coordinates” will be used as a synonym. At the same time, min_coordinate, max_coordinate, and cent_coordinate is a shorter name for minimal, maximal, and central coordinates, respectively.

The orientation-based description of the significance of investigated parameters is graphically illustrated only for those models that have achieved prediction accuracy higher than 50%.

Fig. 12
figure 12

Representation of specimens’ placement in the build chamber in XYZ orientation for one run (Magics 20.0)

Fig. 13
figure 13

Schematic representation of specimens’ placement in the build chamber in XZY orientation for one run (Magics 20.0)

Fig. 14
figure 14

Representation of specimens’ placement in the build chamber in ZYX orientation for one run (Magics 20.0)

Fig. 15
figure 15

Representation of specimens’ placement in the build chamber in Angle orientation for one run (Magics 20.0)

Width

Dimensional features are dependent on both orientation and position in the build chamber. However, from the previous study, the results from a Pearson correlation test showed that in addition to the part positioning, the STL model properties are also significant parameters. However, linear regression models developed based on the Pearson correlation test results achieved low prediction accuracy. Thus the correlation between the investigated parameters and the dimensional features is not entirely reliable. In order to better understand how to control and minimize geometry variation based on the build layout design, more advanced methods are applied in this work.

Since the prediction accuracy of width dimensional feature in ZYX and Angle orientations are below 50% for both linear and machine learning methods, the significance of parameters for these orientations with regards to width is not presented. The low prediction accuracy means that models are not reliable, and thus, the obtained feature importance for those models are not reliable as well.

However, a prediction of the width in XYZ and XZY orientations is more reliable due to higher prediction accuracy. For example, the Pearson correlation test results (see Fig. 16a) pointed out that all coordinates in the y axis are significant to the same level, and are the most significant parameters. At the same time, the Gradient boosting regressor highlighted the importance of y coordinates (see Fig. 16b), but in a different way. The minimal coordinate y is shown as the most significant one and is followed by central and maximal coordinates y. The minimal coordinate y corresponds to the left side of the specimen, which is positioned closer to the sides in the build chamber. Therefore a cooling process for this region is faster than for other specimens. This could be a reason why the machine learning method has highlighted this coordinate over central and maximal coordinates in the y axis. However, to evaluate this assumption, an additional experimental work, where specimens are positioned differently, is required.

The reason why all y coordinates in XYZ orientation have been chosen as the most important ones can be explained by looking at the similarities between coordinates and dimensional features. In other words, for XYZ orientation, the distance between y coordinates can also be seen as a description of the width dimensional feature (see Fig. 3). At the same time, the distance between maximal and minimal coordinates define regions where energy is applied to each specimen. The concentration of the energy on different sides of the specimen will influence the cooling process and thus can lead to geometry variations.

Similarly, the width can be described as a difference between z coordinates for XZY-orientation group. The significance of parameters based on the Pearson correlation test depicted in Fig. 17a are easier to understand and describe, especially by following the same principle as used for the XYZ-orientation group. Thus, z coordinates define the width dimensional feature as a difference between minimal and maximal z coordinates (see Fig. 3). However, a Gradient boosting regressor could lead to new knowledge about the process. For example, the importance of the maximal coordinate y and minimal coordinate x could be explained by looking at the hatching line distribution. In order to elaborate on such an assumption, more experimental work needs to be done in the future with a focus on hatch lines distribution.

In addition to all z coordinates in XZY orientation, the number of mesh triangles has been chosen as a significant parameter. For example, Hu (2017), Adnan et al. (2018) reported that such STL model properties as surface, volume, and the number of mesh triangles are important parameters for the slicing process. Thus they influence the way how energy is applied to the material and how the object is solidified. The authors assume that the slicing process and energy distribution have an impact on the geometry deviations, and STL model properties, in combination with coordinates, provides an additional description of these phenomena without prior knowledge about the scanning strategy used in the AM process.

Fig. 16
figure 16

Significance of parameters for width in XYZ orientation: a Pearson correlation test results, b Gradient boosting regression results

Fig. 17
figure 17

Significance of parameters for width in XZY orientation: a Pearson correlation test results, b Gradient boosting regression results

Length

Similarly to the width dimensional feature, the significance of parameters for length is done for the orientations that have prediction accuracy higher than 50%. Therefore, ZYX- and Angle-orientation groups are analyzed for the length dimensional feature.

As can be seen from Fig. 18, both Pearson correlation test and Gradient boosting regressor point out to the z coordinates as the most significant parameters. While minimal, maximal, and central z coordinates are important to the same extent according to the Pearson correlation test, Gradient boosting regressor highlights central coordinate z as the most important. The maximal coordinate z and minimal coordinate z still are significantly important with a small difference (ca. 5–10%) between them, and therefore, this difference can be neglected. Moreover, the prediction accuracy is 91.8 % and 92.25% for linear regression (model based on the Pearson correlation test results) and Gradient boosting regressor, and this means that there is more than one model, which can be used to predict length dimensional feature. Besides, the order of other parameters’ significance could also be neglected.

While all z coordinates could be considered as parameters that define layer distribution within a specimen and, therefore, may influence the length dimensional feature the most. All other parameters also have a connection with the slicing process and energy distribution similar to the above-described principles for width.

However, the results of the Pearson correlation test and Decision Tree regression for the Angle-orientation group are different and illustrated in Fig. 19a, b respectively. While all z coordinates are the most important parameters (according to the Pearson correlation test), the central coordinate x is the most significant in regards to the Gradient boosting regressor. This difference could be caused by different principles related to both x and z axes, which are a distribution of the hatch lines and slicing (along the x axis) of the specimens into layers (along the z axis). Since the number of specimens is low, and they are concentrated in the one area in the build chamber, more experimental work needs to be performed in the future for a better understanding of which parameters should be considered during the build layout design. The observations regarding STL model properties are similar and also require more experimental work.

Fig. 18
figure 18

Significance of parameters for length in ZYX orientation: a Pearson correlation test results, b Gradient boosting regression results

Fig. 19
figure 19

Significance of parameters for length in Angle orientation: a Pearson correlation test results, b Decision Tree regression results

Thickness

The orientation-based description of the importance of investigated parameters is similar for each dimensional feature. The main reason lies in the physical principles of an AM process. Similarly to the width, thickness dimensional feature in XYZ- and XZY-orientation groups is related to z coordinates (XYZ-orientation—Fig. 20a) and y coordinates (XZY-orientation—Fig. 21a), respectively. Each of them can define the dimensional feature as a difference between minimal and maximal coordinate in the corresponding axis.

The importance of y coordinates for thickness in ZYX orientation (see Fig. 22a) is due to the same reason as for XYZ- and XZY-orientation groups. However, the Gradient boosting regressor highlights the number of mesh triangles (mesh points is another way of describing mesh triangles) and volume STL model properties over other parameters. This can be related to the importance of contours, and thus also associated with the definition of the energy deposition boundaries for each specimen. Besides, it is important to pay attention to the prediction accuracy of models. The prediction accuracy for the linear regression model is lower than 0, while prediction accuracy for Gradient boosting regressor is 55.82 %, and it is also relatively small value. Therefore, more experimental work needs are required to achieve more reliable results.

Explaining the importance of parameters for thickness in the Angle-orientation group is a more complicated task than for other orientations. This is caused by the reason that dimensional features cannot be explained as a difference between the minimal and maximal coordinates. Moreover, the energy deposition area at each layer is much smaller for this orientation than for others. Therefore, both x and y coordinates are important almost at the same level according to a Pearson correlation test (Fig. 23a) and Gradient boosting regressor (Fig. 23b).

Even though STL model parameters are less important compared with previously described results, the authors assume that for Angle-orientation positioning of the sample in terms of x and y coordinate is the most sensitive to the hatch line distribution, which is followed by the importance of layer distributions (z coordinates).

Fig. 20
figure 20

Significance of parameters for thickness in XYZ orientation: a Pearson correlation test, b Gradient boosting regression

Fig. 21
figure 21

Significance of parameters for thickness in ZYX orientation: a Pearson correlation test results, b Decision Tree regression results

Fig. 22
figure 22

Significance of parameters for thickness in ZYX orientation: a Pearson correlation test results, b Gradient boosting regression results

Fig. 23
figure 23

Significance of parameters for thickness in Angle orientation: a Pearson correlation test results, b Gradient boosting regression results

Significance of parameters without division for orientations

A comparison of methods used to evaluate which parameters have an impact on dimensional features with regards to the orientation groups leads to the decreasing performance of proposed models due to a limited number of data. Thus, joining all orientations into one dataset gives a possibility to improve model performance. Besides, machine learning algorithms can find a correlation between dimensions and orientation groups by themselves. The illustrated values of prediction accuracies for different ML methods can be seen in Table 4, and for all dimensions, gradient boost regressor outperformed both linear regression and decision tree regressor. Therefore, the level of significance of parameters proposed by the latter method can be used in the future by designers and additive manufacturing machine operators.

Width

Figure 24b shows that for width dimensional feature all parameters are significant to a specific extent and this result is also observed in Pearson correlation test (see Fig. 24a). However, based on the prediction accuracy of the regression model and gradient boost regressor, predictions of the latter one is to be considered as more accurate. According to the results of Gradient boost regressor, maximal coordinate x is the most important parameter for prediction of width. The next in the list are volume, minimal coordinates x and y, and surface parameter, which are followed by central and maximal y coordinates. The next important parameters are the number of mesh triangles, maximal coordinate z, and central coordinates x and z.

Fig. 24
figure 24

Predicted siginificance of the parameters on width: a Pearson correlation test results, b Gradient boost regressor

Length

Similarly to the width dimensional feature, the gradient boost regressor outperformed the regression model (see Fig. 25a), which is based on the results of Pearson correlation test, in regards to prediction accuracy.

According to the Gradient boost regressor, predictions on parameters’ significance for length and thickness have a different character compared with results for width. While all parameters are significant for width, a number of parameters are reported to be significant to the same extent for both length and thickness. Thus, the length is dependent on the maximal coordinate z, minimal coordinates x and z, volume, and surface STL model properties. The significance level is defined by the listed order meaning the first in the list has a relative importance value of 100%, and the last one has this value of 20 %. The significance level for other parameters for length is shown in Fig. 25b.

Fig. 25
figure 25

Predicted siginificance of the parameters on length: a Pearson correlation test results, b Gradient boost regressor

Thickness

Even though the significance of parameters for thickness is similar for the regression model and gradient boost regressor (see Fig. 26), the latter one has a higher prediction accuracy value. Therefore, predictions of this method are considered more accurate.

Gradient boost regressor describes that for the chosen model, minimal coordinate x is 100% important, and it is followed by minimal coordinate z and maximal coordinate x. These parameters have a relative importance of ca. 62% and 53%, respectively. Then it is important to consider surface and volume parameters, which are followed by maximal and central coordinates z. All other parameters have relative importance less than 20%, but can be seen in Fig. 26b.

These results can be described that in this build layout placement in x and z axes should be defined first, and STL model properties such as surface and volume should be optimized at the design stage. These changes may help to control variations. Still, the authors assume that using machine learning techniques to predict dimensional features before build will help to decrease variation since it will be possible to optimize part placement and part orientation.

Fig. 26
figure 26

Predicted siginificance of the parameters on thickness: a Pearson correlation test results, b Gradient boost regressor

Comparison of the predictive models for each dimensional feature separately

A comparison of the predictive models for width, thickness, and length is conducted at two levels: (i) orientation-based analysis, and (ii) joint data analysis (without separation on the orientations). The testing accuracies in terms of the determination coefficient calculated for the testing dataset are presented for all proposed models and are shown in Table 4.

Table 4 Evaluation of prediction (testing) accuracy of methods: MLP (BP) stands for MultiLayer Perceptron using backpropagation, DTR is decision tree regressor, GBR—gradient boosting regressor and SPR—support vector regressor

As can be seen from Table 4, performance of predictive models for orientation-based modeling depends on both dimensional features and orientation groups. While it is common knowledge that machine learning techniques require a large number of data points, the correlation between the chosen features and predicted outcome is also an important factor. For instance, prediction of thickness in XZY orientation, despite the small number of data points, has high prediction accuracy, while predictive models for width and length in XZY orientation are not satisfactory for any used method. On the one hand, a small number of data points could be one of the reasons for this observation. On the other hand, the thickness prediction, even with this number of data points has a high determination coefficient. Since for a small number of data points, there is a higher risk of getting overfitting issues, a more detailed overview of the results needs to be done.

Therefore, the cross-validation prediction accuracies are compared with testing prediction accuracies for the models with the prediction testing accuracy higher than 0.6 (60%). Besides, root mean square error is used as a supportive metric for the comparison of the model’s performance. Cross-validation accuracies are used to avoid overfitting issues and evaluate the generalization abilities of a model.

A comparison of the linear regression models with machine learning models is described for width, thickness, and length in the corresponding sections below.

Prediction of width dimensional feature

The performance of predictive models for width is unsatisfactory for most of the orientation groups for all methods. One of the reasons could be due to the presence of noise in the data, and due to a small number of data points in each orientation group. Even when a large dataset is available, typically, defining a clear signal (pattern) in the data is a hard task for any model. Therefore, small datasets available for modeling affect the models’ performance. Besides, a division of the collected data into orientation groups eliminates the information about orientation as an important factor (Caulfield et al. 2007; Senthilkumaran et al. 2009a), and this leads to unsatisfactory models’ performance except for the cases when other parameters have a strong correlation with the width. While all methods show almost random performance, only the GBR model has testing prediction accuracy relatively high (0.6746 from Table 4). However, when comparing the cross-validation results with testing prediction accuracy for GBR in XZY orientation, one can see from Table 5 that the proposed model has testing accuracy outside the confidence intervals. Even though the testing accuracy is relatively high, this model should not be used in the future due to insufficient generalization ability.

When all orientation groups are joint into one dataset, the performance of the predictive models for width changes drastically. This change could be connected to the earlier statement about the importance of the orientation.

As can be seen from Table 4, MLP, GBR, and linear regression models have the best performance among all investigated methods. Due to the nature of the chosen ML methods, one machine learning method works better than other ones depending on the tasks. For instance, the decision tree method typically works good for the classification tasks, while an assembly of decision trees, like GBR, works better for the regression task. Therefore, a comparison of the predictive models is conducted only for the methods with the best performance and is shown in Table 5.

Table 5 Comparison of the predictive models for width

The developed linear regression model is compared to the MLP and SVR models. The testing accuracy is out of the confidence range for each model and is lower than average CV accuracy, meaning that overfitting is present. Tuning of the hyperparameters haven’t help to avoid this issue. However, the difference between CV and testing accuracies for the regression model is small, and thus this model can be considered as acceptable.

In the future, all models need to be improved since the random sampling of training and testing data affect the models’ performance. Even though 347 data points are used for training the models, this is still a relatively small dataset. Therefore, predictive models for width should be further improved by taking into account more information about the material and AM process. More experimental work is required for increasing the size of the dataset.

Prediction of thickness dimensional feature

The predictive models for thickness in different orientation groups have a better performance comparing with the results obtained for width. Table 4 shows that both linear and machine learning models show relatively good performance even for the XZY orientation, which has the smallest dataset among all orientation groups. These results show us that there are a strong linear correlation between investigated parameters and thickness, which is in line with the results presented in “Thickness” section. However, models’ performance for ZYX orientation differs from other orientations. While GBR and MLP models have prediction accuracies 55.82% and 61.08%, respectively, linear regression has accuracy lower than 0. Thus, one can assume that investigated parameters have a non-linear correlation with thickness.

For thickness in the XYZ orientation group, the GBR model has significantly larger testing accuracy, and therefore more detailed analysis of this model is shown in Table 6. The testing accuracy is smaller than the average of cross-validation accuracy and is outside of 95% confidence level. A similar observation was made for width, and due to the small dataset used for training a model, and random sampling of the testing dataset could have affected the model’s performance. However, the difference is small and could be neglected, and thus meaning that the GBR model can be considered as acceptable.

Table 6 Comparison of the predictive models for thickness

For thickness in XZY orientation, linear regression and MLP models have the highest prediction accuracy. However, a more detailed analysis shows that linear regression has an overfitting issue, while the MLP model can be considered as acceptable since its testing accuracy lies in the 95% CI for this model.

For thickness in ZYX orientation, MLP and GBR models are compared by looking at the cross-validation accuracy, 95% CI, and testing accuracy. As can be seen from Table 6, the testing accuracy differs from other metrics significantly for both models. Tuning of the hyperparameters hasn’t helped to avoid this issue, and therefore, these models require further improvements and a larger dataset.

For thickness in Angle orientation, linear regression, and GBR models are compared, and results are shown in Table 6. While the LR model has significantly different performance for training and testing datasets, the GBR model shows high prediction accuracy 85.2% and is similar for both training and testing datasets. Therefore, the latter model can be considered as acceptable, and strong correlations have been determined between investigated features and thickness dimensional feature.

When it comes to predicting thickness by using a joint dataset (all orientation groups are used as one dataset), one can see from Table 4 that almost all methods have high prediction accuracy for testing dataset. LR, MLP, and GBR are further evaluated due to the high testing accuracies, and their comparison is presented in Table 6. As a result, only the MLP model has prediction accuracy in 95% CI range, and therefore it is considered as an acceptable model. However, the GBR model has a very small difference between CV and testing accuracies, and thus, can also be regarded as acceptable.

Since there are strong correlations between investigated parameters and thickness, merging data from different orientation groups have provided new patterns in the data, which resulted in the higher prediction accuracies.

Prediction of length dimensional feature

In contrast with the predictive models for thickness, the predictive models for length in ZYX have the highest prediction accuracies among all orientation groups (see Table 4). In the section about the significance of investigated parameters, it was highlighted that length in ZYX orientation has strong linear correlations with coordinate z, the prediction accuracy obtained for predictive models in ZYX orientation supports this observation. Similar observations for the relationship between length and investigated parameters were made for the Angle orientation group, which also results in relatively high prediction accuracies on the testing dataset. However, since machine learning techniques have better performance than linear regression, one can assume a presence of non-linear correlations as well. The predictive models for length in XYZ and XZY show bad performance, which means that the correlation between part position, STL models’ parameters, and length is weaker than for the other two orientation groups.

Table 7 Comparison of the predictive models for length

A more detailed analysis of the models’ performance is shown in Table 7. For instance, all models in ZYX orientation have high prediction accuracies, but all of them are outside the 95% CI range. However, the MLP model has a small difference between prediction accuracies for training and testing datasets, which can be neglected. While the linear regression model, along with models in Angle orientation, has larger prediction accuracy for testing dataset than for training dataset. The reasons are similar, as reported earlier, a small dataset affects random sampling of training and testing datasets.

A similar observation can be made for the predictive models when all orientations are analyzed as one dataset. Even though the MLP and SVR show better performance than the linear regression model (see Table 7), Table 7 shows that both machine learning models have their testing accuracies outside of the model’s confidence intervals. However, for the MLP model, this difference is smaller, and the root mean square error (RMSE) is also the smallest one among the evaluated models. Therefore, this difference can be neglected, and the MLP model can be considered as acceptable.

Recommendations

The primary assumption that was made by authors at the beginning of this work is that one single method will be the best for predicting dimensional features both concerning orientations and when orientations are combined in one dataset. However, analysis has shown that for different tasks, different methods should be used, and a choice should be made based on the user needs and requirements.

Even though this is a preliminary study and the proposed models need to be optimized and improved on a larger dataset, the future perspectives on how the final models could be used are suggested below.

Case 1 Dimensional accuracy is the main requirement, and mechanical properties can be neglected - for use in real manufacturing. Results presented in this work can be already used in the manufacturing for applications where dimensional accuracy is the main requirement. By predicting dimensional features beforehand, the application of the calculated scaling ratio at the design stage will help to adjust dimensions for each separate part with respect to its placement in the build chamber, orientation, and STL model properties.

However, there two major limitations that need to be addressed in future work. The first one is a design complexity. The proposed models can be used for the parts with a simple and similar design to the one used to train the models. The second limitation is a material choice. Since developed models do not include information about used material, these models now can be used just for Polyamide 2200 with a 50/50 ratio of virgin/used powder.

Case 2 Prediction of mechanical properties based on the predicted dimensional features’ values for PA12. Typically, in addition to dimensions, mechanical properties are of interest in manufacturing. The material used in this study is plastic with anisotropic properties, which makes it challenging to develop mathematical material models. Along with that, lack of information needed to build a material model does not allow performing finite element modeling (FEM), which is one of the most widely used methods to simulate mechanical properties beforehand.

In order to address this issue, the author proposes to apply machine learning techniques to predict the mechanical properties of a part before it is fabricated. This prediction will be based on the data collected in advance, including mechanical testing results. Besides, the predicted values of dimensional features, together with part’s placement and orientation in the build chamber, will be used to develop new models, and material properties should also be included since they are one of the critical components of the future models. Additionally, the complexity of the design needs to be improved and be more sophisticated in the future.

Case 3 Development of an intelligent system for quality assurance in additive manufacturing. Even though the proposed models can already be used in the way they are now, additional knowledge of Python programming language is needed for the user to be able to make requests. Therefore, the author considers the results presented in this article as the first step towards the development of an intelligent system for quality assurance in additive manufacturing.

This system will consist of different modules, which will be executed in different orders to provide a solution to the user. A calculation core will be working behind a user-friendly interface.

However, more details of system design will be presented in future publications. Moreover, more experimental work should be done in the future to improve existing modules and create new ones. A particular focus should be set to the variation of different parameters (process and material), including the analysis of samples with a different level of design complexity.

Conclusions

A comparison of regression models with machine learning techniques has been described in this paper. The main aim was to develop models that could predict dimensional features, namely thickness, width, and length, for additive manufacturing with high accuracy. Besides, for a better understanding of the process, investigation of parameters’ significance was performed based on the Pearson correlation test, decision tree regressor, and gradient boost regressor. The 13 parameters were analyzed with respect to the data subsets partitioned against each orientation, as well as for the combined dataset.

For the models with the highest prediction accuracy, all investigated parameters were defined as significant. Moreover, STL model properties were of the major interest as they haven’t been studied in the same context by other researchers except for the previous work by the authors (Baturynska 2018). Most of the applied methods have defined either the surface or the number of mesh triangles as one of the most important parameters with respect to dimensional features. This information can be used during the design stage in the future.

Along with that, the predictive models for width, thickness, and length have been developed. The linear regression model for width was determined as the best among all investigated methods for the case when data is not separated into orientation groups. The three predictive models are acceptable for thickness, namely gradient boost regressor models in XYZ and Angle orientations, and the MLP model when data is not divided into orientation groups. The MLP model has also outperformed other methods for length, and gradient boost regressor was found to be the best for length in the ZYX orientation group. All other models have unsatisfactory performance and require further developments.

In order to continue improving developed models and creating new ones, more experimental work should be done in the future. A particular focus should be set to varying parts’ design, and different processes, and material parameters. The authors have also proposed recommendations on how the improved models could be used in the future.