A Machine Learning-Based Method for Pig Weight Estimation and the PIGRGB-Weight Dataset - Xintong Ji; Qifeng Li; Kaijun Guo; Weihong Ma; Mingyu Li; Zhankang Xu; Simon X. Yang; Zhiyu Ren (Agriculture)
Traditional pig weighing methods are costly, require driving pigs onto electronic scales, and cannot collect real-time data without interference. Pig weight estimation using deep learning often demands significant computational resources and lacks real-time capabilities, highlighting the need for a more efficient method. To overcome these challenges, this study proposes a machine learning-based approach for real-time pig weight estimation by extracting image features. The method reduces computational demands while maintaining high accuracy. The SAM2-Pig model is employed for instant segmentation of pig RGB images to extract features such as relative projection area, body length, and body width, which are crucial for accurate weight prediction. Regression models, including the BPNN with Trainlm, are used to predict pig weight based on the extracted features, achieving the best performance in our experiments. This study demonstrates that machine learning methods using RGB image features provide accurate and adaptable results, offering a viable solution for real-time pig weight estimation. This study also publicly releases the PIGRGB-Weight dataset, consisting of 9579 RGB images of pigs in a free-moving state, annotated with weight information, enabling future research and model testing. The method demonstrates remarkable stability, low computational demand, and practical applicability, making it a lightweight and effective approach for estimating pig weight in real time.