Estimation of Number of Pigs Taking in Feed Using Posture Filtration
Abstract
:1. Introduction
2. Materials and Methods
2.1. Dataset
2.2. Problem of the Previous Method
2.3. Proposed Method
2.3.1. Pig Detection and Posture Classification
2.3.2. Selection of Pigs near the Feeder
2.3.3. Body–Head Mapping Algorithm
Algorithm 1 Head-Body Mapping | |||||||
1: | Input | ||||||
2: | H | – | Head object | ||||
3: | B | – | Body object | ||||
4: | Output | ||||||
5: | P | – | Mapped Head Body Pair | ||||
6: | Procedure | ||||||
7: | P ← Empty list | ||||||
8: | for i ← 1 to length of H do | ||||||
9: | head ← H[i] | ||||||
10: | if head = NULL then | ||||||
11: | continue | ||||||
12: | else | ||||||
13: | temp ← Empty list | ||||||
14: | for j ← 1 to length of B do | ||||||
15: | body ← B[j] | ||||||
16: | if body = NULL then | ||||||
17: | continue | ||||||
18: | else if IoU(head, body) > 0 then | ||||||
19: | temp.push(j) | ||||||
20: | j ← the body with the greatest distance between center points | ||||||
21: | body ← B[j] | ||||||
22: | B[j] ← NULL | ||||||
23: | P.push(Pair(head, body)) | ||||||
24: | return P |
2.3.4. Posture Filtration
Algorithm 2 Posture Filtration | |||||||
1: | Input | ||||||
2: | P | – | Mapped Head-Body Pair | ||||
3: | Output | ||||||
4: | result | – | Number of pigs (int) | ||||
5: | Procedure | ||||||
6: | for i ← 1 to length of P do | ||||||
7: | head, body ← P[i] | ||||||
8: | if body! = standing then | ||||||
9: | P[i] ← NULL | ||||||
10: | result ← the number of non-null pairs in P | ||||||
11: | return result |
3. Results
3.1. Detection and Classification Model
3.1.1. Anchor Box Selection
3.1.2. Training of Detection and Classification Model
3.2. Quantitative Analysis
3.3. Qualitative Analysis
4. Discussion and Conclusions
Author Contributions
Funding
Acknowledgments
Conflicts of Interest
References
- OECD. Meat Consumption (Indicator). 2022. Available online: https://doi.org/10.1787/fa290fd0-en (accessed on 19 November 2022).
- De Lange, C.F.M.; Marty, B.J.; Birkett, S.; Morel, P.; Szkotnicki, B. Application of pig growth models in commercial pork production. Can. J. Anim. Sci. 2001, 81, 1–8. [Google Scholar] [CrossRef]
- Nyachoti, C.M.; Zijlstra, R.T.; De Lange, C.F.M.; Patience, J.F. Voluntary feed intake in growing-finishing pigs: A review of the main determining factors and potential approaches for accurate predictions. Can. J. Anim. Sci. 2004, 84, 549–566. [Google Scholar] [CrossRef]
- Henry, Y. Dietary factors involved in feed intake regulation in growing pigs: A review. Livest. Prod. Sci. 1985, 12, 339–354. [Google Scholar] [CrossRef]
- Adrion, F.; Kapun, A.; Eckert, F.; Holland, E.-M.; Staiger, M.; Götz, S.; Gallmann, E. Monitoring trough visits of growing-finishing pigs with UHF-RFID. Comput. Electron. Agric. 2017, 144, 144–153. [Google Scholar] [CrossRef]
- Maselyne, J.; Saeys, W.; Ketelaere, B.D.; Mertens, K.; Vangeyte, J.; Hessel, E.F.; Millet, S.; Nuffel, A.V. Validation of a High Frequency Radio Frequency Identification (HF RFID) system for registering feeding patterns of growing-finishing pigs. Comput. Electron. Agric. 2014, 102, 10–18. [Google Scholar] [CrossRef] [Green Version]
- 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] [Green Version]
- Tian, M.; Guo, H.; Chen, H.; Wang, Q.; Long, C.; Ma, Y. Automated pig counting using deep learning. Comput. Electron. Agric. 2019, 163, 104840. [Google Scholar] [CrossRef]
- Shi, C.; Zhang, J.; Teng, G. Mobile measuring system based on LabVIEW for pig body components estimation in a large-scale farm. Comput. Electron. Agric. 2019, 156, 399–405. [Google Scholar] [CrossRef]
- Ahn, H.; Choi, W.; Park, S.; Chung, Y.; Park, D. Image Processing and Deep Learning Techniques for Fast Pig’s Posture Determining and Head Removal. KIPS Trans. Softw. Data Eng. 2019, 8, 457–464. [Google Scholar]
- Chen, C.; Zhu, W.; Guo, Y.; Ma, C.; Huang, W.; Ruan, C. A kinetic energy model based on machine vision for recognition of aggressive behaviours among group-housed pigs. Livest. Sci. 2018, 218, 70–78. [Google Scholar] [CrossRef]
- Chen, C.; Zhu, W.; Steibel, J.; Siegford, J.; Wurtz, K.; Han, J.; Norton, T. Recognition of aggressive episodes of pigs based on convolutional neural network and long short-term memory. Comput. Electron. Agric. 2020, 169, 105166. [Google Scholar] [CrossRef]
- Li, D.; Chen, Y.; Zhang, K.; Li, Z. Mounting Behaviour Recognition for Pigs Based on Deep Learning. Sensors 2019, 19, 4924. [Google Scholar] [CrossRef] [Green Version]
- Marsot, M.; Mei, J.; Shan, X.; Ye, L.; Feng, P.; Yan, X.; Zhao, Y. An adaptive pig face recognition approach using Convolutional Neural Networks. Comput. Electron. Agric. 2020, 173, 105386. [Google Scholar] [CrossRef]
- Hao, W.; Han, W.; Han, M.; Li, F. A Novel Improved YOLOv3-SC Model for Individual Pig Detection. Sensors 2022, 22, 8792. [Google Scholar] [CrossRef]
- Riekert, M.; Klein, A.; Adrion, F.; Hoffmann, C.; Gallmann, E. Automatically detecting pig position and posture by 2D camera imaging and deep learning. Comput. Electron. Agric. 2020, 174, 105391. [Google Scholar] [CrossRef]
- Nasirahmadi, A.; Sturm, B.; Edwards, S.; Jeppsson, K.-H.; Olsson, A.-C.; Müller, S.; Hensel, O. Deep Learning and Machine Vision Approaches for Posture Detection of Individual Pigs. Sensors 2019, 19, 3738. [Google Scholar] [CrossRef] [Green Version]
- Li, D.; Zhang, K.; Li, Z.; Chen, Y. A Spatiotemporal Convolutional Network for Multi-Behavior Recognition of Pigs. Sensors 2020, 20, 2381. [Google Scholar] [CrossRef] [Green Version]
- Shao, H.; Pu, J.; Mu, J. Pig-Posture Recognition Based on Computer Vision: Dataset and Exploration. Animals 2021, 11, 1295. [Google Scholar] [CrossRef]
- Lao, F.; Brown-Brandl, T.; Stinn, J.P.; Liu, K.; Teng, G.; Xin, H. Automatic recognition of lactating sow behaviors through depth image processing. Comp. Electron. Agric. 2016, 125, 56–62. [Google Scholar] [CrossRef] [Green Version]
- Yang, Q.; Xiao, D.; Lin, S. Feeding behavior recognition for group-housed pigs with the Faster R-CNN. Comput. Electron. Agric. 2018, 155, 453–460. [Google Scholar] [CrossRef]
- Alameer, A.; Kyriazakis, I.; Dalton, H.A.; Miller, A.L.; Bacardit, J. Automatic recognition of feeding and foraging behaviour in pigs using deep learning. Biosyst. Eng. 2020, 197, 91–104. [Google Scholar] [CrossRef]
- Kim, M.; Choi, Y.; Lee, J.N.; Sa, S.; Cho, H.C. A deep learning-based approach for feeding behavior recognition of weanling pigs. J. Anim. Sci. Technol. 2021, 63, 1453. [Google Scholar] [CrossRef] [PubMed]
- Kim, Y.J.; Park, D.H.; Park, H.; Kim, S.H. Pig Datasets of Livestock for Deep Learning to detect Posture using Surveillance Camera. In Proceedings of the International Conference on Information and Communication Technology Convergence, Jeju Island, Republic of Korea, 21 October 2020; pp. 1196–1198. [Google Scholar]
- Anchor Boxes for Object Detection. Available online: https://www.mathworks.com/help/vision/ug/anchor-boxes-for-object-detection.html (accessed on 25 November 2022).
- YOLO v5. Available online: https://github.com/ultralytics/yolov5 (accessed on 25 November 2022).
- Fernández, J.; Fàbrega, E.; Soler, J.; Tibau, J.; Ruiz, J.L.; Puigvert, X.; Manteca, X. Feeding strategy in group-housed growing pigs of four different breeds. Appl. Anim. Behav. Sci. 2011, 134, 109–120. [Google Scholar] [CrossRef]
- Rauw, W.; Soler, J.; Tibau, J.; Reixach, J.; Gomez Raya, L. Feeding time and feeding rate and its relationship with feed intake, feed efficiency, growth rate, and rate of fat deposition in growing duroc barrows. J. Anim. Sci. 2006, 84, 3404–3409. [Google Scholar] [CrossRef]
- Wolfger, B.; Timsit, E.; White, B.J.; Orsel, K. Systematic review of bovine respiratory disease diagnosis focused on diagnostic confirmation, early detection, and prediction of unfavorable outcomes in feedlot cattle. Vet. Clin. Food Anim. Pract. 2015, 31, 351–365. [Google Scholar] [CrossRef]
- Benaissa, S.; Tuyttens, F.A.; Plets, D.; Cattrysse, H.; Martens, L.; Vandaele, L.; Joseph, W.; Sonck, B. Classification of ingestive-related cow behaviours using RumiWatch halter and neck-mounted accelerometers. Appl. Anim. Behav. Sci. 2019, 211, 9–16. [Google Scholar] [CrossRef]
Classes | Dataset | ||
---|---|---|---|
Train | Valid | Test | |
Images | 734 | 90 | 97 |
Head | 14,095 | 1732 | 1683 |
Standing | 5835 | 728 | 688 |
LyingSide | 4442 | 547 | 534 |
LyingBelly | 3817 | 456 | 447 |
Class | Images | Instances | P | R | mAP50 | mAP50-95 |
---|---|---|---|---|---|---|
All | 89 | 3569 | 0.929 | 0.906 | 0.943 | 0.657 |
Head | 89 | 1690 | 0.917 | 0.852 | 0.895 | 0.477 |
Standing | 89 | 702 | 0.937 | 0.926 | 0.951 | 0.627 |
LyingBelly | 89 | 537 | 0.871 | 0.866 | 0.915 | 0.658 |
LyingSide | 89 | 464 | 0.929 | 0.903 | 0.962 | 0.749 |
Feeder | 89 | 176 | 0.992 | 0.983 | 0.99 | 0.773 |
(a) | ||||||
All | 89 | 3569 | 0.92 | 0.893 | 0.936 | 0.648 |
Head | 89 | 1690 | 0.922 | 0.852 | 0.882 | 0.459 |
Standing | 89 | 702 | 0.93 | 0.926 | 0.953 | 0.626 |
LyingBelly | 89 | 537 | 0.847 | 0.866 | 0.905 | 0.656 |
LyingSide | 89 | 464 | 0.918 | 0.903 | 0.955 | 0.757 |
Feeder | 89 | 176 | 0.98 | 0.983 | 0.984 | 0.743 |
(b) | ||||||
All | 89 | 3569 | 0.925 | 0.889 | 0.934 | 0.647 |
Head | 89 | 1690 | 0.919 | 0.826 | 0.88 | 0.462 |
Standing | 89 | 702 | 0.934 | 0.907 | 0.945 | 0.624 |
LyingBelly | 89 | 537 | 0.857 | 0.846 | 0.914 | 0.655 |
LyingSide | 89 | 464 | 0.933 | 0.896 | 0.952 | 0.742 |
Feeder | 89 | 176 | 0.982 | 0.972 | 0.976 | 0.751 |
(c) |
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. |
© 2022 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
Kim, T.; Kim, Y.; Kim, S.; Ko, J. Estimation of Number of Pigs Taking in Feed Using Posture Filtration. Sensors 2023, 23, 238. https://doi.org/10.3390/s23010238
Kim T, Kim Y, Kim S, Ko J. Estimation of Number of Pigs Taking in Feed Using Posture Filtration. Sensors. 2023; 23(1):238. https://doi.org/10.3390/s23010238
Chicago/Turabian StyleKim, Taeho, Youjin Kim, Sehan Kim, and Jaepil Ko. 2023. "Estimation of Number of Pigs Taking in Feed Using Posture Filtration" Sensors 23, no. 1: 238. https://doi.org/10.3390/s23010238
APA StyleKim, T., Kim, Y., Kim, S., & Ko, J. (2023). Estimation of Number of Pigs Taking in Feed Using Posture Filtration. Sensors, 23(1), 238. https://doi.org/10.3390/s23010238