Cattle Weight Estimation Using Linear Regression and Random Forest Regressor

  • Anjar Setiawan Universitas Amikom Yogyakarta
  • Ema Utami Universitas Amikom Yogyakarta
  • Dhani Ariatmanto Universitas Amikom Yogyakarta
Keywords: cattle, machine learning, linear regression, random forest regressor, prediction model


The global cattle farming industry has benefits as a food source, livelihood, economic contribution, land environmental restoration, and energy source. The importance of predicting cow weight for farmers is to monitor animal development. Meanwhile, for traders, knowing the animal's weight makes it easier to calculate the price of the animal meat they buy. The authors propose estimating cattle weighting linear regression and random forest regression. Linear regression can interpret the linear relationship between dependent and independent variables, and random forest regression can generalize the data well. The data set used in this study consisted of ten variables: live body weight, withers height, sacrum height, chest depth, chest width, maclocks width, hip joint width, oblique body length, oblique back length and chest circumference. Find the model that produces the smallest MAE value. The results show that the linear regression algorithm can produce estimated weight values for cattle with the best performance. This model produces a mean absolute error (MAE) of 0.35 kg, a mean absolute percentage error (MAPE) of 0.07%, a root mean square error (RMSE) of 0.5 kg, and an R² of 0.99. Each variable has excellent correlation performance results and contributes to computer vision and machine learning.


Download data is not yet available.


Ashari, N. Latif, and A. Astuti, “Pengolahan citra digital untuk menentukan bobot sapi menggunakan metode Canny edge detection,” J. Ilm. Ilmu Komput. Fak. Ilmu Komput. Univ. Al Asyariah Mandar, vol. 5, no. 1, pp. 1–6, 2019, doi:

The Food and Agriculture Organization, “The State of Food and Agriculture 2010-11: Women in Agriculture. Closing the Gender Gap for Development,” 2011. [Online]. Available:

V. A. M. Weber et al., “Cattle weight estimation using active contour models and regression trees Bagging,” Comput. Electron. Agric., vol. 179, p. 105804, 2020, doi:

I. F. M. Marai, A. A. El-Darawany, A. Fadiel, and M. A. M. Abdel-Hafez, “Physiological traits as affected by heat stress in sheep—A review,” Small Rumin. Res., vol. 71, no. 1, pp. 1–12, 2007, doi:

R. Dohmen, C. Catal, and Q. Liu, “Image-based body mass prediction of heifers using deep neural networks,” Biosyst. Eng., vol. 204, pp. 283–293, 2021, doi:

U.S. DEPARTMENT OF AGRICULTURE, “Beef From Farm To Table | Food Safety and Inspection Service,” food-safety, 2024.

J. Ashwini, P. Sanjay, G. Amipara, P. Lunagariya, D. Parmar, and D. Rank, Prediction of Body Weight based on Body Measurements in Crossbred Cattle. 2019.

D. A. Sant’Ana et al., “Weighing live sheep using computer vision techniques and regression machine learning,” Mach. Learn. with Appl., vol. 5, p. 100076, 2021, doi:

L. Breiman, “Random Forests,” Mach. Learn., vol. 45, no. 1, pp. 5–32, 2001, doi: 10.1023/A:1010933404324.

J. Montgomery, F. Hollenbach, M. Ward, and R. Alvarez, “Improving Predictions Using Ensemble Bayesian Model Averaging,” Polit. Anal., vol. 20, pp. 271–291, Jul. 2012, doi: 10.2307/23260318.

A. Ruchay, V. Kober, K. Dorofeev, V. Kolpakov, A. Gladkov, and H. Guo, “Live Weight Prediction of Cattle Based on Deep Regression of RGB-D Images,” Agriculture, vol. 12, no. 11. 2022, doi: 10.3390/agriculture12111794.

A. Dakhlan, A. Saputra, M. Hamdani, and S. Sulastri, “Regression Models and Correlation Analysis for Predicting Body Weight of Female Ettawa Grade Goat using its Body Measurements,” Adv. Anim. Vet. Sci., vol. 8, Sep. 2020, doi: 10.17582/journal.aavs/2020/8.11.1142.1146.

A. Ibrahim, W. Artama, I. G. S. (I. G. S. . Budisatria, R. Yuniawan, B. Atmoko, and R. Widayanti, “Regression model analysis for prediction of body weight from body measurements in female Batur sheep of Banjarnegara District, Indonesia,” Biodiversitas J. Biol. Divers., vol. 22, pp. 2723–2730, Jul. 2021, doi: 10.13057/biodiv/d220721.

Z. Huma and F. Iqbal, “Predicting the body weight of Balochi sheep using a machine learning approach,” TURKISH J. Vet. Anim. Sci., vol. 43, pp. 500–506, Aug. 2019, doi: 10.3906/vet-1812-23.

M. Gjergji et al., Deep Learning Techniques for Beef Cattle Body Weight Prediction. 2020.

A. Ruchay et al., “A Comparative Study of Machine Learning Methods for Predicting Live Weight of Duroc, Landrace, and Yorkshire Pigs,” Animals, vol. 12, no. 9. 2022, doi: 10.3390/ani12091152.

G. A. Miller, J. J. Hyslop, D. Barclay, A. Edwards, W. Thomson, and C.-A. Duthie, “Using 3D Imaging and Machine Learning to Predict Liveweight and Carcass Characteristics of Live Finishing Beef Cattle ,” Frontiers in Sustainable Food Systems , vol. 3. 2019, [Online]. Available:

J. Wełeszczuk, B. Kosińska-Selbi, and P. Cholewińska, “Prediction of Polish Holstein’s economical index and calving interval using machine learning,” Livest. Sci., vol. 264, p. 105039, 2022, doi:

Y. Cang, H. He, and Y. Qiao, “An Intelligent Pig Weights Estimate Method Based on Deep Learning in Sow Stall Environments,” IEEE Access, vol. PP, p. 1, Nov. 2019, doi: 10.1109/ACCESS.2019.2953099.

T. Hastie, R. Tibshirani, and J. Friedman, “Overview of Supervised Learning BT - The Elements of Statistical Learning: Data Mining, Inference, and Prediction,” T. Hastie, R. Tibshirani, and J. Friedman, Eds. New York, NY: Springer New York, 2009, pp. 9–41.

S. M. Cabaneros and B. Hughes, “Methods used for handling and quantifying model uncertainty of artificial neural network models for air pollution forecasting,” Environ. Model. Softw., vol. 158, p. 105529, 2022, doi:

A. K. Gupta, V. Singh, P. Mathur, and C. M. Travieso-Gonzalez, “Prediction of COVID-19 pandemic measuring criteria using support vector machine, prophet and linear regression models in Indian scenario,” J. Interdiscip. Math., vol. 24, no. 1, pp. 89–108, Jan. 2021, doi: 10.1080/09720502.2020.1833458.

X. Song, E. A. M. Bokkers, S. van Mourik, P. W. G. Groot Koerkamp, and P. P. J. van der Tol, “Automated body condition scoring of dairy cows using 3-dimensional feature extraction from multiple body regions,” J. Dairy Sci., vol. 102, no. 5, pp. 4294–4308, 2019, doi:

How to Cite
Anjar Setiawan, Ema Utami, & Dhani Ariatmanto. (2024). Cattle Weight Estimation Using Linear Regression and Random Forest Regressor. Jurnal RESTI (Rekayasa Sistem Dan Teknologi Informasi), 8(1), 72 - 79.
Information Systems Engineering Articles