# Internet of Things Meets Computer Vision to Make an Intelligent Pest Monitoring Network
## 4 Conclusions and Future Work  
The presented approach aims to contribute to more sustainable and efficient farming. We presented an IoT network to automate pest monitoring and to enhance part of the technicians work with new technologies. The star topology of the network allows its easy extension to new plantations and other pest types. This network is composed of edge devices, a private cloud, and a mobile application, and uses HTTP to communicate between nodes. The low-cost devices (such as the ESP32-Cam) are associated with low-power consumption, allowing the use of the network in crops with external power constraints. It is possible to run the edge nodes for four months using 18650 batteries, and without the need to change those batteries with the addition of solar panels. Furthermore, the use of low-cost devices at the edge does not significantly decrease the performance of CV models (between 10.3% and 16.3% less detections). We tested four CV models (Faster R-CNN, Scaled-YOLOv4, YOLOv5 (Small), and YOLOv5 (XLarge)) and used three metrics for their evaluation: mAP, memory consumption, and average time for each detection. The model with the best mAP was YOLOv5 (XLarge), with a mAP of 89.70%. The model with the lowest memory consumption and average time for each detection was YOLOv5 (Small), with 15 MB and 0.01S, respectively. As the model runs in the cloud and the goal is to monitor pests daily, we used the model with the highest mAP (YOLOv5 (XLarge)) for the monitoring system. For a real-time monitoring system, the model with the lowest memory consumption (to be closer to the edge) and the lowest average time for each detection was determined to be the best option, in this case YOLOv5 (Small). For a monitoring system with a CV model in the fog, the Scaled-YOLOv4 constitutes the best choice, as it is more balanced. The mobile application allows users to easily monitor the pest's evolution, thus supporting more informed decisions. The application was presented to potential users that have shown interest in such a pest monitoring application, namely to integrate in their own current monitoring system. Most approaches on pest monitoring only address CV models. Advances in IoT, such as reducing hardware costs and increasing computational power, make it especially relevant to use IoT networks for the deployment of those CV models, giving them a purpose and a use. Additionally, most proposed approaches use images obtained in controlled conditions, e.g., always the same light or without noise, making it difficult to develop CV models with good performance outside the lab. This work shows that the use of an IoT network allows the acquiring of images in real contexts and in large quantities, which can then contribute to improve the real performance of CV models. Despite the advantages of an automatic monitoring system, there are some disadvantages that must be taken into account. The lack of precision of the CV model or the lack of the quality of the images can lead to false positives and/or false negatives, both of which can be tackled by large annotated datasets throughout the pest's different development stages obtained under real conditions. Future work will mostly focus on overcoming these disadvantages. For that, we will focus on the expansion of the IoT network to obtain more images and the creation of a dataset with ESP32-Cam images to improve CV models' performance under uncontrolled conditions. Lastly, we will evaluate performance of the monitoring system during multiple crop seasons. Conceptualisation, C.S., J.C. and B.R. ; methodology, C.S., J.C. and B.R. ; software, B.C. ; validation, C.S., J.C., B.R. and B.C. ; formal analysis, C.S., J.C., B.R. and B.C. ; investigation, C.S., J.C., B.R. and B.C. ; resources, C.S., J.C., B.R. and B.C. ; data curation, C.S., J.C., B.R. and B.C. ; writing--original draft preparation, C.S., J.C., B.R. and B.C. ; writing--review and editing, C.S., J.C., B.R. and B.C. ; visualisation, C.S., J.C., B.R. and B.C. ; supervision, C.S., J.C. and B.R.