# Internet of Things Meets Computer Vision to Make an Intelligent Pest Monitoring Network
## 1 Introduction  
The Internet of Things (IoT) describes a network composed of several interconnected devices to obtain, transmit, and store data. The use of smart farming has grown exponentially with the use of IoT to produce better and cheaper food for a growing world population. In smart farming, data can be used, among other things, to make more efficient use of space, minimise waste, and monitor pests [1]. When data is in the form of images, the IoT can be used together with Computer Vision (CV), which is a field of research that enables machines to process, analyse, and obtain insights from images or videos. In this case, the IoT network obtains, transmits, and stores images, and the CV models process those images to obtain information or insights [2; 3; 4].  
Smart farming uses IoT for several purposes, e.g., in irrigation systems to minimise water consumption or in animal feeding to optimise feeding [1]. Computer Vision (CV) is also used with different purposes, e.g., in crop monitoring to obtain insights about the best time to harvest or in animal counting [5; 6].  
Despite the potential of combining IoT and CV, these technologies are still not very commonly used in traditional pest monitoring, which is a visual task and one of the biggest challenges for farmers [7]. In traditional pest monitoring, technicians have to go to the field for the sake of identifying and counting the pests in traps. If the number of pests exceeds a threshold, then they need to use pesticides or biological monitoring. This may not be very precise, as technicians use extrapolation to know the number of pests, i.e., the pests in a small area are counted and used as a sample. It is also expensive, because it requires many hours of specialised work to count the pests and it can also lead to the overuse of pesticides if the visit to the field occurs too late, allowing the pests to propagate [8].  
In this article. we present a system that was developed by combining IoT and CV to make an intelligent pest monitoring network. This network contributes to make the pest monitoring:  
* **Autonomous:** almost does not need human intervention;
* **Cheaper:** reduces the need for technicians to identify and count the pests;
* **Data-driven:** allows to know the daily pest evolution using images and not only when the technicians make pest detection and counts;
* **Precise:** replaces the sampling by the total count of the pests.  
These contributions allow farmers to optimise production quality and increase revenue. With that in mind, the proposed system can be implemented for all types of crops and farms (indoor and outdoor) to allow farmers to make informed decisions in an easy way.  
For the implementation, we designed trapezoidal plastic structures to protect the traps and cameras for environmental conditions and to control the obtained images quality. At the base of these structures, we placed yellow sticky traps and, on the top, the cameras used as edge computing. The structures were placed in different crops and the obtained images from the traps were sent to the cloud. The cloud has a CV model trained to detect and count pests. The information resulting from the model is then processed and sent to an application. The application allows farmers to easily make an informed decision, such as when to use pesticides, just by looking at a dashboard with the evolution of pests in each trap. We used low-cost/low-power cameras and solar panels for power, which allows for long-term monitoring in environments without an external power supply. The complex calculations are in the cloud, where all backend tasks/services are centralised.  
The rest of the article is structured as follows. Section 2 presents material and methods, describing the types of computation, communication protocols, network types, and CV models. Section 3 describes the proposed approach, including the dataset and CV model used, and the proposed IoT network. In Section 4, we present the conclusions.