Temporal Encoding Strategies for YOLO-Based Detection of Honeybee Trophallaxis Behavior in Precision Livestock Systems
Abstract
1. Introduction
- to collect, annotate, and publicly release a large-scale dataset of honeybee trophallaxis at the hive entrance, captured under diverse illumination, hive density, and occlusion conditions;
- to evaluate You Only Look Once (YOLO) object detectors combined with different temporal-to-RGB encoding strategies for trophallaxis detection;
- to assess the feasibility of real-time, markerless deployment on both workstation-class graphics processing units and embedded edge hardware such as the NVIDIA Jetson AGX Orin.
2. Related Works
2.1. Detection Methods and Behavioral Contexts for Trophallaxis
2.1.1. Automated Detection of Trophallaxis
2.1.2. Biological and Ecological Contexts of Trophallaxis
2.1.3. Collective Behavior and Group Dynamics
2.2. Temporal-to-RGB Encoding Strategies
3. Materials and Methods
3.1. Dataset
3.2. Temporal-to-RGB Encoding and Dataset Generation
3.2.1. Direct RGB
3.2.2. Temporally Stacked Grayscale (TSG)
3.2.3. Temporally Encoded Motion (TEM)
3.2.4. Temporally Encoded Motion and Average (TEMA)
- The N grayscale frames were collected (for causal MA) or symmetrically around n if using a centered window for offline training data;
- and were computed according to the formulas above;
- The RGB image was assembled as , , ;
- The results were scaled or clipped to the 0–255 range, resized as required, and saved.
3.3. Model Training and Optimization
4. Results and Discussion
4.1. Investigation of Precision vs. Inference Time
- YOLOv8 tended to be the fastest for a given size and achieved high accuracy when paired with temporal encodings (TSG/TEM/TEMA). Per-image times for YOLOv8 fell into the lowest column of Table 1, making medium-sized YOLOv8 (m/l) attractive when both latency and accuracy matter.
- YOLO11 generally improved accuracy slightly over YOLOv8 for the same size when using temporal encodings, but at a small increase in per-image time; for example, YOLO11m with TSG/TEMA reached very competitive mAP50 numbers while remaining in a similar latency class.
- YOLO12 attained top-end accuracy in several TEMA variants, comparable to or slightly above YOLO11/YOLOv8 for the largest sizes, but it incurred the largest per-image time, making it better suited to offline/batch processing or when highest accuracy is essential.
4.2. Deployment on Jetson AGX Orin Platform
4.3. Visualizations
5. Conclusions
Author Contributions
Funding
Institutional Review Board Statement
Data Availability Statement
Acknowledgments
Conflicts of Interest
References
- Klein, A.M.; Vaissière, B.E.; Cane, J.H.; Steffan-Dewenter, I.; Cunningham, S.A.; Kremen, C.; Tscharntke, T. Importance of pollinators in changing landscapes for world crops. Proc. R. Soc. B Biol. Sci. 2007, 274, 303–313. [Google Scholar] [CrossRef]
- Smith, K.M.; Loh, E.H.; Rostal, M.K.; Zambrana-Torrelio, C.M.; Mendiola, L.; Daszak, P. Pathogens, pests, and economics: Drivers of honey bee colony declines and losses. EcoHealth 2013, 10, 434–445. [Google Scholar] [CrossRef] [PubMed]
- Osterman, J.; Aizen, M.A.; Biesmeijer, J.C.; Bosch, J.; Howlett, B.G.; Inouye, D.W.; Jung, C.; Martins, D.J.; Medel, R.; Pauw, A.; et al. Global trends in the number and diversity of managed pollinator species. Agric. Ecosyst. Environ. 2021, 322, 107653. [Google Scholar] [CrossRef]
- Ulrich, J.; Stefanec, M.; Rekabi-Bana, F.; Fedotoff, L.A.; Rouček, T.; Gündeğer, B.Y.; Saadat, M.; Blaha, J.; Janota, J.; Hofstadler, D.N.; et al. Autonomous tracking of honey bee behaviors over long-term periods with cooperating robots. Sci. Robot. 2024, 9, 1–16. [Google Scholar] [CrossRef] [PubMed]
- Janota, J.; Blaha, J.; Stefanec, M.; Rouček, T.; Ulrich, J.; Fedotoff, L.A.; Rekabi-Bana, F.; Arvin, F.; Schmickl, T.; Krajník, T. Non-invasive honeybee colony monitoring via robotic mapping of combs in observation hives. Comput. Electron. Agric. 2025, 239, 111031. [Google Scholar] [CrossRef]
- Stefanec, M.; Hofstadler, D.N.; Krajník, T.; Turgut, A.E.; Alemdar, H.; Lennox, B.; Şahin, E.; Arvin, F.; Schmickl, T. A minimally invasive approach towards “ecosystem hacking” with honeybees. Front. Robot. AI 2022, 9, 791921. [Google Scholar] [CrossRef]
- Turyagyenda, A.; Katumba, A.; Akol, R.; Nsabagwa, M.; Mkiramweni, M.E. IoT and Machine Learning Techniques for Precision Beekeeping: A Review. AI 2025, 6, 26. [Google Scholar] [CrossRef]
- Bilik, S.; Zemcik, T.; Kratochvila, L.; Ricanek, D.; Richter, M.; Zambanini, S.; Horak, K. Machine learning and computer vision techniques in continuous beehive monitoring applications: A survey. Comput. Electron. Agric. 2024, 217, 108560. [Google Scholar] [CrossRef]
- Jeong, K.; Oh, H.; Lee, Y.; Seo, H.; Jo, G.; Jeong, J.; Park, G.; Choi, J.; Seo, Y.D.; Jeong, J.H.; et al. IoT and AI systems for enhancing bee colony strength in precision beekeeping: A survey and future research directions. IEEE Internet Things J. 2024, 12, 362–389. [Google Scholar] [CrossRef]
- Šabić, J.; Perković, T.; Šolić, P.; Šerić, L. Buzzing with Intelligence: A Systematic Review of Smart Beehive Technologies. Sensors 2025, 25, 5359. [Google Scholar] [CrossRef]
- Kongsilp, P.; Taetragool, U.; Duangphakdee, O. Individual honey bee tracking in a beehive environment using deep learning and Kalman filter. Sci. Rep. 2024, 14, 1061. [Google Scholar] [CrossRef] [PubMed]
- Hu, J.; Chen, Y.; Zhang, H.; Zhang, Y.; Shi, Z.; Ren, J.; Ye, H.; Zuo, Z.; Luo, Z. A 3D group object tracking method for honeybees in open spaces. Comput. Electron. Agric. 2025, 237, 110535. [Google Scholar] [CrossRef]
- Matuzevičius, D.; Urbanavičius, V.; Miniotas, D.; Mikučionis, Š.; Laptik, R.; Ušinskas, A. Key-Point-Descriptor-Based Image Quality Evaluation in Photogrammetry Workflows. Electronics 2024, 13, 2112. [Google Scholar] [CrossRef]
- Crailsheim, K. Trophallactic interactions in the adult honeybee (Apis mellifera L.). Apidologie 1998, 29, 97–112. [Google Scholar] [CrossRef]
- Trhlin, M.; Rajchard, J. Chemical communication in the honeybee (Apis mellifera L.): A review. Vet. Med. 2011, 56, 265–273. [Google Scholar] [CrossRef]
- De Marco, R.; Farina, W. Trophallaxis in forager honeybees (Apis mellifera): Resource uncertainty enhances begging contacts? J. Comp. Physiol. A 2003, 189, 125–134. [Google Scholar] [CrossRef]
- Blut, C.; Crespi, A.; Mersch, D.; Keller, L.; Zhao, L.; Kollmann, M.; Schellscheidt, B.; Fülber, C.; Beye, M. Automated computer-based detection of encounter behaviours in groups of honeybees. Sci. Rep. 2017, 7, 17663. [Google Scholar] [CrossRef]
- Gernat, T.; Rao, V.D.; Middendorf, M.; Dankowicz, H.; Goldenfeld, N.; Robinson, G.E. Automated monitoring of behavior reveals bursty interaction patterns and rapid spreading dynamics in honeybee social networks. Proc. Natl. Acad. Sci. USA 2018, 115, 1433–1438. [Google Scholar] [CrossRef]
- Bernardes, R.C.; Lima, M.A.P.; Guedes, R.N.C.; da Silva, C.B.; Martins, G.F. Ethoflow: Computer vision and artificial intelligence-based software for automatic behavior analysis. Sensors 2021, 21, 3237. [Google Scholar] [CrossRef]
- Gernat, T.; Jagla, T.; Jones, B.M.; Middendorf, M.; Robinson, G.E. Automated monitoring of honey bees with barcodes and artificial intelligence reveals two distinct social networks from a single affiliative behavior. Sci. Rep. 2023, 13, 1541. [Google Scholar] [CrossRef]
- Matuzevičius, D. A Retrospective Analysis of Automated Image Labeling for Eyewear Detection Using Zero-Shot Object Detectors. Electronics 2024, 13, 4763. [Google Scholar] [CrossRef]
- Gharooni-Fard, G.; Byers, M.; Deshmukh, V.; Bradley, E.; Mayo, C.; Topaz, C.M.; Peleg, O. A computational topology-based spatiotemporal analysis technique for honeybee aggregation. npj Complex. 2024, 1, 3. [Google Scholar] [CrossRef]
- Matuzevičius, D. Synthetic Data Generation for the Development of 2D Gel Electrophoresis Protein Spot Models. Appl. Sci. 2022, 12, 4393. [Google Scholar] [CrossRef]
- Geffre, A.C.; Gernat, T.; Harwood, G.P.; Jones, B.M.; Morselli Gysi, D.; Hamilton, A.R.; Bonning, B.C.; Toth, A.L.; Robinson, G.E.; Dolezal, A.G. Honey bee virus causes context-dependent changes in host social behavior. Proc. Natl. Acad. Sci. USA 2020, 117, 10406–10413. [Google Scholar] [CrossRef]
- Boff, S.; Friedel, A.; Mussury, R.M.; Lenis, P.R.; Raizer, J. Changes in social behavior are induced by pesticide ingestion in a Neotropical stingless bee. Ecotoxicol. Environ. Saf. 2018, 164, 548–553. [Google Scholar] [CrossRef]
- Zhang, F.; Cao, W.; Zhang, Y.; Luo, J.; Hou, J.; Chen, L.; Yi, G.; Li, H.; Huang, M.; Dong, L.; et al. S-dinotefuran affects the social behavior of honeybees (Apis mellifera) and increases their risk in the colony. Pestic. Biochem. Physiol. 2023, 196, 105594. [Google Scholar] [CrossRef] [PubMed]
- Farina, W.M.; Wainselboim, A.J. Trophallaxis within the dancing context: A behavioral and thermographic analysis in honeybees (Apis mellifera). Apidologie 2005, 36, 43–47. [Google Scholar] [CrossRef][Green Version]
- Wainselboim, A.J.; Farina, W.M. Trophallaxis in the honeybee Apis mellifera (L.): The interaction between flow of solution and sucrose concentration of the exploited food sources. Anim. Behav. 2000, 59, 1177–1185. [Google Scholar] [CrossRef] [PubMed]
- Gil, M.; De Marco, R.J. Olfactory learning by means of trophallaxis in Apis mellifera. J. Exp. Biol. 2005, 208, 671–680. [Google Scholar] [CrossRef]
- Mc Cabe, S.I.; Hrncir, M.; Farina, W.M. Vibrating donor-partners during trophallaxis modulate associative learning ability of food receivers in the stingless bee Melipona quadrifasciata. Learn. Motiv. 2015, 50, 11–21. [Google Scholar] [CrossRef]
- Ramsey, M.; Bencsik, M.; Newton, M.I. Long-term trends in the honeybee ‘whooping signal’revealed by automated detection. PLoS ONE 2017, 12, e0171162. [Google Scholar]
- Romero-González, J.E.; Solvi, C.; Peng, F.; Chittka, L. Behaviour of honeybees integrated into bumblebee nests and the responses of their hosts. Apidologie 2024, 55, 50. [Google Scholar] [CrossRef]
- Langlands, Z.; du Rand, E.E.; Crailsheim, K.; Yusuf, A.A.; Pirk, C.W. Prisoners receive food fit for a queen: Honeybees feed small hive beetles protein-rich glandular secretions through trophallaxis. J. Exp. Biol. 2021, 224, 1–9. [Google Scholar] [CrossRef] [PubMed]
- Neumann, P.; Naef, J.; Crailsheim, K.; Crewe, R.M.; Pirk, C.W. Hit-and-run trophallaxis of small hive beetles. Ecol. Evol. 2015, 5, 5478–5486. [Google Scholar] [CrossRef]
- Weidenmüller, A.; Tautz, J. In-hive behavior of pollen foragers (Apis mellifera) in honey bee colonies under conditions of high and low pollen need. Ethology 2002, 108, 205–221. [Google Scholar] [CrossRef]
- Wang, J.; Cherian, A.; Porikli, F. Ordered pooling of optical flow sequences for action recognition. In Proceedings of the 2017 IEEE Winter Conference on Applications of Computer Vision (WACV), Santa Rosa, CA, USA, 24–31 March 2017; IEEE: Piscataway, NJ, USA, 2017; pp. 168–176. [Google Scholar]
- Kim, K.; Gowda, S.N.; Mac Aodha, O.; Sevilla-Lara, L. Capturing temporal information in a single frame: Channel sampling strategies for action recognition. arXiv 2022, arXiv:2201.10394. [Google Scholar] [CrossRef]
- van Leeuwen, M.C.; Fokkinga, E.P.; Huizinga, W.; Baan, J.; Heslinga, F.G. Toward versatile small object detection with Temporal-YOLOv8. Sensors 2024, 24, 7387. [Google Scholar] [CrossRef]
- Zhang, Y.; Yu, Y. Gtm: Gray temporal model for video recognition. arXiv 2021, arXiv:2110.10348. [Google Scholar] [CrossRef]
- Bilen, H.; Fernando, B.; Gavves, E.; Vedaldi, A.; Gould, S. Dynamic image networks for action recognition. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, Las Vegas, NV, USA, 27–30 June 2016; pp. 3034–3042. [Google Scholar]
- Mukherjee, S.; Anvitha, L.; Lahari, T.M. Human activity recognition in RGB-D videos by dynamic images. Multimed. Tools Appl. 2020, 79, 19787–19801. [Google Scholar] [CrossRef]
- Kopuklu, O.; Kose, N.; Rigoll, G. Motion fused frames: Data level fusion strategy for hand gesture recognition. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition Workshops, Salt Lake City, UT, USA, 18–22 June 2018; pp. 2103–2111. [Google Scholar]
- Loshchilov, I. Decoupled weight decay regularization. arXiv 2017, arXiv:1711.05101. [Google Scholar]









| Approach | YOLOv8 | YOLO11 | YOLO12 | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| n | s | m | l | x | n | s | m | l | x | n | s | m | l | x | |
| Model input resolution: px | |||||||||||||||
| RGB, % | 78.8 | 84.5 | 84.7 | 85.8 | 85.8 | 76.2 | 84.4 | 84.6 | 86.2 | 86.4 | 80 | 82.1 | 85.2 | 85.7 | 86.4 |
| TSG, % | 86.1 | 91.9 | 91.9 | 92.1 | 92.5 | 86 | 90.7 | 92.1 | 92.5 | 93.5 | 86.6 | 90.3 | 91.8 | 93.1 | 93.7 |
| TEM, % | 85.4 | 88.9 | 91.9 | 92 | 92.7 | 86.7 | 89.3 | 91 | 92.6 | 92.9 | 85.4 | 90.5 | 92.6 | 92.8 | 93.5 |
| TEMA-0.17s, % | 90.4 | 90.9 | 93.2 | 94.1 | 94.9 | 90.8 | 91.9 | 94.2 | 94.5 | 94.5 | 87.3 | 89.8 | 93.8 | 94.8 | 94.8 |
| TEMA-0.3s, % | 91.5 | 94.3 | 94.9 | 95.1 | 95.2 | 90.9 | 93 | 93.6 | 94.6 | 95.1 | 89.8 | 93.6 | 94.8 | 95 | 95.8 |
| TEMA-0.5s, % | 92 | 94.2 | 95.1 | 95.2 | 95.8 | 92.7 | 93.1 | 95.2 | 95.3 | 95.6 | 93.1 | 93.2 | 94.6 | 95.7 | 96 |
| TEMA-1s, % | 93.3 | 95.3 | 95.5 | 95.6 | 96.4 | 94.2 | 94.5 | 95.3 | 96 | 96.2 | 92.4 | 94.6 | 95.4 | 96.4 | 96.4 |
| TEMA-2s, % | 93.6 | 93.6 | 95.3 | 95.6 | 96.1 | 93.1 | 94.3 | 94.6 | 95.7 | 96.3 | 91.8 | 94.8 | 95.4 | 95.7 | 96.1 |
| Time, ms | 13.3 | 13.6 | 15.3 | 17.3 | 25.2 | 15.4 | 15.7 | 17.7 | 16.2 | 22.9 | 19.3 | 19.5 | 20.3 | 28.8 | 29.6 |
| Model input resolution: px | |||||||||||||||
| TEMA-1s, % | 85.8 | 89.2 | 91.1 | 91.2 | 91.8 | 81.2 | 91.2 | 91.5 | 92.4 | 92.6 | 85.6 | 90.2 | 91.3 | 92.6 | 93.4 |
| Time, ms | 9.9 | 10.1 | 11.9 | 13.9 | 14.2 | 12 | 12.2 | 14.2 | 19.5 | 20 | 16 | 16.2 | 16.9 | 25.2 | 25.8 |
| Model input resolution: px | |||||||||||||||
| TEMA-1s, % | 48.7 | 63.8 | 65.2 | 69.8 | 73.9 | 47.2 | 64.3 | 70 | 71.5 | 73.2 | 48.8 | 66.9 | 70.8 | 73.6 | 73.9 |
| Time, ms | 8.9 | 9 | 10.9 | 12.4 | 12.7 | 10.8 | 11.1 | 13.2 | 18.4 | 18.7 | 14.9 | 15.1 | 16 | 24.3 | 24.9 |
| Model | YOLOv8 | YOLO11 | YOLO12 | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| n | s | m | l | x | n | s | m | l | x | n | s | m | l | x | |
| PyTorch | 26 | 22 | 18 | 15 | 11 | 23 | 22 | 18 | 17 | 11 | 23 | 20 | 16 | 11 | 8 |
| FP32 | 27 | 23 | 20 | 17 | 13 | 26 | 23 | 20 | 19 | 14 | 24 | 21 | 17 | 14 | 10 |
| FP16 | 31 | 27 | 23 | 22 | 19 | 29 | 26 | 24 | 22 | 20 | 27 | 24 | 21 | 19 | 15 |
| INT8 | 32 | 30 | 25 | 23 | 21 | 30 | 28 | 24 | 23 | 21 | 27 | 25 | 21 | 19 | 15 |
| PyTorch (RTX) | 75 | 74 | 65 | 58 | 40 | 65 | 64 | 56 | 44 | 43 | 52 | 51 | 49 | 35 | 34 |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2025 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Vdoviak, G.; Sledevič, T. Temporal Encoding Strategies for YOLO-Based Detection of Honeybee Trophallaxis Behavior in Precision Livestock Systems. Agriculture 2025, 15, 2338. https://doi.org/10.3390/agriculture15222338
Vdoviak G, Sledevič T. Temporal Encoding Strategies for YOLO-Based Detection of Honeybee Trophallaxis Behavior in Precision Livestock Systems. Agriculture. 2025; 15(22):2338. https://doi.org/10.3390/agriculture15222338
Chicago/Turabian StyleVdoviak, Gabriela, and Tomyslav Sledevič. 2025. "Temporal Encoding Strategies for YOLO-Based Detection of Honeybee Trophallaxis Behavior in Precision Livestock Systems" Agriculture 15, no. 22: 2338. https://doi.org/10.3390/agriculture15222338
APA StyleVdoviak, G., & Sledevič, T. (2025). Temporal Encoding Strategies for YOLO-Based Detection of Honeybee Trophallaxis Behavior in Precision Livestock Systems. Agriculture, 15(22), 2338. https://doi.org/10.3390/agriculture15222338

