The Development of a Sorting System Based on Point Cloud Weight Estimation for Fattening Pigs
Abstract
:1. Introduction
2. Materials and Methods
2.1. Experimental Data Collection
2.1.1. Animals and Data Collection Equipment
2.1.2. Data Preprocessing
2.2. Point Cloud Preprocessing
2.2.1. Spatial Pass-Through Filtering
2.2.2. Statistical Outlier Filtering
2.2.3. Point Cloud Clustering
2.2.4. Point Cloud Downsampling
2.3. Key Feature Extraction
2.3.1. Feature Definition
2.3.2. Research on Feature Extraction Algorithms
2.4. Research on Weight Estimation Model Based on Feature Parameters
2.4.1. Research on Weight Estimation Model Based on Random Forest
2.4.2. Research on Weight Estimation Model Based on Multilayer Perceptron
2.4.3. Research on Weight Estimation Model Based on Linear Regression and Ridge Regression
2.5. Sorting System Equipment Construction
2.5.1. Hardware Design
2.5.2. Software Design
3. Results
3.1. Point Cloud Extraction Results
3.2. Weight Estimation Model Results
3.3. Analysis of Weight Estimation Model Results
3.4. Sorting System Testing
3.5. Field Test Results
4. Discussion
- (1)
- This study develops a weight estimation model for finishing pigs based on the current dataset. Although we have made efforts to ensure the representativeness of the data, we acknowledge that the diversity of the existing dataset remains limited. Specifically, the current dataset primarily focuses on weight data within a specific range of finishing pigs, which may not fully capture the potential impact of weight variations on the partitioning method. Expanding the diversity of the dataset is highly valuable, and we plan to extend the dataset in future research to include a broader weight range and pigs at different growth stages, to evaluate the applicability of the partitioning method in a wider range of scenarios;
- (2)
- Considering the large data volume and high computational complexity of point clouds, an industrial computer needs to be deployed on the farm, which is costly. In the future, the RGB-D image pairs can be uploaded for computation on a cloud server, or deployment research can be conducted on edge computing devices to reduce equipment costs. For farms located in remote areas with limited or intermittent internet connectivity, this could be challenging. However, solutions such as satellite or wireless communication technologies (e.g., 4G/5G or LoRa) can provide reliable internet connectivity even in rural regions. Alternatively, edge computing devices can be used to process data locally, thus minimizing the reliance on continuous cloud connectivity. These edge devices would collect and preprocess data on-site, transmitting only essential information or updates to the cloud when a stable internet connection is available. In terms of cost-effectiveness, the initial investment required for such a system might be a barrier for smaller farms or those with limited budgets. Long-term savings in labor and increased efficiency, however, could offset these costs, making it a viable solution in the future;
- (3)
- Multiple depth cameras can be deployed to collect data from different angles, and a registration and fusion algorithm for 3D point clouds of fattening pigs can be studied to obtain a complete pig point cloud. The full 3D point cloud of a pig can improve segmentation accuracy, further enhancing feature extraction and posture determination accuracy, thereby improving weight estimation accuracy. Additionally, as the commercial pig industry primarily uses hybrid breeds, which may exhibit different growth patterns and behaviors, the system’s adaptability to various pig breeds, including hybrids, should be explored in future studies to ensure its broad applicability.
5. Conclusions
Supplementary Materials
Author Contributions
Funding
Institutional Review Board Statement
Data Availability Statement
Acknowledgments
Conflicts of Interest
References
- Moosa, M.M.; Ud-Dean, S.M.M. The Role of Dominance Hierarchy in the Evolution of Social Species. J. Theory Soc. Behav. 2011, 41, 203–208. [Google Scholar] [CrossRef]
- Canario, L.; Turner, S.P.; Roehe, R.; Lundeheim, N.; D’Eath, R.B.; Lawrence, A.B.; Knol, E.; Bergsma, R.; Rydhmer, L. Genetic Associations between Behavioral Traits and Direct-Social Effects of Growth Rate in Pigs1. J. Anim. Sci. 2012, 90, 4706–4715. [Google Scholar] [CrossRef]
- da Fonseca de Oliveira, A.C.; Webber, S.H.; Ramayo-Caldas, Y.; Dalmau, A.; Costa, L.B. Hierarchy Establishment in Growing Finishing Pigs: Impacts on Behavior, Growth Performance, and Physiological Parameters. Animals 2023, 13, 292. [Google Scholar] [CrossRef] [PubMed]
- Li, Y.Z.; Johnston, L.J. Behavior and Performance of Pigs Previously Housed in Large Groups. J. Anim. Sci. 2009, 87, 1472–1478. [Google Scholar] [CrossRef] [PubMed]
- Dang, C.; Choi, T.; Lee, S.; Lee, S.; Alam, M.; Park, M.; Han, S.; Lee, J.; Hoang, D. Machine Learning-Based Live Weight Estimation for Hanwoo Cow. Sustainability 2022, 14, 12661. [Google Scholar] [CrossRef]
- He, C.; Qiao, Y.; Mao, R.; Li, M.; Wang, M. Enhanced LiteHRNet Based Sheep Weight Estimation Using RGB-D Images. Comput. Electron. Agric. 2023, 206, 107667. [Google Scholar] [CrossRef]
- Condotta, I.C.; Brown-Brandl, T.M.; Silva-Miranda, K.O.; Stinn, J.P. Evaluation of a Depth Sensor for Mass Estimation of Growing and Finishing Pigs. Biosyst. Eng. 2018, 173, 11–18. [Google Scholar] [CrossRef]
- Okayama, T.; Kubota, Y.; Toyoda, A.; Kohari, D.; Noguchi, G. Estimating Body Weight of Pigs from Posture Analysis Using a Depth Camera. Anim. Sci. J. 2021, 92, e13626. [Google Scholar] [CrossRef]
- Kwon, K.; Park, A.; Lee, H.; Mun, D. Deep Learning-Based Weight Estimation Using a Fast-Reconstructed Mesh Model from the Point Cloud of a Pig. Comput. Electron. Agric. 2023, 210, 107903. [Google Scholar] [CrossRef]
- Shi, C.; Teng, G.; Li, Z. An Approach of Pig Weight Estimation Using Binocular Stereo System Based on LabVIEW. Comput. Electron. Agric. 2016, 129, 37–43. [Google Scholar] [CrossRef]
- Cang, Y.; He, H.; Qiao, Y. An Intelligent Pig Weights Estimate Method Based on Deep Learning in Sow Stall Environments. IEEE Access 2019, 7, 164867–164875. [Google Scholar] [CrossRef]
- Ling, Y.; Jimin, Z.; Caixing, L.; Xuhong, T.; Sumin, Z. Point Cloud-Based Pig Body Size Measurement Featured by Standard and Non-Standard Postures. Comput. Electron. Agric. 2022, 199, 107135. [Google Scholar] [CrossRef]
- Zhang, J.; Zhou, K.; Teng, G. Design of Automatic Group Sorting System for Fattening Pigs Based on Machine Vision. Trans. Chin. Soc. Agric. Eng. 2020, 36, 174–181. [Google Scholar]
- Zhang, B.; Xiong, C. Automatic Point Cloud Registration Based on Voxel Downsampling and Key Point Extraction. Laser Optoelectron. Prog. 2020, 57, 109–117. [Google Scholar]
- Tin, K.H. The Random Subspace Method for Constructing Decision Forests. IEEE Trans. Pattern Anal. Mach. Intell. 1998, 20, 832–844. [Google Scholar] [CrossRef]
- Frazier, P.I. A Tutorial on Bayesian Optimization. arXiv 2018, arXiv:1807.02811. [Google Scholar] [CrossRef]
- Taud, H.; Mas, J.-F. Multilayer Perceptron (MLP). In Geomatic Approaches for Modeling Land Change Scenarios; Springer: Cham, Switzerland, 2018; pp. 451–455. [Google Scholar] [CrossRef]
- Geladi, P.; Kowalski, B.R. Partial Least-Squares Regression: A Tutorial. Anal. Chim. Acta 1986, 185, 1–17. [Google Scholar] [CrossRef]
- McDonald, G.C. Ridge Regression. Wiley Interdiscip. Rev. Comput. Stat. 2009, 1, 93–100. [Google Scholar] [CrossRef]
- Fernandes, A.F.; Dórea, J.R.; Fitzgerald, R.; Herring, W.; Rosa, G.J. A Novel Automated System to Acquire Biometric and Morphological Measurements and Predict Body Weight of Pigs via 3D Computer Vision. J. Anim. Sci. 2019, 97, 496–508. [Google Scholar] [CrossRef] [PubMed]
- Buayai, P.; Piewthongngam, K.; Leung, C.K.; Saikaew, K.R. Semi-Automatic Pig Weight Estimation Using Digital Image Analysis. Appl. Eng. Agric. 2019, 35, 521–534. [Google Scholar] [CrossRef]
- Dohmen, R.; Catal, C.; Liu, Q. Computer Vision-Based Weight Estimation of Livestock: A Systematic Literature Review. New Zealand J. Agric. Res. 2022, 65, 227–247. [Google Scholar] [CrossRef]
- Kongsro, J. Estimation of Pig Weight Using a Microsoft Kinect Prototype Imaging System. Comput. Electron. Agric. 2014, 109, 32–35. [Google Scholar] [CrossRef]
- Pezzuolo, A.; Guarino, M.; Sartori, L.; González, L.A.; Marinello, F. On-Barn Pig Weight Estimation Based on Body Measurements by a Kinect v1 Depth Camera. Comput. Electron. Agric. 2018, 148, 29–36. [Google Scholar] [CrossRef]
- Salau, J.; Haas, J.H.; Junge, W.; Thaller, G. Extrinsic Calibration of a Multi-Kinect Camera Scanning Passage for Measuring Functional Traits in Dairy Cows. Biosyst. Eng. 2016, 151, 409–424. [Google Scholar] [CrossRef]
- Menesatti, P.; Costa, C.; Antonucci, F.; Steri, R.; Pallottino, F.; Catillo, G. A Low-Cost Stereovision System to Estimate Size and Weight of Live Sheep. Comput. Electron. Agric. 2014, 103, 33–38. [Google Scholar] [CrossRef]
Feature Parameters | Characters | Definition |
---|---|---|
Hip Width | W1 | Point Cloud Width within Segmentation Plane b |
Shoulder Width | W2 | Point Cloud Width within Segmentation Plane a |
Hip Height | H1 | Height of the Highest Point in Plane b of the Point Cloud |
Shoulder Height | H2 | Height of the Highest Point in Plane a of the Point Cloud |
Body Length | L1 | Distance Between Planes a and b |
Threshold | Precision | Recall |
---|---|---|
0.55 | 100% | 34.55% |
0.5 | 100% | 61.82% |
0.45 | 100% | 89.09% |
0.4 | 96.30% | 94.55% |
0.35 | 87.10% | 98.18% |
0.3 | 64.29% | 98.18% |
Model Name | Parameter | Tuning Threshold | Fixed Value |
---|---|---|---|
Random Forest | n_estimators | (60, 1200) | 533 |
max_depth | (3, 30) | 20 | |
min_samples_split | (2, 100) | 94 | |
min_samples_leaf | (1, 10) | 1 | |
MLP | hidden_layer_size_1 | (50, 200) | 146 |
hidden_layer_size_2 | (50, 200) | 60 | |
learning rate init | (0.0001, 0.1) | 0.0001 | |
alpha | (0.0001, 0.1) | 0.011 | |
batch size | (16, 128) | 52.00 | |
max iter | (100, 1000) | 431 | |
Linear Regression | degree | (1, 10) | 2 |
alpha | (0.0001, 0.1) | 0.016 | |
Ridge Regression | alpha | (0.0001, 10) | 0.0001 |
Name of Evaluation Metric | Random Forest | MLP | Linear Regression | Ridge Regression |
---|---|---|---|---|
Mean Squared Error (MSE) | 37.63 kg | 50.83 kg | 40.62 kg | 38.48 kg |
Mean Absolute Error (MAE) | 5.23 kg | 5.75 kg | 5.31 kg | 5.43 kg |
Mean Relative Error (MRE) | 4.48% | 5.04% | 4.54% | 4.64% |
Test Pig ID | True Value (kg) | Prediction Mean Value (kg) | Mean Relative Error | Total Duration (s) |
---|---|---|---|---|
1 | 109 | 114.78 | 5.31% | 11.3 |
2 | 115 | 116.01 | 0.88% | 10.9 |
3 | 118.5 | 116.20 | 1.94% | 10.2 |
4 | 119 | 114.57 | 3.72% | 10.1 |
5 | 120 | 118.78 | 1.02% | 10.6 |
6 | 121.5 | 120.27 | 1.02% | 10.3 |
7 | 123.5 | 120.76 | 2.22% | 10.7 |
8 | 124 | 119.38 | 3.73% | 14.9 |
9 | 125 | 122.27 | 2.19% | 13.3 |
10 | 126 | 117.25 | 6.94% | 13.1 |
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
Liu, L.; Ou, Y.; Zhao, Z.; Shen, M.; Zhao, R.; Liu, L. The Development of a Sorting System Based on Point Cloud Weight Estimation for Fattening Pigs. Agriculture 2025, 15, 365. https://doi.org/10.3390/agriculture15040365
Liu L, Ou Y, Zhao Z, Shen M, Zhao R, Liu L. The Development of a Sorting System Based on Point Cloud Weight Estimation for Fattening Pigs. Agriculture. 2025; 15(4):365. https://doi.org/10.3390/agriculture15040365
Chicago/Turabian StyleLiu, Luo, Yangsen Ou, Zhenan Zhao, Mingxia Shen, Ruqian Zhao, and Longshen Liu. 2025. "The Development of a Sorting System Based on Point Cloud Weight Estimation for Fattening Pigs" Agriculture 15, no. 4: 365. https://doi.org/10.3390/agriculture15040365
APA StyleLiu, L., Ou, Y., Zhao, Z., Shen, M., Zhao, R., & Liu, L. (2025). The Development of a Sorting System Based on Point Cloud Weight Estimation for Fattening Pigs. Agriculture, 15(4), 365. https://doi.org/10.3390/agriculture15040365