Computer Vision for Emotion Identification on Sheep Images
DOI:
https://doi.org/10.21439/jme.v9i1.133Keywords:
Computer Vision, EfficientNet, Emotion detection, Pre-trained model, ResNet101, ResNet152, ResNet50, VGG16, YOLOv8Abstract
The rising global demand for meat and dairy products has accelerated the expansion of livestock farming, underscoring the need for advanced technologies to ensure animal welfare and productivity. This research explores the potential of automated monitoring systems, leveraging depth sensors and time-of-flight cameras, to provide valuable insights into environmental conditions, nutrition, health, and productivity. These systems enable the early detection of abnormal behaviors in large-scale farming operations, paving the way for more effective management practices. The study emphasizes the importance of understanding animal needs and introduces advanced models, including EfficientNet, ResNet50, ResNet101, ResNet152, and VGG16, for emotion recognition in sheep. These models achieve impressive accuracy rates ranging from 88% to 93%, significantly enhancing the ability to detect and classify emotional states such as pain. This capability represents a vital component of precision livestock farming, a practice that integrates real-time data with machine learning to support informed decision-making, optimize yields, and mitigate risks. Furthermore, the research highlights methodologies for animal identification, body condition assessment, and pain estimation, showcasing the potential of sophisticated imaging and perception technologies to revolutionize livestock farming. By improving welfare and operational efficiency, these advancements offer a sustainable approach to addressing the growing challenges in modern agriculture.
Downloads
References
ARULMOZHI, E.; BHUJEL, A.; MOON, B.-E.; KIM, H.-T. The application of cameras in precision pig farming: an overview for swine-keeping professionals. *Animals*, v. 11, n. 8, 2021. ISSN 2076-2615. Disponível em: [https://www.mdpi.com/2076-2615/11/8/2343](https://www.mdpi.com/2076-2615/11/8/2343). Acesso em: 28 out. 2025.
BAMJI, C.; GODBAZ, J.; OH, M.; MEHTA, S.; PAYNE, A.; ORTIZ, S.; NAGARAJA, S.; PERRY, T.; THOMPSON, B. A review of indirect time-of-flight technologies. *IEEE Transactions on Electron Devices*, v. 69, n. 6, p. 2779–2793, 2022.
DUTTA, D.; NATTA, D.; MANDAL, S.; GHOSH, N. Moonitor: an IoT based multisensory intelligent device for cattle activity monitoring. *Sensors and Actuators A: Physical*, v. 333, p. 113271, 2022.
FUENTES, A.; YOON, S.; PARK, J.; PARK, D. S. Deep learning-based hierarchical cattle behavior recognition with spatio-temporal information. *Computers and Electronics in Agriculture*, v. 177, p. 105627, 2020.
GALLAGHER, J. How to Train YOLOv8 Object Detection on a Custom Dataset. *Roboflow Blog*, 2023. Disponível em: [https://blog.roboflow.com/how-to-train-yolov8-on-a-custom-dataset/](https://blog.roboflow.com/how-to-train-yolov8-on-a-custom-dataset/). Acesso em: 28 out. 2025.
HÄGER, C.; BIERNOT, S.; BUETTNER, M.; GLAGE, S.; KEUBLER, L. M.; HELD, N.; BLEICH, E. M.; OTTO, K.; MÜLLER, C. W.; DECKER, S. et al. The sheep grimace scale as an indicator of post-operative distress and pain in laboratory sheep. *PLoS ONE*, v. 12, n. 4, p. e0175839, 2017.
JIA, N.; KOOTSTRA, G.; KOERKAMP, P. G.; SHI, Z.; DU, S. Segmentation of body parts of cows in RGB-depth images based on template matching. *Computers and Electronics in Agriculture*, v. 180, p. 105897, 2021.
LIU, D.; HE, D.; NORTON, T. Automatic estimation of dairy cattle body condition score from depth image using ensemble model. *Biosystems Engineering*, v. 194, p. 16–27, 2020.
MCLENNAN, K. M.; REBELO, C. J.; CORKE, M. J.; HOLMES, M. A.; LEACH, M. C.; CONSTANTINO-CASAS, F. Development of a facial expression scale using footrot and mastitis as models of pain in sheep. *Applied Animal Behaviour Science*, v. 176, p. 19–26, 2016.
NEETHIRAJAN, S.; KEMP, B. Digital livestock farming. *Sensing and Bio-Sensing Research*, v. 32, p. 100408, 2021.
NIE, L.; LI, B.; DU, Y.; JIAO, F.; SONG, X.; LIU, Z. Deep learning strategies with CretoNext-YOLOv5 for advanced pig face emotion detection. *Scientific Reports*, v. 14, n. 1, p. 1–19, 2024. Disponível em: [https://www.nature.com/articles/s41598-024-51755-8](https://www.nature.com/articles/s41598-024-51755-8). Acesso em: 28 out. 2025.
NILOOFAR, P.; FRANCIS, D. P.; LAZAROVA-MOLNAR, S.; VULPE, A.; VOCHIN, M. C.; SUCIU, G.; BALANESCU, M.; ANESTIS, V.; BARTZANAS, T. Data-driven decision support in livestock farming for improved animal health, welfare and greenhouse gas emissions: overview and challenges. *Computers and Electronics in Agriculture*, v. 190, p. 106406, 2021.
NOOR, A.; ZHAO, Y. Sheep Facial Expression Primary Data-set. *Mendeley Data*, 15 mar. 2020. Disponível em: [https://data.mendeley.com/datasets/y5sm4smnfr/5](https://data.mendeley.com/datasets/y5sm4smnfr/5). Acesso em: 28 out. 2025.
NOOR, A.; ZHAO, Y.; KOUBÂA, A.; WU, L.; KHAN, R.; ABDALLA, F. Y. Automated sheep facial expression classification using deep transfer learning. *Computers and Electronics in Agriculture*, v. 175, p. 105528, 2020.
PESSANHA, F.; SALAH, A. A.; LOON, T. van; VELTKAMP, R. Facial image-based automatic assessment of equine pain. *IEEE Transactions on Affective Computing*, v. 14, n. 3, p. 2064–2076, 2023.
REZA, M. N.; LEE, K.-H.; HABINEZA, E.; SAMSUZZAMAN, S.; KYOUNG, H.; CHOI, Y. K.; KIM, G.; CHUNG, S.-O. RGB-based machine vision for enhanced pig disease symptoms monitoring and health management: a review. *Journal of Animal Science and Technology*, p. –, 2024. Disponível em: [https://doi.org/10.5187/jast.2024.e111](https://doi.org/10.5187/jast.2024.e111). Acesso em: 28 out. 2025.
ROBOFLOW. *Roboflow: Give your software the power to see objects in images and video*, 2023. Disponível em: [https://roboflow.com](https://roboflow.com). Acesso em: 28 out. 2025.
ROY, R.; BARAL, M. M.; PAL, S. K.; KUMAR, S.; MUKHERJEE, S.; JANA, B. Discussing the present, past, and future of machine learning techniques in livestock farming: a systematic literature review. In: *INTERNATIONAL CONFERENCE ON MACHINE LEARNING, BIG DATA, CLOUD AND PARALLEL COMPUTING (COM-IT-CON)*, 2022. [S.l.: s.n.], v. 1, p. 179–183, 2022.
SANT’ANA, D. A.; PACHE, M. C. B.; MARTINS, J.; SOARES, W. P.; MELO, S. L. N. de; GARCIA, V.; WEBER, V. A. de M.; HEIMBACH, N. da S.; MATEUS, R. G.; PISTORI, H. Weighing live sheep using computer vision techniques and regression machine learning. *Machine Learning with Applications*, v. 5, p. 100076, 2021.
SARWAR, F.; GRIFFIN, A.; REHMAN, S. U.; PASANG, T. Detecting sheep in UAV images. *Computers and Electronics in Agriculture*, v. 187, p. 106219, 2021.
STEAGALL, P. V.; BUSTAMANTE, H.; JOHNSON, C. B.; TURNER, P. V. Pain management in farm animals: focus on cattle, sheep and pigs. *Animals*, v. 11, p. 1483, 2021. Disponível em: [https://www.mdpi.com/2076-2615/11/6/1483/htm](https://www.mdpi.com/2076-2615/11/6/1483/htm). Acesso em: 28 out. 2025.
STRAW, A. D. Review of methods for animal videography using camera systems that automatically move to follow the animal. *Integrative and Comparative Biology*, v. 61, n. 3, p. 917–925, jun. 2021. ISSN 1540-7063. Disponível em: [https://doi.org/10.1093/icb/icab126](https://doi.org/10.1093/icb/icab126). Acesso em: 28 out. 2025.
TSAI, Y. C.; HSU, J. T.; DING, S. T.; RUSTIA, D. J. A.; LIN, T. T. Assessment of dairy cow heat stress by monitoring drinking behaviour using an embedded imaging system. *Biosystems Engineering*, v. 199, p. 97–108, 2020.
XU, S.; ZHENG, H.; TAO, S.; CHAI, Y.; HE, Q.; CHEN, H. A lightweight pig face recognition method based on efficient mobile network and horizontal vertical attention mechanism. *IEEE Transactions on Instrumentation and Measurement*, v. 73, p. 1–14, 2024.
YADAV, C. S.; PEIXOTO, A. A. T.; RUFINO, L. A. L.; SILVEIRA, A. B.; ALEXANDRIA, A. R. d. Intelligent classifier for identifying and managing sheep and goat faces using deep learning. *AgriEngineering*, v. 6, n. 4, p. 3586–3601, 2024. ISSN 2624-7402. Disponível em: [https://www.mdpi.com/2624-7402/6/4/204](https://www.mdpi.com/2624-7402/6/4/204). Acesso em: 28 out. 2025.
YU, S.; LIU, X.; TAN, Q.; WANG, Z.; ZHANG, B. Sensors, systems and algorithms of 3D reconstruction for smart agriculture and precision farming: a review. *Computers and Electronics in Agriculture*, v. 224, p. 109229, 2024. ISSN 0168-1699. Disponível em: [https://www.sciencedirect.com/science/article/pii/S0168169924006203](https://www.sciencedirect.com/science/article/pii/S0168169924006203). Acesso em: 28 out. 2025.
Downloads
Published
How to Cite
Issue
Section
License
Copyright (c) 2026 Journal of Mechatronics Engineering

This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
Authors publishing in the Journal of Mechatronics Engineering agree to the following terms: Authors retain copyright and grant the journal the right of first publication, with the work licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License (CC BY - NC-SA 4.0). Our articles are available free and free, with privileges for educational, fishing and non-commercial activities.
