Artificial Neural Network to Estimate the Paddy Yield Prediction Using Climatic Data

Paddy harvest is extremely vulnerable to climate change and climate variations. It is a well-known fact that climate change has been accelerated over the past decades due to various human induced activities. In addition, demand for the food is increasing day-by-day due to the rapid growth of population. *erefore, understanding the relationships between climatic factors and paddy production has become crucial for the sustainability of the agriculture sector. However, these relationships are usually complex nonlinear relationships. Artificial Neural Networks (ANNs) are extensively used in obtaining these complex, nonlinear relationships. However, these relationships are not yet obtained in the context of Sri Lanka; a country where its staple food is rice. *erefore, this research presents an attempt in obtaining the relationships between the paddy yield and climatic parameters for several paddy grown areas (Ampara, Batticaloa, Badulla, Bandarawela, Hambantota, Trincomalee, Kurunegala, and Puttalam) with available data. *ree training algorithms (Levenberg–Marquardt (LM), Bayesian Regularization (BR), and Scaled Conjugated Gradient (SCG)) are used to train the developed neural network model, and they are compared against each other to find the better training algorithm. Correlation coefficient (R) and Mean Squared Error (MSE) were used as the performance indicators to evaluate the performance of the developed ANNmodels. *e results obtained from this study reveal that LM training algorithm has outperformed the other two algorithms in determining the relationships between climatic factors and paddy yield with less computational time. In addition, in the absence of seasonal climate data, annual prediction process is understood as an efficient prediction process. However, the results reveal that there is an error threshold in the prediction. Nevertheless, the obtained results are stable and acceptable under the highly unpredicted climate scenarios. *e ANN relationships developed can be used to predict the future paddy yields in corresponding areas with the future climate data from various climate models.


Introduction
Rice is the staple food of almost all Sri Lankans. erefore, it is estimated that 2.7 million metric tons of rough rice (paddy) is produced annually to satisfy the demand (around 95%) of the country [1]. More than 1.8 million farmers and farming families involve in this production. erefore, it is important none other than any other agricultural products in Sri Lanka. However, paddy, as a crop, is one of the most affected cultivations in many countries due to the on-going climate variability [2,3]. is is mainly because of the water requirement for the paddy cultivation.
With increasing global temperatures, resulting deviations in rainfall patterns cause immense impact on the crop growth.
us, the water availability for crops essentially depends upon rainfall distribution. Moreover, intense and excess rainfall can produce adverse effects, along with major flooding devastating vegetation, while crop yield also reduces due to water shortage in drought climates. Nevertheless, rice cultivation is considered a semiaquatic plant grown at a controlled supply of water. e source of water supply and degree of flooding are treated to be some environmental factors which determine the paddy harvest.
Paddy cultivation in Sri Lanka takes place under different geographical and hydrological conditions with different soils and elevations. Cascade-type (Helmalu method in local language) cultivation can be seen in the central hill areas, whereas plain cultivation type can be seen in other areas. However, paddy is not the best for higher elevations such as 1500 m MSL in Sri Lanka [4]. Nevertheless, extreme weather events not only in Sri Lanka [5] but also in many other countries have increased over the last decade and have created uncertainty in rice production [6][7][8].
erefore, many researchers investigated the relationships between the various climatic factors to not only paddy but also to various other crops [9][10][11][12][13]. erefore, crop models and decision tools have become a crucial element of precision agriculture in the world as a result of rapid development of advanced technologies [14]. Linear regression techniques, nonlinear simulations, expert systems, Adaptive Neurofuzzy Interference System (ANFIS), Support Vector Machines (SVM), Data Mining (DM), Genetic Programming (GP), and Artificial Neural Network (ANN) are some of the prediction methods which are used in harvest predictions under the climate change [6,[15][16][17][18]. Among these methods, ANN is treated to be a good solution for most of the complex problems. ey resolve complex relations between crop production and interrelated parameters which cannot be solved using linear systems. ANNs are computer programs which mimic the process of human brains [15].
ese programs learn to perform by analyzing own examples for a specific problem. erefore, training a neural network to a particular problem is highly important. However, when it is correctly trained, neural networks can be easily used to predict the relationships even at higher number of variables.
Weather and climatic factors, such as rainfall, temperature, humidity, and sunshine hours, and soil factors, such as pH, texture, and organic matter content of soil are few of the many factors affecting the crop production [14]. erefore, the literature shows many studies which use ANN in determining the relationship between climatic factors and paddy harvest all around the world [19][20][21][22]. ANN was used not only to understand the climatic factors but also to classify the rice grains [23]. However, not many studies, based on ANN, were found in Sri Lanka in the context of paddy harvest. Napagoda and Tilakaratne [24] have carried out an ANN approach to determine the soil temperature, which is useful for the agriculture in Bathalagoda area in Sri Lanka.
However, according to the authors' knowledge, no research has been carried out in determining the paddy harvest (yield) with respect to the various climatic factors in the context of Sri Lanka. erefore, the objective of this paper is to understand the relationships among climatic factors and rice production in Sri Lanka. ree algorithms were used and compared in the development of the training process of ANN which predicts the paddy yield with respect to the various climatic factors. e authors of this paper believe that this would be the first study in the context of Sri Lanka to incorporate the ANN to paddy yield.

Various Algorithms in the Literature
As it was stated earlier, usage of ANN was frequent in many nonlinear real-world problems. ANN required three layers in minimum for its development; input layer, hidden layer, and output layer (refer Figure 1). e knowledge is acquired by detecting relationships in data through neural network. e first layer receives the raw data, which is processed and transferred to the hidden layer. en, the information is passed from the hidden layer to the last layer where the output is produced [15]. e literature shows many algorithms are used in ANN to optimize the training process. Among them, Levenberg-Marquardt (LM), Bayesian Regularization (BR), and Scaled Conjugated Gradient (SCG) are three frequently used algorithms in ANN [25][26][27][28].
2.1. Levenberg-Marquardt (LM) Algorithm. Gradient descent method and Gauss-Newton method are combined in this algorithm. When the Gauss-Newton method is used to express the backpropagation of neural network, the algorithm has a higher probability to reach an optimal solution [29]. In addition, the LM algorithm has faster convergence in backpropagation and therefore, widely used [30]. e Hessian calculation approximation (H) and gradient calculation (g) in LM algorithm are shown in equations (1) and (2), respectively: where J and e are Jacobian matrix and the vector of network error, respectively. In addition, the LM algorithm behaves as Newton's method and is expressed as Where x k+1 , x k , μ , and I are new weight calculated as gradient function, the current weight using Newton algorithm, and constant and identity matrix, respectively. More information of LM algorithm can be found in Ramadasan et al. [31].

Bayesian Regularization Algorithm (BR)
. Similar to LM algorithm, Bayesian Regularization (BR) algorithm updates the learning algorithm's weights and bias values and minimizes the linear combination of squared errors and weights. In addition, BR algorithm modifies the linear combination, and as a result, the network has good generalization qualities by the end of the training. LM and BR algorithms are considered to have the ability to obtain lower mean squared errors compared to other algorithms for functioning approximation problems [30]. More information on the BR algorithm can be found in Bueden and Winkler (2008).

Scaled Conjugated Gradient Algorithm (SCG). Scaled
Conjugate Gradient (SCG) is considered the most popular iteration algorithm used in solving problems of large systems of linear equations [29]. e equation of the conjugate gradient is as follows: where k is the iteration index, α k is the step length at kth iterations, and d k is the search direction. SCG is a second derivative of Conjugate Gradient Algorithm, which has the ability to minimize the purpose function on several variables, and it uses step-size scaling techniques to avoid time consumed for learning iteration [29]. More information on SCG algorithm can be found in [32].

Methodology
MATLAB numerical computing environment (version 8.5.0.197613-R2015a) was used to develop the ANN architectures to predict the paddy yield. One hidden layer was included in the ANN architecture with the dependent variable of the paddy yield. e climatic parameters were included as the input parameters of the ANN model.
Time series data for each input and output parameter were divided into three clusters: for training (70%), for validation (15%), and for testing (15%) of all data. e training step was started with selection of the training algorithms.
e above stated three training algorithms, namely; Levenberg-Marquardt, Bayesian Regularization, and Scaled Conjugate Gradient were used. e performance of each training algorithm was evaluated based on the value of mean squared error (MSE and coefficient of correlation (R). Lowering the MSE values and bringing near the R values to 1 give better predictions compared to the observed parameters [33]. Mathematical expressions for R and MSE are given in equations (5) and (6): where x, y, and N are the observed value, the predicted value, and the number of observations, respectively. Coefficient of correlation and MSE values were found for all cases in ANN under the three algorithms in developing the relationship between paddy yield and climatic factors. Equation (7) presents the mathematical expression for the nonlinear relationship which was modelled herein: where ϕ is the nonlinear function in between the paddy yield and climatic parameters. Depending on the data availability, the above relationship can be formulated in regional basis for harvesting seasons.

Case Study
Sri Lanka is located in the Indian Ocean and lies between the latitudes of 5°55 N and 9°51 N and the longitudes of 79°41 E and 81°53 E. It covers a land area of 65,610 km 2 . Sri Lanka is divided into nine provinces and twenty-five districts for administrative purposes. Eight districts were chosen for this analysis based on the data availability. More importantly, these eight districts are the major paddy grown districts in Sri Lanka. ese districts are, namely, Ampara, Batticaloa, Badulla, Hambantota, Kurunegala, Puttalam, Trincomalee, and Vavuniya (refer Figure 2). Sri Lanka has tropical climate conditions. e average annual temperature varies from 28°C to 30°C and annual average diurnal temperature variability ranges from 4°C to 7°C. Sri Lanka is under two major monsoon winds, and they bring significant amount of rainfall to the whole country. e two major monsoons are southwest monsoon (May to September) and northeast monsoon (December to February). In addition to these, there are two intermonsoons; 1st intermonsoon (March and April) and 2nd intermonsoon (October and November). erefore, the country is rich in its receiving rainfall. However, not only the temporal variations but also the spatial variations affect the receiving Input layer Hidden layer Output layer rainfall. erefore, the annual rainfall ranges from 600 mm in the arid areas to 6,000 mm in the very wet areas [4]. ese rainfall patterns were used in developing two agricultural seasons in the country: Maha season and Yala season. e major agricultural season is the Maha season, and it spans from the September to March of the following year, whereas the Yala season spans from May to August.
e Maha season dominates with rain-fed agriculture; however, irrigated water from tanks dominates in the Yala season for the water requirement of the paddy fields.
Rainfall (mm), morning and evening relative humidity (%), minimum and maximum temperature (°C), wind speed (km/hr), evaporation (mm), and sunshine hours (hr) are used as the climatic factors to predict the paddy yield.
However, several climatic combinations for different time spans were used for each district.
is is because of the nonavailability of some of the data. Table 1 summarizes the used climatic data for different districts. e monthly climatic data were obtained from the Department of Meteorology and Department of Census and Statistics, Sri Lanka. e corresponding paddy yield data for two seasons (Yala and Maha) from rain-fed agriculture were obtained from the Department of Census and Statistics, Sri Lanka.
Depending on the data availability, neural networks were run to various climate combinations to obtain the relationships given in equation (7). In the absence of data for most of the years, combination of Maha and Yala seasons' yield to the climate relationships were obtained. Equations (8) and (9) present these modified relationships between paddy yield and the climatic parameters: Equation (8) was used to model the paddy yield in the Ampara, Batticaloa, Hambantota, Trincomalee, Badulla, and Vavuniya districts while equation (9) was used in the Puttalam and Kurunegala districts. As it was stated above, the neural network analysis were run under the three (LM, BR, and SCG) training algorithms. In addition, computational efficiency in the process is shown in Figure 3 . erefore, it can be clearly seen herein that LM training algorithm outperforms the BR and SCG algorithms. is is well observed in many other related studies in comparing LM algorithm to other training algorithms [34][35][36][37][38]. Figure 4 presents the correlation coefficients for the seasonal yield in Badulla and Kurunegala districts under the LM training algorithm. It can be clearly seen that the coefficient of correlation reaches almost to 1 in the absence of data. Figures 4(b) and 4(d) clearly showcased this finding.

Results and Discussion
e R values in these two cases are 1, not because it is 100% match; however, the lines have only two data points where a straight line is directly predicted as the trend line which goes through the data points. erefore, the ANN model is not functioned well under data scarcity. is clearly justifies the analysis in the annual resolution combining both seasons as two datasets.
It would be interesting to investigate the results from the relationship given in equation (9). As it was stated earlier, the analysis was carried out to two districts in Sri Lanka.

Figures 4(e)-4(h) show the coefficients of correlation for the Maha season under the LM algorithm for Kurunegala district. Similar observations discussed under the relationships given in equation (8) (please refer Figures 4(a)-4(d))
can be observed in here. Results show that the LM algorithm outperforms the other two training algorithms. In the absence of many data, Figure 4 overall suggests researchers to use combination of Maha and Yala seasonal yield as a common dataset. is is acceptable since the yield used here is only based on the rain-fed agriculture in Maha and Yala seasons. e yield due to the irrigated agriculture was not considered for this analysis. Table 2 summaries the correlation coefficients depicting the performance of the ANN trained to determine the relationships between climatic factors and rice production (refer equations (8) and (9)) using three different training algorithms (LM, BR, and SCG). ese results are given for the combined Maha and Yala seasons in the absence of important climatic data. In terms of correlation coefficients, LM training algorithm has performed better compared to other two training algorithms. However, other algorithms also performed fairly well with acceptable R values in determining the relationship between climatic factors and rice production. In addition, the tabulated R values show that the results are improved at an increased number of data points. Table 3 showcases the validation performances of the three training algorithms used for determination of relationship between climatic factors and rice production. All three training algorithms have performed well in terms of validation performance with lower mean square error (MSE) values. However, with reference to the number of epochs and computational time, LM and SCG have performed well with less epoch numbers and computational time. It can be observed from Table 3 that BR training   Mathematical Problems in Engineering algorithm has larger number of epochs. erefore, it can be concluded that LM training algorithm has performed well in determining the relationship between climatic factors and rice production with MSE closer to "0" in less number of epochs and good correlation coefficients.
e results clearly show that paddy production has a strong correlation with climatic factors. However, in the absence of some of the climatic data, the combination of two cultivation seasons has produced improved results. erefore, these results are stable.
As it was stated in Section 1, artificial neural networks were extensively used by many researchers to predict the paddy harvest/yield; however, it was not implemented to the Sri Lanka. Ji et al. [39] have carried out prediction models using neural network to predict the paddy harvest in Fujian province in China. e analysis was important as the province is often prone for natural disasters based on the climate. eir prediction models were within an acceptable range (R 2 ∼0.5 to 0.6). Hossain et al. [40] presented an artificial neural network-based prediction model to analyze the paddy harvest in Bangladesh.
ey have highlighted the necessity of such study to Bangladesh with on-going climate    [41]. ey have considered many variables including maximum and minimum temperature, average rainfall, humidity, climate, weather, types of land, types of chemical fertilizer, types of soil, soil structure, soil composition, soil moisture, soil consistency, soil reaction, and soil texture; however, instead of particularly on paddy, they have analyzed total crop yield, but including paddy too. However, Das et al. [42] have used several models, including liner, neural network, and penalized regression models to predict the rice yield in west coast of India. One important common conclusion was found from all above cited references; there is always an error threshold in the prediction as the prediction is based on the climate data. e same finding can be seen in many other related studies [43,44]. In addition to the changing climate, spatial distribution of climatic data and the quality of the climatic data can trigger the error. However, with all the effort, it is still in the acceptable region for the prediction. Farmers would not be interested in predicting their harvest to the best possible; however, they would be happy to accept a reasonable level prediction. Interestingly, the research carried out to some parts of Sri Lanka is the same. e prediction is stable; however, the coefficient of correlation is around 0.6-0.8. erefore, a similar error threshold is there in the prediction. erefore, more research should be carried out for the higher accuracy prediction model, while keeping the developed model as a baseline.

Conclusions
Nonlinear complex relationships among various climatic factors and paddy yield were obtained for several districts in Sri Lanka using artificial neural networks. Comparative analysis using three different training algorithms shows that the LM training algorithm is better than other two BR and SCG algorithms. However, BR and SCG algorithms have also produced acceptable results. erefore, LM algorithm can be used in future predictions at lower computational costs. e correlation coefficients from the tests were not the best for predictions as they are numerically around 0.65-0.8. However, as the literature suggests these correlation coefficients are acceptable in the context of highly varying climate scenarios. erefore, it can be concluded herein that there is an acceptable correlation in between the paddy yield and the climatic factors. us, it can be concluded that the paddy yield is significantly impacted due to on-going climate change.
More importantly, these nonlinear relationships are available with the analysis. erefore, reverse calculations are possible in the presence of future climate data. Various climate models can be used to extract future climate data, and therefore, the ANN models can be rerun to obtain the corresponding paddy yield data. erefore, this prediction would be highly important to the planners and authorities to arrange sustainable cultivation patterns in the future. However, as discussed, the predictions are obtained with an error threshold due to unpredicted climate variables, spatial nonuniformity of climatic data, and the quality of the recorded data. Nevertheless, the planners and farmers are not expecting perfect predictions, but acceptable predictions.
In addition, in extreme climate events, the models can be used to prepare the proper schedules for food sustainability. Nevertheless, the models have to be further improved using more climatic parameters. In addition, it would be interesting to investigate the relationships among other important variables such as technological improvements in agriculture and new crop varieties, which can withstand some climate extremes and various negative impacts from various pests in paddy cultivation.

Data Availability
e data used to support the findings of this study are available from the corresponding author upon request.

Disclosure
e research was carried out in the Sri Lanka Institute of Information Technology and Wayamba University of Sri Lanka environments.

Conflicts of Interest
e authors declare that they have no conflicts of interest.