Explainable AI Techniques for Comprehensive Analysis of the Relationship between Process Parameters and Material Properties in FDM-Based 3D-Printed Biocomposites

: This study investigates the complex relationships between process parameters and material properties in FDM-based 3D-printed biocomposites using explainable AI techniques. We examine the effects of key parameters, including biochar content (BC), layer thickness (LT), raster angle (RA), infill pattern (IP), and infill density (ID), on the tensile, flexural, and impact strengths of FDM-printed pure PLA and biochar-reinforced PLA composites. Mechanical testing was used to measure the ultimate tensile strength (UTS), flexural strength (FS), and impact strength (IS) of the 3D-printed samples. The extreme gradient boosting (XGB) algorithm was used to build a predictive model based on the data collected from mechanical testing. Shapley Additive Explanations (SHAP), Local Interpretable Model-Agnostic Explanations (LIME), and Partial Dependence Plot (PDP) techniques were implemented to understand the effects of the interactions of key parameters on mechanical properties such as UTS, FS, and IS. Prediction by XGB was accurate for UTS, FS, and IS, with R-squared values of 0.96, 0.95, and 0.85, respectively. The explanation showed that infill density has the most significant influence on UTS and FS, with SHAP values of +2.75 and +5.8, respectively. BC has the most significant influence on IS, with a SHAP value of +2.69. PDP reveals that using 0.3 mm LT and 30 ◦ RA enhances mechanical properties. This study contributes to the field of the application of artificial intelligence in additive manufacturing. A novel approach is presented in which machine learning and XAI techniques such as SHAP, LIME, and PDP are combined and used not only for optimization but also to provide valuable insights about the interaction of the process parameters with mechanical properties.


Introduction
Three-dimensional printing is gaining a lot of attention from industry as well as academia due to its ability to produce parts with the highest complexity, its ease of manufacturing, its reduced material waste, and its cost-effectiveness [1].Fused deposition modeling (FDM) is a type of 3D printing in which materials are extruded from a nozzle and deposited layer by layer in the XY plane to create a 3D structure [2].Commonly used materials in FDM include polylactic acid (PLA) and acrylonitrile butadiene styrene (ABS) [3].Due to its limited strength, researchers are exploring synthetic and natural reinforcements to enhance its mechanical properties [4].Biocomposites, i.e., polymer material reinforced with natural fibers, are among the most promising materials for FDM [5].The mechanical properties of 3D-printed parts largely depend on the material properties and FDM process parameters used [6].Rendas et.al. studied the effect of the printing temperature on the strength of the 3D-printed polyetheretherketone (PEEK).The results indicate that, at higher temperatures, the yield strength was reduced significantly [7].Ahmad et al.'s study on oil-palm-fiber-reinforced ABS composites for FDM demonstrated that the 3 wt% fiber composite exhibited marginally higher tensile strength and modulus values compared to plain ABS [8].Fisher et.al. investigated the effect of raster angle on the performance of carbon-fiber composites, and the results indicated a 130% rise in compressive strength when the angle was set to 0 degrees [9].
It is difficult to build a mathematical model for the prediction of the mechanical performance and quality of the 3D-printed parts as there are too many factors influencing the FDM process parameters and the variety of materials used.Machine learning (ML) is a promising pathway with which to prepare a prediction model, as it can discover underlying patterns with ease.For tensile strength prediction, Jatti et al. used the K-Nearest Neighbor (KNN) ML model, which resulted in better prediction capabilities, with an F1 score of 0.71 [10].Deb et al. found that ensemble ML methods outperformed classical support vector and KNN models in predicting the surface quality and strength of 3D-printed items [11].The lack of transparency in most predictive machine learning models can make it difficult to understand their decision-making processes, which may limit their use in critical applications.Explainable AI (XAI) can play a critical role in additive manufacturing by enhancing the transparency, trust, and efficacy of AI-driven processes.
Explainable machine learning (ML) is used to establish importance rankings for parameters, serving as an alternative tool for prioritization, and to uncover interaction effects between parameters [12].XAI involves using techniques like model simplification, visualization tools, and rule-based systems to demystify complex AI models.By offering explanations for AI outputs, XAI not only helps users to trust and effectively utilize AI technologies but also facilitates better debugging, compliance, and refinement of AI systems.Novel methods for applying XAI in various applications have been suggested by researchers.For instance, Hrnjica and Softic find that the estimation of repair work can be reasonably assisted by explainable AI in the form of a focused, analytical, and trustworthy prediction model [13].Leon Kellner analyzed these predictions using the SHAP explainable AI technique.In terms of ice mechanics, the impact rankings of experimental parameters and parameter interactions were examined and addressed [12].The study conducted by Gawde et.al.provides AI-based predictive maintenance that can be utilized for industrial rotating machinery.They performed XAI integration, using "Local Interpretable Model Agnostic Explanation (LIME)", "SHapley Additive exPlanation (SHAP)", "Partial Dependence Plot (PDP)" and "Individual Conditional Expectation (ICE)" methods to interpret the results [14].According to this study, P-wave velocity is the most crucial factor in predicting UCS and E. For UCS and E estimates, extreme gradient boosting, or XGBoost, was employed as a reliable predictive AI system.These findings suggested that XAI might should taken into consideration to clarify intricate connections between advances in energy resources and rock mechanics [15].The study by Mishra et.al.focuses on predicting the surface roughness of PLA specimens created through additive manufacturing.Their study utilizes eight different supervised machine learning regression algorithms.To enhance the interpretability of these models, explainable AI techniques are employed.Their study also gives insights from the deployment of explainable AI techniques and provides a comparative analysis of the performance of all the algorithms deployed [16].Thapaliyaa's work investigates the use of five machine learning regression models to estimate the processing time and power consumption of CNC machines.Additionally, this study uses the XAI techniques SHAP and LIME to offer post hoc justifications for the predictions generated by these models.The results of the studies showed that the most accurate estimates for processing time and power usage came from random forest regression.The explanations made it clear that the main determinants of processing time and power consumption were the number of axis rotations and the number of fast traverse trips required to reach the machine's zero point.These prediction models can be used by businesses that use CNC milling machines to plan and schedule operations more effectively, saving time and energy.They can also optimize the variables that affect processing and power usage [17].
According to the literature, the use of machine learning algorithms to predict mechanical characteristics in FDM 3D printing remains rather limited.To build trust in these models, clear and transparent explanations are essential.Uniquely, this study combines ML-based prediction modeling, performed using the dataset generated by mechanical testing, with uses XAI techniques like SHAP, LIME, and PDP to provide detailed insights into how different parameters affect the strength of 3D-printed biocomposites.Furthermore, as there are only a few research articles available on the use of explainable AI in additive manufacturing, our work makes an important contribution to the field.In this study, we examined the effect of five parameters on the tensile, flexural, and impact strength of a 3D-printed composite.The results of mechanical testing were used for the creation of the dataset.A mechanical strength prediction model was built using the XGB ML model.Furthermore, a detailed investigation was carried out using XAI techniques to understand the correlation between features and target parameters.Figure 1 illustrates a comprehensive framework that details the implementation of explainable AI, offering a clear overview of the systematic approach used in this research.
to reach the machine's zero point.These prediction models can be used by businesses that use CNC milling machines to plan and schedule operations more effectively, saving time and energy.They can also optimize the variables that affect processing and power usage [17].
According to the literature, the use of machine learning algorithms to predict mechanical characteristics in FDM 3D printing remains rather limited.To build trust in these models, clear and transparent explanations are essential.Uniquely, this study combines ML-based prediction modeling, performed using the dataset generated by mechanical testing, with uses XAI techniques like SHAP, LIME, and PDP to provide detailed insights into how different parameters affect the strength of 3D-printed biocomposites.Furthermore, as there are only a few research articles available on the use of explainable AI in additive manufacturing, our work makes an important contribution to the field.In this study, we examined the effect of five parameters on the tensile, flexural, and impact strength of a 3D-printed composite.The results of mechanical testing were used for the creation of the dataset.A mechanical strength prediction model was built using the XGB ML model.Furthermore, a detailed investigation was carried out using XAI techniques to understand the correlation between features and target parameters.Figure 1 illustrates a comprehensive framework that details the implementation of explainable AI, offering a clear overview of the systematic approach used in this research.

Fabrication of Test Specimen and Mechanical Testing
Biochar (BC) produced from rice husk and polylactic acid (PLA) granules was used to create a biocomposite filament for fused deposition modelling (FDM).Four batches were prepared: pure PLA, PLA with 1% BC, PLA with 3% BC, and PLA with 5% BC.Filaments with diameters of 1.75 mm were acquired from these batches using a single-screw extruder.CAD models of the specimens were prepared using CATIA V5 for utilization in tensile, flexural, and impact tests.The standards and major dimensions used for the tests are presented in Figure 2.There are numerous process parameters involved in the FDMbased 3D printing process.Based on the literature review, key process parameters were identified, and their levels of variation were decided in accordance with the biochar

Fabrication of Test Specimen and Mechanical Testing
Biochar (BC) produced from rice husk and polylactic acid (PLA) granules was used to create a biocomposite filament for fused deposition modelling (FDM).Four batches were prepared: pure PLA, PLA with 1% BC, PLA with 3% BC, and PLA with 5% BC.Filaments with diameters of 1.75 mm were acquired from these batches using a single-screw extruder.CAD models of the specimens were prepared using CATIA V5 for utilization in tensile, flexural, and impact tests.The standards and major dimensions used for the tests are presented in Figure 2.There are numerous process parameters involved in the FDM-based 3D printing process.Based on the literature review, key process parameters were identified, and their levels of variation were decided in accordance with the biochar content (i.e., 0%, 1%, 3%, and 5%).The key process parameters selected were layer thickness (LT), raster angle (RA), infill density (ID), and infill pattern (IP).The non-observed parameters and the process parameters under observation are presented in Table 1, along with their values.J. Manuf.Mater.Process.2024, 8, x FOR PEER REVIEW 4 of content (i.e., 0%, 1%, 3%, and 5%).The key process parameters selected were layer thi ness (LT), raster angle (RA), infill density (ID), and infill pattern (IP).The non-observ parameters and the process parameters under observation are presented in Table 1, alo with their values.In this study, we investigated a total of five parameters, i.e., BC, LT, RA, ID, and each with four levels.A Taguchi orthogonal array was used to design the experimen resulting in a total of 16 experimental runs.Ultimaker-Cura 5.7.0 software was used slice and set the FDM process parameters.All the test specimens were manufactured us the Smart Maker Dual Z200 (an FDM-based 3D printer).To ensure accuracy and repea bility, three samples of each experimental run were fabricated.Following the AST standard procedure, each specimen was tested to evaluate tensile, flexural, and imp strength.Tensile testing was conducted on a universal testing machine (UTM) (obtain from Kalpak Instruments and Controls, Pune, India) with a 10 kN load cell capacity.Us a three-point bending attachment on the same UTM, flexural tests were conducted.F impact testing, we utilized the Izod impact testing machine from International Equipme Mumbai, India.The results of these mechanical tests were meticulously recorded for f ther analysis.

Data Processing and Machine Learning
The experimental data were collected, converted into a CSV file, and imported in the Google Colab platform.Before training the model, preprocessing was performed.T  In this study, we investigated a total of five parameters, i.e., BC, LT, RA, ID, and IP, each with four levels.A Taguchi orthogonal array was used to design the experiments, resulting in a total of 16 experimental runs.Ultimaker-Cura 5.7.0 software was used to slice and set the FDM process parameters.All the test specimens were manufactured using the Smart Maker Dual Z200 (an FDM-based 3D printer).To ensure accuracy and repeatability, three samples of each experimental run were fabricated.Following the ASTM standard procedure, each specimen was tested to evaluate tensile, flexural, and impact strength.Tensile testing was conducted on a universal testing machine (UTM) (obtained from Kalpak Instruments and Controls, Pune, India) with a 10 kN load cell capacity.Using a three-point bending attachment on the same UTM, flexural tests were conducted.For impact testing, we utilized the Izod impact testing machine from International Equipment, Mumbai, India.The results of these mechanical tests were meticulously recorded for further analysis.

Data Processing and Machine Learning
The experimental data were collected, converted into a CSV file, and imported into the Google Colab platform.Before training the model, preprocessing was performed.This involved handling categorical data for the feature "infill pattern".These categorical data were encoded into numerical values to facilitate model training and analysis.Infill patterns (IP), namely cubic, triangle, octate, and line, were assigned the values 0, 1, 2, and 3, respectively.We deployed a supervised machine learning (ML) regression algorithm developed using Python programming, an explainable artificial intelligence (XAI) pipeline which involves employing SHAP, LIME, and PDP to explain the models and create machine learning models by learning from data.The pipeline consists of several steps.In machine learning, assessing a model's performance is a crucial step in building a model.Data scientists usually divide dataset into two sections-80% for training and 20% for testing-to perform this.The dataset is divided on a random basis into training and testing subsets, using the train-test split function to avoid any biases.It is common practice o use 70-80% of the data for training and the remaining 20-30% for testing.Overfitting, which happens when a model is unduly complicated and matches the training data too closely, is lessened by this 80/20 split.Data scientists can more accurately evaluate the model's capacity to be generalized to new data via setting.XGB (extreme gradient boosting) is a powerful and efficient means of implementing gradient boosting, designed for speed and performance.It is widely used in machine learning competitions and real-world applications due to its high accuracy and scalability.XGB operates under the boosting framework, where multiple weak learners (typically decision trees) are combined to form a strong learner.It uses gradient descent to minimize the loss function.XGB incorporates regularization techniques such as L1 (Lasso) and L2 (Ridge) regularization.It employs a tree pruning technique known as "max depth".For hyperparameter tuning, we used RandomizedSearchCV with the XGBRegressor model from the XGB library and employed the best estimator found by the random search.The best estimator used to predict the test data is post-hyperparameter tuning.Our configuration includes a learning rate of 0.25, a max depth of 10, a gbtree booster, and 100 estimators.
In this study, the performance of the machine learning model was evaluated using a coefficient of determination (R 2 ), mean absolute error (MAE) and root-mean-squared error (RMSE) as metric features.A regression model is evaluated by using XAI tools like SHAP, LIME, and PDP to generate insights into the relation between input parameters and output parameters.

SHAP: Shapley Additive Explanations (SHAP) is an advanced technique used
for understanding machine learning model predictions.A systematic approach to analyzing each feature's contribution to model predictions is provided by SHAP.This can be utilized by calculating the "Shapley values" for every attribute, measuring the influence of each on predictions [18].In this study, SHAP values and the XGBoost model's variable importance are calculated for UTS, FS, and IS using the training set.SHAP values play a crucial role in understanding how individual features affect model predictions, enhancing interpretability, trust, and insights into machine learning models' behavior.SHAP quantifies the influence of each feature on the model's output for a specific instance or prediction.The method of evaluating the importance of various characteristics in impacting a machine learning model's predictions using SHAP values is known as variable importance using SHAP.The values provide a means of quantifying the impact of every parameter on the model's output for a certain instance or estimate.First, we calculated SHAP values for the XGBoost model.This involved running the model on the dataset and generating SHAP values for each instance.Once SHAP values for all instances were calculated, we aggregated them to calculate the overall impact of each feature across the dataset.After aggregating SHAP values, we ranked the features based on their absolute SHAP values.Features with higher absolute SHAP values were considered more important, as they had a greater impact on model predictions.The visualization of variable importance was performed using plots such as SHAP summary plots or bar charts.These plots show the relative importance of each feature in influencing model predictions.

LIME: Local Interpretable Model-Agnostic Explanations (LIME) is a post hoc local explanation technique which explains individual predictions based on any black
box machine learning model in the region of a prediction with instances requiring explanation using locally interpretable models (decision trees, linear models, etc.) [19].The LIME method works by altering the input sample slightly and tracking any changes in the black box model's output, assessing the extent to which various factors influence the forecast outcomes by determining the degree of modification [20].By making little adjustments to its parameters, LIME will produce slightly different versions of the training data (perturbations).We modified the assessed instances by making changes to other features and keeping one feature the same.Then, the model was trained on the perturbed instances and their corresponding predictions from the original complex model.We assessed the importance of different features in the interpretable model to understand which aspects of the instance are most influential in the prediction.Finally, we used the interpretable model to explain why the original complex model made its predictions for the selected instances.This explanation is usually given in terms of the contribution of different features.
PDP: In linear regression, the sign of the coefficient makes it simple to identify the link between the target and a feature.The links between the variables in a machine learning model and the target are identified using the Partial Dependence Plot (PDP) technique.It displays the small impact that one or two characteristics will have on the expected result.It displays whether there is a linear, monotonic, or more complex relationship between a feature and the target.Likewise, J. H. Friedman introduced PDP, and this is widely used in machine learning modeling [21].PDP demonstrates how individual features affect the prediction outcomes of a machine learning model and provides a way to illustrate the connection between variables and prediction results [22].

Mechanical Testing and Machine Learning Model
Based on the design of the experiments, the parameter settings for 16 runs, performed with three samples each, are presented in Table 2.The findings of mechanical testing, i.e., ultimate tensile strength (UTS), flexural strength (FS), and impact strength (IS), are tabulated for each experimental run in the same table.A biocomposite with 5% BC, 0.3 LT, 100% ID, 30 RA, and cubic IP exhibits a maximum UTS of 36.95MPa.On the contrary, the pure PLA resulted in a maximum FS of 68.66 MPa with a line pattern.The addition of 1% BC to PLA increased the IS by approximately 53% compared to pure PLA.
Table 2 also shows the XGBoost model's predictions for the UTS, FS, and IS values for each experimental run.Also, readings with maximum UTS, FS and IS are given in bold.The model exhibits outstanding predictive performances, achieving an R-squared value of 0.96 for UTS, one of 0.95 for FS, and one of 0.85 for Impact IS.For training data, the absolute mean error values are 1.16, 1.7 and 1.7 for UTS, FS, and IS, respectively.For testing data, the absolute mean error values are 2.29, 3.33 and 2.96 for UTS, FS, and IS, respectively.
The hyperparameter tuning process played a crucial role in achieving these results.By employing techniques such as RandomizedSearchCV, we systematically explored a range of hyperparameters to identify the optimal combination for minimizing the MSE and enhancing model generalization.This careful tuning ensured that the model not only fitted the training data well but also performed effectively on unseen test data, thereby reducing the risk of overfitting.

SHAP Analysis
The y-axis in Figure 3 displays all the attributes, while the x-axis represents the SHAP value.Each feature and prediction have a SHAP value that corresponds to each point on the chart.Red indicates a characteristic with a higher value.Blue indicates a feature with a lower value.SHAP analysis provides useful insights into the intricate connections between process parameters and mechanical properties of 3D-printed biochar-reinforced PLA composites, which are detailed below.
Infill density (ID) significantly increased tensile, flexural, and impact strengths, highlighting the relevance of void reduction and material density.Higher values of ID (≥0.8) resulted in higher UTS and FS, as well as to ID being identified as the second most important feature for IS.Lower values of ID (≤0.6) led to a reduction in UTS and FS.Higher ID means more material and reduced void in the structure, which means greater load-bearing capacity.Hence, the strength increases with the increase in the ID value.
Layer thickness (LT) had a significant impact on the strength of the 3D-printed composite material.An LT value of 0.3 mm resulted in a higher UTS and FS, while other values resulted in a lower UTS and FS.An LT value of 0.1 mm resulted in a higher IS, whereas other values were linked to a lower IS.However, as per Figure 3c, it can be seen that the contribution of LT is lower in the case of IS.As per the literature, a finer layer thickness is expected to enhance layer adhesion and improve mechanical strength [23].However, these findings imply that there cannot be generalization.Each mechanical property has an optimum LT value.
The addition of biochar (BC) as a reinforcing agent in PLA had less influence on UTS (see Figure 3a) and FS (refer Figure 3b), but its impact on IS was found to be the highest (refer Figure 3c).BC showed a nonlinear effect on mechanical properties.The average value of BC (=3%) enhanced the UTS of the composite, but lower and higher BC content resulted in lower UTS.In the case of IS, the BC content had a positive impact, except at 5%.Due to the addition of the BC, IS increased significantly.This effect may be attributed to increased interfacial bonding between BC and PLA materials.However, with a higher BC content, the increased voids resulted in a reduction in the energy absorbance capacity of the composite.These results suggest that the optimal value of BC, i.e., the amount of reinforcement required, differs for individual mechanical properties.
From Figures 3 and 4, it can be seen that the effect of raster angle (RA) is nominal in the cases of FS and IS.However, the contribution of RA to UTS is significant.At lower values of RA (≤45), UTS increased considerably.RA represents the orientation of the depositing layer.The proper alignment of the printed layer with respect to the loading direction results in increased strength.For example, with a 0 • RA, the printed layers coincide with the tensile loading direction, which means increased load bearing capacity.So, to increase the strength of the 3D structure, the RA value should move in the direction of the applied load.
Figure 3a shows that the line pattern (IP = 3) resulted in lower UTS values whereas the octate pattern resulted in higher UTS values.The SHAP values of all IPs are near zero and clustered together for FS and IS (refer to Figure 3b,c), suggesting that IP has a lower influence on FS and IS.Additionally, Figure 4 indicates that the mean SHAP value is consistently low compared to other process parameters for strength.The IP structure is likely to affect the stress distribution and energy absorption capabilities of the material, but the SHAP analysis suggests that this effect is negligible compared to the other process parameters.Figure 3a shows that the line pattern (IP = 3) resulted in lower UTS values whereas the octate pattern resulted in higher UTS values.The SHAP values of all IPs are near zero and clustered together for FS and IS (refer to Figure 3b,c), suggesting that IP has a lower influence on FS and IS.Additionally, Figure 4 indicates that the mean SHAP value is consistently low compared to other process parameters for strength.The IP structure is likely to affect the stress distribution and energy absorption capabilities of the material, but the SHAP analysis suggests that this effect is negligible compared to the other process parameters.In the SHAP summary plot (see Figure 4), features are ranked according to their influence on the model's predictions.The average absolute SHAP value for each characteristic, which shows their overall impact, is represented by the x-axis.For UTS, ID emerges as the most critical feature, significantly influencing the model's predictions.The remaining features have relatively similar importance levels, although they are less impactful than ID.In the SHAP summary plot (see Figure 4), features are ranked accord fluence on the model's predictions.The average absolute SHAP value for istic, which shows their overall impact, is represented by the x-axis.For U as the most critical feature, significantly influencing the model's prediction ing features have relatively similar importance levels, although they are than ID.
For FS, ID again stands out as the most important feature, with a notab value of +5.8.This indicates a strong positive impact on FS predictions.Fo For FS, ID again stands out as the most important feature, with a notable SHAP mean value of +5.8.This indicates a strong positive impact on FS predictions.Following ID, LT, BC, RA, and IP are the next most important features, respectively.Regarding IS, BC is identified as the most influential feature, followed by ID, LT, RA, and IP.This ranking suggests that BC plays a crucial role in determining IS, with other features also contributing, but to a lesser extent.Each of these features has a positive SHAP value, signifying their positive contribution to FS.Overall, for all output features (UTS, IS, and FS), the input features (ID, LT, BC, RA, and IP) positively impact the model's predictions.This consistent positive influence, as reflected by the SHAP values, underscores the significance of these features in enhancing the mechanical properties of 3D-printed specimens.The detailed analysis provided by SHAP values aids in understanding the complex relationships between input parameters and their effects on the output features, facilitating more informed decision making in the optimization of additive manufacturing processes.

Lime Analysis
Figure 5 showcases a LIME explanation for the 4th instance in the test dataset, created using an XGB regressor.This detailed explanation is presented in a tabular format (see Table 3) and includes three key pieces of information, given from left to right: the model's predictions, the feature contributions, and the actual values for each feature.In the feature contribution plot derived from LIME analysis (refer Figure 5), the features highlighted in blue indicate a negative contribution to the prediction, meaning they decrease the prediction score.Conversely, the features highlighted in orange indicate a positive contribution, meaning they increase the prediction score.
meaning they increase the prediction score.
For this specific instance, where BC is 3, ID is 1, RA is 45, LT is 0.1, and IP is 2 (triangle), the LIME explanation plot reveals how these features impact the prediction of various mechanical properties.For UTS, the IP, LT, and BC parameters positively influence the prediction, pushing the score higher.Among these, the feature IP has the most significant contribution, with the highest LIME value, indicating its strong positive effect on the predicted UTS value.Regarding FS, the feature BC contributes positively, pushing the FS value up, while the other features contribute negatively, lowering the FS value for this instance.This suggests that, in this particular case, BC is the primary driver of a higher FS value.In the case of IS, BC, RA, and LT have positive contributions, increasing the IS value.However, ID and IP contribute negatively, reducing the IS value.This indicates that while BC, RA, and LT enhance the predicted IS, the effects of ID and IP counteract this increase.
All things considered, the LIME explanation plot offers a thorough grasp of how various features contribute to the model's predictions in this particular case.It highlights the varying degrees of positive and negative impacts of each feature, providing insightful information about the model's decision-making process.This detailed analysis is crucial for interpreting and validating the model's predictions, especially in the context of optimizing additive manufacturing processes.In the LIME analysis, instances are modified by systematically altering various features while keeping one feature constant to observe its impact on the prediction for all output features.This approach involves generating perturbed instances and then training the model on these instances using the corresponding predictions from the original, complex model.This process helps in assessing the importance of different features in the interpretable model, providing insights into which aspects of the instance are most influential in the prediction.Table 3 presents the LIME values for UTS, FS, and IS under different input conditions.We can ascertain each feature's contribution to the model's mechanical property predictions by looking at the LIME values.For this specific instance, where BC is 3, ID is 1, RA is 45, LT is 0.1, and IP is 2 (triangle), the LIME explanation plot reveals how these features impact the prediction of various mechanical properties.For UTS, the IP, LT, and BC parameters positively influence the prediction, pushing the score higher.Among these, the feature IP has the most significant contribution, with the highest LIME value, indicating its strong positive effect on the predicted UTS value.Regarding FS, the feature BC contributes positively, pushing the FS value up, while the other features contribute negatively, lowering the FS value for this instance.This suggests that, in this particular case, BC is the primary driver of a higher FS value.In the case of IS, BC, RA, and LT have positive contributions, increasing the IS value.However, ID and IP contribute negatively, reducing the IS value.This indicates that while BC, RA, and LT enhance the predicted IS, the effects of ID and IP counteract this increase.
All things considered, the LIME explanation plot offers a thorough grasp of how various features contribute to the model's predictions in this particular case.It highlights the varying degrees of positive and negative impacts of each feature, providing insightful information about the model's decision-making process.This detailed analysis is crucial for interpreting and validating the model's predictions, especially in the context of optimizing additive manufacturing processes.In the LIME analysis, instances are modified by systematically altering various features while keeping one feature constant to observe its impact on the prediction for all output features.This approach involves generating perturbed instances and then training the model on these instances using the corresponding predictions from the original, complex model.This process helps in assessing the importance of different features in the interpretable model, providing insights into which aspects of the instance are most influential in the prediction.
Table 3 presents the LIME values for UTS, FS, and IS under different input conditions.We can ascertain each feature's contribution to the model's mechanical property predictions by looking at the LIME values.
In LIME analysis, the model is trained on these perturbed instances, using their corresponding predictions from the original complex model.We assessed the importance of using different features in the interpretable model to understand which aspects of the instance are most influential in the prediction.The following are our observations.

•
BC: a lower biochar content (≤3.00) positively influences all three-strength metrics.A higher biochar content (>3.00) negatively impacts these strengths.These insights can guide process optimization in additive manufacturing, enabling the adjustment of parameters to achieve desired mechanical properties in 3D-printed specimens.The following are the optimized parameters resulted through the LIME analysis for achieving maximum strength for the local instance under consideration.

PDP Analysis
PDP plots were used to visualize the relation between the continuous variables and the projected probability of FS, IS, and UTS.PDP is used to investigate the interaction of individual process parameters and various mechanical strengths.These relationships are depicted in Figure 6.It is evident from Figure 6 that there is a nonlinear relationship between each variable and the predicted UTS, FS, and IS values.This nonlinearity indicates that the response of the mechanical strengths to changes in process parameters is not straightforward, but rather varies in a complex manner across the range of the parameters.The pick point in each plot corresponds to the optimum value of the corresponding process parameter.The optimum values of process parameters to maximize the respective strengths are obtained from PDP and are listed in Table 4.The table provides a straightforward reference for setting the process parameters to their optimum levels to enhance the mechanical strengths of interest.

Conclusions
This study investigated how the different FDM-based 3D printing process parameters affected the mechanical properties of pure PLA and biochar-reinforced PLA composites using machine learning and explainable AI techniques.The key process parameters under investigation were biochar content (BC), layer thickness (LT), raster angle (RA), infill pattern (IP), and infill density.Mechanical testing was carried out on the 3D-printed test samples, and we measured the ultimate tensile (UTS), flexural (FS), and impact (IS) strengths.The XGBoost (XGB) algorithm was used to build the prediction model.The results demonstrate the superiority of the XGBoost algorithm, with a coefficient of determination value of 0.96 used for UTS.Three explainable AI (XAI) techniques, namely, SHAP, LIME, and Partial Dependence Plots (PDPs), were utilized to provide insights into the interaction of the process parameters with the various mechanical strengths.The results of XAI are summarized as follows:  All features are positively correlated, but ID is the most significant parameter, as illustrated by the SHAP mean plot of the XGB.


A density of 80% resulted in increased mechanical strength while still saving on material quantity.The optimum values of process parameters to maximize the respective strengths are obtained from PDP and are listed in Table 4.The table provides a straightforward reference for setting the process parameters to their optimum levels to enhance the mechanical strengths of interest.

Conclusions
This study investigated how the different FDM-based 3D printing process parameters affected the mechanical properties of pure PLA and biochar-reinforced PLA composites using machine learning and explainable AI techniques.The key process parameters under investigation were biochar content (BC), layer thickness (LT), raster angle (RA), infill pattern (IP), and infill density.Mechanical testing was carried out on the 3D-printed test samples, and we measured the ultimate tensile (UTS), flexural (FS), and impact (IS) strengths.The XGBoost (XGB) algorithm was used to build the prediction model.The results demonstrate the superiority of the XGBoost algorithm, with a coefficient of determination value of 0.96 used for UTS.Three explainable AI (XAI) techniques, namely, SHAP, LIME, and Partial Dependence Plots (PDPs), were utilized to provide insights into the interaction of the process parameters with the various mechanical strengths.The results of XAI are summarized as follows: • All features are positively correlated, but ID is the most significant parameter, as illustrated by the SHAP mean plot of the XGB.• A density of 80% resulted in increased mechanical strength while still saving on material quantity.

•
In contrast to the literature, this study suggests that 0.3 mm of LT improves the UTS and FS values.

•
Based on the PDP analysis, it can be said that a 30 • raster angle is optimum for enhancing the mechanical strengths.• The influence of BC was most dominant for IS, and 3% BC resulted in maximum UTS.

•
SHAP and PDP reveal that IP has a negligible impact on the mechanical strength of the 3D-printed specimens.• As the relationship between features and the target variable is complex and nonlin- ear, boosting ML models such as XGB can capture these relationships better than linear models.• To enhance mechanical properties of 3D-printed parts, this study suggests that the optimum process parameters are as follows: 0.3 mm LT, 1-3% BC, 30 • RA, 80% ID and Octate IP.
This study was limited to specific process parameters; in the future, the impact of additional process parameters like nozzle temperature will need to be explored.The dataset used for machine learning was relatively small; hence, the result limits generalization.Overall, this study emphasizes the potential for combining machine learning and explainable AI techniques to optimize and understand the impacts of process parameters on the mechanical properties of 3D-printed composites.

Figure 1 .
Figure 1.The framework outlines the steps in the implementation of explainable AI for the present research work.

Figure 1 .
Figure 1.The framework outlines the steps in the implementation of explainable AI for the present research work.

Figure 2 .
Figure 2. Standards and dimensions used for tensile, flexural, and impact tests of FDM-based printed specimens.

Figure 2 .
Figure 2. Standards and dimensions used for tensile, flexural, and impact tests of FDM-based 3D printed specimens.

Figure 4 .
Figure 4. Variable importance of XGBoost model based on training set for (a) UTS, IS.

Figure 4 .
Figure 4. Variable importance of XGBoost model based on training set for (a) UTS, (b) FS and (c) IS.

Table 1 .
FDM 3D-printing process parameters and corresponding settings.

Table 1 .
FDM 3D-printing process parameters and corresponding settings.

Table 3 .
Understanding the relationship between conditions and material properties through LIME analysis.

Table 4 .
Optimum process parameters resulted from PDP.

Table 4 .
Optimum process parameters resulted from PDP.