### 1. Introduction

^{2+}, Mg

^{2+}, SO

_{4}

^{−2}, HCO

^{3−}and total hardness rejection of NF were 89.4%, 94.0%, 97.8%, 96.6% and 93.3%, respectively, and the rejection rate of monovalent ions (Cl

^{−}, Na

^{+}) was 40.3%, achieving about 27% reduction in the net water production cost through a single-stage SWRO. For the first time, the NF membrane pretreatment process was integrated with one of the conventional desalination processes on a pilot plant in Saudi Arabia. This conception was evaluated on NF–SWRO, NF–MSF, and NF–SWRO–MSF pilot plant units using Gulf seawater [15]. Drioli et al. [16, 17] integrated the MF–NF–RO system with membrane distillation/crystallization (MD/MC) units. To achieve the high water recovery rates of 92.8%. NF is used for pretreatment and load reduction to the following RO unit, a membrane crystallizer completes was used and available waste thermal energy and brine pressure exchanger system. The energy consumption of the NF–RO–MC process was reduced to 1.54–1.61 kWh/m

^{3}and the water cost is reduced to 0.56 $/m

^{3}. In seawater desalination process, NF is applied as a pretreatment step of seawater feed and RO or MSF as final treatment step [18]. AlTaee and Sharif [19] carried out the cost analysis on a dual NF-NF, NF-RO and single RO systems. The results showed that NF-NF combination was the lower cost followed by RO then NF-RO systems. In another study, Kaya et al. [20], for applicability of NF membranes prior to the SWRO system was also investigated. They reported that SWRO flux increased from 30.1 LMH to 55.1 LMH when NF was used as a pretreatment prior to seawater SWRO unit (flux of single SW30-RO membrane was 30.1 LMH at 55 bar, while the average flux of the integrated NF90 (30 bar) + SW30-RO (40 bar) system flux was 55.1 LMH). The results showed a good rejection with respect to all ions.

### 2. Material and Method

### 2.1. Experimental Data

^{2}at a recovery of 53–57%. The SWRO unit that received the NF product as feed the operating pressure was maintained at 60 kg/cm

^{2}and a temperature ranged from 23 to 34°C, where the average permeate recovery of the first and second vessels were 30 and 21%, respectively but the overall recovery the SWRO system was about 45%. Fig. 1 shows the diagram of the trihybrid NF/RO/MSF desalination pilot system. The samples of water were collected every hour for a period of two months, the selected parameters including: the feed pressure, temperature, conductivity, flow rate, permeate flow rate and permeate water recovery. The selected experimental inputs and outputs variation presented in Table 1.

### 2.2. Modeling Development

#### 2.2.1. Neural network modelling

*tansig*) as transfer functions was used in the hidden layer (Eq. (1)) and pure linear (

*purelin*) transfer function in the output layer (Eq. (2)). However, the

*tansig*function, produces output in the range of −1 to +1 and the linear transfer function produce outputs in the range of −∞ to +∞ [34, 35].

##### (3)

$${x}_{norm}={\scriptstyle \frac{2({x}_{i}-\text{min\hspace{0.17em}}({x}_{i}))}{max\hspace{0.17em}({x}_{i})-\text{min\hspace{0.17em}}({x}_{i})}}-1$$*x*

*is the input or output variable*

_{i}*x*,

*x*

*and*

_{max}*x*

*are equal to the maximum and minimum values noted for each variable of*

_{min}*x*.

#### 2.2.2. Multi-Linear Regression Model (MLR)

_{1}, x

_{2}, and so forth is as follows:

*x*

_{0}is regression constant,

*a*

_{0}is a constant (intercept) and

*x*

*the coeffcient of predictorsin linear regression model. MLR calculations were performed using STATISTICA v. 8.0 (Stat Soft, Inc.) software.*

_{i}### 2.3. Statistical Performance Evaluation Criteria

*AARD*[35, 39]. The equations are expressed in below:

##### (5)

$$R={\scriptstyle \frac{{\mathrm{\Sigma}}_{i}({y}_{exp}-\overline{{y}_{exp}})({y}_{cal}-\overline{{y}_{cal}})}{\sqrt{{\mathrm{\Sigma}}_{i}{({y}_{exp}-\overline{{y}_{exp}})}^{2}}\sqrt{{\mathrm{\Sigma}}_{i}{({y}_{cal}-\overline{{y}_{cal}})}^{2}}}}$$##### (6)

$$RMSE=\sqrt{{\scriptstyle \frac{1}{N}}{\mathrm{\Sigma}}_{i=1}^{N}{({y}^{exp}-{y}^{cal})}^{2}}$$##### (8)

$$AARD={\scriptstyle \frac{1}{N}}{\mathrm{\Sigma}}_{i=1}^{N}\left|{\scriptstyle \frac{{y}^{exp}-{y}^{cal}}{{y}^{exp}}}\right|$$*N*is the number of experiments,

*y*

*is the experimental value for each parameter, y*

_{exp}_{cal}is respectively the predicted value of the

*i*

*experiment calculate by the model for each parameter. and are the arithmetic mean of experimental $\overline{{y}_{exp}}$ and $\overline{{y}_{cal}}$ are the arithmetic mean of experimental and calculated values.*

^{th}### 3. Results and Discussion

### 3.1. Comparison of the ANN Model and MLR Model

*R*= [0.98 (ANN), 0.622 (MLR)], for permeate recovery

*R*= [0.964 (ANN), 0.572 (MLR)] and for permeate flow rate

*R*= [0.942 (ANN), 0.679 (MLR)].

### 3.2. Mathematical Equations of MLR Developed Model

### 3.3. Mathematical Equations of ANN Developed Model

*x*

*by the mathematical formula is presented as follow: Knowing that*

_{i}*f*

*is the Tangent sigmoid transfer function used in hidden layer:*

_{h}##### (12)

$${Z}_{j}={f}_{h}\hspace{0.17em}\left[{\mathrm{\Sigma}}_{i=1}^{5}{w}_{ji}{x}_{i}+{b}_{j}^{h}\right]={\scriptstyle \frac{exp({\mathrm{\Sigma}}_{i=1}^{5}{w}_{ji}{x}_{i}+{b}_{j}^{h})-exp(-{\mathrm{\Sigma}}_{i=1}^{5}{w}_{ji}{x}_{i}+{b}_{j}^{h})}{exp({\mathrm{\Sigma}}_{i=1}^{5}{w}_{ji}{x}_{i}+{b}_{j}^{h})+exp(-{\mathrm{\Sigma}}_{i=1}^{5}{w}_{ji}{x}_{i}+{b}_{j}^{h})}}\mathrm{\hspace{0.17em}\u200a\u200a}\mathrm{\hspace{0.17em}\u200a\u200a}\mathrm{\hspace{0.17em}\u200a\u200a}j=1,2,......8$$*f*

_{0}is the pure linear transfer function used in output layer presented as Eq. (18):

##### (13)

$$\text{H}={f}_{0}\left[\hspace{0.17em}{\mathrm{\Sigma}}_{i=1}^{8}{w}_{ji}^{H}{Z}_{i}+{b}_{3}^{0}\right]$$##### (14)

$${\delta}_{p},{Q}_{p},y={\mathrm{\Sigma}}_{i=1}^{8}{w}_{ji}^{H}\hspace{0.17em}({\scriptstyle \frac{exp({\mathrm{\Sigma}}_{i=1}^{5}{w}_{ji}{x}_{i}+{b}_{j}^{h})-exp(-{\mathrm{\Sigma}}_{i=1}^{5}{w}_{ji}{x}_{i}+{b}_{j}^{h})}{exp({\mathrm{\Sigma}}_{i=1}^{5}{w}_{ji}{x}_{i}+{b}_{j}^{h})+exp(-{\mathrm{\Sigma}}_{i=1}^{5}{w}_{ji}{x}_{i}+{b}_{j}^{h})}}+{b}_{3}^{0}$$*δ*

*), permeate flow rate (*

_{p}*Q*

*) and permeate recovery (*

_{p}*y*) is given by the Eq. (14).

*j*is the number of neurons in the hidden layer (

*j*=8),

*i*is the number of neurons in the input layer (

*i*=5), ${w}^{I}\hspace{0.17em}({w}_{(j,i)}^{H})$ and ${b}_{1}^{H}$ are weights and bias between input and hidden layer, ${\text{w}}^{\text{H}}({w}_{(1,j)}^{0})$ and ${b}_{3}^{0}$ are weights and bias between hidden and output layer,

*l*is the number of neurons in output layer (

*l*=3).

### 3.4. Sensitivity Analysis

*R*

*) of the various inputs. The method essentially involves partitioning the hidden-output connection weights of each hidden neuron into components associated with each input neuron. The relative importance (%) calculated based on Garson equation [53]:*

_{I}##### (15)

$${R}_{Ij}={\scriptstyle \frac{{\mathrm{\Sigma}}_{m=1}^{{N}_{h}}(({\scriptstyle \frac{\left|{W}_{jm}^{ih}\right|}{{\mathrm{\Sigma}}_{k=1}^{{N}_{i}}\left|{W}_{km}^{ih}\right|}})\times \left|{W}_{mn}^{h0}\right|)}{{\mathrm{\Sigma}}_{k=1}^{{N}_{i}}\left\{{\mathrm{\Sigma}}_{m=1}^{{N}_{h}}(({\scriptstyle \frac{\left|{W}_{km}^{ih}\right|}{{\mathrm{\Sigma}}_{k=1}^{{N}_{i}}\left|{W}_{km}^{ih}\right|}})\times \left|{W}_{mn}^{h0}\right|)\right\}}}$$*I*

*is the relative importance of the*

_{j}*j*

*input variable on output variable;*

^{th}*N*

*and*

_{i}*N*

*are the number of input and hidden neurons, respectively;*

_{h}*W*are connection weights; the superscripts

*i*,

*h*, and

*o*refer to input, hidden and output layers, respectively; and subscripts

*k*,

*m*, and

*n*refer to input, hidden and output neurons, respectively [53]. The numerator of the Eq. (15) describes the sum of the absolute products of the weights for each input.