Intelligent Deep Learning and Keypoint Tracking-Based Detection of Lameness in Dairy Cows
Simple Summary
Abstract
1. Introduction
2. Experimental Materials
2.1. Materials Source
2.2. Data Preprocessing
3. Keypoint Feature Extraction Method for Cow Walking
3.1. Keypoint Selection and Data Annotation
3.2. DLC Backbone Feature Extraction Network Optimization
3.3. Model Training and Evaluation
4. Locomotion Scoring Methods
4.1. Analysis of the Trajectories of Key Points During Walking
4.2. Development of Lameness Scoring Model
4.3. Model Testing
5. Conclusions
Author Contributions
Funding
Institutional Review Board Statement
Informed Consent Statement
Data Availability Statement
Acknowledgments
Conflicts of Interest
References
- Han, S.; Zhang, J.; Cheng, G.; Peng, Y.; Zhang, J.; Wu, J. Research status and challenge of automatic lameness recognition technology for dairy cows. Intell. Agric. 2020, 2, 21. [Google Scholar] [CrossRef]
- Warner, D.; Vasseur, E.; Lefebvre, D.M.; Lacroix, R. A machine learning-based decision aid for lameness in dairy herds using farm-based records. Comput. Electron. Agric. 2020, 169, 105193. [Google Scholar] [CrossRef]
- Song, H.; Jiang, B.; Wu, Q.; Li, T.; He, D. Detection of dairy cow lameness based on fitting line slope feature of head and neck outline. Trans. Chin. Soc. Agric. Eng. (Trans. CSAE) 2018, 34, 190–199. [Google Scholar] [CrossRef]
- Van Hertem, T.; Schlageter Tello, A.; Viazzi, S.; Steensels, M.; Bahr, C.; Romanini, C.E.B.; Lokhorst, K.; Maltz, E.; Halachmi, I.; Berckmans, D. Implementation of an automatic 3D vision monitor for dairy cow locomotion in a commercial farm. Biosyst. Eng. 2018, 173, 166–175. [Google Scholar] [CrossRef]
- Kang, X.; Zhang, X.; Liu, G.; Ma, L. Hoof location method of lame cow based on machine vision. Trans. Agric. Mach. 2019, 50, 276–282. [Google Scholar] [CrossRef]
- Kang, X.; Li, S.; Zhang, X.; Liu, G. Features extraction and detection of cow lameness movement based on thermal infrared videos. Trans. Chin. Soc. Agric. Eng. (Trans. CSAE) 2021, 37, 169–178. [Google Scholar] [CrossRef]
- Zhang, Z.; Chu, Y.; Wang, Y.; Wang, L.; Shen, Y.; Li, X. Lameness detection of cows based on key points of head, neck and back. Trans. Agric. Eng. 2024, 40, 157–164. [Google Scholar] [CrossRef]
- Li, Q.; Chu, M.Y.; Kang, X.; Liu, G. Research progress on lameness recognition technology in dairy cows using computer vision. Trans. Chin. Soc. Agric. Eng. (Trans. CSAE) 2022, 38, 159–169. [Google Scholar] [CrossRef]
- Zhang, G. Clinical diagnosis of lameness in cattle. China Dairy 2021, 0, 68–71. [Google Scholar] [CrossRef]
- Su, L.; Zhang, Y.; Wang, J.; Yin, Y.; Zong, Z.; Gong, C. Segmentation Method of Dairy Cattle Gait Based on Improved Dynamic Time Warping Algorithm. Trans. Chin. Soc. Agric. Mach. 2020, 51, 52–59. [Google Scholar] [CrossRef]
- Zhao, Y.; Zeng, F.; Jia, N.; Zhu, J.; Wang, H.; Li, B. Rapid Measurements of Pig Body Size Based on DeepLabCut Algorithm. Trans. Chin. Soc. Agric. Mach. 2023, 54, 249–255. [Google Scholar] [CrossRef]
- Guoqiang, L.; Dongjian, H.; Kaixuan, Z.; Yu, L. Research on the decomposition method of cow limb based on skeleton characteristics. Chin. J. Agric. Sci. Technol. 2017, 19, 87–94. [Google Scholar]
- Yangyang, G. Body Area Detection and Typical Behavior Classification of Cows Based on Machine Vision; Northwest Agriculture and Forestry University: Yangling, China, 2021. [Google Scholar]
- Li, Q.; Si, Y.; Chu, M.; Kang, X.; Liu, G. Lameness detection of dairy cows based on keyframe positioning and posture analysis. Comput. Electron. Agric. 2024, 227, 109537. [Google Scholar] [CrossRef]
- Tang, B.Y.; Jiao, L.B.; Xu, Y.; Wei, X.Y.; Meng, L. Image feature extraction network based on improved ResNet-50. Comput. Meas. Control 2023, 31, 162–167. [Google Scholar]
- Ye, X.; Mao, C.; Wang, H.; Yuan, S. Research on pavement type recognition based on Resnet-101 deep learning network. Times Automob. 2021. [Google Scholar]
- Li, Q.; Si, Y.; Chu, M.; Liu, N.; Kang, X.; Liu, G. A novel lameness detection method for dairy cows based on temporal gait and spatial post features. Comput. Electron. Agric. 2024, 224, 109172. [Google Scholar] [CrossRef]
- Zheng, Z.; Zhang, X.; Qin, L.; Yue, S.; Zeng, P. Cows’ legs tracking and lameness detection in dairy cattle using video analysis and Siamese neural networks. Comput. Electron. Agric. 2023, 205, 107618. [Google Scholar] [CrossRef]
- Van Den Bogaart, M.; Jacobs, N.; Molenaers, G.; Hallemans, A.; Meyns, P. Validity of deep learning-based motion capture using DeepLabCut to assess proprioception. Gait Posture 2023, 106, S212. [Google Scholar] [CrossRef]
- Jiang, B.; Song, H.; Wang, H.; Li, C. Dairy cow lameness detection using a back curvature feature. Comput. Electron. Agric. 2022, 194, 106729. [Google Scholar] [CrossRef]
- Shahinfar, S.; Khansefid, M.; Haile-Mariam, M.; Pryce, J. Machine learning approaches for the prediction of lameness in dairy cows. Animal 2021, 15, 100391. [Google Scholar] [CrossRef]
- Li, Q.; He, Z.; Liu, X.; Chu, M.; Wang, Y.; Kang, X.; Liu, G. Lameness detection system for dairy cows based on instance segmentation. Expert Syst. Appl. 2024, 249, 123775. [Google Scholar] [CrossRef]
- Slob, N.; Catal, C.; Kassahun, A. Application of machine learning to improve dairy farm management: A systematic literature review. Prev. Vet. Med. 2021, 187, 105237. [Google Scholar] [CrossRef]
- Jia, Z.; Wang, Z.; Zhao, C.; Zhang, N.; Wen, X.; Hu, Z. Pixel Self-Attention Guided Real-Time Instance Segmentation for Group Raised Pigs. Animals 2023, 13, 3591. [Google Scholar] [CrossRef]
- Jia, Z.; Yang, X.; Wang, Z.; Yu, R.; Wang, R. Automatic lameness detection in dairy cows based on machine vision. Int. J. Agric. Biol. Eng. 2023, 16, 217–224. [Google Scholar] [CrossRef]
- Cha, E.; Hertl, J.A.; Bar, D.; Gröhn, Y.T. The cost of different types of lameness in dairy cows calculated by dynamic programming. Prev. Vet. Med. 2010, 97, 1–8. [Google Scholar] [CrossRef]
- Magrin, L.; Contiero, B.; Cozzi, G.; Gottardo, F.; Segato, S. Deviation of behavioral and productive parameters in dairy cows due to a lameness event: A synthesis of reviews. Ital. J. Anim. Sci. 2023, 22. [Google Scholar] [CrossRef]
- Wu, D.; Wu, Q.; Yin, X.; Jiang, B.; Wang, H.; He, D.; Song, H. Lameness detection of dairy cows based on the YOLOv3 deep learning algorithm and a relative step size characteristic vector. Biosyst. Eng. 2020, 189, 150–163. [Google Scholar] [CrossRef]
- Beggs, D.; Jongman, E.; Hemsworth, P.; Fisher, A. Lame cows on Australian dairy farms: A comparison of farmer-identified lameness and formal lameness scoring, and the position of lame cows within the milking order. J. Dairy Sci. 2019, 102, 1522–1529. [Google Scholar] [CrossRef]
- Zillner, J.C.; Tücking, N.; Plattes, S.; Heggemann, T.; Büscher, W. Using walking speed for lameness detection in lactating dairy cows. Livest. Sci. 2018, 218, 119–123. [Google Scholar] [CrossRef]
Frame Splitting Methods | Effect | |||||||||
---|---|---|---|---|---|---|---|---|---|---|
Uniform | ||||||||||
K-means | ||||||||||
Pretraining Model | The Memory Footprint of the Model/MB | Detection Speed/FPS | The Euclidean Distance Between the Predicted Key Point and the Real Labeled Key Point | |
---|---|---|---|---|
Training Loss/Pixel | Test Loss/Pixel | |||
ResNet-50 | 90.0 | 11.6 | 4.227055 | 13.425434 |
ResNet-101 | 170.1 | 9.7 | 4.141327 | 15.245344 |
MobileNetV2 | 9.0 | 14.2 | 4.225975 | 14.435343 |
EfficientNetV2 | 13.7 | 12.4 | 4.07183 | 14.075312 |
dlcrnet_ms5 | 90.9 | 24.1 | 4.080373 | 5.145343 |
Level | Walking Status | Physical Manifestations |
---|---|---|
1 | normal | Cows stand or walk with a straight back and a normal gait |
2 | mild | Cows stand with a straight back and walk with a bowed back with a normal gait |
3 | moderate | Cows stand and walk with a distinctly arched back, a short stride gait, and a nod |
4 | severe | Cows have difficulty walking, are unwilling to bear weight, and have a nod |
Argument | Normal | Mild | Moderate Claudication | Severe Claudication | |
---|---|---|---|---|---|
Angle | Variation interval | 146.26–164.87 | 141.44–156.99 | 138.75–158.33 | 133.34–156.27 |
Mean value | 156.2779 | 149.0112 | 149.3532 | 145.9024 | |
Average amplitude | 18.61 | 15.55 | 19.58 | 22.93 | |
Angle | Variation interval | 175.29–179.99 | 173.53–179.93 | 170.48–179.95 | 162.99–179.95 |
Mean value | 177.8921 | 176.5915 | 175.4388 | 172.2169 | |
Average amplitude | 4.70 | 6.40 | 9.47 | 17.96 |
Mark | Walking State | The Distribution of Feature Angle Values in a Specific Interval | |
---|---|---|---|
Angle | Angle | ||
0 | normal | [75%, 100%] | [90%, 100%] |
1 | mild | [50%, 75%] | [80%, 90%] |
2 | moderate | [25%, 50%] | [70%, 80%] |
3 | severe | [0, 25%] | [0, 70%] |
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
Jia, Z.; Zhao, Y.; Mu, X.; Liu, D.; Wang, Z.; Yao, J.; Yang, X. Intelligent Deep Learning and Keypoint Tracking-Based Detection of Lameness in Dairy Cows. Vet. Sci. 2025, 12, 218. https://doi.org/10.3390/vetsci12030218
Jia Z, Zhao Y, Mu X, Liu D, Wang Z, Yao J, Yang X. Intelligent Deep Learning and Keypoint Tracking-Based Detection of Lameness in Dairy Cows. Veterinary Sciences. 2025; 12(3):218. https://doi.org/10.3390/vetsci12030218
Chicago/Turabian StyleJia, Zongwei, Yingjie Zhao, Xuanyu Mu, Dongjie Liu, Zhen Wang, Jiangtan Yao, and Xuhui Yang. 2025. "Intelligent Deep Learning and Keypoint Tracking-Based Detection of Lameness in Dairy Cows" Veterinary Sciences 12, no. 3: 218. https://doi.org/10.3390/vetsci12030218
APA StyleJia, 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 Sciences, 12(3), 218. https://doi.org/10.3390/vetsci12030218