1 Introduction

The Material Extrusion (MEX) process, also known as Fused Layer Modeling or Fused Deposition Modelling (MEX-TRB/P), matured into a lucrative production alternative due to low machine hour rates, low and wide ranged printer prices as well as low infrastructural requirements. Due to the nature of additive manufacturing, process parameters–such as infill density, number of shells, and layer thickness–are more important compared to conventional manufacturing. They are selected prior to the printing process and have a significant impact on the print result. Since properties such as tensile strength do not depend solely on material properties, the quality of the finished part is often unknown. On the one hand, this leads to high filling densities to ensure the required strength, which increases material costs and printing time. On the other hand, this limits the applicability of the MEX process for stressed parts. With an accurate prediction, the strength of the part can be compared to the already estimated printing time and material cost, which is usually output in the slicer program. In this way, an optimal print job can be found based on quality, time and costs.

However, existing literature typically lacks data and test volume, lacks varied parameters, lacks a proper testing of the prediction accuracy, or achieves unsatisfactory prediction accuracy. Furthermore, the current literature mostly predicts solely trained parameter steps, which reduces the usability of the developed models. In addition, the required data volume and the impact on data reduction methods are unknown. Moreover, it is questionable whether neural networks can achieve better prediction accuracy than simpler methods such as multiple linear regression, as the literature often lacks a comparison.

This paper aims at answering the described open gaps of current literature by predicting the tensile strength in the state of the pre-process with a feed forward neural network based on freely selectable parameter values. This research give novel insights on how the data volume affects the prediction accuracy, how a new parameter should be introduced in an existing neural network approach and how the training data can be reduced in order to still achieve a still satisfying prediction accuracy. The prediction accuracy achieved on randomly selected parameters outperformed previously published models in the literature, even though they predicted known data steps. In addition, the results of the developed neural network are compared to a multiple linear regression approach.

At first the tensile strength is predicted using four variable parameters and a data set of 81 samples for training. Then, print speed is added as a new parameter to improve prediction accuracy and to investigate how to introduce a new parameter into existing data. Effects of the total sample size on the prediction accuracy are investigated using data reduction methods. Subsequently, the prediction of samples with parameter sets outside of the learned value range are observed. Concluding the achieved results are discussed and recommendations are given.

2 Predicting tensile strength in material extrusion: state of the art

The use of neural networks is common in the area of MEX for example to identify print errors [1]. Predictions of quantitative quality characteristics such as surface roughness [2,3,4,5,6] and dimensional accuracy [7,8,9,10] are performed by several researchers. Ali and Chowdary used neural networks to predict dynamic mechanical characteristics of MEX-fabricated parts, in detail the natural frequency [11]. Predictions of the compressive strength of MEX parts were performed by Panda et al. [12] and Sood et al. [13].

Besides neural networks a fuzzy logic approach was used by Trivedi and Gurrala to predict the tensile strength of FDM-fabricated parts [14]. Deshwal et al. used a neural network to optimize the tensile strength of polylactic acid parts (PLA) by varying the infill density, print speed and nozzle temperature. They found that the neural network approach had a better performance than other tested approaches [15]. This could also be stated by a research of Tura et al. [16]. Grozav et al. predict the tensile strength with a neural network varying nozzle temperature and print speed. They used in total 36 samples processed on two different MEX printers and two different materials–glycol-modified polyethylene terephthalate (PETG) and PLA–to train their network. They found that the size and variety of the available data were the most influencing and limiting factors of the used approach [17]. Bayraktar et al. predicted the tensile strength by observing 36 possible parameter combinations varying the nozzle temperature, layer thickness and raster orientation with a data volume of 108 samples. For nine selected samples within their parameter steps they achieved a MAPE between 3.34% [18]. Yadav et al. used a neural network to predict the tensile strength of multi material parts by stacking layers of acrylonitrile butadiene styrene (ABS) and PETG. With a data set of 30 samples they achieved a prediction accuracy between 2.5 and 2.6% for three chosen and trained parameter sets [19]. Tura et al. reached a MAPE of 2.21% on validation data for the tensile strength of PLA samples by varying infill density, extrusion temperature and print speed [16]. A prediction accuracy on test data was not stated.

In the presented literature the reachable accuracy was determined using training data and test only pre-defined parameter steps. This reduces the applicability of the developed neural networks significantly as they can solely guarantee the stated prediction accuracy for their defined parameter sets. In addition, several of the research papers have only validated their prediction accuracy on the training data used to develop the prediction model, thus lacking a proper test to prove their prediction accuracy. The available research papers also lack sample size, test data volume (if tested), and number of varied parameters. Additionally, information on the sample size required to predict tensile strength with sufficient accuracy is missing. This paper fills the mentioned research gaps and provides an approach to predict the tensile strength of random parameter sets with a similar accuracy.

3 Methods and approach

3.1 Observed parameters, value range and resulting data set

The tensile strength of MEX produced parts is mainly determined by the material, the Z-orientation and the selected process parameters [20]. This research focus on the latter and therefore keeps the orientation and material fixed.

The mechanical properties of MEX-manufactured parts is especially influenced by the nozzle temperature, the layer thickness [21] and the infill density [22]. The density of a part is affected by the parameters infill density representing the percentage filling level of the free space inside a part and the number of shells. Shells are defined as the walls of the print that are exposed to the outside of the part. In the following the number of outer perimeters, top and bottom layers are chosen with the same count and are called number of shells. The infill pattern gyroid was used for all samples.

Firstly, the infill density, nozzle temperature, layer thickness and number of shells are observed. It is expected that they have the strongest effect on the tensile strength. The limits of the value ranges are chosen in such a way that the effect of the parameters can be observed in their entirety, yet a prediction still seems possible (see Table 1). For each parameter the minimum, middle and maximum values are determined to fill the value range.

Table 1 Overview of the value range of each parameter

Combining all possible parameter combinations result in a data set of 81 (34) samples called M1. This is used to train and validate the neural network. Later M1 will be extended with three differing print speeds resulting in a data volume of 243 (35) samples (M2). Random parameter combinations which are outside the parameter steps and within the parameter limits are determined to test the prediction accuracy of the resulting neural network. This data set T has a volume of at least 10% of the total training data to test the prediction accuracy. As a loss function, the mean squared error was selected (see Eq. 1). To evaluate the performance of the model the mean absolute error is calculated using the predicted value \({p}_{i}\), the measured value \({x}_{i}\) and the number of samples \(n\) (see Eq. 2). The prediction accuracy is given as the mean absolute percentage error MAPE (see Eq. 3), the mean absolute error MAE and the root mean square error RMSE [23]. Additionally, the number of outliers is used to describe the prediction results. An outlier is detected when the MAPE is more than one and a half times the interquartile range below the first quartile or above the third quartile.

$$MSE=\frac1n\cdot\sum_{i=1}^n{(p_i-x_i)}^2$$
(1)
$$MAE=\frac1n\cdot\sum_{i=1}^n\left|p_i-x_i\right|$$
(2)
$$MAPE=\frac1n\cdot\sum_{i=1}^n\left|\frac{p_i-x_i}{x_i}\right|$$
(3)
$$RMSE=\sqrt{\frac1n\cdot\sum_{i=1}^n{(p_i-x_i)}^2}$$
(4)

3.2 Used neural network

A feed forward neural network consisting of an input layer, two hidden layers with built-in dropout and an output layer is used to predict the tensile strength, as shown in Fig. 1. Each variable parameter has an associated neuron in the input layer. Dropout is used to switch off neurons randomly in the learning process. It helps the neural network to prevent overfitting. In the output layer one neuron provides the predicted tensile strength value.

Fig. 1
figure 1

Exemplary structure of the used neural network approach

The learning process itself is shown in Fig. 2. First the correlation of the input parameters is performed using the Pearson correlation coefficient. In all observations no correlation between the input data was found. Therefore, the data sets could be used to train the neural network. The data set M is used for training and validation using a cross-validation approach dividing the data set randomly in four separate partitions. A hyperparameter tuning with a random grid search is used as pre-defined hyperparameters have a significant impact on the success of the learning phase. The varied hyperparameters are shown in Table 2. In the epochs selection phase epochs are varied iteratively from 1 up to 500. The best performing neural network is determined calculating the minimum average MAE of all four partitions achieved on the validation data. This neural network is then trained again and afterwards tested with the data set T.

Fig. 2
figure 2

Used learning process for the neural network

Table 2 Hyperparameters

3.3 Used multiple linear Regression

The neural network approach shown is compared with a multiple linear regression approach for predicting tensile strength. Linear regression offers simpler applicability and better understanding as the prediction is represented by a function. The function is given by Eq. 5, where \(P\) is the predicted tensile strength, \(b\) is the constant indicating the intersection with the ordinate, \({\beta }_{1}\) to \({\beta }_{5}\) are the regression coefficients and \({x}_{1}\) to \({x}_{5}\) are the set parameters [24].

$$P=b+{\upbeta }_{1} {x}_{1}+{\upbeta }_{2} {x}_{2}+{\upbeta }_{3} {x}_{3}+{\upbeta }_{4} {x}_{4}+{\upbeta }_{5} {x}_{5}$$
(5)

3.4 Sample, measurement and used equipment

The tensile strength was investigated according to the standards DIN EN ISO 527–1 and 3167. The flat sample of type A1 was used with a length of 150 mm visualized in Fig. 3. A horizontal orientation (XYZ-orientation) was used (see Fig. 4).

Fig. 3
figure 3

Tensile strength sample

Fig. 4
figure 4

Top view of build plate

For the measurement of the tensile strength an Inspekt 200 from Hegewald & Peschke Meß- und Prüftechnik GmbH was used with a load cell of 10 kN, a test speed of 3 mm/min, a break-off criterion of 75% and a safety criterion of 8 kN. The prints were produced with a Prusa i3 MK3S + from Prusa Research out of glycol-modified polyethylene terephthalate (Prusament PETG) from Prusa Polymers on a plain PEI-coated spring steel build platform.

4 Results and discussion

4.1 Effect of parameters on the tensile strength

The printed samples achieved a tensile strength between 16.41 N/mm2 and 46.04 N/mm2. The training data has a span of 29.63 N/mm2 and the test data of 19.56 N/mm2 (see Fig. 5). As expected, the obtained tensile strength of the test data was within the training data since the parameters were chosen randomly within the parameter limits of the training data. The differing parameter sets changed the break behavior of the sample. While some break instantly after reaching maximum stress (see (a) in Fig. 6) others had phases of a strong decrease in stress followed by a plateau and a phase with an almost linear stress–strain curve before breaking (see (b) Fig. 6). These samples showed delamination of the outer perimeter and infill during tensile testing, indicating that the process parameters influence this effect.

Fig. 5
figure 5

Tensile strength of (a) training data and (b) test data

Fig. 6
figure 6

Stress–strain diagram of (a) a cracked sample after maximum stress and (b) a cracked sample after a delamination phase

The relative standard deviation of samples with equal parameter sets was 0.63% tested with five additionally manufactured specimens. This indicates a repeatable data generation process.

The effect size of the varied parameters was examined using the mean value of each parameter value represented in a main effects plot (see Fig. 7). The slope of the resulting functions indicates the strength of the parameter influence. The sign of the slope indicates the direction of the optimization. By increasing the number of shells, infill density and layer thickness the mean value of the tensile strength was increased. The tensile strength seems to be particularly dependent on the number of shells, as the function shows the strongest slope. This indicates that the layers aligned with the direction of pull had the highest influence on tensile strength, even though the other layers were aligned with the direction in a gyroid shape. The infill density showed a slightly higher slope than the layer thickness. In contrast, nozzle temperature seemed to have a small influence on the tensile strength. This indicates that the nozzle temperature had less of an effect on layer adhesion than the other effects. Print speed had the highest mean value at the medium speed setting and had small deviations in the mean value. The medium speed mode could be an optimum or a local optimum, and therefore an optimization direction could not be identified. This could be caused by the different speeds within the speed mode depending on the nozzle location.

Fig. 7
figure 7

Effect of parameters on tensile strength

4.2 Predicting the tensile strength via a neural network

After performing the mentioned learning approach on M1 (see 3.2) a MAPE of 3.21% (MAE of 0.99 N/mm2) was achieved on the random test data T. The neural network achieved a RMSE of 1.32 N/mm2 and had 2 outliers (8% of test data T). The used hyperparameters of the best neural network are shown in Table 3.

Table 3 Used hyperparameters for the prediction based on four parameters

4.3 Resulting prediction accuracy and data volume by adding a parameter

In the following the parameter print speed is integrated as it was used by several research activities to optimize the tensile strength [25, 26]. As the used print speed highly depends on the print head location and print task, existing print speed modes quality and speed were used given by the machine associated slicer (PrusaSlicer). Additionally, a speed mode medium is created by calculating the mean value of both referred speeds (see Table 4). All samples of M1 used the quality speed mode.

Table 4 Used print speed modes

With an increased data set M2 (243 sample) a MAPE of 2.54% could be achieved (see test A in Table 5). Three outliers were identified. Test A resulted in the most powerful neural network found in this paper.

Table 5 Prediction accuracy in dependence of added data volume

The integration of the parameter print speed tripled the data set resulting in an increased effort in data generation. Therefore, M2 is reduced by the middle values to test the effect of a reduced added data volume (test B). With the resulting 162 samples the prediction accuracy reduced slightly (see Table 5). One outlier could be identified. Data sets with a layer thickness of 0.15 mm resulted in a significantly worse prediction than other unknown data sets in all observations. It seems that this parameter influence is difficult to predict with the used approach. In test A the effect is higher compared to test B resulting in a higher RMSE.

To extend existing models, it is recommended to first add the minimum and maximum values of the new parameters. The achieved prediction accuracy could already be in a satisfactory range as the observation show.

4.4 Parameter sets outside the learned value range

The following tests are performed with the most powerful neural network found with the total data set M2 (test A). The hyperparameters of the neural network remain unchanged and are given in Table 6.

Table 6 Hyperparameter of most powerful neural network found (test A)

The chosen data ranges were tighter than the original parameter ranges to guarantee a high prediction accuracy (see chapter 3.1). Therefore, five samples with randomly chosen parameters with at least one parameter outside of the value range are tested to observe the effect on the reachable accuracy (test C). Additionally, the minimum and maximum of the original value range is tested (test Min and Max). A minimal infill density of 5% was used since a 0% infill density was not printable due to long bridging resulting in fatal print errors.

The prediction accuracy decreased significantly for parameter sets outside the pre-defined value range (see Table 7). Likewise, the RMSE of test C (3.91 N/mm2) is higher compared to test A. Therefore, the needed value range should be known before data generation to choose a tight parameter range which covers the needed parameter values.

Table 7 Prediction accuracy of randomly chosen parameter sets

4.5 Effects of sample size on prediction accuracy

In the following, the training sample size is varied to investigate how the prediction accuracy degrades with a reduction of the training data volume. For this purpose, the achieved accuracy of the developed models is compared to the best model test A, which is based on the largest data set M2. This approach provides insight into how to reduce the data collection effort with little impact on prediction accuracy.

The sample size is reduced by eliminating the middle values of each parameter resulting in 32 parameter combinations (test D). In a second observation parameters with a seemingly high influence–layer thickness, number of shells and infill density–are represented with the minimum, middle and maximum value. The remaining parameters are trained with the middle values (test E). In a third approach the Taguchi method is used resulting in a data set of 27 samples (test F) [27]. To test the prediction accuracy data set T is used.

In all tests performed, the prediction accuracy decreased with a minimized data set (see Table 8). Test D achieved better prediction accuracies than E. This indicates that if a parameter is varied in the test data a representation by solely a middle value in the training data should be avoided even if they have a small influence on the predicted value. The Taguchi method achieved almost the prediction accuracy of test D by using less data. The RMSE of test D, E and F are higher compared to A. Test D and E had one outlier while test F had no outliers.

Table 8 Achieved prediction accuracy in dependence of used data volume and data generation approach

In our observations no clear preferred data reduction approach could be found. Should the data generation of test A exceed the affordable effort it is recommended to use the approach of test D.

4.6 Comparing the prediction accuracy with multiple linear regression method

The resulting prediction accuracy of the neural network approach performed best at a high data volume. Further the results are compared to the prediction accuracy of a multiple linear regression, as more simple prediction methods could achieve better prediction accuracies, especially at low data volume. Therefore, a multiple linear regression is used on the basis of the data sets A, D, E and F. The prediction accuracy is tested with the random data set T. Figure 8 shows the MAE, MAPE, RMSE, and outliers of the neural network and a multiple linear regression. The best multiple linear regression model achieved a MAPE of 4.82% using data set A. For all data reduction approaches the neural network outperformed the linear regression regarding MAE, MAPE and RMSE (see (a), (b) and (c) in Fig. 8). The regression resulted in less outliers in test A and D. A multiple linear regression achieved a MAPE (12.15%), MAE (1.41 N/mm2), RMSE (6.84 N/mm2) and one outlier for parameter sets outside of the learned parameter range, which are all higher than the achieved characteristics of the neural network approach.

Fig. 8
figure 8

Comparison of the neural network (triangles) and linear regression approach (circles) using (a) MAE, (b) MAPE, (c) RMSE and (d) outliers

The results show that the neural network approach is superior to multiple linear regression considering even a low training data volume.

4.7 Critical appraisal and limitations

The investigations relate to the parameters print speed, number of shells, layer thickness, nozzle temperature and infill density. Therefore, a prediction using the shown approach is only possible if these parameters influence the tensile strength. The used approach needs to be adapted for printers where other parameters play a predominant role.

The investigations are based on PETG material. Materials with a deviating printability, that cannot be processed repeatably by the printer, could worsen the prediction accuracy. The infill pattern was not varied in this paper. This should be considered as a further parameter if variation of the infill pattern is required. This would extend the neural network by one neuron in the input layer.

Tensile strength is area dependent. The ratio of the number of shells and the infill density influences the degree of infill. It is therefore questionable if the used prediction approach can be used for predictions of tensile samples with cross-sections of differing sizes, or if new training data set is required.

A comparison of the achieved prediction accuracies with the current literature is shown in Table 9. The results highlight the novelty of the achieved results of this work, as for the first time the prediction accuracy was tested for parameters that differed from the trained parameter steps and still outperformed the presented literature in case of a properly tested prediction accuracy. Additionally, Test A was trained by varying five process parameters, which exceeds the number of parameters in the literature and therefore give more freedom in parameter optimization. Higher achieved prediction accuracies in the literature were not properly tested as they use the accuracy of the validation, which is more accurate since it has already been used for training. Proper testing requires separation of training and test data. Validation accuracies are typically used only for hyperparameter selection and are not commonly used to report the achieved prediction accuracy of a model.

Table 9 Comparing the achieved prediction accuracy of this work (Test A and Test B) with prediction models of the current literature

5 Conclusion

In this paper, a neural network approach was used to predict the tensile strength of MEX-manufactured PETG parts based on process parameters. The effects of data volume on the prediction accuracy was investigated using different data reduction methods. A comparison with a multiple linear regression in dependence of the data volume was performed.

The achieved prediction accuracy (MAPE of 2.54%) on random test data within the parameter ranges exceeds published results even though they predicted solely known trained data. This indicates a high prediction accuracy of the developed neural network. With a lower sample size of 32 samples a MAPE of 4.15% could be achieved. Increasing the data volume reduces the prediction error (MAPE, MAE and RMSE). However, it has been demonstrated that an increase in data is not necessarily accompanied by a decrease in the number of outliers. In all performed investigations the neural network outperformed a multiple linear regression. Therefore, even at low data volume a neural network approach is recommended.

A secured prediction accuracy seems possible with the representation of minimum, medium and maximum values. However, it is recommended to firstly use a reduced data set with solely minimum and maximum values. A satisfying prediction accuracy could be already achieved with a significantly lower effort in data generation. It is suggested to use the minimum and maximum value to add new parameters to the neural network. Additionally, it is recommended to only vary parameters with a high influence on the observed quality characteristic and avoid varying parameters which are represented by solely one value in the training data set. The prediction accuracy of parameter sets outside the defined value range is clearly worsened. The parameter range should be known beforehand and should not be exceeded.

The used approach could be transferable to other part orientations e.g. the Z-orientation, enabling the prediction of the tensile strength for most parts in practice. Therefore, future work targets the application of the presented approach to other printers, materials and orientations. It is planned to investigate how the existing data can be used to further reduce the data volume for new applications by using transfer learning. In addition, it is planned to apply the approach to other quality characteristics such as dimensional accuracy and surface quality. This would allow the prediction of the most important quality characteristics of the MEX process. The presented approach could be extended to other additive processes, especially those in which strength plays a major role, e.g. laser beam melting (PBF-LB/M). For this, the input parameters have to be adapted to the respective additive process. A first test of a neural network approach could be performed using the minimum and maximum data reduction method and solely a few influential process parameters.