Journal of Pest Science Ecology, Evolution, Behavior and Systematics
YOLO-based detection of blueberry fruit fly (Rhagoletis mendax)
Abstract
Blueberry fruit fly ( Rhagoletis mendax Curran) (BFF) is a major pest of wild blueberry production because larval infestation reduces fruit quality and can result in rejected berries under zero-tolerance market standards. Monitoring BFF currently relies on visual inspection of ammonium-baited yellow sticky traps, which is labor-intensive and can delay timely management decisions. This study evaluated the feasibility of automated BFF detection from trap images using a YOLO11-based object detector. Images were collected from 27 traps deployed across nine commercially managed wild blueberry fields in Nova Scotia during the 2025 field season. The resulting dataset comprised 528 annotated trap images containing 2,187 BFF instances. A YOLO11-small model was trained using transfer learning and evaluated on an independent held-out test set. On the test set, the detector achieved a precision of 0.925, recall of 0.864, F1-score of 0.893, mAP@0.5 of 0.926, and mAP@0.5:0.95 of 0.681, with an average inference time of 9.6 ms per image. In addition to standard detection metrics, predicted and manual counts were compared on the held-out test dataset ( n = 53 images). Count agreement was strong, with slight negative bias (− 0.132), low mean absolute error (0.472), low root mean square error (0.836), and high Pearson correlation ( r = 0.996; 95% CI: 0.992–0.997). Threshold classification accuracy for the 6-fly action threshold was 1.0. Most remaining errors were associated with adhesive glare, partially visible flies at trap edges, and rare but visually similar non-target Tephritidae. A publicly accessible web application was also developed to demonstrate practical deployment. Together, these results show that YOLO-based detection can provide accurate, rapid interpretation of BFF trap images and represents an important step toward automated monitoring and future electronic trap systems for wild blueberry production. Sticky-trap monitoring of blueberry fruit fly is laborious and requires trained visual inspection. We tested whether automated image analysis could reliably identify and count this pest. The detector closely reproduced manual counts, with average errors below one fly per image. It correctly classified all test images relative to the 6-fly action threshold. Automated trap interpretation could support faster, better-timed, and more targeted pest control.