Document Type : Original Research Paper
Graphical Abstract
Highlights
Machine learning is used to optimize and to predict ZnO-based TFN membranes.
5-fold cross-validation and comprehensive hyperparameter tuning were employed.
R2 of 98.71% and 98.66% were achieved for water flux and salt rejection prediction.
SHAP feature importance was used to find key factors.
Solvent, substrate type and nanoparticles load were main factors.
⚠️ THE FOLLOWING SECTION IS TEXT-ONLY
No equations, tables, figures, or color graphics are shown below. For the complete version, please use the free PDF available on this page (top right).
1. Introduction
In recent years, there has been a rapid increase in population, industrialization, and urbanization, resulting in an overconsumption of clean water resources; hence, clean water scarcity has become a major concern for the world [1]. Reusing and desalinating water have been effective means of boosting freshwater supplies in local areas, which has led to sustainable water management on a global scale. Due to excessive surface and groundwater use, coastal aquifers are threatened by seawater intrusion. There is a serious problem in that the only sources of water supply that are still being used are seawater desalination and brackish water [2-4]. Several dry regions around the globe have benefited from desalination, which separates minerals from saltwater in order to provide freshwater [5].
With exceptional separation efficiency, a compact footprint, and relatively low energy consumption, membrane -based technologies are increasingly recognized as reliable solutions to the global water challenges [6]. Approximately 90% of all global desalination capacity is derived from reverse osmosis (RO) technology, which uses semipermeable membranes to remove salts and other minerals [7]. Currently, the predominant composition for RO membranes is polyamide (PA) thin-film composites (TFCs) manufactured through interfacial polymerization (IP). While TFC RO membranes come with certain benefits, they also present drawbacks, including limited chlorine stability, a shorter lifespan, and reduced hydrophobicity. These factors can result in decreased membrane permeation and significant fouling over prolonged usage [8, 9].
To overcome these limitations, thin-film nanocomposite (TFN) membranes have emerged as a promising next-generation alternative. In a seminal study, Jeong et al. [10] introduced the incorporation of nanomaterials into the aqueous phase during the IP process, enabling a more favorable trade-off between water permeability and salt rejection. Since then, extensive research has demonstrated that embedding nanomaterials within the PA selective layer can significantly enhance membrane hydrophilicity, surface morphology, and transport properties [8]. During IP, the PA layer is formed through the reaction between m-phenylenediamine (MPD) and trimesoyl chloride (TMC), dissolved in water and n-hexane, respectively, while nanomaterials are dispersed within the monomer phase to modify the resulting membrane structure.
Various metal oxides find water treatment application in TFN membranes, including nanoparticles of aluminum oxide (Al2O3) [11], manganese oxide (MnO2), copper oxide (CuO) [12], iron oxide (Fe2O3 and Fe3O4) [13, 14], titanium dioxide (TiO2) [15], and zinc oxide (ZnO) [16]. ZnO nanomaterials stand out for their distinctive features: high surface area, excellent photocatalytic properties (wide bandgap of 3.37 eV), low toxicity, and adaptability in shaping [17, 18]. The nanosized ZnO structures offer stability, improve crystallinity in polymeric matrices, and, with fewer defects than other semiconductors, serve as an ideal filler for both polymeric and ceramic matrices [19]. In our earlier studies, we effectively showcased the impressive attributes of ZnO nanoparticles in various applications [20-22].
There has been significant interest in employing zinc oxide (ZnO) nanoparticles to enhance membranes for a range of purposes. [23-32], due to their distinctive properties, including hydrophilicity, photocatalytic and antimicrobial activities, and high surface area [33]. As a nanofiller, ZnO nanomaterials have been extensively used to fabricate thin -film nanocomposite (TFN) membranes with improved RO performance [34-37]. Studies have shown that by adding ZnO nanomaterials, hydrophilicity increases, resulting in a more efficient filtration process due to the increased permeated water flux [38-43]. Also, the incorporation of various shapes of ZnO nanofillers improves the performance of TFN membranes, but the spherical nanofillers perform better than the cubic, rod-like, and flowerlike morphologies due to their relatively smaller dimension, which reduces particle aggregation, resulting in a higher water flux [44]. The efficacy of reverse osmosis (RO) desalination is contingent upon multiple factors, encompassing NPs, MPD, TMC concentrations, polymer type, surface roughness, and hydrophilicity [36]. The intricate interplay among these elements, coupled with operating conditions (e.g., applied pressure, feed salinity, temperature), significantly influences the water permeability and salt rejection capabilities of reverse osmosis systems [45]. This multivariate dependency makes rational membrane design through conventional trial-and-error experimentation both time-consuming and resource-intensive. In addition, the nonlinear interactions among these factors make membrane performance prediction and optimization highly challenging using conventional empirical or mechanistic approaches.
In recent years, artificial intelligence (AI) and machine learning (ML) techniques have emerged as powerful tools for modeling, prediction, and optimization of membrane-based separation processes [4, 46, 47]. ML algorithms can effectively capture nonlinear relationships between multiple input variables and membrane performance outputs, enabling accurate prediction without explicit mechanistic formulations. A variety of ML approaches have been applied in membrane science, including support vector regression (SVR), random forest (RF), extreme gradient boosting (XGBoost), and artificial neural networks (ANNs). SVR is valued for its robustness in high-dimensional spaces, RF for its ensemble-based resistance to overfitting, and XGBoost for its strong predictive power in structured datasets. Nevertheless, multilayer perceptron (MLP) neural networks remain particularly attractive due to their universal function approximation capability and superior performance in highly nonlinear systems [48].
An MLP consists of an input layer, one or more hidden layers, and an output layer, with information propagated forward through weighted connections and optimized via backpropagation learning [49]. This architecture enables MLPs to model complex interactions among membrane fabrication parameters and operating conditions, making them well-suited for desalination process modeling. Despite the growing number of ML-based studies on RO and TFN membranes, most existing works either focus on limited datasets, specific membrane systems, or lack rigorous model interpretability and comparative assessment across multiple ML algorithms [46, 48].
In this study, a comprehensive and interpretable machine learning framework is developed to predict water flux and salt rejection of ZnO-modified TFN RO membranes using literature-derived experimental data. Multiple ML models, including MLP, SVR, RF, and XGBoost, are systematically trained, optimized, and benchmarked under identical conditions to identify the most reliable predictive approach. Model robustness is ensured through repeated k-fold cross-validation and extensive hyperparameter tuning. Furthermore, Shapley Additive exPlanations (SHAP) analysis is employed to elucidate the relative importance of key fabrication and operational parameters, thereby enhancing model transparency and practical relevance. To the best of the authors’ knowledge, this is the first study to integrate comparative ML modeling and SHAP-based interpretability specifically for ZnO-based TFN RO membranes, providing both high predictive accuracy and actionable insights for data-driven membrane design and optimization.
2. Methodologies
2.1. Data Collection
The first stage of the current research focuses on the collection of data. In order to achieve this, a search was conducted on Scopus for articles published in the last decade [12, 16, 36, 51-60]. As a result, 1294 data points were obtained from several articles searched through Scopus. These data were extracted from both tables and figures. Additionally, for figures that were challenging to interpret, Plot Digitizer v3 was employed to extract the necessary data. The collected data is categorized into five distinct groups: nanoparticle properties (nanomaterial type, nanomaterial morphology, and, nanomaterial loading), membrane fabrication conditions (substrate type and concentration, amine and chloride monomers concentrations, and, solvent type), Membrane properties (water contact angle, surface roughness), operational conditions (pressure, and, salt concentration) as input parameters, and RO performance (water flux, and, salt rejection) as output parameters. All the parameters are summarized in Table 1.
2.2. Data preparation
In order to construct dependable and precise machine learning models, it is crucial to effectively manage any missing data points. In this study, there are missing values for various variables, including substrate concentration, solvent type, thickness, roughness, contact angle, and salt concentration. To tackle this problem, various approaches can be employed, such as filling in missing values with a fixed constant, the mean, the median, or the most frequently occurring value [61]. For the categorical data of the solvent type, missing values were imputed using the most frequent strategy. Meanwhile, for the numerical variables, missing values were filled in with their respective means. The missing values remained in their original form for models that can handle missing data. Another important challenge is the conversion of categorical data into a numerical format through the process of labeling. This transformation is necessary to enable ANN models to effectively process this type of data. In this work, categorical data were transformed using the LabelEncoder method from the Sklearn library. Before splitting the data into training and testing sets, a crucial preprocessing step involved normalizing the data to a range between 0 and 1. This normalization was achieved using the MinMaxScaler function from the Sklearn library, which applies the following equation:
(1)
2.3. Model description
A neural network is a simulated system that utilizes artificial neurons inspired by the human brain to categorize or forecast outcomes. Through the information provided by input data, artificial neural network (ANN) models acquire the ability to make highly accurate predictions of the outputs. In our research, we employed artificial neural network (ANN) models to approximate water flux and salt rejection. All the ANN models were constructed using Python 3 and incorporated the following functions and libraries: Pandas (1.5.3), Seaborn (0.12.2), SkLearn (2.2.0), Tensorflow (2.13.0), Keras (2.13.1), XGboost (2.0.2), and Shapely (2.0.2).
2.4. Model validation
The accuracy of constructed models is assessed using a loss function, which we have chosen to be the mean squared error (MSE) as in equation (2).
where n signifies the number of data points, is the observed value, and is the predicted value for the ith sample.
3. Results and Discussion
As previously mentioned, the quantity of neurons in an MLP model has an impact on its performance. In order to determine the ideal number of neurons, we assessed the influence of varying neuron counts in a single layer, ranging from 1 to 15, by measuring the R2 and MSE on both the training and testing datasets. Fig. 1 depicts the testing performance, as measured by R2 and MSE, as the number of neurons changes. These results represent the averages obtained from 5-fold cross-validation conducted over 6 independent runs. As shown in Fig. 1, the MSE values for neural networks with 7, 9, and 10 neurons in a single hidden layer are quite similar, measuring 0.00954, 0.00944, and 0.00934, respectively. Furthermore, these specific neuron counts exhibit the highest R2 values for both the training and testing datasets. In the case of 7 neurons, the R2 values for the training and testing datasets are 97.54% and 89.3%, respectively. Similarly, for 9 and 10 neurons, the R2 values are 97.6% and 89.89%, as well as 98 % and 89.75%, respectively.
The next stage involves determining the ideal number of hidden layers. To accomplish this, various configurations with different numbers of hidden layers, each containing 7, 9, and 10 neurons, were assessed, and the results have been illustrated in Fig. 2. The MLP with three hidden layers, renowned for its exceptional performance in diverse applications [45, 62-64], consistently attains the lowest MSE and the highest R2 values for both training and testing data across all three scenarios: when equipped with 7, 9, and 10 neurons in each layer. There are 24 unique combinations when choosing three numbers from the set of 7, 9, and 10 neurons to determine the most suitable hidden layer structure. These 24 configurations were executed five times, employing 5 -fold cross-validation, and the results are illustrated in Fig. 3. Evidently, among all 24 runs, the MLP model featuring three hidden layers with 7, 7, and 9 neurons respectively stands out with impressive R2 values of 98.69% for the training dataset and 97.83% for the testing dataset, coupled with a minimal testing MSE value of 0.00128, signifying its superior performance.
In order to assess the precision of the model’s predictions, Fig. 4 displays regression analyses for two distinct dependent variables within both the training and test datasets. The accuracy of the predictions is measured using both MSE and the R2 in evaluating the alignment between the predicted values and the target values. As expected, the model demonstrates its highest effectiveness in predicting the training dataset, achieving remarkable efficiency for both water flux (98.71%) and salt rejection (98.66 %) (Fig. 4 (a), (b)). The model’s outstanding performance can be attributed to its initial training on the same dataset, which has resulted in a profound alignment and familiarity between the model and the training data. In Fig. 4 (b) and (d), the findings demonstrated that when subjected to testing data, the R2 values for predicted water flux and salt rejection experienced minimal reductions, remaining at an impressive 97.83% and 97.86%. This underscores the robust and reliable performance of the established model, which holds great promise for accurately forecasting the water flux and salt rejection of laboratory-scale ZnO TFN membranes utilized in water desalination processes. These results indicate its potential as a valuable tool for optimizing water desalination systems and ensuring efficient salt removal.
3.1. Feature importance using SHAP values
SHAP (SHapley Additive exPlanations) is a technique that computes SHAP values for individual features in a machine learning model, aiding in the comprehension of how these features impact the model’s predictions. SHAP values are derived through the model’s conditional expected value function and are assessed for each dataset instance. Analyzing feature importance is possible through SHAP, and in the standard method, the significance of a feature is determined by averaging the absolute SHAP values across all instances, signifying the extent of a feature’s contribution to the model’s output [65]. Our results confirm that a higher permeate water flux leads to a lower salt rejection, as we observed the same effect when we examined the substrate type. As can be seen in Fig. 5, the type of substrate has a high and positive impact on water flux (Fig. 5 (a)), and a negative impact on salt rejection (Fig. 5 (b)), which implies that using PES instead of PSf lowers water flux and increases salt rejection. The TFC-PES membranes’ reduced permeabilities can be traced to the likelihood of the polyamide layer sagging into the support membrane pores [66]. Existing evidence in literature [67, 68] indicates that if polyamide infiltrates these pores, it significantly raises the resistance to water diffusion through the selective layer, resulting in TFC-PES membranes exhibiting the lowest water fluxes in comparison to TFC-PSf membranes. The effectiveness of water permeability in TFC-PSf membranes, despite a thicker polyamide basal layer, may be due to the compensating effect of much thinner polyamide leaves. Furthermore, a slightly lower cross-linking degree in TFC-PSf membranes may contribute to increased flux compared to TFC -PES membranes [66]. The Figs show that solvent type has a minor impact on salt rejection, but its impact on water flux is significant. Wu et al. [69] performed a study to evaluate the effect of different solvents on water flux. They found that using DMAc or DMF in the casting solution increased water flux. This was due to the formation of slanted finger-like pores and a thinner skin layer. On the other hand, membranes made with NMP in the casting solution had a thicker skin layer, which led to lower water flux.
As can be seen in Fig. 5, increasing the nanoparticles’ load increases water flux, which can be attributed to the nanoparticle’s interaction between amine groups and acyl chloride groups, as well as the hydrophilicity of ZnO nanoparticles. Hence, it may have resulted in a decrease in both crosslinking and the creation of nano-voids at the interface between the nanostructure and the PA matrix. Consequently, this would have resulted in a reduction in resistance to water permeability [16].
3.2. Comparison of established ANN model with SVR, RF, and XGBoost
To benchmark the performance of the developed multilayer perceptron (MLP) model, a comparative analysis was conducted using three widely adopted machine learning algorithms: support vector regression (SVR), random forest (RF), and extreme gradient boosting (XGBoost). These models were selected due to their frequent application in membrane process modeling and their complementary strengths in handling nonlinear regression problems. Each model was trained and optimized using the same dataset and preprocessing strategy applied to the ANN model to ensure a fair comparison. The predictive performance of the models was evaluated for both water flux and salt rejection, and the predicted values were plotted against experimental data, as shown in Fig. 6.
Compared with the ANN results presented in Fig. 5, the SVR, RF, and XGBoost models exhibited noticeably larger deviations from the experimental data, with a substantial number of data points scattered away from the ideal fitted line. Quantitatively, the SVR model achieved R2 values of 73.37% and 73.80% for salt rejection and water flux prediction, respectively. The RF model showed improved performance, with R2 values of 86.12% for salt rejection and 81.60% for water flux. In contrast, the XGBoost model yielded lower predictive accuracy, with R² values of 69.86% and 64.42% for salt rejection and water flux, respectively.
Overall, these results clearly demonstrate the superior predictive capability of the established MLP model for the ZnO-modified TFN membrane dataset considered in this study. The enhanced performance of the ANN can be attributed to its greater flexibility in capturing complex nonlinear interactions among membrane fabrication parameters and operating conditions, which are not fully resolved by the alternative ML approaches in this specific application.
4. Conclusions
This study demonstrates the potential of data-driven machine learning approaches to support the rational design and optimization of ZnO-modified thin-film nanocomposite (TFN) reverse osmosis membranes. By integrating a large, literature-derived dataset with advanced neural network modeling and interpretability analysis, the proposed framework moves beyond conventional empirical optimization and provides a systematic means of understanding how fabrication and operational parameters jointly govern membrane performance.
The developed multilayer perceptron (MLP) model proved particularly effective in capturing the complex, nonlinear relationships inherent to RO desalination systems incorporating ZnO nanofillers. Beyond predictive accuracy, the application of SHAP analysis enabled transparent interpretation of model behavior, revealing that solvent selection and operating pressure dominate water flux, while substrate characteristics and nanoparticle loading play a decisive role in salt rejection. These insights are valuable for guiding experimental membrane design, as they help prioritize key parameters and reduce reliance on trial-and-error approaches.
A key contribution of this work lies in the comparative evaluation of multiple machine learning algorithms under a unified modeling framework. The superior performance of the MLP model relative to support vector regression, random forest, and XGBoost highlights its suitability for highly nonlinear membrane systems where interdependent fabrication and operating variables interact across multiple scales. Importantly, this comparative assessment strengthens confidence in model selection rather than relying on a single algorithmic approach.
Despite these advances, several limitations should be acknowledged. The dataset was compiled from published studies, which inherently introduces variability in experimental protocols, testing conditions, and reporting standards. Although normalization and preprocessing were applied, unreported factors such as membrane aging, long-term fouling behavior, and feed water composition beyond NaCl were not explicitly captured. In addition, missing data were addressed using statistical imputation methods, which, while practical, may introduce uncertainty in sparsely represented parameter ranges.
Future work should focus on expanding the framework to include experimentally generated, standardized datasets and to explore more advanced imputation and uncertainty quantification techniques. Extending the model to other nanofillers, hybrid nanocomposites, and different membrane configurations would further test its generalizability. Moreover, coupling machine learning predictions with optimization and inverse-design strategies could enable the direct identification of optimal membrane fabrication windows for targeted desalination performance.
Overall, this study establishes an interpretable and scalable AI-assisted framework for predicting and understanding the performance of ZnO-based TFN RO membranes, offering a promising pathway toward data-driven membrane engineering and more efficient desalination technologies.
Acknowledgement
We would like to thank our colleagues at the Water Reuse laboratory, as well as acknowledge the support of the Iran National Science Foundation (INSF) under grant number 4040956 from this laboratory.
Conflict of Interest
The authors declare no conflict of interest.
Funding
This study was not supported by any funding.
Author’s Contributions
Study Conception or Design: AA, DN, SBG, MHS
Data Acquisition:AA, DN, SBG
Data Analysis or Interpretation: AA, FR, MHS
Manuscript Drafting:AA, DN, AMH
Critical Manuscript Revision: MHS
All authors have approved the final manuscript and are responsible for all aspects of the work.
AI Statement
The authors confirm that no AI tools or services were used during the preparation of this work.