{'fraction_non_alphanumeric': 0.029316407141878626, 'fraction_numerical': 0.01803735330380383, 'mean_word_length': 4.84, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Reference Evapotranspiration Prediction for Smart Irrigation

: Irrigation is the most critical process for agriculture, but irrigation is the largest consumer of fresh water and causes the loss of large quantities because of the inaccuracy in crop water estimation. Our proposed system aims to improve irrigation management by estimating the amount of water needed by the crop accurately and reduces the number of meteorological parameters needed for such estimation. Detection of the reference crop evapotranspiration (ETo) is the most critical process in crop water estimation, that is considered through our proposed solution by implementing machine learning models using neural networks and linear regression to predict daily ETo using climate data like temperature, humidity, wind speed, and solar radiation. Comparing our system results with FAO-56 Penman-Monteith ET0 and cropwat8.0 software as benchmark, show that our proposed system is better than the linear regression model, in terms of determination coefficient (R^2)=.9677 and root mean square error(RMSE) =.1809, while the multiple linear regression model achieved determination coefficient (R^2)=.68 and root mean square error(RMSE) =3.01. Our system then used the predicted ETo and Crop coefficient (Kc) from FAO, to estimate crop evapotranspiration (ETc) for precision irrigation target.


I. INTRODUCTION
By 2050 the world's population will be 9 billion and demand for food will increase dramatically, Agriculture is the main source of food but consumes more than 70 percent of freshwater around the world. 25 percent from the water that used for irrigation is wasted because weakness in irrigation management. Most farmers irrigate crop without knowing the amount of water that plant needs at any real level of precision and this lead to waste a lot of irrigation water nevertheless the crop productivity is still weak. Thus, it is vital to develop a precision system to optimize irrigation management and predict the amount of water crop needs to decrease water consumption and increase crop productivity.
In Egypt, agriculture is the main component for the economy; it represents more than 14.5 percent of the gross domestic product and 28 percent of entire jobs [7]. Small farms in Egypt dominate in agriculture approach and farmers use traditional practices like using old technology for irrigation so farmer suffers from increasing production cost, decreased soil fertility and insufficient water recourses [4].
Most farmers irrigate crop without knowing the amount of water that plant needs at any real level of precision and this lead to waste a lot of irrigation water and productivity weak So it is important to develop a precision system to optimize irrigation management and predict the amount of water that crop needs to decrease water consumption & increase productivity [8]. Two processes associated with high losses of water; the first process is evaporation; in this process water loss from soil, the second process is transpiration; in this process water loss from small openings on the plant leaf. Combined between these processes lead to know the amount of water that plant lost, and this process is evapotranspiration (ETo), and it is the main process to detect plant water needs. The goal of our study is developing system that can optimize effectively the water consumption by minimize water loss in irrigation. Our proposed system should predict the needed amount of water crop needs; Adjustment of water irrigation with weather parameters, along with continuous monitoring & feedback for farm status [2]. To achieve the goals of this study, our proposed system will use supervised machine learning algorithms like multi linear regression and neural network to predict ETo by weather data using historical data. System will collect data related to weather by using weather sensors and send it to the prediction model to predict ETo. Thus, the proposed system mainly consists of two stages, first stage is monitoring, and second stage is prediction. In monitor stage, the system will monitor the parameters that that have impacts on crop and water needed using weather sensors distributed in the farm like temperature, humidity, wind speed and solar radiation, The second stage which is the prediction stage, the system will use data that collected from first stage to predict the amount of water crop needs based on machine learning algorithms [10].

II. BACKGROUND
The current approaches to set up water requirement prediction model depend only on climate information that coming from meteorological station, but there are some other problems with these approaches, like that all region doesn't have access to the precision weather information and if any sudden changes happen in climate, they cannot respond in real time [1]. Due to these technical limitations of accessible soil sensors, these approaches have not been widely accepted, requiring measurement data to be registered and stored, traditionally using wired, and limiting the flexibility and real-time interaction the sensors that unravel these issues have high cost, require uncommon treatment and require nonstop calibration.
The data gathered about soil status by using soil sensors can be used to build a better prediction model, monitoring all variables like soil moisture, the water quantity in the soil is important to predict water requirements correctly [5]. Combining between soil and climate variables will help in managing irrigation more efficiency from traditional approaches that use climate variables only [4]. The combination between these variables has some challenges like increasing amount data flow, traditional manual systems rely on agronomists expertise to help in irrigation management but it is not accessible to every farm, plenty of data will lead to slow in analysis and will impact in a real time processes. Thus, implementing machine learning models for prediction will help to predict crop water needs with high efficiency to bridge the current gap [9].
The most common methods to estimate evapotranspiration is experimental using lysimeter [11] or evaporation pan, but these systems are not accurate, need a lot of labor, and are very expensive. In the last years, scientists have developed numerous physical equations that used meteorological parameters to know reference crop evapotranspiration (ETo). The Food and Agricultural Organization of United Nations (FAO) has accepted the FAO Penman-Monteith (FAO-56PM) as the standard equation to estimate ETo (Allen et al., 1998). The climatic parameters that that have impacts on crop water needs are sunshine, wind speed, temperature, humidity, dew point, and pressure [6].
There are some other mathematical methods like Penman-Monteith, Makkink, Priestley-Taylor, Turc, Hargreaves-Samani, and Blaney-Criddle to calculate ETo but these models need high accuracy reading, and in many areas, the meteorological data set is not complete [3]. So the machine learning model helps to reduce the parameters that are needed to estimate reference evapotranspiration. Now, machine learning and deep learning are used widely in many fields of engineering and sciences like medicine, agriculture, and biochemistry [18]. These algorithms are used to improve and raise the accuracy of the prediction process depending on data sets come from many experiments in different fields [15]. This inspired and derive the design and implementation for our proposed system that aims to detect the amount of water the crop needs by using neural network based on deep learning from "Keras" library to predict ETo, and uses the crop coefficient "Kc" value come from FAO to predict the amount of water the crop needs [12].

III. PROPOSED SYSTEM ARCHITECTURE
Our system is based on FAO Penman-Monteith (FAO-56PM) equation as a benchmark to assess the accuracy of our proposed model and to compare our prediction results and the result used by FAO from using Penman-Monteith using CROPWAT8.0 program from FAO [20]. System will use then the predicted value of ETo to calculate the amount of water, the crop needs by multiple ETo and Kc. We also used different prediction models to achieve the best results, thus through our study, we compared between linear regression, neural network and FAO cropwat8.0 software to know what is the best model to predict reference evapotranspiration (ETo) and measure this using different metrics like determination coefficient (R^2) and root mean square error(RMSE) [16].
We used Potato as the main crop for our proof of concept and case studies as in Egypt, the potato crop is one of the strategic vegetable crops, where about 200 thousand feddans are grown each year, giving total productivity of about 1 million tons [13]. Potato plant is a cold air plant that needs its first stages of development (during the first two months of its life) to have a fairly warm atmosphere at a temperature of 25-20C [17]. Potato plant can be grown in different types of soil, but it is found in light tilapia and Algerian soil with good drainage and ventilation. It allows the growth of tubers to grow naturally to contain about 50-3 clay and salts, about 2-3% of the sand [14]. To about 0.9% and the proportion of calcium carbonate to about 4% -2 and if it is forced to cultivate in the new clay or heavy sandy land, care and attention should be given to organic and chemical fertilizers to improve their natural and chemical properties [19]. Potato crop of crops sensitive to the lack of soil moisture, especially during periods of critical growth of the plant. The soil moisture level must not be less than 60% of the available water [22]. This causes the shortage of the quantity of the crop and the small size and number of tubers produced. The periods are affected by the lack of soil moisture, which is about 6 -5 weeks from the date of agriculture for the early varieties and 6: 8 weeks for the late varieties. The first irrigation is given after planting for 21-18 days, Soil conditions and plant growth stages [25]. The prevention of irrigation shall be taken before the reduction of about 7-10 days in the summer loaf, 15 -10 days in the Nile and the Nile, in order to facilitate the cutting process and help to harden the crust and the soil is not stuck to tubers [19]. In the new lands, where irrigation system is drip or drip, it is necessary to give light and convergent irrigation (every 2-3 days) according to the prevailing weather conditions in the region and the stages of plant growth, to stop irrigation before the reduction by about 5 days [23]. In general Plant irrigation should be carried out either in the early morning or at sunset. According to FAO, the Kc of potato is 0.5 in initial stage and it be in first 25 days, 1.15 in mid stage and in end stage Kc is 0.75 [21].
The weather data we used to train the neural network model for four years (2014 to 2018) from Cairo airport climate station with latitude 30.13, longitude 31.4, and altitude 64 [28]. The climate in Cairo is semi-arid; the range of minimum and maximum air temperature from 20 to 38 C in summer and from 10 to 23 C, relative humidity is between 35 to 62%, and maximum wind speed is 397 kilometers/day usually in May [30]. The weather data we used is consisting of the average of daily relative humidity; an average of daily air temperature, wind speed, and solar radiation, and these variables is input for neural network model.
The proposed system as explained briefly in the previous sections compose of two main stages the first one for monitoring both the soil and meteorological parameters, and second phase is for predicting the amount of water crop needs for precision irrigation purposes.

Fig. 1 Proposed system block diagram
The block diagram as shown in Fig. 1 shows how these stages control and automate the crop irrigation process based on optimized irrigation schedule. Soil parameters that are measured from different soil sensor like matric potential and volumetric soil water content and the weather information that coming from weather station provide our machine learning model with relevant information for predicting the weekly irrigation schedule. This soil and meteorological data along with the weekly schedule data will be hosted on the cloud for analytics and dash boarding for farm management [29].
The proposed system used both Artificial Neural Network (ANN) and linear regression for building the prediction model. The advantages of the ANN is that it can learn and make complex relationships between nonlinear data [24], it can work in a massive amount of data and can process information rapidly. This study uses a ANN based on "Keras" [26] which is a deep learning library built in "Tensorflow" [27] from Google that it is characterized by fast operation and easy to handle. In our proposed system, the ANN consists of one input layer, two hidden layers, and one output layer. We used a rectified linear units (RELU) [35] as the strongest nonlinear activation function to build regression-based ANN, and because activation function is nonlinear [31], it is easy to backpropagate the errors, it allows to more natural optimization and faster than other activation functions. We also used adaptive moment estimation (ADAM) [33] as the optimization function to minimize the error and to improve the model. Feedforward, and Backpropagation method are used to train the neural network model because it is faster compared with any other optimizer [34].
The weather data consisted of 6 columns divided into five columns as inputs and one column as output, the input columns are maximum air temperature, minimum air temperature, the average relative humidity, wind speed, and solar radiation and the output column represents ETo. As such, to train the neural network model, data splits into two sections, the first section represents 70% from all of the data (875 samples, from 2014 to 2017) and it is used to train the neural network model [32]. The second section represents 30% from the data (375 samples, from 2017 to 2018) and it is used to test the training of neural network model and compare between the predicted value from machine learning and actual value from the weather data set. Our designed ANN is consisting of single input layer of 5 nodes based on the number of inputs variables, two hidden layers with 12 and 8 nodes respectively, and one single output layer with one node to predict the value of daily evapotranspiration. The value of ETo in the weather data of this study was calculated by Penman-Monteith equation [36], which calculates either hourly or daily ETo. The FAO Penman-Monteith method is integration between mass transfer method and energy balance with select reference surface resistance factors [40]. This method is a physical method depend on the equation of Penman-Monteith, and this equation clarifies that the reference surface is green grass hypothetical surface with a uniform height equal 0.12 m, with a surface resistance equal 70 sm-1 and an albedo equal 0.23 with good actively growing and enough watered conditions [37]. (2) Where (ETi predicted) is the predicted value by the neural network model, (ETi calculated) is the value of ETo based on (FAO-56 PM ET), (N) is the number of observations [38]. We used also the multiple linear regression to predict the reference evapotranspiration with meteorological data, this data consists of some variables like the maximum and minimum temperature, humidity, wind speed, and solar radiation. By that the evapotranspiration represents the dependent variable (y), and the independent variables are climate data which are represented by (x1,x2,x3,x4,x5), as expressed by following equation :

Yi=b0+b1x1+b2x2+b3x3+b4x4+b5x5+ei
(3) where yi and xi represent the observations of each of the variables y, x1,...x5 respectively, ei is a random error which is a term representing the remaining effects on [y] from the variables that are not explicitly included in the model, where b0, b1....b5 are fitting constant [41].
Our Hardware part of the proposed system designed based on seven types of sensors to monitor the weather and soil conditions, including soil moisture, soil temperature, humidity, wind speed, temperature, solar radiation and pressure as shown in Fig. 2. All these sensors are connected to the microcontroller, and the microcontroller is connected to NRF24L01 [45]. The NRF24L01 is a half-duplex transceiver in which data is transferred in both directions. The NRF module transfer the collected data to the gateway. The gateway is consisting of raspberry Pi 3, NRF module is connected to the internet through Ethernet cable. The gateway receives the collected data and upload it to the Thingspeak platform every 20 minutes [44].

Fig. 2 Proposed hardware design of sensing and soil node
Our ANN and linear regression models described in previous sections are deployed to the cloud to predict the amount of water. Clloud will save the data, represent it to the farmer through dashboard and run the ANN model to predict the amount of water crop needs as shown in Fig. 1. At pump side the microcontroller receives control action from the model hosted on the cloud through the gateway and nRF module that represents the water amount crop needs and time to start irrigation. To predict weekly irrigation schedule, system need to forecasting weather data for 7 days, so system will use Open weather map API, this API is free and provide weather data about air temperature, humidity, wind speed, and sunrise and sunset time to calculate the solar radiation [43].

IV. IMPLEMENTATION AND TESTING
The historical climate data split into 70% to train multiple linear regression model and 30% to test the model after the training. We used (RMSE), (R^2) and (MSE) metrices to assess the accuracy of the prediction model using test data to detect the best number of layers and nodes to achieve optimal values. The multiple linear regression model achieved (almost R^2=0.68) and (almost RMSE=3.01), that show that this model is weak in estimating reference evapotranspiration. Fig. 3 shows the relationship between the actual value as a blue point and fitted line that represents predicted value with almost 68.9% accuracy [42].

Fig. 3 relation between actual and prediction value using multiple linear regression
To build suitable neural network model , many different neural network models have been trained with the different number of hidden layers and nodes, after that (RMSE), (R^2) and (MSE) are calculated using test data to detect the best number of layers and nodes to achieve optimal case. The first model was trained by one hidden layer with 1 to 20 nodes, the best (R^2) achieved was (almost R^2=0.92) and (almost RMSE=0.3) with 12 nodes and one hidden layer, the second model, trained by 2 hidden layers with 12 nodes for each hidden layer and this model achieve (almost R^2=0.96) and (almost RMSE=0.12), the models that trained with more than 2 hidden layers did not effect on the (R^2) and (RMSE), so the best (RMSE )an (R^2) achieved by 2 hidden layers and 12 nodes in every layer. Fig. 4 shows the value of (R^2) after 600 epoch and represents how it is near to the optimal case that equal one. Fig. 5 shows the value of (RMSE) and how it is near to the optimal value that equal to 0 [49]. The 30% of data used for testing of neural network model (146 samples for daily weather data from 2017 to 2018) also used to compare between the predicted value and actual value from historical data to know the accuracy of the model. Fig. 6 shows the comparison and the difference between predicted value by the neural network model and the actual value by testing data, orange graph represents the predicted value by the model and the blue graph represent actual value from testing data. This graph shows how the neural network mode based on Keras performed with achieved 97.8% accuracy [50].

Fig. 4. Proposed system ANN R^2 results
Thus, the ANN achieved very high accuracy compared with multiple linear regression and the FAO method. Accordingly, ANN model is very good to predict ETo with (R^2) = 0.96 and can be used to make crop irrigation schedule. It also has the advanteges to decrease the number of variables that need to estimate ETo which reduces the complexity of hardware device and computation power needed for such complex calculations [46]. Table 1 shows the results of a simple regression analysis and presents the calculation of errors. The selected ANN model showed excellent performance when compared to ET_PM values. This model with an RMSE of 0.16 mm d-1, an R2 of 0.96 and mean square error (MSE) = 0.0532 and show the results of other models

V. CONCLUSION
This paper focused on developing a SMART model for precision irrigation using both multiple linear regression and Artificial Neural Network (ANN) models based on Keras to predict reference evapotranspiration (ETo). The aim of the proposed model is to optimize the water efficiency and crop productivity. The proposed system used the IoT and ANN technology to predict water needs of any crop and create the weakly irrigation schedule using soil and meteorological measurements on real time from the farm. The testing analysis of the proposed system showed that the designed model achieved high accuracy compared with current model used by FAO or linear regression to predict ETo value with (R^2=0.96) and (RMSE=0.12) [47].

ACKNOWLEDGMENT
This paper and the research behind it would not have been possible without the engagement and support of MSA student Gamal Aldin whom I would like to thank and appreciate all his efforts, insights and expertise that greatly assisted through the course of this research. Finally, it is with true pleasure that I pay my sincere gratitude and acknowledgement for Gamal" contributions to achieve the research objectives as planned.