The agricultural sector confronts challenges arising from climate change and evolving global trade, emphasizing the critical need for effective pest management to sustain crop yields. This study introduces an innovative pest detection and monitoring approach, centering on the Codling Moth (Cydia pomonella) as a model insect. The system seamlessly integrates a Raspberry Pi-based trap, the YOLOv10m (You Only Look Once) deep learning model, and the Ubidots IoT platform. The YOLOv10m model, renowned for its real-time object detection capabilities, undergoes training to identify Codling Moths in images captured by the trap. Subsequently, the model-generated data is transmitted to the Ubidots platform, facilitating remote real-time monitoring. The Ubidots dashboard encompasses features like data analysis, historical trends, and notification alerts for elevated pest densities. Results underscore the YOLOv10m model’s impressive 89% confidence level in detecting Codling Moths. The Ubidots platform enhances overall system performance, enabling farmers to monitor pest activity and intervene promptly. This integrated system fosters informed decision-making, curtails excessive pesticide use, and advocates sustainable farming practices. Ultimately, this research makes a substantial contribution to precision agriculture by harnessing the synergies of deep learning and IoT technologies, delivering a dependable and cost-effective solution for managing pest populations in agriculture.
Effective pest management remains a persistent challenge in precision agriculture, particularly due to the difficulty of accurately detecting small insects in cluttered trap environments under varying lighting and background conditions. Traditional methods often require labor-intensive inspections, while existing deep learning-based object detectors, such as standard YOLO models, face trade-offs between detection accuracy and computational feasibility on edge devices. This study introduces an improved version of the YOLOv5m model tailored for deployment on a Raspberry Pi-based smart insect trap, targeting codling moth (Cydia pomonella) detection. The proposed architecture incorporates a Convolutional Block Attention Module (CBAM) to enhance feature representation and reduce background interference, along with strategic filter reduction to lower computational complexity. As a result, the model achieves a maximum confidence level of 95% and an average of 91.36%, with reduced parameter count and a FLOPs value of 26.88 billion. Integration with the Firebase IoT platform enables real-time monitoring and remote data management. Comparative analysis with YOLOv5–YOLOv12 variants demonstrates that the improved YOLOv5m offers the best balance between accuracy and efficiency for low-power deployment. These findings highlight the potential of combining lightweight deep learning and IoT infrastructure to create scalable, energy-efficient, and sustainable pest detection systems for real-world agricultural applications.