Automatic Recognition and Quantification Feeding Behaviors of Nursery Pigs Using Improved YOLOV5 and Feeding Functional Area Proposals
Abstract
:Simple Summary
Abstract
1. Introduction
2. Materials and Methods
2.1. Animals, Housing, and Management
2.2. Dataset
2.2.1. Definition of Behaviors
2.2.2. Data Acquisition and Preprocessing
2.3. The Overall Process of Behavior Recognition and Quantification
Feeding Functional Area Proposals Filtering Strategy
Algorithm 1 Feeding functional area proposals filtering strategy |
: Pig head detection bounding box : The number of feeding and drinking in the current frame
|
- where means all the bounding boxes are in the pig pen area, means the number of heads with feeding behavior, and means the extent of the feeding area.
2.4. Piglet Head Detection Network Architecture
YOLO Principle
2.5. Evaluation Index
2.6. Training Environment and Equipment Description
3. Results
3.1. Performance Comparison of Different Models
3.2. Ablation Test
3.3. Performance Comparison of Three IOU Loss Functions
4. Discussions
4.1. The Impact of Different Models on the Pig Head Detection Performance
4.2. Results of Feeding Behaviors and No Feeding Behaviors
Distribution of Feeding Time of Piglets in Different Periods for All Weather
5. Conclusions
Author Contributions
Funding
Institutional Review Board Statement
Informed Consent Statement
Data Availability Statement
Acknowledgments
Conflicts of Interest
References
- Nguyen-Ba, H.; van Milgen, J.; Taghipoor, M. A procedure to quantify the feed intake response of growing pigs to perturbations. Animal 2020, 14, 253–260. [Google Scholar] [CrossRef]
- Neethirajan, S.; Reimert, I.; Kemp, B. Measuring Farm Animal Emotions—Sensor-Based Approaches. Sensors 2021, 21, 553. [Google Scholar] [CrossRef]
- Jia, M.; Zhang, H.; Xu, J.; Su, Y.; Zhu, W. Feeding frequency affects the growth performance, nutrient digestion and absorption of growing pigs with the same daily feed intake. Livest. Sci. 2021, 250, 104558. [Google Scholar] [CrossRef]
- Von Jasmund, N.; Wellnitz, A.; Krommweh, M.S.; Büscher, W. Using Passive Infrared Detectors to Record Group Activity and Activity in Certain Focus Areas in Fattening Pigs. Animals 2020, 10, 792. [Google Scholar] [CrossRef]
- Boumans, I.J.; de Boer, I.J.; Hofstede, G.J.; Bokkers, E.A. How social factors and behavioural strategies affect feeding and social interaction patterns in pigs. Physiol. Behav. 2018, 194, 23–40. [Google Scholar] [CrossRef]
- Li, Y.; Zhang, H.; Johnston, L.; Martin, W. Understanding Tail-Biting in Pigs through Social Network Analysis. Animals 2018, 8, 13. [Google Scholar] [CrossRef]
- Li, Y.Z.; Johnston, L.J.; Dawkins, M.S. Utilization of Optical Flow Algorithms to Monitor Development of Tail Biting Outbreaks in Pigs. Animals 2020, 10, 323. [Google Scholar] [CrossRef] [PubMed]
- Vitali, M.; Santolini, E.; Bovo, M.; Tassinari, P.; Torreggiani, D.; Trevisi, P. Behavior and Welfare of Undocked Heavy Pigs Raised in Buildings with Different Ventilation Systems. Animals 2021, 11, 2338. [Google Scholar] [CrossRef] [PubMed]
- Luo, Y.; Zeng, Z.; Lu, H.; Lv, E. Posture Detection of Individual Pigs Based on Lightweight Convolution Neural Networks and Efficient Channel-Wise Attention. Sensors 2021, 21, 8369. [Google Scholar] [CrossRef] [PubMed]
- Juul, L.; Kristensen, T.; Theil, P.; Therkildsen, M.; Kongsted, A. Effect of two different feeding strategies on energy intake from pasture, feed efficiency and growth performance of growing-finishing pigs in a mobile pasture system. Livest. Sci. 2021, 252, 104690. [Google Scholar] [CrossRef]
- Gomes, B.C.K.; Andretta, I.; Valk, M.; Pomar, C.; Hauschild, L.; Fraga, A.Z.; Kipper, M.; Trevizan, L.; Remus, A. Prandial Correlations and Structure of the Ingestive Behavior of Pigs in Precision Feeding Programs. Animals 2021, 11, 2998. [Google Scholar] [CrossRef]
- Larsen, M.L.V.; Wang, M.; Norton, T. Information Technologies for Welfare Monitoring in Pigs and Their Relation to Welfare Quality®. Sustainability 2021, 13, 692. [Google Scholar] [CrossRef]
- Kapun, A.; Adrion, F.; Gallmann, E. Case Study on Recording Pigs’ Daily Activity Patterns with a UHF-RFID System. Agriculture 2020, 10, 542. [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]
- Ott, S.; Moons, C.; Kashiha, M.; Bahr, C.; Tuyttens, F.; Berckmans, D.; Niewold, T. Automated video analysis of pig activity at pen level highly correlates to human observations of behavioural activities. Livest. Sci. 2014, 160, 132–137. [Google Scholar] [CrossRef]
- Arulmozhi, E.; Bhujel, A.; Moon, B.E.; Kim, H.T. The Application of Cameras in Precision Pig Farming: An Overview for Swine-Keeping Professionals. Animals 2021, 11, 2343. [Google Scholar] [CrossRef] [PubMed]
- Yang, A.; Huang, H.; Zheng, B.; Li, S.; Gan, H.; Chen, C.; Yang, X.; Xue, Y. An automatic recognition framework for sow daily behaviours based on motion and image analyses. Biosyst. Eng. 2020, 192, 56–71. [Google Scholar] [CrossRef]
- Li, Y.Z.; McDonald, K.A.; Gonyou, H.W. Determining feeder space allowance across feed forms and water availability in the feeder for growing-finishing pigs. J. Swine Health Prod. 2017, 25, 9. [Google Scholar] [CrossRef] [PubMed]
- Chen, C.; Zhu, W.; Steibel, J.; Siegford, J.; Han, J.; Norton, T. Classification of drinking and drinker-playing in pigs by a video-based deep learning method. Biosyst. Eng. 2020, 196, 1–14. [Google Scholar] [CrossRef]
- Chen, C.; Zhu, W.; Steibel, J.; Siegford, J.; Han, J.; Norton, T. Recognition of feeding behaviour of pigs and determination of feeding time of each pig by a video-based deep learning method. Comput. Electron. Agric. 2020, 176, 105642. [Google Scholar] [CrossRef]
- Garrido-Izard, M.; Correa, E.C.; Requejo, J.M.; Diezma, B. Continuous Monitoring of Pigs in Fattening Using a Multi-Sensor System: Behavior Patterns. Animals 2019, 10, 52. [Google Scholar] [CrossRef]
- Zhu, W.; Guo, Y.; Jiao, P.; Ma, C.; Chen, C. Recognition and drinking behaviour analysis of individual pigs based on machine vision. Livest. Sci. 2017, 205, 129–136. [Google Scholar] [CrossRef]
- Kim, M.; Choi, Y.; Lee, J.; Sa, S.; Cho, H. A deep learning-based approach for feeding behavior recognition of weanling pigs. J. Anim. Sci. Technol. 2021, 63, 1453–1463. [Google Scholar] [CrossRef]
- Parez, S.; Dilshad, N.; Alanazi, T.M.; Lee, J.W. Towards Sustainable Agricultural Systems: A Lightweight Deep Learning Model for Plant Disease Detection. Comput. Syst. Sci. Eng. 2023, 47, 515–536. [Google Scholar] [CrossRef]
- Dilshad, N. Efficient Deep Learning Framework for Fire Detection in Complex Surveillance Environment. Comput. Syst. Sci. Eng. 2023, 46, 749–764. [Google Scholar] [CrossRef]
- Yar, H.; Khan, Z.A.; Ullah, F.U.M.; Ullah, W.; Baik, S.W. A modified YOLOv5 architecture for efficient fire detection in smart cities. Expert Syst. Appl. 2023, 231, 120465. [Google Scholar] [CrossRef]
- Lou, M.E.; Porter, S.T.; Massey, J.S.; Ventura, B.; Deen, J.; Li, Y. The Application of 3D Landmark-Based Geometric Morphometrics towards Refinement of the Piglet Grimace Scale. Animals 2022, 12, 1944. [Google Scholar] [CrossRef]
- Li, G.; Hui, X.; Chen, Z.; Chesser, G.D.; Zhao, Y. Development and evaluation of a method to detect broilers continuously walking around feeder as an indication of restricted feeding behaviors. Comput. Electron. Agric. 2021, 181, 105982. [Google Scholar] [CrossRef]
- Del Valle, J.E.; Pereira, D.F.; Mollo Neto, M.; Gabriel Filho, L.R.A.; Salgado, D.D. Unrest index for estimating thermal comfort of poultry birds (Gallus gallus domesticus) using computer vision techniques. Biosyst. Eng. 2021, 206, 123–134. [Google Scholar] [CrossRef]
- Gómez, Y.; Stygar, A.H.; Boumans, I.J.M.M.; Bokkers, E.A.M.; Pedersen, L.J.; Niemi, J.K.; Pastell, M.; Manteca, X.; Llonch, P. A Systematic Review on Validated Precision Livestock Farming Technologies for Pig Production and Its Potential to Assess Animal Welfare. Front. Vet. Sci. 2021, 8, 660565. [Google Scholar] [CrossRef] [PubMed]
- Yang, Q.; Xiao, D.; Cai, J. Pig mounting behaviour recognition based on video spatial–temporal features. Biosyst. Eng. 2021, 206, 55–66. [Google Scholar] [CrossRef]
- Li, X.; Pan, J.; Xie, F.; Zeng, J.; Li, Q.; Huang, X.; Liu, D.; Wang, X. Fast and accurate green pepper detection in complex backgrounds via an improved Yolov4-tiny model. Comput. Electron. Agric. 2021, 191, 106503. [Google Scholar] [CrossRef]
- Gan, H.; Xu, C.; Hou, W.; Guo, J.; Liu, K.; Xue, Y. Spatiotemporal graph convolutional network for automated detection and analysis of social behaviours among pre-weaning piglets. Biosyst. Eng. 2022, 217, 102–114. [Google Scholar] [CrossRef]
- Yang, Q.; Xiao, D. A review of video-based pig behavior recognition. Appl. Anim. Behav. Sci. 2020, 233, 105146. [Google Scholar] [CrossRef]
- Xu, S.; Dutta, V.; He, X.; Matsumaru, T. A Transformer-Based Model for Super-resolution of Anime Image. Sensors 2022, 22, 8126. [Google Scholar] [CrossRef]
- Liu, S.; Qi, L.; Qin, H.; Shi, J.; Jia, J. Path aggregation network for instance segmentation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, Salt Lake City, UT, USA, 18–23 June 2018; pp. 8759–8768. [Google Scholar]
- Zhu, X.; Lyu, S.; Wang, X.; Zhao, Q. TPH-YOLOv5: Improved YOLOv5 Based on Transformer Prediction Head for Object Detection on Drone-captured Scenarios. In Proceedings of the 2021 IEEE/CVF International Conference on Computer Vision Workshops (ICCVW), IEEE, Montreal, BC, Canada, 11–17 October 2021; pp. 2778–2788. [Google Scholar] [CrossRef]
- Chen, C.; Zhu, W.; Norton, T. Behaviour recognition of pigs and cattle: Journey from computer vision to deep learning. Comput. Electron. Agric. 2021, 187, 106255. [Google Scholar] [CrossRef]
- Mekhalfi, M.L.; Nicolò, C.; Bazi, Y.; Al Rahhal, M.M.; Alsharif, N.A.; Al Maghayreh, E. Contrasting YOLOv5, Transformer, and EfficientDet Detectors for Crop Circle Detection in Desert. IEEE Geosci. Remote. Sens. Lett. 2021, 19, 3003205. [Google Scholar] [CrossRef]
- Han, J.H.; Choi, D.J.; Park, S.; Hong, S.K. Hyperparameter optimization using a genetic algorithm considering verification time in a convolutional neural network. J. Electr. Eng. Technol. 2020, 15, 721–726. [Google Scholar] [CrossRef]
- Selvaraju, R.R.; Cogswell, M.; Das, A.; Vedantam, R.; Parikh, D.; Batra, D. Grad-CAM: Visual Explanations From Deep Networks via Gradient-Based Localization. In Proceedings of the IEEE International Conference on Computer Vision, Venice, Italy, 22–29 October 2017; p. 9. [Google Scholar]
Category | Abbreviation | Description |
---|---|---|
Feeding Behavior | FB | The piglet’s head enters the trough, the head droops, and the two forelimbs enter or are near the trough. |
Not Feeding Behavior | NFB | The piglet does not enter the trough, its head is not in the trough, its body is close to or away from the trough, and it stands on the floor vertically on all four limbs or lies on its side to rest. |
Configuration | Parameter |
---|---|
Image resolution | 2304 pixels ∗ 1296 pixels (W ∗ H) |
Training framework | Python 3.7 programming language, Pytorch framework |
Pretrained model | ImageNet model |
Operating system | Ubuntu18.04 version |
Accelerated environment | CUDA11 and CUDNN 7 |
Development environment | Vscode |
Computer configuration used in training and testing | Dell Tower Workstation Intel@Xeon(R) T7920 Processor, 32 GB RDIMM, 512 G Solid State Drive, 4 TB Mechanical Hard Drive, Graphics Card RTX2080Ti |
Detector | Backbone | mAP | F1_Score |
---|---|---|---|
YoloV3 | Darknet53 | 83.1% | 82.0% |
YoloV5 | CSPDarknet53 | 87.0% | 86.0% |
YoloV5 | MobileNetV3-Large | 66.4% | 66.0% |
YoloV5 | RepVGG | 78.0% | 77.0% |
YoloV5 | proposed model |
Classes | C3TR | CBAM | Change Head | mAP | F1_Score |
---|---|---|---|---|---|
M0 | - | - | - | 87.0% | 86.0% |
M1 | ✓ | - | - | 89.4% | 87.0% |
M2 | - | ✓ | - | 87.2% | 86.0% |
M3 | - | - | ✓ | 87.4% | 85.0% |
M4 | ✓ | ✓ | ✓ | 92.1% | 90% |
Model | IOU | mAP | F1_Score |
---|---|---|---|
The proposed model | GIOU | 87.2% | 87% |
The proposed model | DIOU | 89.4%% | 87% |
The proposed model | CIOU | 92.1%% | 90% |
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
Luo, Y.; Xia, J.; Lu, H.; Luo, H.; Lv, E.; Zeng, Z.; Li, B.; Meng, F.; Yang, A. Automatic Recognition and Quantification Feeding Behaviors of Nursery Pigs Using Improved YOLOV5 and Feeding Functional Area Proposals. Animals 2024, 14, 569. https://doi.org/10.3390/ani14040569
Luo Y, Xia J, Lu H, Luo H, Lv E, Zeng Z, Li B, Meng F, Yang A. Automatic Recognition and Quantification Feeding Behaviors of Nursery Pigs Using Improved YOLOV5 and Feeding Functional Area Proposals. Animals. 2024; 14(4):569. https://doi.org/10.3390/ani14040569
Chicago/Turabian StyleLuo, Yizhi, Jinjin Xia, Huazhong Lu, Haowen Luo, Enli Lv, Zhixiong Zeng, Bin Li, Fanming Meng, and Aqing Yang. 2024. "Automatic Recognition and Quantification Feeding Behaviors of Nursery Pigs Using Improved YOLOV5 and Feeding Functional Area Proposals" Animals 14, no. 4: 569. https://doi.org/10.3390/ani14040569
APA StyleLuo, Y., Xia, J., Lu, H., Luo, H., Lv, E., Zeng, Z., Li, B., Meng, F., & Yang, A. (2024). Automatic Recognition and Quantification Feeding Behaviors of Nursery Pigs Using Improved YOLOV5 and Feeding Functional Area Proposals. Animals, 14(4), 569. https://doi.org/10.3390/ani14040569