Machine Learning Technique for Precision Agriculture Applications in 5G-Based Internet of Things

the AI-based wireless sensor will push intelligent agriculture to a new standard. The research goal of this work is to improve the prediction state using image processing-based machine learning techniques. The main objective of the paper, as described above, is to detect and control cotton leaf diseases. This paper comprises several aspects, including leaf disease detection, remote monitoring system depending on the server, moisture and temperature sensing, and soil sensing. Insects and pathogens are typically responsible for plant diseases that reduce productivity if not timely. This paper presents a method to monitor the soil quality and prevent cotton leaf diseases. The proposed system suggested uses a regression technique of arti ﬁ cial intelligence to identify and classify leaf diseases. The information would be delivered to farmers through the Android app after infection identi ﬁ cation. The Android app also allows soil parameter values like moisture, humidity, and temperature to be displayed along with the chemical level in a container. The relay may be on/o ﬀ to regulate the motor and chemical sprinkler system as required by using the Android app. In the proposed system, the SVM algorithm delivers the best accuracy in detecting various diseases and demonstrates its e ﬃ ciency in the detection and control by the improvement of cultivation for the farmers.


Introduction
The information technology of the farming sector is currently regarded as a concern to confront the many difficulties that arise in the area. The development of efficient and more profitable agriculture systems and instruments is quickly increasing with environmental monitoring and remote control in agriculture [1]. Precision agriculture and intelligent agriculture can lead in this direction. These two phrases concern the integration, with traditional agricultural methods, of sophisticated technologies for the production of good crops [2]. Intelligent agriculture systems can supply farmers with significant environmental data from their fields to enhance competitiveness and profit. Nearly every area of agriculture can benefit from such technical developments, from plantation and irrigation to plant protection and harvesting. When the AI is integrated into the cloud, processes become intelligible and judgments involving human involvement are made fluently [3,4]. Diverse strategies for resolving contemporary issues in agriculture have been presented, from databases to predictive analysis. As far as precision and efficiency are concerned, systems using AI have proved to be the best results [5]. Farming is a vibrant area, and the circumstances to deliver a meaningful solution cannot be generalized. The AI approaches enable us to collect and respond optimally to the unique challenge of the complicated characteristics of each case. The development of various AI systems gradually solves extremely complex problems. In agriculture, multiple approaches to agriculture are adapted quickly to AI. The concept of smart systems enables farmers to recognize crops, analyze the soil, provide expert advice, and develop business opportunities. This leads to stochastic AI technologies that enable agricultural production to recognize, collect, and respond to different conditions (depending on the knowledge gained) to increase efficiency [5,6]. By following new progress in the agricultural sector, farmers can offer solutions via platforms such as chatterbots that benefit from the field. Global agriculture artificial intelligence is predicted to increase significantly [7,8]. It was aimed at improving the efficiency of daily agricultural activities such as the adoption of robots and drones, protocols to monitor crop health, computerized irrigation systems, and tractors without a driver. This paper was aimed at emphasizing the usage of WSN and IoT in agriculture and at presenting an in-depth analysis of sensor and IoT data analytics utilizing AI approaches for applications in agriculture. The approach is to detect and control cotton leaf diseases and motivate to increase the application in agriculture-based application.
This paper organized as follows. Section 2 provides literature survey, and Section 3 has presented the materials and methods. Section 4 described the artificial intelligence in agriculture. Section 5 proposed the novel approaches and performances. Section 6 discusses the analyzed result, and finally, Section 7 concluded the proposed work conclusion.

Literature Survey
Artificial intelligence (AI) technologies have predicted the behavior of nonlinear systems and have contributed to controlling variables to improve system-operating conditions. A recent analysis highlights the emergence of artificial intelligence as part of solutions for enhanced farm productivity.
Sharma et al. [1] suggested that solar-powered IoT sensor nodes monitor and operate the agricultural sectors. Operations such as crop management, crop harvesting, water supply control, control of animals, distribution of pesticide, moisture, and temperature measuring technologies will also be monitored and controlled in agriculture.
Suchithra [2] suggested that sensors can detect field conditions such as temperature, humidity, humidity, and farm fertility. The value of sensing is authenticated and then transmitted to the Wi-Fi, and the verified data from the Wi-Fi module is transmitted via the cloud to the mobile or laptop of the farmer. If the field requires care, farmers are also informed by SMS. An algorithm with temperature, humidity, and fertility thresholds is created that can be configured to manage water quantity in an MCU node. From anywhere in the world, farmers may control the engine.
Joshi [3] described the construction of the wireless agricultural environmental sensor nodes to monitor climatic conditions and deduct the optimum external conditions for high crop yields in a specific agricultural field. This research focuses on the literature on the construction of the wireless agricultural environmental sensor nodes to monitor climatic conditions and deduct the optimum external conditions for high crop yields in a specific agricultural field. Agriculture and food production is a sector that has recently remitted its concentration to WSN, which seeks to raise its production and the agricultural yield benchmark using these costeffective modern technologies. In recent years, wireless sensor networks (WSNs) have been attracting great attention.
Mekonnen [5] discussed that the present analysis is a comprehensive evaluation of the implementation in sensor data analytics within the agroecosystem of different machine learning algorithms. It covers a case study on an integrated food, energy, and water (FEW) systems based on IoTdriven smart farm prototypes.
Sangeeta et al. [4] suggested that machine learning approach is intended to forecast the best crop yield in a certain area through the analysis of several climatic parameters, such as precipitation, temperature, and dampness, soil pH, soil type, and previous plant crop records.
Ghadge [6] suggested that farmers monitor the soil fertility based on data extraction analyses. The method, therefore, focuses on the monitoring of soil quality to determine the crop fit for production by type of soil and to maximize crop production using the right fertilizer recommended.
Sujawat [7] discussed that the enormous uses of artificial intelligence are in many domains. Artificial intelligence can be of tremendous help in addressing agricultural illnesses due to its ability to understand the problems and develop the right reasons for them and find ideal solutions for them. The study gives a quick introduction of artificial intelligence application in agriculture, its available farming practices, and the numerous ways available to detect disease in plants. Kshirsagar and Akojwar [8][9][10][11] elaborate on the use of artificial intelligence for different classification and prediction problems and furthermore explained the use of hybrid artificial intelligence for feature extraction, classification, and prediction along with modeling with different algorithms and optimization techniques. Significant demonstration in the domains of artificial intelligence, case-based reasoning, multiagent optimization, scheduling, data mining, web crawlers, comprehending and translating natural languages, and virtual vision reality [12][13][14]. 2 Wireless Communications and Mobile Computing

Materials and Methods
3.1. Use of WSN in Agriculture. Spatial-temporal climatic, hydrographic, pressure, movement, the wetness of the soil, eco-psychological plants, plagues, and the reporting to the farmer of optimal alternatives are possible using wireless sensor networks [9]. It would be a tremendous boon for him to have such knowledge routinely. Automatic control equipment can be used to control irrigation, fertilization, and pest control to address adverse situations which confront farmers. Maintenance of irrigation is also one of the most crucial precise farming chores [5]. The small parasitoid wasp Microplitis croceipes finds caterpillars attacking cotton crops by placing onto a complicated organic cocktail, which is issued when assaulted from the plant. Sensors capable of detecting this cocktail might result, with much-targeted pesticide treatments or warp introductions, in the early detection and mitigation of this attack. Diverse elements, including soil type and temperature, differ substantially in precision farming (PA) from area to area; any irrigation system therefore must be flexible to suit these differences. Irrigation regulators are frequently costly to manage precious water resources [10]. They are not efficient at all. Moreover, WSNs are still under improvement; for instance, they are sometimes inaccurate, delicate, and hungry for power and can easily lose contact in a hostile environment, especially in agriculture [6]. Cultivation field surveillance is critical for agricultural effectiveness in reducing resource waste and increasing yields in activities such as irrigation and fertilization because it allows farmers to access and decide upon sound information on climate factors, soil, and plant situations and changes in plant life [15]. Although agricultural field monitoring generally involves manpower, one-off agro weather stations, and wired sensor network systems, the high density and flexible deployment of instruments for collecting data in real time is necessary for this issue, immersed in precise farming [11]. WSNs have been developed to provide low-cost, flexible, easy-to-use, and high-precision benefits in real time for agricultural monitoring. We highlight the applications for agriculture and farming that can be used with WSNs [5,6].
3.1.1. Irrigation Management System. Agricultural production demands a better irrigation system to maximize water use in agriculture. Another cause for the need for an improved system is the frightening decrease in the groundwater level [16]. This setting has a cost-effective and waterefficient method of micro-irrigation. However, depending on environmental and soil knowledge, microirrigation efficiency may be further increased. WSNs are used as the organizing mechanism in this respect.

Farming System
Monitoring. Several upgraded technologies and equipment are presently being employed in agriculture. In this respect, the enhanced method for managing this equipment makes operation generally easier and allows automation for famine. Furthermore, remote surveillance devices aid better management of large-scale farms [17]. Moreover, the system quality can be enhanced by providing extra data such as satellite photos and weather forecasts.

Pest and Disease
Control. Increased quality of crops and minimized agricultural expense are helped by controlled utilization of pesticides and fertilizers. However, we must monitor the likelihood and presence of pests in crops to control the use of pesticides [16]. We require information about the environment, such as temperature, moisture, and wind speed, for this purpose. A WSN can observe these occurrences independently and can anticipate them in a field of interest.
3.1.4. Controlled Use of Fertilizers. The growth of plants and their quality depends directly on fertilizer application. However, it is demanding work to optimally feed fertilizers in good fields. Monitoring of the variation in land nutrition such as nitrogen (N), phosphorous (P), potassium (K), and pH can be carried through the application of fertilizers for agriculture. The balance of soil nutrition can therefore be sustained, as well as the quality of the crop [18].
3.1.5. Groundwater Quality Monitoring. The growing use of fertilizers and pesticides reduces groundwater quality. Control of water quality by placing sensor nodes is enhanced by wireless technology [3].
3.1.6. Remote Control and Diagnosis. Farm equipment like pumps, lighting, heaters, and valves in machines also can be remotely controlled and diagnosed using the Internet of Things [5].

Artificial Intelligence in Agriculture
In its vigorous technological discovery and the huge application region, artificial intelligence (AI) is one of the major research solutions in software development. AI's key idea in agriculture is flexibility, fast performance, accuracy, and cost viability [4,19]. Artificial intelligence in agriculture not only helps farmers utilize their farming talents but also leads farmers to increase returns and improve the quality with less expense [7,8]. AI-based technology for wireless sensors enhances the efficient functioning of all sectors and addresses the issues faced by numerous sectors in the agriculture industry such as crop harvesting, irrigation, and soil content sensitivity. AI technology enables plant disease, pests, and malnutrition diagnostics on farms, and AI sensors can supervise the agricultural parameters and control them [20,21].

Proposed System
The system uses a temperature sensor, a humidity sensor, an optical sensor, a ground moisture sensor, a soil pH sensor, and a camera module for data collection. The field characteristics are monitored using LCD monitors and mobile applications. The sprayed chemical in the plants is controlled via the solenoid valve in Figure 1. The first image is taken from the camera and detected and displayed in the app by image infection picked, when farmers take the appropriate steps after disease identification, i.e., by using an app to spray pesticides or fertilizers to convert ON/OFF into the water [22]. The ON/OFF external 3 Wireless Communications and Mobile Computing devices are controlled by the relay driver. With the assistance of a sensor, farmers may also control the soil and water level in a tank. For soil condition and water level and pesticide tank measurement, four different kinds of sensors are used. These sensors comprise a sensor [18], a humidity sensor, a sensor of water, and a humidity sensor. All of these sensors have a Raspberry Pi interface. For moving the whole system, motor drivers and DC motors are used. The movable system monitors the status of the ground in different locations.

IoT Cloud for the Proposed Method.
To provide data and transport the data between devices, this IoT cloud plays an essential function. The storage is kept independently for every analysis, such as sensor output, item recognition, illnesses of plants, and predictive big data analysis [3,5,7]. Moreover, farmers can gain knowledge through Internet services from agroexperts about smarter agriculture and future forecasting. Services are designed to provide insights on crop planting, control of pesticides, and land management. In the agricultural sector, the    [6]. The central processing unit's main focus is on the transmission of information between components utilized to process IoT systems.

5.3.
Wi-Fi. In the proposed system, wireless fidelity plays a crucial role in IoT deployment. A high-speed Internet is available via IEEE 802.11X to communicate with the user [16]. The built-in wireless network allows the robot to communicate the gathered data on the server and user interface application via smart mobiles.

Smartphone.
All data collected in the field are used in the user interface application to appear on a mobile phone. It is a mobile phone software program that designs and works. The application information in the field is revealed [23].

Raspberry
Pi. Raspberry Pi is a system for gathering data from numerous sensors. The Raspberry PI GPIO pins connect different sensors. When data is collected from a sensor

Wireless Communications and Mobile
Computing by the Raspberry Pi over wireless networks, the data is delivered to the database cloud [8,9]. To forecast the output of plant disease, the data collected from the cloud were previously processed and analyzed by AI. 5.6. HD Camera. Anything in the field can be recorded and provided to the user using a mobile app. The digital camera provides the fundamental ingredients for capturing images and videos [24].

Sensor
Unit. The plant's growth is mainly determined by the elements of environment and climate and the amount of water and fertilizer irrigation. Fluid nutrition factors must be monitored and managed in a limited range of desired levels to ensure optimal growth. The parameters shall include nutrient temperature, pH, and EC concentration [3,5]. If the parameters exceed the acceptable range, plants can damage it. Further parameters can be changed to improve further growth, e.g., air temperature, relative humidity, and light intensity, and CO 2 concentrations. Some sensors are the primary way to address challenges related to the monitoring and management of increasing spatial circumstances [6,16]. The sensor can detect and monitor a range of parameters such as temperature, moisture, the intensity of light, and CO 2 . The following details are provided by its function and operating process and the advantages that the key sen-sor offers. Image processing-based leaf disease detection is shown in [14]; this also analyzes the CNN-based transfer learning model.
(i) Soil sensor: this sensor is used to measure the amount of soil moisture and water. Two huge exposing pads constitute a sensor and work on the electric conductivity key. Resistance of the soil moisture sensor, which is the main determinant of plant development, is inversely related to moisture content. If less than required water voltage is reduced, analog voltage will enable the farmer to discover the water shortfall. This sensor is utilized across the field to manage the quantity of water and any other essential automation [17]. The watering system in the greenhouse was improved by the wireless moisture sensor network (ii) Light intensity sensor: as we know, all plants and flowers require great sunshine, and every group of plants reacts differently to the intensity of the light. Some plants work well with low intensity of light and some with high intensity of light [16]. The farmer must supply enough light quantities for the healthy plant for at least 8 to 10 hours per day. Artificial lighting is a superior way to develop a healthy plant with sufficient intensity [13] (iii) Temperature sensor: one of the essential parameters regulating plant growth and development is temperature. Lower temperatures are frequently the result of inadequate plant growth. The photosynthesis and genotype growth demand a varied level of temperature, which can advance plant growth [23]. The optimal temperature on the ground should not be less than 4°C and more than 30°C for successful plant growth (iv) Humidity sensor: the sensor is used for the sensation and measurement of comparative air humidity. The real temperature of the air and humidity of the    Wireless Communications and Mobile Computing air is measured. Moisture affects plant leaf growth, pollination, and photosynthesis directly and indirectly in many ways. The health of the leaf does not depend only on photosynthesis but also on the physical cell development process that may be observed using a moisture sensor [13] (v) CO 2 sensor: to maintain the root metabolism in the nutritional solution, the necessary levels of oxygen in the root environment are vital. The level of oxygen in the root environment is particularly significant since low levels influence the breathing of the root, its nutrient absorption, and thus plant growth (vi) pH sensor: the pH sensor is used to accurately monitor the number of nutrients needed to be irrigated in the soil. The pH value is monitored to supply the plants or crops with the needed amount of nutrients for healthy growth [18,23] 5.8. Motor Driver. The DC motor that is attached to the wheels is utilized to drive the driver. It is a current amplifier that regulates the motor power and converts a low-power signal into a high-powered motor signal and vice versa [20].

DC Motor.
The DC engine is an electric machine that transforms electrical power into mechanical energy. The main components of the DC engine are the currentcarrying frame [21] connected to the supply by the switch and contacts. It works on the basis that "the currentcarrying driver in the magnetic field has mechanical force." 5.10. Robot Movement. DC motors are utilized for robot movements that are electronically regulated by the Raspberry Pi. The wireless module takes signals from the input and transmits them to the processor, which turns the engine around. DC engines are switched on and off when the signal is received by permitting a certain pin for the Raspberry Pi [15,24]. An adequate velocity is provided by 300 rpm DC motors.

5.11
. Pesticide Spraying Mechanism. The Raspberry Pi digital key's Wi-Fi module connection receives a message from the mobile app on a smartphone. The drifting sensor and submersible pump have been placed in the pesticides. The pump is connected on one end of the tube and the other end with the sprayer nozzle [25]. The user can use the mobile application to spray a specified pesticide if the plant suffers from any illness.

Data Acquisition.
In the data acquisition segment, the data acquisition unit is established in various sensor nodes. The data collection module is used in agricultural production to collect information from processing variables in real time (temperature, light intensity, humidity, nutritional product solution level, atomization quantities, and photos of plants and sick plants). Finally, the control and management sector is a central processing unit of the system (CPU). The CPU system includes various critical duties including Raspberry Pi and WRTnod, which are designed for the storage, management [5,6,8], and transfer of data acquired from nodes to the webserver in real time. This technology allows farmers to monitor and control the operation remotely through the smartphone app.
5.13. Image Preprocessing. Image preprocessing uses various preprocessing techniques to eliminate image noise or another removal of objects. The pixel size of the original image is large, and it takes more time for the whole procedure [9,12]. After the image has been converted into miniatures, the pixel size is decreasing and it takes less time.
5.14. Image Segmentation. Image segmentation is one of the most commonly used ways for clearly distinguishing image pixels in a specific application [20]. It divides an image into several discrete states, which show a large similarity of the pixels in each area.

Feature Extraction.
Feature extraction is a key element in the detection of disease. In the identification of an object, it plays a vital function. The extraction of features is used in numerous image processing applications [22,26]. The features used for the detection of illness are color, texture edges, and morphology.

5.16.
Classification. This is the last phase in the identification of disease in which the classification system is utilized to recognize the type of leaf disease [27]. Different types of artificial intelligence are used for detecting leaf diseases.

Random Forest.
Bagging is a new model of random forestry based on trees. Bagging was aimed at minimizing prediction variation by averaging predictions via sampling and substitution. Random forests supply the packing with a new element, randomly selecting and producing a tree with characteristic alterations and often repeating [11,28]; this procedure ultimately measuring all forecasts is made      [21,28]. Naive Bayes classification has many highdimensional features with very little data training and is highly scalable. In Bayesian analysis, the probability of an event C given an event Y is not the same as the probability of Y given C as in Eq (1).
Assuming that C1, C2,…..Cn and Z are the feature vectors and the class of the crop prediction dataset, respectively, the Bayes equation can be expressed as shown in Eq (2).
Where PðCÞ = prior probability representing the feature vectors of crop dataset.
PðC | ZÞ = prior probability representing the class of crop dataset. 5.16.3. Support Vector Machine (SVM). Algorithms for SVM regression are modified to predict continued response. SVM regression algorithms instead of identifying hyperplanes that separate data find a model that does not differ by value from the measured data except for a small number of parameter values that reduce error sensitivity. It is suitable for largescale data when there are a large number of predictor factors. Potential applications of SVM-aided PA [26] in WSN are a regression for the detection and forecast of plant disease and sensor data [28].
The SVM is a multitude of instances chosen as space points so that samples belonging to distinct groups are divided into two groups.
The input characteristics are transferred to a higherdimensional space and can also be shown as Eq (3).
Where the set of nonlinear transformation and k is the bias. Figure 2 is a flow chart where the robot will operate in the initial phase, detection of soil type (soil color). It will examine which sort of crop has been sown after the detection of the soil. It checks the health of the crop and the soil based on crops. If soil fertilization and cultivation are not troublesome, then these operations are carried out. If the plant and soil are troublesome, the problem is resolved and the farmer is encouraged to take the required measures for the crop, and chemical is sprayed on the infected plants and monitored for a few days. If the problem ends, the issue will be checked again. If no difficulty is present and the illness of the crop is cleared, the robot will not function till the next disease is detected.
5.17. Performance Measurement. The statistical analysis, and in particular the average square error (MSE), is used to determine the durability of established models to prevent plant illness [15,24]. However, precise, specific, sensitive, accurate, and F-score assessment matrices were used to evaluate the classification model that has been created. Table 1 specified the employed model measures.

Results And Discussion
It takes at least 15 seconds to spray chemical products on each plant. After 3 seconds, he continued his trip to the rest of the plants. A total length of roughly 33.36 minutes was needed for a maximum of 75 plants with a total length of 20 centimeters. This will have a consumption of 30,000 milliliters of chemicals, as shown in Table 2 and  9 Wireless Communications and Mobile Computing morning can be determined. When there was irrigation, high water content is shown by the blue curve. In the evening hours after the robot was irrigated in the morning, the red curve shows low moisture content. As mentioned in Table 3, dispersion required 7 days. It was completed distributed.
IoT is the effective interface between sensors and Raspberry Pi and wireless communication. The detection of leaf disease is carried out with artificial intelligence. All observations and tests have been performed, which demonstrates that this is the intelligent agriculture solution as indicated in Table 4. This approach enhances the agricultural output and boosts the farmers' total income.
The main objective of the paper, as described above, is to detect and control cotton leaf diseases. The dataset was separated into 60% training and 40% test subsets to validate the proposed model. For predicting the leaf diseases, RF, SVM, and Naive Bayes were used. The results of the various AI classification models are given in Table 5. Leaf disease detection using various algorithms is shown in Figures 5-7.

Conclusion and Future Scope
Agriculture is undergoing a digital transition, like numerous industries. The amount of data from farms is collected. Wireless, IoT, robotic, and AI networks are being used. Artificial intelligence algorithms enable the extraction from the flood of data of relevant knowledge and insight. The major purpose of this work is, according to the discussion, to detect and monitor cotton leaf diseases. The second objective is to monitor the parameters of agricultural parameters. The correct identification and illness of the plants are extremely crucial for agricultural performance, and this may be done with artificial intelligence. This paper analyzes the approach of AI for the detection of an unhealthy plant leaf. Different aspects of the infected sheet may precisely identify and classify different plant diseases by removing features of the infected sheet. This method enables the illness to be detected and pesticides sprayed automatically on the afflicted plants and to send the user information. The SVM algorithm delivers an accuracy of 98.34% for the bacterial blight diagnosis of diseases and demonstrates its efficiency in the detection and control by the improvement of cultivation for the farmers. In the future, this presented work is improved with the CNN model for classifying diseases.

Data Availability
The datasets used and/or analyzed during the current study are available from the corresponding author on reasonable request.