Source-linked AI summary
Bee Detection and Tracking at Hive Entrance using YOLO11 and ByteTrack
Thi Thu Thao Nguyen, Johannes Reschke
TL;DR
Automatic bee entrance monitoring must detect and track small, fast-moving bees despite motion blur and temporary low-confidence detections. This work combines YOLO11 transfer learning with ByteTrack, testing augmentation, backbone-freezing, and tracker settings; moderate augmentation, progressive unfreezing, and ByteTrack tuning improved reliability, although fast outgoing bees remained the main limitation.
Problem
Bee entrance monitoring is difficult because bees are small, fast-moving, blurred, and sometimes overlapping, causing tracking and counting challenges.
Method
The study trains YOLO11 for detection, applies ByteTrack for tracking, and evaluates augmentation, backbone-freezing, and tracker-parameter choices.
Results
Moderate augmentation and progressive backbone unfreezing provided the best balance between accuracy and generalization, while ByteTrack tuning improved trajectory continuity and reduced counting errors.
Takeaways & Limitations
The results support combining moderate augmentation, progressive unfreezing, and ByteTrack tuning for more reliable bee entrance monitoring under realistic recording conditions.
Takeaways & Limitations
Missed detections of fast-moving outgoing bees remain the main limitation, reducing tracking and counting accuracy after detections are lost.
Abstract
from arXiv · showhide
This work presents an automatic bee entrance monitoring system based on YOLO11 transfer learning and the ByteTrack tracking algorithm. The study investigates the influence of data augmentation, backbone freezing, and tracker parameter optimization on the detection and counting of small, fast-moving bees. The detector with progressive backbone unfreezing strategy achieved about 97.0% precision and 98.7% mAP50, while providing more stable convergence than full fine-tuning. Experiments also showed that light augmentation outperformed heavy augmentation. For tracking, ByteTrack parameters were optimized to improve trajectory continuity under low-confidence detections. On an independent 25 FPS side-view video, the optimized YOLO11-ByteTrack system correctly counted 43 of 47 incoming bees (91.5%) and 7 of 30 outgoing bees (23.3%). Error analysis showed that most counting errors were caused by missed detections due to rapid bee motion and motion blur, while tracking failures became less frequent after parameter optimization. Overall, the results indicate that moderate augmentation, progressive backbone unfreezing, and ByteTrack tuning improve the reliability of automatic bee entrance monitoring under realistic recording conditions.
I. INTRODUCTION
The study addresses difficult automatic bee monitoring at hive entrances, where small, fast-moving, blurred, and overlapping bees complicate detection and tracking. It evaluates YOLO11 training choices and ByteTrack optimization, alongside counting-error analysis.
- Automatic monitoring is motivated by the value of bee traffic counts for assessing colony activity and possible health or environmental conditions.
- Small, rapidly moving bees, motion blur, and overlap near hive entrances can cause fragmented trajectories and ID switches.
- The study trains a YOLO11 detector for bee detection.
- It compares data-augmentation strategies and backbone-freezing schemes during detector training.
- It optimizes ByteTrack parameters for bee tracking and analyzes the main sources of counting errors.
II. Related Work
Prior work established deep-learning detection and tracking for bee monitoring but left gaps in cross-setting generalization, tracker-parameter analysis, counting-focused evaluation, and detailed error analysis. This study addresses these gaps with YOLO11, ByteTrack, an independent viewpoint, and explicit failure analysis.
- Earlier bee-counting work combined YOLOv8m with several trackers and reported its best F1-scores using OC-SORT with a box-based counting strategy.The reported F1-scores were 91.49% for incoming bees and 89.08% for outgoing bees.
- That baseline used data from only two hives and the same environment for training and testing, limiting assessment across viewpoints and settings.
- Behavior-recognition research addressed entering, leaving, and pollen-carrying behaviors but focused on recognition rather than counting accuracy.
- Long-term monitoring used YOLOv8 with BoT-SORT and independent videos, but did not detail missed detections, ID switches, or temporary tracking loss near entrances.
- The present study uses public detection datasets, an independent video from a different viewpoint, YOLO11 with ByteTrack, tracker optimization, and detailed failure analysis.
III. Dataset
The dataset combines two public image sources to increase training scale and visual diversity, while a separate Pexels video provides independent tracking evaluation from a side view.
- The combined image dataset contains over 9,500 images, including 7,635 training images and 1,909 validation images.
- The Mendeley dataset contributes over 6,500 labeled images focused on bee detection and movement direction on landing boards.
- Dataset Ninja contributes over 3,000 object-detection images with diverse visual characteristics.
- Together, the two image sources increase variation in appearance, viewpoint, and environmental conditions.
- The independent tracking video was recorded for 30 seconds at 25 FPS from a side-view camera under natural lighting.
IV. Methodology
The system combines YOLO-based bee detection, ByteTrack trajectory association, and counting-box boundary crossings to monitor hive-entrance traffic. It uses transfer learning and retains low-confidence detections to improve continuity for small, fast-moving bees.
- YOLOv8 and YOLO11 are evaluated as one-stage, anchor-free detectors for accurate, real-time detection of small, fast-moving bees.
- Both detectors use COCO-pretrained weights and are fine-tuned on the bee dataset through transfer learning.The stated benefits are faster convergence, improved accuracy with limited data, and reduced overfitting risk.
- ByteTrack associates both high- and low-confidence detections with existing trajectories to recover weak detections and produce more continuous tracks.
- A rectangular counting box classifies bees by whether each bounding-box center crosses its boundary from outside in or inside out.Each crossing is logged by tracking ID, and repeated entry or exit events are recorded independently.
- The method favors a counting box over a single virtual line because it is more robust to bees’ oscillatory flight near the hive entrance.
V. Experiments
Experiments examine augmentation, backbone-freezing strategies, detector choice, and tracker settings. Light augmentation and progressive backbone unfreezing provide stronger stability and localization, while YOLO11 improves tracking continuity over YOLOv8.
- Effect of Augmentation: Light augmentation consistently achieves higher localization accuracy and recall with lower losses than heavy augmentation for small-bee detection.Heavy augmentation with RandAugment and random erasing can reduce mAP50-95, box loss, class loss, and recall.
- Backbone Freezing: Full fine-tuning reaches mAP50–95 of 0.784–0.785 with over 96% precision and recall, but its validation losses are over 6% higher than progressive unfreezing.The passage associates its greater fluctuation and higher validation losses with a greater risk of overfitting.
- Backbone Freezing: Progressive backbone unfreezing freezes the backbone for the first 30 epochs, trains for 93 epochs, and is described as improving stability while delaying overfitting.The all-unfrozen model converges at epoch 82, whereas freezing throughout trains for 75 epochs.
- YOLOv8 versus YOLO11: YOLO11 provides more stable tracking and higher counting accuracy than YOLOv8 by preserving features during rapid motion or partial occlusion and reducing ID switches.The C2PSA module is linked to improved attention to small targets, while C3k2 blocks are linked to more consistent features across frames.
- Tracker Parameter Optimization: Tracker optimization lowers confidence thresholds and lengthens the track buffer to preserve identities across temporary detection failures, while a higher matching threshold limits incorrect ID switches.These settings prioritize trajectory continuity over conservative filtering.
Parameter
ByteTrack parameters are adjusted to preserve bee identities through weak detections, occlusions, and overlaps. Lower thresholds and a longer buffer improve continuity, while stricter matching helps limit ID switches.
- A very low threshold lets ByteTrack recover detections after one- or two-frame occlusions instead of terminating tracks.
- Lowering the new-track threshold initializes newly appearing bees faster, reducing missed entries despite a risk of short-lived false tracks.
- Increasing the track buffer keeps lost tracks alive longer, enabling re-association after temporary occlusion and reducing fragmented trajectories.
- A higher matching threshold requires stronger spatial consistency before assigning existing IDs, reducing incorrect switches between nearby bees.Detection confidence is also combined with motion similarity when fuse_score is enabled.
- The combined settings improve trajectory continuity while limiting unnecessary ID switches and supporting more reliable counting across the counting region.
VI. Results
The results compare YOLOv8 and YOLO11 against ground-truth bee counts under optimized and unoptimized tracking conditions. YOLOv11 consistently performs better, and lower tracking thresholds recover detections and improve counting accuracy.
- 47 incoming bees and 30 outgoing bees are present in the independent testing video.
- YOLOv11 consistently outperforms YOLOv8 with and without tracking parameter optimization.
- YOLOv11’s more reliable detections provide higher-quality tracker inputs, producing more stable trajectories and improved counting performance.
- Optimized tracking improves outgoing-bee counting because low-FPS motion creates large frame-to-frame displacements that can break identity continuity.
- Lowering the tracking confidence threshold recovers more detections, reduces missed bee trajectories, and improves overall counting accuracy.
VII. Error Analysis
Missed detections were concentrated among fast-moving outgoing bees because motion blur and insufficient viewpoint diversity reduced visual visibility and generalization. Tracking errors were linked to rapid displacement, close bees, occlusion, and abrupt turns, while lighting and shadows had little effect.
- Outgoing bees produced most detection failures because high speed and difficult viewing angles caused motion blur and reduced visual features.Motion blur makes bees harder to detect, especially when they leave the hive rapidly.
- Insufficient viewpoint diversity reduced generalization to unusual or side-angle bee orientations.The training data were dominated by top-down views.
- Lighting changes had minor influence on detection, and shadows rarely caused false detections.The test video used relatively stable natural lighting, while the model generally recognized bees by body pattern and shape.
- High-speed motion and limited viewpoint diversity were the primary causes of missed detections, especially for outgoing bees.Lighting changes and shadows had comparatively little impact on detection performance.
- Fast movement between 25 FPS frames made track association difficult, while close bees, brief disappearance, and rapid turning caused occasional continuity failures.ID switches occurred near overlapping bees; temporary losses were rare, and sudden direction changes could break trajectories.
- Parameter optimization decreased fragmented tracks but retained a trade-off between preserving fast-bee tracks and avoiding incorrect ID associations.
VIII. Conclusion
The study combines YOLO11 detection with ByteTrack tracking for bee entrance monitoring and evaluates training and tracking choices. Moderate augmentation, progressive backbone unfreezing, and ByteTrack tuning improved the balance of accuracy, generalization, trajectory continuity, and counting reliability, while fast outgoing bees remained the main limitation.
- YOLO11 detection with ByteTrack tracking formed the bee entrance monitoring system.
- Moderate data augmentation and progressive backbone unfreezing provided the best balance between accuracy and generalization.
- ByteTrack parameter tuning improved trajectory continuity and reduced counting errors compared with the default configuration.
- Missed detections of fast-moving outgoing bees remained the system’s main limitation, reducing subsequent tracking and counting accuracy.
- Future work targets viewpoint changes and low-frame-rate videos through more diverse training data and stronger use of temporal information.