Artificial Neural Network Approach to Modelling of Metal Contents in Different Types of Chocolates

The relationships between the contents of various metals (Cu, Ni, Pb and Al) in different types of chocolates were studied using chemometric approach. Chemometric analysis was based on the application of artificial neural networks (ANN). ANN was performed in order to select the significant models for predicting the metal contents. ANN equations that represent the content of one metal as a function of the contents of other metals were established. The statistical quality of the generated mathematical models was determined by standard statistical measures and cross-validation parameters. High agreement between experimental and predicted values, obtained in the validation procedure, indicated the good quality of the models. The obtained results indicate the possibility of predicting the metal contents in different types of chocolate and define the strong non-linear relationship between metal contents.


Introduction
Chemometric analysis is undoubtedly of great importance in modern sciences.It means performing calculations on measurements of chemical data.Chemometric techniques are applied to explain both descriptive and predictive problems in experimental life sciences, especially in chemistry and biochemistry.In descriptive applications, properties of chemical systems are modelled with the intent of learning the underlying relationships and structure of the system.[3][4][5][6][7][8][9][10] Artificial neural networks (ANNs) are widely applied chemometric method for regression and classification purposes.ANN is a powerful data modelling tool which can be combined with both classical and modern statistical methods.The developing of ANNs is based on brain structure.ANN are able to learn, recognize patterns and manage data. 11They are made from artificial neurons which have a function as biological neurons.ANN consist of a number of linked layers of artificial neurons, including an input and an output layer.Measured variables are presented to the input layer and they are processed by mathematical functions in one or more hidden (intermediate) layers. 12The multilayer perceptron (MLP) model made from one input layer, one or more hidden layers and one output layer is the most common flexible and general type of ANNs. 13MLP represents a feed-forward ANN architecture with unidirectional full connections between successive layers.However, this does not uniquely determine the property of ANN.In addition to network architectures, the neurons of a network have activation functions which transform the incoming signals from the neurons of the previous layer applying a mathematical function.4][15][16] Thus, it is important to choose a type of activation function for the neurons of a neural network, such as hyperbolic tangent function (tanh), logistic sigmoid func-tion (logistic), identity function, negative exponential function (exponential) and sinusoidal function (sine).Most common nonlinear activation functions are sigmoid and hyperbolic tangent functions. 13Coefficients associated with the hidden layer (weights and biases) and coefficients associated with the output layer are grouped separately in sets of matrices.Weights are constantly updated and determined during the training step by means of a learning rule.The error function between network outputs and experimental outputs is minimized by optimization procedures.
The main advantages of ANN technique include the ability to learn non-linear and linear relationships between variables directly from a set of examples and the capacity to model multiple outputs simultaneously. 12,13he aim of this research was to study the usefulness of chemometric analysis (ANN) in the prediction of the metal contents in different types of chocolate.

Materials and Methods
The complete ANN analyses was carried out by NC-SS&GESS and Statistica v. 10.0 software.Model validation is a very important aspect of every regression analysis. 15,16The statistical validity of ANN models was described by standard statistical parameters: R, R train , R test and R val (correlation coefficients for the whole data set, training, test and validation set, respectively), RMSE, RMSE train , RMSE test and RMSE val (RMSE for the whole data set, training, test and validation set, respectively), variation coefficient (CV), Fisher's value (F -test) and significance level (p).Test set must be used to determine generalization error, while validation set is used to find the best ANN configuration and training parameters (by comparing validation set error and training set error during training).These statistical measures were used for comparison of prediction ability of the established models.Calculated leave-one-out (LOO) cross-validation parameters are the following: correlation coefficient of cross-validation (R 2 CV ), predicted residual sum of squares (PRESS), total sum of squares (TSS) and PRESS/TSS ratio.
Automated network search (ANS) option in Statistica v. 10.0 program was applied for searching for the optimal network architecture.First of all, the whole data set (Table 1) was divided in three subsets: training set with 70% of the data, and test set and validation set with 15% of the data each.100 ANNs were trained and four of them were selected as the best.The applied training algorithm for the multilayer perceptron ANN models was Broyden-Fletcher-Goldfarb-Shanno (BFGS) and error function was based on sum of squares (SOS).Sine, tanh and logistic functions were used for hidden activation, while identity, exponential and sine served as output activation functions.The vaules of weights of neurons were predetermined by the applied software.The weight decay values for hidden and output layers were in the range from 0.0001 to 0.001.

1. Instrumentation
Metal (Cu, Ni, Pb, Al) contents were determined using inductive coupled plasma with optical emission spectroscopy (ICP-OES) system -Thermo iCAP 6500 Duo.The analytical lines used for each element, as well as the instrumental parametars of analyses are given in Table 2.The emission lines for each element were based on tables of known interferences, baseline shifts and experience in work with different samples.
Plasma of argon gas was used to produce excited atoms and ions which emitted characteristic electromagnetic radiation.Samples were prepared in automated system for microwave digestion (Berghof MSW 3+).

Chemicals and Reagents
Chemicals used in the analysis were of extra purity grade for trace element analysis (J.T. Baker, USA, IN-STRA).Used chemicals include HNO 3 , H 2 O 2 , standard solutions of Cu, Ni, Pb and Al (1000 mg/dm 3 ).For all dilutions and dissolutions ultra pure water from EasyPure system was used.Working solutions were prepared daily by diluting standard solutions with 0.1 mol/dm 3 of nitric acid.All vessels and cells were washed with nitric acid (1:1), deionized and ultra pure water.

3. Samples
Metal content was determined in 38 different chocolate samples.Samples were collected randomly in the lo-cal markets.Collected samples included both domestic (Serbian) and foreign producers.

4. Sample Preparation
Samples were digested by microwave-assisted mineralization.Samples (0.4 g) were well homogenized and transferred to the reaction vessels and 7 cm 3 of nitric acid and 2 cm 3 of hydrogen peroxide were added.Applied digestion programme is given in the Table 3.  Digested samples were quantitatively transferred to volumetric flask and diluted to 25 cm 3 with ultra pure water.A blank digest was carried out in the same way as the samples.Recovery test was done for each element with the following results: 98.6% (Cu), 99% (Ni), 99.1% (Pb) and 99.5% (Al).

Results and Discussion
The ANS procedure for ANN developing resulted in four networks.These networks differ in the input and out-   4.
The real quality of the networks was estimated by comparison of RMSE and R for all networks and by analysis of residuals.Generally, all the obtained ANNs have the excellent predictive power (R, R train , R test , R val higher than 0.90 and CV% lesser than 5%, R 2 CV higher than 0.50, low PRESS value and PRESS/TSS ratio) (Table 4).
Good test of prediction ability of the selected networks is the graphical comparison of target and output values of metal content (Figure 1).Less scattering of the points around the linear relationship, the intercept very close to zero and the slope very close to 1, indicate an outstanding concurrence between the experimental and predicted data.
Another confirmation of the outstanding predictive power of the formed ANNs is the comparison between minimum and maximum residual and IPD% values that are presented in Table 5.

1. Global Sensitivity Analysis
GSA coefficient presents the ratio between the network error when the observed variable is omitted and the network error when the observed variable is present in the model.The GSA coefficient equal to 1 or less is a sure sign that the variable should be omitted from the ANN model.The results of GSA for ANN models are shown in Figure 2. As it can be seen from the GSA coefficients presented in pie charts, each variable contributes to decrease of the network's error.

Conclusion
The artificial neural networks modelling was successfully carried out on the set of metal contents in different types of chocolates.The ANN modelling resulted in the best four networks.Their usefulness was confirmed by detailed statistical validation.Comparisons of the experimental and predicted values, and predicted values and residuals, showed that the established ANNs can be successfully used in accurate prediction of Cu and Ni content in chocolate samples.Global sensitivity analysis confirmed the importance of each input variable in the applied ANNs.The obtained high-quality networks detects the strong non-linear relationship between the metal contents in the analysed samples.

Figure 1 .
Figure 1.Comparison between measured and predicted values (a-d) and predicted and residual values (e-h) for ANN models.

4. 1 .
Acknowledgement This paper was performed within the framework of the research projects No. 172012 and 172014 supported by the Ministry of Education, Science and Technological Development of the Republic of Serbia and the project No. 114-451-3593/2013-04, financially supported by the Provincial Secretariat for Science and Technological Development of Vojvodina.

Figure 2 .
Figure 2. The GSA coefficients of the input variables.

Table 1 .
The content of metals in the analysed chocolate samples (b -molality)

Table 3 .
Program of microwave digestion

Table 4 .
Statistical and cross-validation parameters of the established neural networks for prediction of the metal contents in different types of chocolate