Deciding Heavy Metal Levels in Soil Based on Various Ecological Information through Artificial Intelligence Modeling

ABSTRACT The aim of this paper is to decide on heavy metal levels based on ecological parameters by effectively eliminating common disadvantages such as high cost and serious time-consuming laboratory procedures via an effective artificial intelligence approach. Therefore, this study is hinged on an artificial intelligence technique, ANN, because of its low cost and high accuracy in overcoming the mentioned limitations and obstacles in the determination process of the amounts of elements. The ANNs have thus been employed to determine essential heavy metals, such as Fe, Mn, and Zn depending on Ca, K, and Mg concentrations of soil samples obtained from different altitudes in Mount Ida. To the best knowledge of the authors, this is the first study in the literature in which altitude was considered as a parameter in the prediction of nutrient heavy metals. The computed relative errors are significantly low for each of the considered elements (Fe, Mn, and Zn); and are found to be between 1.0–4.1%, 1.0–4.2%, 1.5–7.1%, respectively, for the training, testing, and holdout data. The findings indicate that the relative errors could still be decreased further by assuming the altitude as a factor variable.


Introduction
The amount of nutrient elements in the soil is of great importance for plants since the supplies and variety of these elements provide plenty and richness of the vegetation. In this respect, the Mount Ida, which has become a national park because of the abundance of vegetation and the biodiversity it provides therein, contains environmentally significant examples of various plant flora.
The analytical elemental analysis instruments utilized to determine the amount of the elements in soil and plants have various difficulties and limitations.
The presence of nutrient elements in the soil is a necessity for plants (Arefi, Kafi, and Khazaei 2013). Elements that are characterized as macro elements such as nitrogen (N), phosphorus (P), calcium (Ca), potassium (K), and magnesium (Mg), whose rates of appearance in the soil are higher than many other elements, contribute greatly to the plant diversity in the habitat (Can et al. 2021). Considering the importance of macro elements, it is necessary to know how much they are in the soil (Yahia, García-Solís, and Celis 2019).
Determination of the amounts of elements in soil and plants is traditionally performed with elemental analysis instruments such as Atomic Absorption Spectrophotometer (AAS), Inductively Coupled Plasma Mass Spectrometer (ICP-MS), and Inductively Coupled Plasma Optical Emission Spectroscopy (ICP-OES) (Alam, Ahmed, and Howladar 2020;Dan-Badjo et al. 2019;Sayo, Kiratu, and Nyamato 2020;Yalcin et al. 2020). In addition to the conventional analytical methods, various mathematical models, and artificial intelligence techniques, including ANNs, are also utilized regarding the prediction of the amounts of stated elements (Marković et al. 2016;Zhang et al. 2020;Zhou et al. 2015).
Environmental components such as air, water, and soil are pollutant receptors of large amounts from multiple sources, and therefore they can be used to study the origin and properties of the pollution (Alengebawy et al. 2021; Emenike et a. 2020). Environmental factors such as air, water, and soil are susceptible to contamination due to various pollutant effluents and substances, and consequently, are prone to create severe ambiguities in risk assessment, decision making, and management processes (Suarez-Paba, Cruz, and Munoz 2020). Soil pollution is accepted as an important risk indicator especially in woodlands since it paves the way to severe dangers for health and the environment (Hossen et al. 2021;Jiang et al. 2021;Wu et al. 2021). Elemental analysis, among the different soil quality indicators, comes to the forefront as a traditional but efficient method to assess the extent of soil contamination. However, experimentally measuring the correlation between soil properties and elemental concentration of pollutants are both time-consuming and costly. Moreover, it seems impossible to simulate all naturally occurring variants with the highest accuracy.
In the use of elemental analysis instruments that are accepted as traditional methods, there are a lot of difficulties such as costs arising from the excessive use of consumables such as acid and pure gas, the need for providing appropriate temperature, humidity, cleaning conditions in the environment where the device is located, the device operator costs based on elapsed analysis times for each element, and deduction limits (Pearce et al. 2004;Vera et al. 2021). However, the mathematical modeling tools, especially artificial intelligence techniques, outstand as important alternatives to save time and costs. In this respect, there are studies in the literature reporting that ANNs could make more accurate predictions as compared to the traditional methods (Inakollu et al. 2009;Mojid, Hossain, and Ashraf 2019;Olawoyin et al. 2013;Shadrin et al. 2020). The existing studies in the literature on element analysis include mathematical models regarding long time periods like the effects of environmental pollution in the long run mostly from a temporal viewpoint (Bui, Bui, and Nguyen 2021;Jia, Dong, and Du 2020;Jiang, Nan, and Yang 2013;Li et al. 2021;Oonk and Spijker 2015). To the best knowledge of the authors, the ANNs have not been used by taking into account the spatial-data viewpoint as in this study before to obtain the amounts of ingredients like heavy metals in soil. The most prominent aspect of this research is to assure that it is possible to obtain costeffective results as compared to the derived results by using the conventional device-based techniques by performing fewer amount of elemental analysis via an artificial intelligence technique based on ANNs.
Since they involve an adaptable and flexible structure consisting of layers and neurons, ANNs can identify and classify complex nonlinear relationships between input and output datasets. Therefore, ANN is a powerful technology for modeling the complex "input-output" relationship (Chen et al. 2019). ANN is also a technique with flexible mathematical structure that could be developed by inspiration from biological neural networks (Qaderi et al. 2017). The flexibility and adaptivity of ANNs to use in many areas enable them as the first option for modeling many scientific problems. Recently, ANNs, which have been used successfully toward the solution of various problems, have increased their popularity progressively in environmental problems, since they could be fruitful tools of the trade to estimate the features or behaviors encountered in environmental problems (Fangfang, Alagumalai, and Mahian 2021;Guo and Wang 2021;Kassem, Gokcekus, and Maliha 2021;Nourani et al. 2020;Shams et al. 2021;Wolski and Kruk 2020). In recent years, the performance of ANN models has increased tremendously with the development of computer hardware and software technologies and has attracted great attention regarding the construction of various prediction models. Highly complicated features or complex nonlinear relationships regarding a dataset could be enlightened by increasing the depth of a neural network and the number of neurons included in the hidden layers on a reasonable level and sound basis. Since it is a data-driven approach, the ANN technique does not require troublesome mathematical computations such as the computation of a Jacobian matrix, numerical integration, and so on to handle sophisticated scientific problems. Therefore, ANNs have been utilized successfully to deal with a lot of problems in a wide variety of disciplines such as biomechanics (Sari and Cetiner 2009), climatology (Shahmansouri et al. 2021), financial and economic modeling (Sermpinis et al. 2021), environmental pollution (Maleki et al. 2019), medical applications (Zhang et al. 2018), and composition of music via computers (Abu Doush and Sawalha 2020;Briot 2021). In this respect, ANNs can be used to make the necessary estimates in a variety of research areas, and the flexibility of the number of dependent and independent variables is one of the most outstanding aspects. In the determination process of the optimization model, ANNs, which is inspired by biological neural networks, are taking place in the prediction tools and provide accurate responses in various fields such as determination of plant element concentration, estimation of water and soil pollution, determination of suitable agricultural lands, determination of irrigation type and amount.
In soil chemistry, while macro elements such as Ca, K, Mg, N, P, and S are allowed to be present in comparatively high concentrations for plant vitality, heavy metals are considered as a special element group having toxic effects on plants in the case of high concentrations (Karahan et al. 2020;Uchimiya et al. 2020). Although Cu, Fe, Mn, Mo, and Zn are essential heavy metals for plant growth, their excess amount in the soil above a certain concentration may cause toxic effects for plants (Jothimani, Arulbalachandran, and Yasmin 2017;Turan, Ozdemir, and Demir 2020).
Mount Kaz or Mount Ida is a mountain range located between Canakkale and Balikesir provinces and in the north of Edremit Bay. The mountain, called Kaz Mountain or Kaz Mountains, extends largely on the Biga Peninsula. Kaz Mountains consist of Mount Dede in the west, Mount Kaz in the middle with three hills (Babadag in the north, Karatas hill in the middle, Sarikiz hill in the south), Mount Eybek in the east, and Mounts Gurgen and Kocakatran in the northeast. The deep valleys and canyons located on Mount Ida and extended in the north-south direction exhibit a rich potential regarding flora and fauna (Efe et al. , 2014Ozyigit et al. 2015). Especially, the biological diversity housed by the vegetation constitutes one of the most remarkable values of the national park.
This study mainly aims to discover concentrations of essential heavy metals, such as Fe, Mn, and Zn based on Ca, K, and Mg concentrations of soil samples obtained from different altitudes in the Mount Ida.

Study Area, Elemental Analysis, and Data Structure
In this study, soil samples were collected from the Mount Ida national park road first at an altitude of 20 m, then at every 100 m up to 1600 m, 1621 m, 1658 m, and 1678 m along the road to Sarikiz Hill in the national park. Fifteen samples have been collected from each of the mentioned altitudes. These soil samples weighing 500 g were taken from the designated locations 20 cm below the surface and brought to the laboratory environment in sterile bags. They have been dried in an oven at 80°C for 48 hours in glass petri dishes. Then, it was made ready for weighing by passing it through a steel sieve with a 2 mm pore diameter. Soil samples weighed in the range of 0.200-0.250 g were transferred to Teflon vessels then 6 ml 65% HNO 3 (Merck), 3 ml 37% HCl (Merck) and 2 ml 48% HF (Merck) was added. The digestion process of the prepared samples was carried out by using the Berghof-MSW2 brand-model microwave device. After the process, the samples were transferred to 50 ml sterile falcon tubes using ultra-pure water by filtering with a blue band Whatman filter. The total volume was completed to 50 ml (Ozyigit et al. 2015;Yalcin et al. 2020). The concentrations of Ca, Fe, K, Mg, Mn, and Zn elements were determined as mg kg −1 dry weight by the PerkinElmer-Optima 7000DV inductively coupled plasma optical emission spectroscopy (ICP-OES) device.

Neural Network Design and Setup
The ANNs are robust metaheuristic computational tools designed by inspiring the activities of neurons. The general structure of ANNs consists of the input layer, hidden layer(s), and output layer. The input layer contains neurons, so-called covariates, or independent variables, while the output variable contains neurons called dependent variables. Although the number of hidden layers and the number of artificial neurons therein are not definite values, both the number of independent variables and dependent variables is predetermined based on the studied problem. As is the case in Figure 1, there is no connection between the neurons of the same layer, but usually, the neurons of neighboring layers are densely interconnected via synapsis-like structures. Thereby, the data collected from the environment is utilized to train the neural network to predict the continuous values of the dependent variable.
The data collected in a total of 300 samples are divided into three subgroups called training data, testing data, and holdout to prevent overfitting and to make reasonable predictions ( Table 1). The supervised learning starts with random weights and determines the weights that will be applied to the current task. Back-propagation neural networks are typical supervised learning procedures, employing the back error procedure for learning. The utilized backpropagation algorithm to train the neural networks is endowed with gradient descent to minimize the error via updating the weights. SPSS 27 has been utilized to reach the desired data-driven model. During the computations, the method is chosen to be neural networks, the submodule is preferred as the multi-layer perceptron (MLP), the number of hidden layers is taken to be 1, the number of neurons or units in the hidden layer is taken to be 3, and the hyperbolic tangent function and the sigmoid function are utilized as the activation function for the hidden layer and the output layer, respectively.
The inner structure of the MLP, as indicated in Table 2, is constructed by attributing 4 input variables where Altitude, Ca, Mg, and K are set as independent variables in each case during the calculations. In addition, the number of the output variable adjusted as 1 that is represented individually by Fe, Mn, and Zn. The distribution of the training, testing and holdout data are Sum of Squares a .Excluding the bias unit determined as 70%, 20%, and 10% for each cases Fe, Mn, and Zn. Regarding the structure of the MLP, it is important to note that the number of units in the input layer is seen to be 4 in Table 2. Both the dependent and independent variables are rescaled through a normalization process before the analysis via standardization. Different MLPs have been trained and separate analyses have been carried out for each dependent variable as it is understood from Figure  2-3 and the quantitative results in Table 3-5.
The learning rate of the algorithm is set to be 0.4 initially with a momentum of 0.9. The squared error function has been utilized during the operation of the gradient descent algorithm. The algorithm consumes all the data once and continues to use the recorded data until reaching one of the stopping criteria such as the maximum number of epochs, a predetermined number of consecutive steps with no decrease in error, maximum ratio of the relative errors, and so on.

Results and Discussion
When classifications or predictions based on data-driven mathematical models are concerned without noticing whether there is causality between the dependent and independent variables or not ANNs are powerful tools. The current study focuses on the prediction regarding the amount of essential heavy metals like Fe, Mn, or Zn in the soil of Mount Ida by considering the altitude in addition to the macro elements like Ca, K, and Mg. Although various methods such as artificial neural networks, machine learning, and even deep learning have been used in the literature to predict element levels, so far, altitude has not been considered in any study (Bagheri, Bazvand, and Ehteshami 2017;Bhagat et al. 2021;Hanandeh, Mahdi, and Imtiaz 2021;Lu et al. 2019;Shadrin et al. 2020). A supervised learning procedure, ANNs, are adopted to achieve this aim. It has been seen that the ANNs can be preferred as an important alternative in determining the soil element concentrations as a time-saving and low-cost method. The current method could be employed to make predictions with higher accuracy as compared to the traditional analytical methods, in most cases. The current approach can be regarded as a prediction model based on the real-world data, and comparative results with statistical methods in the literature are not included in this paper. In addition, validation of the present approach has been performed via splitting the data into three parts and using one of them for validation. Thereby, the required validation has been observed by utilizing the real-world data that is not used in the training or testing stages. Besides, to the best knowledge of the authors, this study that utilizes the ANNs to forecast the amount of essential heavy metals by associating them with the altitude is a pioneering work in the literature. In addition, the importance of this ANN approach can be better understood when its possible impacts on industrial areas such as smart farming, precision agriculture, and mining are taken into account. With this study, it has been shown that the ANN technique is an effective alternative method to reach further element analysis results by doing fewer experiments in soil element content studies.
The architecture of the neural network consists of four independent variables Altitude, Ca, K, Mg in the input layer. The hidden layer compromises three neurons as depicted in Figure 1. The output layer contains a single unit that represents Fe, Mn, or Zn in separate cases. Input and output data are normalized before starting the analysis. Then, the data is distributed into three categories for the purpose of training, testing, and holdout. These partitions of the data for three different micro elements (Fe, Mn, or Zn) can be found in Table 1 in detail. The training part is utilized for the supervision of MLP while the testing or validation part is exploited to avoid overfitting. The holdout data is spared to control the accuracy of the prediction. The hidden layer made use of the hyperbolic tangent function while the output layer used the logistic sigmoid function as the activation function since the sigmoid functions are widely utilized in prediction models concerning mathematical biology and chemistry. The audience can refer to the work of Mustafa et al. (2021) for a specific example. The sum of squares error is adopted as the error function, and each of the number of consecutive steps without decreasing in the error, the maximum training time, the maximum number of epochs, the error change or the relative error change in the consecutive steps are introduced as stopping criteria.
Firstly, the predicted vs actual Fe values have been plotted in Figure 2(a) for the whole dataset, and the results accumulate in an acceptable and reasonable neighborhood of the perfect prediction line. The residuals have been depicted in Figure 3(a) for the predicted Fe values, and the results are shown in the figure again quite plausible when the actual values are considered. The quantitative results in Table 3 show that the relative errors have been found to be 4.1%, 4.2%, and 7.1% for the training, testing, and holdout data, respectively. Since the actual values are sufficiently higher than zero so that the relative errors suffice to take a full grasp regarding the effectiveness of the current technique. Moreover, it is important to point out that the holdout dataset has not been included in the analysis during the training and testing stages. Besides, the sum of squares error is computed as 1.070 for the training set and 0.0131 for the testing set that seems to be considerably small values. Also, the RMSEs have been computed to be .071 and .075, respectively, for the training and testing data. Another important finding is the importance of the altitude among the independent variables. The conclusion that Altitude seems to be the most important independent variable among all   independent variables can be inferred from Table 4. Also, the parameter estimation demonstrated in Table 5 provides a sound base regarding this inference and is utterly persuasive. Secondly, the predicted vs the actual Mn values and the residuals are illustrated in Figures 2(b) and 3(b), respectively. The results in Figure 2(b) exhibit an almost perfect match while the residual values seem fully acceptable in a harmony with the predicted vs actual values. According to the findings in Table 3, the relative errors has been computed as 1.0%, 1.0%, 1.5% for the training, testing, and holdout data, respectively. The sum of squares errors is found to be 0.081 and 0.032 for the training and testing data, respectively. In addition, the RMSEs were computed to be .012 and .021, respectively, for the training and testing data. As reported by the results concerning the parameter estimation in Tables 4 and 5, Ca and K are the foremost important independent variables in the prediction of Mn.
Finally, the predicted vs true Zn values are plotted in Figure 2(c), and the residual plot is supplied in Figure 3(c). The power of the ANN-based prediction method could be observed in the former one since the actual vs the predicted values concentrate in a tiny subset of the confidence region. Furthermore, the corresponding relative errors are found to be 2.0%, 2.2%, and 3.4%, respectively, for the training, testing, and holdout data while the sum of squares errors is computed to be 0.155 and 0.063 for the training and testing datasets. Moreover, the RMSEs have been computed to be .028 and .030  for the training and testing data, respectively. According to the results of variable importance analysis, the importance of the independent variables K and Altitude seem the highest ones among the independent variable importance's via the parameter estimations in Tables 4 and 5. Indeed, although the produced results are quite satisfactory, the relative errors could be declined up to one-fifth of the received results. Particularly, the derived results in Table 6 have been deduced by setting Altitude as a factor  variable instead of an independent variable, even for modest stopping criteria. At its core, the attribution of Altitude as a factor variable at the beginning of the training leads to a higher numerical accuracy since each separate value of Altitude is involved in the training process as a separate independent variable in that case.

Conclusions
In this paper, efficient neural network models with an innovative perspective of ecological importance have been produced to determine the heavy metal (Fe, Mn, and Zn) level in soil by using local factors (altitude, Ca, K, and Mg). It is believed that the derived network models will assist in finding heavy metal levels in soil, assessing economic and environmental impacts in various local conditions, and making accurate decisions in improving desired environmental policies. In this context, heavy metal levels have been investigated based on the soil information obtained from the Mount Ida. Unlike conventional approaches, the ANN has then succeeded in investigating heavy metal levels, depending on the real data, in the soil through altitude and various soil parameters for the first time. This article has provided very informative and guiding results from the latest research through the derived neural network models for the ecosystem of interest, based on the relation between the altitude and the examined element levels for the first time in the literature. The simulation results can be viewed as an important indication of the superiority of the network algorithm over other conventional approaches. It has been concluded that these findings will be very beneficial in terms of environmental and all aspects in organizing suitable research plans for scientists in this field. There is no doubt that in modeling the behavior of such a wide variety of realistic problems involving a wide range of sciences, optimal assessment of heavy metal status for living things and therefore for agricultural economies and even political decisions in daily life is vital. The results obtained appear to be original and optimal and therefore it is a requirement for the interested readers to be more careful in modeling such problems. Although this study has been carried out to determine the heavy metal level in the Mount Ida, the fact that the same study can be realized very comfortably for any ecosystem is believed to have increased the importance of this study even higher. For further research, such studies can be done for plant element status in a more involving way, similar to the element status determined here in the soil.

Disclosure statement
No potential conflict of interest was reported by the author(s).

Informed consent
This manuscript did not involve human or animal participants; therefore, informed consent was not collected.