scieee AI-readable full text Open interactive document viewer

A System Using Artificial Intelligence to Detect and Scare Bird Flocks in the Protection of Ripening Fruit

Marcoň, Petr; Janoušek, Jiří; Pokorný, Josef; Novotný, Josef; Vlachová Hutová, Eliška; Širůčková, Anna; Čáp, Martin; Lázničková, Jana; Kadlec, Radim; Raichl, Petr; Dohnal, Přemysl; Steinbauer, Miloslav; Gescheidtová, Eva

Abstract

Flocks of birds may cause major damage to fruit crops in the ripening phase. This problem is addressed by various methods for bird scaring; in many cases, however, the birds become accustomed to the distraction, and the applied scaring procedure loses its purpose. To help eliminate the difficulty, we present a system to detect flocks and to trigger an actuator that will scare the objects only when a flock passes through the monitored space. The actual detection is performed with artificial intelligence utilizing a convolutional neural network. Before teaching the network, we employed videocameras and a differential algorithm to detect all items moving in the vineyard. Such objects revealed in the images were labeled and then used in training, testing, and validating the network. The assessment of the detection algorithm required evaluating the parameters precision, recall, and F1 score. In terms of function, the algorithm is implemented in a module consisting of a microcomputer and a connected videocamera. When a flock is detected, the microcontroller will generate a signal to be wirelessly transmitted to the module, whose task is to trigger the scaring actuator.

Full text

sensors Article A System Using Artificial Intelligence to Detect and Scare Bird Flocks in the Protection of Ripening Fruit Petr Marcoˇn * , JiˇríJanoušek , Josef Pokorný, Josef Novotný, Eliška VlachováHutová, Anna Šir˚uˇcková, Martin ˇ Cáp, Jana Lázniˇcková, Radim Kadlec, Petr Raichl, Pˇremysl Dohnal, Miloslav Steinbauer and Eva Gescheidtová   Citation: Marcoˇn, P.; Janoušek, J.; Pokorný, J.; Novotný, J.; Hutová, E.V.; Šir˚uˇcková, A.; ˇ Cáp, M.; Lázniˇcková, J.; Kadlec, R.; Raichl, P.; et al. A System Using Artificial Intelligence to Detect and Scare Bird Flocks in the Protection of Ripening Fruit. Sensors 2021,21, 4244. https://doi.org/ 10.3390/s21124244 Academic Editor: Paolo Spagnolo Received: 28 May 2021 Accepted: 18 June 2021 Published: 21 June 2021 Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations. Copyright: © 2021 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https:// creativecommons.org/licenses/by/ 4.0/). Faculty of Electrical Engineering and Communication, Brno University of Technology, 61600 Brno, Czech Republic; [email protected] (J.J.); [email protected] (J.P.); [email protected] (J.N.); [email protected] (E.V.H.); [email protected] (A.Š.); [email protected] (M. ˇ C.); [email protected] (J.L.); [email protected] (R.K.); [email protected] (P.R.); [email protected] (P.D.); [email protected].cz (M.S.); [email protected].cz (E.G.) *Correspondence: mar[email protected] Abstract: Flocks of birds may cause major damage to fruit crops in the ripening phase. This problem is addressed by various methods for bird scaring; in many cases, however, the birds become accustomed to the distraction, and the applied scaring procedure loses its purpose. To help eliminate the difficulty, we present a system to detect flocks and to trigger an actuator that will scare the objects only when a flock passes through the monitored space. The actual detection is performed with artificial intelligence utilizing a convolutional neural network. Before teaching the network, we employed videocameras and a differential algorithm to detect all items moving in the vineyard. Such objects revealed in the images were labeled and then used in training, testing, and validating the network. The assessment of the detection algorithm required evaluating the parameters precision, recall, and F1 score. In terms of function, the algorithm is implemented in a module consisting of a microcomputer and a connected videocamera. When a flock is detected, the microcontroller will generate a signal to be wirelessly transmitted to the module, whose task is to trigger the scaring actuator. Keywords: bird detection; convolutional neural network; deterrent system; flocks of birds; fruit; fruit crops; starlings 1. Introduction The protection of fruit crops from raiding flocks of birds constitutes a major problem for fruit farmers and winegrowers. One of the most prominent pests in this respect is the European starling (Sturnus vulgaris), whose immense flocks feeding on fruit in large orchards and vineyards are perfectly capable of ruining the entire harvest [ 1 ]. Diverse measures are being taken to prevent this beautiful passerine from attacking fruit fields and wine-growing areas, with the relevant efforts and applicable techniques usually conceived or designed to be physically harmless to the bird. The scaring methods involve mechanical, optical, and acoustic approaches, in addition to utilizing natural enemies. 1.1. Mechanical Techniques The set of mechanical instruments, options, and procedures includes, first of all, nets stretched over the entire orchard or vineyard or wrapped around the individual plants. The main disadvantages of this option rest in the comparatively high purchase cost, rather short service life, and unfavorable ecological impact; moreover, the installation is very complicated, and the labor time to install and remove the nets amounts to approximately 60 h ha−1. Another type of scaring within this group relies on various scarecrows and kites. The former embody a centuries-old, differently configurable tool and can be combined Sensors 2021,21, 4244. https://doi.org/10.3390/s21124244 https://www.mdpi.com/journal/sensors Sensors 2021,21, 4244 2 of 16 in various ways with the latter, which imitate birds of prey such as the eagle, falcon, and sparrowhawk. The natural enemies of starlings, blackbirds, and magpies are, for example, larger and more aggressive birds, including eagles, owls, eagle owls, buzzards, and falcons; respected and feared by the pests, these animals have been traditionally used as models for realistic kites. In terms of the actual shape and placement, such models have proved most effective when delivered in 3D and mounted visibly in the vicinity of the tree(s). Yet another–interesting and modern–alternative consists in using unmanned aerial vehicles (UAVs, drones) to deter a flock that has appeared above the monitored area, whose size must be selected appropriately to the parameters of the drone [ 2 , 3 ]. This category comprises also robotic birds, or robirds [ 4 ]; their applicability, however, is markedly limited by the maximum flight time, relevant legislation, particular control and battery charging requirements, and other prominent factors. 1.2. Acoustic Methods In sizeable orchards and vineyards, a hunter’s services are usually of great benefit. The hunter shoots blank cartridges to scare the flock away, the aim being not to kill the birds. The central disadvantage is that the armed guard can watch over only a part of the total area and has to stay active and alert all day, resulting in major financial costs. Another option consists in utilizing sonic bird repellers, which emit emulated or authentic sounds of raptors or frightened starlings signaling their mates to avoid a dangerous location. A closely related procedure exploits sounds at frequencies audible and unpleasant to the birds [ 5 ]. This principle finds use in, for instance, narrowly directional ultrasonic repellers. Such devices, although often very effective, nevertheless provide optimum performance especially in small, fully or partially enclosed spaces. By extension, it is also possible to employ gas cannons, such as the Zon Mark 4 Propane Bird Scare Cannon, albeit only at the expense of seriously disturbing persons and animals that live nearby: The guns shoot continuously during the ripening period, creating or increasing the noise burden in the surroundings. The method is comparatively cheap but may gradually become ineffective. 1.3. Optical Modes and Instruments The less costly optical solutions are based on distributing glittering items in gardens or larger growing areas and on external surfaces of houses. This approach deters all types of birds, as the shiny objects disturb them, and the smaller birds are directly scared by the reflections, which resemble raptors’ eyes. Starlings, however, range among intelligent birds and, after a time, may notice that the reflections always occur at the same places and that there is no danger. Another popular tool is the holographic strip [ 6 ], a special glossy foil emulating a raptor’s eye; at locations protected in this manner, starlings usually behave very cautiously. Considering novel trends and progressive technologies, especially in view of their practical applicability and performance, we can emphasize the agrilaser system [ 7 ]. In this concept, laser generators emit a beam which is then perceived by the pests as a physical risk or obstacle and makes the birds take off or change their flight paths. 1.4. Natural Enemies In the case of large-scale growers, a viable option is to hire a falconer. As raptors commonly hunt small birds for food, this natural procedure (if regular) embodies a very effective means to defend an orchard or a vineyard against starlings; however, disadvantageously, the method is very time-intensive and costly. Sensors 2021,21, 4244 3 of 16 1.5. Aims and Objectives Most of the above-presented methods are problematic in that the pests gradually become accustomed to the disturbance. The issue is especially irritating in the acoustic devices, where, despite the diminished scaring effect, the human and animal exposure to the repelling noises remains at the same levels of intensity. With this difficulty in mind, we designed a system that executes the scaring task only after optically detecting a flock; the triggering signal is communicated to the actuator wirelessly. In the given context, our paper characterizes the hardware and software components of a novel setup that utilizes videocameras and artificial intelligence (AI) to detect flocks of starlings. The entire concept incorporates a scaring element (such as a loudspeaker, a gas cannon, or a laser beam generator) to be activated only when a flock has been detected; thus, the process is not continuous, eliminating undesired sonic disturbance, and this factor constitutes the greatest advantage of the system against regularly marketed options. In this manner, the actual scaring becomes more effective and environmentally friendly thanks to the irregularity of the actuating impulses. Beyond the Introduction, the paper is organized as follows: Section 2outlines the state of the art in the field, comparing relevant studies; Section 3describes the hardware of the system; Section 4analyzes the applied scaring methodology; Section 5presents the experiments and their results; Section 6discusses the general outcomes of the research; and Section 7embodies the conclusion. 2. Previous Research AI algorithms are currently employed in diverse branches of science and industry, including but not limited to civil [ 8 ] and electrical [ 9 ] engineering, crude oil drilling or mining [10], and manufacturing control [11]. In software terms, our concept of bird flock detection exploits AI algorithms, utilizing the approaches outlined in previously published studies that focus on AI in the detection of animals. The set of relevant sources comprises, for example, articles [ 12 – 17 ], which discuss the monitoring, detection, and classification of birds to prevent their interaction with wind turbines. Most of the monitoring projects described in these studies concern birds in the air. A different technique is proposed by the authors of reference [ 18 ]. This study eventually led to the designing of deep learning-based object-detection models using aerial images collected by an unmanned aerial vehicle (UAV). In the bird detection, the authors employ diverse models, including the Faster Region-Based Convolutional Neural Network (R-CNN), Region-Based Fully Convolutional Network (R-FCN), Single Shot MultiBox Detector (SSD), Retinanet, and You Only Look Once (YOLO). Such a model-supported procedure is also applied in source [ 19 ]. Another variant of flying bird detection (FBD), formulated for the purposes of aviation safety, namely, to forestall bird - aircraft collisions, is characterized in papers [ 20 , 21 ]; the research utilizes a simplified bird skeleton descriptor combined with an SVM (Support Vector Machine). A similar method appears in article [ 22 ], which proposes a feature-based bird detector. By combining the Histogram of Oriented Gradients (HOG) and the Center-Symmetric Local Binary Pattern (CS-LBP) into a feature set, the authors successfully detected crows under various lighting conditions. A dataset of crows, containing a wide range of movement phases, positions, and backgrounds, was prepared and learned with a linear Support Vector Machine (SVM). Further, article [ 23 ] introduces a bird detection and classification system exploiting Gaussian and Gabor filters, the HOG, and convolutional neural networks (CNNs). Such networks are employed also by other researchers in ornithology [ 24 ], agriculture [ 25 ], and air traffic safety centered on collision avoidance [26,27]. Studies [ 28 , 29 ] discuss the behavior of birds in the sky and on water, in addition to evaluating different types of classifiers. The literature, by extension, includes comprehensive articles addressing both the detection and the scaring of birds [ 30 ]. One of these sources is referenced in study [ 31 ], which characterizes the prototype of a device that comprises PIR sensors as the detector Sensors 2021,21, 4244 4 of 16 to track moving birds and uses LC oscillator type colpitts with a piezo ultrasonic sensor as the repeller. An ultrasonic repeller is described also in source [ 32 ], whose authors nevertheless follow a markedly more sophisticated path, exploiting machine learning algorithms. The use of an ultrasonic sensor as the actuator in combination with a Haar cascade classifier-based detector is then outlined in article [33]. The method defined in our study, compared to those exposed in the above-mentioned research articles, generally does not rely on detecting individual birds but rather on optimizing learning algorithms to facilitate flock detection. Another significant difference rests in that the design presented herein can involve virtually any actuator, switchable by the wireless module integrated in the system. These aspects together form the actual novelty of the designed setup, as further indicated in Section 1.5 above and the Discussion section below. 3. Hardware Components and Functions To scan the monitored space, evaluate the movement, and transfer the detectionrelated data, we designed an optical detector of moving objects (Figure 1). This detector utilizes a camera system and algorithms to track items in a predefined area, allowing the detection of not only birds and insects but also, if differential image processing is applied, fast processes or effects such as lightnings. The basic element of the detector consists in an NVIDIA Jetson Nano single board-computer, to which two videocameras are connected: One a Raspberry Pi HQ equipped with a Sony IMX477R sensor and a 16 mm f/1.4 PT3611614M10MP lens, and the other an Arducam 8 Mpx USB webcam CCTV 5–50 mm . The combination of two videocameras is used intentionally to deliver fast processing and convenient properties of the images. Sensors 2021, 21, x FOR PEER REVIEW 4 of 16 characterizes the prototype of a device that comprises PIR sensors as the detector to track moving birds and uses LC oscillator type colpitts with a piezo ultrasonic sensor as the repeller. An ultrasonic repeller is described also in source [32], whose authors nevertheless follow a markedly more sophisticated path, exploiting machine learning algorithms. The use of an ultrasonic sensor as the actuator in combination with a Haar cascade classifierbased detector is then outlined in article [33]. The method defined in our study, compared to those exposed in the above-men- tioned research articles, generally does not rely on detecting individual birds but rather on optimizing learning algorithms to facilitate flock detection. Another significant difference rests in that the design presented herein can involve virtually any actuator, switchable by the wireless module integrated in the system. These aspects together form the actual novelty of the designed setup, as further indicated in subsection 1.5 above and the Discussion section below. 3. Hardware Components and Functions To scan the monitored space, evaluate the movement, and transfer the detection-re- lated data, we designed an optical detector of moving objects (Figure 1). This detector utilizes a camera system and algorithms to track items in a predefined area, allowing the detection of not only birds and insects but also, if differential image processing is applied, fast processes or effects such as lightnings. The basic element of the detector consists in an NVIDIA Jetson Nano single board-computer, to which two videocameras are connected: One a Raspberry Pi HQ equipped with a Sony IMX477R sensor and a 16 mm f/1.4 PT3611614M10MP lens, and the other an Arducam 8 Mpx USB webcam CCTV 5-50 mm. The combination of two videocameras is used intentionally to deliver fast processing and convenient properties of the images. Figure 1. A block diagram of the sample setup for the detection of flying objects. The number of detectors required for a 360° coverage is specified in Table 1. Both of the above-defined videocameras are preset such that a flock can be captured at a distance of 300 m or less; in the Sony IMX477R, the minimum zoom value has to be selected in Figure 1. A block diagram of the sample setup for the detection of flying objects. The number of detectors required for a 360 ◦ coverage is specified in Table 1. Both of the above-defined videocameras are preset such that a flock can be captured at a distance of 300 m or less; in the Sony IMX477R, the minimum zoom value has to be selected in advance. In addition to the distance, the parameters that define the coverable area include Sensors 2021,21, 4244 5 of 16 the horizontal field of view (FOV). Before the actual monitoring, the devices are inserted in 3D-printed visors (Figure 2). Table 1. The technical specifications of the applied cameras. Camera Sony IMX477R + PT3611614M10MP Arducam 8 MP IMX179AF Zoom Horizontal FOV Number for 360◦coverage Zoom Horizontal FOV Number for 360◦coverage Min 44.6◦8.1 Fixed 64.5◦5.6 Max 21.8◦16.5 Considering the fact that the optical detector was to be tested in a vineyard with no connection to the electricity grid, we had to assemble a small island network [ 34 ]. For this purpose, we employed a photovoltaic panel exhibiting the following parameters: Max power 100 W, open circuit voltage (Voc) 21.6 V, short circuit current (Isc) 6.11 A, max power voltage (Vmp) 18 V, and max power current (Imp) 5.55 A. The electricity obtained from this panel was transferred to the solar charger controller and then fed directly to the devices or stored in the battery. In In island systems, a key factor consists in low consumption; we therefore implemented in the design a time delay switch to activate the entire setup an hour before sunrise and to shut it off an hour after sunset. Thus, we enabled the installed optical detector to operate over the complete grape harvest period in the Czech Republic. The electricity to the microcomputer is supplied by a 5 V voltage changer having the maximum current of 2.5 A; the videocameras receive power from the microcomputer. Separate feeding is secured for the module measuring the temperature and humidity, which, thanks to the attached SIM card, transmits the acquired data over an LTE network every 30 min. The reason for this configuration is that we need to know the temperature and humidity inside the sealed box, intending to evaluate the data before further use. To keep the internal spaces of the optical detector cooled, we fabricated a heat sink and mounted it to the rear wall of the module; the air circulation is guaranteed by a cooling fan running on a voltage of 12 V. As vineyards are generally warm and sunny, and the setup is exposed to intensive sunlight, the surfaces of the plastic box were covered with a special reflective foil. The two videocameras capture the position of the flock, allowing the actuator to be wirelessly triggered to execute the scaring task at the planned location. The wireless signal is transferred via WiFi, using an ESP8266 module. The actual receiver comprises only the power supply, ESP8266 module, and a relay to switch on the feeding (up to 10 A) and signal lines of the actuator (an ultrasonic repeller or a gas cannon). The optical detection and early warning unit is detailed in Figure 2; the complete assembly, erected at a vineyard in the village of Boˇretice, Moravia, the Czech Republic, is then visualized in Figure 3. Sensors 2021,21, 4244 6 of 16 Sensors 2021, 21, x FOR PEER REVIEW 6 of 16 Figure 2. The optical detection and early warning unit to track a flock of birds. Figure 3. The complete setup located at a vineyard in Bořetice, Moravia, the Czech Republic. 4. Methods for the Detection of Moving Targets When investigating the possibilities of the visual detection, we employed diverse image processing techniques combined with deep learning. The algorithms were implemented in the module represented in Figures 1–3. At the initial stage, we traced any and all visual activity by utilizing a differential algorithm in the detection of movement [35,36]. The captured set included all items that had changed their positions by at least one pixel between two instances of imaging. The images contained individual birds, bird flocks, insects, and other objects. In total, we executed approximately 300,000 detection shots, and these then allowed us to use in the research a corresponding number of images with detected items. From such a perspective, the differential method for the detection of moving objects appears to be wholly insufficient in monitoring only a single concrete item; in our case, however, the object is a flock Figure 2. The optical detection and early warning unit to track a flock of birds. Sensors 2021, 21, x FOR PEER REVIEW 6 of 16 Figure 2. The optical detection and early warning unit to track a flock of birds. Figure 3. The complete setup located at a vineyard in Bořetice, Moravia, the Czech Republic. 4. Methods for the Detection of Moving Targets When investigating the possibilities of the visual detection, we employed diverse image processing techniques combined with deep learning. The algorithms were implemented in the module represented in Figures 1–3. At the initial stage, we traced any and all visual activity by utilizing a differential algorithm in the detection of movement [35,36]. The captured set included all items that had changed their positions by at least one pixel between two instances of imaging. The images contained individual birds, bird flocks, insects, and other objects. In total, we executed approximately 300,000 detection shots, and these then allowed us to use in the research a corresponding number of images with detected items. From such a perspective, the differential method for the detection of moving objects appears to be wholly insufficient in monitoring only a single concrete item; in our case, however, the object is a flock Figure 3. The complete setup located at a vineyard in Boˇretice, Moravia, the Czech Republic. 4. Methods for the Detection of Moving Targets When investigating the possibilities of the visual detection, we employed diverse image processing techniques combined with deep learning. The algorithms were implemented in the module represented in Figures 1–3. At the initial stage, we traced any and all visual activity by utilizing a differential algorithm in the detection of movement [ 35 , 36 ]. The captured set included all items that had changed their positions by at least one pixel between two instances of imaging. The images contained individual birds, bird flocks, insects, and other objects. In total, we executed approximately 300,000 detection shots, and these then allowed us to use in the research a corresponding number of images with detected items. From such a perspective, the differential method for the detection of moving objects appears to be wholly insufficient in monitoring only a single concrete item; in our case, however, the object is a flock of Sensors 2021,21, 4244 7 of 16 birds. The acquired images nevertheless embodied a good input to support the subsequent application of deep learning. To prepare for this procedure, we classified and annotated the images, eventually obtaining a set of training images. The result was a classification model implemented in a microcomputer to facilitate the visual detection of bird flocks. 4.1. Image Capturing This section characterizes the image capturing procedures in greater detail. At the initial stage of the process, we formed a set of images capturing objects moving in the vineyard, utilizing an algorithm based on the differential method complemented with background image filtering (Figure 4). This technique exploits the principle of a movement detector capable of eliminating false detection caused by the quivering of grapevine leaves or the green vegetation in the vicinity. By simply subtracting the current image from the previous one, we yield a differential image, which is then converted to a binary image resulting from a predefined threshold. Simultaneously, an accumulated differential image of the background is being created to be later subtracted from the differential image; thus, we ensure the filtering of the background. Furthermore, object detection via the recognition of binary contours is in progress; during the operation, any image containing a positively detected item is stored and sent to a cloud storage room. A binary differential image and a highlighted region around a detected object are shown in Figure 5. Sensors 2021, 21, x FOR PEER REVIEW 7 of 16 of birds. The acquired images nevertheless embodied a good input to support the subsequent application of deep learning. To prepare for this procedure, we classified and annotated the images, eventually obtaining a set of training images. The result was a classification model implemented in a microcomputer to facilitate the visual detection of bird flocks. 4.1. Image Capturing This section characterizes the image capturing procedures in greater detail. At the initial stage of the process, we formed a set of images capturing objects moving in the vineyard, utilizing an algorithm based on the differential method complemented with background image filtering (Figure 4). This technique exploits the principle of a movement detector capable of eliminating false detection caused by the quivering of grapevine leaves or the green vegetation in the vicinity. By simply subtracting the current image from the previous one, we yield a differential image, which is then converted to a binary image resulting from a predefined threshold. Simultaneously, an accumulated differential image of the background is being created to be later subtracted from the differential image; thus, we ensure the filtering of the background. Furthermore, object detection via the recognition of binary contours is in progress; during the operation, any image containing a positively detected item is stored and sent to a cloud storage room. A binary differential image and a highlighted region around a detected object are shown in Figure 5. Nvidia Jetson Nano Input image Actual image Accumulated differential image of the background Previous image Differential image Filtering of the background Object detection Image saving Transfer to a cloud storage room + - + Figure 4. A flow chart characterizing the differential method (the input, actual, previous, and accumulated images); the differential image of the background; the differential image; the filtering of the background; object detection; image storage; transfer to a cloud storage room. Figure 5. A binary differential image (left) and a highlighted region around a detected object (right). The unit visualized in Figure 2 is capable of detecting bird-size objects in real time, up to a distance of approximately 300 m. If movement is recognized, the image is sent to a cloud storage room. The images collected during our experiment comprised multiple false detections due to insects, and this effect can be considered the greatest disadvantage Figure 4. A flow chart characterizing the differential method (the input, actual, previous, and accumulated images); the differential image of the background; the differential image; the filtering of the background; object detection; image storage; transfer to a cloud storage room. Sensors 2021, 21, x FOR PEER REVIEW 7 of 16 of birds. The acquired images nevertheless embodied a good input to support the subsequent application of deep learning. To prepare for this procedure, we classified and annotated the images, eventually obtaining a set of training images. The result was a classification model implemented in a microcomputer to facilitate the visual detection of bird flocks. 4.1. Image Capturing This section characterizes the image capturing procedures in greater detail. At the initial stage of the process, we formed a set of images capturing objects moving in the vineyard, utilizing an algorithm based on the differential method complemented with background image filtering (Figure 4). This technique exploits the principle of a movement detector capable of eliminating false detection caused by the quivering of grapevine leaves or the green vegetation in the vicinity. By simply subtracting the current image from the previous one, we yield a differential image, which is then converted to a binary image resulting from a predefined threshold. Simultaneously, an accumulated differential image of the background is being created to be later subtracted from the differential image; thus, we ensure the filtering of the background. Furthermore, object detection via the recognition of binary contours is in progress; during the operation, any image containing a positively detected item is stored and sent to a cloud storage room. A binary differential image and a highlighted region around a detected object are shown in Figure 5. Nvidia Jetson Nano Input image Actual image Accumulated differential image of the background Previous image Differential image Filtering of the background Object detection Image saving Transfer to a cloud storage room + - + Figure 4. A flow chart characterizing the differential method (the input, actual, previous, and accumulated images); the differential image of the background; the differential image; the filtering of the background; object detection; image storage; transfer to a cloud storage room. Figure 5. A binary differential image (left) and a highlighted region around a detected object (right). The unit visualized in Figure 2 is capable of detecting bird-size objects in real time, up to a distance of approximately 300 m. If movement is recognized, the image is sent to a cloud storage room. The images collected during our experiment comprised multiple false detections due to insects, and this effect can be considered the greatest disadvantage Figure 5. A binary differential image (left) and a highlighted region around a detected object (right). The unit visualized in Figure 2is capable of detecting bird-size objects in real time, up to a distance of approximately 300 m. If movement is recognized, the image is sent to a cloud storage room. The images collected during our experiment comprised multiple false detections due to insects, and this effect can be considered the greatest disadvantage of the applied differential algorithm. The technique, however, enabled us to gather a sufficient Sensors 2021,21, 4244 8 of 16 number of images (see Figure 6for examples), which then found use at the next stage, in training the classifier via machine learning methods. The data collection took place at two wineries, one based in Boˇretice and the other in Popice (both in Moravia, the Czech Republic). The altitude profile of the vineyard and the distribution of the optical detectors are represented in Figure 7, where each of the red spots represents three detecting modules that cover the areas highlighted in green. Sensors 2021, 21, x FOR PEER REVIEW 8 of 16 of the applied differential algorithm. The technique, however, enabled us to gather a sufficient number of images (see Figure 6 for examples), which then found use at the next stage, in training the classifier via machine learning methods. The data collection took place at two wineries, one based in Bořetice and the other in Popice (both in Moravia, the Czech Republic). The altitude profile of the vineyard and the distribution of the optical detectors are represented in Figure 7, where each of the red spots represents three detecting modules that cover the areas highlighted in green. Figure 6. Examples of images capturing the activity in a vineyard. Figure 7. A special content 3D map: the placement of the optical detectors. The bulk of data collected with the detection algorithm comprised approximately 300,000 images, from which 993 were selected for further processing. Subsequently, the individual items in each image were annotated and categorized, with the birds classified into more specific subsets to demonstrate their distinctive visual in-flight characteristics (Figure 8). During the machine learning phase, the images were assorted again, roughly at the ratio of 8:1:1, into the training, validating, and testing subgroups (see Table 2, in Figure 6. Examples of images capturing the activity in a vineyard. Sensors 2021, 21, x FOR PEER REVIEW 8 of 16 of the applied differential algorithm. The technique, however, enabled us to gather a sufficient number of images (see Figure 6 for examples), which then found use at the next stage, in training the classifier via machine learning methods. The data collection took place at two wineries, one based in Bořetice and the other in Popice (both in Moravia, the Czech Republic). The altitude profile of the vineyard and the distribution of the optical detectors are represented in Figure 7, where each of the red spots represents three detecting modules that cover the areas highlighted in green. Figure 6. Examples of images capturing the activity in a vineyard. Figure 7. A special content 3D map: the placement of the optical detectors. The bulk of data collected with the detection algorithm comprised approximately 300,000 images, from which 993 were selected for further processing. Subsequently, the individual items in each image were annotated and categorized, with the birds classified into more specific subsets to demonstrate their distinctive visual in-flight characteristics (Figure 8). During the machine learning phase, the images were assorted again, roughly at the ratio of 8:1:1, into the training, validating, and testing subgroups (see Table 2, in Figure 7. A special content 3D map: the placement of the optical detectors. The bulk of data collected with the detection algorithm comprised approximately 300,000 images, from which 993 were selected for further processing. Subsequently, the individual items in each image were annotated and categorized, with the birds classified into more specific subsets to demonstrate their distinctive visual in-flight characteristics (Figure 8). During the machine learning phase, the images were assorted again, roughly at the ratio of 8:1:1, into the training, validating, and testing subgroups (see Table 2, in which the individual data match the counts of detected objects). For our purposes, the term flock denotes not less than five birds flying together. Sensors 2021,21, 4244 9 of 16 Sensors 2021, 21, x FOR PEER REVIEW 9 of 16 which the individual data match the counts of detected objects). For our purposes, the term flock denotes not less than five birds flying together. Birds Insects Helicopter individuals Soaring Retracted wings Bees Flies Flocks Figure 8. Categorizing the collected images (Individual birds: spread/retracted wings; insects: bees and flies; helicopters; flocks). Table 2. The categories and their counts in the training, validation, and testing subgroups. Category Training Validation Testing Insects Flies 442 41 43 Bees 36 7 4 Birds Individuals 2308 445 228 Retracted wings 55 6 6 Soaring 160 5 3 Flocks 79 29 26 Helicopters 11 2 4 4.2. Machine Learning Algorithm To facilitate the recognition of objects in the images, we employed the cloud-based instrument Google AutoML Vision [37–40], which delivers an algorithm for the training of neural networks. The AutoML service utilizes recurrent neural networks to search for an optimum neural network architecture (applying a procedure referred to as neural architecture search) [41]. The algorithm (Figure 9) suggests the basic set of hyperparameters as well as the counts of layers and nodes to be required from the convolutional neural network that is being searched for. In the next iterations, the individual parameters are specified more precisely by the feedback. This process then repeats until the algorithm has gradually identified the best-fitting optimum architecture for the concrete dataset. The desired model is then selected from the set of assembled neural networks in such a manner that it possesses optimum properties, including sufficient accuracy and detection sensitivity. Figure 8. Categorizing the collected images (Individual birds: spread/retracted wings; insects: bees and flies; helicopters; flocks). Table 2. The categories and their counts in the training, validation, and testing subgroups. Category Training Validation Testing Insects Flies 442 41 43 Bees 36 7 4 Birds Individuals 2308 445 228 Retracted wings 55 6 6 Soaring 160 5 3 Flocks 79 29 26 Helicopters 11 2 4 4.2. Machine Learning Algorithm To facilitate the recognition of objects in the images, we employed the cloud-based instrument Google AutoML Vision [ 37 – 40 ], which delivers an algorithm for the training of neural networks. The AutoML service utilizes recurrent neural networks to search for an optimum neural network architecture (applying a procedure referred to as neural architecture search) [ 41 ]. The algorithm (Figure 9) suggests the basic set of hyperparameters as well as the counts of layers and nodes to be required from the convolutional neural network that is being searched for. In the next iterations, the individual parameters are specified more precisely by the feedback. This process then repeats until the algorithm has gradually identified the best-fitting optimum architecture for the concrete dataset. The desired model is then selected from the set of assembled neural networks in such a manner that it possesses optimum properties, including sufficient accuracy and detection sensitivity. Sensors 2021,21, 4244 16 of 16 18. Hong, S.-J.; Han, Y.; Kim, S.-Y.; Lee, A.-Y.; Kim, G. Application of Deep-Learning Methods to Bird Detection Using Unmanned Aerial Vehicle Imagery. Sensors 2019,19, 1651. [CrossRef] 19. Janousek, J.; Marcon, P.; Pokorny, J.; Mikulka, J. Detection and Tracking of Moving UAVs. In Proceedings of the 2019 Photonics Electromagnetics Research Symposium, Rome, Italy, 17–20 June 2019; pp. 2759–2763. 20. Xu, Q.; Shi, X. A Simplified Bird Skeleton Based Flying Bird Detection. In Proceedings of the 11th World Congress on Intelligent Control and Automation, Shenyang, China, 29 June–4 July 2014; pp. 1075–1078. 21. Wu, T.; Luo, X.; Xu, Q. A New Skeleton Based Flying Bird Detection Method for Low-Altitude Air Traffic Management. Chin. J. Aeronaut. 2018,31, 2149–2164. [CrossRef] 22. Mihreteab, K.; Iwahashi, M.; Yamamoto, M. Crow Birds Detection Using HOG and CS-LBP. In Proceedings of the 2012 International Symposium on Intelligent Signal Processing and Communications Systems, Taiwan, China, 4–7 November 2012; pp. 406–409. 23. Ghosh, S.K.; Islam, M.R. Bird Species Detection and Classification Based on HOG Feature Using Convolutional Neural Network. In Proceedings of the Recent Trends in Image Processing and Pattern Recognition; Santosh, K.C., Hegadi, R.S., Eds.; Springer: Singapore, 2019; pp. 363–373. 24. Akçay, H.G.; Kabasakal, B.; Aksu, D.; Demir, N.; Öz, M.; Erdo˘gan, A. Automated Bird Counting with Deep Learning for Regional Bird Distribution Mapping. Animals 2020,10, 1207. [CrossRef] [PubMed] 25. Lee, S.; Lee, M.; Jeon, H.; Smith, A. Bird Detection in Agriculture Environment Using Image Processing and Neural Network. In Proceedings of the 2019 6th International Conference on Control, Decision and Information Technologies (CoDIT), Paris, France, 23–26 April 2019; pp. 1658–1663. 26. Tian, S.; Cao, X.; Zhang, B.; Ding, Y. Learning the State Space Based on Flying Pattern for Bird Detection. In Proceedings of the 2017 Integrated Communications, Navigation and Surveillance Conference (ICNS), Herndon, VA, USA, 18–20 April 2017; pp. 5B3-1–5B3-9. 27. Jo, J.; Park, J.; Han, J.; Lee, M.; Smith, A.H. Dynamic Bird Detection Using Image Processing and Neural Network. In Proceedings of the 2019 7th International Conference on Robot Intelligence Technology and Applications (RiTA), Daejeon, Korea, 1–3 November 2019; pp. 210–214. 28. T’Jampens, R.; Hernandez, F.; Vandecasteele, F.; Verstockt, S. Automatic Detection, Tracking and Counting of Birds in Marine Video Content. In Proceedings of the 2016 Sixth International Conference on Image Processing Theory, Tools and Applications (IPTA), Oulu, Finland, 12–15 December 2016; pp. 1–6. 29. Boudaoud, L.B.; Maussang, F.; Garello, R.; Chevallier, A. Marine Bird Detection Based on Deep Learning Using High-Resolution Aerial Images. In Proceedings of the OCEANS 2019, Marseille, France, 17–20 June 2019; pp. 1–7. 30. Roihan, A.; Hasanudin, M.; Sunandar, E. Evaluation Methods of Bird Repellent Devices in Optimizing Crop Production in Agriculture. J. Phys. Conf. Ser. 2020,1477, 032012. [CrossRef] 31. Siahaan, Y.; Wardijono, B.A.; Mukhlis, Y. Design of Birds Detector and Repellent Using Frequency Based Arduino Uno with Android System. In Proceedings of the 2017 2nd International conferences on Information Technology, Information Systems and Electrical Engineering (ICITISEE), Yogyakarta, Indonesia, 1–3 November 2017; pp. 239–243. 32. Palanisamy, S.; Selvaraj, R.; Ramesh, T.; Ponnusamy, J. Applications of Remote Sensing in Agriculture—A Review. Int. J. Curr. Microbiol. Appl. Sci. 2019,8, 2270–2283. [CrossRef] 33. Arowolo, O.; Adekunle, A.A.; Ade-Omowaye, J.A. A Real Time Image Processing Bird Repellent System Using Raspberry Pi. FUOYE J. Eng. Technol. 2020,5. [CrossRef] 34. Marcon, P.; Szabo, Z.; Vesely, I.; Zezulka, F.; Sajdl, O.; Roubal, Z.; Dohnal, P. A Real Model of a Micro-Grid to Improve Network Stability. Appl. Sci. 2017,7, 757. [CrossRef] 35. Lin, L.; Zhu, M. Efficient Tracking of Moving Target Based on an Improved Fast Differential Evolution Algorithm. IEEE Access 2018,6, 6820–6828. [CrossRef] 36. Cafforio, C.; Rocca, F. The Differential Method for Image Motion Estimation. In Proceedings of the Image Sequence Processing and Dynamic Scene Analysis; Huang, T.S., Ed.; Springer: Berlin/Heidelberg, Germany, 1983; pp. 104–124. 37. He, X.; Zhao, K.; Chu, X. AutoML: A Survey of the State-of-the-Art. Knowl. Based Syst. 2021,212, 106622. [CrossRef] 38. Bisong, E. Google AutoML: Cloud Vision. In Building Machine Learning and Deep Learning Models on Google Cloud Platform: A Comprehensive Guide for Beginners; Bisong, E., Ed.; Apress: Berkeley, CA, USA, 2019; pp. 581–598. ISBN 978-1-4842-4470-8. 39. Rivera, J.D.D.S. Object detection with a model trained in Google Cloud AutoML. In Practical TensorFlow.js: Deep Learning in Web App Development; Rivera, J.D.D.S., Ed.; Apress: Berkeley, CA, USA, 2020; pp. 163–184. ISBN 978-1-4842-6273-3. 40. AutoML Vision Beginner’s Guide. Available online: https://cloud.google.com/vision/automl/docs/beginners-guide?hl=cs (accessed on 13 April 2021). 41. Connor, J.T.; Martin, R.D.; Atlas, L.E. Recurrent Neural Networks and Robust Time Series Prediction. IEEE Trans. Neural Netw. 1994,5, 240–254. [CrossRef] [PubMed]