Prediction of Potato Yield Based on Energy Inputs using Artificial Neural Networks and C-sharp under Saudi Arabia Conditions

The objective of this study was to explore the relation between energy inputs and potato yield using artificial neural network (ANN) under Saudi Arabia conditions. Additionally, the extracted weights from ANN model were formulated using C-sharp language to develop interactive application for friendly and easy use. For this purpose, the energy use pattern was determined by collection data from two sources, the first source was actual field experiments in three sites belong to Riyadh region, Saudi Arabia and the second source from growers by using a face to face questionnaire method. The results indicated that total energy consumption and yield of potato production were different based on production pattern. In this study, for field experiment data, average the energy indices covering energy efficiency, specific energy and energy productivity were calculated at 2.25, 1.60 MJ/kg and 0.63 kg/MJ, respectively. For predicting of potato yield based on energy inputs, artificial neural network (ANN) with standard back propagation algorithm was employed. The results illustrated the ANN model with 6-1522-1 architecture that had the best condition to the prediction of potato yield. With respect to ANN model, R2, mean absolute error and mean relative error were computed as 0.704, 2.36 ton/ha and 5.59%, respectively in testing stage. Moreover, contribution analysis was applied after training process of the ANN model. The results disclosed the water irrigation energy which had the highest contribution (24.75%) to potato yield among all inputs (machinery energy, diesel fuel energy, labor energy, chemicals energy and seeds energy). The developed C-sharp interactive application was tested and it can estimate potato yield. Soil and agronomy researchers, framers and agricultural engineers can use the developed C-sharp interactive application to explore the input variables that have more potential to increase potato yield on a farm. It is user-friendly and could be run on Windows desktop without C-sharp environment.

There are hundreds of potato producers in Saudi Arabia comprising potato production units of all sizes and capabilities, growing many varieties for sale mainly to the wholesale markets.Over 75% of the total potato production in Saudi Arabia comes from small farmers grouped in different regions, and who supply local wholesale markets (http://tadco-agri.com).In Saudi Arabia, potatoes are produced under different agricultural conditions.These conditions include different factors such as seed bed preparation techniques, soil, climate, water quality etc.Additionally, the most tangible and the most important output for potatoes producers is the yield.So, prediction of yield is intended to be useful for farmers, governments, and agribusiness industries (Taki and Haddad, 2012).Moreover, the prediction of product yield in every region is important in order to planning and policy making future for food providing distribution, pricing and also its import and export is so important since product yield is as a result of different processes interaction in plant, and these processes are influenced by weather factors, and studying their relationship and product yield are necessary to product-climate models extraction (Lamba and Dhaka, 2014).The interaction of such factors can affect on potato yield, so if it is able to convert all potatoes production inputs to energy consumption pattern, this can eliminate the variations in the affecting factors and this can assist the potato producers to use the best energy pattern to maximize yield.However, energy plays important role due to that crop production process uses large quantities of non-commercial energy as well as commercial energies.The non-commercial energy includes seed, manure and animate energy, and the commercial energies consumed directly and indirectly in the form of diesel, electricity, fertilizer, plant protection chemical, irrigation water, machinery, etc (Soheili-Fard and Salvatian, 2015).Efficient use of these energies helps to achieve increased crop production and productivity.For potato production, the optimum energy requirement was found to be 89786.21MJ/ha (Ebrahimi et al., 2014).Moreover, farming systems of potato has significant effect on the energy ratio and the highest energy consumption in potato production was related to the chemical energy with an average of 51% as reported in Ghahderijani et al. (2013).Pannu et al. (1992) conducted farmer's survey and field experiments to assess the energy requirements of potato.They found that potato crop required 38269 to 45568 MJ/ha of total input energy.Singh et al. (1988) found that potato cultivation required 26706, 28590 and 29270 MJ/ha energy input, respectively for bullock drawn disc harrow, tractor drawn disc harrow and tractor drawn rotavator.Gulati and Singh (2011) reported that the energy analysis of potato production revealed that among the various operations, irrigation consumed the maximum amount of energy, i.e. 6622.12MJ/ha (44.4%) followed by seedbed preparation 3192.84MJ/ha (21.4%).Total operation wise energy consumption for potato production was found to be 14902.77MJ/ha.Amongst the indirect energy sources, the energy input derived through the seed material was maximum, i.e. 16320 MJ/ha (36.05%).Fertilizer contributed the next major share of energy input, i.e. 10870 MJ/ha (24.01%).The total energy requirement for potato production under mechanized system from all the sources including the direct and indirect sources was 45262.98MJ/ha.Average output energy from potato was 62983.6MJ/ha.The output to input energy ratio and average specific energy requirement for the crop was observed to be 1.4 and 2.6 MJ/kg, respectively.
In recent years, there is an increasing tendency toward the use and development of artificial neural network (ANN) models in various fields of agriculture (Khoshnevisan et al., 2013) where they are data-driven self-adaptive methods.Additionally, ANN learns from examples and capture subtle functional relationships among the data even if the underlying relationships are unknown or hard to describe (Zhange et al., 1998).ANN can also identify and learn correlated patterns between input data sets and corresponding target values through training.However, after training, ANN can be used to predict the outcome of new independent input data (Jabjone and Jiamrum, 2013).Moreover, ANN is able to deal with nonlinear problems (Taki and Haddad, 2012) and has the advantage over traditional linear regression as traditional linear regression models are only limited to the modeling of linear relationship among data (Obe and Shangodoyin, 2010).
In recent years, several studies have been carried out by application of an ANN model in the field of crop yield prediction. Taki and Haddad (2012) conducted a study to examine energy use pattern and predict the output yield for greenhouse tomato production.The data used in the study were collected from growers by using a face to face survey.They used ANN model to predict greenhouse tomato production.The model predicted output yield based on human power, machinery, diesel fuel, and chemical fertilizer, water for irrigation, seed and chemical poisons.The results of ANN model analyze showed that the (7 10 10 1) was the best suited model estimating the greenhouse tomato production.Farjam et al. (2013) examined seed and grain corn yield by ANN.The developed ANN was a multilayer perceptron with six neurons in the input layer (human labor, machinery, diesel fuel, chemical fertilizer and seed).The ANN approach appeared to be a suitable method for modeling yield.Mobarake et al. (2014) conducted a study to estimate the wheat yield using ANN.Data were collected by using face to face questionnaire method.Information collected from each field includes climate, soil texture, EC of soil, soil structure, crop rotation, crop residues management method, tillage method, depth of tillage, the amount of (nitrogen, phosphorus and potash) fertilizers consumed, method and efficiency of the amount of water used.These variables were acted as input variables of the ANN model and biomass yield (total seed yield and straw) was acted as the output variable.The results showed that the proposed ANN model can predict the biomass yield with coefficient of determination of 90%.Khoshnevisan  Energy inputs patterns for different crops have been studied by different researchers as they are good parameters for crop yield prediction as reported in many research papers.Regarding to potato importance in Saudi Arabia, the goal of this study was to demonstrate the potential of an ANN model to predict potato yield on the basis of input energies.Additionally, the extracted weights from the developed ANN model were formulated using C-sharp language to develop interactive application for friendly and easy use for prediction potato yield and energy indices.

Data collection
The energy use pattern was determined by collecting data from two sources, the first source was actual field experiments in three sites belong to Riyadh region, Saudi Arabia.The second source was from growers by using a face to face questionnaire method.The experiments were performed in private farms at Al-Kharj Governorate and Sajer city, Saudi Arabia.No crop residues were found in the experimental fields.Average soil moisture content (MC), soil bulk density (BD), organic matter (O.M) and CaCo 3 percentage are shown in Table (1) for the soil in the experiment sites.Meanwhile, chemical elements, pH, electric conductivity (EC) and sodium adsorption ratio (SAR) of the soil in the experiment sites are shown in Table (2).Table (3) illustrates water characteristics in the experimental sites and total dissolved solids (TDS).However, treatments comprised of three different types, plowing using a disc harrow, one pass, plowing using chisel plow, one pass and plowing using moldboard plow, one pass.
Potato was planted in autumn cycle.Spunta variety, Growers No.12640 and date of closing: 3/12/2014, country of origin Netherland was utilized, the seeds size in mm: 35/55 treated with IMAZALIL.
The planter (Type TEKYATAGANLI, Turkey) was used.Potato rows building machine was also used to raise potato rows after planting.Center pivot is the main source to supply irrigation water in the experiment site.The center pivot was operated at 50% speed rate to apply a reasonable average depth of water.Urua, DAB, dissolved fertilizer, potassium and pesticide were added.Potato digger was used in harvesting process.The machine was CARTTO with two rows.To determine potato yield, 5 plants in each plot were harvested by hand and weighed.Then tubers were separated from the plants, weighed and tuber yield was recorded in terms of tones/ha.
The second source of the required data is from growers by using a face to face survey.The survey was made in 2015 by interviewing several growers that produced potato in Sajer city.Inquiries were conducted in a face to face interviewing.The necessary data through questioner include the hour of machinery usage and labors, diesel fuel, seeds, fertilizers and chemicals consumption per hectare and the yield of potato.

Energy inputs
The amount of energy inputs used in agricultural production practices (human labor energy, machinery energy, diesel fuel energy, chemical fertilizers energy, water irrigation energy, seeds energy) and output (potato yield) were calculated per hectare and then, these data were converted to forms of energy to evaluate the output-input analysis.In order to estimate output and input energy, the input data and amount of output yield were multiplied by the coefficient of energy equivalent.Energy equivalents of inputs and output were converted into energy on area unit.Human labor, machinery, diesel fuel, irrigation, seed, fertilizer and pesticide have been included to estimate the inputs energy for potato production and each item has energy equivalent as shown in Table (4).
Energy efficiency, energy productivity and specific energy are calculated based on the energy equivalents of the inputs and output as follows (Mohammadi et

Artificial neural networks approach for potato yield prediction
The artificial neural network is typically composed of several layers of many computing elements called nodes.However, node or neuron is the smallest data processing unit.Each node receives an input signal from other nodes or external inputs and then after processing the signals locally through a transfer function, it outputs a transformed signal to other nodes or final result (Zhang et al., 1999).Output of neuron is obtained from this formula: A= f (Wp+b) Where f is activation function; W and b are respectively weight and neuron bias.W and b parameters are adjustable and the f is selected by the designer.The artificial neural network is characterized by the network architecture, that is, the number of layers, the number of nodes in each layer and how the nodes are connected.In a popular form of artificial neural network called the multi-layer perceptron, all nodes and layers are arranged in a feed forward manner.The first or the lowest layer is called the input layer where external information is received.The last or the highest layer is called the output layer where the network produces the model solution.In between, there are one or more hidden layers which are critical for artificial neural network to identify the complex patterns in the data (Zhang et al., 1999).
Commercially available QNET 2000 was employed in this study (Vesta Services, 2000).This software is a Windows-based package, which supports standard back-propagation algorithm for training purposes.QNET 2000 operates via a graphical user interface that enables the user to load the data of training and testing sets or select testing data as random, design the network architecture and feed values for the training parameters.The artificial neural network type used in this study was the standard back-propagation neural network.The software was ordered to select 5 data from the whole data set for testing the developed ANN model.
It must be noted that because the variables (input or output) presented were of different orders of magnitude, all of the original inputs or output variables were normalized between 0.15 and 0.85 before entering into the network structure using the following equation: Where t is the original values of input and output parameters, T is the normalized value; t max and t min are the maximum and minimum values of the input and the output parameters in the training data set, respectively.Table (5) shows maximum and minimum values of the input and the output parameters used in the study.In this study, trial and error approach was used to determine the optimum neurons in the hidden layers of the network.Transfer function was also varied; however, they were sigmoid and hyperbolic tangent (tanh) in the hidden layers.The whole data set was consisted of 24 patterns.The inputs were energy equivalent of human labor, machinery, diesel fuel, chemical fertilizers (nitrogen, phosphorus and potassium), pesticides, seeds and irrigation.The output variable in this study was potato yield.
Preliminary trials indicated that two hidden layers performed better results to predict potato yield.To determine the optimal number of neurons in the hidden layers, training was used for 6-n1-n2-1 architectures.The number of neurons in the hidden layer (n1) was studied from 1 -20.The number of neurons in the hidden layer (n2) was studied from 2 -30.Results show that among the various structures, the best training performance to predict potato yield was belong to the 6-15-22-1 structure.However, the best ANN model was elected based on the highest correlation coefficient and the lowest training error.Figure (1) illustrates the best ANN structure in the study.Meanwhile, final training error after 50000 iterations was 0.009556 as shown in Figure (2) and the details of network definitions to predict potato yield is depicted in Figure (3).Additionally, Table (6) illustrates network statistics for training phase and testing phase.

Evaluation of ANN model predictability
The ANN output error between the actual and the predicted should be evaluated.A popular error performance measure such as the mean absolute error (MAE) and mean relative error (MRE) were used and they are calculated as follows: Where iobs v Y and ipre v Y are calculated and predicted potato yield, N is number of observations.The coefficient of determination (R 2 (was selected to be a criterion for measuring the linear correlation between the calculated and the predicted values.However, R 2 reflects the degree of fit for the mathematical model.The closer the R 2 value is to 1, the better the model fits to the actual data.

C-Sharp application
C-Sharp (C#) programming language is available under.NET programming environment.It used for developing an interactive application to predict potato yield under Saudi Arabia conditions.This application has been developed keeping in view of its user friendliness and easily operable.Moreover, C# was chosen because it can run on other operating systems and it is a clean, welldesigned and implemented object-oriented language (Post, 2007).The required equations in current C# application were formulated by the help of the weights obtained after the final training of the developed ANN model.After the application development was completed, it was converted to a free-standing executable version in order to run the application directly on the Windows desktop, without starting up the C-Sharp environment.The developed C# application was validated with experimental data to ascertain its suitability for potato yield predictions.

Energy inputs Al-Kharj-1 (Site1)
The average yield of potato in the site was 34156 kg//ha.Energy inputs at different stages of potato production are presented in Table (7) for potato production in the three sites when soil was prepared by three different tillage implements (system I was disk harrow, system II was chisel plow and system III was moldboard plow).Total energy inputs in different patterns under this study was in range from 54974.74 to 60260.77MJ/ha in Al-Kharj-1 site.In general, chemical fertilizer accounted for a major share of energy input was in the range of 32.02-35.10%;however, Islam et al. (2001) reported that the fertilizer contributed the largest energy input (47 % -50 %) in different cropping systems.The diesel fuel used share of energy input was in the range of 27.21-32.53% in potato production in this study.
It is clear that system III had the highest energy input and this is due to moldboard plow.However, Askari et al. (2014) reported that energy consumption in agriculture sector depends on mechanization level and they showed that the moldboard plow had the highest share of energy consumption and 48% of the energy consumption share was related to fuel energy.In the present study, the total input energy for system I, system II and system III were 56098.89,54974.74 and 60260.77MJ/ha as illustrated in Table (7), respectively as shown in Table (7).The output energy for system I, system II and system III were 116388, 118620 and 133884 MJ/ha, respectively as shown in Table (8).Energy efficiency was calculated as 2.07, 2.16 and 2.22, respectively for system I, system II and system III as shown in Table (8).It is concluded that the energy ratio can be increased by raising the crop yield and/or by decreasing energy input consumption.A similar result such as 1.25 for potato was seen in Mohammadi et al. (2008).The energy productivity of potato produced in Al-Kharj-1 site under three tillage system were 0.58, 0.60 and 0.62 kg/MJ, respectively for system I, system II and system III.This means that 0.58 units output was obtained per unit energy as shown in Table (8).The specific energy of potato produced in Al-Kharj-1 site under the three tillage systems were1.74,1.67 and 1.62 MJ/kg respectively for system I, system II and system III as shown in Table (8).

Al-Kharj-2 (Site2)
The average yield of potato in the site was 36230 kg/ha.Total energy inputs were in the In this study, trial and error approach was used to determine the optimum neurons in the hidden range from 55760.66 to 62920.62 MJ/ha as shown in Table (7).In general, chemical fertilizer accounted for a major share of energy input (28.62-32.30%).
The diesel fuel used share of energy input (27.60-35.13%) in potato production.The total input energy for system I, system II and system III were 55760.66,56199.00 and 62920.62MJ/ha,respectively as shown in Table (7).Meanwhile, the output energy for system I, system II and system III were 123444, 127152 and 140688 MJ/ha, respectively as shown in Table (8).Energy efficiency was calculated as 2.21, 2.26 and 2.24, respectively for system I, system II and system III as shown in Table (8).The average energy productivity of potato produced in Al-Kharj-2 site under three tillage system were 0.61 , 0.63 and 0.62 kg/MJ, respectively for system I, system II and system III as shown in Table (8).The specific energy of potato produced in Al-Kharj-2 site under three tillage systems were 1.63, 1.59 and 1.61 MJ/kg, respectively for system I, system II and system III as shown in Table (8).

Sajer (Site3)
The average yield of potato in the site was 37800 kg/ha.Total energy inputs in different patterns were in the range from 55590.13 to 60836.31MJ/ha as shown in Table (7).In general, chemical fertilizer accounted for a major share of energy input (31.72-34.71%).The diesel fuel used share of energy input (26.33-31.604%) in potato production as shown in Table (7).It is clear that system III had the highest energy input and this due to moldboard plow.The total input energy for system I, system II and system III were 55961.33,55590.13 and 60835.31MJ/ha, respectively as shown in Table (7).Meanwhile, the output energy for system I, system II and system III were 134208, 133560 and 140472 MJ/ha, respectively as shown in Table (8).Energy efficiency was calculated as 2.40, 2.40 and 2.31, respectively for system I, system II and system III as shown in Table (8) ; showing the efficiency use of energy in the potato production.The energy productivity of potato produced in Sajer site under three tillage systems were 0.67, 0.67 and 0.64 kg/MJ, respectively for system I, system II and system III as shown in Table (8).The specific energy of potato produced in Sajer site under three tillage systems were 1.50, 1.50 and 1.56 MJ/kg, respectively for system I, system II and system III as shown in Table (8).

Comparing energy indices for potato production
In this study, comparing of average total  4).Also, average total energy output of potato production in the three sites is illustrated in Figure (5).Meanwhile Figure (6) depicts average energy efficiency for potato production in the three sites.Moreover, averages of energy productivity and specific energy for potato production in the three sites are illustrated in Figure (7) and Figure (8), respectively.It is clear that average total energy input for potato production was higher in Al-Kharj-2 site compared to the other sites with average value of 58293 MJ/ ha as shown in Figure (4).Average total energy output was higher in Sajer site compared to other the sites with value of 136080 MJ/ha as shown in Figure (5).Average energy efficiency was higher in Sajer site compared to the other sites with value of 2.37 MJ/ha as shown in Figure (6).Average energy productivity was higher in Sajer site compared to the other sites with average value of 0.66 kg/MJ as shown in Figure (7).Average specific energy was higher in Al-Kharj-1 site compared to the other sites with average value of 1.67 MJ/kg as shown in Figure (8).
Comparing energy efficiency, specific energy and energy production for potato production in the three sites in the present study with different sources are listed in Table (9).By inspection of the data in Table (9), it is clear that the obtained results for energy efficiency, specific energy and energy productivity for potato production in this study are within the range compared to other studies around the world.

Evaluation of the ANN potato yield prediction model
The ANN model achieved the best results after 5000 iteration.The best ANN model for predicting potato yield was a network with two hidden layers (6-15-22-1) and trained with standard   2014) who reported that the best ANN model for predicting seed corn yield based on energy inputs was network with two hidden layers.Additionally, in Khoshnevisan et al. (2014), the best ANN model for predating potato yield based on energy inputs had an 11-30-2-1 structure, i.e., it consisted of an input layer with eleven input variables, two hidden layers with 30 and 2 neurons respectively, and potato yield as output.Also, during forecasting of tea yield based on energy inputs, the ANN model with 7-13-13-1 architecture had the best condition for predict of tea yield (Soheili-Fard and Salvatian, 2015).In another study, Pahlavan et al. (2012) predicted basil production using an ANN model including an input layer (with seven neurons), two hidden layers (with 20 neurons in each layer) and an output layer (with one neuron).
The error estimation indices of the represented ANN model during testing stage were calculated according to Equation ( 5) and (6).Mean absolute error and mean relative error were computed as 2.36 ton/ha and 5.59 %, respectively.The agreement of the results between normalized actual and predicted potato yield is shown in Figure (9) with R 2 for testing data of 0.704 indicating that the ANN predicted potato yield by this model tends to follow the corresponding actual ones quite closely.Therefore, this model was selected as the best solution for estimating potato yield on the basis of input energy.

Contribution analysis
In order to assess the predictive ability and validity of the developed ANN model, a contribution analysis was performed using the best developed model by Qnet2000.However, contribution analysis as shown in Figure (10) provides insight into the usefulness of individual variables.With this kind of analysis it is possible to judge what parameters are the most and the least significant during generation of the satisfactory ANN model.It is evident that water irrigation energy had the highest contribution on output (24.75%), followed by chemical energy (20.55%) and followed by machinery energy (20.48%).Furthermore, the contribution of diesel fuel energy, labor energy and seed energy was 11.55%, 12.24% and 10.43%, respectively.

C-Sharp application
The extracted weights from the developed ANN model were formulated using C-sharp language to develop interactive application for friendly and easy use. Figure (11) depicts the screenshot of the inputs and Figure (12) shows screenshot of the output.Furthermore, Figure (13) depicts screenshot of output screen for energy indices.The application is able to study the effect of each input variable on the output with respect to other input variables at average value by generating five values of each input variable and draw the relationship.Moreover, the application is able to calculate energy indices (energy efficiency, specific energy and energy productivity).The Csharp interactive application was tested and it can estimate potato production and compare yield on farms.Soil and agronomy researchers, framers and agricultural engineers can use the C-sharp interactive model to explore the factors that have more potential to increase potato production on a farm.Additionally, decision makers and scientists can estimate yield in different regions in Saudi Arabia and they can evaluate the effects of different factors on potato production.

CONCLUSION
In this study, the amount of energy consumption for potato production under Saudi Arabia conditions was determined and also the study aimed to develop feed forward neural network model for predicting potato yield.The optimal artificial neural network topology for this study was 6-15-22-1 and standard backpropagating training algorithm.The error estimation indices of the ANN model during testing stage were 2.36 ton/ha and 5.59% of mean absolute error and mean relative error, respectively.The results disclosed the water irrigation energy had the highest contribution (24.75%) to potato yield among all inputs (machinery energy, diesel fuel energy, labor energy, chemicals energy and seeds energy).The extracted weights from the developed ANN model were formulated using C-sharp language to develop interactive application for friendly and easy use.

Fig. 9 .
Fig. 9. Agreement of the results between normalized actual and predicted potato yield

Table 1 .
Soil characteristics in the experimental sites

Table 3 .
pH, EC, SAR, chloride and nitrate values in the soil in the experimental sites

Table 4 .
Energy equivalent of inputs in potato production

Table 5 .
Maximum and minimum values of the input and the output parameters used in the study

Table 6 .
Statistics criteria of the best ANN models from Qnet software after training and testing stages to predict potato yield

Table 7 .
Total energy inputs (MJ/ha) in different patterns for potato production in the three sites

Table 8 .
Total energy outputs (MJ/ha) in different patterns for potato production in the three sites

Table 9 .
Comparing energy efficiency, specific energy and energy productivity for potato production from different sources