Artificial intelligence applications in the agriculture 4.0 Aplicações de inteligência artificial na era da agricultura 4.0

- The usage of digital data is one of the main characteristics of the Agriculture 4.0 era. Different devices and sensors may be used to capture a variety of types of data that enable the development of applications of computer vision, acoustic events, and data processing. These applications are useful for monitoring, understanding, and predicting many attributes of agricultural chain production with the objective of assisting farmers in the decision-making process. In a scenario of increasing obligation for sustainable usage of natural resources and an increase in production rates to assure a food security situation in the world, there is a high demand for improvements at any stage of agricultural processes. This paper aims to contribute to further research on artificial intelligence in the agricultural context, listing sample practical AI scenarios, including those that the Eldorado Research Institute has contributed. Throughout this paper, different applications of AI are discussed, highlighting some characteristics, advantages, disadvantages, and results to provide an overview of the different technologies that can be applied in agriculture. Furthermore, we presented the main challenges of popularizing the use of AI-based systems, some possible approaches to reduce the difficulties, and a view of the next most promising technologies in conjunction with AI.


INTRODUCTION
The impact of artificial intelligence (AI) in business and in the agricultural value chain has been through a variety of phases since the term was coined during the Dartmouth Workshop in 1955, including long winters of reduced funding for the research field joined by low expectancy of any economic returns, reaching today's high-expectation juncture. The very optimistic current phase is supported by multiple factors that enable large-scale practical implementations of the concept, such as virtual voice assistants and image recognition applications embedded in handheld devices.
Modern AI is the term coined for today's implementation of such systems (RUSSELL et al., 2009), and the circumstances that enabled and made possible the arrival of the current optimistic phase were the exponential growth and accessibility to computational power, the high availability of good quality digital data, and finally the whole ecosystem around public domain libraries and community collaboration around the research field.
This paper aims to contribute to further research on AI in the agricultural context, listing sample practical AI scenarios where the Eldorado Research Institute has contributed, with sections that focus on the three main areas of applied AI in the agricultural context being computer vision, acoustic event detection, and data processing, closing with the conclusion section, which summarizes some of the main ideas, and pointing toward possible future applications of AI in the field of agriculture.
This publication does not intend to cover the entire range of AI practical applications in agriculture or cover in depth the AI frontier in the computer science field. This publication aspires to bring fundamentals of AI in a structured form to support evaluation of the applied concepts in practical agricultural context, laying ground for future work by bringing expert analysis of successful implementations of the concept in the field of AI applied agriculture.
The current strategies in pursuit of deploying AI solutions to practical fields, such as agriculture, can be classified into two main fronts. The first is a need to deploy a technological agent to act in a human manner when handling decision-making in complex processes. The second is having an agent that surpasses humans in the capability to execute a certain task, not only in timeliness but also with more accuracy. Currently, on the first front, we have AI acting mostly as a perception agent, matching our human capability of detecting and classifying objects and other agents in a short period, which is well exemplified in urban self-driving vehicles. The ability to enter the second front and outperform humans is where the research field expends most of its efforts currently, and it is mostly related to predictions based on perception, where the selfdriving vehicles would be able to avoid collision events, outperforming humans in the most difficult scenarios. Reaching mature general-purpose AI systems is the challenge to today's focused single-purposed solutions, also referred to as narrow AI.
The computer science (CS) implementation of AI has a history of constant evolution in approaches and techniques. The latest shift in the field came with a move from algorithms and programmed routines, which allowed systems to automate and solve problems based on specific domain knowledge embedded by domain experts as a set of rules and algorithms, to the current AI techniques, which are covered in a practical way in this publication. The conventional CS classes of solutions can certainly act as intelligent systems that emulate human intelligence, but the specialization to one applicable domain reduces the scalability and positions it very close to automation solutions. At the domain scale, the limitations of the conventional approach become clearer, and this complexity is the main reason why AI research is considered crucial to many areas, such as self-driving vehicles, where realworld scenarios cannot be entirely modeled and have been one of the main successful deployments of neural networks (NNs).

COMPUTER VISION
In a scenario of increasing obligation for sustainable usage of natural resources and an increase in production rates to assure a food security situation in the world, there is a high demand for improvements at any stage of agricultural processes (CHARANIA; LI, 2020). The use of sophisticated technologies aided by AI and computer vision are considered important factors for the growing adoption of precision agriculture and entering the era of Agriculture 4.0 (LU; YOUNG, 2020).
One of the major areas of AI applications is computer vision. The aim of this area is to create algorithms that help, simulate, and even overcome human decisions based on unstructured data that can be interpreted as images. A variety of devices and sensors can be used to obtain this type of data, such as cameras, smartphones, sensors for specific bands of the electromagnetic spectrum (e.g., infrared), etc. These sensors can be attached to different platforms, whether they are fixed to structures, such as supports, stands, pedestals, posts, and metallic frames, or they are mobile, such as people, cars, tractors, unmanned aerial vehicles (UAVs) (e.g., drones), and satellites. Artificial intelligence applications in the agriculture 4.0 One of the techniques that boosted the state of the art of computer vision is deep learning (LECUN et al., 2015). Most methods developed to solve problems using images and videos are based on convolutional neural networks (CNNs). The great advantage of using deep learning is the reduced need for feature engineering since deep neural networks are in charge of extracting the problem's intrinsic attributes, such as shape, color, and texture information. In traditional machine learning (ML) methods, the development and usage of handcrafted attributes can affect the entire performance of the system. Moreover, specialists need to create rules, methods, and ways of highlighting and extracting the characteristics intrinsic to the problem. The methods based on handcrafted features are less robust to changes in the datasets, noise, and variability of data (KAMILARIS; PRENAFETA-BOLDÚ, 2018).
The impact of this technology in the context of agriculture 4.0 is the possibility to automate and optimize a multitude of agricultural processes and products, which could depend on laboratory procedures, highly specialized professional participation, a large number of employees or equipment, and laborious, stressful, or risky procedures for people. In general, to ensure a good adoption by the farmers, the systems must have some characteristics, such as interoperability, scalability, accessibility, and usability; however, it is still a challenge for most of the existing applications (ZHAI et al., 2020). The following are some examples of computer vision uses in different areas of the agricultural production chain.
For a comprehensive and large-scale view of the cultivated land area, one of the most common image formats is obtained by remote sensing, which is aerial imaging. This type of image can be obtained by satellites, airplanes, and drones; the main advantages are collecting data in a nondestructive way and systematically obtaining information about large areas (KAMILARIS; PRENAFETA-BOLDÚ, 2018). Currently, drones are gaining popularity due to the versatility and control they provide, as well as the increase in the offer of all related equipment, such as cameras, sensors, and software, and furthermore, the increase in autonomy and load capacity. In general, large numbers of images are produced, and the evaluation carried out by specialists can be laborious, which can lead to inattention and error. Thus, the use of algorithms and AI to conduct pattern recognition in the data are essential for this type of task. The main applications are directed towards crop and livestock monitoring. In the work of Barbedo (2019), a review on the use of drones in different applications includes classification of vegetation, detection and quantification of water stress, diseases, pests, and nutritional deficiency. In addition to monitoring, this type of information can integrate crop forecasts, biomass estimation, and canopy cover models. The images used for these applications can be from the visible RGB spectrum region, from other bands of the spectrum (e.g., near infrared), or the combination of them in a vegetation index format. Most of the papers cited use traditional mathematical modeling techniques, such as linear and nonlinear regression, and the use of traditional ML techniques, such as support vector machines (SVMs) and random forest. The most recent techniques, such as deep neural networks (DNNs) and convolutional neural networks, appear in few studies but are the most promising since they are state-of-the-art techniques for computer vision systems (LECUN et al., 2015).
Satellite images continue to be important in several applications in precision agriculture, such as water stress, biomass, diseases, and crop estimation, using both hyperspectral images and vegetation indices (SISHODIA et al., 2020). One of the most common classification tasks is land usage and land cover, which can consider different types and scales of images and present good results both with traditional ML techniques and deep learning (CHENG et al., 2017;MA et al., 2019).
One of the main aspects of agriculture 4.0 is the use of technology directly in the field, which is available directly to the farmer. The use of mobile devices, such as smartphones and cameras, has increased the capacity for monitoring and data collection. An application example is the recognition of plant diseases through images. Some works address this theme for a specific crop, such as wheat (JOHANNES et al., 2017), while others more generally target different crops and diseases, such as Mohanty et al. (2016), with 14 cultures and 26 diseases, and Ferentinos (2018), with 25 diseases and 58 pairs of [culture, disease]. There are differences between the works, mainly in the capture procedure and in the quantity of the images; however, in all the works, an accuracy above 90% was reported. For the detection and recognition of pests, a review by Barbedo (2020) considers three main situations: images of traps, fields, or controlled environments. Traps are the most widely adopted form of pest monitoring and, if performed correctly, can sample the insect population in a large area of interest. The use of a variety of image processing methods, traditional ML, and deep learning has been observed. The reported performance also varies, mainly given the variety of insect species and environment; however, the majority prevails with an accuracy over 80%. The use of faster, automatic, and more accurate methods, both for the detection of diseases and pests, can make the process of maintaining the crop more efficient, especially when integrated with an early warning system.
The use of robots in the field (agrobots) can be seen as futuristic by more traditional farmers; however, agricultural machines already have a very high level of automation, including machines that do not need a driver (KAYACAN et al., 2015). In addition to selfdriving, some machines have an automatic harvesting and fruit counting system based on computer vision, for example, for apple harvesting in a more controlled environment using RGBD Kinect V2 sensors and two Faster R-CNN models (FU et al., 2020) and strawberry harvesting using traditional image processing algorithms (QINGCHUN et al., 2012). In the review by Pereira et al. (2017), little or no use of deep learning methods was observed, but a diversity of traditional methods of image processing and ML, such as extracting texture attributes from different color spaces (e.g., HSV, L * a * b), was observed mainly for removing background and leaves for the segmentation of the fruits of interest. For better performance in counting fruits and automatic harvesting, the review by Tang et al. (2020) takes into account depth estimation methods or depth measurement sensors. Another important application for autonomous machines is the automatic detection of weeds, which, in general, uses traditional methods of image processing and ML. Despite promising results with the use of deep learning, the high cost of creating a database is a barrier to the commercial development of solutions (WANG et al., 2019). It is worth mentioning that these devices have limited computational capacity and need real-time responses; that is, the algorithms must be optimized for this environment.
There are already some initiatives for the development and commercialization of systems that seek to automate agricultural processes (CHARANIA; LI, 2020). The Eldorado Research Institute develops solutions for agriculture. For example, a solution for the recognition of citrus plant diseases and a solution for the recognition of pests and insects in adhesive traps using small single board computers have already been developed. Despite the advance of connectivity in the field, many applications can be developed without this dependence, making custom solutions more appropriate to the reality and needs of the farmer.
There are still major challenges in the area of computer vision applied to agriculture, mainly the existence of publicly available databases for the development and faster evaluation of applications; however, there are some initiatives, such as those listed by Lu and Young (2020) for different tasks, by Chiu et al. (2020) for aerial images, and by Mohanty et al. (2016) for plant diseases. The main problem of most datasets is that they are for a very specific problem and do not cover most of the real situations of farmers around the world. Thus, a bottleneck for the development of solutions based on computer vision is the creation of a database to train algorithms, since it can be an expensive and overwhelming activity through the participation of one or more experts. The collection, verification, annotation, and preparation of data can use most of the project time and effort. There are different techniques that seek to minimize the use of annotated data, such as data augmentation, which makes minor changes to the original images (SHORTEN; KHOSHGOFTAAR, 2019). The use of synthetic data is becoming more popular, but the difference between real and synthetic data can be challenging. A potential technique to overcome this challenge is called domain adaptation (WANG; DENG, 2018; WILSON; COOK, 2020). The use of generative adversarial network (GAN) models is gaining much attention and producing surprising results in other areas (ISOLA et al., 2018), with one of the applications being to generate more realistic training samples, minimizing the difference between synthetic and real data (HOFFMAN et al., 2018).

ACOUSTIC EVENT DETECTION
Acoustic events are part of our daily life and can help to retrieve valuable information about the environment. These events have been used for different purposes in speech signal processing, such as sound event detection and classification (MESAROS et al., 2017), voice activity detection (LUO; MESGARANI, 2019), speaker identification, and source separation (TAN; DEHAK, 2020). The acoustic signals allow sensing without interfering with the environment, which can be valuable for nonintrusive monitoring. In the context of Agriculture 4.0, field monitoring and sensing are extremely important, and acoustic events can play an important role in pest detection, activity monitoring, and population estimation, leading to a large gain in production.
Acoustic feature engineering focuses on extracting features from raw acoustic signals to characterize the signal according to its properties in the time and frequency domains. Hand-engineered features have been studied over the past years combined with conventional signal processing and ML-based methods. A well-engineered set of features often leads to better performance and usually requires most part of the development effort when designing a d ML solution. To make learning algorithms less dependent on hand-crafted features, DL models have been proposed to minimize the dependency and thereby give better performance in different acoustic applications (LATIF et al., 2020). Artificial intelligence applications in the agriculture 4.0 Several ML/DL systems have been designed to improve the automatic detection of pests in the context of precision agriculture. These techniques are valuable for the early detection and monitoring of aggressive pests. The acoustic activity of insects can be isolated from other environmental sounds through the analysis of features in time and frequency domains. The automatic detection of the red palm weevil (RPW) in palm trees has been proposed based on acoustic events (PINHAS et al., 2008). The RPW bore deep into palm crowns and trunks and was not visible until the palm was nearly dead. The acoustic signals of RPW can be recorded from the infested palms using off-the-shelf recording devices (PINHAS et al., 2008). The authors applied vector quantization and Gaussian mixture models (GMMs), achieving detection ratios close to 98.9%. A low-cost, real-time platform for the acoustic detection of cicadas in plantations has been proposed by analyzing their acoustic patterns (ESCOLA et al., 2020). The proposed method is based on the bark scale (BS), wavelet-packet transform (WPT), paraconsistent feature engineering (PFE) for feature extraction, and support vector machines (SVMs) for classification. The authors reached an accuracy of 96.41% for differentiating cicadas and background noise. A sound parameterization technique has been designed specifically for the identification and classification of acoustic signals of insects using Mel Frequency Cepstral Coefficients (MFCC) and Linear Frequency Cepstral Coefficients (LFCC) (NODA et al., 2019). SVM and random forest (RF) algorithms were evaluated for classification of the insect sounds, which reached a success rate of 98.07% on the 343 insect species dataset.
Activity monitoring and population estimation play an important role in the context of precision agriculture. A monitoring and classification of bee swarm activity was proposed based on acoustic event analysis (ZGANK, 2019). The bee colony typically produces four characteristic sounds: flying, fanning (worker bees trying to cool the hive with ventilation), hissing (defense reaction to potential outside threats), and piping (produced by the queen bee as a challenge signal to any new queen bee in a hive). The bee's acoustic signal shows a distinctive energy distribution over the spectral frequency range, which indicates the possibility of acoustically separating the sounds (ZGANK, 2019). The author applied the MFCC and Hidden Markov Models (HMM) for acoustic modeling and reached a classification accuracy of 80.89%. Accurate monitoring of livestock grazing behavior is important to assure the sustainable and efficient use of grazing resources (CHELOTTI et al., 2020). Thus, a real-time monitoring approach to measuring feeding behavior was proposed based on acoustic events (CHELOTTI et al., 2020). The method is based on the recognition of jaw movements from a small microphone placed on the cattle head. A multilayer perceptron and a decision tree were evaluated for the detection of rumination and grazing sounds. The MLP showed the best results, reaching F1-scores higher than 0.75 for both sound activities.
The good performance and often low computational cost make acoustic signals a highly feasible method for detection and monitoring systems in the context of Agriculture 4.0. The use of ML/ DL algorithms combined with acoustic signals will allow the development of portable devices for remote monitoring of animal activities and aggressive insect pests. Thus, this allows early detection and leads to larger production gains.

DATA PROCESSING
According to Maneta et al. (2009), agriculture represents 70% of the water consumption of Brazil. Understanding how evapotranspiration works is one of the ways to reduce this problem. Different methods to quantify evapotranspiration use several measurements at the site, such as temperature, solar radiation, wind speed, and relative humidity; however, these values are not available for all regions (ALTHOFF et al., 2018).
Models of ML have the ability to generalize; in that case, this type of model can efficiently predict decent results. Recent research (ALTHOFF et al., 2018) compares how satisfactory the AI models are in contrast to the Penman Monteith method, which has been the standard model for evapotranspiration, and the results show that even with a small amount of data, the ML algorithm exhibited smaller errors than the other methods that are settled in the literature.
The data used for the analysis were retrieved from 11 meteorological stations located northwest of Minas Gerais state in Brazil between 1987 and 2016. The data used to predict the model contains minimum, maximum, and average temperature, relative humidity, solar radiation, and wind speed. Finally, yet importantly, the evapotranspiration used for this study is from one hypothetical crop.
Several ML models were applied to the dataset and evaluated, the most relevant ones being the Bayesian regularized neural network (BRNN), random forest (RF), and support vector machines (SCMs). The evaluation process examined the mean absolute error (MAE), root mean squared error (RMSE), and coefficient of determination (r 2 ).
The results of the experiment showed that the BRNN for all combinations of entry has the most precise results. This result was achieved even when the data were limited, showing robustness of the model, even when compared to models in the literature. Therefore, this model can aid in the estimation of evapotranspiration for irrigation and water balance.
Livestock production is undergoing a wave of digitalization that is driven by market demands, such as traceability, and applying AI to such an expanding data availability environment is one of the most promising short-term practical AI successes. In the egg-producing market, traceability is required to detect and isolate problems shown in productivity that are caused by diseases or any other factors (LONG; WILCOX, 2011).
Any disruptor to productivity has less impact when detected earlier, which is the challenge faced by AI solutions in the field, since spreading to other animals can cause serious damage and economic issues to the producers. et al. (2016) used a support vector machine (SVM) model to try to prevent this type of problem. Their results show that their model was able to achieve an accuracy of 0.9854, a specificity of 0.9865, a sensitivity of 0.9333, and a positive predictive value of 0.6135; this result was obtained one day in advance.

Ramirez-Morales
The data collected for this experiment were collected from 2008 to 2014 and are already labeled. The input used was created using one window size multiple of seven days. According to Ramirez-Morales et al. (2016), this multiple could be related to the weekly cyclical variations. Features, such as age of birds, production over days minus seven previous days, and so on were used to achieve the article goal.
The most important attribute for the SVM model is the kernel. The authors test several kernels to find which one is the best for the problem they are trying to solve. To select the best kernel, the accuracy, specificity, sensitivity, and positive predictive value were analyzed, and the kernel with the best performance was the radial basis function (RBF). Another important attribute was also optimized: the sigma, and the best sigma was 5.
The results showed with this model could help producers reduce their economic losses because they would have one day of advance notice to act before the disease spread.
Groundwater level changes are another important research field in which AI is being applied to predict and monitor natural resources, overcoming historical models. According to Sahoo et al. (2017), groundwater dynamics are determined by several factors, such as physical hydrogeological properties, climate variability, and pumping. The challenge is to predict how changes in one system variable will impact other variables that determine the groundwater quantity and quality.
The study uses groundwater level data for 33 years collected in the USA over the years 1980 and 2012 from the USGS National Water Information System, Standardized Pacific Decadal Oscillation (PDO) index, North Atlantic Oscillation (NAO) index, and Multivariate El Nino Southern Oscillation (ENSO) index as potential predictor variables.
Variable preprocessing is a very important step in any machine-learning problem. The article solved the preprocessing step using a three-step pipeline: singular spectrum analysis (SSA), genetic algorithm, and mutual information. SSA, as defined by VAUTARD et al. (1992), is a form of principal component analysis (PCA) used to detect periodic signals in time series data with noisy data inside.
In Sahoo et al. (2017), they used a multilayer perceptron (MLP) network to predict the groundwater level changes over time. MLP is a feed forward neural network with at least one hidden layer, each layer is fully connected with the subjacent layer, and the inputs are propagated through the network in a forward direction. MLP networks allow the approximation of any function (FACELI et al., 2017).
As a conclusion for Sahoo et al. (2017), they highlight the importance of data preprocessing, comparing the model with raw data and the model feed with preprocessed data, and the use of MLP network and conventional regression models. The MLP network fed with preprocessed data shows a better accuracy and performance than another tested method. Additionally, they highlight the importance of climate indices in groundwater level prediction for agriculture.

CONCLUSIONS
1. We introduce several AI applications for agriculture mainly in three different contexts: computer vision, acoustic event processing, and data processing. Most applications are still at a proof-of-concept maturity level, while others are highly specialized for a specific situation or domain; therefore, many desired characteristics, such as scalability, accessibility, usability, etc., are not fulfilled. There are several challenges to increasing the adoption of systems with AI, but many of them could be alleviated with more opportunities to explore real problems, collect data with different sensors, interact with experienced experts, Artificial intelligence applications in the agriculture 4.0 and receive feedback from users on how to improve the systems. Publicly available datasets of agricultural data could increase interest in applying successful techniques from different domains to agricultural problems, reduce the effort to collect and annotate data, and enable the development and evaluation of algorithms; 2. Traditional supervised ML algorithms, such as SVMs or small neural networks, are very popular, but with the increasing amount of available data and the variety of situations that a model has to deal with, depending on the application, the handcrafted features limit the performance of algorithms. The development of deep learning-based solutions is recommended, mainly for computer vision problems. However, image processing methods or traditional mathematical modeling techniques could give reliable and fast responses in a more controlled environment or limited devices; 3. Future impacts of AI in the field of agriculture should become more systemic as specialized solutions start to integrate across the value chain. The tendency of increased digitalization is the fuel for AI solutions; with more available digital data, AI models should be able to grow in maturity and start gaining traction across traditional areas in the field; 4. From the practical experience gained in such technological projects, the Eldorado Research Institute believes that the challenges in the near future are concentrated on two fronts: The first is explainable AI (YI et al., 2018), which should enable the automation of traditional processes by adding transparency to the reasoning process, gaining trust of the stakeholders. The second front is the great challenge faced in implementing distributed AI considering the complexity of the agricultural value chain. These fronts are high impact enablers for broader AI solutions that should be available in the near future.