The olive fruit fly Bactrocera oleae (Rossi) (Diptera: Tephritidae) is the primary pest of olive crop globally, causing serious economic losses each year. Early and accurate detection of this pest is essential for implementing integrated management strategies and minimizing the use of chemical inputs. In this context, the application of advanced technologies such as computer vision and machine learning through modelling emerges as a promising solution for monitoring and managing this pest. However, the absence of a robust and efficient dataset has hindered the development of reliable models for its recognition. This study details the creation procedure of a dataset comprising 2440 images collected from field and laboratory environments, along with data augmentation and training of three different models using machine learning algorithms. The models were implemented with YOLOv5 and optimized with different versions (s, m, and epoch). All three models achieved accuracy exceeding 90%. The optimisation process, which combined different YOLOv5 versions (s and m) and epochs (300 and 150), determined that the model trained with the s version and 300 epoch provided the best trade-off between accuracy, robustness, and computational efficiency. This makes it the most suitable option for implementation on low-cost, resource-limited platforms such as the Raspberry Pi. This study represents a step toward the integration of artificial intelligence into olive cultivation, bringing significant benefits to both producers and the environment. This study differs from previous YOLOv5-based pest detection research by providing a heterogeneous dataset that combines field and laboratory conditions, and by validating its deployment on a low-cost embedded platform (Raspberry Pi), thus enabling practical automation in Integrated Pest Management (IPM) systems.
Moreno-Alcaide et al. (Mon,) studied this question.