## Abstract

Water is a vital resource that makes it possible for human life forms to exist. The need for freshwater consumption has significantly increased in recent years. Seawater treatment facilities are less dependable and efficient. Deep learning systems have the potential to increase the efficiency as well as the accuracy of salt particle analysis in saltwater, which will benefit water treatment plant performance. This research proposed a novel method for optimization and modelling of the treatment process for saline water based on water level data analysis using machine learning (ML) techniques. Here, the optimization and modelling are carried out using molecular separation-based reverse osmosis Bayesian optimization. Then the modelled water saline particle analysis has been carried out using back propagation with Kernelized support swarm machine. Experimental analysis is carried out based on water salinity data in terms of accuracy, precision, recall, and specificity, computational cost, and Kappa coefficient. The proposed technique attained an accuracy of 92%, precision of 83%, recall of 78%, specificity of 81%, computational cost of 59%, and Kappa coefficient of 78%.

## HIGHLIGHTS

A novel method in optimization and modelling of the treatment process for saline water based on water level data analysis using machine learning techniques is proposed.

Here the optimization and modelling are carried out using molecular separation-based reverse osmosis Bayesian optimization.

The modelled water saline particle analysis has been carried out using back propagation with a Kernelized support swarm machine.

### Graphical Abstract

## INTRODUCTION

Despite the fact that 75% of the planet is covered by water bodies, a catastrophic water scarcity that the world faces in proportion to population growth, industrial development, and agricultural advancement has left 800 million people without access to drinking water. As 97% of the planet's water supplies are salty and the majority of freshwater is in glaciers, ice caps, and underground, there is also sadly very little drinking water available. By 2050, it is anticipated that roughly half of the world's freshwater would be utilized (Alshehri *et al.* 2021). Additionally, researchers have considered using a variety of water desalination methods to effectively combat this issue. Numerous efficient desalination techniques have been researched, including vapour compression, multistage flashing, reverse osmosis, and multi-effect distillation (Aghilesh *et al.* 2021). These techniques require high-power sources like fuel and energy, expensive installation and maintenance costs, and highly skilled operators and employees despite being efficient and capacitive methods on a big production scale. Desalination and water treatment have both made extensive use of the electric ion separation technique known as capacitive deionization (CDI) (Jiang *et al.* 2021). In order to remove salt from the electrodes, the CDI process involves repeated cycles of charging (ion adsorption) as well as discharging, which releases the salt into brine. During the charging phase of the CDI process, ions from the feed water are electrically adsorbed to an electrode (which is mostly made of carbon), with cations adhering to cathode as well as anions adhering to anode. As a result, the electrode's adsorption capacity and amount of ion adsorption of CDI are strongly connected. In order to discharge effectively and completely utilize this capacity, co-ions (ions with the same polarity as the electrode) must not desorb. A membrane CDI (MCDI) approach is developed based on the use of an ion exchange membrane (IEM) electrode surface to solve the co-ion desorption problem (Sahour *et al.* 2020). Ion adsorption effectiveness of MCDI is higher than that of CDI because it can successfully prevent the desorption of co-ions caused by the presence of IEMs.

Emerging Artificial Intelligence (AI) and Machine learning (ML), coupled with smart technology, are filling a niche in water applications that were previously underserved by traditional techniques and thinking. Some reports estimate that AI expenditures in the water industry will account for almost 10% of the investment of over $90 billion that is expected to mature by 2030. In water applications, AI, ML, and smart technologies are expected to model and overcome complex and difficult issues through their generalization, resilience, and relative ease of design to achieve cost savings and optimize processes (Odabaşı *et al.* 2022). Water applications that have seen notable ML utilization include water and wastewater treatment, natural-systems monitoring, and precision/water-based agriculture. These industry studies have been observed to rely on numerous ML techniques, with the most commonly used including artificial neural networks (ANNs), recurrent neural networks (RNN), radio frequency (RF), support vector machine (SVM), and adaptive neuro fuzzy inference system (ANFIS) with occasional AI methods including fuzzy inference systems (FISs). There have also been some applications involving hybrid techniques that marry two ML systems, including ANN–RF and SVM–RF. Studies have recorded success in their applications of both AI and ML in water-based usages for optimizing modelling processes (Rall *et al.* 2020).

The contribution of this research is as follows:

- 1.
To propose a novel method for the optimization and modelling of the treatment process for saline water based on water level data analysis using ML techniques.

- 2.
Here the optimization and modelling are carried out using molecular separation-based reverse osmosis Bayesian optimization.

- 3.
The modelled water saline particle analysis has been carried out using back propagation with a Kernelized support swarm machine.

The organization of this article is as follows: section 2 gives existing works based on optimization and modelling for saline water using ML techniques; section 3 explains proposed optimization and modelling for saline water using ML architectures; performance analysis and experimentation is shown in section 4; and we conclude in section 5 with future scope for research.

## RELATED WORKS

Researchers from all around the world have suggested and presented a variety of approaches to forecast salinity and dangerous components in saline water. The following discussion includes a few of the suggested best-in-class methods. A hybrid strategy was put up in Work (Zhang *et al.* 2022) to forecast river water salinity in Babol-Rood River. ML methods input variables were predicted utilizing Pearson's correlation coefficient technique. Total Dissolved Solids (TDS) were also the primary predictor utilized to forecast the salinity of river water. Zhang *et al.* (2022) used an ANN with rapid propagation to predict the salinity forecast of groundwater depending on the pumping rate. A comparison between the implemented model and the standard statistical saturated-unsaturated (SUTRA) computational method was made. In the study (Viet *et al.* 2021), ANNs were used to evaluate groundwater salinity (ANN). Based on their findings, Bonny *et al.* (2022) and Lee *et al.* (2022) developed an image analysis technique to better understand how pollutant movement in homogenous aquifers is impacted by intrusive saltwater (SW). A linear relationship between concentration and dye optical density was established using nine distinct seawater concentrations. Wang *et al.* (2020) suggested an image analysis method that used a second-order exponential function of measured light intensity values to evaluate saltwater concentration in a homogeneous aquifer. The technique was further tested in two-dimensional heterogeneous aquifers, producing contour plots of intruding wedges' saltwater concentration with two (Li *et al.* 2020) and four (Doña *et al.* 2016) isolines, respectively. Feizizadeh *et al.* (2021) used a similar strategy, fitting eight salt concentration values to observed grayscale pixel intensity values using the least squares method. By mimicking an unrestricted coastal aquifer with quartz sand and using binary-style automated image processing, Batchuluun *et al.* (2021) reported the sole study to categorize each pixel into either freshwater or saltwater depending on its brightness levels. Lighting was positioned in front of the sandbox in every other study (light reflection technique). Son *et al.* (2021) made an effort to compare the two experimental strategies in-depth. The use of neural networks in membrane formation (Dargam *et al.* 2020) and the prediction of membrane function (Milosavljević 2020) are topics covered in a number of papers in the field of membrane science. By establishing superior membrane synthesis techniques based on the delicate balance between ion retention properties as well as permeability, we have extended the use of ANN surrogate methods in membrane research to characterize and optimize LbL-based membrane methods (Sagastibeltza *et al.* 2022). The performance of LbL nano-filtration membrane models, as well as separation method, may thus be designed simultaneously using an optimization technique thanks to the coupling of ANNs into a hybrid mechanistic/data-driven method. As a result, the intended separation goal can be best served by membrane synthesis techniques and membrane processes (Elsheikh *et al.* 2022).

## SYSTEM MODEL

We employed the Cook's distance to conduct the influential analysis in this study. The latter has been done to identify the influence of each data point on the final method and we also employed standard scaling. Data inside each feature are scaled by Standard Scaler so that distribution is centred around 0 and has a standard deviation of 1. Three continuous factors and one categorical component were taken into account throughout the experiment design (electrodes configuration). 45 trials were conducted using the Box-Behnken design with three iterations of a central point. For each experiment, the applied voltage required to sustain current intensity was monitored over the course of time (six sample points). Further, marginal distribution (the probability distribution of the variables contained in the subset) and Bayesian network inference (evaluating the joint probability of a particular assignment of values for each variable (or a subset) in the network) with naive Bayes (most effective classification algorithms which help in building the fast ML models that can make quick predictions) were estimated.

### Molecular separation-based reverse osmosis Bayesian optimization

^{2}and an accuracy of 5 W/m

^{2}. Figure 2 includes a tubular cover, basin, feedwater assembly, and all necessary instrumentation for measurements of all specifications. As a tubular cover, a 1.5-thick, transparent polycarbonate cylinder measuring 50 cm in diameter and 100 cm in length was employed, allowing the basin to be exposed to sunlight from all directions. The basin also had side walls that measured 90, 40, 5, and 0.15 cm in length, breadth, and thickness, respectively, of black-painted steel. Through a feeding method that delivered feed water at the same rate as hourly-evaporated amount, the height of the salinized water inside the basin was restricted to 0.5 cm. The main method used to determine this height was a graded level meter that was fastened to each side of the basin.

*P*

_{i}:where

*A*is the membrane area and

*Q*

_{i}is the permeating flow rate. According to the Kelvin Equation (3), vapour sorption and condensation take place in small free-volume pores (diameter

*d*

_{p}) at vapour pressures

*p*that are lower than

*P*

_{s}.where molar volume, surface tension, and contact angle are represented by

*υ*,

*σ*, and

*θ*. The Kelvin radius,

*r*

_{k}, may be calculated using this equation. It is crucial to remember at this point that the uptake of a contaminant by two material adsorbents must be compared under identical experimental conditions as well as at the same equilibrium concentration (particularly pH). Separation factor, which is given by Equations (4) and (5) value of RL, determines whether the shape of isotherms is irreversible, favourable, linear, or unfavourable.

*n*because a Bayesian network linked to

*G*

_{i}has a maximum in-degree (i.e., maximum number of parents) equal to

*n*classes. For issues with numerous classes, this is not viable. Thus, the maximum in-degree can be decreased using a structural learning approach. In practice, we analyse the result of the following optimization to reduce certain classto-feature arcs in

*G*: , where it is anticipated that set inclusions between graphs take place in the arcs space and are given by Equation (7)where

_{i}*P*(

_{a}*F*) stands for

_{j}*F*’s parents according to

_{j}*G*, and

*P*(

_{a}*C*) means

_{i}*C*’s parents. Additionally,

_{i}*ψ*BDEu score has a similar sample size

_{α}*α*. For instance, Equation (8) scorewhere the first sum is over the combined states of its parents, and the second sum is over the conceivable states of

*F*. Additionally,

_{j}*N*=

_{ji}*P*

*k*

*N*is the number of records needed to ensure that

_{jik}*F*is in its

_{j}*k*-th state and that its parents are in their

*i*-th configuration. The class variables have the same parents for all the graphs in the search space if we take into account a network linked to a particular class event since the links joining the class events are fixed. This suggests that the right-hand side's first sum in (4) is constant. Therefore, by taking only the features into account, the optimization in (9) can be accomplished. Any subset of

*C*is a potential candidate for a feature's parents set, which simplifies the issue to m separate local optimizations. According to

*G*∗,

*F*’s parents are actually

_{j}*j*= 1, m. This is made possible by the bipartite separation of class events and features, but in most situations, directed cycles may be found in the graph that maximizes all local scores. Let

*k*be the number of mixture components,

*X*be the set of query variables,

*Z*be the other variables (i.e., the number of values of

*C*). Marginal distribution of

*X*is evaluated by adding values of

*C*and

*Z*from Equations (10)–(13):where the previous equality is true since, for any

*j*, (

*j*) 1

*z*∑

_{j}*P c z*= . Therefore, it is simple to ignore the non-query variables

*Z*while computing

*P*(

*X*=

*x*), and the computation of

*P*(

*X*=

*x*) takes

*O*(|

*X*|

*k*), regardless of |

*Z*|. Bayesian network inference, in contrast, is worst-case exponential in |Z|. Conditional probabilities are effectively estimated as ratios of marginal probabilities . Mixture of trees, where each variable in each cluster is allowed to have one additional parent in addition to

*C*, provides a slightly richer model than naive Bayes while still allowing for efficient inference.

*M*, a privacy leakage assault

*A*, and a prior knowledge distribution

*F*

_{0}concerning private data x.where KL stands for the Kullback–Leibler divergence between the posterior distribution FA conditioned on disclosed information and the prior knowledge distribution

*F*

_{0}. This indicates that

*A*and

*B*are disjoint in set theory notation, i.e.,

*A*∩

*B*= ∅.

*P*(

*A*|

*B*) =

*P*(

*A*) or

*P*(

*B*|

*A*) =

*P*(

*B*), and

*P*(

*A B*) =

*P*(

*A*)

*P*. By using Equations (15) and (16), we can state the following:

*H*

_{1}and

*H*

_{2}, with

*P*(

*H*

_{1}) = 1

*P*(

*H*

_{2}). It is also common to use the word ‘model’ for the word ‘hypothesis.’ Let

*D*stand for the measured data. Then, Equation (21) provides posterior probability of hypothesis

*H*

_{1}.and posterior probability of

*H*

_{2}is represented by Equation (22)

_{1}'s posterior odds to its prior odds is known as Bayes factor. When compared to competing hypothesis

*H*

_{2}, Bayes factor is seen as a summary indicator of evidence data giving us supporting hypothesis

*H*

_{1}. Bayes factor and posterior odds are the same if the prior probabilities for

*H*

_{1}and

*H*

_{2}are the same. Let

*f*be joint PDF for continuous random variables

_{XY}*X*and

*Y*. (

*x*,

*y*). Next, by Equations (24) and (25)

The denominator, *P*(*x*), is independent of the class; it is the same for classes *y _{j}* and

*y*, for instance. The scaling factor

_{l}*P*(

*x*) makes sure that posterior probability

*P*(

*y*|

_{j}*x*) is appropriately scaled.

### 3.2. Back propagation with Kernelized support swarm machine (BPKSSM) based saline water analysis

Principal component analysis employing a kernel function is a technique for producing the conventional linear PCA in a high-dimensional space. KPCA performs nonlinear PCA in this feature space in a manner similar to performing nonlinear PCA in original input space.

Let *H* be a Hilbert space that implements the self-adjoin operator for the trace class *G*.

*T*∈

*B*(

*H*) is considered to be a tumour trace class. By Equation (35) in this instance,

*K*:

*S*×

*S*→

*C*known as a positive definite (p.d.) kernel on

*S*is one that, according to Equation (38)for all, and

*a*is the eigenvector which is an

_{k}*N*dimensional column vector of

*a*.

_{ki}*a*can be solved by Equation (51)

_{k}*X*, layer thickness

*x*, trans membrane velocity

*v*, and salt supply concentration

*c*are all inputs to ANN. Ionic retention of ion

_{j}*j R*is output to ANN.

_{j}## PERFORMANCE ANALYSIS

The experiment was carried out using a computer with the following technological specs: Intel Core i5 7200U, 8 GB of RAM, a 1 TB hard drive, and NVIDIA GTX 760MX graphics. Python 3.5 environments were used to mimic the implementation of the suggested approach. We conducted a statistical study by evaluating predicted performance to establish the findings of the suggested strategy.

Dataset description: The feed flow rate (*F* = 400–600 L/h), permeate flux (*P*_{flux} (L/h·m^{2})), condenser inlet temperature (*T*_{cond} = 20–30 °C), evaporator inlet temperature (*T*_{evap} = 60–80 °C), and feed salt concentration (*S* = 35–140 g/L) made up the datasets. The principal output was permeated flux. In order to train NN, data have also been separated into three categories: training, validation, and testing. Training division is typically utilized to get model specifications. While testing division confirms its performance, validation division checks precision of continuous training to prevent over fitting.

Table 1 gives a comparative analysis between proposed and existing technique based on salt water analysis. Here the salt water analysis has been carried out based on salinity and temperature analysis of water like S = 35–140 g/L, *T*_{cond} = 20–30 °C, *T*_{evap} = 60–80 °C. Parameters analysed are in terms of accuracy, precision, recall, specificity, computational cost, and Kappa coefficient.

Salt water analysis . | Techniques . | Accuracy . | Precision . | Recall . | Specificity . | Computational cost . | Kappa coefficient . |
---|---|---|---|---|---|---|---|

S = 35–140 g/L | SUTRA | 81 | 72 | 68 | 71 | 45 | 61 |

ANN | 83 | 74 | 72 | 73 | 48 | 63 | |

OMTP_SWL_MLA | 85 | 75 | 75 | 75 | 51 | 65 | |

T_{cond} = 20–30 °C | SUTRA | 82 | 73 | 70 | 72 | 48 | 68 |

ANN | 84 | 78 | 72 | 75 | 52 | 71 | |

OMTP_SWL_MLA | 86 | 81 | 74 | 78 | 53 | 73 | |

T_{evap} = 60–80 °C | SUTRA | 85 | 75 | 74 | 75 | 49 | 71 |

ANN | 88 | 79 | 76 | 79 | 55 | 75 | |

OMTP_SWL_MLA | 92 | 83 | 78 | 81 | 59 | 78 |

Salt water analysis . | Techniques . | Accuracy . | Precision . | Recall . | Specificity . | Computational cost . | Kappa coefficient . |
---|---|---|---|---|---|---|---|

S = 35–140 g/L | SUTRA | 81 | 72 | 68 | 71 | 45 | 61 |

ANN | 83 | 74 | 72 | 73 | 48 | 63 | |

OMTP_SWL_MLA | 85 | 75 | 75 | 75 | 51 | 65 | |

T_{cond} = 20–30 °C | SUTRA | 82 | 73 | 70 | 72 | 48 | 68 |

ANN | 84 | 78 | 72 | 75 | 52 | 71 | |

OMTP_SWL_MLA | 86 | 81 | 74 | 78 | 53 | 73 | |

T_{evap} = 60–80 °C | SUTRA | 85 | 75 | 74 | 75 | 49 | 71 |

ANN | 88 | 79 | 76 | 79 | 55 | 75 | |

OMTP_SWL_MLA | 92 | 83 | 78 | 81 | 59 | 78 |

*S*= 35–140 g/L based on water salinity. The proposed technique attained accuracy of 85%, precision of 75%, recall of 75%, specificity of 75%, computational cost of 51%, Kappa coefficient of 68%, existing SUTRA attained accuracy of 81%, precision of 72%, recall of 68%, specificity of 71%, computational cost of 45%, Kappa coefficient of 61%, ANN attained accuracy of 83%, precision of 74%, recall of 72%, specificity of 73%, computational cost of 48%, and Kappa coefficient of 63%.

*T*

_{cond}= 20–30 °C based on water salinity. The proposed technique attained accuracy of 86%, precision of 81%, recall of 74%, specificity of 78%, computational cost of 53%, Kappa coefficient of 73%, existing SUTRA attained accuracy of 82%, precision of 73%, recall of 70%, specificity of 72%, computational cost of 48%, Kappa coefficient of 68%, ANN attained accuracy of 84%, precision of 78%, recall of 72%, specificity of 75%, computational cost of 52%, and Kappa coefficient of 71%.

*T*

_{evap}= 60–80 °C based on water salinity. The proposed technique attained accuracy of 92%, precision of 83%, recall of 78%, specificity of 81%, computational cost of 59%, Kappa coefficient of 78%, existing SUTRA attained accuracy of 85%, precision of 75%, recall of 74%, specificity of 75%, computational cost of 49%, Kappa coefficient of 71%, ANN attained accuracy of 88%, precision of 79%, recall of 76%, specificity of 79%, computational cost of 55%, and Kappa coefficient of 75%.

## DISCUSSION

Figure 4(a)–4(f) shows that the majority of samples were correctly classified by our classification model, while only a tiny fraction of samples was wrongly classified. Additionally, Figure 5(a)–5(f) showed that if there are more training data available for the method to be trained, the overall accuracy of method may rise. The model's specificity metrics demonstrated a true negative ratio of 0.89, indicating that it correctly identified the majority of the negative predictions. On the other hand, the model correctly predicted 92% of the positive test data outcomes. Additionally, Figure 5(a)–5(f) shows how the model demonstrated a specificity score, which made the model efficient and resilient by classifying more positive predictions over wrong misclassification. The proposed method maintained between precision and recall, according to an f-score. Figure 6(a)–6(f) displays the individual classification scores for the target classes in order to demonstrate cutting-edge findings and offer a full analysis report for assessing the suggested strategy.

## CONCLUSION

This research proposed a novel method for optimization, as well as modelling of the treatment process using ML techniques using molecular separation-based reverse osmosis. Bayesian optimization and water saline particle analysis have been carried out using back propagation with Kernelized support swarm machine. The proposed models were evaluated and examined by some statistical parameters where with the training data's constrained range of class labels, the system was unable to categorize salts with salinities greater than 100 ppt. The proposed method attained accuracy of 92%, precision of 83%, recall of 78%, specificity of 81%, computational cost of 59%, and Kappa coefficient of 78%. Further, we intend to examine the applicability of DL methods in water treatment techniques by integrating our suggested approach with contemporary water treatment facilities in further research.

## DATA AVAILABILITY STATEMENT

All relevant data are included in the paper or its Supplementary Information.

## CONFLICT OF INTEREST

The authors declare there is no conflict.