Pig Weight and Body Size Estimation Using a Multiple Output Regression Convolutional Neural Network: A Fast and Fully Automatic Method
Abstract
:1. Introduction
- (i)
- Projection method. Project a slide with grids onto the back of a pig, then calculate the pig shoulder height and area according to the principle of stereo projection to estimate pig weight [14]. This method is difficult to automate.
- (ii)
- Two-dimensional image method. Extract the pig body size, back area size, and other parameters from 2D images of pig backs, and use the model of the relationship between the pig weight and these parameters to achieve weight estimation. The average error of the weight estimation using this method is 3.38–5.3% [15,16,17,18].
- (iii)
- Three-dimensional image method. After acquiring 3D images of pig backs using a depth camera, extract the pig back height, body size, back area size, and other parameters from the 3D image and use these parameters to estimate the pig weight. The 2D image mainly shows color, texture and contour information of the pig back, but the color and texture information are not related to the pig weight and body size. The 3D image shows outline and height information on the pig back; these parameters are highly correlated with the body size and pig weight. In addition, it was impossible to estimate the pig height using the 2D image. Therefore, this method is more promising than the 2D image method. The mean absolute error (MAE) of estimating pig body size for this method is 1.44–5.81% [9,19,20,21,22,23,24,25].
- (iv)
- Ellipse fitting method. The ellipse fitting method is used to fit the area of a pig back image and estimate the weight of the pig based on the relationship model between the pig weight and center of mass, the length of the long axis and the short axis, the area, and the regional eccentricity of the fitted ellipse. The average relative error when using the ellipse fitting method to estimate pig weight is 3–3.8% [26,27,28,29].
2. Materials and Methods
2.1. Design of the Pig Weight and Back Image Acquisition System
2.2. Acquisition Method of Body Size
2.3. Data Collection and Preprocessing
2.4. Construction, Training and Testing of Pig Weight and Body Size Estimation Models
3. Results and Discussion
3.1. Model Training Results
3.2. Model Test Results
3.3. Feature Maps
3.4. Application Prospect
4. Conclusions
Author Contributions
Funding
Informed Consent Statement
Data Availability Statement
Conflicts of Interest
References
- Li, D.; Li, Z. System Analysis and Development Prospect of Unmanned Farming. Trans. Chin. Soc. Agric. Mach. 2020, 51, 1–12. [Google Scholar] [CrossRef]
- Lee, S.; Ahn, H.; Seo, J.; Chung, Y.; Park, D.; Pan, S. Practical Monitoring of Undergrown Pigs for IoT-Based Large-Scale Smart Farm. IEEE Access 2019, 7, 173796–173810. [Google Scholar] [CrossRef]
- Amraei, S.; Abdanan Mehdizadeh, S.; Salari, S. Broiler weight estimation based on machine vision and artificial neural network. Brit. Poult. Sci. 2017, 58, 200–205. [Google Scholar] [CrossRef]
- Wang, Y.; Yang, W.; Walker, L.T.; Rababah, T.M. Enhancing the accuracy of area extraction in machine vision-based pig weighing through edge detection. Int. J. Agric. Biol. Eng. 2008, 1, 37–42. [Google Scholar] [CrossRef]
- Matthews, S.G.; Miller, A.L.; Clapp, J.; Plötz, T.; Kyriazakis, I. 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] [Green Version]
- Liu, T.H.; Teng, G.H.; Fu, W.S. Research and development of pig weight estimation system based on image. In Proceedings of the 2011 International Conference on Electronics, Communications and Control (ICECC), Ningbo, China, 9–11 September 2011. [Google Scholar]
- McFarlane, N.J.B.; Wu, J.; Tillett, R.D.; Schofield, C.P.; Siebert, J.P.; Ju, X. Shape measurements of live pigs using 3-D image capture. Anim. Sci. 2005, 81, 383–391. [Google Scholar] [CrossRef]
- Doeschl-Wilson, A.B.; Whittemore, C.T.; Knap, P.W.; Schofield, C.P. Using visual image analysis to describe pig growth in terms of size and shape. Anim. Sci. 2004, 79, 415–427. [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]
- 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]
- Frost, A.R.; Schofield, C.P.; Beaulah, S.A.; Mottram, T.T.; Lines, J.A.; Wathes, C.M. A review of livestock monitoring and the need for integrated systems. Comput. Electron. Agric. 1997, 17, 139–159. [Google Scholar] [CrossRef]
- Itoh, T.; Kawabe, M.; Nagase, T.; Matsushita, H.; Kato, M.; Miyoshi, M.; Miyahara, K. Body surface area measurement in juvenile miniature pigs using a computed tomography scanner. Exp. Anim. 2017, 66, 229–233. [Google Scholar] [CrossRef] [Green Version]
- Wu, J.; Tillett, R.; McFarlane, N.; Ju, X.; Siebert, J.P.; Schofield, P. Extracting the three-dimensional shape of live pigs using stereo photogrammetry. Comput. Electron. Agric. 2004, 44, 203–222. [Google Scholar] [CrossRef]
- Minagawa, H.; Hosono, D. A light projection method to estimate pig height. In Swine Housing, Proceedings of the First International Conference, Des Moines, IA, USA, 9–11 October 2000; American Society of Agricultural Engineers: St. Joseph, MO, USA, 2000; pp. 120–125. [Google Scholar]
- Yang, Y.; Teng, G.; Li, B.; Shi, Z. Measurement of pig weight based on computer vision. Trans. Chin. Soc. Agric. Eng. 2006, 2, 135–139. [Google Scholar] [CrossRef]
- Schofield, C.P.; Marchant, J.A.; White, R.P.; Brandl, N.; Wilson, M. Monitoring Pig Growth using a Prototype Imaging System. J. Agric. Eng. Res. 1999, 72, 205–210. [Google Scholar] [CrossRef] [Green Version]
- Liu, T.; Li, Z.; Teng, G.; Luo, C. Prediction of Pig Weight Based on Radical Basis Function Neural Network. Trans. Chin. Soc. Agric. Mach. 2013, 44. [Google Scholar] [CrossRef]
- Kollis, K.; Phang, C.S.; Banhazi, T.M.; Searle, S.J. Weight estimation using image analysis and statistical modelling: A preliminary study. Appl. Eng. Agric. 2007, 23, 91–96. [Google Scholar] [CrossRef]
- Fernandes, A.; Rea, J.D.O.; Fitzgerald, R.; Herring, W.; Rosa, G. 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]
- Ke, W.; Hao, G.; Qin, M.; Wei, S.; Zhu, D. A portable and automatic Xtion-based measurement system for pig body size. Comput. Electron. Agric. 2018, 148, 291–298. [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]
- Li, Z.; Mao, T.; Liu, T.; Teng, G. Comparison and optimization of pig mass estimation models based on machine vision. Trans. Chin. Soc. Agric. Eng. 2015, 31, 155–161. [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]
- Pezzuolo, A.; Milani, V.; Zhu, D.; Guo, H.; Guercini, S.; Marinello, F. On-Barn Pig Weight Estimation Based on Body Measurements by Structure-from-Motion (SfM). Sensors 2018, 18, 3603. [Google Scholar] [CrossRef] [PubMed] [Green Version]
- Fu, W.; Teng, G.; Yang, Y. Research on three-dimensional model of pig′s weight estimating. Trans. Chin. Soc. Agric. Eng. 2006, 22, 84–87. [Google Scholar]
- Kashiha, M.; Bahr, C.; Ott, S.; Moons, C.P.H.; Niewold, T.A.; Ödberg, F.O.; Berckmans, D. Automatic weight estimation of individual pigs using image analysis. Comput. Electron. Agric. 2014, 107, 38–44. [Google Scholar] [CrossRef]
- Suwannakhun, S.; Daungmala, P. Estimating Pig Weight with Digital Image Processing using Deep Learning. In Proceedings of the 2018 14th International Conference on Signal-Image Technology & Internet-Based Systems (SITIS), Beijing, China, 26–29 November 2018. [Google Scholar]
- Wang, Y.; Yang, W.; Winter, P.; Walker, L. Walk-through weighing of pigs using machine vision and an artificial neural network. Biosyst. Eng. 2008, 100, 117–125. [Google Scholar] [CrossRef]
- Kashiha, M.; Bahr, C.; Ott, S.; Moons, C.P.H.; Niewold, T.A.; Ödberg, F.O.; Berckmans, D. Weight Estimation of Pigs Using Top-View Image Processing. In Proceedings of the International Conference Image Analysis and Recognition (ICIAR), Vilamoura, Portugal, 22–24 October 2014. [Google Scholar]
- LeCun, Y.; Bengio, Y.; Hinton, G. Deep learning. Nature 2015, 521, 436–444. [Google Scholar] [CrossRef]
- Kamilaris, A.; Prenafeta-Boldú, F.X. Deep learning in agriculture: A survey. Comput. Electron. Agric. 2018, 147, 70–90. [Google Scholar] [CrossRef] [Green Version]
- Li, G.; Bai, L.; Zhu, C.; Wu, E.; Ma, R. A Novel Method of Synthetic CT Generation from MR Images Based on Convolutional Neural Networks. In Proceedings of the 2018 11th International Congress on Image and Signal Processing, BioMedical Engineering and Informatics (CISP-BMEI), Beijing, China, 13–15 October 2018. [Google Scholar]
- Chen, D.; Li, S.; Wu, Q. A Novel Supertwisting Zeroing Neural Network with Application to Mobile Robot Manipulators. IEEE Trans. Neural. Netw. Learn. Syst. 2020, 1–12. [Google Scholar] [CrossRef]
- Huang, G.; Liu, Z.; van der Maaten, L.; Weinberger, K.Q. Densely Connected Convolutional Networks. In Proceedings of the 2017 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), Honolulu, HI, USA, 21–26 July 2017. [Google Scholar]
- Yu, X.; Yu, Z.; Ramalingam, S. Learning strict identity mappings in deep residual networks. In Proceedings of the 2018 IEEE/CVF Conference on Computer Vision and Pattern Recognition, Salt Lake City, UT, USA, 18–22 June 2018. [Google Scholar]
- Chollet, F. Xception: Deep Learning with Depthwise Separable Convolutions. In Proceedings of the 2017 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), Honolulu, HI, USA, 21–26 July 2017. [Google Scholar]
- Sandler, M.; Howard, A.; Zhu, M.; Zhmoginov, A.; Chen, L. MobileNetV2: Inverted Residuals and Linear Bottlenecks. In Proceedings of the 2018 IEEE/CVF Conference on Computer Vision and Pattern Recognition, Salt Lake City, UT, USA, 18–22 June 2018. [Google Scholar]
Optimization Function | Learning Rate | Loss Function | Batch Size | Iterations |
---|---|---|---|---|
Adam | 0.001 | MSE | 16 | 150 |
Model | Size of Input Image (pixels) | Model Size (MB) | Number of Parameters | Number of Trainable Parameters | Training Time (h) |
---|---|---|---|---|---|
Modified DenseNet201 | 224 × 224 | 229 | 18,333,510 | 18,104,454 | 29.1 |
Modified MobileNet V2 | 224 × 224 | 31 | 2,265,670 | 2,231,558 | 12.9 |
Modified ResNet152 V2 | 224 × 224 | 683 | 58,343,942 | 58,200,198 | 35.7 |
Modified Xception | 299 × 299 | 243 | 20,873,774 | 20,819,246 | 54.0 |
Items | Modified DenseNet201 | Modified MobileNet V2 | Modified ResNet152 V2 | Modified Xception | |
---|---|---|---|---|---|
BW | RMSE (kg) | 2.51 | 1.84 | 1.73 | 1.53 |
MAE (kg) | 2.03 | 1.49 | 1.31 | 1.16 | |
MRE | 3.44% | 2.54% | 2.26% | 1.99% | |
SW | RMSE (cm) | 0.48 | 0.44 | 0.46 | 0.43 |
MAE (cm) | 0.38 | 0.34 | 0.37 | 0.33 | |
MRE | 1.49% | 1.35% | 1.47% | 1.31% | |
SH | RMSE (cm) | 1.53 | 1.38 | 1.31 | 1.36 |
MAE (cm) | 1.42 | 1.22 | 1.17 | 1.23 | |
MRE | 2.79% | 2.38% | 2.30% | 2.40% | |
HW | RMSE (cm) | 0.50 | 0.40 | 0.47 | 0.47 |
MAE (cm) | 0.45 | 0.31 | 0.38 | 0.38 | |
MRE | 1.84% | 1.29% | 1.55% | 1.58% | |
HH | RMSE (cm) | 1.11 | 0.96 | 1.10 | 0.87 |
MAE (cm) | 0.90 | 0.76 | 0.89 | 0.66 | |
MRE | 1.59% | 1.34% | 1.58% | 1.16% | |
BL | RMSE (cm) | 1.16 | 0.89 | 0.84 | 0.94 |
MAE (cm) | 0.97 | 0.69 | 0.63 | 0.75 | |
MRE | 1.05% | 0.74% | 0.69% | 0.82% | |
MET (ms) | 17.98 | 5.99 | 27.10 | 12.32 | |
MSE (kg2) | 11.699 | 7.357 | 7.057 | 6.236 |
Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations. |
© 2021 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
Zhang, J.; Zhuang, Y.; Ji, H.; Teng, G. Pig Weight and Body Size Estimation Using a Multiple Output Regression Convolutional Neural Network: A Fast and Fully Automatic Method. Sensors 2021, 21, 3218. https://doi.org/10.3390/s21093218
Zhang J, Zhuang Y, Ji H, Teng G. Pig Weight and Body Size Estimation Using a Multiple Output Regression Convolutional Neural Network: A Fast and Fully Automatic Method. Sensors. 2021; 21(9):3218. https://doi.org/10.3390/s21093218
Chicago/Turabian StyleZhang, Jianlong, Yanrong Zhuang, Hengyi Ji, and Guanghui Teng. 2021. "Pig Weight and Body Size Estimation Using a Multiple Output Regression Convolutional Neural Network: A Fast and Fully Automatic Method" Sensors 21, no. 9: 3218. https://doi.org/10.3390/s21093218
APA StyleZhang, J., Zhuang, Y., Ji, H., & Teng, G. (2021). Pig Weight and Body Size Estimation Using a Multiple Output Regression Convolutional Neural Network: A Fast and Fully Automatic Method. Sensors, 21(9), 3218. https://doi.org/10.3390/s21093218