Introduction

Metal ions are vital trace components in human beings and are crucial for a healthy life. Because of heavy metal ion’s broad spread, variety of forms, difficulty in degrading, toxicity, and other qualities, pollution from these ions has become an international issue1. The neurological, immunological, reproductive, and gastrointestinal systems are affected due to the intake of heavy metal ions (such as Pb, Cd, Hg, As, and Cr) that gradually build up in the human body through the food chain or direct contact. Consequently, it is crucial to perform analytical metal ion detection & enrichment adsorption in food and the environment2,3. Chemical precipitation4, membrane filtration5, ion-exchange process6 and adsorption7 have been a popular technique for removing metal ions throughout the past few years. Because of its versatility and low requirements for experimental settings, adsorption is regarded as one of the most successful techniques for detecting and removing metal ions8. It may also remove numerous compounds at once. However, the drawbacks of single synthesis conditions, challenging skeleton alterations, and poor controllability severely restrict the application of conventional adsorbents (e.g., carbon-based materials, zeolite, graphene, molecularly imprinted polymers, and porous silica)9.

Recently, MXene, a novel class of two-dimensional nanomaterials from the transition-metal carbides, nitrides, carbonitrides, and oxy-carbonitride materials family, has generated much interest across various industries10,11. Owing to their attributes, including hydrophilicity, high chemical stability, large surface area, thermal/electrical conductivity, and environmental friendliness, MXenes can be used as appropriate materials in a variety of applications, such as lithium-ion batteries, semiconductors, hydrogen storage, supercapacitors and environmental remediation12,13,14. Because MXene-based adsorbents have distinct structures that allow them to adsorb a wide range of environmental contaminants, it’s critical to comprehend the processes involved in adsorption and how pollutants interact with the adsorbents15. MXene has a surface charge that is caused by functional groups on its surface, and it is capable of being electrostatically charged. Due to etching and intercalation, MXene’s surface forms various functional groups, including − O, −F, and − OH. Etchants and intercalants form a broad range of functional groups that facilitate adsorption reactions. Depending on the target’s charge, MXene could adsorb either positively or negatively charged materials16. Since the different ions of radioactive substances and heavy metals are oppositely charged to the MXene terminations, MXene can remove them due to their electrostatic characteristic. Therefore, the primary adsorption mechanism of MXene is electrostatic interaction with inorganic pollutants. Positively charged MXene can remove anions from water at very low pH levels, but its application is challenging since very low pH water quality is not universal.

Zinc oxide, or ZnO, is a semiconductor compound with a broad bandgap that is frequently utilized in a variety of applications, including coatings, sensors, and photocatalysis17. ZnO is good at binding to metal ions through chemical bonding and electrostatic forces because of its large surface area and ability to generate hydroxyl groups. Numerous hydroxyl groups (− OH) that are known to have a significant interaction with metal ions can be found on the surface of ZnO18. These groups can improve the MXene material’s capacity to absorb metal ions by raising its total surface charge density. Through coordination or electrostatic attraction, hydroxyl groups may interact with metal ions. More adsorption sites may become available on the active surface of MXenes with the addition of ZnO19. These locations may be chemical sites wherein the metal ions can be attached by electrostatic interactions, chelation, or complexation, or they may be physical adsorption sites (because of the ZnO’s increased surface area). For metal ions, this increases overall adsorption efficiency. Since ZnO is a semiconductor, its presence on MXenes may help the metal ions and the MXene material transfer electrons. Particularly for metal ions undergoing chemical reactions throughout the adsorption process, this may result in an accelerated rate of adsorption. For instance, ZnO can decrease or oxidise some transition metal ions, making it easier for them to be captured on the MXene surface. ZnO and MXenes together may be a viable way to improve these materials’ adsorption effectiveness for various metal ions, especially in environmental remedial applications20,21.

ZnO-MXene (ZnO@Ti3C2Tx) was created using an in-situ development approach and inventively added to wastewater that contained metal ions. Many characterisations, including SEM, XRD and FTIR, were studied to confirm the preparation of the composite material. More adsorption sites are provided by evenly developed zinc oxide nanosheets on the surface of MXene, which enhances the adsorption of metal ions, improving the sorption mechanism and thermodynamics. Terminal and functional groups, including − OH and − O, on the surface of the composite material facilitate the metal ion transport and allow it to be adsorbed on the surface of the materials energetically. Furthermore, by adjusting the adsorptive behaviour, MXene can produce uniform zinc deposition, create evenly spaced “seed points” for uniform nucleation and prevent dendritic development. ZnO@MXene, as an adsorbent, delivers outstanding sorption performance and cycling stability by taking advantage of these synergistic effects. As reported in the literature, metal ions tend to adsorb on the adsorption based on the active site present and the compatibility of the adsorbent towards selective metal ions. MXene has good compatibility and ability to adsorb carcinogenic metal ions like lead, chromium, iron and arsenic but fails to perform for the metal ions like iron, cobalt and other non-carcinogen metal ions, which can still be a major threat towards the ecosystem if beyond the permissible limits suggested by World Health Organization (WHO) as shown in Table 122. Adding the ZnO nanorods onto the MXene nanosheets helps the MXene adsorb the additional metal ions. The composite material was experimentally studied, and metal ions like lead, cadmium, chromium, copper, arsenic, nickel, zinc, etc. were seen.

Table 1 Permissible limits of investigated metal ions.

Due to various anthropogenic processes, including mining, deterioration of rocks, volcanic erosion, burning of fossil fuels, and other industrial activities, heavy metals (HMs) have been released into lakes, rivers, and oceans. This has increased the level of HMs in water sources, posing a serious threat to both human civilisation and biodiversity23. One of the major issues for the public’s health is the drinking of water, which has a specific level of heavy metals, which can have various acute and long-term impacts. The WHO indicates that water treatment alone might avert a large percentage of sickness globally24. There are widely used adsorbents for the adsorption of targeted metal ions. The comparison of ZnO-MXene with traditionally used adsorbents like activated carbon, biochar and Metal-Organic Framework (MOFs) is demonstrated in Table 2.

The specific contributions of the present study are as follows:

  1. (a)

    This study created ZnO-MXene nanocomposites with unique morphological and structural characteristics using a two-step production method. This research sheds light on (i) how the composites’ morphology changes with temperature, (ii) how ZnO micro rods developed on Ti3C2 sheets at elevated temperatures and (iii) how ZnO particles spread out over Ti3C2 layers at a lower temperature. These results offer a deeper comprehension of the structural development of ZnO-MXene composites and their improved efficacy as wastewater treatment nano adsorbents.

  2. (b)

    Applying sorption kinetics, isotherms, and thermodynamic modelling, the work thoroughly evaluates the adsorption characteristics of ZnO-MXene nanocomposites. The work highlights the chemisorption process as the primary mechanism driving metal ion removal to guarantee adherence to WHO water quality criteria. This study provides a solid basis for evaluating and enhancing nano-adsorbent compounds for environmental applications by linking theoretical sorption models with actual findings.

  3. (c)

    Two machine learning models, such as SVM and RF, are used to forecast the ZnO-MXene composite’s adsorption performance. These models accurately predicted the adsorption effectiveness under various experimental conditions, such as temperature, pH, and dosage. This reveals complex nonlinear correlations which are challenging to identify using traditional methods. By advancing our knowledge of adsorption mechanisms and enabling data-driven optimisation of synthesis and operational parameters, this integration paves the way for wastewater treatment systems that are more efficient and scalable.

Thus, this study combines advanced materials, detailed adsorption analysis, and machine learning techniques to solve important problems in wastewater treatment.

Table 2 Comparative study of common adsorbents.

Materials and methods

MAX Phase (Ti3AlC2), having 99% purity, was purchased from Intelligent Materials Pvt. Ltd., Sodium Fluoride (NaF) was purchased from SD Fine-Chem Ltd and Hydrochloric Acid (HCl) was purchased from Fine Chemicals Ltd. Zinc Acetate Dihydrate [Zn(CH3COO)2·2H2O] and Sodium Hydroxide (NaOH) were procured from Finar Chemicals. No further purification of any material was done before experimentation and synthesis. The groundwater was collected from local areas of Gandhinagar City, Gujarat, India. The local and the rural regions have a metal ion concentration due to rapid urbanisation in the city’s outskirts. Industrial estates also cover rural areas, so groundwater pollution is a major issue. Many reported health cases are water-borne and arise from local areas where the water has concentrations of carcinogenic metal ions above the permissible limits suggested by the World Health Organization (WHO)22. The major contributors to groundwater pollution are the Gujarat Industrial Development Corporation, uneven rainfall and rapid urbanisation.

Synthesis of MXene

After being treated in an etchant to remove the Al layers from the Ti3AlC2 MAX Phase precursors, multilayered Ti3C2Tx particles were formed by a safe synthesis route, which was used as a material onto which the ZnO materials would be deposited. Firstly, 3.35 g of NaF was dissolved in 20 mL of HCl at ambient temperature (35 ⁰C) for 1 h. After properly mixing the compounds and forming In-Situ HF, MAX Phase precursor (Ti3AlC2), 1 g was added slowly to the In-Situ HF solution. The slow addition ensures proper etching of the Al layers with effective interaction of the MAX phase with the etchant. The mixture was then stirred at 50 ⁰C for 24 h. The stirred solution mixture was centrifuged at 7000 rpm to separate the nanosheets from the solution. The separated nanosheet was dried in the vacuum-dried oven at 70℃ to remove the moisture and solvent content in the powder if any28. The synthesis route is shown in Fig. 1.

Fig. 1
figure 1

In-Situ (Safe) Synthesis Route of MXene from MAX Phase (Created in BioRender. Kagalkar, A., 2025. https://BioRender.com/89dqhb0).

Synthesis of ZnO@MXene

The ZnO seed layer was fixed on the surface of Ti3C2Tx before the growth of ZnO nanorods. 0.23 g of Zinc Acetate Dihydrate was vigorously dissolved in 50 mL Deionized (DI) water at 50℃. In another beaker, 0.64 g of NaOH was dissolved in 50 mL DI Water at similar conditions. Both solutions were then combined, and 0.5 g of Ti3C2Tx was added while vigorously stirring for 24 h at 65 °C. ZnO nanorods were cultured on Ti3C2Tx seeded as-is. The mixture after 24 h was centrifuged and washed with DI water and solvent to maintain pH and remove the impurities, if any. The remains after the washing were the composite material, which was dried in a vacuum oven at 80℃ overnight. After drying, the material was ready to be used as an adsorbent29. The synthesis route for ZnO-MXene has been shown in Fig. 2.

Fig. 2
figure 2

Synthesis Route for ZnO-MXene Nanocomposite Phase (Created in BioRender. Kagalkar, A., 2025. https://BioRender.com/89dqhb0).

Material characterisation

Samples’ surface morphologies were recorded using SEM, EVO 18, Carl Zeiss, EDX. An X-ray diffractometer was used to characterise the crystalline structures of the samples (Tabletop Rigaku MiniFlex 600-C X-Ray Diffraction equipment) from 5⁰ to 50⁰, having a scanning rate of 5⁰/min. FTIR spectroscopy is an analytical technique for figuring out the makeup of organic, polymeric, and even inorganic materials. The termination groups on the ZnO-MXene surface responsible for the adsorption are shown by the FTIR spectrum derived using the Perkin-Elmer spectrum two models.

Adsorption experiments

The adsorption experiments were carried out using the adsorption process when the ZnO-MXene adsorbent was employed to remove metal ions from the wastewater. The metal ions were adsorbed on the material’s surface simultaneously due to electrostatic attraction and the sorption mechanism. The adsorption experiments were carried out considering the parameters responsible for the sorption of metal ions (adsorbate) onto the adsorbent (ZnO-MXene composite). The parameters studied to understand the adsorption were the effect of time, dosage, temperature, pH, and initial concentration of the metal ions in the wastewater. The results of the initial and final concentration after the experimental analysis were calculated as removal (%) and the adsorption capacity by using Eqs. (1) and (2):

$$\:{\text{Q}}_{\text{m}\text{a}\text{x}}=\frac{{\text{C}}_{\text{i}}-{\text{C}}_{\text{f}}}{\text{m}}\times\:\text{V}$$
(1)
$$\:\text{R}\text{e}\text{m}\text{o}\text{v}\text{a}\text{l}\:\left({\%}\right)\:\text{o}\text{f}\:\text{m}\text{e}\text{t}\text{a}\text{l}\:\text{i}\text{o}\text{n}\text{s}=\:\frac{{\text{C}}_{\text{i}}-{\text{C}}_{\text{f}}}{{\text{C}}_{\text{i}}}\times\:100$$
(2)

Where Ci is the initial concentration of the metal ions before adsorption (mg/L); Cf is the final concentration of the metal ions after adsorption (mg/L); Qmax is the maximum adsorption capacity (mg/g); m is the mass or quantity of adsorbent used (g) and V is the volume of wastewater sample used (L). Table 3 specifies the parametric ranges of various parameters experimentally studied.

Table 3 Parameter ranges for adsorption experiments.

Adsorption isotherms

Adsorption isotherms were studied to understand the adsorption mechanism of metal ions onto the surface of the ZnO-MXene nanocomposite. The adsorption isotherm models that were used to understand the mechanism were the Langmuir and Freundlich Isotherm models. Table 4 summarizes the equations, plots and parameters used for Langmuir and Freundlich Isotherm models. The initial and final concentrations were taken into account to carry out the calculations for each model, the graphs of which were plotted to understand the favorability of the isotherm models and understand the overall mechanism based on the assumptions of the models.

Langmuir isotherm

The adsorption isotherm developed by Langmuir assumes that there is homogeneous monolayer adsorption at every surface site and that adsorbed molecules cannot interact with nearby adsorption sites30. Equation (3) is a representation of the linear Langmuir:

$$\:\frac{{\mathbf{C}}_{\mathbf{e}}}{{\mathbf{q}}_{\mathbf{e}}}=\:\frac{1}{{\mathbf{Q}}_{\mathbf{m}}\mathbf{b}}+\:\frac{1}{{\mathbf{Q}}_{\mathbf{m}}}{\mathbf{C}}_{\mathbf{e}}$$
(3)

Where Ce is Equilibrium Concentration (mg/l), qe is the amount adsorbed in equilibrium time (mg/g), Qm and b are Langmuir constants related to maximum adsorption capacity (mg/g) and adsorption energy associated with the heat of adsorption (L/mg), respectively. The linear plot of the slope & intercept was used to calculate the Langmuir parameters. The dimensionless separation factor computed the affinity among the adsorbent and adsorbate, RL, using the Langmuir isotherm parameters, as shown in the following Eq. (4):

$$\:{\mathbf{R}}_{\mathbf{L}}=\:\frac{1}{1+\mathbf{b}{\mathbf{C}}_{0}}$$
(4)

C0 is the initial concentration of the metal ions in the wastewater, and b is the Langmuir constant. The RL values indicate if the adsorption is linear or unfavourable (RL = 1 or RL > 1), irreversible (RL = 0), or favourable (0 < RL < 1).

Freundlich isotherm

The process of adsorption on an irregular (heterogeneous) material with an interaction amongst adsorbed molecules during the reversible & non-ideal process of adsorption is described by the empirical Freundlich’s isotherm model. The linear form for the Freundlich isotherm model can be written as shown in Eq. (5):

$${ln}{{q}}_{{f}}={ln}{{K}}_{{f}}+\:\frac{1}{{n}}{ln}{{C}}_{{e}}$$
(5)

Where Freundlich constants KF and n stand for coefficient and intensity, respectively. The parameter, 1/n, indicates the type and strength of the adsorption mechanism. According to the model, if 1/n = 1, it concludes that the adsorption of metal ions onto the adsorption surface, which possesses equal adsorption energies, whereas if 1/n < 1, it implies that as the concentration of adsorbate increases, the adsorption intensity per unit increase in concentration decreases.

Table 4 Different isotherm models that were investigated in this study.

Adsorption kinetics

Adsorption kinetics determines the adsorption rate over the surface of the nano adsorbents. It is important to study how fast and effective the rate of the adhering of the metal ions on the surface takes place31. The adsorption kinetics are influenced by many parameters like surface area and pore size of the nano adsorbents, the concentration of the metal ions (adsorbate) used and adsorption parameters like adsorption temperature, pH, mixing rate, etc. This study gives a detailed idea about designing and optimising various processes in the wastewater treatment domain. There are about 16 kinetic parameter models for analysing the overall adsorption and rate mechanism32. However, in this study, two major prominent and significant kinetic models were used to understand the kinetics and mechanism of the sorption of metal ions on the surface of the nano adsorbents.

Pseudo-first-order kinetic model

Lagergren initially proposed the Pseudo-First Order (PFO) concept in 1898. According to this model, the adsorption rate of adsorbate (metal ions) is directly related to the number of free adsorption sites. Equation (6) describes the PFO model’s differential form, and integration of (6) gives (7) when q0 = 0.

$$\frac{{{d}\mathbf{q}}_{{t}}}{{{d}}_{{t}}}={{k}}_{1}({{q}}_{{e}}-{{q}}_{{t}})$$
(6)
$${{q}}_{{t}}={{q}}_{{e}}(1-{{e}}^{{-{k}}_{1}{t}})$$
(7)

The above Equation, when linearised, gives the following Eq. (8):

$${ln}\left({{q}}_{{e}}-{{q}}_{{t}}\right)={ln}{{q}}_{{e}}-{{k}}_{1}{t}$$
(8)

Pseudo-Second-Order rate kinetic model

The pseudo-second-order rate kinetic model indicates whether the chemisorption is a rate-controlling step. This model postulates that the adsorption proceeds via a second-order reaction mechanism, implying that the transfer or sharing of electrons between the adsorbent and adsorbate may be the rate-limiting phase. The quantity of vacant sites determines the rate of adsorption33. The mathematical model assumes a homogenous adsorption process in which all locations on the absorbent are equally accessible and available for adsorbate molecules34. The mathematical Equation for the PSO rate model can be written as Eq. (9), and after the linearisation of Eq. (10) is obtained.

$$\frac{{{d}}_{{q}}}{{{d}}_{{t}}}={{k}}_{2}({{{q}}_{{e}}-{{q}}_{{t}})}^{2}$$
(9)
$$\frac{{t}}{{{q}}_{{t}}}=\frac{1}{{{k}}_{2}{{q}}_{{e}}^{2}}+\frac{{t}}{{{q}}_{{e}}}$$
(10)

From the above equation, the plotting of \(\:\frac{t}{{q}_{t}}\) vs. t can be done, which obtains a slope of \(\:\frac{1}{{q}_{e}}\) from which equilibrium adsorption capacity (qe) (mg/g) is calculated, and the intercept gives the value of PSO rate constant (k2). The kinetic models that are investigated in this study, along with their linear equation, plots and parameters, are given in Table 5.

Table 5 Different kinetic models that were investigated in this study.

Adsorption thermodynamics

The adsorption thermodynamic modelling was carried out taking into account the effect of temperature to understand the energy relations that would have affected the adsorption performance of the metal ions onto the surface of the adsorbent taken into account. The thermodynamic modelling also confirmed the possible mechanism of the adsorption when the energy-related parameters like Gibbs Free Energy (∆G), Entropy Change (∆S) and Enthalpy Change (∆H) were calculated based on the obtained results. The thermodynamic and isotherm modelling confirmed the adsorption mechanism of the targeted metal ions onto the adsorption surface.

ML techniques for adsorption studies

Innovative solutions are needed to address environmental issues, including removing metal ions from wastewater to maximise treatment procedures and ensure adherence to strict quality standards. In environmental research, ML has become an efficient approach that could enhance the efficiency of several processes and offer predictive insights35,36. ML has transformed environmental research by providing data-driven solutions to challenging problems37. Traditional modelling techniques do not adequately address the high dimensionality and nonlinearity of environmental datasets. On the other hand, ML algorithms are excellent at identifying complex patterns and delivering reliable predictions38. ML is used in wastewater processing to estimate the effectiveness of pollutant removal, improve operating parameters, and investigate the effects of treatment operations on the environment. Adaptive control techniques for sustainable water resource management are also being made economically feasible by the growing integration of ML models into real-time monitoring systems. Adsorption treatments, which are commonly used to remove contaminants from wastewater, rely on multiple variables, including temperature, process time, pH, and adsorbent dosage. Optimising these settings via standard trial-and-error methods can be time-consuming and resource-intensive. The requirement for extensive experimentation can be avoided by ML techniques, which provide an effective substitute by predicting adsorption performance based on input parameters.

SVM and RF are two well-known ML algorithms actively employed for predictive modeling in various research applications. SVM performs remarkably well in tasks involving regression and classification, especially when the dataset is small and has intricate relationships. Using kernel functions, SVM can accurately predict nonlinear adsorption behaviour by converting input data into higher-dimensional spaces. SVM’s robustness and interpretability make it a popular choice for predicting performance under various experimental conditions. Conversely, the RF model is a robust and adaptable ensemble learning technique that performs exceptionally well for predictions based on regression. RF improves generalisation performance and minimises overfitting by building numerous decision trees during training and averaging their outputs. It is appropriate for various regression problems due to its intrinsic capacity to manage both linear and nonlinear connections. Moreover, the model is robust against noise and outliers and can handle datasets with high dimensionality and intricate feature interactions. SVM and RF are essential for adsorption investigations due to their complementing strengths. RF is best suited for datasets with intricate, high-dimensional interactions, whereas SVM is better for datasets with fewer variables and unambiguous boundary lines. Combined, these methods allow researchers to address various adsorption performance prediction issues. The dataset that was used to predict and validate the results using the ML approach was experimental data for the varying parameters like the effect of time, dosage, temperature and pH of the adsorption medium.

Characterisation techniques

SEM analysis

The surface morphology and the structure of the ZnO-MXene composite were studied using SEM, EVO 18, Carl Zeiss. Figure 3 shows the morphology and structures of the composites. The figure indicates that the MXene sheets are underneath the formed ZnO seed. MXene displayed a loose layered structure resembling an accordion, exposing its characteristic smooth surface morphology.

Fig. 3
figure 3

SEM of (a): MXene sheets; (bc): Deposition of ZnO over MXene sheets.

EDX analysis

The EDX analysis of the material also confirmed the ZnO deposition. Figure 4 shows the EDX mapping of the material with the atomic and weight composition of the elements present in Table 6. The elemental detection confirms the presence of the required elements that are present in the ZnO-MXene nanocomposites. Ti and C confirm the presence of MXene sheets as Al, and in a minimal amount, they confirm the etching of the A layers. The presence of Zn and O confirms the formation of ZnO on the MXene sheets. From Fig. 4, it can be clearly seen that the presence of all the essential elements to be present in the composite material can effectively work together as an adsorbent for capturing multiple metal ions. The composite synthesised must have an adequate amount of ZnO and MXene (prepared from an etching of MAX Phase). As seen in Table 2, the Al element (A phase of MAX) is present in 0.92% and 1.10% of atomic and weight%, respectively. The adsorbent, which will be used, must have Zn, O, Ti and C, which can confirm the presence of major elements that are responsible for the removal of targeted metal ions. The presence of these materials is 10.11%, 25.37%, 11.18% and 51.78%, respectively on atomic %, whereas 29.23%, 17.95%, 23.67% and 27.50%, respectively on weight%. The SEM and EDX analyses thus confirm the nanocomposites’ morphology and compounds, respectively.

Table 6 Elemental composition of ZnO-MXene nanocomposite.
Fig. 4
figure 4

(a) EDX Mapping of ZnO-MXene Nanocomposite; (b) Presence of Ti element; (c) Presence of Zn element; (d) Presence of Al element; (e) Presence of C element and (f) Presence of O element.

XRD analysis

The XRD patterns of (a) MAX Phase (Ti3AlC2) (b) MXene (Ti3C2) (c) ZnO-MXene nanocomposite (d) Phase identification methods shown in Fig. 5 confirm the formation of ZnO material on the top surface of MXene compounds, which were prepared by eliminating the A layers from the MAX phase precursor. The 2θ peaks at 9.8, 19.35 and 39.8 in Fig. 5a indicate the presence of Ti3C2, which confirms the multilayered and stacked structure of MXene, the presence of oxides and the presence of higher amounts of A layers, usually Al, which needs to be etched to get pure MXene. The pure, delaminated MXene can be confirmed by shifting the 2θ of 9.8 towards the lower angles, and the intensity peaks at 2θ = 39.8 must lower its intensity to confirm the complete etching of Al layers in the MXene, as seen in Fig. 5b. In Fig. 5c, it can be confirmed that the peaks at 2θ of 31, 34, 36 and 47 confirm the presence of Zn and ZnO compounds in the material. Cumulatively, the peaks at 7.8, 31, 34, 36 and 47 confirm the presence of ZnO over delaminated MXenes, and the small peak having low intensity at 39.8 confirms the elimination of Al layers from the MAX phase39. Figure 5d shows the phase identification for confirmation of various phases or components present in the ZnO-MXene nanocomposites, which confirm the material as ready for the adsorption of metal ions onto the surface.

The Scherrer method given in Eq. (11) was used to determine the crystal size of the ZnO-MXene nanocomposites.

$$\:\text{D}=\:\frac{\text{K}{\uplambda\:}}{{\upbeta\:}\:\text{C}\text{o}\text{s}\left({\uptheta\:}\right)}$$
(11)

Where D is the average crystal size, K is the dimensionless factor used (0.9), λ is the wavelength of X-rays, β is FWHM of the diffracted peak, and θ is the angle of diffraction. Table 7 provides the angle of diffraction (θ), FWHM value and the phase confirmed from the analysis. After understanding the Equation and substituting the values in the above Scherrer equation, crystal size was calculated, and from the analysis, the values of lattice constants (a, b, c) and the crystal phase are estimated. The values of the crystal size (from the Scherrer equation), lattice constants and crystal phase were calculated and noted in Table 8.

Fig. 5
figure 5

XRD for (a) MAX Phase (Ti3AlC2) (b) MXene (Ti3C2) (c) ZnO-MXene nanocomposite (d) Phase identification for confirmation of ZnO-MXene nanocomposite.

Table 7 Phase identification of ZnO@MXene.
Table 8 Determination of lattice constants and crystal size.

FTIR analysis

FTIR was used to analyse the material’s active functional groups and bonds. FTIR spectrum was obtained, as shown in Fig. 6, which is attributed to all the terminal and functional groups responsible for the metal ions’ adsorption on the nano adsorbents’ active surface. The vibrations can be noted at 1628, 709 and 544 cm− 1, confirming the presence of C=C bonds, Ti-C interactions and Zn-O interactions, respectively. The broader peak in the ZnO-MXene compound between 3,250 and 3,700 cm− 1 corresponds to the O–H bonds, which concludes that ZnO-MXene abundance of hydroxyl groups, which plays an important role in the coordination bond formation with metal ions to get adsorbed on the adsorbent surface.

The FTIR spectra indicate strong vibrations on 1,105 cm− 1, corresponding to M-F bonds wherein the M is Ti and Zn. The vibrations in the MXene are the vibrations of Ti-F bonds, concluding that the titanium and fluoride compounds bond together. The vibrations in the ZnO-MXene correspond to Zn-F bonds, concluding that the ZnO atoms are bonded with the MXene sheets39.

Fig. 6
figure 6

FTIR spectrum of MXene and ZnO-MXene nanocomposite.

TGA of ZnO nanoparticle

The TGA analysis demonstrates the profile of the material and authenticates the thermal stability of the material. Figure 7 depicts the ZnO thermal stability which focuses on some major points and a conclusion can be drawn to understand the integration of ZnO with the MXene to increase the adsorption efficiency. The decomposition of water that has been absorbed physically and the presence of volatile organic elements usually causes a modest drop in weight in the range of 30–60℃. Since ZnO has a larger surface area, it tends to adsorb water molecules from the environment, which bind to the surface in very small amounts. This decomposition does not relate to the decomposition of material but with moisture loss. The TGA profile shows less weight loss from the temperature range of 60–200℃ as ZnO being an inorganic material, cannot be seen decomposing in this range. This loss in the region depicts the decomposition of residual organic stabilizers, which were used in the synthesis of ZnO. At higher temperatures after 200 °C, it can be seen that there is a rapid loss in the weight% as there occurs a ZnO phase change. At further higher temperatures (~ 350 °C), due to the higher temperature, ZnO undergoes partial reduction, reducing to Zn. When added to Ti2C2 MXene, ZnO can tolerate extreme temperature synthesis or post-treatment procedures like heating at elevated temperatures because of its exceptional thermal stability30.

Fig. 7
figure 7

TGA Analysis for ZnO Nanomaterial.

Results and discussions

The removal efficiency was confirmed by undergoing various parametric studies like the effect of time, dosage, temperature, pH and initial concentration. The nano adsorbent used for evaluation was ZnO@MXene, where the MXene was titanium carbide. MXene had surface terminations that effectively removed carcinogenic metal ions more efficiently than MXene. The wastewater was analysed using ICP-OES (7300 DV, Perkin Elmer), triplicating the results.

Effect of time

The effect of contact time that affects the ZnO-MXene (adsorbent) and metal ions is illustrated in Fig. 8a. As seen in the figure, the ZnO-MXene composite and the metal ions in the water solution interact more intensely as the adsorption period goes on, gradually increasing the adsorption capacity. Because there are many active adsorption sites available in the early stages, metal ions can diffuse and adhere to the adsorbent surface quickly through processes such as ion exchange, surface complexation, and electrostatic attraction. A steady adsorbed layer is created as more metal ions move towards the adsorbent and remain immobilised on its surface over time, filling open binding sites. The intrinsic physicochemical characteristics of Cd2+, which include its hydration energy, ionic radius, and electronic configuration, that impact its interaction with the adsorbent surface, are responsible for the observed reduced adsorption of cadmium ions as compared to other metal ions. Due to fewer advantageous surface binding interactions, the ZnO-MXene nanocomposite shows a comparatively lower affinity for cadmium. This could be the consequence of competing with other metal ions that have higher binding inclinations and stronger attraction forces. Cadmium’s capacity to create stable coordination bonds may also be further restricted by steric hindrance or variations in the distribution of charges on the adsorbent surface, which would lower its total adsorption effectiveness. The diversity in adsorption capacity amongst various metal ions thus emphasises the significance of the surface chemistry, ion characteristics, and competing adsorption dynamics for determining the overall efficacy of the adsorbent material, even as the process of adsorption continues over time.

Because of advantageous electrostatic attraction, surface complexation, and possible chemical bonding mechanisms, lead, chromium, and arsenic ions show a strong initial affinity for the ZnO-MXene nanocomposite, enabling quick sorption on the adsorbent surface. Because of their electric charge density, ionic radii, and hydration energies, these metal ions have a high adsorption efficiency because they can interact with the functional groups on the adsorbent surface in an efficient manner. The adsorption time restriction for the experimental investigation was set at 55 min because further would result in decreasing adsorption efficiency returns as well as increased operating costs. Longer adsorption durations may lead to higher energy consumption, higher processing costs, and decreased viability for large-scale implementations in real-world wastewater treatment applications. To reconcile adsorption effectiveness and economic viability, the ideal time for contact must be determined. To increase adsorption efficiency while keeping costs down, more parametric experiments involving changes in pH, adsorbent dose, and temperature can be investigated.

To ensure a controlled experimental environment for assessing adsorption performance, the investigation was carried out using initial metal ion concentrations of 0.12 ppm for chromium, 0.0087 ppm for cadmium, 0.067 ppm for lead, and 0.043 ppm for arsenic. To guarantee even dispersion and efficient metal ion-adsorbent interactions, 0.05 g of the nanocomposite dose was added to the wastewater specimens, which were then agitated at 200 rpm in an orbital shaking device under ambient conditions. Strict measures were also made to preserve the wastewater sample’s integrity by avoiding contamination from outside sources, guaranteeing that the interactions among ZnO-MXene and the specifically targeted metal ions were the only factors influencing the adsorption process. This carefully regulated environment guarantees precise adsorption analysis and offers trustworthy information about ZnO@MXene’s potential for wastewater treatment uses. Figure 8a shows that analysis of the chromium, cadmium, lead, and arsenic ion adsorption behaviour on the ZnO-MXene nanocomposite over time showed that the metal ion species and their suitability for the adsorbent surface affected the adsorption effectiveness. The maximum adsorption efficiency was shown by chromium ions, which increased from 91.80 to 97.20% in 45 min, suggesting a robust interaction between the binding sites on ZnO-MXene and Cr ions.

The substantial charge density and advantageous electrostatic interaction of Cr ions with the surface of an adsorbent may be the cause of this. The adsorption efficiency of cadmium ions, on the other hand, increased from 83.89 to 90.68%, indicating a poorer binding affinity with the adsorbent. This decreased affinity could be caused by steric hindrance effects that restrict its adsorption ability as well as Cd2+’s higher hydration energy, which reduces its likelihood of dehydration and interaction with surface functional groups. From 87.86% at 5 min to 96.98% at 50 min, lead ions demonstrated notable adsorption, suggesting an intense bond and stable complex formation with the adsorbent. Arsenic ions were similarly adsorbed successfully, showing that ZnO-MXene can effectively capture and hold As ions. For 45 min, removal efficiency increased from 86.32 to 95.96%. To record the dynamic variations in adsorption rate and assess the impact of varied contact duration on metal ion removal, the dynamics of adsorption were examined at 5-minute intervals. A thorough grasp of adsorption mechanisms is made possible by this time-based method, which also helps to optimise operating conditions for the effective and economical removal of heavy metal pollutants from wastewater.

Effect of dosage

The dose of ZnO-MXene nano adsorbents was carefully adjusted between 0.05 g and 0.5 g to assess their adsorption ability for the elimination of hazardous metal ions from wastewater. Because there are fewer active adsorption sites available at lower dosages (0.05 g), the adsorbent may not be able to hold as many metal ions, which could result in decreased removal effectiveness. This restriction results from the fact that a lesser amount of adsorbent provides fewer binding sites, which in turn limits the overall adsorption capacity. On the other hand, raising the dosage to 0.5 g increases the number of metal ion adsorption sites accessible, which could improve the removal efficiency overall. The ability of metal ions to bound binding sites may be hampered by particle aggregation, which can cause the surface sites to reach saturation or see a decrease in adsorption per unit mass. As a result, excess adsorbent loading might not always correspond to a proportionate increase in adsorption capacity. Without appreciable improvements in adsorption efficiency, this phenomenon, known as the adsorbent overloading effect, may result in inefficient use of the nanomaterial and raise operating expenses. To ensure both cost-effectiveness and excellent adsorption capacity, the goal of this study is to determine the ideal adsorbent dose that maximises removal efficiency while minimising material usage. A balance between performance and economic viability can be achieved by examining the adsorption performance over the chosen range (0.05 g to 0.5 g), which will direct the development of sustainable wastewater treatment procedures. Small doses of adsorbent are evaluated to determine its effectiveness before being scaled up for commercial uses, and this clinical dosage range is frequently used in lab-scale investigations to mimic real-world settings. This study intends to improve the practical application of ZnO-MXene composites for substantial wastewater treatment by optimising the dosage while guaranteeing resource-efficient and financially feasible heavy metal removal.

ICP-OES analysed the initial and final concentration, the results of which are shown in Fig. 8b. To ensure consistency in the adsorption evaluation, the working volume in this study was 100 mL of wastewater, but the initial metal ion concentrations were kept the same as described in the effect of time parametric experiments. The contact time was set at 10 min for every experimental run (although in contrast to the time-dependent investigations), the emphasis here was on the impact of adsorbent dosage change. Further, in order to separate the effect of dosage on the rate of adsorption and avoid protracted contacts that can mask the effect of dosage change, a consistent contact time was maintained. An orbital shaker set at 200 rpm was used to carry out the adsorption procedure under controlled conditions. This improved mass transfer and homogenous mixing amongst the metal ions in water samples and the binding sites of the ZnO-MXene nano adsorbent. Metal ions were able to interact efficiently with the active surface sites because of the constant agitation, which also reduced mass transfer resistance and guaranteed uniform dispersion of the adsorbent particles. With consistent hydrodynamic circumstances, this configuration allowed for a more precise evaluation of the effects of varying adsorbent dosages on adsorption efficiency.

To make the adsorption method not only efficient but also financially feasible for possible large-scale wastewater treatment applications, the experimental strategy sought to maximise the adsorbent dosage needed for optimal removal efficiency within a brief contact period. As seen in Fig. 8b, the work confirms the excellent adsorption capacity of ZnO-MXene composites towards heavy metal removal by showing that the removal performance of metal ions increases with increasing adsorbent dosage. The increased surface area brought about by a larger number of adsorbent particles in the water solution is the main cause of the improvement in removal efficiency. Because more active binding sites are introduced by a higher adsorbent dosage, there are more interactions among the metal ions and the nano adsorbent surface, increasing the adsorption capacity. Since there is a greater surface area available, metal ions stick onto the adsorbent surface more readily at higher dosages. As a result, it is shown that the removal rate gradually increases with the dosage of the adsorbent. Higher dosages may cause the metal ions to form insoluble precipitates rather than adhere to the adsorbent, as this might imply the deposition of metal ions instead of surface adsorption if the rate of removal were to drop despite an increase in dosage. The solubility of metal ions may be affected by changes in liquid chemistry, such as pH fluctuations, or by excessive adsorbent saturation. The capacity of the adsorbent to surpass mass transfer resistance, which usually serves as a limiting factor in the transport of heavy metals from the aqueous phase into the solid adsorbent phase, is ultimately responsible for the better removal efficiency seen with increased adsorbent dosage. The higher adsorbent dosage speeds up the adsorption kinetics by efficiently lowering mass transfer barriers and improving the overall efficacy of ZnO-MXene composites in the treatment of wastewater applications.

Effect of temperature

One important factor influencing the thermodynamic viability and effectiveness of the adsorption process is the effect of temperature that affects the adsorption of heavy metals by ZnO-MXene nano adsorbents. To learn how temperature changes impact adsorption capacity, the interdependency between temperature & the concentration of heavy metal ions deposited on the nano-adsorbent interface at the ideal contact time was examined. Temperature was the primary variable that changed in this investigation because the initial amounts of metal ions found in the wastewater specimen were kept constant with earlier experimental configurations. To ensure a controlled assessment of adsorption behaviour free from the influence of fluctuating adsorbent mass, the amount of adsorbent used was set at 0.05 g for each sample. The sample was constantly agitated at 200 rpm in a shaking device at room temperature to promote even mixing and interactions among the heavy metal ions and active sites of adsorption. Adsorption dynamics are greatly impacted by temperature, which affects the metal ion diffusion rate, the intensity of the adsorbent-adsorbate interaction, and the desorption characteristics of newly adsorbed species. By giving metal ions more energy to break the activation barriers, a temperature rise can frequently improve adsorption by increasing surface diffusion and binding site accessibility. However, by interfering with weak physical interactions like van der Waals forces and electrostatic attractions, extremely high temperatures can cause desorption effects, which lower adsorption effectiveness. Optimising adsorption settings in practical applications requires an improved understanding of whether or not the process is endothermic or exothermic, which can be achieved by evaluating the adsorption behaviour at various temperatures. The viability, spontaneity, and sorption technique of ZnO-MXene adsorbent for heavy metal removal is clarified by this thermodynamic analysis, guaranteeing its usefulness in the treatment of wastewater under various environmental circumstances.

As demonstrated in Fig. 8c, as the temperature rose from 35 to 70 °C, the adsorption behaviour of metallic ions upon the ZnO-MXene nano adsorbent surface started to decrease, suggesting a temperature-dependent adsorption mechanism. The process of adsorption is exothermic, which means that lower temperatures promote metal ion adhesion to the adsorbent surface, as indicated by a decrease in removal effectiveness with rising temperatures. Even though MXenes have a high degree of thermal stability, there are several reasons why their adsorption efficacy decreases at increasing temperatures. One of the main causes is that high temperatures can cause desorption effects, in which the adsorbed metal ions’ kinetic energy rises and the interactions with the sites that are active are weakened, causing them to return to the solution. Furthermore, some metal ions may experience complexation or hydrolysis processes at higher temperatures, generating precipitates rather than staying in their state as ions for adsorption. The measured removal effectiveness is decreased by these precipitated metal species’ ineffective adhesion to the ZnO-MXene surface. The rise in system entropy (randomness), that upsets the adsorption equilibrium, is another important factor affecting adsorption at high temperatures. Because metal ions tend to create strong, stable interactions with adsorbent active sites, adsorption is often more advantageous in systems with reduced entropy. However, the system’s entropy grows with temperature, leading to an equilibrium shift that favours desorption over adsorption and decreases the removal of metal ions. This occurrence is consistent with the ideas of thermodynamic spontaneity, which states that a temperature rise can change the system’s ΔG and possibly hinder the adsorption process. As a result, the study demonstrates that ZnO-MXene nano adsorbents are more effective at lower temperatures, which makes them appropriate for uses in which adsorption takes place at room temperature or slightly higher temperatures. Optimising real-world wastewater treatment procedures requires an understanding of this temperature dependence to maintain the structural integrity of the nano adsorbent and maximise adsorption efficiency.

Effect of pH

pH directly affects the adsorbent’s surface charge, the formation of metal ions in aqueous solution and the entire adsorption mechanism, hence, it is a critical factor in determining the effectiveness of metal ion removal using the adsorption process. The wastewater sample was changed to various pH levels using NaOH for alkali settings and nitric acid (HNO2) for acidic environments to methodically examine the impact of pH. Following the charge associations between the adsorbent material and the metal ions in solution, the addition of HNO₃ promoted protons of the absorbent surface, which can either facilitate or inhibit metal ion adsorption. Reduced adsorption effectiveness might result from abundant H+ ions competing with metal ions for active sites of adsorption in extremely acidic conditions. In contrast, the addition of NaOH raised the pH in alkaline circumstances, which may have improved metal ion adsorption by deprotonating functional groups on the ZnO-MXene surface. This can result in the creation of more negatively charged sites for metal-cation interaction. But instead of staying in an ionic state for adsorption, some metal ions may precipitate as hydroxide complexes, such as M(OH)x, at extremely high pH values. Since heavy metals are no longer accessible in their natural ionic state as a result of this precipitation effect, there may appear to be a decrease in adsorption efficiency, but this is not because the adsorbent performs worse.

To make certain that the exhibited adsorption behaviour was due to surface contacts and not unintended chemical precipitation, the pH adjustment procedure was meticulously regulated. The study sought to determine the ideal pH range for maximising metal ion sorption while avoiding competing adverse impacts that could affect adsorption effectiveness by methodically changing and maintaining pH throughout a range of temperature settings. Comprehending the impact of pH is essential for streamlining actual wastewater treatment procedures, guaranteeing optimal adsorption effectiveness while preserving systemic chemical stability. Figure 8d demonstrates that under the same adsorption conditions and conditions, the adsorption capacity of ZnO-MXene adsorbent for the removal of metal ions from wastewater was assessed, highlighting the impact of variations in pH on adsorption efficiency. The study demonstrates that metal ion removal effectiveness falls with increasing pH, suggesting that states of acidity are better for adsorption.

The wastewater solution’s metal ions disintegrate more efficiently at lower pH values, staying within their ionic state and thereby rendering them easily accessible for sorption onto the nano adsorbent’s surface. Electrostatic attraction and surface adsorption mechanisms work together to produce adsorption in these acidic circumstances, wherein the metal ions that are positively charged have a significant interaction with the terminal groups on the surface of the adsorbent. ZnO@MXene’s adsorption capability is increased by this dual adsorption mechanism. However, metal ions’ capacity to stick to the adsorbent surface decreases when the system’s pH rises towards alkaline conditions. The proportion of free metal ions in water for adsorption is decreased at higher pH values due to the tendency of metal ions to hydrolyse and precipitate, generating insoluble hydroxide complexes (M(OH)x). In extremely alkaline conditions, this results in a decrease in adsorption effectiveness and the failure of the nano adsorbents.

The findings also show how MXene and its hybrids perform better at adsorption in acidic media than in alkaline media, which makes them ideal for treating wastewater in acidic environments. Increased metal ion interactions on the adsorbent surface in acidic conditions greatly improve the adsorption performance of MXene-based nano adsorbents, even if they still maintain excellent removal capacity at neutral pH (pH 7). Furthermore, the study indicates that the adsorbent can be efficiently regenerated using methanol or alkali washes following adsorption, allowing for their reuse in later adsorption cycles. The practical use of ZnO-MXene in the treatment of wastewater depends on its capacity for desorption and regeneration, which guarantees sustainable and reasonably priced metal ion removal.

Fig. 8
figure 8

Effect of (a) Time, (b) Dosage, (c) Temperature and (d) pH.

Effect of initial concentration

To assess the sorption ability and efficacy of ZnO-MXene nano adsorbents, the impact of the initial metal ion levels in the sample of wastewater was methodically investigated by varying the concentration at predetermined intervals. Adsorption equilibrium, mass transfer rate, and binding site occupancy on the adsorbent surface are all significantly influenced by the initial concentration of metal ions. Consistent distribution of metal ions before the adsorption process was ensured by carefully adding hydrated salts of metal ions to the wastewater solution at varying weight percentages to create controlled changes in concentration. A thorough examination of how different concentrations affect the adsorbent’s affinity, sorption kinetics, and total removal effectiveness was made possible by this carefully managed alteration. The majority of the metal ions could be accommodated by the sites that are active on the ZnO-MXene surface at lower starting concentrations. This led to a better adsorption efficiency since there were more binding sites than there were ions in the solution. However, competing for active adsorption sites grew more intense as the initial concentration rose. This resulted in a situation where the adsorbent surface gradually got saturated, which caused the adsorption effectiveness to gradually decrease at higher concentrations. Under such circumstances, the adsorption process is mainly controlled by mass transfer and diffusion constraints, where the concentration gradient serves as the driving force for sorption and metal ions must move from the bulk stream to the adsorbent surface. This research is crucial for figuring out the ZnO-MXene nanocomposites’ adsorption capacity at different metal ion concentrations as well as the saturation point at which more metal ions cannot be adsorbed since there aren’t enough active sites available. The information gathered sheds light on the adsorption isotherms, which aid in comprehending how metal ions and the nano adsorbent interact. Additionally, by guaranteeing that the quantity of adsorbent is suitably matched to the pollutant load, this knowledge helps to optimise the treatment of wastewater conditions by avoiding the abuse of nanomaterials while attaining optimum removal effectiveness.

The effect of initial concentration on the adsorption process is plotted in Fig. 9. As seen, the ZnO-MXene nano adsorbent adsorption capability and overall performance progressively decrease as its initial concentration of heavy metal ions in water rises. The limited number of active sites for binding on the surface of the adsorbent, which gets saturated as additional metal ions try to adhere, is the cause of this decrease in adsorption effectiveness. Because of an intense bond between the heavy metal ions and the ZnO-MXene composite, the adsorbent surface first offers enough active sites to enable effective adsorption at lower metal ion concentrations. The available surface area, however, becomes a limiting factor as the concentration rises, restricting the adsorption of more metal ions above the saturation threshold. The adsorption capacity is further decreased when the sites used for adsorption are completely occupied because any extra metal ions in the solution are unable to bind efficiently and can even desorb from earlier used sites. Additionally, because of their considerable affinity for the adsorbent, metal ions exhibit a competitive influence at increasing concentrations, trying to occupy the few active sites. A plateau in adsorption efficiency arises from the adsorbent reaching an equilibrium state when it can no longer hold more metal ions due to its limited number of functional groups and sites for adsorption. At higher concentrations, the removal efficiency is reduced because the unadsorbed heavy metal ions stay in the solution. This behaviour implies that the ratio of the quantity of metal ions in solution to the accessible active sites is crucial for adsorption. The experimental findings indicate that as the ZnO-MXene adsorbent achieves saturation and stops offering new binding sites, the adsorption capability falls at higher starting metal ion concentrations. To maximise removal effectiveness and avoid desorption effects that could jeopardise the overall adsorption performance, it is crucial to optimise the adsorbent dose in relation to the concentration of metal ions.

Fig. 9
figure 9

Effect of initial concentration on removal (%).

There are multiple environmental factors, majorly the pH, ionic strength and competing ions that also influence the adsorption efficiency of the ZnO-MXene for targeted metal ions. These parameters are likely to tune the surface charge, reactivity and accessibility of binding sites through which the efficiency and performance of the composite material can be studied.

pH can tune the surface of the adsorbent making it either more attractive or repulsive to the targeted metal ions to get adsorbed on the adsorbent sites. At lower pH or in an acidic medium, there are high chances that the metal ions get precipitated out due to acidity and tend to get adsorbed on the active sites of the adsorbent. At higher pH, there is less chance that the metal ions precipitate and hence the adsorption efficiency decreases.

Ionic strength can tune the electrostatic attractions between the adsorbent and the adsorbate. Increased ionic strength can diminish electrostatic interactions and reduce adsorption effectiveness by compressing the electrical double layer surrounding the adsorbent surface. Targeted metal ions alongside other ions in the wastewater may compete for the active sites on the ZnO-MXene adsorbent surface as a result of increased ionic strength.

The targeted metal ions may face direct competition for adsorption on active sites of ZnO-MXene adsorbent from the existence of other ions in wastewater. This is especially crucial when ions are competing for the exact same adsorption sites due to their similar size and charge. Certain ions might be more attracted to the ZnO-MXene surface than others, which could result in preferential adsorption and the displacement of specific metal ions.

Predictions of removal (%) using ML approach

The effectiveness of ML models such as SVM, and RF approaches in precisely forecasting the proportion of pollutants removed during adsorption processes is assessed in this study. Initial concentration, final concentration, adsorption time, adsorbent dosage, adsorbent pH, and adsorption temperature are the input parameters, while the output parameter is the removal percentage. The RMSE, MAE and MAPE were the three main metrics used to assess the models. With default parameter settings, the SVM train model produced RMSE, MAE, and MAPE values of 3.64, 2.37, and 2.79%, respectively. As seen in Fig. 10a, the RF model outperformed the SVM model with significantly lower RMSE (0.56), MAE (0.33), and MAPE (0.39%) values. The SVM and RF hyperparameters were optimised to enhance model performance using grid search techniques. After optimisation, there were noticeable improvements in the models’ training performance. The optimised SVM model achieved the training MAE of 0.72, the RMSE of 1.31, and the MAPE of 0.83%. In addition, a reduced RMSE of 0.55, MAE of 0.30, and MAPE of 0.38% demonstrates that the RF model was more accurate, as seen in Fig. 10b. These outcomes indicate that hyperparameter adaptation considerably improves the predictive capacity of both models, with the RF model consistently outperforming the SVM model.

In predictive modelling, 10-fold cross-validation is an essential technique for evaluating a model’s performance. This technique implies that the predicted accuracy is systematically assessed by splitting the dataset into ten subsets or “folds” and incrementally training the model on nine of them in a sequence while validating it on the remaining one. The final performance measurements are analysed after 10 iterations of the process, yielding a reasonable interpretation of the model’s generalisation ability. This method minimises the risks of overfitting and ensures that the model’s performance is not disproportionately dependent on any one set of data. The results indicated that the RF model consistently outperformed the SVM model across all evaluation criteria. The SVM model’s 10-fold cross-validation RMSE, MAE, and MAPE values were 3.89, 2.70, and 3.20%, respectively, as observed in Fig. 10c.

In contrast, the RF model had significantly impressive outcomes, with an RMSE of 1.36, MAE of 0.76, and MAPE of 0.92%. These findings suggest that the RF model is more effective at capturing the basic relationships between the input parameters and removal (%), even when hyperparameter modification is not used. The predictions of the optimised models illustrate that, in comparison to the default hyperparameter, there have been substantial improvements in prediction accuracy. 10-fold cross-validation yielded RMSE, MAE, and MAPE values of 1.54, 1.08, and 1.24% for the improved SVM model, respectively. With RMSE, MAE, and MAPE values of 1.30, 0.70, and 0.85%, respectively, the RF model yielded even better results, Fig. 10d. These enhancements demonstrate how well hyperparameter adjustment raises both models’ prediction ability. Even after optimisation, the RF model outperforms the SVM model because it can capture intricate nonlinear correlations and interactions between the adsorption parameters. Furthermore, 10-fold cross-validation guarantees robust evaluation and offers trustworthy performance indicators by minimising reliance on any data sample. Optimising adsorption operations and increasing pollutant removal effectiveness can be accomplished with the enhanced RF model, which shows promise as a dependable and accurate method for estimating removal (%).

Fig. 10
figure 10

(a-d) Performance of SVM and RF Models in predicting removal (%).

Adsorption isotherm

Langmuir isotherm

The plot of Langmuir Isotherm for all the metal ions studied for adsorption over the ZnO-MXene surface is shown in Fig. 11a. The Langmuir isotherm demonstrated a superior fit to the experimental data with greater correlation coefficients for each metal ion. The maximum adsorption capacity (Qmax) for chromium, cadmium, lead and arsenic were found to be 107.76 mg/g, 6.65 mg/g, 58.44 mg/g and 36.62 mg/g, respectively. The higher R2 value indicates favourable adsorption of the metal ions onto the surface of the selected adsorbent for removal. The separation factor (RL) was also calculated, and the values for chromium, cadmium, lead and arsenic were found to be 4, -3, -1 and − 6, respectively. From the separation factor values, it can be concluded that chromium removal is unfavourable based on the assumptions of the Langmuir isotherm. In contrast, the adsorption is irreversible for cadmium, arsenic, and lead, meaning that the metal ions will be difficult to desorb into the bulk phase. Moreover, the reusability and regeneration of the adsorbent will be quite difficult for the next adsorption cycles40. The Freundlich and Langmuir constant values are given in Table 9.

Freundlich isotherm

As given in Table 4, the intercept and slope-based results for n and KF are obtained after plotting ln Cf against ln qf as shown in Fig. 11b. The adsorption capacities KF of chromium, cadmium, lead and arsenic were obtained to be 6.92 mg/g, 1.57 mg/g, 5.09 mg/g and 4.01 mg/g, respectively, as shown in Table 9. It can be concluded that the adsorption process of metal ions over the adsorbent’s surface favours the Freundlich isotherm. In the Freundlich model, the coefficient of determination (R2) value is also closer to 1, which suggests that the model is more favourable than the Langmuir model, which has values that are not close to 1 compared to Freundlich model values. The ‘n’ parameter in the Freundlich model describes the adsorption intensity and process of the metal ions onto the adsorbent. A lower value of ‘1/n’ indicates more favourability of the process, more uniformity of adsorption sites and less heterogeneous sorption behaviour and at lower concentrations, the metal ions tend to adsorb on the surface more rapidly and easily. This constant represents the material’s adsorption capability.

A larger adsorption capacity is indicated by a higher KF value. A high KF in ZnO-MXene composites would suggest that the material can adsorb a lot of metal ions onto its surface. This is probably because the material has a lot of functional groups, like hydroxyl (O−H) groups and metal-oxygen linkages (Zn –O and Ti–C). The unique interactions of ZnO and MXene with the metal ions under study (such as Cr, Cd, Pb, and As) should be taken into account when interpreting the KF value, which indicates how well the adsorbent attracts metal ions.

The adsorption efficiency and the heterogeneity of the surface of the adsorbent are shown by the value of 1/n. The process of adsorption is favourable if 0 < 1/n < 1, meaning that metal ions selectively adsorb onto accessible sites. Adsorption is considered unfavourable if 1/n > 1, which could be a sign of repulsive interactions or competitive adsorption. As the 1/n value between 0 and 1 for the ZnO-MXene composites would suggest that the surface of the composite is favourable for metal ion adsorption, with the rate of adsorption increasing as the surface sites are gradually occupied. The model does not give exact values for Qmax, as the Freundlich model assumes that a non-uniform surface varies with varying adsorption energies, which means that it represents a more generalised capacity that rises with the adsorbate concentration rather than having a finite maximum capacity41.

Table 9 Langmuir and Freundlich constants for metal ion removal.
Fig. 11
figure 11

(a) Langmuir Isotherm; (b) Freundlich Isotherm.

Adsorption kinetics

The plot for the pseudo-1st -order rate kinetics is shown in Fig. 12a. From the intercept and the slope values of the graphs, the rate constant (k1), equilibrium adsorption capacity (Qe) and R2 values are calculated, which will determine the effective model fitting and the values are given in Table 10. The results confirm that the 1st order rate kinetic model was not fit for the adsorption kinetics for the adsorption of metal ions on the surface of ZnO-MXene nanocomposite. From the model, it can be seen that the equilibrium adsorption capacity values are much lower for all the metal ions targeted.

Figure 12b provides the plot between \(\:\frac{t}{{q}_{t}}\) vs. t. From the intercept and the slope values of the graphs, the rate constant (k1), equilibrium adsorption capacity (Qe) and R2 values are calculated, which will determine the effective model fitting and the values are given in Table 10. It can be observed that the equilibrium adsorption capacity of the metal ions on the adsorbent surface is higher than that of the values obtained by the 1st order kinetic model. The regression values are also closer to 1, concluding that the model fits the mechanism of the 2nd order model42.

Table 10 Pseudo 1st and 2nd order kinetic model parameters.
Fig. 12
figure 12

(a) Pseudo 1st order rate kinetic model; (b) Pseudo 2nd order rate kinetic model.

Adsorption thermodynamics

Like any other phase equilibrium, the adsorption equilibrium can be studied using a thermodynamic technique. The sole broad premise of the thermodynamic approach is that the layer of adsorbed metal ions can be considered a different phase from the bulk phase43. The adsorbed surface layer of metal ions can be regarded as a single phase with bulk solution-like characteristics. However, it is believed that the adsorbent ZnO-MXene is thermodynamically inert. Once metal ion adsorption on the ZnO-MXene surface achieves an equilibrium state, there is no longer a tendency to alter metal ion concentrations on the adsorbent surface or in an aqueous solution. This is because the adsorption process is spontaneous in both directions, and the ∆G is zero at equilibrium. The rate of metal ion adsorption onto the adsorbent surface equals the rate of metal ion desorption from the adsorbent surface at equilibrium. Metal ion concentration in an aqueous solution and on the surface of the adsorbent becomes nearly constant44.

The thermodynamic parameters responsible for understanding the adsorption mechanism of metal ions on the surface of the ZnO-MXene nano adsorbents are determined as shown in Table 11. Results indicate that the adsorption is spontaneous and feasible (as it is a negative value for all metal ions); endothermically, the metal ions are adsorbed on the adsorbent surface (as the enthalpy is positive). As the entropy is close to 0 and negative, it can be said that the adsorption of metal ions occurs with a decrease in randomness at the solid-liquid interface at no temperature.

Table 11 Thermodynamic parameters.

Discussion on inherent mechanisms

The sorption of chromium (Cr), cadmium (Cd), lead (Pb), and arsenic (As) over ZnO-MXene relies on multiple surface exchanges, including the process of complexation electrostatic attraction, ion exchange, surface precipitation, and probable redox reactions. As primary adsorption sites, ZnO-MXene nano adsorbents have oxygen-containing functional groups like hydroxyl (OH), carboxyl (COOH), oxide (O), and Ti−O−Ti/Zn−O−Zn bonds. Depending on the size and charge of the ions, the adsorption of metal ions probably involves inner-sphere and outer-sphere complexation.

Cr (VI) typically exists as CrO₄²⁻ or HCrO₄⁻ in solution. ZnO-MXene may assist its oxidation to Cr (III) via electron transmission, allowing thereafter adsorption via hydroxyl coordination:

$$\:{\varvec{H}\varvec{C}\varvec{r}\varvec{O}}_{4}^{-}+{3\varvec{e}}^{-}+{7\varvec{H}}^{+}\to\:\:{\varvec{C}\varvec{r}}^{3+}+\:{4\varvec{H}}_{2}\varvec{O}$$

On the surface of MXene, Pb (II) and Cd (II) metal cations combine with carboxyl and hydroxyl groups to create stable complexes. Additionally, Pb²⁺ can precipitate on the surface and create Pb (OH)2 in somewhat alkaline circumstances. Arsenic species interact with ZnO via ligand exchange mechanisms, where AsO₄³⁻ displaces hydroxyl groups on the adsorbent’s surface.

Metal ions could replace preexisting surface electrons (H⁺ or Na⁺), particularly for Pb²⁺ and Cd2+. Pb2+ and As (III/V) may produce insoluble hydroxides under specific circumstances, which would decrease their mobility in solution.

The special characteristics of the material and the thermodynamic factors related to the interaction influence several important processes in the ZnO-MXene adsorption mechanism for metal ions. Firstly, ZnO@MXene’s surface functional groups, such as hydroxyl (− OH) & carboxyl (− COOH) groups, are essential for promoting the adhesion of metal ions.

The adsorption of targeted metal ions gets adsorbed on the adsorbent surface depending on the thermodynamic parameters, rate kinetics and adsorption isotherm results. Initially, the adsorption process can be understood in 3 different stages:

  1. 1.

    Diffusion: Metal ions move towards the ZnO-MXene surface via diffusion from the bulk solution. Concentration gradients and variables like temperature and agitation can impact this first phase.

  2. 2.

    Surface interaction: When metal ions reach the surface of the adsorbent, they engage in coordination bonding, hydrogen bonding and electrostatic attraction with the functional groups. Stable adsorption results from donating pairs of electrons from the oxygen atoms within group function to metal ion empty orbitals, which creates coordinate bonds.

  3. 3.

    Complex formation: To improve retention and stop desorption from returning to the solution, more metal ions may attach to the surface and form complexes with several functional groups.

Diffusion, interactions with terminal groups, formation of various complexes and thermodynamic variables are all part of the overall well-coordinated adsorption pathway of ZnO-MXene for metal ions. The potential of ZnO-MXene in environmental remediation applications is highlighted by its efficient adsorbent for extracting metal ions from contaminated water sources due to its large surface area, reactive terminal groups and advantageous thermodynamic characteristics. As seen in Fig. 13 initially, the metal ions of chromium, cadmium, lead and arsenic tend to attach on the surface of the adsorption using electrostatic attraction. In the later stage, as the time of adsorption increases, the metal ions tend to bind with the surface due to the presence of multiple terminal groups on the adsorbent surface.

Fig. 13
figure 13

Adsorption Mechanism of Metal Ions on ZnO-MXene surface.

The adsorption mechanism is more suggestive of chemisorption in light of these characteristics, particularly the positive ΔH and negative ΔS. The adsorbate is arranged more formally on the adsorbent surface due to stronger contacts (perhaps covalent or ionic bonds), which is indicative of the chemisorption rather than physisorption, even though the process is spontaneous.

Conclusion

The in-situ HF method successfully created ZnO-MXene nanocomposites, which are used as nano adsorbents for treating wastewater contaminated with heavy metals such as Cr, Cd, Pb, and As. Significant interactions among heavy metal ions with the ZnO-MXene nanocomposites were shown by adsorption isotherm investigations, suggesting a high susceptibility to pollutants. These results validate that the primary mechanism guiding the adsorption process is chemisorption. Thermodynamic investigations revealed that the adsorption process occurs spontaneously and favourably under experimental conditions, whereas the rate kinetics analysis showed that adsorption is quick and effective. These results thus demonstrate ZnO-MXene nanocomposites’ promise as an efficient and environmentally friendly wastewater treatment option.

Additionally, applying ML techniques offered helpful insights on enhancing adsorption performance. Using SVM and RF modelling in combination with hyperparameter change resulted in notable improvements in prediction accuracy. Using 10-fold cross-validation, the optimised SVM model demonstrated good prediction skills by producing outcomes with RMSE, MAE, and MAPE corresponding to 1.54, 1.08%, and 1.24%, respectively. With RMSE, MAE, and MAPE corresponding to 1.30, 0.70, and 0.85%, respectively, the RF model outperformed the others. These improvements show how ML can precisely forecast adsorption efficiency and optimise operating settings. These results demonstrate that ZnO-MXene nanocomposites serve as a state-of-the-art wastewater treatment material by fusing sophisticated prediction modelling with experimental validation. In addition to enhancing our comprehension of adsorption mechanisms, integrating material development and ML techniques opens up new avenues for developing and deploying effective environmental cleanup systems. These results open new avenues for studying ZnO@MXene-based devices for practical and large-scale uses.