A Multi-Object Tracking Method for Dairy Cows in Intensive Farming Scenarios
Simple Summary
Abstract
1. Introduction
2. Materials and Methods
2.1. Dataset Construction
2.2. Detection Method
2.2.1. Detector
2.2.2. Improvement of Downsampling Modules
2.2.3. Partial Bi-Level Routing Attention Module
2.2.4. Improvement of Spatial Pyramid Pooling
2.3. Multi-Object Tracking Method
2.3.1. Dairy Cow Multi-Object Tracking Framework
2.3.2. Optimization of Trajectory Association
3. Experiments and Results
3.1. Experimental Platform and Parameter Settings
3.2. Evaluation Metrics
3.2.1. Object Detection Evaluation Metrics
3.2.2. Multi-Object Tracking Evaluation Metrics
3.3. Detection Results for Densely Populated Dairy Cows
3.3.1. Comparison of Different Detection Models
3.3.2. Heatmap Analysis
3.3.3. Ablation Experiments and Attention Module Comparisons
3.4. Multi-Object Tracking of Densely Populated Dairy Cows
3.4.1. Comparison of Tracking Performance Before and After Algorithm Improvement
3.4.2. Comparison of Tracking Performance Across Representative Monitoring Scenarios
3.4.3. Comparison of Different Tracking Algorithms
4. Discussion
5. Conclusions
Author Contributions
Funding
Institutional Review Board Statement
Informed Consent Statement
Data Availability Statement
Conflicts of Interest
Appendix A
| Component | Parameter | Setting |
|---|---|---|
| Detector training | Input image size | 640 × 640 pixels |
| Detector training | Batch size | 16 |
| Detector training | Number of epochs | 200 |
| Detector training | Optimizer | AdamW |
| Detector training | Momentum parameter | 0.937 |
| Detector training | Weight decay | 0.0005 |
| Detector training | Initial learning rate | 0.01 |
| Detector training | Learning-rate schedule | Linear decay |
| Detector training | Warm-up epochs | 3 |
| Detector training | Mosaic augmentation probability (mosaic) | 1.0; disabled during the final 10 training epochs |
| Detector training | Horizontal flipping probability | 0.5 |
| Detector training | Random scaling parameter (scale) | 0.5 |
| Detector training | HSV augmentation (hsv_h, hsv_s, hsv_v) | 0.015, 0.7, 0.4 |
| Detector training | Model initialization | Corresponding pretrained weights |
| Detection filtering | Detection confidence threshold | 0.30 |
| Detection filtering | High-confidence detections | s ≥ 0.50 |
| Detection filtering | Low-confidence detections | 0.30 ≤ s < 0.50 |
| First association | Association metric | MPDIoU |
| First association | Matching threshold | 0.90 |
| Second association | Association metric | IoU |
| Second association | Matching threshold | 0.50 |
| Track management | New-track initialization threshold | s ≥ 0.60 |
| Track management | Next-frame matching threshold for track confirmation | 0.70 |
| Track management | Maximum lost-track buffer length | 210 frames |
| Track management | Maximum retention duration | Approximately 7 s at 30 FPS |
| Kalman filter | State vector | (x, y, a, h, vx, vy, va, vh) |
| Kalman filter | Time step | 1 |
| Kalman filter | Position standard-deviation weight | 1/20 |
| Kalman filter | Velocity standard-deviation weight | 1/160 |
| Repeated experiments | Number of independent runs | 5 runs with different random seeds |
References
- Jiang, B.; Wu, Q.; Yin, X.; Wu, D.; Song, H.; He, D. FLYOLOv3 deep learning for key parts of dairy cow body detection. Comput. Electron. Agric. 2019, 166, 104982. [Google Scholar] [CrossRef] [Scilit]
- Siachos, N.; Neary, J.M.; Smith, R.F.; Oikonomou, G. Automated dairy cattle lameness detection utilizing the power of artificial intelligence; current status quo and future research opportunities. Vet. J. 2024, 304, 106091. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Van Hertem, T.; Tello, A.S.; Viazzi, S.; Steensels, M.; Bahr, C.; Romanini, C.E.B.; 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] [Scilit]
- Lodkaew, T.; Pasupa, K.; Loo, C.K. CowXNet: An automated cow estrus detection system. Expert Syst. Appl. 2023, 211, 118550. [Google Scholar] [CrossRef] [Scilit]
- Xudong, Z.; Xi, K.; Ningning, F.; Gang, L. Automatic recognition of dairy cow mastitis from thermal images by a deep learning detector. Comput. Electron. Agric. 2020, 178, 105754. [Google Scholar] [CrossRef] [Scilit]
- Yu, R.; Wei, X.; Liu, Y.; Yang, F.; Shen, W.; Gu, Z. Research on Automatic Recognition of Dairy Cow Daily Behaviors Based on Deep Learning. Animals 2024, 14, 458. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Alipio, M.; Villena, M.L. Intelligent wearable devices and biosensors for monitoring cattle health conditions: A review and classification. Smart Health 2023, 27, 100369. [Google Scholar] [CrossRef] [Scilit]
- Maroto-Molina, F.; Navarro-García, J.; Príncipe-Aguirre, K.; Gómez-Maqueda, I.; Guerrero-Ginel, J.E.; Garrido-Varo, A.; Pérez-Marín, D.C. A Low-Cost IoT-Based System to Monitor the Location of a Whole Herd. Sensors 2019, 19, 2298. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Wolfger, B.; Jones, B.W.; Orsel, K.; Bewley, J.M. Evaluation of an ear-attached real-time location monitoring system. J. Dairy Sci. 2017, 100, 2219–2224. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Song, C.; Jiang, D.; Wang, F. Exploration of agricultural IoT breeding tracking based on a saliency visual target tracking algorithm. Turk. J. Agric. For. 2023, 47, 960–971. [Google Scholar] [CrossRef] [Scilit]
- Lamanna, M.; Bovo, M.; Bellisola, G.; Romanzin, A.; Cavallini, D. Rethinking wearable technology in dairy cows: Challenges and prospects for smart collars. Open Agric. J. 2025, 19, e18743315410860. [Google Scholar] [CrossRef] [Scilit]
- Neethirajan, S. Transforming the Adaptation Physiology of Farm Animals through Sensors. Animals 2020, 10, 1512. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Mon, S.L.; Onizuka, T.; Tin, P.; Aikawa, M.; Kobayashi, I.; Zin, T.T. AI-enhanced real-time cattle identification system through tracking across various environments. Sci. Rep. 2024, 14, 17779. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Myat Noe, S.; Zin, T.T.; Tin, P.; Kobayashi, I. Comparing state-of-the-art deep learning algorithms for the automated detection and tracking of black cattle. Sensors 2023, 23, 532. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Liu, H.; Reibman, A.R.; Boerman, J.P. Video analytic system for detecting cow structure. Comput. Electron. Agric. 2020, 178, 105761. [Google Scholar] [CrossRef] [Scilit]
- Tang, H.; Li, Z.; Zhang, D.; He, S.; Tang, J. Divide-and-conquer: Confluent triple-flow network for RGB-T salient object detection. IEEE Trans. Pattern Anal. Mach. Intell. 2025, 47, 1958–1974. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Li, X.; Wang, W.; Hu, X.; Yang, J. Selective kernel networks. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), Long Beach, CA, USA, 16–20 June 2019; IEEE: New York, NY, USA, 2019; pp. 510–519. [Google Scholar] [CrossRef] [Scilit]
- Woo, S.; Park, J.; Lee, J.Y.; Kweon, I.S. CBAM: Convolutional block attention module. In Proceedings of the European Conference on Computer Vision (ECCV), Munich, Germany, 8–14 September 2018; Springer: Cham, Switzerland, 2018; pp. 3–19. [Google Scholar] [CrossRef] [Scilit]
- Zhu, L.; Wang, X.; Ke, Z.; Zhang, W.; Lau, R.W. Biformer: Vision transformer with bi-level routing attention. arXiv 2023, arXiv:2303.08810. [Google Scholar] [CrossRef] [Scilit]
- Han, S.; Fuentes, A.; Yoon, S.; Jeong, Y.; Kim, H.; Park, D.S. Deep learning-based multi-cattle tracking in crowded livestock farming using video. Comput. Electron. Agric. 2023, 212, 108044. [Google Scholar] [CrossRef] [Scilit]
- Li, G.; Sun, J.; Guan, M.; Sun, S.; Shi, G.; Zhu, C. A New Method for Non-Destructive Identification and Tracking of Multi-Object Behaviors in Beef Cattle Based on Deep Learning. Animals 2024, 14, 2464. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Pretto, A.; Savio, G.; Gottardo, F.; Uccheddu, F.; Concheri, G. A novel low-cost visual ear tag based identification system for precision beef cattle livestock farming. Inf. Process. Agric. 2024, 11, 117–126. [Google Scholar] [CrossRef] [Scilit]
- Guo, Y.; Hong, W.; Wu, J.; Huang, X.; Qiao, Y.; Kong, H. Vision-Based Cow Tracking and Feeding Monitoring for Autonomous Livestock Farming: The YOLOv5s-CA+ DeepSORT-Vision Transformer. IEEE Robot. Autom. Mag. 2023, 30, 68–76. [Google Scholar] [CrossRef] [Scilit]
- Zhou, H.; Chung, S.; Kakar, J.K.; Kim, S.C.; Kim, H. Pig Movement Estimation by Integrating Optical Flow with a Multi-Object Tracking Model. Sensors 2023, 23, 9499. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Lu, J.; Chen, Z.; Li, X.; Fu, Y.; Xiong, X.; Liu, X.; Wang, H. ORP-Byte: A multi-object tracking method of pigs that combines Oriented RepPoints and improved Byte. Comput. Electron. Agric. 2024, 219, 108782. [Google Scholar] [CrossRef] [Scilit]
- Mg, W.H.E.; Tin, P.; Aikawa, M.; Kobayashi, I.; Horii, Y.; Honkawa, K.; Zin, T.T. Customized Tracking Algorithm for Robust Cattle Detection and Tracking in Occlusion Environments. Sensors 2024, 24, 1181. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Zheng, Z.; Qin, L. PrunedYOLO-Tracker: An efficient multi-cows basic behavior recognition and tracking technique. Comput. Electron. Agric. 2023, 213, 108172. [Google Scholar] [CrossRef] [Scilit]
- Wang, A.; Chen, H.; Liu, L.; Chen, K.; Lin, Z.; Han, J.; Ding, G. Yolov10: Real-time end-to-end object detection. arXiv 2024, arXiv:2405.14458. [Google Scholar] [CrossRef] [Scilit]
- Ma, S.; Xu, Y. Mpdiou: A loss for efficient and accurate bounding box regression. arXiv 2023, arXiv:2307.07662. [Google Scholar] [CrossRef] [Scilit]
- Zhang, X.; Liu, C.; Yang, D.; Song, T.; Ye, Y.; Li, K.; Song, Y. RFAConv: Innovating spatial attention and standard convolutional operation. arXiv 2023, arXiv:2304.03198. [Google Scholar] [CrossRef] [Scilit]
- Luiten, J.; Osep, A.; Dendorfer, P.; Torr, P.; Geiger, A.; Leal-Taixé, L.; Leibe, B. Hota: A higher order metric for evaluating multi-object tracking. Int. J. Comput. Vis. 2021, 129, 548–578. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Chattopadhay, A.; Sarkar, A.; Howlader, P.; Balasubramanian, V.N. Grad-cam++: Generalized gradient-based visual explanations for deep convolutional networks. In Proceedings of the 2018 IEEE Winter Conference on Applications of Computer Vision (WACV); IEEE: New York, NY, USA, 2018; pp. 839–847. [Google Scholar] [CrossRef] [Scilit]
- Zhang, Y.; Sun, P.; Jiang, Y.; Yu, D.; Weng, F.; Yuan, Z.; Wang, X. Bytetrack: Multi-object tracking by associating every detection box. arXiv 2022, arXiv:2110.06864. [Google Scholar] [CrossRef] [Scilit]
- Pujara, A.; Bhamare, M. Deepsort: Real time & multi-object detection and tracking with YOLO and TensorFlow. In Proceedings of the 2022 International Conference on Augmented Intelligence and Sustainable Systems (ICAISS); IEEE: New York, NY, USA, 2022; pp. 456–460. [Google Scholar] [CrossRef] [Scilit]
- Du, Y.; Zhao, Z.; Song, Y.; Zhao, Y.; Su, F.; Gong, T.; Meng, H. Strongsort: Make deepsort great again. IEEE Trans. Multimed. 2023, 25, 8725–8737. [Google Scholar] [CrossRef] [Scilit]
















| Model | P (%) | R (%) | mAP (%) | Params (M) | GFLOPs |
|---|---|---|---|---|---|
| YOLOv5s | 93.5 ± 0.5 | 87.2 ± 0.6 | 92.8 ± 0.4 | 7.13 | 16.5 |
| YOLOv8s | 95.1 ± 0.4 | 86.1 ± 0.5 | 93.7 ± 0.3 | 11.14 | 28.6 |
| YOLOv10s | 93.4 ± 0.4 | 88.4 ± 0.3 | 93.9 ± 0.3 | 7.23 | 21.6 |
| YOLOv5s-CA [23] | 93.8 ± 0.5 | 88.2 ± 0.5 | 93.2 ± 0.4 | 7.35 | 17.1 |
| Pruned YOLO [27] | 91.1 ± 0.6 | 85.7 ± 0.7 | 91.4 ± 0.5 | 11.9 | 25.1 |
| BR-YOLOv10s (Ours) | 95.7 ± 0.3 | 90.3 ± 0.2 | 95.2 ± 0.2 | 7.70 | 23.9 |
| Index | Models | P (%) | R (%) | mAP (%) | Params (M) | GFLOPs |
|---|---|---|---|---|---|---|
| 1 | YOLOv10s | 93.4 ± 0.4 | 88.4 ± 0.3 | 93.9 ± 0.3 | 7.23 | 21.6 |
| 2 | +RFADown | 92.2 ± 0.6 | 88.7 ± 0.5 | 94.4 ± 0.4 | 7.36 | 22.1 |
| 3 | +SPPELAN | 93.2 ± 0.4 | 89.1 ± 0.3 | 94.1 ± 0.2 | 7.48 | 22.7 |
| 4 | +PBRA | 94.6 ± 0.5 | 88.9 ± 0.4 | 94.6 ± 0.2 | 7.32 | 22.3 |
| 5 | +RFADown+SPPELAN | 93.5 ± 0.5 | 89.8 ± 0.5 | 94.6 ± 0.4 | 7.61 | 23.2 |
| 6 | +RFADown+PBRA | 94.4 ± 0.4 | 89.6 ± 0.4 | 94.8 ± 0.2 | 7.46 | 22.9 |
| 7 | +SPPELAN+PBRA | 95.2 ± 0.3 | 89.4 ± 0.3 | 95.0 ± 0.2 | 7.56 | 23.3 |
| 8 | +RFADown +SPPELAN+BRA | 93.8 ± 0.6 | 88.9 ± 0.5 | 93.5 ± 0.6 | 7.65 | 23.5 |
| 9 | +RFADown +SPPELAN+SK | 92.5 ± 0.6 | 88.1 ± 0.7 | 92.0 ± 0.6 | 7.74 | 24.6 |
| 10 | +RFADown +SPPELAN+CBAM | 91.3 ± 0.7 | 87.5 ± 0.7 | 91.6 ± 0.8 | 6.65 | 22.8 |
| 11 | +RFADown +SPPELAN+PBRA | 95.7 ± 0.3 | 90.3 ± 0.2 | 95.2 ± 0.2 | 7.70 | 23.9 |
| Model | IDF1 (%) | IDS | MOTA (%) | MOTP (%) | HOTA (%) | FPS |
|---|---|---|---|---|---|---|
| YOLOv5s+BR-Tracker | 68.9 ± 1.2 | 1828.6 ± 75.6 | 76.2 ± 1.1 | 77.1 ± 0.7 | 58.9 ± 0.9 | 48.9 |
| YOLOv8s+BR-Tracker | 75.2 ± 0.7 | 1625.0 ± 61.8 | 77.1 ± 0.9 | 77.8 ± 0.7 | 63.4 ± 1.0 | 45.1 |
| YOLOv10s+BR-Tracker | 75.8 ± 0.7 | 1587.6 ± 61.2 | 78.5 ± 0.8 | 78.1 ± 0.7 | 63.8 ± 0.9 | 44.7 |
| YOLOv5s-CA+BR-Tracker | 70.6 ± 0.8 | 1745.2 ± 76.2 | 76.4 ± 1.0 | 77.5 ± 0.8 | 60.4 ± 1.0 | 47.6 |
| Pruned YOLO+ BR-Tracker | 73.4 ± 1.1 | 1691.8 ± 87.8 | 77.1 ± 1.1 | 77.8 ± 0.9 | 61.9 ± 1.2 | 44.2 |
| BR-YOLOv10s+ BR-Tracker (Ours) | 79.2 ± 0.4 | 1446.4 ± 32.2 | 80.5 ± 0.7 | 79.1 ± 0.5 | 67.6 ± 0.6 | 43.2 |
| Model | IDF1 (%) | IDS | MOTA (%) | MOTP (%) | HOTA (%) | FPS |
|---|---|---|---|---|---|---|
| YOLOv10s+ByteTrack | 73.1 ± 1.1 | 1883.0 ± 76.2 | 74.8 ± 1.0 | 76.1 ± 0.8 | 63.2 ± 1.0 | 46.3 |
| BR-YOLOv10s+ByteTrack | 76.7 ± 0.8 | 1767.2 ± 50.8 | 77.1 ± 0.9 | 77.3 ± 0.7 | 65.0 ± 1.0 | 46.1 |
| YOLOv10s+BR-Tracker | 75.8 ± 0.7 | 1587.6 ± 61.2 | 78.5 ± 0.8 | 78.1 ± 0.7 | 63.8 ± 0.9 | 44.7 |
| BR-YOLOv10s+ BR-Tracker (Ours) | 79.2 ± 0.4 | 1446.4 ± 32.2 | 80.5 ± 0.7 | 79.1 ± 0.5 | 67.6 ± 0.6 | 43.2 |
| Video | IDF1 (%) | IDS | MOTA (%) | MOTP (%) | HOTA (%) | FPS |
|---|---|---|---|---|---|---|
| 01 | 79.0 | 21 | 84.1 | 80.5 | 66.4 | 43.3 |
| 02 | 78.4 | 34 | 80.5 | 68.9 | 67.2 | 44.7 |
| 03 | 82.1 | 9 | 85.9 | 83.7 | 73.4 | 43.1 |
| 04 | 77.1 | 53 | 73.7 | 76.1 | 61.5 | 44.5 |
| 05 | 86.1 | 42 | 82.3 | 80.3 | 71.9 | 44.8 |
| Model | IDF1 (%) | IDS | MOTA (%) | MOTP (%) | HOTA (%) | FPS |
|---|---|---|---|---|---|---|
| YOLOv10s+DeepSort | 64.3 ± 1.4 | 2402.2 ± 91.5 | 72.6 ± 1.3 | 73.9 ± 1.1 | 57.9 ± 1.2 | 41.8 |
| YOLOv10s+StrongSort | 69.1 ± 1.3 | 2193.6 ± 82.1 | 73.2 ± 1.1 | 75.3 ± 1.0 | 59.3 ± 1.1 | 40.5 |
| YOLOv10s+ByteTrack | 73.1 ± 1.1 | 1883.0 ± 76.2 | 74.8 ± 1.0 | 76.1 ± 0.8 | 63.2 ± 1.0 | 46.3 |
| BR-YOLOv10s+DeepSort | 65.4 ± 1.1 | 2157.4 ± 75.3 | 73.3 ± 1.1 | 74.0 ± 0.9 | 59.8 ± 1.2 | 41.1 |
| BR-YOLOv10s+StrongSort | 69.2 ± 0.9 | 2045.8 ± 75.6 | 73.7 ± 0.9 | 75.4 ± 0.8 | 61.8 ± 0.8 | 40.3 |
| BR-YOLOv10s+ByteTrack | 76.7 ± 0.8 | 1767.2 ± 50.8 | 77.1 ± 0.9 | 77.3 ± 0.7 | 65.0 ± 1.0 | 46.1 |
| BR-YOLOv10s+ BR-Tracker (Ours) | 79.2 ± 0.4 | 1446.4 ± 32.2 | 80.5 ± 0.7 | 79.1 ± 0.5 | 67.6 ± 0.6 | 43.2 |
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. |
© 2026 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.
Share and Cite
Diao, Z.; Huang, Z.; Li, J.; Cheng, J.; Zhao, S.; Zhang, B. A Multi-Object Tracking Method for Dairy Cows in Intensive Farming Scenarios. Animals 2026, 16, 2884. https://doi.org/10.3390/ani16182884
Diao Z, Huang Z, Li J, Cheng J, Zhao S, Zhang B. A Multi-Object Tracking Method for Dairy Cows in Intensive Farming Scenarios. Animals. 2026; 16(18):2884. https://doi.org/10.3390/ani16182884
Chicago/Turabian StyleDiao, Zhihua, Zhichao Huang, Jiangbo Li, Jinpeng Cheng, Suna Zhao, and Baohua Zhang. 2026. "A Multi-Object Tracking Method for Dairy Cows in Intensive Farming Scenarios" Animals 16, no. 18: 2884. https://doi.org/10.3390/ani16182884
APA StyleDiao, Z., Huang, Z., Li, J., Cheng, J., Zhao, S., & Zhang, B. (2026). A Multi-Object Tracking Method for Dairy Cows in Intensive Farming Scenarios. Animals, 16(18), 2884. https://doi.org/10.3390/ani16182884

