Machine Learning based Precision Agriculture Model for Farm Irrigation to Optimize Water Usage

The food demand is ever increasing each year and to meet this demand precision agricultural approach using machine learning tools play an important role. Precision irrigation systems integrate cutting-edge technologies, such as sensors, controllers, data analytics and internet, to achieve sustainability in agriculture and maximize water use so as to improve crop production while minimizing water wastage and climate impact. The main purpose of this article is to find out the precise water requirements for a particular area of the land by using soil moisture sensors. These sensors provide real-time data that is transmitted to a central control unit, which utilizes data driven algorithms to analyze moisture levels in the soil and controls the water supply. Furthermore, the model developed offers remote monitoring and control capabilities, enabling farmers to access and manage the system from anywhere using mobile or web application. This feature allows farmers to remotely adjust irrigation schedules, receive real-time alerts and notifications, and track water consumption, promoting convenient and efficient management of water resources. Thus by using effective water management techniques such as precision irrigation, controlling the water quality, will accomplish optimizing water usage and intern optimizes the yield.


Introduction
Smart agriculture techniques include creating recommendation systems and notifications for farmers to increase the production and quality of the crop.One such system is Agricultural Irrigation Recommendation and Alert (AIRA) system which models k-nearest neighbour and neural network machine learning algorithms to classify the irrigation alerts [1].Large land holdings are used by most farmers, making it difficult to reach every corner of land and maintain track of them.Precision agricultural management practices utilizes a range of machine learning techniques which are being used to examine crucial elements like soil and water for their efficient management [2].However, there are a lot of issues that might affect irrigation, including unequal water sprinkles, a lack of rain, poor water quality, and sudden weather changes, to mention a few.Result of this is uneven and bad quality of crop.The IoT based system "AREThOU5A" is a smart irrigation system for precision agriculture, where radiofrequency energy harvesting technique is used [3].Digital technological advancement in the agriculture field using handheld devices and web frameworks is making the life of the farmers easier than before; various machine learning models are used for the management of water schedules to optimize the usage [4].In order to optimize the water resource and internal yield, 2 appropriate water management techniques like drip irrigation and water quality control must be used [5].
Since fresh water is a scarce resource, efficient use of it is essential for cost-effective manufacturing.Intelligent irrigation systems take into account historical data, data from connected IoT devices, and data collected by sensors for real-time prediction and decision-making.Drip irrigation is one of such technique where a low-pressure watering technique is used that boosts the system's energy efficiency [6] [7].An irrigation management decision-support system for citrus farms in southeast Spain was reported by Torres-Sanchez et al. [8].The suggested concept makes use of smart sensors to keep track of meteorological information, water usage from the previous week, and the quality of soil water.Three separate models, SVM, RF, and Linear Regression were then trained on this data in order to construct the decision support system for smart irrigation.The best result is predicted by RF with a substantially reduced prediction error.
The crop chosen for harvest depends on the soil characteristics, which also depend on the climate and geography of the land under use.The "selection of crop, land preparation, choosing the seed, yield of crops, and selection of fertilizers" are all determined by the precise prediction of the soil's attributes.The characteristics of the soil are influenced by the topography and climate of the area.Predicting soil properties mostly entails foreseeing soil nutrients, surface moisture, and weather trends throughout the crop's lifecycle.The amount and type of nutrients in a given soil impact how effectively crops grow.Sensors are typically utilized to track soil characteristics like soil nutrients [9].This nutrients data of soil is the basis for farmers to choose the appropriate crop for the area.Cubist tree model and Partial least squares regression (PLSR) were used to build the prediction models [10].Rain, heat waves, cold waves, and dew points all have an impact on common agricultural practices, these weather events have analyzed by Gaitan [11].
The motivation to create such an application is that the agriculture domain is mostly untapped when it comes to use of IoT and machine learning to enhance conventional farming practices by the small farmers.Small and affordable sensors have been made possible by the decade's rapid advancements in nanotechnology.Because of its autonomous operation, customizable sized hardware platforms, expandable, and inexpensive technologies, the IoT has been made an appropriate instrument for the objective of self-sufficient, intelligent decision-making in the agriculture sector.In this context, a few important applications are precision agriculture, automated irrigation scheduling, plant growth optimization, farm land monitoring, greenhouse monitoring, and agricultural production process management in crops.Despite a few drawbacks like security, interoperability, heterogeneity, and memory-constrained hardware platforms, with the aid of applications like the one suggested in this article, where irrigation schedule is anticipated with machine learning by monitoring the soil moisture and meteorological conditions, machine learning and IoT are paving the way for the future.

Related Work
The system takes into account the agricultural field's humidity, soil and surface temperature, UV light radiation, and soil moisture by using weather forecast data from the Internet and sensor data from sensing nodes as input.To make decisions and information visualization, a web based system receives data wirelessly over the cloud using web services, and it gives real-time information insights based on the analysis of sensor data and weather forecast data [12].
Parameters such as soil moisture difference, relative humidity, air temperature is used to train SVR model by using the real time data collected.The Soil Moisture Differences (SMD) of the upcoming days has been predicted using a trained SVR model.To improve the accuracy of soil moisture difference prediction, the projected value of SMD is used as feed for k-means clustering [12].
A technology for remotely monitoring and controlling irrigation in agricultural fields has been developed to reduce labor and water costs.The coordinator node transmits data that is continuously gathered from sensors and sent from the coordinator node to the web server system, which is connected to it through the RS232 serial data bus.The outputs are produced using the fuzzy rule base 3 system in accordance with the supplied input to the system.Defuzzification process is utilized to produce the output for generating the motor status after fuzzification is complete [13].
AREThOU5A consists of layer model of subsystems; "the measurement subsystem, the routing subsystem, the user-interface subsystem, and the server subsystem".It's important to note that while linear regression can provide useful insights and predictions in smart irrigation systems, other machine learning techniques and algorithms may also be implemented to enhance the models accuracy and effectiveness [3].Ground sensor data and remote sensing data can be combined to monitor the health of sugarcane crop in real time, such as water stress, by assuming uniform holding capacity [14].
Three machine learning techniques were used to create several irrigation recommendation models: one traditional linear regression method and two nonparametric methods, boosted trees classifiers (BTC) and gradient boosted regression trees (GBRT).Compared to linear regression, GBRT and BTC models needed fewer modifications to accommodate for non-linear relationships between variables.The created model can help agronomists plan irrigation much more effectively [15].On this dataset, various regression and classification techniques were used to create models that could forecast the weekly irrigation plan suggested by the agronomist.
The aim of an IOT platform based on arduino "Thingspeak" is to develop application for the farmer to be able to control the irrigation from anywhere and at any time using a computer or smart phone which keeps an eye on the water's properties, and maximize its utilization.In order to monitor the soil condition, the system features a soil moisture sensor that monitors the soil moisture level and transmits data to the "Thingspeak" cloud via the Wi-Fi module ESP8266.If the humidity level is measured at regular intervals, you can determine whether the soil is moist or dry, which activates the solenoid valve and releases water to irrigate the ground [16] [17].
The majority of the characteristics that are monitored are ambient temperature, humidity, and soil water content; they do not directly correlate with the crop's water requirements.So crop monitoring and automatic irrigation systems interact with users to gather information about the crops that were planted, estimate irrigation needs for the entire season in advance, gather soil data, and make irrigation decisions using neural networks.They also alert irrigation units to enable zone-wise watering and send sensor data to MQTT (Message Queuing Telemetry Transport) broker systems to enable remote data monitoring [18] [19].

System Architecture
The system in this case consists of an ESP 8266 Wi-Fi Module, which is connected to a microcontroller along with soil moisture, humidity, temperature, and rain drop sensors that are placed in the soil and provide data for each of these variables represented in Figure 1.For the purpose of predicting soil condition based on temperature and moisture levels, machine learning algorithms have been used.The control signal is then sent to the ESP 8266 through serial connection using the predicted output, which controls the water pump to water the field as needed.In order for farmers to access the data from their mobile devices and have a thorough picture of the fields being irrigated, the last and most important component is recording the data of soil moisture, temperature level, and prediction with date and time on the server.The system follows the following steps:

Getting the data from sensors
A variety of IoT end-devices, including soil moisture, temperature, humidity, and rain sensors, can collect data.To combine these data and manage how the end devices are connected to one another and the web host, an ESP 8266 device serving as an IoT gateway is used.The gateway collects data, to accurately recognize an intriguing occurrence, such as a variation in soil moisture.Through the device provisioning service, gateways can either deliver updates on a regular basis or whenever they notice a new event.

Input from the user
We created a Graphical User Interface (GUI) that is accessible through mobile phones and other personal computer devices.The GUI is simple and user friendly so that a lay man can use it and will enable farmers to remotely access the installed IoT system, removing the requirement for ongoing manual monitoring.With little manual assistance, this design offers farmers cost-efficient and ideal alternatives.Additionally, by utilizing the "WebHost", the GUI can be used to retrieve relevant data and up-to-date insights that will help farmers to make decisions for managing crop growth.

Output to the user
Periodic notifications are given to the user using the user interface application on smart phone regarding various levels of sensor data also the temporal data is shown for the predicted values.

Algorithm Employed
Machine learning models such as SVM, RF, and Linear regression are used for creating the system which takes the input soil water parameters, previous water usage in the field and meteorological information.The models thus developed for irrigation decision support system predicts the future usage with lower prediction error [8] [20].
Deep neural networks (DNN), PLSR, SVR, and long short-term memory (LSTM) is examples of multivariate regression techniques that are often used nowadays.Three primary components related to absorbance, refraction, and scattering of light that were employed in modeling for both the nearby and satellite datasets were shown to be the most efficient using PLSR, a linear technique.The SVR model (Sagan, V. et al.) applied in the area of remote sensing for quality of water uses a Bayesian optimization function and a linear kernel, both of which have gained popularity.A feed forward DNN was also created, with a learning rate of 0.01 and five hidden layers.The model was trained using a Bayesian regularized back propagation method [21].

Figure 2. Algorithm Employed in Proposed System
An Algorithm of Proposed system is shown in figure 2. Linear regression is a popular method to forecast a continuous numerical value based on one or more input parameters.It assumes that there is a linear relationship between the input and output variables.It minimizes the discrepancy between the expected and actual values.The linear regression model with one input feature is given by: y = b 0 + b 1 * x (1) Where y is prediction variable, x is input, b0 is intercept, b1 is slope.In multivariate linear regression (with multiple input features), the relationship is represented by a hyper plane in a higher-dimensional space and represented by: Here multivariate linear regression is used along with support vector machine which intern employ support vector regression for the future irrigation prediction using the previous data present in the database.

IOT Device Model
The Figure 3 shows the IOT device picture which consists of Soil Moisture Sensor, DHT11 Sensor, Rain Sensors, two channels Relay Driver, 5V motor pump, 8266 Lua Wi-fi Module, pcb Board, and 5V Power Supply.The IOT device is connected to database using Wi-Fi which sends the data of sensors after every 60 seconds of time interval.

Application Deployment
The events delivered from the gateway are collected using the IoT Event Hub on the cloud side.A streaming service called The Event Hub can compile and decipher millions of events from data transmitted by IoT devices.The Event Hub also uses some security procedures to make sure that the incoming communications are genuine.Each consumer application in partitioned consumer architecture only receives a piece of the message stream [22].With the help of this approach, event processing can be scaled horizontally and incorporated into Azure's big data analytics services, such as Databricks and Azure stream analytics, with ease.Deploying the system over the cloud gives the advantage of load balancing and thus reduces the downtime [23].The Figure 6 shows Water Pump Activity showing the current status of the water pump which cannot be changed through application also it depicts the previous on time of the motor and the off time of motor.Also, a button (Click here to view list) redirecting to the previous data value of the Motor pump On\Off values.
The WebHost event processing engine can be used to quickly analyze data streams generated by sensor devices.After receiving an adequate amount of events, the analytics service starts to take action, such as starting alarms, feeding data to a monitoring tool, or storing impacted data for later use.The working application is developed to test the features and prediction discussed so far in this article.The mobile application gives the user a view of the entire system which enables better understanding and usage for the farmers.

Conclusion & Future work
Precision agriculture is paving the way for use of machine learning models, sensors, robotics, Drones, IoT in everyday agricultural practices.Paper takes into account precision irrigation in agriculture, which uses IOT and Machine Learning to Optimize Water Usage.The system makes use of soil moisture sensor to find out the soil's moisture level and a microcontroller to automatically turn on and off the pump depending on the need for irrigation, allowing for the most efficient use of water in agricultural fields without the need for farmer intervention.This technology is both practical and reasonably priced.In areas with a lack of water, this irrigation system is also beneficial and increases sustainability.The constructed system was successfully evaluated and put into use as a precision agricultural system in a lab and a small field, and we discovered that it was accurate in its operation.The implications of system, which can be deployed both in urban and rural areas, reduces manual labour while preventing water waste, which is particularly beneficial for farmers and agricultural researchers looking to increase crop productivity with less input cost.
Future work will include installing communication systems to assist users by giving real-time field conditions in the form of photos and video as well as increasing the number of devices and sensors for proper monitoring.It can be improved for future developments by building this system over a significant region of land.Additionally, the system can be interconnected to monitor each soil's quality and crop growth.System can be strengthened by including more sophisticated machine learning algorithms.These algorithms would assist the field become an autonomous system because they are able to learn the needs of the crop and minimize the water requirement.

Figure 1 .
Figure 1.Architecture of Proposed Irrigation System.

Figure 3 .
Figure 3. Physical IOT Devices Connected to Main Module

Figure 4 .
Figure 4. Start-up Activity on Mobile Application

Figure 5 .
Figure 5. Soil Moisture Activity (Left) and Previous Moisture Values (Right)

Figure 6 .
Figure 6.Water Pump Activity (Left) and Water Pump On/Off Values (Right)