Introduction

Magnesium being the least heavy structural metal has emerged as a crucial element in the quest for lightweight materials in several industries. Due to its exceptional attributes, including outstanding machinability, high strength-to-weight ratio and acceptable damping qualities, it is highly regarded as a significant resource for industries aiming to reduce weight1. Despite being regarded as one of the superior lightweight metals with notable benefits, magnesium does have certain drawbacks including poor corrosion resistance, strength, elastic modulus, and ductility when compared to other metals. As a result, the advancement of magnesium alloys has become a crucial field of study and creativity. In order to address these constraints, magnesium is combined with different elements such as Al, Zn, Mg and certain rare earth metals2,3. The constraints have prompted the evolution of Metal Matrix Composites (MMCs), wherein reinforcing particles including metals, ceramics, carbides, oxides, etc., are included into the matrix phase. Friction Stir Processing (FSP) is a solid-state processing method that operates on the idea of friction stir welding. It is widely recognized for its ability to improve microstructure, achieve uniform reinforcement distribution and enhance the mechanical properties of materials4,5,6. FSP is particularly effective in producing defect-free metal matrix composites. FSP is performed by employing a rotating tool that produces heat by friction between the tool and the workpiece. This technique involves mechanical mixing of the material of the workpiece at temperatures lower than its melting point. This amalgamation induces considerable plastic deformation and dynamic recrystallization phenomena. As a result, a microstructural framework characterized by a homogenous and intricate texture is established, accompanied by augmented mechanical properties including elevated hardness, improved ductility, and enhanced wear resistance7,8. FSP involves the flow of material and plastic deformation, resulting in the production of certain regions. These regions include the stir zone (SZ), which is the area where material mixing occurs. The stir zone (SZ) is encircled by the thermomechanical affected zone (TMAZ) and the heat-affected zone (HAZ). The SZ is of paramount importance as it directly influences the material characteristics through significant plastic deformation induced by the tool’s stirring action.

Qin et al.9 carried innovative research in developing a Friction stir processed AZ31 magnesium hybrid composite using reinforcements such as nano MgO and nano hydroxyapatite. The investigators examined the influence of tool rotational velocity on the corrosion resistance, microstructure and mechanical properties of the hybrid composite. The analysis demonstrated a significant enhancement in the grain morphology of the stir zone (SZ), which was observed when employing elevated rotational speeds (6000 rpm) during friction stir processing (FSP). This improvement was due to dynamic recrystallization (DRX), which ultimately led in achieving the highest possible tensile strength (TS). The corrosion resistance trials demonstrated a significant improvement in the MMCs compared to the base matrix. This was evident through a decrease in the self-corrosion current density and an increase in the self-corrosion potential, indicating a higher resistance to corrosion. Dehong et al.10 examined the wear performance of AZ31 magnesium matrix composite reinforced with different mixes of nano-Al2O3 and carbon nanotubes (CNTs). The findings demonstrated that the composite reinforced with 0.3% of nano- Al2O3 exhibited superior wear resistance in comparison to the composite reinforced exclusively with 0.3% carbon nanotubes. The composite consisting of 0.1% Al2O3 and 0.2% CNTs exhibited notable improvements in wear resistance and a decrease in friction coefficient at loads greater than 1.95 MPa. Thus, the exceptional durability of this hybrid composite expands its possibilities for use in diverse industries.

A hybrid nanocomposite consisting of multi-walled carbon nanotubes (MWCNT), graphene and AZ31 magnesium alloy has been fabricated by Sharma et al.11 using FSP with varying tool rotation speeds. The reinforcement ratio was optimized using 1.6% volume of MWCNT and 0.3% volume of graphene. The velocity of tool rotation was systematically altered while maintaining the constancy of other processing parameters. The results showed a 19.72% increase in microhardness (from 64.6 to 80.4 HV) and a 77.5% increase in compressive strength (from 160 to 284 MPa) contrast to the base metal AZ 31 Magnesium alloy. SEM study revealed grain refinement strengthening as the primary factor contributing to the strength of the nanocomposite. Liu et al.12 enhanced the characteristics of the AZ31B Mg alloy, by introducing a combination of CeO2 and ZrO2 into the alloy using FSP. The outcome of this was the creation of hybrid AZ31B Mg/CeO2 + ZrO2 rare earth oxides reinforced composites, which was formed by different tool rotational speeds, with a maximum speed of 1200 rpm. The results indicated a notable reduction in the size of the matrix grains (from 7.39 μm to 3.38 μm) as a result of greater plastic deformation, dynamic recrystallization and the particles’ ability to hinder movement. The hardness was increased from 99 to 135 HV, the TS were increased from 172 to 228 MPa, and an improvement in wear characteristics was also accomplished. These enhancements were a result of eliminating defects, refining the magnesium grains, and uniformly distributing ZrO2 + CeO2 particles.

Smith at al13. evaluated the tribological behaviour and mechanical properties of AZ31 Mg alloy reinforced with hybrid silicon carbide and carbon nanotubes. The microstructural investigation demonstrated a consistent distribution of SiC and CNT particles inside the refined grain structure of the AZ31 matrix, resulting from significant plastic deformation and dynamic recrystallization during friction stir processing. The hybrid composite demonstrated a notable improvement in hardness (35%) and TS (20%) relative to the unprocessed AZ31 alloy. Wear testing revealed a significant decrease in wear rate, with the composite exhibiting enhanced wear resistance attributed to the synergistic interaction of hard SiC particles and the self-lubricating characteristics of CNTs. However, they observed reduction ductility with increase in vol% of the hybrid reinforcement. The microstructural development and effects of hybrid reinforcements, particularly TiC and CNTs, on the mechanical characteristics of AZ31 magnesium alloy made by FSP were studied by Patel et al.14. The treated hybrid composite’s grain size was considerably reduced from 30 μm (AZ31 alloy) to 5 μm, according to the microstructural examination. Grain refinement was found to be largely influenced by the pinning action of the TiC and MWCNTs as well as dynamic recrystallization during FSP. In comparison to the unprocessed AZ31 alloy, the hybrid composite showed a 30% improvement in ultimate TS and a 40% increase in yield strength.

ML has become increasingly vital in materials science due to its ability to model complex, non-linear relationships between input variables and output properties. In the context of metal matrix composites, especially magnesium-based systems, traditional experimental methods to study wear, hardness and tensile strength are time-consuming, resource-intensive, and often limited by parameter interactions. ML models such as Support Vector Machines, Decision Trees, and Random Forests have demonstrated high accuracy in predicting material behavior even with relatively small datasets15,16,17,18,19,20. Moreover, the integration of interpretable ML tools enables deeper insights into variable importance, facilitating the optimization of process parameters. Thus, the use of ML in our study is not only justified by its predictive power but also by its ability to reduce experimental costs and accelerate material development.

Aydin et al.21 engineered ZK60 magnesium matrix composites with varying concentrations of cerium dioxide (from 0.25 to 1 wt%) utilizing a powder metallurgy technique. The tribological behavior of the specimens was scrutinized under applied loads of 5, 10, 20, and 30 N, at sliding velocities of 75, 110 and 145 mm/s. The deteriorated surfaces, wear debris, and counterface materials were analysed to elucidate the underlying wear mechanisms. The predictive efficacy of five distinct machine learning algorithms was assessed using an authentic experimental dataset. The Decision Tree algorithm accurately forecasted the test and validation metrics, attaining 85% and 99% accuracy, respectively.

The significance levels of the input parameters were elucidated through the application of three machine learning algorithms. The forecast of volume loss was predominantly governed by the load parameter. Recently, Kumaraswamy et al.22 explored the wear behavior and COF of nickel-titanium dioxide-alumina composites with varying proportions of alumina (3, 6, 9 and 12 wt%) while maintaining a constant titanium dioxide content of 9 wt%. The variables scrutinized in the wear analysis encompassed sliding distances (1500, 1000 and 500 m), applied loads (25, 50 and 75 N), and sliding velocities (1.46, 2.93 and 4.39 m/s). The pin-on-disc apparatus was utilized to conduct various wear tests in as per Taguchi L27 orthogonal array. The ML methodologies employed to correlate predicted and actual values for both measures exhibited robustness, with an acceptable margin of error. The Mean Squared Error (MSE) for the wear rate was recorded at 0.1025 (10.25%) in the Linear Regression (LR) model and 0.2390 (23.89%) in the RF model. Regression analysis was employed to evaluate the impact of various parameters on the wear rate, while ML techniques augmented the investigation of wear rate and COF beyond traditional empirical data. The findings underscore the effectiveness of integrating Taguchi methodologies with ML to predict wear mechanisms in Ni-Cu alloy composites accurately.

Xue et al.23 developed a machine learning framework to predict the mechanical properties of graphene-reinforced aluminum alloy composites. Using a curated dataset of composition and processing variables, multiple ML models were trained, with Cat Boost achieving superior accuracy (R² = 0.9882 for tensile strength and 0.9597 for hardness). The SHAP method provided interpretability by identifying influential parameters. All models demonstrated prediction errors within 10%, indicating high generalization capability. This study highlights the potential of interpretable ML for designing high-performance Al-based composites.

Song-Jeng Huang et al.24 investigated the wear behavior of AZ-series magnesium matrix composites reinforced with hybrid fillers like boron carbide (B₄C) and graphene nanoplatelets (GNPs). It was shown that adding more reinforcement (up to 4 wt%) makes wear resistance much better. The amount of wear is mostly affected by the load and the distance the object slides. Taguchi-based analyses show that load is the most important factor. SEM analysis shows that wear can go from abrasive to adhesive depending on the conditions. In addition, machine learning models, especially polynomial regression (R² ≈ 0.953, RMSE ≈ 0.103), were very good at predicting wear rate based on factors like reinforcement %, load, sliding distance and speed.

Ammisetti et al.25 examined the tribological behavior of AZ31 magnesium matrix composites reinforced with B₄C and graphene nanoplatelets (GNPs). Using Taguchi design of experiments, they found that applied load had the most significant effect on wear rate, followed by sliding distance, reinforcement percentage and velocity. SEM analysis revealed distinct wear mechanisms under minimum and maximum wear conditions. Among various machine learning models, polynomial regression achieved the highest prediction accuracy for wear rate with an R² of 0.953 and RMSE of 0.103.

The literature indicates that there is no research on the prediction of wear characteristics for AZ31/NbC and ZrC reinforced hybrid composites. Thus, the present study aims to create an AZ31 hybrid composite using FSP by adding different compositions (4, 8, 12) vol% of NbC and ZrC hybrid reinforcements. This study investigates the influence of these reinforcements on the mechanical and tribological properties of the composite. An in-depth analysis has been carried out to study the mechanical properties and microstructure of the composites. The findings have been compared to the AZ31 alloy and the results have been discussed. Three ML algorithms: Random Forest (RF), Decision Tree (DT) and linear regression, were employed to predict the wear behavior of the AZ31/NbC and ZrC hybrid composite.

Materials and methods

Materials and test procedures

In the present study, AZ31 magnesium alloy plates (100 mm × 100 mm × 6 mm) with a chemical composition of Mg-3 wt% Al-1 wt% Zn are used as the base metal. Niobium carbide (NbC) and Zirconium carbide (ZrC) particulates with mean particle size of 5 to 10 μm were used as reinforcement. The FSP technique was employed to fabricate AZ31BMg/(NbC and ZrC) hybrid composites incorporating varying volumetric percentages of particles, specifically 4%, 8% and 12%, as delineated in Table 1. The process parameters are also detailed in Table 2. The FSP technique entails the creation of a rectangular groove on the AZ31 plate through wire EDM. The groove was filled with the required vol% of NbC and ZrC particles. Next, the FSP processing begins with the use of a pin-less H13 tool—featuring a 16 mm flat shoulder and no protruding pin—to close the groove. A WC cylindrical tapered profile pin tool is used for three pass FSP. The tool has a shoulder diameter of 16 mm, a length of 4 mm and a pin shoulder diameter of 4 mm. The traversal speed was set at 20 mm/min, the rotation speed at 1200 rpm and an applied force of 4 kN was used. The axial force of 4 kN was measured using the machine’s integrated load sensor during FSP. The FSP three passes was used to synthesize these hybrid composites. The synthesized composites were sectioned utilizing the electrical discharge machining (EDM) wire cutting technique to obtain specimens for tensile evaluation, wear assessment, microhardness determination and microstructural analysis. The cross sectioned composites were subjected to metallographic preparation through grinding and polishing. After fine polishing, the composite samples were etched with a solution consisting of 25 ml water 25 ml acetic acid (CH₃COOH) and 100 ml ethanol, 2.5 g ((O₂N)₃C₆H₂OH) picric acid. The microstructures of the produced hybrid composites were analysed using a scanning electron microscope (SEM) and optical microscope. Grain size was measured using the linear intercept method on Optical images taken from the centre of the stir zone (SZ), where maximum material mixing and refinement occurs.

The tensile strength of hybrid composite was evaluated using the ASTM E8M standard without any modifications. A speed of 1 mm/min was measured using an INSTRON 5500R universal tensile machine. The Vickers hardness of the composite materials was measured using a Mitutoyo MVK-H11 tester under a constant load of 50 g with a dwell time of 15 s following the guidelines specified in the ASTM E 384 standard. Dry sliding wear experiments on the hybrid composites were conducted using a DUCOM pin-on-disc tribometer (Model: TR-20LE) with a cylindrical pin of 10 mm diameter. The applied normal load ranged from 15 N to 60 N, while the sliding velocity was varied between 1 m/s and 3 m/s to evaluate the wear behavior under different operational conditions. The wear rate of the hybrid composite was determined by dividing the wear loss by the constant sliding distance 1500 m. A scanning electron microscope (Zeiss Gemini 300 FE-SEM) was used to analyze the worn debris and surfaces of the composites in order to further investigate the wear behaviour of the composite.

Table 1 Composition of reinforcements in metal matrix Composites.
Table 2 Friction stir process parameters.

Machine learning models

Figure 1 shows an organized workflow in predicting wear rate and friction coefficient through machine learning regression models. The workflow starts with collecting a Wear Rate & COF dataset, after collecting dataset is fed into the data pre-processing phase. In data pre-processing stage where categorical features (e.g., material type) are encoded through a Label Encoder and numerical features are standardized through Standard Scaler to provide equal feature scaling. Following the preprocessing stage, the dataset is partitioned into training and testing subsets in a proportion of 80:20, thereby facilitating the model’s ability to discern patterns from the training data while reserving a fraction for evaluative purposes. Three regression models used to predict the target variables are LR, DT Regressor and RF Regressor. These models are selected based on their unique capabilities: Linear Regression to comprehend linear relationships, DT to recognize intricate patterns and RF to prevent overfitting and improve accuracy through ensemble learning.

The efficacy of the model is evaluated concerning standard regression indicators: MSE (Mean Squared Error), R² (coefficient of determination), MAE (Mean Absolute Error) and RMSE (Root Mean Squared Error). These parameters give an insight into the model’s accuracy, error distribution and predictive capacity. Figure 1 clearly depicts the step-by-step process of model construction and testing for regression model development in prediction of wear rate and friction coefficient, thereby giving a systematic framework for model choice and performance determination.

Fig. 1
figure 1

Block diagram illustrating the key phases of a machine learning workflow.

Linear regression (LR)

LR is a most popular regression method used for the prediction of numerical values from linear relationships among dependent and independent variables. It assumes that there exists a linear relationship between material properties, sliding velocity, applied load and resulting wear rate and friction coefficient. The main strength of Linear Regression is its interpretability and computational speed, which is best for datasets where wear rate and friction coefficient have linear relationships with input features. Its weakness is when non-linear relationships or material property interactions are involved, where more sophisticated models are needed to achieve superior predictive accuracy.

Decision tree regressor (DT)

Decision Tree Regression is a rule-based, non-linear algorithm that splits the data set recursively into subsets depending on feature conditions, creating tree-like structure. It is best suited for identifying non-linear relationships and interactions among input variables, making it a suitable option for model complex relationships of wear rate and friction coefficient. Unlike Linear Regression, Decision Trees make no assumption of linearity, which makes them flexible enough to fit any kind of wear conditions in different materials and load applications. However, Decision Trees suffer from overfitting, particularly with small datasets, because they have the tendency to memorize training data instead of good generalization to new, unseen data.

Random forest regressor (RF)

RF is an ensemble learning strategy that constructs a plurality of Decision Trees and merges the resulting predictions to enhance the accuracy and simplification of the model. Through aggregating the results of an ensemble of trees, Random Forest mitigates overfitting, producing a stronger and more stable model. This renders Random Forest well-suited for wear rate and friction coefficient prediction, where material properties variations and ambient conditions involve noise in data. Random Forest’s capacity to deal with non-linearity, high-dimensional data, and feature interactions is a strong advantage for this application. Still, its computing cost is more than that of models like Linear Regression.

Results and discussion

Microstructural characterization of composites

Figure 2a-c shows the microstructure of the hybrid composites HC-1, HC-2 and HC-3 respectively. The microstructure shows uniform distribution of NbC and ZrC particles in AZ31 matrix without any clustering. Uniform distribution of hybrid particles will significantly improve the mechanical strength of the composite. Figure 2d presents the XRD patterns of the hybrid composites (HC-1 to HC-3). The diffraction peaks confirm the presence of magnesium (Mg) along with the reinforcement phases niobium carbide (NbC) and zirconium carbide (ZrC) in all three composites. The absence of any additional peaks indicates that no undesirable interfacial reactions occurred between the reinforcements and the AZ31 matrix during the friction stir processing. Figure 3 illustrates the grain morphology of the base AZ31 magnesium alloy (Fig. 3a) alongside the hybrid composites HC-1, HC-2, and HC-3 (Figs. 3b–d, respectively). The as-received AZ31B alloy displays coarse grains with an average size of approximately 60 μm (Fig. 3a and e). Notably, a significant refinement in grain structure is observed following Friction Stir Processing (FSP), attributed to the dynamic recrystallization mechanism activated during processing. This refinement culminates in the formation of fine, equiaxed grains with an average size close to 6 μm in the HC-3 composite, as shown in Fig. 3d and e. The incorporation of fine NbC and ZrC particles into the AZ31 matrix appears to hinder grain coarsening, likely due to their grain boundary pinning effect, thereby promoting microstructural stability and refinement.

The FSP methodology is posited to engender plastic deformation alongside the progressive refinement of the grain size within the composite matrix. Qiao et al.26 observed the correlation between high-angle GB (HAGBs) in the ZrO2 reinforced magnesium composite, which fosters the formation of finely recrystallized grains. This observation underscores the occurrence of active dynamic recrystallization throughout the FSP process. The FSP technique promotes the formation of a significant amount of misoriented sub-grains and low-angle GB (LAGBs). Such microstructural configurations are particularly conducive to the onset of recrystallization phenomena. The transition of LAGBs into HAGBs through persistent dynamic recrystallization has been acknowledged as a catalyst for the transformation of diminutive nuclei into fully refined equiaxed grains27.

Fig. 2
figure 2

Microstructures of AZ31/(NbC–ZrC) composites: (a) HC-1, (b) HC-2, (c) HC-3, and (d) XRD pattern of the hybrid composite.

Fig. 3
figure 3

Optical micrographs of grain structures for (a) AZ31 alloy, (b) HC-1, (c) HC-2, and (d) HC-3, along with (e) grain size comparison of the composites.

Figure 4 displays the SEM images of the HC prepared using FSP. The NbC and ZrC particles are dispersed uniformly in the matrix in all composites and there is no presence of large or clustered particles in the composites. This is due to sufficient material flow, which causes even distribution of particles after the three passes. Likewise, it has been observed that the interparticle separation of the composite subjected to Friction Stir Processing (FSP) diminishes concomitantly with an increase in the volumetric percentage of hybrid particulates. Figure 4c exhibits a noticeably smaller gap between the particles compared to the samples shown in Fig. 4a and b. The energy-dispersive X-ray spectroscopy (EDS) results of the developed composites are shown in Fig. 4d. The presence of Nb, Zr and C in Fig. 4d&e confirms the presence of embedded NbC and ZrC particles in the hybrid composite. Elemental Mapping of HC-3 composite is shown in Fig. 5. The results reveal the existence of NbC and ZrC particles and the distribution of all elements in the matrix.

The application of intense plastic deformation of the tool is believed to have contributed to the disaggregation and refinement of the hybrid particles within the composite material. The substantial deformation of the NbC and ZrC particles during the tool subsequent traversal is a pivotal factor in altering the dimensions of the reinforcement particles. The minute particles function as restraining agents, impeding the growth of grains within the composite or the migration of grain boundaries (GB). Zener pinning and Dynamic recrystallization are acknowledged as the mechanisms that assist in inhibiting grain growth in the composite material subsequent to FSP. The incorporation of hybrid reinforcement particles within the AZ31 matrix has been shown to enhance the microstructure by constraining the movement of GB and facilitating nucleation processes.

Fig. 4
figure 4

SEM micrographs of (a) HC-1, (b) HC-2, (c) HC-3; (d) electron image of HC-3; and (e) corresponding EDS spectrum of HC-3.

Consequently, the composite undergoes dynamic recrystallization as a result of the continuous generation of thermal energy through friction and the impact of straining and mechanical agitation during the FSP procedure. Sub-grain particles may emerge at the GB of the hybrid composite, hindering the migration of GB and the proliferation of grains during the dynamic recrystallization phase within the SZ14,28. The observed phenomenon can be ascribed to the cumulative effects of variations in stresses between the particles and the matrix, sub-grains and severe plastic deformation. The interface between the matrix and particles is distinctly seamless, with no apparent gap. The unique characteristics of the matrix-particle interface serve as evidence for the absence of diffusion between the particles and the matrix18.

Fig. 5
figure 5

Elemental Mapping of HC-3 FSP composite.

Hardness, tensile and wear properties

Figure 6a illustrates the microhardness plots of the hybrid composites that underwent FSP process. The result of the Microhardness test indicates a substantial enhancement in the microhardness values when reinforcement was added to the AZ31 matrix. The initial AZ31 alloy had an average microhardness of 62 ± 2 HV. However, the hybrid composites show different levels of improvement: HC-1 reached an average microhardness of 89 ± 2 HV, HC-2 obtained 110 ± 2 HV and HC-3 demonstrated a significant rise to 122 ± 3 HV. The results unambiguously demonstrate that an increase in vol% of reinforcement material is directly associated with a gradual rise in microhardness. Factors like as grain size, vol% of reinforcement particles and its dispersion often influence the microhardness. After FSP, the hybrid reinforcement particle size reduced appreciably. The microhardness measurement of the composite is profoundly influenced by both the mean dimensions of the particles and the grain size of the matrix within the hybrid composite (HC). The AZ31B Mg/(NbC and ZrC) hybrid composite demonstrates considerable refinement in grain dimensions and particle size after friction stir processing (FSP), which consequently enhances the microhardness of the HC. The enhanced hardness observed in the composite can be attributed to multiple strengthening mechanisms. These include grain refinement in accordance with the Hall–Petch relationship, which correlates decreased grain size with increased hardness, and Orowan strengthening, arising from the uniform dispersion of fine reinforcement particles that impede dislocation motion3,6,7,29.

Figure 6b illustrates the TS results of the hybrid composites subjected to FSP process. Compared to the AZ31 alloy YS 120 ± 2 MPa, TS 239 ± 5 MPa, the HC-3 composites exhibited highest yield strength of 145 ± 3 MPa and TS of 316 ± 6 MPa. This indicates that an increase in vol% of particles directly improves the TS of the hybrid composite. This may be associated with the diminished occurrence of flow-induced flaws and particle agglomeration in the composite reinforced with (NbC and ZrC) in FSP. The aggregation of particulate matter or an elevated density of rigid particles located at the GB or embedded within the grain interior generates significant stress concentrations in the regions with a higher density of particles.

Fig. 6
figure 6

(a)Microhardness and (b) tensile test plots of the FSP processed hybrid composites.

The tensile test in this area shows a significant vulnerability to fast crack initiation and growth. This tendency may diminish the composites strength owing to the uniform distribution of NbC and ZrC particles. The enhancement in the TS of the hybrid composite with increasing vol% of particles can be ascribed to the superior dispersion of the (NbC and ZrC) particles and the refining of the grain structure. Numerous scholarly investigations attribute the enhanced tensile characteristics of composite materials to a range of mechanisms, such as grain refinement, strengthening resulting from discrepancies in thermal expansion, dislocation strengthening, and mechanisms involving particle-induced or Orowan strengthening6,13,30. The improved ultimate TS (UTS) of the composite is primarily attributed to several contributing factors, including enhanced plastic flow during processing, uniform distribution of reinforcement particles leading to increased dislocation density and entanglement and the formation of finer grains within the matrix that contribute to strengthening through grain boundary hardening14.

Fig. 7
figure 7

Tensile fracture surface of the samples (a) AZ 31 alloy, (b) HC-1, (c) HC-2 and (d) HC-3. Mechanism of (e) ductile and (f) brittle fracture.

Figure 7 presents the SEM images of the tensile fracture surfaces for both the unreinforced AZ31 alloy and the NbC–ZrC reinforced hybrid composites. The AZ31 matrix (Fig. 7a&e) shows a typical ductile fracture with shallow and uniformly distributed dimples, indicating micro void coalescence. In contrast, the HC-1 to HC-3 composites (Fig. 7b-d) exhibits features such as cleavage steps, river patterns, and particle-matrix interface decohesion, suggesting a predominantly brittle fracture mechanism. These characteristics imply that the inclusion of hard ceramic reinforcements limits plastic deformation and promotes brittle fracture. The failure likely initiates at the reinforcement–matrix interfaces and propagates through or around the particles due to stress concentration as shown in Fig. 7f. The fracture sequence, including crack initiation at the particles, interaction with the surrounding matrix, and final propagation. The transition from ductile to brittle fracture with increasing reinforcement content reflects the trade-off between improved strength and reduced ductility.

The observed outcome corroborates the tensile test results depicted in Fig. 6b. The presence of reinforcement particles significantly improves the load-bearing capacity in the composite material by various strengthening mechanisms as explained earlier. However, with the addition of NbC and ZrC hybrid particles reduced the ductility of the matrix material. The observation of fine reinforcement particles on the fracture surfaces of the composite, as illustrated in Fig. 7, serves as evidence of particle-induced strengthening mechanisms within the material. This finding aligns with the results presented by Satish Kumar et al.7, indicating that the presence of TiC particles on the fracture surfaces of AZ31/TiC composites reflects robust interfacial bonding between the reinforcement and the matrix.

Wear properties

Figure 8 shows the FC of FSP hybrid composites at sliding speeds of (a) 1 m/s and (b) 3 m/s under various applied loads. The friction coefficient increases with the load for all materials at sliding speeds of 1 m/s (Fig. 8a). AZ31 has the greatest values, whereas HC-3 displays the lowest. The hybrid composites (HC-1, HC-2, HC-3) exhibit reduced friction compared to AZ31, indicating superior tribological performance. The significant reduction in the FC for HC-3 suggests enhanced lubricating properties or superior material stability. HC-3 is a superior choice for wear applications. AZ31 exhibits the highest FC, although HC-3 retains its leading position in reducing friction. This pattern indicates that increased speeds lead to reduced friction, potentially due to thermal effects and the establishment of a stable tribolayer. HC-3 persistent superior performance demonstrates its efficacy in reducing friction, establishing it as a premier choice for high-speed applications.

In comparison to the AZ31 alloy with an FC of 0.48, the hybrid composites demonstrated reduced FC values of 0.42, 0.37, and 0.34 as the vol% of hybrid reinforcement increased from 4%, 8%, to 12%, respectively, under a load of 60 N and a 1 m/s sliding speed. The friction coefficient (FC) values for the AZ31 alloy and HC-3 are determined to be 0.78 and 0.63, respectively, at a sliding velocity of 3 m/s while subjected to a load of 60 N. This phenomenon is intrinsically linked to the inherent characteristics (dispersion and granularity) of the particulate matter embedded within the matrix of the hybrid composite. This occurrence is attributed to the homogeneous distribution of particles, along with a decrease in particle dimensions and interparticle distances. The particles, which are finely dispersed, are posited to have acted as obstacles to deformation during the experimental assessment, thereby contributing to a reduction in wear and the friction coefficient of the hybrid composite.

Fig. 8
figure 8

Coefficient of friction of friction stir processed hybrid composites at sliding speeds of (a) 1 m/s and (b) 3 m/s under various applied loads.

Figure 9 illustrates the wear characteristics of FSP hybrid composites at sliding speeds of (a) 1 m/s and (b) 3 m/s under various applied loads. AZ31 displays the highest wear rate under all load circumstances, indicating inadequate wear resistance, while HC-3 shows the lowest wear rate, implying exceptional wear resistance at sliding speeds of 1 m/s under various applied loads (Fig. 9a). The wear rate of the composite markedly diminished with the increase in the vol% of hybrid particles. Compared to AZ31 alloy wear rate 0.051mm3/min, HC-3 exhibited significant reduction in wear rate 0.032 mm3/min sliding speeds of 1 m/s under 60 N load.

At a sliding speed of 3 m/s (Fig. 9b), the wear rate values significantly exceed those observed at 1 m/s. This occurs due to increased frictional heat and accelerated material degradation. We observe a consistent pattern across various loads, indicating a predictable wear process. AZ31 exhibits greater wear, whereas HC-3 continues to perform effectively. Compared to AZ31 alloy wear rate 0.091mm3/min, HC-3 exhibited significant reduction in wear rate 0.064 mm3/min sliding speeds of 3 m/s under 60 N load. This supports the notion that hybrid composites HC-3 are more effective in reducing wear at elevated speeds. The enhanced hardness value and finer grains are mostly responsible for the reduction in wear rate. The hybridized composite microhardness and wear rate have a direct linear relationship, according to the hardness (see Fig. 6a) and wear rate. This indicates a high degree of agreement with Archard formula. A major factor in improving the wear performance—especially by lowering the wear rate—is the improved spatial distribution of reinforcement particles and the notable decrease in interparticle spacing at higher particle volume fractions. For the HC-3 composite, it is thought that the consistent and fine distribution of reinforcement particles inside the matrix has actually suppressed localised deformation and reduced material loss during wear testing.

Fig. 9
figure 9

Wear rate of friction stir processed hybrid composites at sliding speeds of (a) 1 m/s and (b) 3 m/s under various applied loads.

Fig. 10
figure 10

Worn surfaces of (a) AZ31 alloy, (b) HC-1, (c) HC-2, and (d) HC-3 FSP-processed composites tested at 3 m/s sliding speed under a 60 N load.

Figure 10a-d illustrates the worn surfaces of the hybrid composites tested at a sliding speed 3 m/s under applied load of 60 N. The wear behavior of the composites has been found to be significantly influenced by changes in the volume percentage of reinforcement, which can be attributed to variations in the worn surfaces. SEM images of delaminated regions on the worn surface of the composite in the AZ31 alloy is presented in Fig. 8a. AZ31 alloy is reported to exhibit reduced resistance to wear loss, hence resulting in the occurrence of delamination as depicted in Fig. 10a. On the other hand, as shown in Fig. 10b-d, the HC containing NbC and ZrC particles appears smooth, indicating abrasive wear behaviour. As the amount of reinforcement increased from 4 to 12 vol%, the hybridized composite’s delaminated area decreased. Consequently, a heightened mode of abrasive wear has been documented within the composite as the volumetric percentage escalates, which can be attributed to the augmented material (plastic) flow and the superior dispersion of the reinforcing particles. It is posited that during the assessment of the wear behavior of the composites, the finely and appropriately dispersed particles within the AZ31 alloy inhibited direct contact between the rotating disc and the surface of the HC pin.

Performance matrix

The parameter tweaking phase has commenced to determine the ideal setup for each machine learning model. The optimal setup for the Random Forest (RF) model is as follows: The maximum number of features for the optimal split (MF) is set at 2, the minimum number of samples required at a leaf node (MSL) is established at 1, and the total number of decision trees in the forest (NE) is fixed at 100. The ideal configuration of the decision tree entails employing absolute error as the splitting criterion, establishing a maximum depth of 8, and a minimum sample leaf (MSL) of 1. This investigation incorporated four unique evaluative metrics— R², RMSE, MSE, and MAE—to systematically evaluate and juxtapose the efficacy of the ML models. The coefficient of determination, R², is a statistical measure employed to evaluate the quality of fit of a regression model. It is obtained by the subsequent formula:

$${R^2}=\frac{{\sum\limits_{{i=1}}^{n} {{{\left( {{y_i} - {{\hat {y}}_i}} \right)}^2}} }}{{\sum\limits_{{i=1}}^{n} {{{\left( {{y_i} - \bar {y}} \right)}^2}} }}$$
(1)

Let n represent the number of assessments, yi indicate the experimentally measured output value, ŷi imply the predicted output value and y signify the arithmetic mean of the empirically measured values. The RMSE, or root mean squared error, indicates the average discrepancy between predicted and actual values. It is calculated by determining the square root of the average of the squared deviations between the expected and actual values.

$$RMSE=\sqrt {MSE} =\sqrt {\frac{1}{n}\sum\nolimits_{{i=1}}^{n} {{{\left( {{y_i} - {{\hat {y}}_i}} \right)}^2}} }$$
(2)

The MSE, or mean squared error, is a measure of the average squared difference between the actual and projected values. It is calculated using the following formula:

The mean absolute error (MAE) quantifies the average disparity between actual and predicted values. It is obtained by the subsequent formula:

$$MAE=\frac{1}{n}\sum\limits_{{i=1}}^{n} {{{\left| {{y_{i - }}{{\hat {y}}_i}} \right|}^2}}$$
(3)

As demonstrated in Eq. 1, the coefficient of determination (R²) assesses the alignment of the model’s predictions with the actual data. A model with a perfect fit has a R² value of 1, whereas a value of 0 signifies that the model does not account for the variability in the data. R² is very proficient at evaluating the proportion of variance explained by the model in comparison to alternative measures. Additionally, three supplementary error metrics quantify the model’s efficacy: Root Mean Squared Error (RMSE) and Mean Squared Error (MSE) assess the squared discrepancies among actual and predicted values. Since RMSE equals the square root of MSE, both metrics have a monotonic relationship, indicating that lower levels denote improved model accuracy. MAE calculates the average absolute deviation among actual and anticipated values. In contrast to RMSE and MSE, MAE has reduced sensitivity to outliers, rendering it a valuable tool for minimizing severe variances.

Table 3 Comparative performance outcomes of ML models.

Linear Regression (0.9032) and Random Forest (0.8999) demonstrate high accuracy, showing these models explain about 90% of the target variable’s variance as shown in Table 3. The Decision Tree (0.8238) has the lowest R², which means it captures less variance and tends to overfit. Linear Regression (0.0311) and Random Forest (0.0316) have RMSE values that are close pointing to steady performance. The Decision Tree has the highest RMSE (0.0419), which suggests its predictions fluctuate more.

Wear behavior and ML prediction

Figure 11(a, c and e) presents a comparative analysis of the actual and predicted wear rate for LR, DT and RF techniques respectively. The scatter plot assesses the performance of Linear Regression in predicting wear rates, yielding an exceptionally high correlation coefficient (R = 0.9959), indicating a near-perfect relationship between predicted and actual values as shown in Fig. 11a. The black dashed line (Y = T) represents the ideal fit, while the red regression line shows the model’s predicted values. The almost complete overlap between the two lines suggests that the wear rate follows a strongly linear pattern, making Linear Regression an ideal model for this dataset. The model captures the overall trend with minimal residual errors, confirming its high accuracy. The high R² score validates that Linear Regression is a strong baseline approach, offering simplicity and interpretability. Given its ability to generalize well across different loads, this model is one of the best choices for wear rate prediction in controlled experimental conditions.

The scatter plot assesses the Decision Tree Regressor in the estimation of wear rates with a good correlation coefficient (R = 0.9876) as shown in Fig. 11c. The black dashed line (Y = T) is the perfect fit, and the red regression line shows the values predicted by the Decision Tree. The model very well captures the overall trend, tracing the linear relationship closely; however, small variations are noted, especially in intermediate wear rates. The Decision Tree model overfits the training data, as indicated by its sensitivity to wear rate fluctuations.

The scatter plot shows the predicted vs. actual values of wear rate by the Random Forest model with a high correlation coefficient (R = 0.9819) as shown in Fig. 11e. The ideal fit is shown by the black dashed line (Y = T), and the red regression line indicates the predicted values by the Random Forest. The model accurately depicts the trend of wear rate, following the expected linear relationship very closely, with only slight deviations at the extreme values. In contrast to one Decision Tree, Random Forest drastically enhances generalization through variance reduction, creating more stable predictions.

Figure 11 (b, d and f) presents a comparative analysis of the actual and predicted Friction Coefficient for LR, DT and RF techniques respectively. The scatter plot illustrates the Linear Regression model’s ability to forecast the friction coefficient, resulting in a high correlation coefficient (R = 0.9637) Fig. 11b. The black dashed line (Y = T) is the ideal fit, and the red regression line is the Linear Regression’s forecast values. The high correlation indicates that the friction coefficient has a nearly linear relationship with the input features. Overall, the model works well but there are some minor variations in lower friction predictions that suggest possible limitations in representing non-linearity. The high R² value certifies that the model fits a considerable amount of variance, which makes it a good baseline method.

The scatter plot Fig. 11d shows the actual vs. predicted values of the friction coefficient with the Decision Tree Regressor. The model had a correlation coefficient (R = 0.9602), which means that there was strong agreement between the predictions and actual values. The black dashed line is the ideal fit (Y = T), and the red regression line is the fit of the model. Decision Tree captures the overall trend well but shows minor discrepancies, particularly towards the upper limit of friction values, indicating a degree of overfitting. The scatter plot shows the Random Forest models predicted against actual friction coefficient, and the model has a high correlation coefficient (R = 0.9519) Fig. 11e. The ideal fit is represented by the black dashed line (Y = T), and the red regression line is the Random Forest’s prediction. The model identifies the general trend very well, but minor discrepancies for lower friction values point to possible variance. In contrast to Decision Trees, Random Forest minimizes overfitting through ensemble averaging of several trees, which improves predictability stability. The comparison of various models for friction coefficient and wear rate predictions presents significant observations about their robustness. Linear Regression was always the best, especially for wear rate predictions, as it assumes linearity, which suits the characteristics of the dataset. Decision Trees were highly accurate but overfit, hence less dependable for generalization. Random Forest, an ensemble algorithm, greatly enhanced stability and prediction accuracy over Decision Trees in most instances.

Fig. 11
figure 11

Comparison of actual and predicted wear rate (a, c, e) and friction coefficient (b, d, f) using linear regression (a, b), decision tree (c, d), and random forest (e, f) models.

Fig. 12
figure 12

Feature importance in predicting (a) friction coefficient and (b) wear rate across different machine learning models.

Figure 12 illustrates the importance of different features across three machine learning models: Decision Tree, Random Forest, and Linear Regression on predicting the friction coefficient (Fig. 12a) and wear rate (Fig. 12b). Each feature—Material, Load (N), and Sliding Velocity—holds varying levels of significance depending on the model. Notably, both the Decision Tree and Random Forest models place a strong emphasis on Sliding Velocity, giving it a weight of over 80%. This suggests that fluctuations in this parameter greatly influence the friction coefficient and wear. On the other hand, Linear Regression also recognizes Sliding Velocity as important, but its impact is considerably less than that of the other two models. As for Material and Load (N), they have a moderate effect; both Decision Tree and Random Forest attribute a smaller importance (around 8–10%) to these features, indicating they play a role in determining the friction coefficient.

Conclusions

Hybrid AZ31/(NbC + ZrC) composites were manufactured in this work using multi-pass tool approach Friction Stir Processing (FSP). Major results show that the AZ31 matrix underwent notable grain refining as the volume fraction of hybrid reinforcements increased, with grain sizes lowered to the range of 4–6 μm. Intense plastic deformation, dynamic recrystallization, and the Zener pinning effect caused by the fine reinforcement particles account for this refinement. Microhardness showed a significant increase as the volume fraction of hybrid reinforcements grew from 4% to 12%, mostly because of grain size decrease and uniform particle dispersion, from 62 HV to 122 HV. Moreover, the tensile strength of the HC-3 composite rose significantly—from 239 MPa to 316 MPa—attributed to improved strengthening mechanisms enabled by well-dispersed fine particles, the reduction of flow defects, and lower particle agglomeration. The wear rate and mean coefficient of friction of the HC-3 composite diminished from 0.041 mm³/min to 0.025 mm³/min and from 0.42 to 0.2, respectively, under a load of 45 N, which can be ascribed to the considerable enhancement in hardness and the homogeneous distribution of NbC and ZrC particles.The scatter plot assesses the performance of Linear regression in predicting wear rates and friction coefficient yielding an exceptionally high correlation coefficient (R = 0.9959) and (R = 0.9637) indicating a near-perfect relationship between predicted and actual values respectively. Sliding Velocity is the key determinant of the friction coefficient, making it the most crucial feature for prediction. Material and Load (N) contribute but are less significant in all models.