Real-time fruit detection and counting on edge devices in orchards

Towards Practical Precision Agriculture: Real-Time Fruit Detection and Video Analytics on Embedded Edge Hardware

Computer Vision and Pattern Recognition

Summary

Counting fruit in orchards using video cameras is hard because it needs fast and accurate processing of many pictures quickly. The authors trained a lightweight AI system to spot and track different fruits using small computer devices that can work directly in the field. Their system works fast enough to keep up with live video and can count fruits with reasonable accuracy depending on the camera angle. This shows it is possible to use compact devices to monitor fruit without losing details over time.

What this means in practice

  • For orchard managers: Use embedded edge devices running lightweight AI to monitor fruit growth and count in real time for better harvest planning.
  • For agricultural drone operators: Integrate efficient fruit detection and tracking algorithms into drones flying over crops to automate yield monitoring without heavy computation.

Authors

Ivica Dimitrovski, Vlatko Spasev, Ivan Kitanovski, Petre Lameski, Dane Boshev

Abstract

Static-image benchmarks do not capture the computational and temporal requirements of practical orchard video analytics. This study presents an end-to-end framework for real-time fruit detection, tracking, and counting on the NVIDIA Jetson Orin Nano Super. A lightweight YOLO26s detector is trained independently on four public datasets representing apples, mangoes, blueberries, and strawberries under a common protocol. The models are deployed on embedded platform using PyTorch and TensorRT at FP32, FP16, and INT8 precision. APPLE MOTS is then used for temporal video analytics because it provides orchard sequences with persistent fruit identities, enabling evaluation of multi-object tracking and unique-fruit counting. The selected FP16 TensorRT detector is integrated into an NVIDIA DeepStream pipeline combining hardware-accelerated decoding, ByteTrack tracking, and motion-aware line-crossing analytics. Across the four detection tasks, mean test mAP@50:95 ranges from 0.4957 to 0.8656. On the Jetson, TensorRT FP16 achieves 66.76-74.56 images/s at 13.41-14.98 ms prediction latency, while reducing mAP@50:95 by only 0.0020-0.0054 and gross energy consumption by approximately 64-66% relative to PyTorch FP32. The complete detector-tracker-analytics pipeline reaches 44.96-54.11 FPS and sustains the configured 30-FPS input rate without output-frame loss. On held-out orchard video sequences, HOTA ranges from 0.345 to 0.538, event-level counting F1 from 0.611 to 0.803, and relative count error from 6.2% to 51.6%. Performance varies across acquisition geometries: near-lateral row viewing yields the most stable tracking and counting, whereas forward traversal remains association- and recall-limited despite spatially adaptive counting geometry. These results show that practical edge-based fruit monitoring requires efficient detection and acquisition geometries that support reliable temporal association.