Evaluation of hybrid models based on image segmentation and inference for pig weight estimation
Authors:
Open Access
- 14 September 2026
- journal article
- research article
- Published by Frontiers Media SA in Frontiers in Artificial Intelligence
- Vol. 9, 1876396
Abstract
Introduction: Accurate weight estimation in pig production is essential for optimizing management, feeding, and commercialization decisions; however, traditional weighing methods are invasive, time-consuming, and prone to operational errors. This study proposes a non-invasive computer vision–based approach to estimate pig weight under real farm conditions in San Martín, Peru. Methods: A dataset of 3,800 lateral images paired with their corresponding ground-truth weights was collected. A computational pipeline was implemented, including geometric standardization, instance segmentation using YOLOv8n-seg, and feature extraction through EfficientNet-B0. The resulting embeddings were used as input for supervised regression models (SVR, XGBoost, and CatBoost), evaluated using repeated stratified cross-validation and an independent test set, with MAE, RMSE, and R² as performance metrics. Statistical comparisons were conducted using the Friedman test followed by Wilcoxon post hoc analysis with Holm correction. Results: The results demonstrated strong predictive performance, with the SVR model achieving the best results (RMSE = 2.68 kg, MAE = 1.81 kg, R 2 = 0.85), showing statistically significant differences compared to the other models. Discussion: These findings indicate that combining computer vision techniques with models capable of capturing non-linear relationships effectively models the relationship between animal morphology and body weight, providing a low-cost, non-invasive solution applicable to real-world production systems and supporting the advancement of precision livestock farming.Keywords
This publication has 40 references indexed in Scilit:
- A comprehensive survey of loss functions and metrics in deep learningArtificial Intelligence Review, 2025
- Instance segmentation of pigs in infrared images based on INPC modelInfrared Physics & Technology, 2024
- A novel approach based on a modified mask R-CNN for the weight prediction of live pigsArtificial Intelligence in Agriculture, 2024
- Use of machine learning approaches for body weight prediction in Peruvian Corriedale SheepSmart Agricultural Technology, 2024
- Low-cost livestock sorting information management system based on deep learningArtificial Intelligence in Agriculture, 2023
- Towards rapid weight assessment of finishing pigs using a handheld, mobile RGB-D cameraBiosystems Engineering, 2023
- Sow mortality in a pig production system in the midwestern USA: Reasons for removal and factors associated with increased mortalityVeterinary Record, 2022
- Automated Cattle Classification and Counting Using Hybridized Mask R-CNN and YOLOv3 Algorithms2022
- Herd-level factors associated with piglet weight at weaning, kilograms of piglets weaned per sow per year and sow feed conversionAnimal, 2020
- The Use of Ranks to Avoid the Assumption of Normality Implicit in the Analysis of VarianceJournal of the American Statistical Association, 1937