Practical Artificial Neural Network Tool for Predicting the Competitive Adsorption of Dyes on Gemini Polymeric Nanoarchitecture

The objective of this study was to model the removal efficiency of ternary adsorption system using feed-forward back propaga - tion artificial neural network (FFBP-ANN). The ANN model was trained with Levenberg–Marquardt back propagation algorithm and the best model was found with the architecture of {9-11-4-3} neurons for the input layer, first and second hidden layers, and the output layer, respectively, based on two metrics, namely, mean squared error (MSE) = (0.2717–0.5445) and determination coefficient ( R 2 ) = (0.9997–0.9999). Results confirmed the robustness and the efficiency of the developed ANN model to model the adsorption process.


Introduction
Adsorption is one of the most effective unit operations employed for the removal of dye pollutants from wastewater 1 with respect to removal capacity with high quality adsorbate, low cost, and energy feeding. 2 Dyes can exist in the wastewater as acid, cationic, direct, dispersed, and reactive, and can be adsorbed from aqueous effluents using several adsorbents. 3 The increasing number of parameters required for competitive adsorption process description leads to complicating the modelling and optimisation process of the real phenomenon. 4,5 Several isotherms and non-linear models have been proposed in the literature to fit the multi-component adsorption systems, 3 namely, modified-Langmuir isotherm, extended-Langmuir isotherm, extended-Freundlich isotherm, and ideal adsorbed solution theory (IAST) based model, etc. 6 Recently, artificial intelligence approaches have been proving their capacity in modelling the complex and non-linear behaviour of multi-component adsorption systems such as artificial neural networks (ANN), 7 support vector machines (SVMs) 8,9 used with default optimisation algorithms or with recently published methods like swam or dragonfly optimisation techniques. Thus, the novelty of the present study is the development of an accurate ANN model to predict the removal efficiency of three dyes, namely, {blue acid 92, direct green 6, direct red 31} on Gemini polymeric nanoarchitecture.

Methodology
In this work, the input parameters for the ANN model were selected based on their availability in a selected scientif-ic published paper, as well as on their effect on the outputs. The data set was directly extracted from the experimental curves using digitiser software from paper. 10 The selected parameters in this paper were λ max of each dye {blue acid 92, direct green 6, direct red 31}, molecular weight of the salts used {NaHCO 3 , Na 2 CO 3 , Na 2 SO 4 }, initial concentration of each dye {300 mg l −1 , 400 mg l −1 , 500 mg l −1 , 600 mg l −1 }, weight of the adsorbent {m ad : 0.025 g, 0.05 g, 0.075 g, 0.1 g, 0.125 g}, adsorption time {t: 2.06-60 min}, and the maximum dye adsorption capacity {q e1 , q e2 , q e3 } considered as outputs. The data set can be arranged in the matrix of {12, 414} data points and then randomly divided into three subsets to train/validate and test the model. The data set is normalised between [−βγ, (1−β)γ] which helps to achieve a higher training accuracy and leads to stable convergence of network weights and biases by having all inputs with the same range of values and using premnmx/postmnmx function already programmed in the MATLAB software, and expressed by the following equation: (1) In this work, β = 0.5 and γ = 2 were selected, and the scaled values of each input were computed. x i and x in are its original and normalised value, x max and x min are the maximum and the minimum of x. Outputs anti-normalisation can be performed using the following expression: (2) A supervised training strategy with Levenberg-Marquardt algorithm was adopted as default in this study. Different significant aspects of the building of ANN models are the network structure, i.e., transfer function, the number of Practical Artificial Neural Network Tool for Predicting the Competitive Adsorption of Dyes on Gemini Polymeric Nanoarchitecture hidden layers, and the number of neurons in each layer. The number of inputs and outputs is usually in direct relation to the examined problem, and is defined as the number of controlling parameters of the process (inputs) and the number of parameters directly affecting them (outputs). However, there is no rule for the exact determination of the number of hidden layers and the number of neurons in each layer. Usually, the optimal hidden layers and neurons in the ANN model can be conducted solely by trial-and-error method, and based on the calculation of some statistical parameters, i.e., errors and regression coef-ficient. To avoid overfitting of the ANN model, each architecture was changed 20 times, and all parameters were selected randomly like initial weights and biases. A detailed flow chat of the ANN methodology is given in Fig. 1, and implemented in convivial and flexible MATLAB program to test all parameters and save the optimal weights and biases and other optimised parameters for further use for ANN prediction.
Such modelling technique works like a "black box" where the basic process of this method is shown in Fig. 2.

Results and discussion
The comparison between experimental and calculated values was conducted using mean squared error (MSE), which was the main criterion to evaluate the accuracy of ANN. Generally, the prediction ability of ANN model is related directly to the small mean squared error (MSE) of training and validation stage. This error is defined as follows as: 11,14 ( ) where n is the total number of data, exp i y , cal i y , and exp y are the target and network output values, and the mean of the experimental values, respectively. The determination coefficient R 2 is also used to confirm the performance of the best developed models, and can be expressed by the following equation: 15 The coefficient of determination is a statistical measurement that assesses how strong the linear relationship is between the two variables. In this work, a feed-forward back propagation -multi-layer artificial neural network (FFBP-ANN) coded in MATLAB as newff was used and trained with Levenberg-Marquardt algorithm implemented in MATLAB software, and expressed as trainlm. 16 The test of three transfer functions was performed using {hyperbolic tangent sigmoid (tansig), log-sigmoid (logsig), and linear (purelin)}. After 3000 iterations, results showed that an ANN model with one hidden layer, including in it different neurons, was unable to fit the behaviour of multi-component adsorption system. Thus, an ANN with two hidden layers was used, where the number of neurons in every layer was changed from 1 to 20. Fig. 3 shows the variation of MSE in divided ranges against the number of neurons in every hidden layer. It was found that an ANN model with two hidden layers and with the structure of {9-11-4-3} neurons in input layer, first and second hidden layers, and the output layer, respectively, can precisely predict the maximum dye adsorption capacity on Gemini polymeric nanoarchitecture (GPN). Table 1 summarises the architecture of the final ANN model.     The present accuracy of the developed ANN models is acceptable for further prediction of the three dyes on the Gemini polymeric nanoarchitecture. The three ANN models can be written with the obtained characteristics as follows: where I(1:n), j(1:m), k(1:l), and l(1:p) are the number of inputs, hidden, and outputs, respectively. w and b are weights and biases, and f is the hyperbolic tangent sigmoid transfer function. Table 2 summarises some statistical parameters of the three ANN models.  To facilitate the use of the developed ANN models in this study, a user-friendly and robust graphical interface tool was written in MATLAB software using Windows 7 as an operating system.  Tables 3-5 show the values of weights and biases obtained during the training stage of the best ANN models that can be used in the graphical user interface.
The performance of the developed model in this study was compared with previously published papers on modelling of dye adsorption by ANN. Results showed that the developed model was capable of predicting the removal efficiency of adsorption of the ternary systems (03 dyes) on GPN with high performance ( Table 6).

Conclusion
In this study, the adsorbent capability of thee dyes (AB92, DG6, and DR31) on (GPN) was modelled using the ANN approach. A total of 414 experimental data points were collected from the work of Mahmoodi et al. 10 The best ANN model was found with {9-11-4-3} structure, taking into account the hyperbolic tangent sigmoid and the linear transfer function in the hidden layer and the output layer, respectively. The obtained determination coefficient was larger than 0.999 approaching the ideal fitting status with R 2 = 1, and the largest mean squared error was lower than 0.5445. The obtained statistical parameters confirmed the accuracy of the ANN model to fit the competitive adsorp-tion process of dyes on GPN. The best fitting training data was attained with 4-18-1.