Banner

Chief Editor:
Harjinder Singh
Massey Institute of Food Science and Technology, NEW ZEALAND
Frequency:Bi-Monthly
Indexing:
Elsevier (Scopus and Embase), AGRICOLA, Google Scholar, CrossRef, CAB Abstracting Journals, Chemical...

Choosing the Best Machine Learning Model for Weight Estimation at Different Growth Stages in Bali Cattle

Anak Agung Oka1,*, Ni Putu Sarini1, Putu Veri Swastika2, Komang Dharmawan2
  • https://orcid.org/0000-0002-5015-6359, https://orcid.org/0000-0003-2420-7850, https://orcid.org/0000-0001-8540-8520, https://orcid.org/0000-0002-7021-1386
1Department of Animal Husbandry, Udayana University, Bali 80224, Indonesia.
2Department of Mathematics, Udayana University, Bali 80224, Indonesia.

Background: Accurate weight estimation is essential for effective livestock management. Bali cattle, a vital component of Indonesia’s agricultural economy. Traditional weighing methods pose practical challenges, thus requiring adoption of machine learning (ML) techniques.

Methods: This study compares five ML models-linear regression (LR), random forest regression (RFR), support vector regression (SVR), neural network regression (NNR) and polynomial regression (PR)-to determine the most accurate approach for predicting Bali cattle weight across different age groups. The research was conducted at a livestock breeding center in Bali, where morphological features such as body height, body length and heart girth were collected and used as predictors. Results indicate that polynomial regression consistently outperformed other models for middle-aged cattle (366-728 days), while random forest regression performed best for younger (240-365 days) and older (729+days) cattle. SVR and NNR struggled to generalize due to the characteristics of the dataset.

Result: The study highlights the importance of age-specific modeling for precise weight prediction, offering valuable insights into precision livestock management. Future research should explore deep learning or hybrid approaches to improve predictive accuracy for mature cattle.

Bali cattle are integral to Indonesia’s agricultural sector, providing a primary source of meat and economic stability for farmers (Martojo, 2012). Accurate weight estimation is crucial for livestock management, impacting health monitoring, feed efficiency and economic valuation (Haq et al., 2020). However, conventional weighing methods are labor-intensive, time-consuming and impractical for large-scale operations, especially in rural areas with limited access to precise equipment (Budianto et al., 2022; Goopy et al., 2018).
       
To address these challenges, Machine learning (ML) has emerged as a non-intrusive alternative, offering enhanced accuracy and efficiency in cattle weight estimation (Awasthi et al., 2023). Prior studies have explored various ML techniques, such as Linear Regression, Neural Networks, Random Forest, Polynomial Regression and Support Vector Regression, demonstrating superior predictive performance compared to traditional methods (Sarini and Dharmawan, 2023; Wang et al., 2021). These models utilize morphometric measurements and other attributes to enhance estimation accuracy while minimizing stress on the animals.
       
Among ML techniques, Random Forest Regression (RFR) has shown strong performance in cattle weight prediction due to its ability to capture complex feature interactions while mitigating overfitting (Ruchay et al., 2021; Tırınk et al., 2023). Additionally, polynomial regression models have been used to describe cattle growth patterns, particularly in middle-age groups where weight gain follows nonlinear trends (Cavalcante et al., 2020). Despite these advancements, existing studies often overlook age-specific variations in model performance, limiting their practical applicability across different developmental stages.
       
Machine learning is becoming an essential tool in modern livestock management, offering smarter and more efficient ways to handle tasks that were once manual and time-consuming. Instead of relying solely on traditional weighing methods, farmers and researchers can now use algorithms to estimate traits like body weight based on simple body measurements. This approach is especially helpful in rural areas where access to weighing equipment is limited or impractical. By analyzing patterns in the data, machine learning models can help monitor cattle growth, adjust feeding programs and even flag potential health issues earlier. These systems are not only faster and less stressful for the animals, but also scale well to large herds. As the livestock industry continues to evolve, machine learning offers a way to make better decisions based on real-time data-ultimately improving productivity, saving costs and supporting more sustainable farming practices.
       
This study seeks to determine which machine learning model provides the highest accuracy in predicting Bali cattle body weight across different age groups while addressing the challenges posed by nonlinear growth patterns and varying model effectiveness. Specifically, it investigates how morphological features (body height, body length and heart girth) contribute to weight estimation at different develop-mental stages and how model performance varies between young, middle-aged and mature cattle. Additionally, this research examines whether an age-specific modeling approach outperforms a generalized model in predicting cattle weight, providing insights into the most effective methodologies for precision livestock management.
Data collection
 
This research was carried out at the livestock breeding center, Denpasar, located in Pekutatan Village, Jembrana Regency during the period of 2020-2022. Linear body measurements were taken for each cattle after being weighed to obtain weight in kg, body weight (BW) as the dependent variable body height, body length and heart girth, all in cm. The data collection was conducted with animal care and was supervised by the Bali Superior Livestock Breeding Center. The collection of data sets and all other procedures carried out in this investigation were conducted without confining the cattle.
 
Data preprocessing
 
The raw data was examined for inconsistencies such as missing values, duplicate entries and outliers. Any missing data points were handled using appropriate imputation techniques, while duplicate records were removed to prevent bias. Outliers were removed based on domain knowledge. The dataset was categorized into four age groups: 240-365 days (young cattle), 366-546 days (early maturity), 547-728 days (growth peak) and 729-1040 days (mature cattle for males) / 729-999 days (mature cattle for females).
       
This segmentation was crucial to analyze weight prediction patterns at different stages of cattle growth. Key morphological features; Body height, Body length and Heart girth, were selected as predictors, with Body Weight serving as the target variable. To facilitate effective model training, feature scaling was applied. Standardization using the StandardScaler method ensured that all predictor variables were on the same scale. 
 
Model development
 
Five machine learning models: Linear Regression (LR), Random Forest Regression (RFR), Support Vector Regression (SVR), Neural Network Regression (NNR) and Polynomial Regression (PR), were implemented to predict cattle body weight, each chosen for its unique ability to model different types of relationships between morphological features and body weight. LR was selected for its simplicity in modeling linear correlations, while PR extended this approach by capturing nonlinear growth patterns. RFR, an ensemble learning method, was included due to its robustness in handling complex interactions and variations in cattle morphology. SVR was tested for its ability to map relationships in high-dimensional spaces and NNR was explored to assess its capability in capturing intricate patterns and dependencies in cattle growth trends. By incorporating this diverse set of models, the study aimed to determine the most effective approach for predicting cattle weight across different age stages. The dataset was split into an 80:20 ratio for training and testing to ensure robust evaluation. Cross-validation was used to enhance generalization and reduce overfitting.
 
Model evaluation
 
The trained models were evaluated using key regression performance metrics: Mean Absolute Error (MAE): Measures the average absolute differences between actual and predicted values. Root Mean Square Error (RMSE): Captures the standard deviation of prediction errors, with higher sensitivity to large deviations. R² Score: Indicates the proportion of variance explained by the model, where a score closer to 1 signifies better performance.
The correlation matrices provided insights into the relationships between body weight and other morphological features (Body height, body length and heart girth) across different age groups for both male and female cattle.
       
Table 1 shows that the young male cattle’s heart girth has the strongest predictor of body weight (0.90), body length (0.72) and body height (0.65) are moderately correlated but less influential than heart girth. Similar to male cattle,  female cattle, heart girth remains the best predictor (0.85). body length (0.70) has a stronger influence than body height (0.52). Therefore, in short heart girth is the dominant predictor for both male and female young cattle, while female cattle show weaker correlations compared to male cattle, indicating slightly more variability in body structure.

Table 1: Correlation Matrix-age group of cattle (240-365 days).


       
Table 2 presents, for early maturity male cattle, heart girth has the strongest correlation with body weight (0.91). This means that heart girth remains the dominant predictor. body height and body length also become more important (0.84 and 0.82, respectively). For female cattle in this group,  heart girth remains the strongest predictor (0.90), while body height (0.73) and body length (0.74) have similar but slightly lower correlations. This age group shows the strongest overall correlations, indicating consistent growth relationships. Male cattle show stronger correlations across all features compared to females.

Table 2: Correlation matrix - age group of cattle (366-546 days).


       
Table 3 presents, for males at group 547-728 Days Old (Growth Peak), Male Cattle, Heart Girth remains the best predictor but shows a slightly weaker correlation (0.76), while  Body Length and Body Height remain moderately correlated (0.69 and 0.67, respectively). Female cattle in this group, Heart Girth shows its strongest correlation in this group (0.92), making it an even better predictor for females than for males, while Body Length (0.61) and Body Height (0.63) have weaker correlations compared to younger groups. Overall, for male cattle, correlations begin to weaken slightly, possibly due to growth variability. For female cattle, Heart Girth becomes the strongest predictor across all age groups. Feature importance shifts slightly, meaning additional predictors may improve model accuracy.

Table 3: Correlation matrix -age group of cattle (547-728 days).


       
Table 4 shows, for males in the age group Cattle of 729-1040 days old (mature cattle for males), Heart Girth (0.88) remains dominant. Body Length (0.78) and Body Height (0.71) maintain a strong influence. For female cattle, correlations weaken significantly compared to earlier stages. Heart Girth is still the best predictor (0.74), but not as strongly correlated as in younger cattle. Body Length (0.53) and Body Height (0.50) become less reliable predictors. Overall, male cattle’s heart Girth still shows strong correlations in adulthood, meaning models can still predict their weight effectively. For female cattle, weight prediction becomes more challenging due to weaker correlations.

Table 4: Correlation matrix-age group of cattle (729-1040 days).


   
It can be seen from Table 5 that by analyzing model performance across the ages, we found that LR consistently performs well across all age groups, RFR sometimes performs well but is less consistent, while SVR struggles in most cases due to the dataset characteristics and NNR do not significantly outperform simpler models, suggesting that simpler models are more suitable for prediction. Overall, RF consistently outperforms SVR and NNR in all age groups. SVR and NNR struggle in this dataset, especially in the 547-728 days group, where its R² score is significantly lower than that of the Random Forest model. For mature cattle (729+days), both models have high errors, indicating a need for feature engineering, alternative models, or ensemble methods.

Table 5: Model performance for each age group of female cattle.


       
Table 6 at age group 240-365 days, LR performs best in this age group, RF and PR perform moderately well and have similar R² around 0.71, indicating a moderate predictive power. PR has slightly better RMSE, but the difference is small. The model performance across the ages  shows that LR performs well in younger age groups, particularly in 240-365 days. RFR performs better in 366-546 days, likely capturing non-linear relationships in growing cattle. SVR and NNR generally struggle due to dataset characteristics, suggesting insufficient data for deep learning.

Table 6: Model performance for each age group of male cattle.


       
The results indicate that the performance of machine learning models in predicting Bali cattle body weight varies significantly across age groups, reinforcing the need for an age-specific modeling approach. PR consistently outperformed other models in the middle-age group (366-728 days), where cattle experience nonlinear growth spurts, aligning with previous studies that highlight its effectiveness in capturing weight progression trends (Cavalcante et al., 2020). In contrast, RFR demonstrated superior performance for younger (240-365 days) and older (729+ days) cattle, likely due to its ability to handle complex feature interactions and nonlinear dependencies, which have been similarly reported in studies on Brahman cattle and other breeds (Li et al., 2022). The lower performance of SVR and NNR suggests that these models struggle with the dataset characteristics, particularly in cases where data volume and feature distributions impact convergence and generalization.
       
Comparing these findings to existing research, prior studies have shown that ensemble models like Random Forest are highly effective in predicting cattle weight based on morphometric measurements (Sarini and Dharmawan, 2023; Tırınk et al., 2023), which aligns with this study’s results for young and mature cattle. However, the limitations observed in older female cattle, where correlation values weakened, suggest that additional features (e.g., age, nutrition, breed variations) should be incorporated for improved model accuracy. Moreover, while polynomial regression captured growth trends well, its performance declined in mature cattle due to irregular weight fluctuations influenced by external factors such as diet and genetics, reinforcing the findings of previous studies that highlight the limitations of polynomial models for highly variable biological data (Cano et al., 2016; Widyas et al., 2018). These results emphasize the importance of using different models tailored to specific growth phases, providing valuable insights into precision livestock management. However, future studies should explore deep learning approaches or hybrid models that integrate multiple predictive techniques to enhance overall prediction accuracy and applicability. The accuracy of these models varied, with some achieving Mean Absolute Errors as low as 0.35 kg (Setiawan and Utami, 2024) and others around 13-18 kg  (Setiawan and Utami, 2024; Weber et al., 2020). By accurately predicting cattle body weight based on age group and morphological features, farmers can adjust feed portions to optimize growth and prevent overfeeding or underfeeding, reducing costs and improving efficiency. For early age (240-365 days), weight predictions also help in health monitoring, enabling farmers to detect abnormal weight fluctuations that may indicate disease, malnutrition, or poor growth rates, allowing for timely intervention (Segerkvist et al., 2020).
       
The lower prediction accuracy for older cattle (729+ days) can be attributed to greater biological variability and  external influences (Hassen et al., 1999). Besides, nonlinear growth fluctuations of the cattle are harder for the machine learning models proposed in this research to capture. XGBoost algorithms have demonstrated good performance in predicting daily weights (R2 = 0.869) (Awasthi et al., 2024; Awasthi et al., 2023). Unlike younger cattle, which follow more consistent growth trajectories, mature cattle experience weight variations due to factors like diet, genetics, reproductive status and environmental conditions, which were not explicitly included as model inputs.
       
The outcomes of this study are in line with earlier research exploring the use of body measurements and machine learning for predicting livestock weight. Karakus (2025) reported that prediction models performed better when lambs were grouped by age, which supports our finding that model accuracy improves when Bali cattle are segmented by developmental stage. A similar conclusion was drawn by Haldar et al., (2023), who found that decision tree models, particularly Recursive Partitioning and Regression Trees (RPART), worked well for predicting goat weight based on body dimensions-echoing our observation that Random Forest models handle complex cattle morphometrics effectively, especially in younger and mature groups. Additionally, Banik et al., (2021) demonstrated that nonlinear regression methods were better suited for estimating piglet weight during early development, which aligns with our result showing the strength of polynomial regression during the 366–728 day growth window. Meanwhile, Hamadani et al., (2024) observed that support vector machines and deep learning models struggled with generalizing predictions across sheep age groups, a challenge that was also evident in our neural network and SVR results for older Bali cattle. From a broader perspective, Sultana et al., (2022) and Djeghar et al., (2025) reaffirm the reliability of body measurements like heart girth and body length in estimating cattle weight, reinforcing our conclusion that these traits remain essential across all age groups for accurate prediction.
This study demonstrates that machine learning models can effectively predict Bali cattle weight based on morphological features, with performance varying across age groups. Polynomial Regression was the most effective model for middle-aged cattle (366-728 days), capturing nonlinear growth trends. In contrast, Random Forest Regression provided superior accuracy for young (240-365 days) and mature (729+days) cattle, likely due to its ability to handle complex feature interactions. Support Vector Regression and Neural Network Regression exhibited lower accuracy, suggesting that simpler models may be better suited for this dataset. These findings emphasize the need for age-specific modeling in cattle weight prediction, since a generalized approach may not sufficiently capture growth variability across life stages. Future studies should incorporate additional predictive factors such as nutrition, genetics and environmental conditions, while also exploring hybrid machine learning models and deep learning techniques for further improvement in prediction accuracy. By optimizing weight estimation methods, farmers can enhance cattle management practices, improve feed efficiency and support economic sustainability in livestock production.
This study was supported by the Institute of Research and Community Service and BPTU-HPT Denpasar, Livestock Breeding Center for Bali Cattle, for their support, provision of equipment during the year of 2020-2022
 
Disclaimers
 
The views and conclusions expressed in this article are solely those of the authors and do not necessarily represent the views of their affiliated institutions. The authors are responsible for the accuracy and completeness of the information provided, but do not accept any liability for any direct or indirect losses resulting from the use of this content.
 
Informed consent
 
All animal procedures for experiments were approved by the Committee of Experimental Animal care and handling techniques were approved by the University of Animal Care Committee.
The authors declare that there are no conflicts of interest regarding the publication of this article. No funding or sponsorship influenced the design of the study, data collection, analysis, decision to publish, or preparation of the manuscript.

  1. Awasthi, T., Morshed, A. and Swain, D. (2024). A machine learning approach to simulate growth of cattle at pasture using remotely collected walk-over weights. SSRN Electronic Journal. https://doi.org/10.2139/ssrn.4805155.

  2. Awasthi, T.R., Morshed, A. and Swain, D. (2023). A comparative study of machine learning methods: A case study of weight and growth of livestock. 2023 IEEE Engineering Informatics. 1-7. https://doi.org/10.1109/IEEECONF58110.2023. 10520498.

  3. Banik, S., Naskar, S., Barman, K., Das, P.J., Kumar, S. and Rajkhowa, S. (2021). Nonlinear prediction models for estimation of pre-weaning body weight of pigs using morphometric traits. Indian Journal of Animal Research. 55(11): 1383- 1386. http://dx.doi.org/10.18805/IJAR.B-4174.

  4. Budianto, D., Widi, T.S.M., Panjono, P., Budisatria, I.G.S. and Hartatik, T. (2022). Estimation of body weight using linear body measurements in two crossbred beef cattle. https:// doi.org/10.2991/absr.k.220207.070.

  5. Cano, G., Blanco, M., Casasús, I., Cortés-Lacruz, X. and Villalba, D. (2016). Comparison of B-splines and non-linear functions to describe growth patterns and predict mature weight of female beef cattle. Animal Production Science. 56(11): 1787. https://doi.org/10.1071/AN15089.

  6. Cavalcante, D.H., Sousa Júnior, S.C., Silva, L.P., Malhado, C.H.M., Martins Filho, R., Azevêdo, D.M.M.R. and Campelo, J.E.G. (2020). Fitting of fixed regression curves with different residual variance structures for Nellore cattle growth modeling. Semina: Ciências Agrárias. 41(2): 545-558. https://doi.org/10.5433/1679-0359.2020v41n2p545.

  7. Djeghar A.E., Ridouh R., Boukerrou M., Chaabi A.Z., Evin A., Tekkouk- zemmouchi F. et al. (2025). Morphometric study of local Algerian cattle breeds and prediction of carcass weight from linear body measurements: Case of Setifien and Guelmoise breeds. Asian Journal of Dairy and Food Research. 44(3). https://doi.org/10.18805/ajdfr.DRF-440.

  8. Goopy, J.P., Pelster, D.E., Onyango, A., Marshall, K. and Lukuyu, M. (2018). Simple and robust algorithms to estimate liveweight in African smallholder cattle. Animal Production Science. 58(9): 1758. https://doi.org/10.1071/AN16577.

  9. Haldar, A., Pal, P., Ghosh, S. and Pan, S. (2023). Body weight prediction using recursive partitioning and regression trees (RPART) model in Indian black Bengal goat breed: A machine learning approach. Indian Journal of Animal Research. 57(9): 1251-1257. http://dx.doi.org/10.18805/IJAR.B-4894.

  10. Hamadani, A., Ganai, N.A., Alam, S., Mudasir, S., Raja, T.A., Hussain, I. and Ahmad, H.A. (2024). Artificial intelligence techniques for the prediction of body weights in sheep. Indian Journal of Animal Research. 58(5): 884-889. http://dx.doi.org/ 10.18805/IJAR.B-4831.

  11. Haq, M.S., Budisatria, I.G.S., Panjono, P. and Maharani, D. (2020). Prediction of live body weight using body measurements for Jawa Brebes (Jabres) Cattle. Journal of Animal and Plant Sciences. 30(3): 552-559. https://doi.org/10.36899/ JAPS.2020.3.0065.

  12. Hassen, A., Wilson, D.E. and Rouse, G.H. (1999). Evaluation of carcass, live and real-time ultrasound measures in feedlot cattle: II. Effects of different age end points on the accuracy of predicting the percentage of retail product, retail product weight and hot carcass weight. Journal of Animal Science. 77(2): 283. https://doi.org/10.2527/1999.772283x.

  13. Karakus, F. (2025). Estimation of marketing live weight of lambs by different machine learning algorithms. Indian Journal of Animal Research. 59(1). doi. 10.18805/IJAR.BF-1855

  14. Li, J., Li, Q., Ma, W., Xue, X., Zhao, C., Tulpan, D. and Yang, S.X. (2022). Key region extraction and body dimension measurement of beef cattle using 3D point clouds. Agriculture. 12(7): 1012. https://doi.org/10.3390/agriculture12071012.

  15. Martojo, H. (2012). Indigenous bali cattle is most suitable for sustainable small farming in Indonesia. Reproduction in Domestic Animals. 47(s1): 10-14. https://doi.org/10.1111/ j. 1439-0531.2011.01958.x.

  16. Ruchay, A.N., Kolpakov, V.I., Kalschikov, V.V, Dzhulamanov, K.M. and Dorofeev, K.A. (2021). Predicting the body weight of Hereford cows using machine learning. IOP Conference Series: Earth and Environmental Science. 624(1): 012056. https://doi.org/10.1088/1755-1315/624/1/012056.

  17. Sarini, N.P. and Dharmawan, K. (2023). Estimation of bali cattle body weight based on morphological measurements by machine learning algorithms: Random forest, support vector, K-neighbors and extra tree regression. Journal of Advanced Zoology. 44(3): 1-9. https://doi.org/10.17762/ jaz. v44i3.234.

  18. Segerkvist, K.A., Höglund, J., Österlund, H., Wik, C., Högberg, N. and Hessle, A. (2020). Automatic weighing as an animal health monitoring tool on pasture. Livestock Science. 240: 104157. https://doi.org/10.1016/j.livsci.2020.104157.

  19. Setiawan, A. and Utami, E. (2024). Predicting the weight of livestock using machine learning. 2024 IEEE International Conference on Artificial Intelligence and Mechatronics Systems (AIMS). 1-6. https://doi.org/10.1109/AIMS61812. 2024.10512610.

  20. Sultana, N., Khan, M.K.I. and Momin, M.M. (2022). Nonlinear models for the prediction of yearly live weight of cattle. Asian Journal of Dairy and Food Research. 41(2): 168-172. http://x.doi.org/10.18805/ajdfr.DRF-257.

  21. Tırınk, C., Önder, H., Francois, D., Marcon, D., Şen, U., Shaikenova, K., Omarova, K. and Tyasi, T.L. (2023). Comparison of the data mining and machine learning algorithms for predicting the final body weight for the Romane sheep breed. PLOS ONE. 18(8): e0289348. https://doi.org/10.1371/journal. pone.0289348.

  22. Wang, Z., Shadpour, S., Chan, E., Rotondo, V., Wood, K.M. and Tulpan, D. (2021). Applications of machine learning for livestock body weight prediction from digital images. Journal of Animal Science. 99(2): 1-15. https://doi.org/10.1093/jas/ skab022.

  23. Weber, V.A.M., Weber, F. de L., Oliveira, A. da S., Astolfi, G., Menezes, G.V., de Andrade Porto, J.V., Rezende, F.P.C., Moraes, P.H. de, Matsubara, E.T., Mateus, R.G., de Araújo, T.L.A.C., da Silva, L. O.C., de Queiroz, E.Q.A., de Abreu, U.G.P., da Costa Gomes, R. and Pistori, H. (2020). Cattle weight estimation using active contour models and regression trees, Bagging. Computers and Electronics in Agriculture. 179(September). https://doi.org/10.1016/j.compag.2020. 105804.

  24. Widyas, N., Prastowo, S., Widi, T.S.M. and Baliarti, E. (2018). Predicting Madura cattle growth curve using a non-linear model. IOP Conference Series: Earth and Environmental Science. 142: 012006. https://doi.org/10.1088/1755-1315/142/1/ 012006.

Editorial Board

View all (0)