Kevin Rafi Pranaja 1, Giva Andriana Mutiara 2*, Marlindia Ike Sari 3

Computer Technology Program Study, Department of Applied Sciences, Telkom University Main Campus, Bandung, Indonesia


 

Download Citation: |
Download PDF


ABSTRACT


Real-time monitoring of livestock behavior is essential for improving animal welfare and optimizing farm productivity. Traditional manual observation is often inefficient, error-prone, and labour-intensive. This study proposes a computer vision-based system for real-time classification of horned sheep behaviours, specifically wake, lay, and sleep, using transfer learning with the YOLOv8 segmentation model. The system is designed for top-view camera setups in one-sheep-per-pen farm structures, enhancing visibility and minimizing occlusion. A dataset of over 12,000 annotated images was collected and augmented to train the model effectively. The proposed system demonstrates a classification accuracy exceeding 90% across all behavior classes, with an average detection latency below one second. Experimental results validate the model’s robustness under varied lighting and environmental conditions. This approach enables efficient and scalable behaviour monitoring without requiring additional sensors, offering a practical solution for intelligent farm management and early detection of health-related anomalies.


Keywords: Computer vision, Precision livestock farming, Real-time monitoring, Sheep behaviour recognition, Transfer learning.


Share this article with your colleagues

 


REFERENCES


  1. Alon, A., Shimshoni, I., Godo, A., Berenstein, R., Lepar, J., Bergman, N., Halachmi, I. 2023. Machine vision-based automatic lamb identification and drinking activity in a commercial farm. Animal, 17(9), 100923.

  2. Anitha, U., Narmadha, R., Sumanth, D.R., Kumar, D.N. 2020. Robust human action recognition system via image processing. Procedia Computer Science, 167, 870–877.

  3. Benos, L., Tagarakis, A.C., Dolias, G., Berruto, R., Kateris, D., Bochtis, D. 2021. Machine learning in agriculture: A comprehensive updated review. Sensors 21(11), 3758.

  4. Boğa, M., Karabıyık, M.A. 2025. Farm assistant counts sheep. Black Sea Journal of Agriculture, 8(1), 73–79.

  5. Carhuas, J.N., Grados, L.A.C., Payano, I.U., Garcia-Olarte, E., Mauricio-Ramos, Y., Eulogio, C.Q., Mohamed, M.M. H. 2025. Counting sheep: human experience vs. Yolo algorithm with drone to determine population. Veterinary Integrative Sciences, 23(2), 1–9.

  6. Chen, G, Wang, C., Yuan, Z., Wang, S., Wu, Y., Zhao, Y., Cheng, Y., Zhang, J. 2023. Light Yolov8n for Behavior Recognition of Liaoning Cashmere Goats. https://doi.org/10.2139/ssrn.4654299

  7. Cominotte, A., Fernandes, A.F.A., Dorea, J.R.R., Rosa, G.J.M., Ladeira, M.M., van Cleef, E.H.C.B., Pereira, G.L., Baldassini, W.A., Machado Neto, O.R. 2020. Automated computer vision system to predict body weight and average daily gain in beef cattle during growing and finishing phases. Livestock Science, 232, 103904.

  8. Deng, X., Yan, X., Hou, Y., Wu, H., Feng, C., Chen, L., Bi, M., Shao, Y. 2021. Detection of behavior and posture of sheep based on YOLOv3. INMATEH - Agricultural Engineering, 64(2), 457–466.

  9. Duong-Trung, H., Duong-Trung, N. 2024. Integrating YOLOv8-agri and DeepSORT for advanced motion detection in agriculture and fisheries. EAI Endorsed Transactions on Industrial Networks and Intelligent Systems, 11(1), 1–11.

  10. Dwivedi, A., Henige, M., Anklam, K., Döpfer, D. 2025. Real-time digital dermatitis detection in dairy cows on Android and iOS apps using computer vision techniques. Translational Animal Science, 9, 168.

  11. El Allali, K., Beniaich, Y., Farsi, H., M′hani, M. E. M., Jabal, M. S., Piro, M., Achaâban, M. R., Ouassat, M., Challet, E., Besson, M., Mounach, J., Pévet, P., Satté, A. 2022. Sleep pattern in the dromedary camel: a behavioral and polysomnography study. Sleep, 45(8), 101.

  12. Fotouhi, F., Menke, K., Prestholt, A., Gupta, A., Carroll, M.E., Yang, H.J., Skidmore, E.J., O’Neal, M., Merchant, N., Das, S.K., Kyveryga, P., Ganapathysubramanian, B., Singh, A.K., Singh, A., Sarkar, S. 2024. Persistent monitoring of insect-pests on sticky traps through hierarchical transfer learning and slicing-aided hyper inference. Frontiers in Plant Science, 15,1484587.

  13. Furnari, A., Farinella, G.M. 2023. Streaming egocentric action anticipation: An evaluation scheme and approach. Computer Vision and Image Understanding, 234, 103763.

  14. Gong, X., Liu, Q., Fu, R., Zhou, R., Xie, T., Chen, X. 2024. GAM-YOLOv7-tiny and Soft-NMS-AlexNet: Improved lightweight sheep body object detection and pose estimation network. Research Square, 1–37.

  15. González-Baldizón, Y., Pérez-Patricio, M., Camas-Anzueto, J.L., Rodríguez-Elías, O.M., Escobar-Gómez, E.N., Vazquez-Delgado, H.D., Guzman-Rabasa, J.A., Fragoso-Mandujano, J.A. 2022. Lamb Behaviors analysis using a predictive cnn model and a single camera. Applied Sciences, 12(9), 4712.

  16. Guarnido-Lopez, P., Ramirez-Agudelo, J.F., Denimal, E., Benaouda, M. 2024. Programming and setting up the object detection algorithm YOLO to determine feeding activities of beef cattle: a comparison between YOLOv8m and YOLOv10m. Animals, 14(19), 2821.

  17. Hu, T., Yan, R., Jiang, C., Chand, N.V., Bai, T., Guo, L., Qi, J. 2023. Grazing Sheep Behavior Recognition Based on Improved YOLOV5. Sensors, 23(10), 4752.

  18. Jiang, Z., Zhao, L., Li, S., Jia, Y. 2020. Real-time object detection method based on improved YOLOv4-tiny. https://doi.org/10.48550/arXiv.2011.04244

  19. Laghari, A.A., Estrela, V.V., Li, H., Shoulin, Y., Khan, A.A., Anwar, M.S., Wahab, A., Bouraqia, K. 2024. Quality of experience assessment in virtual/augmented reality serious games for healthcare: A systematic literature review. Technology and Disability, 36, 17–28.

  20. Laghari, A.A., Estrela, V.V., Yin, S. 2024. How to Collect and Interpret Medical Pictures Captured in Highly Challenging Environments that Range from Nanoscale to Hyperspectral Imaging. Current Medical Imaging, 20, e281222212228.

  21. Laghari, A.A., Shahid, S., Yadav, R., Karim, S., Khan, A., Li, H., Shoulin, Y. 2023. The state of art and review on video streaming. Journal of High-Speed Networks, 29, 211–236.

  22. Laghari, A.A., Sun, Y., Alhussein, M., Aurangzeb, K., Anwar, M.S., Rashid, M. 2023. Deep residual-dense network based on bidirectional recurrent neural network for atrial fibrillation detection. Scientific Reports, 13(1), 15109.

  23. Mu, Y., Hu, J., Wang, H., Li, S., Zhu, H., Luo, L., Wei, J., Ni, L., Chao, H., Hu, T., Sun, Y., Gong, H., Guo, Y. 2024. Research on the behavior recognition of beef cattle based on the improved lightweight cbr-yolo model based on YOLOv8 in multi-scene weather. Animals, 14(19), 2800.

  24. Munir, M.A., Shah, R.A., Ali, M., Laghari, A.A., Almadhor, A., Gadekallu, T.R. 2025. Enhancing gene mutation prediction with sparse regularized autoencoders in lung cancer radiomics analysis. IEEE Access, 13, 7407–7425.

  25. Noor, A., Zhao, Y., Koubaa, A., Wu, L., Khan, R., Abdalla, F.Y.O. 2020. Automated sheep facial expression classification using deep transfer learning. Computers and Electronics in Agriculture, 175, 105528.

  26. Saifudin, A., Madyawati, S.P., Yuadi, I., Rimayanti, R., Mustofa, I., Rulaningtyas, R., Gunawan, T.S., Besari, A. R.A. 2024. Monitoring cow behavior based on lying, standing, eating, and ruminating recognition using YOLOv8. Turkish Journal of Veterinary and Animal Sciences, 48(5), 190–197.

  27. Simanjuntak, N., Saragih, R. E., Pernando, Y. 2024. Utilizing Lightweight YOLOv8 Models for Accurate Determination of Ambarella Fruit Maturity Levels. Journal of Computer System and Informatics (JoSYC), 5(3), 719–728.

  28. Wang, J., Zhai, Y., Zhu, L., Xu, L., Yuan, H. 2024a. PD-YOLO: A study of daily behavioural detection in housed sheep. PLoS ONE, 19, 1-22.

  29. Wang, X., Hu, Y., Wang, M., Li, M., Zhao, W., Mao, R. 2024b. A real-time lightweight behavior recognition model for multiple dairy goats. Animals, 14(24), 1-18.

  30. Wang, Z., Hua, Z., Wen, Y., Zhang, S., Xu, X., Song, H. 2024c. E-YOLO: Recognition of estrus cow based on improved YOLOv8n model. Expert Systems with Applications, 238, 122212.

  31. Xu, Y., Nie, J., Cen, H., Wen, B., Liu, S., Li, J., Ge, J., Yu, L., Lv, L. 2023. An Image Detection Model for Aggressive Behavior of Group Sheep. Animals, 13(23), 3688.

  32. Yadav, C.S., Peixoto, A.A.T., Rufino, L.A.L., Silveira, A.B., de Alexandria, A.R. 2024. Intelligent classifier for identifying and managing sheep and goat faces using deep learning. AgriEngineering, 6(4), 3586–3601.

  33. Yin, S., Li, H., Teng, L., Laghari, A.A., Almadhor, A., Gregus, M., Sampedro, G.A. 2024. Brain CT image classification based on mask RCNN and attention mechanism. Scientific Reports, 14(1), 29300.

  34. Yu, L., Guo, J., Pu, Y., Cen, H., Li, J., Liu, S., Nie, J., Ge, J., Yang, S., Zhao, H., Xu, Y., Wu, J., Wang, K. 2023. A recognition method of ewe estrus crawling behavior based on multi-target detection layer neural network. Animals, 13(3), 413.

  35. Yu, L., Pu, Y., Cen, H., Li, J., Liu, S., Nie, J., Ge, J., Lv, L., Li, Y., Xu, Y., Guo, J., Zhao, H., Wang, K. 2022. A lightweight neural network-based method for detecting estrus behavior in ewes. Agriculture, 12(8), 1207.

  36. Yu, W., Liu, Y., Yang, X., Xie, R., Wang, C. 2024. YoloSortC3D: A YOLOv8, DeepSort, and C3D-based method for sheep rumination behavior recognition. Applied Sciences,14(23), 10801.

  37. Zhang, L., Han, G., Qiao, Y., Xu, L., Chen, L., Tang, J. 2023a. Interactive dairy goat image segmentation for precision livestock farming. Animals, 13(20), 1-17.

  38. Zhang, L., Zhao, B., He, C., Yang, F., Zhang, J. 2024. Behaviour recognition of housed sheep based on spatio-temporal information. Journal of Applied Animal Research, 52(1), 1–13.

  39. Zhang, X., Xuan, C., Xue, J., Chen, B., Ma, Y. 2023b. LSR-YOLO: A high-precision, lightweight model for sheep face recognition on the mobile end. Animals, 13(11), 1-21.

  40. Zhao, H., Mao, R., Li, M., Li, B., Wang, M. 2023. SheepInst: A high-performance instance segmentation of sheep images based on deep learning. Animals, 13(8), 1338.

  41. Zhu, H. 2024. Transfer learning on animal species recognition tasks. Advances in Engineering Innovation, 11(9), 60–63.


ARTICLE INFORMATION


Received: 2025-04-16
Revised: 2025-07-07
Accepted: 2025-08-04
Available Online: 2025-09-01


Cite this article:

Pranaja,K.R., Mutiara,G.A, Marlindia,I.S. 2025. Leveraging YOLOv8 and transfer learning for real-time classification of horned sheep behavior: a computer vision approach to precision livestock. International Journal of Applied Science and Engineering, 22, 2025112. https://doi.org/10.6703/IJASE.202509_22(3).002

  Copyright The Author(s). This is an open access article distributed under the terms of the Creative Commons Attribution License (CC BY 4.0), which permits unrestricted use, distribution, and reproduction in any medium, provided the original author and source are cited.