Exploring Key Visual Features for Early Lameness Detection: Toward Transparent Intelligence

Document Type : Original Research

Authors

1 Department of Agricultural Machinery Engineering, Faculty of Agriculture, University of Tehran, Karaj, Iran.

2 Department of Biosystems Engineering, Faculty of Agriculture, University of Tabriz, Tabriz, Iran.

Abstract

Lameness in cattle, characterized by abnormal stride and gait, poses significant economic and welfare challenges in agriculture. Traditional visual inspections lack accuracy and scalability, prompting the development of transparent computer vision-based detection systems. This study leverages a dataset of 170 cattle videos from public sources and the University of Tehran’s Cattle Farm, preprocessed into 1226 one-second sub-clips (416×416 pixels, 25 FPS) to mitigate noise from unpredictable cattle behavior. Using the YOLOv7 model, we extracted 35 temporal features, including step sizes, speed, acceleration, and relative head-to-leg coordinates, focusing on the cattle’s head, legs, and back. These features were further engineered using time-series characterization techniques and hypothesis testing, yielding 3773 features. A deep learning model, trained on these features, achieved 88.66% accuracy and 93.74% AUC, while a Light Gradient Boosting Machine model on engineered features reached 81.3% accuracy and 90.8% AUC. Sensitivity analysis highlighted leg and head-related features as critical for lameness detection. By emphasizing interpretable features and robust modeling, this approach enhances transparency, improving animal welfare and farm productivity under diverse conditions.

Keywords


Abbasian Ardakani, A., Mohammadi, A., Mirza‐Aghazadeh‐Attari, M., Faeghi, F., Vogl, T. J., & Acharya, U. R. (2023). Diagnosis of Metastatic Lymph Nodes in Patients With Papillary Thyroid Cancer: A Comparative Multi‐Center Study of Semantic Features and Deep Learning‐Based Models. Journal of Ultrasound in Medicine, 42(6), 1211-1221. https://doi.org/10.1002/jum.16131
Abdul Jabbar, K., Hansen, M. F., Smith, M. L., & Smith, L. N. (2017). Early and non-intrusive lameness detection in dairy cows using 3-dimensional video. Biosystems Engineering, 153, 63-69. https://doi.org/10.1016/j.biosystemseng.2016.09.017
Alban, L., Agger, J., & Lawson, L. (1996). Lameness in tied Danish dairy cattle: the possible influence of housing systems, management, milk yield, and prior incidents of lameness. Preventive veterinary medicine, 29(2), 135-149. https://doi.org/10.1016/S0167-5877(96)01066-5
Alsaaod, M., Schaefer, A. L., Büscher, W., & Steiner, A. (2015). The role of infrared thermography as a non-invasive tool for the detection of lameness in cattle. Sensors, 15(6), 14513-14525. https://doi.org/10.3390/s150614513
Arrieta, A. B., Díaz-Rodríguez, N., Del Ser, J., Bennetot, A., Tabik, S., Barbado, A., García, S., Gil-López, S., Molina, D., & Benjamins, R. (2020). Explainable Artificial Intelligence (XAI): Concepts, taxonomies, opportunities and challenges toward responsible AI. Information fusion, 58, 82-115. https://doi.org/10.1016/j.inffus.2019.12.012
Bagheri, N., Aghdam, M. J., & Ebrahimi, H. (2024). Estimating Nitrogen and Chlorophyll Content in Corn Using Spectral Vegetation Indices Derived From UAV Multispectral Imagery. Biomechanism and Bioenergy Research, 3(1), 81-93.‏ https://doi.org/10.22103/BBR.2024.23234.1082
Barkema, H. W., Westrik, J. D., van Keulen, K. A. S., Schukken, Y. H., & Brand, A. (1994). The effects of lameness on reproductive performance, milk production and culling in Dutch dairy farms. Preventive veterinary medicine, 20(4), 249-259. https://doi.org/10.1016/0167-5877(94)90058-2
Christ, M., Braun, N., Neuffer, J., & Kempa-Liehr, A. W. (2018). Time series feature extraction on basis of scalable hypothesis tests (tsfresh–a python package). Neurocomputing, 307, 72-77. https://doi.org/10.1016/j.neucom.2018.03.067
Ettema, J. F., & Østergaard, S. (2006). Economic decision making on prevention and control of clinical lameness in Danish dairy herds. Livestock science, 102(1-2), 92-106. https://doi.org/10.1016/j.livprodsci.2005.11.021
Flower, F. C., & Weary, D. M. (2006). Effect of Hoof Pathologies on Subjective Assessments of Dairy Cow Gait. Journal of Dairy Science, 89(1), 139-146. https://doi.org/10.3168/jds.S0022-0302(06)72077-X
Green, L. E., Hedges, V. J., Schukken, Y. H., Blowey, R. W., & Packington, A. J. (2002). The Impact of Clinical Lameness on the Milk Yield of Dairy Cows. Journal of Dairy Science, 85(9), 2250-2256. https://doi.org/10.3168/jds.S0022-0302(02)74304-X
Huxley, J. (2013). Impact of lameness and claw lesions in cows on health and production. Livestock science, 156(1-3), 64-70. https://doi.org/10.1016/j.livsci.2013.06.012
Jia, Z., Zhao, Y., Mu, X., Liu, D., Wang, Z., Yao, J., & Yang, X. (2025). Intelligent Deep Learning and Keypoint Tracking-Based Detection of Lameness in Dairy Cows. Veterinary Sciences12(3), 218.‏  https://doi.org/10.3390/vetsci12030218
Jiang, B., Song, H., & He, D. (2019). Lameness detection of dairy cows based on a double normal background statistical model. Computers and Electronics in Agriculture, 158, 140-149. https://doi.org/10.1016/j.compag.2019.01.025
Lecun, Y., Bengio, Y., & Hinton, G. (2015). Deep learning. nature, 521(7553), 436-444. https://doi.org/10.1038/nature14539
Melendez, P., Bartolome, J., Archbald, L. F., & Donovan, A. (2003). The association between lameness, ovarian cysts and fertility in lactating dairy cows. Theriogenology, 59(3), 927-937. https://doi.org/10.1016/S0093-691X(02)01152-4
Merkin, A., Krishnamurthi, R., & Medvedev, O. N. (2022). Machine learning, artificial intelligence and the prediction of dementia. Current Opinion in Psychiatry, 35(2), 123-129. https://doi.org/10.1097/YCO.0000000000000768
Ogundari, K., & Bolarinwa, O. D. (2018). Impact of agricultural innovation adoption: a meta‐analysis. Australian Journal of Agricultural and Resource Economics, 62(2), 217-236. https://doi.org/10.1111/1467-8489.12247
Oliveira, D. F., Vismari, L. F., Nascimento, A. M., de Almeida, J. R., Cugnasca, P. S., Camargo, J. B., Almeida, L., Gripp, R., & Neves, M. (2021). A new interpretable unsupervised anomaly detection method based on residual explanation. IEEE Access, 10, 1401-1409. https://doi.org/10.1109/ACCESS.2021.3137633
Peng, J., Zhao, Z., & Liu, D. (2022). Impact of Agricultural Mechanization on Agricultural Production, Income, and Mechanism: Evidence From Hubei Province, China [Original Research]. Frontiers in Environmental Science, 10, 838686. https://doi.org/10.3389/fenvs.2022.838686
Ryu, H. W., & Tai, J. H. (2022). Object detection and tracking using a high-performance artificial intelligence-based 3D depth camera: towards early detection of African swine fever. Journal of Veterinary Science, 23(1), e17. https://doi.org/10.4142/jvs.21252
Schlageter-Tello, A., Bokkers, E. A., Koerkamp, P. W. G., Van Hertem, T., Viazzi, S., Romanini, C. E., Halachmi, I., Bahr, C., Berckmans, D., & Lokhorst, K. (2014). Manual and automatic locomotion scoring systems in dairy cows: A review. Preventive veterinary medicine, 116(1-2), 12-25. https://doi.org/10.1016/j.prevetmed.2014.06.006
Schmid, U., & Finzel, B. (2020). Mutual explanations for cooperative decision making in medicine. KI-Künstliche Intelligenz, 34(2), 227-233. https://doi.org/10.1007/s13218-020-00633-2
Shrestha, A., Loukas, C., Kernec, J. L., Fioranelli, F., Busin, V., Jonsson, N., King, G., Tomlinson, M., Viora, L., & Voute, L. (2018). Animal Lameness Detection With Radar Sensing. IEEE Geoscience and Remote Sensing Letters, 15(8), 1189-1193. https://doi.org/10.1109/LGRS.2018.2832650  
Sprecher, D., et al., Hostetler, D. E., & Kaneene, J. (1997). A lameness scoring system that uses posture and gait to predict dairy cattle reproductive performance. Theriogenology, 47(6), 1179-1187. https://doi.org/10.1016/S0093-691X(97)00098-8
Wang, C.-Y., Bochkovskiy, A., & Liao, H.-Y. M. (2023). YOLOv7: Trainable bag-of-freebies sets new state-of-the-art for real-time object detectors. Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), 7464–7475. https://doi.org/10.1109/CVPR52729.2023.00721
Warnick, L., Janssen, D., Guard, C., & Gröhn, Y. (2001). The effect of lameness on milk production in dairy cows. Journal of Dairy Science, 84(9), 1988-1997. https://doi.org/10.3168/jds.S0022-0302(01)74642-5
Wu, D., Wu, Q., Yin, X., Jiang, B., Wang, H., He, D., & Song, H. (2020). Lameness detection of dairy cows based on the YOLOv3 deep learning algorithm and a relative step size characteristic vector. Biosystems Engineering, 189, 150-163. https://doi.org/10.1016/j.biosystemseng.2019.11.017