1. Introduction
Polymer foams are used extensively for their mechanical properties, energy-absorption capabilities, low weight, exceptional cushioning qualities, and excellent insulating behavior [
1,
2]. Polymer foam can be defined as a two-phase system that consists of gas bubbles dispersed into a polymer matrix [
3]. It has a wide range of application areas, including the automotive industry [
4], engineering materials [
5], packaging [
6], thermal insulation [
7,
8], protection [
9], housing decoration, mattresses, furniture, and electronic devices [
10]. As polymer foams undergo large deformation under compression, understanding their mechanical behavior, especially deformation under different loading conditions, is crucial [
10,
11,
12]. Functionally graded materials are inhomogeneous composites with modifiable features that are now employed extensively across a variety of industries [
13]. Foam materials with varying degrees of functionality have been demonstrated to work well in shock-absorbing applications [
14,
15]. Recent studies have also asserted that these foam features can be significantly influenced by foam structure and morphology such as spatial distribution and gradient of cell size [
16,
17]. An asymmetric spatial feature can produce better mechanical and thermal-insulation outcomes, which can make them beneficial in a range of applications, such as impact resistance, high strength at low weight, and thermal or sound insulation [
14,
18]. It has been demonstrated that the use of functionally graded foam materials offers high performance in applications requiring compression resistance and shock absorption [
14,
15].
One important application of foam polymer is in the design of custom mattresses. As humans spend about one-third of their lives lying in bed, a custom mattress designed in accordance with body curvature and weight distribution is very important to relieve any back pain or discomfort [
19]. While designing a mattress, three aspects are considered: the shape and mass distribution of the human body, the mechanical properties of the material of the mattress, and the interaction between the human body and the material [
20,
21]. Another prospective application is footwear due to the high impact load repetitively exerted on the feet, which is several times greater than body weight [
22]. The use of proper footwear cushioning is necessary to prevent repetitive stress injuries since the high load is repeated during the walk [
22,
23]. Additionally, the right footwear can enhance exercise comfort and performance. Hence, with the right design of functionally graded foam materials, it is possible to create useful ergonomic items such as shoe soles. The soles of shoes should be lightweight and have adequate shock absorption and endurance [
24,
25]. Contemporary sports footwear is engineered to alter the viscoelastic midsole, which is commonly comprised of polymeric foam to reduce mechanical stress waves [
26]. Similarly, athlete safety and the prevention of injuries are both crucial, which is why different foam constructions are employed for many areas in protective gear or for surfaces where sports activities can be practiced safely [
2,
22].
The drawback of foam materials, however, is that they are stochastic and have a random microstructure [
27]. As the microstructure of these foam materials plays a crucial role in their global behavior and properties, researchers have tried to find predictable alternatives for foams [
28,
29]. Lattice structures, in particular, are the subject of substantial research due to their multi-functional properties, including load carrying [
30], energy absorption [
31], heat exchange [
32], and building materials [
33]. They are created by duplicating mesoscale unit cells in three dimensions. They offer extreme design freedom to alter the geometries of unit cells in order to attain desired macro-scale material attributes for a variety of applications [
34]; however, producing these complex and intricate lattice structures can be infeasible using conventional manufacturing processes, in which case, the need for advanced manufacturing comes into play [
35].
Additive manufacturing (AM), also known as 3D printing, is a cutting-edge technology that enables the production of complex geometries and near-net-shape components with minimal raw material consumption [
36,
37,
38,
39]. Utilizing the benefits of 3D-printing technology, functionally graded lattice materials can be manufactured with a uniform and ordered structure, and their unit cells can be manipulated and optimized to achieve the desired mechanical properties for a specific application [
40,
41]. Three-dimensional printed polymeric lattice structures have been studied for their uses in energy absorption [
31], building materials [
33], enhanced ductility [
42], and mechanical properties [
43].
A wide variety of factors can significantly impact the behavior of the 3D-printed lattice parts, which would, in turn, affect their mechanical behaviors. Therefore, understanding the relation between the lattice structural parameters and mechanical performance, such as stiffness, is of vital importance for the optimization of the lattice design [
44]. In this context, machine learning (ML), a subset of artificial intelligence (AI), plays a vital role by analyzing the hidden links and patterns within a given dataset. ML uses data analysis to recognize patterns and connections, enabling it to perform specific functions. ML algorithms have a greater ability to detect non-linear interaction between the parameters of an AM process, and mechanical properties such as deformation, compared to conventional methods. AI- and ML-based tools play a crucial role in hastening the advancement of new materials, production methods, and processes [
45]. The methods are divided into supervised learning, where the algorithm picks up knowledge from labeled training data and assists in making predictions for unforeseen data, and unsupervised learning, where the algorithm defines how to establish relationships between features of interest by working with unlabeled data [
45]. Building connections and drawing conclusions from data, systems, or frameworks, with the ability to automatically learn and improve without explicit programming, can be facilitated using ML techniques [
46]. In this study, a number of lattice structures were designed and computational analyses were performed to understand the effect of lattice geometries on their mechanical stiffness. Then, different ML algorithms were evaluated to study their performance.
4. Evaluation of ML Models
For analyzing and interpreting results, it is crucial to report the values of these error metrics to demonstrate the performance of a model. Selecting which measures to report depends on the research question, the type of data, and the specific analysis conducted. The results of training five ML algorithms concerning their error metrics for the training and testing phases are shown in
Table 7.
The results presented in
Table 7 indicate that the prediction errors for the metrics MSE, RMSE, and MAE are remarkably low during both the training and testing phases for all ML models. This leads to the creation of a dependable and credible model for each of the ML algorithms used. Furthermore, the LR and PR algorithms exhibit similar accuracy levels. This can be attributed to the fact that the degree of order obtained with the PR algorithm is 1, which implies that the optimal model for our dataset under the PR algorithm follows a linear model, similar to that of the LR algorithm.
The Taylor diagram is a visual aid that is used to compare models or observations to a reference dataset in terms of correlation, variability, and bias on a single chart [
61]. The diagram is constructed using a polar coordinate system, with the actual dataset depicted as a point at the center. Each model is plotted as a point on the diagram, with the distance from the origin representing its correlation with the actual dataset and the angular position representing the ratio of standard deviations between the model and the actual dataset. The distance between a model and an actual dataset is visualized by arcs using RMSE. The closer a point is to the reference point, the better the model’s performance [
61]. The Taylor diagram in
Figure 4. illustrates the results of the comparison between the five ML algorithms in this study. The diagram plots the actual point, which represents the standard deviation of the test dataset, and each algorithm is represented by a point in the plot. The algorithm whose point is closest to the actual point on the diagram is ANN. As this plot demonstrates, ANN’s correlation is 0.93, which is followed by DT, which is 0.74. This indicates that the ANN model has a high correlation with the actual data in this research, and its RMSE is close to zero. Therefore, the Taylor diagram suggests that the ANN algorithm outperformed the rest of the ML algorithms in this study. As mentioned before, LR and PR provide identical outcomes, so their overlap in the Taylor diagram is also evident.
Nevertheless, while the correlation of ANN may be satisfactory, there are various approaches that can enhance the predictive capabilities of ML models. This study employed hyperparameter tuning as a means to reduce overfitting and enhance the accuracy of the models; however, an additional method to enhance prediction accuracy is to collect more data. The utilization of a broader and more representative sample in training models helps to alleviate the issue of overfitting. Furthermore, the process of identifying and selecting the features that are most relevant has the potential to enhance the precision of the prediction. The simplification of the model and enhancement of accuracy can be achieved by eliminating irrelevant or redundant features [
62].
This research also utilized the relative error box plot to evaluate the accuracy of ML algorithms in predicting a model. This plot measures the percentage difference between the predicted value and true value. This is an important tool for assessing the precision of a model’s predictions. It can be used to compare different ML algorithms for a given dataset [
63].
In this study, the box plot of relative error for each ML algorithm is presented in
Figure 5, with the results indicating that the median value for the ANN algorithm was the lowest in comparison with other ML models. The ANN algorithm also exhibited a smaller interquartile range, indicating that its errors were more consistent across different data points. Conversely, the LR and PR algorithms had several error values falling outside of the box which are shown in diamond shape, indicating difficulties in accurately predicting certain types of data points. Additionally, the narrower box plot of the ANN algorithm suggests a more tightly clustered distribution compared to other algorithms.
Moreover,
Figure 6 illustrates a comparative analysis of ML algorithms, focusing on their performance in predicting actual values vs. predicted values throughout the training and testing phases. It shows the superior performance of ANN compared to other algorithms. It is worth mentioning that the ANN model consistently demonstrates the highest level of agreement between observed and forecasted values, thus confirming its effectiveness as the preferred algorithm for precise predictions within this particular framework, other than the ML algorithms for this research. The presented visual evidence serves to emphasize the importance of this study’s findings and the potential implications of employing ANN in practical scenarios that require accurate prediction.
The SHapley Additive exPlanations (SHAP) method, initially proposed by Lundberg and Lee [
64], was also utilized in this study to determine the individual contributions of each feature. This methodology, based on co-operative game theory, improves the clarity and comprehensibility of ML models [
65]. In order to evaluate the importance of features within the entire dataset, this study employed a bee swarm plot. As depicted in
Figure 7a, the variables have been organized based on their global feature importance, with the most significant variables positioned at the top and the least significant variables positioned at the end. With the given dataset and the best ANN model in this study, it was observed that the lattice structure feature had a significant positive effect when its values were high, while its impact was relatively minor and negative when the values were low. The influence of the feature’s Z-axis on strain predictions was found to be minimal, regardless of whether its values were high or low. The reason for showing the lattice structure feature with a different color than other features in
Figure 7. is that this feature is a categorical feature while others are numerical.
Furthermore, the bar plot depicted in
Figure 7b illustrates that the order of features is determined by their absolute SHAP values, regardless of their impact on predictions, be they positive or negative. In conclusion, the most important features for strain in this study are lattice structure, thickness, Y, X, and Z, respectively.
5. Conclusions
In conclusion, this study successfully developed a strain prediction model for designing lattice structures for AM-processed ordered foam material ML algorithms. First, a dataset of 360 data points was generated from 29 types of lattice structures, by varying the thickness and cell size of those structures along the X, Y, and Z axes. Then, by utilizing that dataset and employing supervised learning methods in ML with regression models, the study was able to accurately predict the mechanical deformation of the lattice structures, namely, strain. The study compared the performance of five ML algorithms, including Linear Regression, Polynomial Regression, Decision Tree, Random Forest, and Artificial Neural Network, and found that the ANN algorithm outperformed the others. Evaluation metrics such as mean squared error, root mean squared error, and mean absolute error, showed remarkably low prediction errors during both the training and testing phases, indicating a dependable and credible model for each of the ML algorithms used. The visualization of the system’s output through the Taylor diagram and relative error box plot, and comparison between the actual and predicted values of training and testing phases, further confirmed the superiority of the ANN algorithm; moreover, this study used the SHAP method to evaluate feature importance across the dataset and its contribution to the predictions, which showed that lattice structure had a significant positive effect when values were high, while the Z-axis had minimal influence. Overall, the results of this study have important implications for the development of accurate and reliable strain prediction models for lattice structures in AM, which could contribute to improving the quality and efficiency of AM processes in various industries.