Prediction of Density and Speed of Sound of Binary Ionic Liquid and Ketone Mixtures Using Artificial Neural Network

. The applications of ionic liquids solve a lot of major problems regarding green energy production and environment. Ionic liquids are solvents used as alternative to unfriendly traditional and hazardous solvents which reduces the negative impact to environment to a great extent. This study produced models to predict two of the basic physical properties of binary ionic liquid and ketone mixtures: density and speed of sound. The artificial neural network algorithm was used to predict these properties by varying the temperature, mole fraction, atom count in cation, methyl group count in cation, atom count in anion, hydrogen atom count in anion of ionic liquid and atom count in ketone. Total experimental data points of 2517 for density and 947 for speed of sound were used to train the algorithm and to test the network obtained. The optimum neural network structure determined for density and speed of sound of binary ionic liquid and ketone mixtures were 7-9-9-1 and 7-7-4-1 respectively; overall average percentage error of 2.45% and 2.17% respectively; and mean absolute error of 28.21 kg/m3 and 33.91 m/s respectively. The said algorithm was found applicable for the prediction of density and speed of sound of binary ionic liquid and ketone mixtures.


Introduction
Ionic liquids (ILs) are classified as highly useful compounds having very good properties such as being non-volatile and non-flammable, low toxicity and good solubility for various organic and inorganic materials. Compared to regular volatile organic solvents, ILs have received considerable attention because they are more environmentally friendly. Applications of ILs solve a lot of major problems regarding green energy production and environment which includes solar energy, biomass and CO 2 adsorption [1]. ILs have also been introduced as carbon dioxide capturing solvents as alternative to conventional amine-based solvents [2]. Publications about the preparation and application of ILs have grown and researches have gained considerable interest, therefore physical properties of ILs such as density, viscosity, conductivity, speed of sound, etc. are needed for these applications.
ILs are considered as "designer solvents" and an alternative to hazardous organic solvents [3]. The use of these promising solvents as alternative to unfriendly traditional solvents reduces the negative impact on environment to a great extent. On the other hand, the toxic effects of ILs also have attracted great attention. In order to control their potential hazards and to design environmentally friendly ILs, knowing its physical properties is highly important. The numerous applications of ILs encourage the need to have thermodynamic models to compute the thermodynamic properties of ILs like the COSMO-RS which have been widely-used and considered an efficient tool in predicting properties of ILs [4]. Previous studies are only limited to certain number of systems of ionic liquids like binary mixtures of ILs with water and alcohol. Also, they only vary only one, two or three parameters like pressure, temperature and mole fraction while the effect of atom counts is disregarded. Other researches considered a certain temperature range but limited binary ILs only.
Model building is needed for the properties of ILs to integrate wide range of composition and temperature as varying parameters. The existing data from experiments are reviewed to achieve accurate predictions of ILs. This research generates models that can predict physical properties of binary IL and ketone's physical properties by incorporating the parameters that are produced from an algorithm. These properties are specifically density and speed of sound which are acquired from experimental data from different references. Optimization is done using the algorithm namely Artificial Neural Network (ANN).
The output of this research is useful in reducing the cost in terms of utilizing ILs. Conducting experiments is highly costly because of the expensive materials and equipment. In this research, the physical properties are predicted instead of utilizing experiments which minimizes expenses and time. The huge number of experimental data can be represented by a model so that industries that use ILs will no longer handle experiments but will only refer to the models that have the ability to predict properties. This makes the experimental data simpler and manageable.
This study covers the prediction of binary IL and ketone mixtures only. The ketones considered are acetone, acetophenone, gamma-butyrolactone, N-methylpyrrolidone and 4-methyl-1,3-dioxolan-2-one. The ANN algorithm is used to predict the properties of ILs namely density and speed of sound. Density is an important property of ionic liquids which is essential in different applications like designing apparatuses, applying and solving material balance and design of separation processes and a crucial property in industrial process design involving ionic liquids. Speed of sound is also a significant property because it is needed to determine other physical properties and it is one of the key thermodynamic property of ILs due to its close relation with compressibility. The IUPAC Ionic Liquid Database, ILThermo is the database used in obtaining the experimental data of ILs. The parameters that are varied are temperature, mole fraction, atom count in cation, methyl group count in cation, atom count in anion, hydrogen atom count in anion of IL and atom count in ketone only.

Methodology
The step by step process flow chart for the prediction of density and speed of sound using the Artificial Neural Network algorithm is shown in Figure 1. The first step was gathering all the available experimental data for binary IL and ketone mixtures from different references. Inconsistent data were then trimmed. The acquired trimmed data were considered as the input data in evaluating the weights and bias or simply called as the parameters by applying the Artificial Neural Network algorithm. Using the obtained values of the weights and bias, equations for computing the properties used by the algorithm were utilized to recalculate the values of the properties. These new set of predicted data acquired after applying the model was then tested by getting the mean absolute error between the predicted and experimental values in order to identify which combination of the hidden layers produced the most accurate results.
The values of experimental and predicted properties were organized and then graphed according to the value of the percentage error.

Data gathering
Data gathering involved the searching for property data of binary IL and ketone mixtures from a database which is the IUPAC Ionic Liquids Database, ILThermo. The codes of cations and anions used in this study is presented in Table 1. A total of 2565 for density and 947 experimental data points for speed of sound were gathered. The temperature range, pressure, mole fraction range, number of data points and references for the respective ILs were also presented in the discussion. Also, information regarding atom count in cation, atom count in anion, methyl group count in cation, hydrogen atom count in anion of IL, and atom count in ketone were gathered, compiled and organized completely in a Microsoft Excel® file as part of data warehousing.

Data trimming
Data trimming was the collating of all the data gathered by observing them very carefully, and then removing the points of disagreement. Accurate and reliable data was considered. Data trimming was done by graphing all the data gathered from different references. Graphs of temperature versus property and mole fraction versus property were plotted that formed smooth curves. Points that were observed to be far or out from the smooth curve were omitted or trimmed. The trimmed data were compiled into one spread sheet in preparation for the utilization of the algorithm. For density, the number of data points left after trimming was 2517 and 947 for speed of sound. References were classified into three different groups namely systems with more than two references, systems with two available references and systems with only one reference. For systems with more than two references, the data that were consistent with one another were considered. For systems with two available references, the most accurate data were selected in which the accuracy were based from the reported uncertainty. Lastly, systems with only one available reference were automatically considered. Additionally, systems that contain only two data points that belongs to this group were considered [5]. Data with large uncertainties were inconsistent data and expected to be out from the generated smooth curve.

ANN algorithm
The ANN model used in the algorithm is presented in Figure 2. This model includes input to a layer succeeded by hidden layers and the last layer called the output layer [6]. Each node in all layers were bridged through weights (w n-n', w I'-n , and w n'-Y ) and also the bias (w b-n , w b-n', and w b-Y ). The source node is at first subscript while the destination node is at second subscript. The setting of input layer allowed a total of seven input variables: temperature, T, mole fraction of the IL, X, atom count in cation, NC, CH 3 -R group count in cation, NM, atom count in anion, NA, hydrogen atom count in anion, NH of IL and atom count in ketone, NK. The study was limited to a maximum of 2 hidden layers and 10 nodes in each hidden layer. For the output layer, there was only one expected output per neural network structure which was the physical property. Density and speed of sound for each binary IL and ketone mixture were treated separately.
A flowchart for determining the neural network structure is presented in Figure 3. The neural network structure with the most accurate results for every physical property was determined by selecting the structure with lowest mean absolute error, MAE given in Eq. 1, where L is the total number of data points, Y l is the predicted value and E l is the experimental or actual value.
The mathematical relationship among the inputs, hidden layers and outputs is described by weights, bias weights, and transfer functions [7]: The transfer function is given by the following: The I' in Eq. 6 is a function of the input variables: T, X, NC, NM, NA, NH and NK and its corresponding slope, m i and intercept, b i and is expressed as:  Initially, the training of ANN started by randomly assigning the initial values for weights and bias. A flowchart for training the neural network is shown in Figure 4. The weights and bias were adjusted until the termination criteria was achieved during the training period. In this case, a value of 0.5 for all initial weights and bias were assigned. The maximum number of epochs, training time and target mean square error, MSE (Eq. 7) were the three termination criteria.
The experimental data were divided into two different subsets which were the training and testing. Ninety percent (90%) of the experimental data were utilized in neural network training and remaining ten percent (10%) of data were allocated in testing the generated model. Parameters were obtained, and the optimum neural network structure were selected after the training process.

Prediction of properties
An MS Excel ® spread sheet which simplified the computation for the chosen structure was prepared for the recalculation of the properties. Eq. 9 was used to recalculate the data points for density and speed of sound. Y l is the predicted value and Y l ' is the output node and is a function of weights, bias weights and the corresponding slope and intercept for the given set of data points (Eq. 4).

Computation of MAE and percentage error
The last step was obtaining the mean absolute error for density and speed of sound using Eq. 1. For the goal of analyzing the results, percentage errors given in Eq. 10 were also computed and the experimental and predicted values were grouped and graphed according to the percentage errors. Percentage errors of 0 -1% were marked green, 1 -5% were marked yellow while the 5% and above were marked red.
3 Results and discussion

Density
A total of 2565 data points was collected for the density of binary IL and ketone mixtures from different reliable literatures. From that, 2517 trimmed data were utilized in training the network and obtaining the optimum parameters of the neural network. Adjustment of parameters was performed for different trial-and-error stage or epoch until the optimum neural network structure was achieved. The optimum neural network structure in the prediction of density of binary mixture of IL and ketones is called the 7-9-9-1 neural network structure. The neural network with nine (9) hidden layer 1 nodes and nine (9) hidden layer 2 nodes was the combination that reported the lowest mean absolute error of 28.21 kg/m 3 and overall average percentage error of 2.45%.    As shown in Tables 2 to 5, the average percentage error for the prediction of density of binary IL and ketone mixtures ranged from 1.23% to 3.63%, 0.50% to 1.47%, 1.20% to 6.99% and 0.19% to 2.25% for binary ILs containing acetone, acetophenone, gammabutyrolactone and 4-methyl-1,3-dioxolan-2-one respectively. The results acquired from prediction show that N-methylpyrrolidone + trimethylammonium dihydrogen phosphate (C11A12) with 60 data points resulted the highest percentage error. The possible sources of errors for the systems with a bit high percentage error could be from the inconsistency of experimental data that might occurred due to impurities of the substances and from inaccuracy of instruments and measurements methods. Tables 6, 7 and 8 show the values of the weights and bias that resulted from applying the ANN algorithm that are used in determining A, Bn' and Cn of Eq. 11. The values are the result of modeling the density of binary IL and ketone mixtures which obtained the 7-9-9-1 as the optimum neural network structure and were utilized in predicting density. The generated model for this prediction as shown in Eq. 11 is a function of parameters A, Bn' and Cn where mole fraction, X, temperature, T, atom count in cation, NC, methyl group count in cation, NM, atom count in anion, NA, hydrogen atom count in the anion, NH and atom count in the ketone, NK values are inputted in Cn.

Fig. 5. Density of binary IL and ketone mixtures.
Predicted values by thes model versus experimental values: %error < 1 (Green); 1 ≤ %error ≤ 5 (Yellow); %error > 5 (Red). Figure 5 shows that the optimum neural network structure was able to predict the experimental values successfully for the density of binary and ketone mixtures. The predicted values were observed to have good agreement with experimental values. Some of the error of prediction lied in the experimental uncertainties of data points. From all the recalculated experimental density of this system, 34.92% were in between the percentage error range of 0-1% which were marked green, 50.74% were in the range of 1-5% which were marked yellow and only 14.34 % of the studied compounds have the percentage error higher than 5% which were marked red. With such minimal number of data points with percentage error greater than 5%, the model obtained using the 7-9-9-1   Table 8. Output layer weights and bias.

Speed of sound
There were 947 data points collected for the speed of sound of binary IL and ketone mixtures which were obtained from various reliable literatures. Since all the systems have only one reference, all the collected data were used in training the network and obtaining the optimum parameters of the neural network. Just like in the prediction of density, adjustment of parameters was performed for different trial-and-error stage or epoch until the optimum neural network structure was achieved. The optimum neural network structure in predicting the speed of sound of binary IL and ketone mixtures is the 7-7-4-1 neural network structure. The structure with seven (7) hidden layer 1 nodes and four (4) hidden layer 2 nodes achieved the smallest mean absolute error of 33.91 m/s and 2.17% overall average percentage error.  The percentage error for the prediction of the speed of sound of binary IL and ketone mixtures ranged from 0.79% to 1.96% and 0.59% to 4.01% for ILs containing acetone and N-methylpyrrolidone respectively, as presented in Tables 9 and 10. The results acquired from prediction show that N-methylpyrrolidone +   Figure 6. shows that the optimum neural network structure was able to predict the experimental values successfully. The predicted values of speed of sound of binary IL and ketone mixtures were observed to have good agreement with experimental values. Most of the error of prediction lied in the experimental uncertainties of data points. From all the recalculated experimental speed of sound of this system, 35.06% were in between the percentage error range of 0-1% which were marked green, 53.01% were in the range of 1-5% which were marked yellow and only 11.93% were greater than 5% which were marked red. With such minimal percentage error greater than 5%, the model obtained using the 7-7-4-1 structure was already acceptable for the prediction of speed of sound of binary IL and ketone mixtures.

Conclusion
New models using an algorithm, the artificial neural network, were designed to predict the density and speed of sound of binary ionic liquid and ketone mixtures which have numerous applications because of its environmentally benign nature. The prediction was based on the knowledge of temperature, mole fraction, atom count in cation, methyl group count in cation, atom count in anion, hydrogen atom count in anion of IL and atom count in ketone for the compounds in the mixture. Density and speed of sound from IUPAC Ionic Liquids Database, ILThermo, were considered as the experimental database. If no experimental data is available, the proposed models are potential tools to estimate the density and speed of sound of binary ionic liquid and ketone mixtures.
In this study, the network has a maximum of seven inputs and one output. The optimum neural network structure acquired for the density of binary ionic liquid and ketone mixtures was the 7-9-9-1 model with an overall average percentage error of 2.45% and mean absolute error of 28.21 kg/m 3 . For the speed of sound of binary ionic liquid and ketone mixtures, the model with 7-7-4-1 neural network structure was found to be the optimum model which produced 2.17% overall average percentage error with 33.91 m/s mean absolute error. The results for the density and the speed of sound of binary ionic liquid and ketone mixtures showed that the experimental and the ANN predicted data were in good agreement. Therefore, the identified models are applicable for the prediction of density and speed of sound of binary IL and ketone mixtures.