IoT-Equipped and AI-Enabled Next Generation Smart Agriculture: A Critical Review, Current Challenges and Future Trends

Smart agriculture techniques have recently seen widespread interest by farmers. This is driven by several factors, which include the widespread availability of economically-priced, low-powered Internet of Things (IoT) based wireless sensors to remotely monitor and report conditions of the field, climate, and crops. This enables efficient management of resources like minimizing water requirements for irrigation and minimizing the use of toxic pesticides. Furthermore, the recent boom in Artificial Intelligence can enable farmers to deploy autonomous farming machinery and make better predictions of the future based on present and past conditions to minimize crop diseases and pest infestation. Together these two enabling technologies have revolutionized conventional agriculture practices. This survey paper provides: (a) A detailed tutorial on the available advancements in the field of smart agriculture systems through IoT technologies and AI techniques; (b) A critical review of these two available technologies and challenges in their widespread deployment; and (c) An in-depth discussion about the future trends including both technological and social, when smart agriculture systems will be widely adopted by the farmers globally.


I. INTRODUCTION
As per the recent report by the UNESCO World Water Assessment Program (WWAP), the world's population will increase by 33% in 2050, doubling the need for food and water [1]. This will have serious consequences for the whole world, especially the developing nations. Amongst the ubiquitous Internet of Things (IoT) technology, smart agriculture is one the most important emerging application, as shown in Fig. 1. Smart Agriculture Techniques [2], [3] have recently seen widespread interest by farmers and researchers alike to meet increased food demands.
Smart Agriculture Systems (SAS) are driven by several key factors, which include the adoption of IoT technologies for remote, unmanned monitoring of the agriculture fields The associate editor coordinating the review of this manuscript and approving it for publication was Eyhab Al-Masri . and taking corrective actions to make the environment most conducive for crop growth.
SAS depends on a combination of hardware and software technologies for optimum benefits. The hardware side is now well supported by the availability of inexpensive, portable, power-efficient hardware with wireless connectivity, which enables their deployment in large numbers across vast indoor and outdoor agriculture fields. Rugged hardware modules may be installed underground to measure soil conditions, while others may withstand harsh climate conditions such as sunlight, rain, and extreme humidity. Other specialized hardware includes Graphical Processing Units (GPUs), which can process large amounts of data gathered by these modules as dictated by software-based Artificial Intelligence (AI) frameworks.
On the software side, the recent boom in AI and Big Data technologies supports not only the managing of large amounts of data accumulated by hardware modules but also to give this VOLUME 10, 2022 This work is licensed under a Creative Commons Attribution 4.0 License. For more information, see https://creativecommons.org/licenses/by/4.0/ data as input to state-of-the-art, AI-based predictors, which can give more well-informed decisions to the farmer. They can efficiently analyze the latest trends in the data and provide several insights to the farmer. These benefits range from greater crop productivity, saving of tightly managed resources such as water for irrigation purposes, and minimization of the use of toxic chemicals such as those used in fertilizers, pesticides, and herbicides. Such a level of control over agriculture not previously possible gives the farmer greater flexibility and insight to plan his activities, such as determining what crops will result in optimum yield under existing and predicted climatic conditions. It keeps him well informed about his current and projected use of permissible fertilizer and pesticide use. It also helps him regulate the usage of tightly managed resources such as water for irrigation purposes.
This paper presents a detailed review of the architectures of first-generation smart farms relying on various wireless sensors and communications technologies around which IoT technologies in SAS are based. We then discuss how recent advancements in AI-powered algorithms based on Deep Learning (DL) can use the collected data from diverse sources.
This data can be collected from a large number of IoT sensors and imagery from unmanned aerial vehicles (UAVs) in different geographically diverse smart agriculture fields to make more accurate and informed decisions for pest detection, plant diseases, smart irrigation, limited use of herbicides, and other harmful substances. We then review the current state-of-the-art technologies, implementation challenges associated with them, and future trends and direction in SAS.
In terms of significant contributions, this paper has presented 1) A detailed tutorial on the available advancements in the field of SAS through IoT technologies and AI techniques; 2) A critical review of these two available technologies and challenges in their widespread deployment; and 3) An indepth discussion about the future trends including both technological and social, when SASs will be widely adopted by the farmers globally. The roadmap of this paper is as follows: Section II discusses the related work. Section III discusses the state-of-the-art wireless sensor network (WSN) technology and use-cases of IoT in SAS. Section IV discusses the smart irrigation technologies used currently in the world. Section V presents an overview of the use of UAVs, which is a current driving force behind AI-powered solutions for SAS. Section VI discusses these solutions in detail, which are possible via DL applications. Section VII discusses the challenges in SAS, and Section VIII discusses the future trends in the area of smart agriculture technology. Finally, Section IX concludes the paper.

II. RELATED WORK
IoT-based smart farming has actively been in development for the last two decades, ever since the boom in wireless sensor technology. A comprehensive survey on the role of IoT in SAS has been provided by Farooq et al. [2] and Ayaz et al. [3]. Li et al. [4] presented an actual working smart greenhouse (SGH) with remote monitoring option using the WSN technology. With the advent of smart lower-powered wireless sensor technology enabling deployment in high densities, micromanagement ideas for SAS have started to evolve quickly. As soil parameters could be monitored closely, water conservation strategies such as smart irrigation technologies were developed. Hydroponics [5] and Aeroponics [6] are two such cutting-edge, soil-less medium based water management technologies. Nalwade and Mote [5] described a hydroponics-based smart irrigation system in which plants are suspended into a nutrient solution instead of soil for direct application of water to crop roots as per requirements. Idris et al. [6] implemented an aeroponics-based water irrigation system for crops in which water is directly sprayed at crop roots as per need. Special hardware design for sensor nodes was actively developed especially for use in smart agriculture applications [7].
IoT-based SAS studies have also been a popular topic amongst researchers [8]. These have been practically implemented for efficient monitoring and controlling of the agriculture systems remotely, sometimes with the option of saving data to the cloud for the benefit of other farmers working in similar domains, e.g., crops and climatic conditions.
Internet of Underground Things (IoUT) is a new emerging concept [9]. Monitoring soil factors and climatic conditions are two major contributors to the well-being of the crops. Like IoT, it represents an internet of wireless sensors and actuators which are located below ground to monitor and control soil conditions such as moisture, nutrients, acidity, pH levels, and soil electrical conductivity. Wireless signal propagation loss and protection of sensitive electronics inside wireless sensor nodes is a challenging issue for the IoUT technology. Singlehop, wireless, underground sensor networks have been discussed in detail by Tiusanen et al. [10].
UAVs for smart cities surveillance in real-time have been proposed previously [11], [12]. The use of UAVs in smart farming is also being explored by researchers [13]. UAVs equipped with specialized smart camera applications capture aerial images of the field, which, combined with advanced DL-based AI tools, can predict crop diseases, phenotyping, plant growth monitoring, weed detection, and used for irrigation pesticide spraying.
Architecture of a neural network. In current circumstances of acute water shortages for agricultural purposes, it is crucial to devise smart strategies for water conservation. Advanced irrigation concepts centered around IoT-based precision agriculture include the techniques of hydroponics [19] and aeroponics [20]. Zahid et al. [46] present a novel TeraHertz (THz) waves based method to estimate water content in living plant leaves to maximize water conservation via smart irrigation strategies.
The concept of greenhouses [17], [18] is not new and has been around and utilized for agriculture for a few decades now. However, with the advancement in IoT and wireless sensor nodes technology, the SGH concept is rapidly emerging [47], [48]. SGHs enable farmers to maintain microclimate conditions, enhance irrigation and fertilizer use. Similar to SGHs is the concept of Tunnel Farming [19]. Plastic tunnel farming is successful in developing countries due to its low cost, having off-season crops, and better productivity [49]. Traditional tunnel farms use drip irrigation, overhead irrigation, or sprinkler irrigation methods for better results. This type of irrigation is better than normal flooding methods. Various irrigation methods provide various levels of water and energy efficiency. Semi-Circular cross-section tunnels are used, which are usually 14 to 28 feet wide and 7 to 12 feet tall at the center (depending on width), and 48 to 96 feet long.
It is usually recommended that tunnels should be no wider than 30 feet for cross ventilation and to avoid snow accumulation on the roof. Like SGHs, it is also lined with IoT sensor technology to constantly monitor soil moisture, temperature, humidity, and light intensity and take corrective actions accordingly through appropriate actuators.
The use of Machine Learning (ML) and DL has also been actively researched for improved crop yields [50], agriculture advisory systems [51], [52], detection of crop diseases, weed detection [53], and pests [38]. Zeynep et al. [21] have carried out an exhaustive literature survey on the use of DL techniques in smart agriculture. The use cases of DL in smart agriculture include detection of plant diseases, pest recognition, plant classification, smart irrigation, and weed detection. Table 1 summarizes the topics related to SAS covered in various research papers and compares them with the contributions we presented in this survey article.

III. USE OF IOT IN SMART AGRICULTURE
A. WIRELESS SENSOR TECHNOLOGIES FOR SMART AGRICULTURE 1) TEMPERATURE SENSORS Ambient temperature monitoring is vital for crops growth in indoor as well as outdoor smart farms. Some crops are susceptible to changes in temperature, e.g., wheat. Even for a short period, high temperature affects the growth of shoots and, in turn, reduces root growth. Similarly, the high soil temperature is more crucial as damage to the roots is severe, resulting in a substantial reduction in shoot growth.

2) HUMIDITY SENSORS
Humidity monitoring is essential for crops to estimate water losses due to evaporation, which is vital for the process of photosynthesis. Other complications related to humid conditions are that it may promote the growth of mold and bacteria that cause plants to die and crops to fail, as well as conditions like root or crown rot. Humid conditions also invite the presence of pests, such as fungus gnats, whose larva feed on plant roots and thrive in moist soil [23], [24].

3) SOIL SENSORS
Multiple types of soil moisture sensors are in use in SAS to study parameters like pH and conductivity. Soil conductivity maps help to predict crop yield as they indirectly deduce soil organic matter and soil texture. These two parameters are indicators of available water content and the presence of potential weeds. Thus, soil electrical conductivity measurement is also used for the estimation of quantities of soilapplied herbicides. Similarly, soil pH is essential to have healthy crops as strongly acidic soils having pH in the range of 4.0-5.0 can have high concentrations of soluble aluminum, iron, and manganese, which may be toxic to the growth of some plants. A pH range of approximately 6 to 7 identifies the ideal level of plant nutrients.

4) FLUID LEVEL SENSORS
Level sensors are used to detect the level of substances, including liquids, powders, and granular materials. Level sensors find their use in SAS to monitor the nutrient solution level if the hydroponics method is used for smart irrigation.   abstraction levels. The capabilities of these wireless technologies vis-a-vis their practical use cases are discussed in different sections below.

1) LoRa AND LoRa-WAN
Kontogiannis et al. [54] and Ray et al. [55] have proposed Low Power Long Range (LoRa) and LoRa-Wide area network (LoRa-WAN) technology at the physical layer for data communication between the IoT transceivers. Both LoRa and LoRa-WAN technologies are used in sensor nodes to implement their AI-based irrigation systems, Open Watering System (OWS), and LoRa-Agri, respectively. LoRa is a lowpower, long-range spread spectrum modulation technique enabling IoT sensors to communicate at a distance of up to 12Km [47]. It also provides the highest scalability (5-20K nodes) but low data-rates of about 100Kb/sec.

2) RFM69
Besides LoRa, another physical layer technology to connect IoT-based sensor nodes proposed in recent literature includes the RFM69 standard. RFM69 [88] supports a communication range of up to 0.5Km and data-rates of up to 100Kb/s for up to 65K nodes. RFM69 transceivers can operate over a wide frequency range, including the 433-, 868-, and 915MHz license-free industrial, scientific, and medical (ISM) frequency bands.

3) ZIGBEE
Zigbee technology [36], also referred to as IEEE 802.15.4, is another low-powered wireless communication technology for sensor nodes. It has a moderate communication range of up to 1Km and supports data-rates of approximately 1Mb/s for up to 65K nodes. Like RFM69, Zigbee operates in the ISM radio band, most popularly in the 2.4GHz band, though some devices also use 784MHz in China, 868MHz in Europe, and 915MHz in the US/Australia region. Chikankar et al. have demonstrated the use of ZigBee technology in their automatic irrigation system [14].

4) BLUETOOTH
Bluetooth [49] is another low-power wireless connection solution for the sensor nodes. It has the least supported range of 50m for up to 7 nodes, for the maximum data transmission capacity of 1Mb/s. Bluetooth transceivers require the least power out of the technologies mentioned above.

5) NARROW BAND IoT (NB-IoT)
NB-IoT [48] is a low-power WAN technology (LPWAN) developed through the long-term evolution (LTE) standards, which support direct communication of wireless sensor nodes with the existing generations of cellular networks from 2G to 4G. It supports data-rates of up to 150Kb/s.

6) SigFox
SigFox [48] is another LPWAN technology like NB-IoT. Sigfox employs the differential binary phase-shift keying (DBPSK) and the Gaussian frequency-shift keying (GFSK) modulation techniques that enable communication using the ISM radio bands. Sigfox technology works at 868MHz in Europe and 902MHz in the US. It utilizes a widereaching signal that passes freely through solid objects, called ''Ultra Narrowband'' and requires little energy. The network is based on a one-hop star topology and requires a mobile operator to carry the generated traffic. It supports low datarates of 100bits/sec.

7) WIRELESS FIDELITY (Wi-Fi)
Wi-Fi belongs to the IEEE 802.11 family of IEEE standards. This technology is suitable for wireless sensor nodes where power consumption is not an issue, and higher data transmission rates are required. Thus, it may only be suitable for high data-rates such as video transmission in indoor settings like indoor farms. The transmission distances are lower in the range of 100ft only. For IoT use in SAS, such high datarates are rarely required. Two Wi-Fi standards that have been developed, or are being developed, specifically for IoT are Wi-Fi HaLow (802.11ah) [48] and HEW (802.11ax) [49]. It can support up to 290Mb/s in the upstream. Wi-Fi based sensor connection has been used in a practical system by Buendia et al. [56].

8) WiMAX
Worldwide Interoperability for Microwave Access (WiMAX) is IEEE 802.16 standard [2], [48]. It is sometimes regarded as long-haul Wi-Fi due to its similarities with Wi-Fi standards. It supports up to 380Mb/s data-rate in the upstream. It has the same limitation as Wi-Fi and may be suitable when the wireless sensor nodes are present at an indoor location.

9) CELLULAR TECHNOLOGIES
Cellular technologies will be used to connect IoT-based sensors and smart farming machinery in large fields that otherwise communicate only over a short distance, as depicted in Fig. 3. Future smart agriculture machinery like drones will frequently be having flights covering huge areas, and real-time communication with such drones/UAVs could only be with the help of cellular networks [11]. Newer cellular technologies such as 4G LTE, 5G, and B5G are not only facilitating large communication ranges but also permit large data transmission capability, which will be suitable for applications like real-time video transmission from agriculture drones [12], [104]. Another alternative benefit of using the cellular technologies is to create an Internet Gateway as these systems have connectivity to packet data networks as their core. This will enable the use of Internet-driven applications such as making the system ''weather aware'' in realtime, deciding against irrigation if rainfall is expected or predicted by real-time weather updates etc. Available cellular technologies include 2G/3G/4G and 5G. All previously mentioned physical layer, one hop wireless technologies are either directly compatible with cellular technologies like NB-IoT, SigFox, and WiMAX, or they may be linked to cellular technologies using a gateway. Jawad et al. [57] presented a comprehensive comparison of the different wireless technologies discussed above with technical quantifications. It was suggested by the authors [57] that LoRa and ZigBee wireless technologies are most suitable for SAS because of their low latency and power consumption, easy implementation, smaller size, simplicity, scalability, and most importantly, the communication range (typically small for ZigBee and long for LoRa). Although, as discussed that 5G and B5G technologies [104] with low latency, large communication ranges, high data transmission capabilities that allow realtime video transmission using UAVs/drones will dominate future SAS with higher reliability.

C. HOW SENSORS AND ACTUATORS COORDINATE -MICROCONTROLLER PLATFORMS FOR IOT BASED SMART AGRICULTURE SYSTEMS
Microcontroller-based platforms popularly used by researchers in IoT based SAS include ATMEGA328P [54] (sometimes used in conjunction with Arduino development boards), 18F458 PIC microcontroller [14], and ESP8266 NodeMCU microcontroller [58]. Most of these microcontroller platforms provide an integrated Wi-Fi module having TCP/IP protocol that can able to access any Wi-Fi network. These platforms are cost-effective, power-efficient, and require minimal external circuitry. They also feature moderate storing capability and on-board processing. On-board processing is required to define the logic that how corrective action will be taken according to the sensor reading. All smart irrigation algorithms (described later) can be implemented as a logic program running on the microcontroller. These platforms also allow the integration of different sensors VOLUME 10, 2022 through General Purpose IO (GPIO) pins with minimal run time giving these platforms to scale up to multiple sensors in a single platform. For example, ATMEGA328P having a limit of 8 sensors per actuator [54]. Jawad et al. [59] have presented a practically implemented ZigBee-based system interfaced with ATMEGA 328p microcontroller, which uses energy harvesting techniques and sensor sleep/wake cycles to reduce the power consumption of the WSN network. [60] is the concept in which the surface irrigation method is substituted by a channel of pipes laid into the land for irrigation. Pinpointed locations are selected at various depths for placing water closest to the plant roots and thus minimizing excess water loss in the soil surrounding the plants. Using drip irrigation, farmers can save up to 95% of the water. However, the upfront cost of this irrigation system is high as farmers need an initial investment in purchasing and laying the network of pipes underground through the agricultural land and provisioning of expensive power to drive water pumps for circulation of water in these pipes. Using a renewable form of energy, e.g., solar power, for meeting the power requirements, has a high initial cost but is generally lower in the long run.

B. SOIL-LESS IRRIGATION TECHNIQUES 1) HYDROPONICS
Hydroponics is a branch of hydro-culture, where plants are grown in a soil-less environment using a nutrient solution [14], exclusively. A mechanical structure using coir or coconut fiber may be used for the support of plants. The nutrient solution parameters such as pH and electrical conductivity have to be monitored constantly [7]. There are two variations of this technique where water is continuously circulated, or nutrient solution is supplanted with a new solution to maintain the parameters, the latter method results in power savings.

2) AEROPONICS
Like Hydroponics, Aeroponics is also a technique where plants are grown in a soil-less environment, but instead of placing the plants in a nutrient solution, the roots are sprayed with a nutrient solution based on the data of root chamber moisture levels [20]. Presently several crops have been successfully undergone experimental cultivation using the aeroponics technique [6].

C. SMART IOT BASED IRRIGATION CONTROL 1) FUZZY LOGIC ALGORITHMS
This is a class of algorithms based on a pre-defined set of rules and degree of membership calculations based upon sensor values [37]. Fuzzy algorithms are fast and smart adaptive algorithms and include error-control capabilities [61]. Prac-tical systems implemented using Fuzzy control algorithms for smart irrigation control have been developed by several researchers [17], [37]- [54], [61].

2) MAJORITY VOTE ALGORITHMS
In this type of algorithm, if the majority of the sensors report a reading greater or less than a pre-specified threshold value to trigger the irrigation process, then the irrigation is started.

3) TIME-CONTROLLED ALGORITHMS
In this type of algorithm, the actuators are activated at a particular time of the month and for the pre-specified duration. For this duration, they stay on as per pre-set or preprogrammed conditions by the farmer. This algorithm can sometimes use sensors as a feedback mechanism for adaptive actuator control.

4) EXPONENTIAL WEIGHT MOVING AVERAGE ALGORITHMS
In this type of algorithm, the immediate sensor reading is multiplied by the weighting factor and then added to an average of previous n readings, again multiplied by a second weighting factor to generate a moving average as per the equation given below: where, the coefficient value a is between 0 and 1, S c is the current sensor reading, and S n,avg is the average over previous n sample readings. This mechanism is resilient to instantaneous sensor noise.

5) PROPORTIONAL INTEGRAL, DERIVATIVE (PID) CONTROL ALGORITHMS
This is an advanced control loop feedback process, as shown in Fig. 4, in which a setpoint set by the farmer is tracked by the system, using a function of the error to follow it and achieve it. The setpoint may be a control process variable such as soil moisture, ambient temperature, or humidity. The output of the system response is provided in Fig. 5. It can be seen that a proportional controller achieves fast control action in reaching the setpoint but may result in an overshoot in the process. The integral controller achieves low steady-state error while the derivative controller reduces system overshoots. The use of a PID controller in a solar-based irrigation system has been discussed in [62].

6) NEURAL NETWORK ALGORITHMS
These belong to an advanced class of ML algorithms in which the system is trained using training data composed of sensor values and the level of irrigation required. Training requires setting system weights to make the output, a weighted linear sum of input sensor values. An activation function is used to model non-linearities in the system to avoid getting negative output values and cater for situations not covered by an exclusively linear response, as shown in Fig. 6. Once the system weights are tuned in the training stage, the testing stage uses these leaned weights to derive an optimum irrigation requirement based on the input sensor value. These algorithms require an immense amount of training data to be able to give superior results. As the number of layers increases in the neural networks, so does the training complexity, which sometimes requires expensive GPUs.
Recently, Al-Naji et al. [63] have developed a system using input RGB images to a pre-trained, feed-forward back propagation artificial neural network (ANN) and claimed high system accuracy in determining soil conditions and water requirement for irrigation.

V. USE OF UAVs IN SMART AGRICULTURE
UAVs are primarily used for crop monitoring through aerial images being acquired by the UAV and crop spraying owing to the ease offered by its aerial mobility and maneuverability. Velusamy et al. [44] provide an excellent taxonomy of the type of UAVs being used in precision agriculture being classified as fixed-wing, vertical take-off and landing (VTOL) based on their flight patterns and other architectural design such as the number of rotors, being classified as single rotor, multi-rotor (tri-copter, quad-copter, hexa-copter, octo-copter). These UAVs are equipped with multiple camera types: RGB, multi-spectral, and hyper-spectral. Different UAV architectures and mounted cameras may be suited for specialized applications. For example, fixed-wing may be better for broad surveillance and monitoring of the agriculture field, while VTOL-based multi-rotor design may be suited for pesticide spraying. Similarly, an RGB camera may be suited for low altitude UAV operation for close-range detection of different pests and plant diseases through real-time manual monitoring or DL-based automated monitoring, while hyper-spectral imagery is useful for high altitude UAV monitoring to monitor and assess the extent of plant disease or pest infestation spread across a large agriculture field through inspection of broad foliage. Often farmers will have to use one UAV type for monitoring of the field and another type of UAV for spraying purposes, as several factors come into play like UAV flight time, flying altitude, flight speed, camera, and other sensors' limitations and on-board hardware processing [64], [44], [65]. Jawad et al. [65] have implemented a practical solar-powered wireless power transfer (WPT) based drone field-landing platform for drone battery recharging; authors claim 97% battery saving and flight endurance time increase from 25 minutes to 850 minutes on the specific X525 drone used in their study, when this system is augmented with a specialized sleep-wake strategy of WSN sensor nodes communicating with the drone.
Crop Monitoring is enabled through special aerial images acquired by UAVs based on thermal, multi-band hyperspectral, multi-spectral, and light detection and ranging (LIDAR) technology. This allows farmers to identify crop conditions and plant diseases through the use of advanced image data analytics along with exact geolocation data through GPS measurements [23]. The use of UAVs in modern SAS makes use of thermal, LIDAR, hyper-spectral and multi-spectral imaging technologies together with advanced image processing software to solve a variety of farmers' issues.
LIDAR technology has been used to detect crop/plant volumes to predict expected yield and areas with problems. Since, LIDAR is still a very expensive technology, similar parameters such as normalized difference vegetation index (NDVI) [66] and crop water stress index (CWSI) [67] can be obtained using aerial images acquired using hyper-spectral and multi-spectral cameras. The NDVI and CWSI parameters can help identify crop biomass levels and provide predictive information such as crop diseases, water stress levels, nutrient deficiencies, and pest infestations. Yang et al. [29] designed a deep Convolutional Neural Network (CNN) to estimate rice grain yield using images acquired by the UAVs. This framework can make estimations at the ripening stage. Dyson et al. [31] integrated a radiometric index with terrain height images for segmenting crops and trees using highresolution UAV images. Nevavuori et al. [28] apply CNNs to crop yield prediction using RGB image analysis and NDVI data collected by the UAVs. An interesting combination of fusion of multi-spectral imaging and RGB images through UAVs in the detection of weeds was presented by Barrero and Perdomo [68]. Similarly, Lottes et al. [26] present a crop and weed classification system using a UAV-based application.
Crop spraying is made possible through UAVs after identifying problematic locations which require spraying of pesticides through GPS-enabled UAVs. Deployed systems have claimed UAV payload capacities of up to 2 Kg and flight endurance times of up to 15 minutes [25]. Interestingly, some researchers have preferred the use of hybrid systems using both ground-based nodes and UAVs to achieve greater efficiency. An example is a system proposed by Faical et al. [24] in which UAVs are guided through ground nodes having information about wind direction and speed. The UAVs then incorporate their own flight parameters (position, current velocity, and direction of travel) so the spraying process is optimally planned and executed inside targeted areas where it is most required. The commercial supplier DroneFly estimates that drones can spray fertilizer 40 to 60 times faster than doing so by hand [69].
The use of UAVs is not limited to conventional SAS, but they are now also being used for aquatic farming of plants, e.g., lotus and other aquatic organisms, e.g., fish [45], where human monitoring is exceedingly difficult.

VI. USE OF DEEP LEARNING IN SMART AGRICULTURE
Z. Unal et al. [25] have compiled a comprehensive bibliography on the recent trends of DL-based CNNs in the area of Smart Agriculture, as shown in Fig. 7. The main feature by which DL networks are distinguished from neural networks is their depth, and that feature makes them capable of discovering latent structures within unlabeled and unstructured data. DL is a computationally expensive algorithm and practically requires powerful GPUs for the proper training of algorithms using large training datasets. Ma et al. present an approach where training could be speeded up using multiple GPUs in parallel [70].

A. PLANT DISEASES
In order to detect plant diseases in crops, current research has been focusing on image-processing based DL systems instead of the conventional practice of using RNA analysis for timely identification of any crop diseases saving the farmers from huge economic losses. The most popular image-based DL framework, shown in Fig. 7, uses a multi-layer CNN framework that initially self-learns features present in the labeled training image data. These learned features are then fed to an ANN in the second stage. Neural weights, bias functions, and non-linear activation functions are used to make the classification accuracy high.
Gobalakrishnan et al. [27] present an exhaustive review of various systems development and in progress. Types of infectious diseases that can destroy the yield are fungal, bacterial, and viral. Similarly, types of non-infectious diseases result from non-ideal farming situations like improper soil acidity, mineral toxicities, and deficient nutrients. Efficient image processing-based ML systems have been developed by researchers [71]. Most notable of these include work by Mahlein et al. [72], who devised a technique based on the generation of spectral disease indices (SDIs) and spectral vegetation indices (SVIs) for sugar beet plants. Using hyper-spectral signatures, the plant diseases in sugar beet plants could be classified with accuracy in the range of greater than 85%. The advantage of this technique is that it is not affected by noise from other sources in the imaging process such as camera flash. Other techniques in the domain of image processing include genetic algorithms for image segmentation [73], pattern recognition techniques based on Gabor Transform [74], [75], CNN based DL frameworks [34]. Almost all of these claim accuracies of between 90 to 95%. Other specialized image-based techniques are developed keeping in view the detection of plant diseases in targeted crops like citrus fruits [76], mango trees [77], apples [38], and rice [78].

B. AGRICULTURAL ADVISORY SYSTEMS
Niranjan et al. [51] discuss a chat-bot based farmers' query answering system through which they can get specific answers to their queries. The system uses online web resources like documents as training data and Natural Language Processing to develop a DL-based Recurrent Neural Network (RNN) framework. The queries could range from crop types grown in particular geographical regions to the use of pesticides and fertilizers. Several ontology-based knowledge bases exist today, like ADANS [79] and AGRI-QAS [52], which can be queried using SPARQL queries.

C. EDAPHIC PARAMETERS ESTIMATION
Many researchers have devoted attention to the estimation of soil parameters [80], [81], which play a dominant role in other factors such as prevention of non-infectious diseases and increasing crop yield. Many soil-based factors are essential for maintaining healthy crops, such as moisture, air, temperature, mineral matter, organic matter, organisms, etc. While external climatic factors such as temperature, humidity, precipitation can only be controlled when crops are grown in an indoor environment, soil factors could be controlled when crops are grown in both indoor and open fields. Many studies using ML algorithms have investigated the soil properties to develop Digital Soil Maps [82]. Jia et al. [83] present the idea where comprehensive ML-based soil models could be applied to nearby land areas where less training data is available.

D. REAL-TIME PEST DETECTION
Pest detection has been investigated by some researchers. The most notable of these works is that of Brunelli et al. [38]. The researchers claim that although many ML algorithms exist for the detection of plant diseases using images of damaged crops, there is no provision for real-time pest threat detection. It is due to the fact that ML algorithms are run on powerful hardware, physically distant from the wireless sensor nodes collecting the data from many vantage points, so detection is done after the damage has been done. They give a framework for real-time detection of codling moth pest detection, using AI at edge solution. The solution comprises of readily available and moderately expensive hardware like Raspberry PI-3, Intel Movidius neural compute stick (NCS), and Intel Myriad X neural accelerator as a vision processing unit (VPU) for 21226 VOLUME 10, 2022  real-time pest detection after the training of the deep neural network (DNN). Using this solution, pest detection accuracy was greater than 90%.

E. PHENOTYPING
Plant phenotyping is an emerging science that links the impact on functional plant body development from the dynamic interaction between its genetic background and the physical world. Using image-based DL methods such as CNN [21], as shown in Fig. 7, this is possible, as this problem is not too different from other problems such as detection of plant diseases and pest detection. Uzal et al. [33] have developed a DL technique to predict the number of seeds per pod. Similarly, grapevine phenotyping using the DL technique has been implemented using only a consumer-grade camera is carried out by Milella et al. [84]. Feng et al. [85] have fused multi-spectral imaging with ML for plant salt stress phenotyping.

F. WEED DETECTION
Like the nuisance of pests and plant diseases, weeds are other unwanted plants growing within the agriculture field and reduce the productivity of the farming lands. Ferriera et al. [86] and Moshia and Newete [32] have devised CNN-based DL approaches for the detection of weeds in soybean and cornfield. Bah et al. [87] have done the same with images acquired via UAVs. Kounalakis et al. [22] have used the transfer learning approach for the detection of weeds through the DL algorithm. Partel et al. [88] have developed a smart sprayer for real-time weed management using NVIDIA GPUs and CNN. Chang and Lin [53] developed a computer vision-based, robotic watering, and weed detection system.

VII. CHALLENGES FOR SMART FARMING A. INTERNATIONAL REGULATIONS ON USE OF PESTICIDES -A CASE FOR ORGANIC FARMING
According to a recent report of the World Health Organization (WHO), around three million cases of pesticide poisoning occur globally each year, leading to nearly 220,000 deaths in developing countries, making the case of pesticidefree organic farming [89]. Restrictions have already been implemented by the European Union (EU) and other regulatory bodies on the use of harmful pesticides. For example, the EU has indicated a zero-tolerance policy on the use of VOLUME 10, 2022  Tricyclazole chemicals in rice [90]. This makes a case of organic farming inside contained indoor environments where the climate can be maintained closely without the threat of pests as encountered in agriculture farms in open fields.

B. REDUCTION OF ARABLE LAND AMID DROUGHT-LIKE SITUATIONS -A CASE FOR VERTICAL FARMING
Recently, we have seen several problems hampering the growth of agriculture. These problems include acute water shortages for proper irrigation of lands, reduction of farming lands due to rapid urbanization and industrialization, widespread crop diseases decreasing productivity, and harmful effects of pesticides/insecticides on human populations. Currently, researchers have begun giving a lot of attention to vertical farming techniques [5], [6], [15], [91], [92]. Verti-cal farming techniques solve all of the problems mentioned above by using water-based solutions and lightweight porous aggregates, e.g., coconut coir [16] instead of soil, giving the possibility of lightweight vertical stacking of plants/crops over a small area of land such as rooftops of buildings which have weight limitations. This also gives numerous other benefits such as the possibility of confining the vertical farming space in a green-house like an environment for controlled supply of water and nutrients using a variety of smart sensors connecting via IoT concepts [35], and increased crop productivity with minimal requirement of water over the small footprint. This is especially suitable for agro-based economies like the Middle East, Africa, and the Indian Subcontinent, which are facing increasingly drought-like situations and have a dire shortage of water for suitable irrigation.
By using the IoT technology for intelligent vertical farming, new types of crops, genetically superior crops, or yield of certain crops may be increased tremendously with minimal use of water and creation of an artificial climate if the natural climate is not favorable. Smart farming has huge upfront and operational costs to build up the required infrastructure. The farmers could meet the upfront costs through the availability of loans on easy installments by government bodies to support Smart Agriculture practices.
Similarly, Farmers may offset the operating costs through increased productivity than conventional farming methods. For example, farming inside closed spaces or earlier detection of crop diseases through advanced AI-based Agricultural Advisory systems may give timely prediction and protection from airborne and soil-borne crop diseases. Similarly, with smart irrigation strategies such as aeroponics, crops may grow up to 3 times faster [92]. There is also the potential possibility that food prices will again be lowered through the reduction of food-miles as smart indoor vertical farms will typically be located in urban locations such as rooftops or buildings or large warehouses.

D. GLOBAL CONSORTIUM FOR DEVELOPMENT OF SEAMLESS WIRELESS SENSOR TECHNOLOGIES AND DATA AGGREGATION FOCUSSED ON SMART AGRICULTURE USE
Currently, researchers have been able to piece together available wireless sensor technologies and platforms for the development of Smart Agriculture infrastructures. Almadani and Mostafa [93] have developed a SAS using multi-vendor devices using a data distribution service (DDS) middleware. However, there is a need for a consortium specially dedicated towards the development of Wireless sensor development for Smart Agriculture use cases. Currently, this need is felt at various levels. For example, LoRa EU radio frequencies are in the ISM bands of 868MHz and 433MHz. The 868MHz band is mainly used in urban areas; for agricultural applications, the 433MHz band can achieve better distances with less attenuation over distance. However, existing devices in the market utilize only the 868MHz band for the LoRa Mac layer and infrastructure [54]. Similarly, WSN nodes deployment in underground situations to study soil parameters needs dedicated efforts by the researchers to study the behavior of wireless waves propagation through the soil [94]. Similarly, the issues of the development of standard communication protocols for seamless integration of different types of sensors and advanced security mechanisms are required to protect information transfer in the fields to preserve the privacy of growers [9].
Similar to the problem of heterogenous communication protocols of wireless sensors, the data being collected by them at application layers can suffer from similar problems.
The diverse wireless sensor manufacturers use different data formats, which results in reduced syntactical and semantic interoperability among IoT environments. Sensor data can be encoded in binary, or represented in formats such as json, xml, text (e.g., csv), shapefile, or even proprietary formats. The heterogeneity of data types and formats can also affect the performance of a protocol employed for communicating the information. To cater to this problem Agricultural Industry Electronics Foundation (AEF) for tractors and agricultural machinery, which is very relevant in arable farming, has developed a standard ISO 11783 [95]- [97]. Similarly, AgroXML developed by the Association for Technologies and Structures in Agriculture (KTBL) [98]- [100].

E. HACKING ATTACKS ON SMART MACHINERY AND CYBER THREATS TO AGRO DATABASES
An imminent threat to smart farming will be from computer hackers who may attack smart self-driving farming machinery like smart tractors and UAVs. Self-driving cars already face several types of cyber threats like Denial-of-Service (DoS) and its sub-types (Sybil, Grayhole, Wormhole, Rushing attacks) [85]. IoT sensor node communication using several IEEE wireless communication standards, e.g., 802.11p used for autonomous cars and eventually autonomous farming machinery, are especially vulnerable to jamming/DoS attacks [110]- [112]. Similarly, DoS attacks on servers hosting smart agriculture historical data logs and other agricultural advisory systems will keep smart farmers ill-informed about timely measures against natural disasters (pest infestation). Robust counter-attacks techniques for these cyber threats will need to be present at the core (Servers) as well as the edge (Smart farming machinery and IoT field nodes) for the protection of smart farmers' interests.

VIII. FUTURE TRENDS FOR SMART FARMING A. PARADIGM SHIFT FROM CLOUD-BASED TO EDGE AI APPLICATIONS FOR SMART AGRICULTURE
As with other applications, AI-based SAS applications will undergo a paradigm shift in which edge devices like wireless sensors will become intelligent enough to make autonomous decisions independently without relying on powerful central servers running AI algorithms. With the recent advancements in electronics, embedded systems with increased processing power and memory, labeled as System on Chip (SoC) [27], [77], have the ability to provide a complete solution without reliance on other external entities. Smart AI-based embedded systems running computer vision algorithms have been developed using portable architectures as used for real-time pest detection by Brunelli et al. [38]. Similarly, Gia et al. [15] have developed an experimental framework in which CNN-based image compression is implemented inside the sensor node due to low data transmission rates of current WSN networks based on LoRa and NB-IoT. Thus, there will be a shift from cloud-computing solutions to edge-computing based solutions. These solutions will also be able to provide farmers with real-time threat detection and its timely prevention. Alsamhi et al. [101] propose using drones with B5G physical layer wireless technologies to perform federated learning and edge AI processing for smart environments. Intensive ML is possible over B5G networks due to its high data-rates and low latency [102].

B. OPEN SOURCE SMART AGRICULTURE SOLUTIONS FOR FARMERS
As there is a shift from cloud-based solutions to edgecomputing based solutions, there will also be a shift from proprietary to open-source based solutions from the farmers. Farmers may not be technologically equipped to program AI-based algorithms from scratch [30]. Many of the edge AIbased solutions of the future will already be using open source based AI-algorithms such as OpenCV libraries [103] for computer vision or other publicly available software frameworks. This will bring down the cost of SAS. Similarly, the farmer will not have to design new systems from scratch each time; consultancy firms will provide plug-and-play based hardware plus software solutions to farmers alongwith aftersales support. Open-source software solutions would also mean that farmers' measurements could be shared openly with other farmers enabling farmers to build a strong knowledge base.

C. HUGE YIELDS WILL NO LONGER BE DUE TO FARMERS' LABORIOUS EFFORTS RATHER HIS INTELLECTUAL ABILITIES
In the future, most of the farming equipment will be selfdriven, like smart cars [104]. These include smart farming tractors and UAVs using computer vision technologies to manage everything from sowing, irrigations, fertilizer application, weed removal, herbicides applications, and pest detection. In these situations, tech-savvy farmers could only survive amidst fierce competition through their knowledge of AI, big data analytics to fully understand the conditions of their crops. Many Smartphone software-based services owing to big leaps in Edge AI applications, will be available to identify crop conditions, e.g., conditions of fruits, detections of pests, etc.

D. RISE OF BLOCKCHAIN TECHNOLOGY IN SMART FARMING SECTOR TO COUNTER CYBER THREATS
Like other emerging areas in the IoT technology [104], Smart Agriculture will also be vulnerable to cyber-attacks. Hence, there would be a growing need to protect the farmer's privacy as well as the data of his crops if it will be shared for cloud applications. Future threats to SAS will be in the form of control systems intrusion, secure key management for encryption/decryption. There could also be a potential threat to physical Smart Agriculture equipment. For example, GPS spoofing attacks causing incorrect positioning of UAVs/drones working in the crops field or a smart tractor could be given incorrect waypoints leading to physical damage. In addition, the delay caused by long-distance signal transmission from IoT sensors deployed at great distances in the field also increases the risk of Sybil attacks in which malicious data is spread through virtual nodes [18]. Additionally, it is found that the threat was not only in the form of software but also hardware threats were equally likely. In one instance, it was found that high voltage pulses emitted from solar-based insecticidal lamps interfered with the Zig-Bee based communication of other IoT nodes. Future Open Source smart farming technologies would also warrant this free sharing of possibly compromised or corrupted information to other smart farmers. BlockChain technology would be used to secure the data received for onward transmission from wireless sensors to cloud servers.

E. FUTURE CROPS WILL NOT BE FARMERS CHOICE RATHER DICTATED BY DATA DRIVEN SMART FARMING
Currently, farmers mostly depend on a combination of guesswork, estimation, and past experience when deciding about the crop to be grown and the fertilizer that should be used for optimum crop yield. In the future, ML models will be used to study long-term climate patterns in particular geographical locations, and these will be a guide to farmers on which crops to target at particular sites in the future. Villa-Henriksen et al. [105] review the impact of data-driven decisions on smart farming and identify six different stages of data flow which are: sensing/perception, communication/transport/transfer, storage, processing, analytics, and actuation and display. The data processing/analytics stage may differ in position according to architecture, e.g., fog/edge computing or cloud computing. Data processing/analytics typically has an AI-based prediction framework and forms the heart of data-driven agriculture. Chakrabarty et al. [113] have studied the climate patterns and other man-made factors such as fertilizer use in parts of Bangladesh and its effects on crop yields. These data points are used as input to a DNN for prediction framework. Similarly, Jin et al. [114] have studied a climate predictor that can predict weather conditions for the next 24 hours. Thus, in the future, crop production decisions will be heavily guided by the output of advanced predictor systems fed with climate and crop yield data from the past.

F. 5G WIRELESS TECHNOLOGIES WILL BE USED FOR ALWAYS CONNECTED SMART FARMING MACHINERY
It is increasingly evident that 5G wireless technologies [104] will dominate smart agriculture. This is because of the advantages of 5G technologies, such as higher data-rates, larger coverage areas, and adaptability to heterogeneous communication environments. These are essential for real-time crop monitoring in large farmlands [106]. 5G [104] also provides excellent support for the vehicle-to-vehicle (V2V) and vehicle-to-infrastructure (V2I) due to its low latency and new frequency bands, which will be the requirement in the future for always connected farming machinery like smart tractors and swarms of smart drones [107].

G. RISE OF GREEN(ER) IoT
Future IoT networks, including those deployed for SAS, will be energy efficient. Almalki

IX. CONCLUSION
A comprehensive review of existing research literature and recent state-of-the-art developments in the area of Smart Agriculture Systems was presented. The significant contributions of this paper are: 1) A detailed tutorial on the available advancements in the field of SAS through IoT technologies and AI techniques; 2) A critical review of these two available technologies and challenges in their widespread deployment; and 3) An in-depth discussion about the future trends including both technological and social when SASs will be widely adopted by the farmers globally.
In this paper, we first discussed the importance of smart agriculture practices with the growing gaps in global food demand versus current food generation, the growing shortage of arable land for agriculture, stricter regulations by International organizations on the use of toxic pesticides/herbicides, and global shortage of water resources for irrigation purpose. Clearly, all of the challenges cannot be met through traditional agricultural practices.
We then discussed in detail the current hardware building blocks of the smart agriculture system, which is primarily based upon a large number of IoT nodes deployed in the field with suitable sensors to monitor the current situations of crops. The monitored parameters are transmitted wirelessly through various available technologies for the farmer to take remedial actions manually or automatically through pre-programmed instructions to actuators. We discuss the automated control algorithms and strategies along with their advantages and limitations for one particularly important application, smart irrigation, in view of recently depleting water resources.
We also discussed the currently available and implemented hardware, wireless communications technologies, and software aspects of the smart agriculture systems in terms of implementation with their use-cases and limitations. These use-cases will define their potential roles in newer Smart Agriculture standards and specifications as they evolve.
Next, we presented a detailed insight into the emerging trends of applications of AI and DL in smart agriculture and the architectural building blocks for smart agriculture systems. We discussed at length practical prototype implementations and their effectiveness for applications in automated plant disease or pest detection. We also briefly discussed the impact of these technologies on future advancements in smart agriculture, such as the use of UAV/drones and other smart farming machinery.
Finally, we discussed the challenges of smart agriculture systems to support the paradigm shift of adopting the latest technological advancements for mainstream systems. The foremost is the social implication of these technological advancements on traditional farming methods. These advanced techniques may redefine the way the farmers will practice agriculture in the years to come. Farmers will have to be tech-savvy to keep themselves abreast with these technological advancements, and traditional farming practices will become obsolete and impractical. Other technical challenges include standardization aspects of commercially available smart agriculture systems solutions to make them compatible across several manufacturers, make them backward compatible and lower costs associated with the wide adoption of smart agriculture systems.
In the end, we also discussed the future directions of advancement in smart agriculture systems and the technological difficulties and challenges they will bring with them. These future directions primarily focus on bringing more AI-based solutions towards edge devices from the core for real-time threat detection and quick remedial actions, making the availability of more open-source, customizable solutions for farmers, and incorporating measures for cyber security. He is currently an Associate Professor with the Department of Electrical Engineering, Faculty of Engineering, Islamic University of Madinah, Madinah, Saudi Arabia. He has authored and coauthored several journals and IEEE proceeding publications. His current research interests include next-generation of millimeter-wave (mm-wave) radio-over-fiber, mm-wave, and THz signal generation mode-locked lasers, metamaterials and metasurfaces, antennas/antenna array design and characterization for the Wi-Fi/IoT/UAVs/FANETs/5G systems, and mm-wave frequency bands. He is an active reviewer of many reputed IEEE journals and letters.
QAZI UMAR FAROOQ received the master's and Ph.D. degrees in geotechnical engineering from The University of Tokyo, Japan. He is currently working as an Assistant Professor and a Program Coordinator at the Department of Civil Engineering, Islamic University of Madinah, Saudi Arabia. He is also working on the implementation of digital technologies in civil and environmental engineering. He has been involved in research, teaching, and consultancy for more than ten years. His primary area of research is geotechnical and geo-environmental engineering, with a particular focus on water environment and energy-related issues. His current research interests include shallow geothermal systems, heat transfer in rocks and soils, multi-phase fluid flow problems, and geo-environmental issues, such as water conservation, green energy, and soil contamination. He is registered as a Professional Engineer (civil) at the Pakistan Engineering Council. VOLUME 10, 2022