Submitted:
29 June 2025
Posted:
30 June 2025
You are already at the latest version
Abstract
Keywords:
1. Introduction
2. Materials and Methods
2.1. Dataset
2.1. Pain Labeling and Categorization
2.2. Video Acquisition and Processing
2.3. Dataset Composition and Diversity
2.4. Ethical Considerations
2.5. Landmark Extraction and Model Architecture
2.6. Processing Pipeline
2.7. Normalization and Data Organization
2.8. Feature Extraction and Temporal Modeling with LSTM
2.9. Temporal Sequence Construction
2.10. LSTM Model Architecture
2.11. Training Procedure
2.12. Inference Pipeline and Video-Level Classification
3. Results
3.1. Face and Landmark Detection Performance
3.1.1. Model Training and Evaluation
3.1.2. Bounding Box Detection
3.1.3. Pose Estimation and Landmark Localization
3.1.4. Implications for Downstream Processing
3.2. LSTM Model Training and Classification Performance
3.2.1. Convergence and Learning Dynamics
3.2.2. Quantitative Evaluation on Validation Data
- True Negatives (TN): 765
- True Positives (TP): 929
- False Positives (FP): 3
- False Negatives (FN): 3
- Accuracy: 0.9965
- Precision: 0.9968
- Recall: 0.9968
- F1-score: 0.9968
3.2.3. Interpretation and Limitations
3.3. Qualitative Visualization of Frame-Level Inference
3.3.1. Pain and No-Pain Frame Analysis
3.3.2. Robustness to Environmental Variability
3.3. Inference Performance on Unseen Videos
| Classification Metrics: | ||||
| precision | recall | f1-score | support | |
| NO_PAIN | 0.50 | 0.80 | 0.62 | 5 |
| PAIN | 0.83 | 0.56 | 0.67 | 9 |
| accuracy | 0.64 | 14 | ||
| macro avg | 0.67 | 0.68 | 0.64 | 14 |
| weighted avg | 0.71 | 0.64 | 0.65 | 14 |
4. Discussion
5. Conclusions
Acknowledgments
Conflicts of Interest
References
- Bai, M. and Goecke, R., 2020, October. Investigating LSTM for micro-expression recognition. In Companion Publication of the 2020 International Conference on Multimodal Interaction (pp. 7-11).
- Cain, B., 2024. Facial expressions in cattle in different affective states. https://stud.epsilon.slu.se/20429/1/cain_b_240218.pdf.
- Carbone, L., 2020. Do “Prey Species” hide their pain? Implications for ethical care and use of laboratory animals. Journal of Applied Animal Ethics Research, 2(2), pp.216-236. [CrossRef]
- Chen, J., Zhao, X., Xiong, Z. and Liu, G., 2025. EEG-Based Micro-Expression Recognition: Flexible Brain Network Reconfiguration Supporting Micro-Expressions Under Positive Emotion. Psychology Research and Behavior Management, pp.781-796. [CrossRef]
- Dong, Z., Wang, G., Lu, S., Li, J., Yan, W. and Wang, S.J., 2022. Spontaneous facial expressions and micro-expressions coding: from brain to face. Frontiers in Psychology, 12, p.784834. [CrossRef]
- Evangelista, M.C., Monteiro, B.P. and Steagall, P.V., 2022. Measurement properties of grimace scales for pain assessment in nonhuman mammals: a systematic review. Pain, 163(6), pp.e697-e714. [CrossRef]
- Farghal, M., Pajor, E., Luna, S.P., Pang, D., Windeyer, M.C. and Ceballos, M.C., 2024. Development of the calf grimace scale for pain and stress assessment in castrated Angus beef calves. Scientific Reports, 14(1), p.25620. [CrossRef]
- Gleerup, K.B., Andersen, P.H., Munksgaard, L. and Forkman, B., 2015. Pain evaluation in dairy cattle. Applied Animal Behaviour Science, 171, pp.25-32.
- Gothard, K.M., 2014. The amygdalo-motor pathways and the control of facial expressions. Frontiers in neuroscience, 8, p.43. [CrossRef]
- Guo, Q., Pei, D., Sun, Y., Langenhuizen, P.P., Orsini, C.A., Martinsen, K.H., Nordbø, Ø., Bolhuis, J.E. and Bijma, P., 2025. Multi-Object Keypoint Detection and Pose Estimation for Pigs. In Proceedings of the International Joint Conference on Computer Vision, Imaging and Computer Graphics Theory and Applications (Vol. 3, pp. 466-474).
- Henssen, D.J., Kurt, E., Kozicz, T., Van Dongen, R., Bartels, R.H. and van Cappellen van Walsum, A.M., 2016. New insights in trigeminal anatomy: a double orofacial tract for nociceptive input. Frontiers in neuroanatomy, 10, p.53. [CrossRef]
- Lu, Y., Mahmoud, M. and Robinson, P., 2017, May. Estimating sheep pain level using facial action unit detection. In 2017 12th IEEE International Conference on Automatic Face & Gesture Recognition (FG 2017) (pp. 394-399). IEEE.
- Mahato, S. and Neethirajan, S., 2024. Integrating artificial intelligence in dairy farm management− biometric facial recognition for cows. Information Processing in Agriculture. [CrossRef]
- Matsumoto, D. and Willingham, B., 2009. Spontaneous facial expressions of emotion of congenitally and noncongenitally blind individuals. Journal of personality and social psychology, 96(1), p.1. [CrossRef]
- McLennan, K.M., 2018. Why pain is still a welfare issue for farm animals, and how facial expression could be the answer. Agriculture, 8(8), p.127. [CrossRef]
- McLennan, K.M., Miller, A.L., Dalla Costa, E., Stucke, D., Corke, M.J., Broom, D.M. and Leach, M.C., 2019. Conceptual and methodological issues relating to pain assessment in mammals: The development and utilisation of pain facial expression scales. Applied Animal Behaviour Science, 217, pp.1-15. [CrossRef]
- Mota-Rojas, D., Whittaker, A.L., Coria-Avila, G.A., Martínez-Burnes, J., Mora-Medina, P., Domínguez-Oliva, A., Hernández-Avalos, I., Olmos-Hernández, A., Verduzco-Mendoza, A., Casas-Alvarado, A. and Grandin, T., 2025. How facial expressions reveal acute pain in domestic animals with facial pain scales as a diagnostic tool. Frontiers in Veterinary Science, 12, p.1546719. [CrossRef]
- Parivendan, S.C., Sailunaz, K. and Neethirajan, S., 2025. Socializing AI: Integrating Social Network Analysis and Deep Learning for Precision Dairy Cow Monitoring—A Critical Review. Animals, 15(13), p.1835. [CrossRef]
- Pennington, Z.T., Dong, Z., Feng, Y., Vetere, L.M., Page-Harley, L., Shuman, T. and Cai, D.J., 2019. ezTrack: An open-source video analysis pipeline for the investigation of animal behavior. Scientific reports, 9(1), p.19979. [CrossRef]
- Pu, Y., Zhao, Y., Ma, H. and Wang, J., 2025. A Lightweight Pig Aggressive Behavior Recognition Model by Effective Integration of Spatio-Temporal Features. Animals, 15(8), p.1159. [CrossRef]
- Rashid, M., 2021. PhD Thesis. Towards Automatic Visual Recognition of Horse Pain. University of California, Davis. https://www.proquest.com/docview/2568603713?
- Shibanoki, T., Yamazaki, Y. and Tonooka, H., 2024. A System for Monitoring Animals Based on Behavioral Information and Internal State Information. Animals, 14(2). [CrossRef]
- Tschoner, T., Mueller, K.R., Zablotski, Y. and Feist, M., 2024. Pain Assessment in Cattle by Use of Numerical Rating and Visual Analogue Scales—A Systematic Review and Meta-Analysis. Animals, 14(2), p.351. [CrossRef]
- Xu, F., Zhang, J. and Wang, J.Z., 2017. Microexpression identification and categorization using a facial dynamics map. IEEE Transactions on Affective Computing, 8(2), pp.254-267. [CrossRef]
- Yu, Z., Liu, G., Liu, Q. and Deng, J., 2018. Spatio-temporal convolutional features with nested LSTM for facial expression recognition. Neurocomputing, 317, pp.50-57. [CrossRef]
- Zhang, L., 2024. MicroEmo: Time-Sensitive Multimodal Emotion Recognition with Micro-Expression Dynamics in Video Dialogues. arXiv preprint arXiv:2407.16552.
- Zoltick, A.H., Mann, S. and Coetzee, J.F., 2024. Pain pathophysiology and pharmacology of cattle: how improved understanding can enhance pain prevention, mitigation, and welfare. Frontiers in Pain Research, 5, p.1396992. [CrossRef]







![]() |
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 (http://creativecommons.org/licenses/by/4.0/).
