Tracking and Behavior Analysis of Group-Housed Pigs Based on a Multi-Object Tracking Approach
<p>Part of group-housed pig images.</p> "> Figure 2
<p>The overall structure of V8-Sort.</p> "> Figure 3
<p>The pipeline of the YOLOv8n algorithm.</p> "> Figure 4
<p>The flowchart of OC-SORT.</p> "> Figure 5
<p>OC-SORT tracking process for pigs.</p> "> Figure 6
<p>Comparison between V8-Sort and other tracking methods on public datasets.</p> "> Figure 7
<p>Comparison between V8-Sort and other tracking methods on private datasets.</p> "> Figure 8
<p>The visual results of V8-Sort on the public dataset.</p> "> Figure 9
<p>The tracking results visualization of V8-Sort on the private dataset.</p> "> Figure 10
<p>The visualization of long-term tracking results. (The first row shows the tracking results for videos 2001 and 3010, and the second, third, and fourth rows, respectively, depict the tracking results of two frames from videos 2002, 2003 and 2004).</p> "> Figure 11
<p>Time allocation and proportion of pig behaviors.</p> "> Figure 12
<p>The proportional occurrence of the four behaviors.</p> ">
Abstract
:Simple Summary
Abstract
1. Introduction
2. Materials
3. Methods
3.1. Pig Detection Based on the YOLOv8n Model
3.2. Pig Tracking Based on the OC-SORT Algorithm
3.2.1. Pig Motion Prediction
3.2.2. Data Association
3.2.3. Trajectory Management
3.3. Pig Behavior Analysis Algorithm
Algorithm 1: Pseudo-code of pig behavior analysis. |
Input: A video sequence ; object detector ; tracking score threshold is set 0.75; Frames per second ; Output: Tracks of the video |
|
Return |
3.4. Evaluation Metrics for MOT
4. Results and Analysis
4.1. Results Comparison of V8-Sort and Other MOT Methods
4.2. Tracking Results of V8-Sort on One-Minute Videos Dataset
4.3. The Long-Term Tracking Results of V8-Sort
4.4. Results of Behavior Analysis
5. Conclusions and Future Work
Author Contributions
Funding
Institutional Review Board Statement
Informed Consent Statement
Data Availability Statement
Conflicts of Interest
References
- Matthews, S.G.; Miller, A.L.; Clapp, J.; Plötz, T.; Kyriazakis, I.J.T.V.J. Early detection of health and welfare compromises through automated detection of behavioural changes in pigs. Vet. J. 2016, 217, 43–51. [Google Scholar] [CrossRef] [PubMed]
- Matthews, S.G.; Miller, A.L.; PlÖtz, T.; Kyriazakis, I. Automated tracking to measure behavioural changes in pigs for health and welfare monitoring. Sci. Rep. 2017, 7, 17582. [Google Scholar] [CrossRef] [PubMed]
- Maselyne, J.; Adriaens, I.; Huybrechts, T.; De Ketelaere, B.; Millet, S.; Vangeyte, J.; Nuffel, A.N.; Saeys, W.J.A. Measuring the drinking behaviour of individual pigs housed in group using radio frequency identification (RFID). Animal 2016, 10, 1557–1566. [Google Scholar] [CrossRef] [PubMed]
- Chapa, J.M.; Maschat, K.; Iwersen, M.; Baumgartner, J.; Drillich, M.J.B.P. Accelerometer systems as tools for health and welfare assessment in cattle and pigs–a review. Behav. Process. 2020, 181, 104262. [Google Scholar] [CrossRef] [PubMed]
- Meijer, E.; Oosterlinck, M.; van Nes, A.; Back, W.; van der Staay, F.J. Pressure mat analysis of naturally occurring lameness in young pigs after weaning. BMC Vet. Res. 2014, 10, 193. [Google Scholar] [CrossRef]
- Arablouei, R.; Wang, Z.; Bishop-Hurley, G.J.; Liu, J. Multimodal sensor data fusion for in-situ classification of animal behavior using accelerometry and GNSS data. Smart Agric. Technol. 2023, 4, 100163. [Google Scholar] [CrossRef]
- Chen, Z.; Lu, J.; Wang, H. A Review of Posture Detection Methods for Pigs Using Deep Learning. Appl. Sci. 2023, 13, 6997. [Google Scholar] [CrossRef]
- Guo, J.; Wu, X.; Liu, J.; Wei, T.; Yang, X.; Yang, X.; He, B.; Zhang, W. Non-contact vibration sensor using deep learning and image processing. Measurement 2021, 183, 109823. [Google Scholar] [CrossRef]
- Dhanya, V.G.; Subeesh, A.; Kushwaha, N.L.; Vishwakarma, D.K.; Nagesh Kumar, T.; Ritika, G.; Singh, A.N. Deep learning-based computer vision approaches for smart agricultural applications. Artif. Intell. Agric. 2022, 6, 211–229. [Google Scholar] [CrossRef]
- Tran, D.; Thanh, N. Pig Health Abnormality Detection Based on Behavior Patterns in Activity Periods usingDeep Learning. Int. J. Adv. Comput. Sci. Appl. 2023, 14, 603–610. [Google Scholar] [CrossRef]
- Zhang, Y.; Yang, X.; Liu, Y.; Zhou, J.; Huang, Y.; Li, J.; Zhang, L.; Ma, Q. A time-series neural network for pig feeding behavior recognition and dangerous detection from videos. Comput. Electron. Agric. 2024, 218, 108710. [Google Scholar] [CrossRef]
- Alameer, A.; Kyriazakis, I.; Bacardit, J. Automated recognition of postures and drinking behaviour for the detection of compromised health in pigs. Sci. Rep. 2020, 10, 13665. [Google Scholar] [CrossRef] [PubMed]
- Yang, Q.; Xiao, D. A review of video-based pig behavior recognition. Appl. Anim. Behav. Sci. 2020, 233, 105146. [Google Scholar] [CrossRef]
- Chen, F.; Liang, X.; Chen, L.; Liu, B.; Lan, Y. Novel method for real-time detection and tracking of pig body and its different parts. Agric. Food Sci. 2020, 13, 144–149. [Google Scholar] [CrossRef]
- Jaoukaew, A.; Suwansantisuk, W.; Kumhom, P. Robust individual pig tracking. Int. J. Electr. Comput. Eng. (IJECE) 2024, 14, 279–293. [Google Scholar] [CrossRef]
- Gong, W.C.; Wang, J.; Mao, L.; Lu, L. A Pig Tracking Algorithm with Improved IOU-Tracker. In Proceedings of the International Conference on Agri-Photonics and Smart Agricultural Sensing Technologies, Zhengzhou, China, 10–12 June 2022. [Google Scholar]
- Zhang, L.; Gray, H.; Ye, X.; Collins, L.; Allinson, N. Automatic Individual Pig Detection and Tracking in Pig Farms. Sensors 2019, 19, 1188. [Google Scholar] [CrossRef]
- Tu, S.; Zeng, Q.; Liang, Y.; Liu, X.; Huang, L.; Weng, S.; Huang, Q. Automated Behavior Recognition and Tracking of Group-Housed Pigs with an Improved DeepSORT Method. Agriculture 2022, 12, 1907. [Google Scholar] [CrossRef]
- Zhou, H.; Li, Q.; Xie, Q. Individual Pig Identification Using Back Surface Point Clouds in 3D Vision. Sensors 2023, 23, 5156. [Google Scholar] [CrossRef]
- Hao, W.; Zhang, K.; Zhang, L.; Han, M.; Hao, W.; Li, F.; Yang, G. TSML: A New Pig Behavior Recognition Method Based on Two-Stream Mutual Learning Network. Sensors 2023, 23, 5092. [Google Scholar] [CrossRef]
- Gao, Y.; Yan, K.; Dai, B.; Sun, H.; Yin, Y.; Liu, R.; Shen, W. Recognition of aggressive behavior of group-housed pigs based on CNN-GRU hybrid model with spatio-temporal attention mechanism. Comput. Electron. Agric. 2023, 205, 107606. [Google Scholar] [CrossRef]
- Ji, H.; Teng, G.; Yu, J.; Wen, Y.; Deng, H.; Zhuang, Y. Efficient Aggressive Behavior Recognition of Pigs Based on Temporal Shift Module. Animals 2023, 13, 2078. [Google Scholar] [CrossRef] [PubMed]
- Meinhardt, T.; Kirillov, A.; Leal-Taixe, L.; Feichtenhofer, C. Trackformer: Multi-object tracking with transformers. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, New Orleans, LA, USA, 18–24 June 2022; pp. 8844–8854. [Google Scholar]
- Wang, Z.; Zheng, L.; Liu, Y.; Wang, S. Towards Real-Time Multi-Object Tracking. Computer Vision and Pattern Recognition. arXiv 2019, arXiv:1909.12605. [Google Scholar]
- Sun, P.; Cao, J.; Jiang, Y.; Zhang, R.; Xie, E.; Yuan, Z.; Wang, C.; Luo, P.J. Transtrack: Multiple object-tracking with transformer. In Proceedings of the Computer Vision and Pattern Recognition, Seattle, WA, USA, 13–19 June 2020. [Google Scholar]
- Psota, E.T.; Schmidt, T.; Mote, B.; Pérez, L.C. Long-Term Tracking of Group-Housed Livestock Using Keypoint Detection and MAP Estimation for Individual Animal Identification. Sensors 2020, 20, 3670. [Google Scholar] [CrossRef] [PubMed]
- FFmpeg. Available online: https://ffmpeg.org/ (accessed on 1 September 2023).
- Darklabel. Darklabel Software for Annotating Images and Videos. Available online: https://github.com/darkpgmr/DarkLabel (accessed on 28 July 2023).
- Seo, Y.W.; Lee, S.G.; Chang, W.D.; Cha, E.Y. A Study on Multi-Object Tracking, Using The Hungarian Algorithm. In Proceedings of the Korea Information Processing Society Conference, Seoul, Republic of Korea, 14–15 May 2004; pp. 777–780. [Google Scholar]
- 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), Trichy, India, 24–26 November 2022; pp. 456–460. [Google Scholar]
Dataset | Video Number | Day | Night | Sparse | Time | Activity Level | Number of Pigs |
---|---|---|---|---|---|---|---|
Public dataset | 0102 | √ | — | √ | 1 min | H | 7 |
0402 | √ | — | × | 1 min | M | 15 | |
0502 | — | √ | √ | 1 min | M | 8 | |
0602 | √ | — | × | 1 min | H | 16 | |
0702 | √ | — | × | 1 min | M | 12 | |
0802 | — | √ | × | 1 min | L | 13 | |
0902 | √ | — | × | 1 min | M | 14 | |
1002 | — | √ | × | 1 min | M | 14 | |
1102 | √ | — | × | 1 min | H | 16 | |
1202 | √ | — | × | 1 min | L | 15 | |
1502 | — | √ | × | 1 min | M | 16 | |
2001 | √ | — | √ | 10 min | L | 7 | |
2002 | — | √ | √ | 10 min | H | 8 | |
2003 | √ | — | × | 10 min | L | 16 | |
2004 | — | √ | × | 10 min | M | 15 | |
Private dataset | 3001 | √ | — | √ | 1 min | L | 10 |
3002 | √ | — | × | 1 min | M | 11 | |
3003 | — | √ | × | 1 min | M | 11 | |
3004 | √ | — | √ | 1 min | H | 6 | |
3005 | √ | — | √ | 1 min | M | 6 | |
3006 | √ | — | √ | 1 min | M | 6 | |
3007 | √ | — | √ | 1 min | M | 6 | |
3008 | — | √ | √ | 1 min | L | 6 | |
3009 | — | √ | √ | 1 min | H | 6 | |
3010 | √ | — | √ | 60 min | H | 6 |
Layer Name | Description |
---|---|
Stem layer | Initial layer for feature extraction and input processing. |
Stage layer1 | Processes the input with convolutional layers for feature refinement. |
Stage layer2 | Further refines features, capturing more complex patterns. |
Stage layer3 | Continues to extract and enhance feature representations. |
Stage layer4 | The final stage of the backbone, preparing features for the neck module. |
TopDown layer1 | Upsamples features for better spatial resolution. |
TopDown layer2 | Continues to upsample and merge features from different scales. |
Down Sampl0 | Reduces spatial dimensions for processing efficiency. |
Bottom Up layer0 | Integrates features from previous layers for enhanced information. |
Down Sample1 | Further downsampling to balance speed and accuracy. |
Bottom Up layer1 | Merges features, ensuring a comprehensive representation. |
ConvModule | Applies convolution operations for feature extraction. |
Con2d | Standard convolution layer for additional feature processing. |
Bbox.Loss | Computes the loss related to bounding box predictions. |
Cls.Loss | Computes the loss for classification accuracy. |
Video Sequence | Algorithm | HOTA/%↑ | IDs↓ | MOTA/%↑ | IDF1/%↑ | FP↓ | FN↓ |
---|---|---|---|---|---|---|---|
Public datasets | Trackformer | 70.8 | 283 | 88.5 | 79.5 | 1048 | 3719 |
JDE | 62.6 | 473 | 83.4 | 71.2 | 3323 | 3455 | |
TransTrack | 63.8 | 523 | 79.3 | 71.2 | 3627 | 4910 | |
V8-Sort | 82.0 | 22 | 96.3 | 96.8 | 658 | 953 | |
Private datasets | Trackformer | 73.5 | 41 | 95.7 | 86.9 | 426 | 463 |
TransTrack | 57.5 | 395 | 82.1 | 67.2 | 1292 | 2279 | |
V8-Sort | 74.8 | 17 | 93.7 | 93.1 | 143 | 1232 |
Video Squences | HOTA/%↑ | IDs↓ | MOTA/%↑ | IDF1/%↑ | FP↓ | FN↓ |
---|---|---|---|---|---|---|
0102 | 85.4 | 2 | 98.2 | 97.1 | 1 | 35 |
0402 | 84.3 | 0 | 95.4 | 97.7 | 137 | 68 |
0502 | 84.0 | 10 | 99.4 | 99.7 | 10 | 4 |
0602 | 73.8 | 0 | 90.6 | 91.9 | 275 | 165 |
0702 | 83.7 | 0 | 98.1 | 99.0 | 13 | 55 |
0802 | 91.9 | 0 | 99.9 | 99.9 | 0 | 3 |
0902 | 85.8 | 0 | 97.5 | 98.7 | 45 | 61 |
1002 | 72.2 | 0 | 92.2 | 96.0 | 93 | 236 |
1102 | 83.1 | 5 | 97.6 | 92.8 | 29 | 83 |
1202 | 81.6 | 5 | 95.0 | 95.6 | 26 | 193 |
1502 | 77.3 | 0 | 98.4 | 99.2 | 29 | 50 |
Total/average | 82.0 | 22 | 96.8 | 96.8 | 658 | 953 |
Video Squences | HOTA/%↑ | IDs↓ | MOTA/%↑ | IDF1/%↑ | FP↓ | FN↓ |
---|---|---|---|---|---|---|
3001 | 78.0 | 2 | 97.0 | 97.1 | 11 | 87 |
3002 | 72.0 | 2 | 95.4 | 89.8 | 22 | 129 |
3003 | 70.1 | 3 | 93.0 | 93.0 | 27 | 202 |
3004 | 71.6 | 5 | 94.3 | 91.6 | 33 | 149 |
3005 | 82.0 | 0 | 99.9 | 99.9 | 0 | 2 |
3006 | 81.0 | 0 | 91.3 | 95.5 | 2 | 154 |
3007 | 82.6 | 0 | 97.6 | 98.8 | 18 | 25 |
3008 | 84.1 | 0 | 99.9 | 99.9 | 1 | 0 |
3009 | 52.3 | 5 | 71.2 | 70.6 | 29 | 484 |
Total/average | 74.8 | 17 | 93.7 | 93.1 | 143 | 1232 |
Video Squences | HOTA/%↑ | IDs↓ | MOTA/%↑ | IDF1/%↑ | FP↓ | FN↓ |
---|---|---|---|---|---|---|
2001 | 56.7 | 19 | 97.1 | 67.6 | 189 | 391 |
2002 | 67.3 | 29 | 90.4 | 85.1 | 291 | 1986 |
2003 | 61.2 | 73 | 93.6 | 73.0 | 1235 | 1741 |
2004 | 59.0 | 91 | 84.6 | 74.5 | 1737 | 5436 |
3010 | 69.0 | 9 | 99.7 | 75.1 | 75 | 201 |
Total/average | 62.6 | 44 | 93.1 | 75.1 | 705 | 1951 |
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. |
© 2024 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
Tu, S.; Du, J.; Liang, Y.; Cao, Y.; Chen, W.; Xiao, D.; Huang, Q. Tracking and Behavior Analysis of Group-Housed Pigs Based on a Multi-Object Tracking Approach. Animals 2024, 14, 2828. https://doi.org/10.3390/ani14192828
Tu S, Du J, Liang Y, Cao Y, Chen W, Xiao D, Huang Q. Tracking and Behavior Analysis of Group-Housed Pigs Based on a Multi-Object Tracking Approach. Animals. 2024; 14(19):2828. https://doi.org/10.3390/ani14192828
Chicago/Turabian StyleTu, Shuqin, Jiaying Du, Yun Liang, Yuefei Cao, Weidian Chen, Deqin Xiao, and Qiong Huang. 2024. "Tracking and Behavior Analysis of Group-Housed Pigs Based on a Multi-Object Tracking Approach" Animals 14, no. 19: 2828. https://doi.org/10.3390/ani14192828
APA StyleTu, S., Du, J., Liang, Y., Cao, Y., Chen, W., Xiao, D., & Huang, Q. (2024). Tracking and Behavior Analysis of Group-Housed Pigs Based on a Multi-Object Tracking Approach. Animals, 14(19), 2828. https://doi.org/10.3390/ani14192828