Research on Estimating Backfat Thickness in Jinfen White Pigs Using Deep Learning and Image Processing
Abstract
1. Introduction
2. Materials and Methods
2.1. Data Set Acquisition
2.1.1. Acquisition of Sow Buttocks Images
2.1.2. Data Acquisition for Backfat Thickness in Sows
2.1.3. Image Preprocessing
2.2. Improved YOLOv8n-ShuffleNetV2 Algorithm for Detection of Sows’ Buttocks Regions of Interest
2.3. Depth Image Processing and Extraction of External Shape Parameters
2.4. Model Development and Evaluation
2.4.1. Machine Learning Model Creation and Optimization Algorithms
2.4.2. Model Evaluation
3. Results and Analysis
3.1. Performance Comparison of Different Models
3.2. Correlation and Principal Component Analysis
3.3. Sow Backfat Thickness Estimation Model
3.4. Sow Backfat Thickness Estimation System
4. Discussion
- During feeding, sows often display high-frequency tail sweeping driven by excitement, which produces blurred trails in the images. These blurred regions can generate spurious edge pixels during contour extraction, inflating area measurements and resulting in BFT overestimation. Subsequent studies may include the detection of tail movement amplitude through interframe differences and the use of interpolation between adjacent frames for replacement, thereby reducing errors during the extraction of external morphological parameters.
- The study focused on the collection of growth data from Jinfen White sows at the gilt and parous stages. Body conformation and fat distribution vary across physiological stages. Changes in abdominal morphology can cause pixel bridging between the abdominal and hip regions in images, which can complicate accurate hip contour segmentation and the extraction of morphological parameters. Subsequent studies should include the collection and categorization of samples from different physiological stages to create a more comprehensive multimodal model for physiological stage identification and prediction, thereby further enhancing the model’s accuracy and adaptability.
5. Conclusions
Author Contributions
Funding
Institutional Review Board Statement
Data Availability Statement
Conflicts of Interest
References
- Thitachot, K.; Sirinopwong, V.; Seemuang, V.; Ratchatasriprasert, A.; Kirkwood, R.N.; Am-In, N. Influence of backfat thickness and the interval from altrenogest withdrawal to estrus on reproductive performance of gilts. Animals 2021, 11, 1348. [Google Scholar] [CrossRef]
- Ding, R.; Zhuang, Z.; Qiu, Y.; Ruan, D.; Wu, J.; Ye, J.; Cao, L.; Zhou, S.; Zheng, E.; Huang, W. Identify known and novel candidate genes associated with backfat thickness in Duroc pigs by large-scale genome-wide association analysis. J. Anim. Sci. 2022, 100, skac012. [Google Scholar] [CrossRef]
- Kim, K.; Hosseindoust, A.; Ingale, S.; Lee, S.; Noh, H.; Choi, Y.; Jeon, S.; Kim, Y.; Chae, B. Effects of gestational housing on reproductive performance and behavior of sows with different backfat thickness. Asian-Australas. J. Anim. Sci. 2015, 29, 142. [Google Scholar] [CrossRef]
- Ma, W.; Qi, X.; Sun, Y.; Gao, R.; Ding, L.; Wang, R.; Peng, C.; Zhang, J.; Wu, J.; Xu, Z. Computer vision-based measurement techniques for livestock body dimension and weight: A review. Agriculture 2024, 14, 306. [Google Scholar] [CrossRef]
- Fisher, A.V. A review of the technique of estimating the composition of livestock using the velocity of ultrasound. Comput. Electron. Agric. 1997, 17, 217–231. [Google Scholar] [CrossRef]
- Ginat, D.T.; Gupta, R. Advances in computed tomography imaging technology. Annu. Rev. Biomed. Eng. 2014, 16, 431–453. [Google Scholar] [CrossRef]
- Sharma, S.; Mittal, R.; Goyal, N. An assessment of machine learning and deep learning techniques with applications. ECS Trans. 2022, 107, 8979. [Google Scholar] [CrossRef]
- Moutik, O.; Sekkat, H.; Tigani, S.; Chehri, A.; Saadane, R.; Tchakoucht, T.A.; Paul, A. Convolutional neural networks or vision transformers: Who will win the race for action recognitions in visual data? Sensors 2023, 23, 734. [Google Scholar] [CrossRef]
- Yu, M.; Zheng, H.; Xu, D.; Shuai, Y.; Tian, S.; Cao, T.; Zhou, M.; Zhu, Y.; Zhao, S.; Li, X. Non-contact detection method of pregnant sows backfat thickness based on two-dimensional images. Anim. Genet. 2022, 53, 769–781. [Google Scholar] [CrossRef]
- Li, X.; Yu, M.; Xu, D.; Zhao, S.; Tan, H.; Liu, X. Non-contact measurement of pregnant sows’ backfat thickness based on a hybrid CNN-ViT model. Agriculture 2023, 13, 1395. [Google Scholar] [CrossRef]
- Teng GuangHui, T.G.; Shen ZhiJie, S.Z.; Zhang JianLong, Z.J.; Shi Chen, S.C.; Yu JiongHua, Y.J. Non-contact sow body condition scoring method based on Kinect sensor. Trans. Chin. Soc. Agric. Eng. 2018, 34, 211–217. [Google Scholar]
- Jian, Y.; Pu, S.; Zhu, J.; Zhang, J.; Xing, W. Estimation of Sow Backfat Thickness Based on Machine Vision. Animals 2024, 14, 3520. [Google Scholar] [CrossRef]
- Fernandes, A.F.; Dórea, J.R.; Valente, B.D.; Fitzgerald, R.; Herring, W.; Rosa, G.J. Comparison of data analytics strategies in computer vision systems to predict pig body composition traits from 3D images. J. Anim. Sci. 2020, 98, skaa250. [Google Scholar] [CrossRef]
- Alvarez, J.R.; Arroqui, M.; Mangudo, P.; Toloza, J.; Jatip, D.; Rodriguez, J.M.; Teyseyre, A.; Sanz, C.; Zunino, A.; Machado, C. Body condition estimation on cows from depth images using Convolutional Neural Networks. Comput. Electron. Agric. 2018, 155, 12–22. [Google Scholar] [CrossRef]
- Azzaro, G.; Caccamo, M.; Ferguson, J.D.; Battiato, S.; Farinella, G.M.; Guarnera, G.C.; Puglisi, G.; Petriglieri, R.; Licitra, G. Objective estimation of body condition score by modeling cow body shape from digital images. J. Dairy Sci. 2011, 94, 2126–2137. [Google Scholar] [CrossRef]
- Vieira, A.; Brandão, S.; Monteiro, A.; Ajuda, I.; Stilwell, G. Development and validation of a visual body condition scoring system for dairy goats with picture-based training. J. Dairy Sci. 2015, 98, 6597–6608. [Google Scholar] [CrossRef]
- Greer, E.; Mort, P.; Lowe, T.; Giles, L. Accuracy of ultrasonic backfat testers in predicting carcass P2 fat depth from live pig measurement and the effect on accuracy of mislocating the P2 site on the live pig. Aust. J. Exp. Agric. 1987, 27, 27–34. [Google Scholar] [CrossRef]
- Yang, W.; Wu, J.; Zhang, J.; Gao, K.; Du, R.; Wu, Z.; Firkat, E.; Li, D. Deformable convolution and coordinate attention for fast cattle detection. Comput. Electron. Agric. 2023, 211, 108006. [Google Scholar] [CrossRef]
- Pan, P.; Guo, W.; Zheng, X.; Hu, L.; Zhou, G.; Zhang, J. Xoo-YOLO: A detection method for wild rice bacterial blight in the field from the perspective of unmanned aerial vehicles. Front. Plant Sci. 2023, 14, 1256545. [Google Scholar] [CrossRef]
- Ma, N.; Zhang, X.; Zheng, H.-T.; Sun, J. Shufflenet v2: Practical guidelines for efficient cnn architecture design. In Proceedings of the European Conference on Computer Vision (ECCV), Munich, Germany, 8–14 September 2018; pp. 116–131. [Google Scholar]
- Wang, J.; Ma, S.; Wang, Z.; Ma, X.; Yang, C.; Chen, G.; Wang, Y. Improved Lightweight YOLOv8 Model for Rice Disease Detection in Multi-Scale Scenarios. Agronomy 2025, 15, 445. [Google Scholar] [CrossRef]
- Li, X.; Wu, J.; Zhao, Z.; Zhuang, Y.; Sun, S.; Xie, H.; Gao, Y.; Xiao, D. An improved method for broiler weight estimation integrating multi-feature with gradient boosting decision tree. Animals 2023, 13, 3721. [Google Scholar] [CrossRef] [PubMed]
- Ester, M.; Kriegel, H.; Xu, X. XGBoost: A scalable tree boosting system. In Proceedings of the 22nd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, San Francisco, CA, USA, 13–17 August 2016. [Google Scholar]
- Cheng, T.; Li, M.; Quan, L.; Song, Y.; Lou, Z.; Li, H.; Du, X. A multimodal and temporal network-based yield Assessment Method for different heat-tolerant genotypes of wheat. Agronomy 2024, 14, 1694. [Google Scholar] [CrossRef]
- Zou, H.; Hastie, T. Regularization and variable selection via the elastic net. J. R. Stat. Soc. Ser. B Stat. Methodol. 2005, 67, 301–320. [Google Scholar] [CrossRef]
- Jun, H.; Kangting, L.; Tianqi, H.; Yunge, W.; Gang, X. Remote sensing inversion of mangrove biomass based on machine learning. For. Grassl. Resour. Res. 2024, 65–72. [Google Scholar] [CrossRef]
- Adeleke, A.A.; Okolie, J.A.; Ogbaga, C.C.; Ikubanni, P.P.; Okoye, P.U.; Akande, O. Machine learning model for the evaluation of biomethane potential based on the biochemical composition of biomass. BioEnergy Res. 2024, 17, 731–743. [Google Scholar] [CrossRef]











| Dataset | Sample Size | Maximum | Minimum | Mean | Standard Deviation |
|---|---|---|---|---|---|
| Training set | 152 | 29 | 6 | 17.13 | 5.59 |
| Test set | 51 | 28 | 6 | 16.86 | 5.69 |
| Model | Trainable Parameters | Model Size (MB) | Training Time (h) | MAP50-95 | Inference Latency (ms) |
|---|---|---|---|---|---|
| Yolov8n | 3,005,843 | 6.3 | 4.5 | 0.939 | 3.3 |
| Yolov8s | 11,125,971 | 22.5 | 6.5 | 0.941 | 5.0 |
| Yolov8m | 25,840,339 | 52.1 | 15.8 | 0.942 | 12.0 |
| Yolov8l | 43,630,611 | 87.5 | 30.6 | 0.936 | 21.1 |
| Yolov8n-ShuffleNetV2 | 2,790,247 | 5.6 | 5.8 | 0.942 | 3.7 |
| Indicator | Load Factor | |
|---|---|---|
| F1 | F2 | |
| AB | 0.3843 | −0.0142 |
| AFE | 0.3842 | −0.0390 |
| AR | 0.3821 | −0.0451 |
| HB | 0.3165 | 0.6515 |
| HH | 0.3325 | −0.3498 |
| PB | 0.3711 | −0.0609 |
| MIE | 0.2962 | 0.4347 |
| MAE | 0.3398 | −0.3373 |
| RC | 0.3214 | 0.3781 |
| Machine Model | Parameters |
|---|---|
| GBDT | Learning_rate = 0.03, max_depth = 5, min_samples_split = 20, n_estimators = 100 |
| XGBoost | colsample_bytree = 0.769, learning_rate = 0.11, max_depth = 3, n_estimators = 100, reg_alpha = 1.0, reg_lambda = 1.0, subsample = 0.713 |
| RF | max_depth = 7, min_samples_leaf = 4, min_samples_split = 9, n_estimators = 112 |
| EN | Alpha = 0.157, l1_ratio = 0.1, Max_iter = 2000 |
| SVM | C = 32, degree = 3, gamma = 0.002 |
| Estimation Model | Training Set | Test Set | Validation Set | ||||||
|---|---|---|---|---|---|---|---|---|---|
| R2 | MAE | MSE | R2 | MAE | MSE | R2 | MAE | MSE | |
| GBDT | 0.9237 | 1.2589 | 2.3715 | 0.8063 | 1.9852 | 6.1447 | 0.8393 | 1.8005 | 5.0691 |
| XGBoost | 0.9293 | 1.1672 | 2.1968 | 0.7845 | 2.0478 | 6.8340 | 0.8187 | 1.8692 | 5.7175 |
| RF | 0.8810 | 1.5078 | 3.6976 | 0.7876 | 2.0274 | 6.7349 | 0.8132 | 1.8829 | 5.8938 |
| EN | 0.8227 | 1.8776 | 5.5123 | 0.8356 | 1.8102 | 5.2126 | 0.8617 | 1.6456 | 4.3626 |
| SVM | 0.8171 | 1.8814 | 5.6842 | 0.8208 | 1.8438 | 5.6820 | 0.8540 | 1.6783 | 4.6040 |
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. |
© 2026 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.
Share and Cite
Xing, W.; Li, H.; Fu, X.; Li, Z.; Yi, P.; Zhang, J. Research on Estimating Backfat Thickness in Jinfen White Pigs Using Deep Learning and Image Processing. Agriculture 2026, 16, 138. https://doi.org/10.3390/agriculture16020138
Xing W, Li H, Fu X, Li Z, Yi P, Zhang J. Research on Estimating Backfat Thickness in Jinfen White Pigs Using Deep Learning and Image Processing. Agriculture. 2026; 16(2):138. https://doi.org/10.3390/agriculture16020138
Chicago/Turabian StyleXing, Wenwen, Hong Li, Xuyang Fu, Ziyu Li, Pengzhe Yi, and Jianlong Zhang. 2026. "Research on Estimating Backfat Thickness in Jinfen White Pigs Using Deep Learning and Image Processing" Agriculture 16, no. 2: 138. https://doi.org/10.3390/agriculture16020138
APA StyleXing, W., Li, H., Fu, X., Li, Z., Yi, P., & Zhang, J. (2026). Research on Estimating Backfat Thickness in Jinfen White Pigs Using Deep Learning and Image Processing. Agriculture, 16(2), 138. https://doi.org/10.3390/agriculture16020138

