1 Introduction

3D printing, also known as additive layer manufacturing (ALM) or AM, is an automated manufacturing process that fabricates three-dimensional (3D) customized products by melting thermoplastic polymers/composites and depositing materials on a platform layer-by-layer (Ref 1). AM uses computer-aided design (CAD) or 3D object scanners to manufacture items with accurate geometric features (Ref 2). Unlike traditional manufacturing, which often requires milling or other operations to remove excess material, these are built layer by layer, similar to how 3D printing works (Ref 3). Spooled polymers (Feedstock filament) are used as an input material in the AM technology that is pulled or extruded by a heated nozzle with a gear mechanism according to printing products (Ref 4). For bonding layers, temperature control or chemical bonding agents are used to keep the layers together. Because of their numerous advantages over traditional methods, such as rapid production, custom products, reduced waste materials and labor costs, precision, and accuracy, AM technologies have been considered promising to play a significant role in designing and constructing the built environment (Ref 5). AM technologies can be utilized to build unusual structures that are not achievable with traditional construction methods and give quick housing solutions in emergencies (Ref 6). AM has been around for more than three decades, and progress in automation for building applications has been gradual. This is because AM techniques, in their current state, cannot be directly applied to large-scale construction projects (Ref 5). Today, AM is the technology upsetting production, while composites were the technology disturbing manufacturing a generation or two ago (Ref 7). Fiber-reinforced polymer composite materials, like additive materials, offer options for lightweight, moving from metal to polymer, and consolidating assembly (Ref 8).

Polymer-based composites have emerged as a more cost-effective and environmentally friendly option than traditional polymeric materials (Ref 9)). A new variety of materials with appropriate optical, electrical, magnetic, thermal, or mechanical properties can be created (Ref 10). The biodegradability and eco-friendliness of starch materials have sparked interest in their development in recent years (Ref 11). Furthermore, the biomaterial’s renewable origin, low cost and availability, and capacity to be processed as a thermoplastic polymer are all important elements to consider when selecting it for specific applications (Ref 12). Fiber-reinforced polymer composites have a wide range of applications (including automotive, construction, and others), but most commercially accessible materials are made of petroleum-based polymers reinforced with synthetic fibers (Ref 13). Nonetheless, there has been an increasing interest in replacing these polymers with renewable and bio-based alternatives because of environmental concerns. Natural composites, based on polypropylene (PP) resin and fibers such as flax, hemp, kenaf, and sisal, are currently used to make a variety of automobile components (Ref 14).

ABS is a most popular material for prototyping, conceptual design, and intangible model manufacturing, with a wide range of applications in the automobile industry and medical sub-divisions, such as surgery for a realistic model experience (Ref 15). ABS as a manufacturing material has had a huge positive impact in the prototyping and modeling sector due to its opaque properties and behavior, such as the benefits of researching material flow through sections of the model and being easily visible through the cross section (Ref 16). A polymer-based composite consists of at least two pieces, one of which is reinforcement, and the other is the matrix. Different fillers may be used for polymer-based composites, such as; ceramics, metals, and other types of thermoplastic polymers. Thermosetting and thermoplastic resins have been widely employed as the matrix in polymer composites (Ref 17). According to previous research work, Al and its composites provide better materials with better mechanical and thermal properties than unreinforced materials (Ref 18). Different types of metallic powders have been reinforced in different polymers, which may evolve their rheological, thermal, and mechanical properties (Ref 19).

Machine learning (ML) is a sort of artificial intelligence that enables software programs to improve their prediction accuracy without being expressly designed to do so (Ref 20). ML algorithms estimate new expected output using past information as input (Ref 21, 22). Three common ML approaches, random forest (RF), linear, and AdaBoost were applied to construct predictive models for non-traditional machining processes. However, the linear regression did not map the intricate association between process factors and responses. On the other hand, AdaBoost regression and RF regression were suitable for predicting non-traditional machining responses (Ref 23). ML approaches were utilized in Electrical Discharge Machining to predict changes in tool shape. However, the outcomes anticipated by the RF strategy were more persuasive and produced favorable results with high accuracy of 93.67% (Ref 24). The RF regressor has adequately anticipated material removal rate, surface roughness, and active energy consumption for the CNC face milling, comprising 27 experiments (Ref 25). In addition, an RF-based thermal error modeling approach was implemented. A thermal error experiment confirms the proposed model’s more than 90% forecast accuracy despite fluctuating operating circumstances. Compared to traditional approaches, the suggested model uses less training data, allows faster and more intuitive parameter adjustment, achieves higher prediction accuracy, and has more resilience (Ref 26). The RF regression model was better than the Quantile and multiple regression models for predicting surface roughness during machining AISI 4340 steel (Ref 27). In previous studies, ML has been reported for AM design (Ref 28), prediction of surface roughness in wire arc AM (Ref 29), quality analysis in metal AM (Ref 30), and geometry deviation in AM (Ref 31). ML has gotten much interest from academic researchers and industrial engineers across various fields in recent decades (Ref32). ML applications can be found in various manufacturing and machining processes (Ref 33). Moreover, many practical experiments, particularly for milling and turning equipment, reveal encouraging outcomes (Ref 34). Therefore, there is a need to investigate ML applications in several manufacturing fields.

It is evident from the previous literature studies that many researchers or scientists have used different fabrication processes and tools to tune the mechanical properties of the reinforced/composite structures prepared using 3D printing processes. However, it has been observed that significantly less work has been reported for the metallic spray-based composites by AM between two thermoplastic layers to maintain/improve better mechanical properties. As with the higher demand for 3D printing technology in every sector or industry for different applications having different expectations from end products in terms of strength, appearance, etc., materials and techniques must be compatible. The present study is an extension of the work conducted by (Ref 35) for the development of the ABS-Al composite structures. In continuation, the present study focused on investigating the flexural properties by multi-objective optimization, ML, and fracture analysis.

2 Materials and Methods

ABS thermoplastic polymer with a 1.75 ± 0.05 mm diameter of feedstock filament was used as printing material for this research work. For reinforcement of Al particles in ABS thermoplastic polymer layers, Al spray (99.5% pure aerosol) (Manufactured by; Wurth India Ltd, India) was used. All samples have been prepared according to ASTM D790 standards for this research work. The dimensional specification of the ASTM D790 standard is shown in Fig. 1. Polymer layers were deposited using the spraying method to reinforce Al (in spray form) particles between ABS. The spray was given to ABS layers using an acrylic mist spray. Pilot experiments were conducted to ensure the consistency of Al in each spray, and it was discovered that each push of the spray could spray roughly 65 mg of Al. Every reinforced layer receives an exact amount of Al spray.

Fig. 1
figure 1

Dimensional view of Flexural sample (ASTM D790) (All dimensions are in mm)

According to the literature review, three different important factors (No. of layers, infill pattern, and Infill density) have been selected (Ref 36, 37). Three levels of each factor were selected based on their flexural strength. Line, Triangle, and cubic infill patterns provide maximum mechanical strength (Ref 36, 37). Three different layers of each factor were also selected, as shown in Table 1. Figure 2 shows the step-by-step procedure for developing ABS-Al-based composite structures.

Table 1 Selected essential factors and their different levels
Fig. 2
figure 2

Stepwise working procedure for this research work

3 Experimentation

3.1 3D printing for Manufacturing of ABS-Al Composites Structures

The flexural samples were 3D printed using the FFF technique on a PRUSA i3 MK2 3D printer (extruder temperature 270 °C, maximum build plate temperature 125 °C, nozzle diameter 0.4 mm, build plate area 250 mm (Height) × 210 mm (Length) × 200 mm (Width)). The spray procedure is used to reinforce the Al. Printing was interrupted for spraying and restarted after the spraying operation was completed. Figure 3 depicts the flexural testing procedure. The specimen’s CAD software package Fusion 360 “Version 2020” was used to create a 3D model of ASTM D790. The “Ultimaker Cura 4.13.1 software suite” was used to slice the 3D model and set the input parameters. Some fixed and some variable input parameters were used to print samples.

Fig. 3
figure 3

(a) Flexural sample of ABS-Al composite, (b) Flexural testing setup, (c) fractured sample after flexural testing, (d) All fractured samples after flexural testing

For this research work, layer height was 0.1 mm, the printing temperature was 240 °C, the build plate temperature was 80 °C, and the printing angle was 45 degrees. These constant parameters were chosen since several researchers have determined that these printing settings produce the best outcomes (Ref 38). Infill pattern, infill density, and the number of reinforced Al layers were the variable printing factors used in the experimentation. The number of reinforced Al layers was chosen to be 2, 3, or 4 to determine the influence of reinforcement. Three different infill patterns (cubic, triangular, and linear) were used for this research work. These were chosen because all three patterns print differently and have various infill shapes (Ref 39). The infill density of flexural samples was chosen at 60, 80, and 100% to determine the impact of Al reinforcement at various porosities. The Taguchi L9 (3^3) orthogonal array approach was used to design the experiments. Table 2 shows the experimental design of the research work.

Table 2 Experimental design for the printing of flexural sample (Ref 35)

The ABS thermoplastic polymer and Al particles-based composite samples with each 2, 3, and 4 sprayed Al intermediate layers were prepared using the modified FFF process. Three different samples were fabricated, having two layers of Al particles. Each layer of Al-particles spray is deposited 0.03 mm layer thickness in this sandwich structure. In such samples, 1st layer was sprayed after 33% of printing of total sample thickness (13th layer), and 2nd layer was sprayed after 66% of printing of total sample thickness (26th layer). Similarly, 3 and 4 layers of Al particles are sprayed according to Table 3. The spray interval for all the no. of layers is shown in Table 3.

Table 3 Experimental design for the printing of flexural samples (Ref 35)

3.2 Flexural Testing

The mechanical properties of matter are determined through flexural strength testing. According to ASTM standards, it calculates the amount of force required to shatter a specimen formed of homogenous material or any other composite material (see Fig. 1). The flexural testing of samples was carried out on a universal testing machine (UTM) during this experimentation process. The UTM with a maximum capacity of 5000 N (Make: Shanta Engineering, India). Three samples were made for every experimental run of setup are tested, and their average value is considered as a concluding result. Figure 3(b) shows samples undergoing a flexural test, while Fig. 3(c) and (d) shows fractured samples after flexural testing. Ultimate flexural strength (UFS), fracture strength (FS), strain at peak (SP), and strain at break (SB) are the results of flexural testing. The results of the flexural tests are reported in Table 4.

3.3 Morphological and XRD Analysis

The optical photomicrographic analysis is an experiment in which several magnified images are examined using an optical microscope. Only the best and worst flexural strength samples (Table 3) were examined in this experimental research. For this study, an optical microscope was used to take a 100 × magnified image, and roughness and 3D rendering were done using “Gwyddion software version 2.59.” According to flexural strength, the best and worst samples were then analyzed using an XRD machine model no. “D8 ADVANCE ECO” (Manufactured by; Bruker Scientific Instruments, Billerica, Massachusetts). The CuK-alpha radiation source was operated at 40 kV/25 mA. K-beta filter was used to eliminate interference peaks. Divergence slit and scattering slit 0.5° together with 0.2 mm of receiving slit were used. The XRD analysis was recorded by monitoring the diffraction pattern appearing in the 2θ range from 5 to 90 with a scan speed 2°/min and a scan step of 0.05°. A high-quality magnified image has been taken using SEM machine model no. “JEOL JSM- IT500” (Manufactured by; JEOL, Akishima, Tokyo, JAPAN) for detailed analysis. SEM photomicrographs were taken in the vacuum environment chamber @15 kV power supply with two different magnifications (× 33 and × 140 zoom).

4 Results and Discussion

4.1 Flexural Testing

The flexural properties of ABS-Al hybrid composite structures manufactured using the modified AM technique are shown in Table 4. Sample 9 has the highest flexural strength, whereas sample 2 results lowest. Better flexural properties in sample 9 may be due to the combination of cubic-shaped infill pattern, four Al layers, and an infill density of 80% have provided the lesser defect formation or compactness in forming a part. The Al particles were placed between porous zones generated by cubic patterns, boosting flexural strength. The cubic infill design makes this permeable yet improved connection between layers easier.

The minimum values of UFS and FFS were observed for sample no. 2, having input parameters as triangular infill pattern, 80% infill density with two sprayed Al spray layers. The triangular infill provides more porosity and hence more hollow space, minimum no. of reinforced Al layers resulted in low flexural strength values. All the samples are a combination of triangular infill patterns with only two no. of Al, layers that have shown weaker flexural strength than other combinations. Therefore, samples prepared with triangular infill patterns are the least strong samples.

The Al particle reinforcement in the ABS layers has increased its SB. The maximum SP and SB were observed for experimental run no. 4 and experimental run no. 8, respectively, as fewer reinforced Al layers resulted in low strength at break and perhaps increased its ductility. Minimum SP and SB are observed at experimental run no. 5 and run no. 9.

4.2 Single-Objective Optimization

Experimental observations for modified 3D printing of ABS-Al composites are shown in Table 4. Three experiments were conducted for each set of experiments per the L9 (3^3) Taguchi orthogonal array, and analysis was done on an average of three readings for UFS, FFS, SP and SB refer to Tables 2, 4. The computed signal-to-noise (SN) ratios are shown in Table 5.

Table 4 Experimental observations and results
Table 5 SN ratios of UFS, FFS, SP, and SB

The output parameters or responses of modified 3D printing of ABS-Al composites such as UFS, FFS, SB, and SP have been optimized by considering the “larger the better” option. Figure 4(a) to (h) shows the means and SN ratio plots for the UFS, FFS, SP and SB responses, respectively. The optimal input parameter combinations for different responses were analyzed conclusively from Fig. 4(a) to (h). It is observed from Fig. 4(a) and (b), means and SN ratios of UFS, that several layers at the middle level, infill pattern, and infill density at the higher-level result in a higher value of UFS. Similar results can be seen for FFS from Fig. 4(c) and (d) number of layers at the middle level, infill pattern, and infill density at higher level result in a higher value of FFS. In the same style, Fig. 4(e) and (f) specifies maximum SP at a middle level of the number of layers, higher level of infill pattern, and intermediate level of infill density. SB attained a higher value at the middle level of the number of layers, a lower level of infill pattern, and a higher level of infill density.

Fig. 4
figure 4

Main effects plots (a) mean UFS, (b) SN ratios UFS, (c) mean FFS, (d) SN ratios FFS, (e) mean SP, (f) SN ratios SP, (g) mean SB, and (h) SN ratios SB

The analysis of variance (ANOVA) for means and SN ratios of different responses is depicted in Table 6. It has been observed from the ANOVA Table 6 that only the infill pattern has a statistically significant 95% confidence, both for means and SN ratios. Infill density has a significant effect on SB only for SN ratios. The infill pattern has maximum contributions for means of responses UFS of 94.74%, FFS of 95.11%, SP of 22.47%, SB of 55.77%, and SN ratios of responses UFS of 92.11%, FFS of 93.36%, SP of 25.14%, and SB of 50.91%, respectively. The contribution toward the residual error is 3.73%, 3.32%, and 2.39% of UFS, FFS, and SB for means except for SP means of 42.39%. Similarly, residual error of SN ratios contributed 4.78% for UFS, 4.41% for FFS, and 0.93% for SB, except 49.98% for SP. The lower residual error values indicate no sophisticated measurement error in experimentation and the oversight of vital factors.

Table 6 ANOVA for means and SN ratios; UFS, FFS, SP and SB

4.3 Multi-objective Optimization

The optimal results of single-objective optimization of responses of modified 3D printing of ABS-Al composites such as UFS, FFS, SB and SP have different factor level combinations. So, to achieve multi-objective optimization of UFS, FFS, SB and SP responses, a hybrid methodology was utilized employing different weight assigning techniques. The TOPSIS method was used to attain a composite score or MCS (multiple composite scores) (Ref 40, 41); all steps followed are in line with (Ref 42). The TOPSIS presupposes that the selected option has the shortest Euclidean dispersion from the satisfactory ideal solution and the most significant distance from the perfect negative resolution (Ref 43). Firstly, the equal weights were assigned to responses UFS, FFS, SB, and SP, i.e., 25% weightage to each response as there are four output parameters. Secondly, the weights were assigned with Entropy weights methods as it gives weights without considering the contribution of the decision-maker; it may be an engineer, researcher or any other member of the research team. Therefore, there is no bias while assigning weights and only mathematical computation based on entropy and probability theory; it is well developed and implemented technique, and all steps were followed as per (Ref 44, 45). The advantages, drawbacks and implementation of the Entropy method are well described (Ref 46). Finally, the AHP weights method was utilized to assign weights to the responses because this method includes due consideration to the decision-maker and steps are followed in line with (Ref 47). After computing MCS with different weight assigning methods, it is further optimized as per the Taguchi method, and the larger, the better option was utilized, and computations were done in Minitab software.

The responses considered are UFS, FFS, SB, and SP, and their average values in 5 become the decision matrix for evaluation to attain MCS. The computed weights of importance for UFS, FFS, SB and SP with three methods, Equal, Entropy, and AHP, are shown in Fig. 5, and the weighted matrix is multiplied with a normalized matrix attained by vector normalization while assuming computations up to four decimals. The pair-wise comparison matrix to compute AHP weights is shown in Table 7. With six comparisons, the maximum Eigenvalue achieved is 4.135, and the consistency ratio CR of 5%. The fact that the CR is less than ten percent suggests that decision-makers judgment when allocating values to the matrix for pair-wise comparisons is highly accurate. The finest and worst choices must then be determined, and separation measurements must be prepared using Euclidean distance. The ideal best and worst solutions are shown in Fig. 6 for three weight methods Equal, Entropy, and AHP. The separation measures, MCS, and computed SN ratios for MCS are shown in Table 8 for Equal, Entropy and AHP weights.

Fig. 5
figure 5

Weights to responses by different methods

Table 7 Pair-wise comparison matrix
Fig. 6
figure 6

Ideal positive and ideal negative for different weights

Table 8 Separation measures, MCS and SN ratios

Consequently, the Taguchi method was utilized to optimize the observed MCS. As a result, the MCS is always regarded as the higher, the better quality SN ratio (Ref40). The main effects plots for means and SN ratios are shown in Fig. 7 for Equal, Entropy and AHP weights. The optimal combination of factor/level from Fig. 7(a) and (b) indicates that a lower level of the number of layers, the middle level of infill pattern, and a higher level of infill density results in a higher value of MCS of 0.4647 for Equal weights. So, the optimal combination is A2, B2 and C3. Figure 7(c) and (d) indicates that a lower level of the number of layers, lower level of infill pattern, and higher infill density result in a higher value of MCS of 0.5922 for Entropy weights. So, the optimal combination is A1, B1 and C3. Similarly, Fig. 7 (e) and (f) indicates that the middle level of the number of layers, higher level of infill pattern, and higher infill density result in the higher value of MCS of 0.9306 for AHP weights. So, the optimal combination is A2, B3 and C3.

Fig. 7
figure 7

Main Effects Plots (a) mean MCS Equal Weights, (b) SN ratios MCS Equal Weights, (c) mean MCS Entropy Weights, (d) SN ratios MCS Entropy Weights, (e) mean MCS AHP Weights, (f) SN ratios MCS AHP Weights

ANOVA results for means and SN ratios of MCS with different weights methods are shown in Table 9, * indicates the significant factors. The infill pattern has contributed significantly to MCS equal weights, 64.58% for means and 67.68% for SN ratios, MCS entropy weights, 48.44 for means and 45.18% for SN ratios. The infill pattern also contributes to MCS with AHP weights, 94.99% for means and 82.99% for SN ratios.

Table 9 ANOVA for means and SN ratios; MCS Equal, Entropy and AHP Weights

4.4 Comparative Analysis

The comparative analysis was performed to check the optimal results of single-objective and multi-objective optimization techniques. The experiments were repeated three times to verify the attained optimal combination of parameters, and mean values were considered for analysis. Table 10 depicts experimental values and precited by the Taguchi method using Minitab software. The relative error is computed with Eq. 1, and Ei shows the experimental value and Pi shows predicted values. The relative error is within permissible limits, and its value is lowest for UFS 0.61 means and highest for SP 7.02 means.

$${\text{Relative error}} \left( \% \right) = \left| {\frac{{E_{i} - P_{i} }}{{E_{i} }}} \right| \times 100$$
(1)
Table 10 Predicted and experimental responses

Furthermore, to verify the contribution of optimal results for a single-objective and multi-objective, the attained values for each response were compared with the initial values or virgin ABS as UFS is 47.46 MPa, FFS of 43.41 MPa, SP of 0.165 and SB of 0.706. The comparative results were obtained in percentage change in the individual response UFS, FFS, SB, and SP concerning initial values or virgin ABS. The Grey-Taguchi method verified the optimal results, and the results were similar to the presented results with Taguchi-TOPSIS. Figure 8 shows the percentage change in the individual response plotted on the y-axis and different responses with a single-objective and multi-objective optimization with varying methods of weight on the x-axis. Taguchi method optimization improves all the responses, such as SB enhanced 37% and is higher in all responses followed by 23% improvement in SP, and 6% improvement of UFS and FFS.

Fig. 8
figure 8

Percentage change in responses with different weights

The multi-objective optimization with different weights indicates some improvement in the response and deterioration. Figure 8 suggests that with equal importance to all responses, i.e., 25% each to UFS, FFS, SP, and SB, there is a deterioration of the UFS by 41%, FFS by 42%, and SP by 68%, and only improvement of 7% in SB. With the application of entropy weights to responses, i.e., UFS of 16.19%, FFS of 16.45%, SP of 28.53%, and SB of 38.38%. There is a deterioration of the UFS by 24%, FFS by 25%, SP by 49%, and only an improvement of 7% in SB. When AHP weights are assigned to responses, i.e., UFS of 56.30%, FFS of 30.80%, SP of 6.30%, and SB of 6.60%. There is a deterioration of the SP by 7%, SB by 20%, and UFS and FFS improved by 7% each.

So, in the present case, multi-objective optimization with AHP weights provides significant results, as in this case, weights were assigned with the help of the decision-maker. The literature also shows deterioration and enhancement of response values in multi-objective optimization (Ref 42, 44, 46, 47).

4.5 Machine Learning: Random Forest Regression

Random forest (RF) is a “Tree” based algorithm that uses the quality features of multiple decision trees for making decisions. First, RF leads to create independent decision tree branches during the training phase (Ref 48, 49). Then, the final prognosis is made by blending the predictions from all trees. Finally, RF uses a collection of results to make a final decision and is referred to as the ensemble learning technique (Ref 23). The RF algorithm is also fast, and more robust than other regression models (Ref 50, 51). The first stage of RF is to establish the RF tree by aggregating the N decision trees, and the second stage is to make a hypothesis for each tree generated in the first phase. Finally, the RF prediction is computed by Eq. 1.

$${\text{RF Prediction }} = \frac{1}{K}\mathop \sum \limits_{k = 1 }^{k} h_{k} { }\left( {\text{x}} \right){ }$$
(2)

where K is the number of diverse regression trees generated for the iterations with input vector x, and hk(x) signifies the mean of predictions given by K regression trees.

In RF, hyperparameters improve the model’s prediction capability or make it faster. There are two primary hyperparameters in RF, viz. n_estimators and max_depth.

  • n_estimators: It specifies how many trees the algorithm constructs before doing maximum voting or averaging predictions. A higher number of trees improve performance and make predictions more stable, slowing down the computation.

  • max_depth: It governs the maximum height up to which the trees inside the forest can grow. With an increase in the depth of the tree, the model accuracy increases up to a certain limit, but then it will start to decrease gradually because of overfitting in the model. Therefore, it is essential to set its value appropriately to avoid overfitting.

4.5.1 Performance Evaluation of RF Regression

  • Root Mean Square Error (RMSE): The average difference between the model’s anticipated values and the actual values in the database is described by an RMSE. The lower RMSE, the stronger a model can “fit” a piece of information.

  • Mean Square Error (MSE): Mean Square Error gages the mean of error squares, which indicates the average squared difference between the anticipated and actual values. It is never derogatory. As a result, numbers close to 0 are desirable. The MSE is the resonance frequency of error (around the origin) that includes both the variance and bias of the estimator.

  • Coefficient of Determination (R2): The R2 is a quantitative calculation that reflects how much the independent variable can explain variance in the dependent variable. It indicates how well the data match the model (the goodness of fit).

  • Mean Absolute Error (MAE): The average difference between estimated and actual data is computed using MAE since it quantifies inaccuracy in observations made on the same scale, also known as scale-dependent accuracy.

  • Maximum Error (Maxi. Error): The max error method estimates the maximal residual error. It is a statistic that depicts the worst-case difference between the estimated and observed values.

  • Median Absolute Error (MedAE): The median absolute error is especially intriguing since it is resistant to outliers. The loss is estimated by averaging the total variances between the target and the prognosis.

    $${\text{RMSE}} = \sqrt {\frac{{\mathop \sum \nolimits_{i = 1}^{N} \left( {P_{i} - A_{i} } \right)^{2} }}{N}}$$
    (3)
    $${\text{MSE}} = \frac{1}{N}\sum \left( {A_{i} - P_{i} } \right)^{2}$$
    (4)
    $$r = \frac{{n\left( {\sum {xy} } \right) - \left( {\sum x } \right)\left( {\sum y } \right)}}{{\sqrt {\left[ {n\sum {x^{2} - \left( {\sum x } \right)^{2} } } \right]} \left[ {n\sum {y^{2} - \left( {\sum y } \right)^{2} } } \right]}}$$
    (5)
    $${\text{MAE}} = \frac{1}{N}\sum \left| {A_{i} - P_{i} } \right|$$
    (6)
    $${\text{Maxi Eror}} = \left( {A_{i} - P_{i} } \right)$$
    (7)
    $${\text{MedAE}} = \left( {\left| {A_{i} - {\text{median}}\left( {A_{i} } \right)} \right|} \right)$$
    (8)

Where Pi is the anticipated value, Ai is the actual value, and N is the sample size.

4.6 Application of Random Forest Regression to Predict Ultimate Flexural Strength, Fracture Flexural Strength, Strain at Peak and Strain at Break

The RF regression analysis was performed to predict UFS, FFS, SP and SB. All the experiments were performed with L-9 Taguchi orthogonal array while repeating experiments thrice. First, RF regression analysis of raw data of all experiments was performed, and descriptive statistical analysis is shown in Table 11. It shows the mean values of all the experiments performed, standard error (SE) of the mean, standard deviation (StDev), variance, coefficient of variance (CoefVar), minimum, median, maximum and range values.

Table 11 Descriptive statistics of L-9 repeated experiments for UFS, FFS, SP and SB

Before presenting and finalizing ML results with RF regression, other methods were applied, such as linear regression (LR) and support vector machine (SVM) (Ref 52). First, the initial results of the three algorithms, RF, LR and SVM, were compared in terms of R2. The R2 of LR and SVM comes out to be very low compared to RF. Then, regression modeling of FFS was performed by RF regression based on two primary hyperparameters such as estimators, i.e., number of trees and depth of the tree. The performance of the FFS model has been analyzed based on R2, MSE, RMSE, MAE, maximum error and MedAE. First, keeping the depth of the tree constant at 30 and estimator values varied from 60 onward. Then, at estimator 100, the maximum R2 and minimum values of MSE, RMSE, MAE and maximum error were observed. Then, the estimator was fixed at 100, and the depth of the tree was increased from 30 onward. But there is no improvement in the performance parameters (refer to Table 12). Finally, the estimator at 100 and the depth of the tree at 30 were selected as optimal values for the regression analysis of UFS, FFS, SP and SB.

Table 12 Effects of number of trees and depth of tree on FS performance parameters: Responses at optimal parameters

Table 12 also depicts the performance of FFS, UFS, SP, and SB based on performance metrics. It is shown in Table 12 that the RF technique provided the best accuracy (R2) with a value of 0.999 for UFS and has the lowest accuracy of 0.944 for the prediction of SP values. Higher R2 values imply that the data are tightly bound to the fitted regression line and that the proportional error in estimating out-of-roundness is exceptionally minimal. The MSE was calculated using Eq. 3. The MSE value achieved using a given approach should be the smallest for the peak quality of a regression model. For the given dataset, it can be seen that SB has a minimal MSE value of 0.001, whereas the FFS model has projected the response with a maximum MSE value of 0.415. The SB’s RF approach model correctly predicted the smallest error margin. SP has the lowest RMSE, whereas FFS has the highest. MAE for SP has the lowest value of 0.011 and the highest value of 0.535 for FFS. SP has minimal, maximum, and median absolute errors of 0.025 and 0.006, respectively.

Figure 9 compares actual and predicted values for the FFS model. To test the FFS model findings, six tests were performed to examine the difference between fundamental and projected values. For example, experiment 1’s anticipated value is 33.20, whereas the actual value is 34.02. After that, the absolute error was determined to be 0.817. The findings reveal that experiment number two has a minor absolute error of 0.046 between actual and projected FFS. The same method has been applied to UFS, SP, and SB RF models to check the accuracy by calculating the absolute error between actual and predicted values refer to Fig. 9(b), (c), and (d).

Fig. 9
figure 9

Experimental vs. RF predicted values and error (a) FFS, (b) UFS, (c) SP, and (d) SB

4.7 Contour and Surface Plots: Functional relationship between Factors and Responses

The surface and contour plots have been drawn to ensure the optimum combination of the process parameters. The contour plot of UFS, FFS, SP, and SB has been drawn against infill density, infill pattern, and no. of layers, showing that the optimum fabrication setup is four number of Al particle spray layers, with 100% infill density and cubic infill pattern, refer to See Fig. 10, 11. Figure 12 and 13.

Fig. 10
figure 10

Contour and surface plots for UFS

Fig. 11
figure 11

Contour and surface plots for FFS Fig. 12. Contour and surface plots for strain at peak

Fig. 12
figure 12

Contour and surface plots for strain at break

Fig. 13
figure 13

XRD plots of pure ABS along with 1, 2, and 3 no. of Al layers composite

4.8 XRD Analysis

Based on the flexural strength properties result, sample run no. 3 (no. of Al particle layers 2), 6 (no. of Al-particle layers 3), and 9 (no. of Al-particle layers 4) and pure ABS sample have been analyzed by XRD for 2θ from 5° to 90° with 2134 steps. Based on Fig. 14, it has been observed that samples prepared with 2 and 3 layers are highly crystalline (44.17% and 41.54%) as compared to pure ABS (23.21%) and with 4 no. of Al-particle layers (51.11%). According to Fig. 14 of XRD graphs, it is observed that all the 3 composite samples of Al spray layered are higher crystallinity. It is observed that samples with 4 no. of Al-spray layers are more crystalline than others, showing higher mechanical strength present in sample 9 (4 no. of Al-spray layers). According to Fig. 14, samples with 2 and 3 layers of Al-particles in the form of spray are 0 peaks, and sample with 4 layers of Al-particles are 2 peaks shows better mechanical properties from a flexural point of view. This XRD graph shows the no. of counts vs. the 2θ graph. The crystallinity of the polymer increases strength because, in the crystalline phase, intermolecular bonding is more significant. Hence, the polymer deformation can result in higher strength leading to oriented chains. This XRD result supports the flexural strength results.

Fig. 14
figure 14

100 × optical image, 3D rendering image, and Ra graph of sample no. 3 (a, b, c), 6 (d, e, f), 9 (g, h, i) and pure ABS (j, k, l)

4.9 Morphological Properties

ABS-Al-based composite specimens were manufactured on samples no. 3, 6, and 9, and pure ABS was observed after flexural testing for fractured parts of the specimens. This optical analysis has been performed for all the no. of Al-spray layers (2, 3, and 4) composited with ABS polymer manufacturing types. According to flexural strength testing, it has been observed that sample no. 9 has maximum flexural strength, which suggests that 4 no. of Al-spray in ABS composites provides better mechanical strength. This optical analysis has been performed at 100 × magnifications for detail and justification. Optical images of samples no. 3, 6, and 9 and the pure ABS-based fractured portion of the flexural sample are shown in Fig. 15(a), (d), (g), and (j). Similarly, 3D rendering images of the surface of the fractured portion of samples no. 3, 6, 9 and pure ABS-based composite flexural sample are shown in Fig. 15(b), (e), (h), and (k). Lastly, by using “Gwyddion software version 2.59”, average surface roughness (Ra) has been determined, and the graph of the surface roughness is shown in Fig. 15(c), (f), (i), and (l) of sample no. 3, 6, 9 and pure ABS. The Ra values in samples no. 3, 6, 9, and pure ABS are 13.25, 6.97, 5.44, and 6.19 nm, respectively. According to Fig. 15, it has been observed that minimum Ra is obtained in experimental run no. 9 that justified/supports the flexural strength output results. This may be due to lesser Ra providing better bonding of two layers during 3D printing. As a result, lower Ra shows better mechanical blending, providing better mechanical (tensile) strength.

Fig. 15
figure 15

SEM image of ABS-Al based composite at × 33 magnifications

SEM images have been taken after optical analysis of all four flexural samples (experiment run no. 3, 6, 9, and pure ABS). In the SEM analysis, the study needs to identify the reason for the fracture pattern of samples. The fractured pattern of specimen no. 3 (2 no. of Al-spray layers) is shown in Fig. 16(a). Similarly, specimens no. 6, 9 and pure ABS-based fractured portion are shown in Fig. 16(b), (c) and (d), respectively.

Fig. 16
figure 16

SEM image of ABS-Al based composite at × 33 magnifications

According to Fig. 16, it has been observed that all the fractured in sample no. 6 and pure ABS are completely broken, which shows lesser bonding strength, whereas it has been observed that, according to Fig. 16, fracture in sample no. 3 and 9 is not completely broken, which shows higher flexural strength. Furthermore, SEM magnified image shows that in sample no. 9, a fracture is regular compared to others that support the flexural results.

5 Conclusions

The fractured strength has been studied while designing FFF-based ABS-Al composite structures. Three main input parameters, infill pattern, infill density, and the number of sprayed layers, have been selected to investigate FFS, UFS, SP, and SB. Single objective, multi-objective, and prediction with ML have been performed, and results were supported with XRD, optical, and SEM fracture analysis. From the investigation, the following conclusions were drawn.

  • The maximum and minimum values of UFS and FFS, according to Table 4, are obtained in experimental run no. 9. It has been also observed that fabricated samples are stronger due to cubic infill patterns (exp. run no. 3, 6, and 9), whereas triangular-shaped infill patterns are the least strong. Reinforcement of Al particle spray in between the ABS layers has increased flexural strength. Maximum UFS and FFS are obtained in experimental run no. 9, having a cubic-shaped infill pattern with 4 no. of Al particles layers with 80% infill density.

  • As per single, multi-objective optimization and comparative analysis, it has been concluded that the best fabrication setup for the composite product is no. of Al particle spray is 4 with 100% infill density and cubic infill pattern from a flexural strength point of view, whereas multi-objective optimization with AHP weights provides significant results, as in this case, weights were assigned with the help of the decision-maker.

  • According to morphological (SEM and optical) and XRD analysis, it has been observed that experimental run no. 9 (no. of Al spray layers 4) has minimum infill porosity that provides better flexural strength as compared to other experimental runs (no. of Al spray layers 2 & 3).

  • Machine learning, the Random forest approach, with R2 of 99.6, 99.9, 94.4, and 97.1% for FFS, UFS, SP, and SB, respectively, prove to predict responses. Furthermore, the performance parameters such as MSE, RMSE, MAE, and MedAE favorable results revealed that ML aids in forecasting outcomes to make the AM system more efficient, optimize performance, and improve proactively so that relevant measures can be taken when desired.