Related Experiment Video
Updated: Sep 30, 2025

An Efficient Single—Person Technique for Milk Sampling from Laboratory Mice
Published on: March 28, 2025
Real-time milk analysis integrated with stacking ensemble learning as a tool for the daily prediction of
Lucio F M Mota1, Diana Giannuzzi1, Vittoria Bisutti1
1Department of Agronomy, Food, Natural Resources, Animals and Environment (DAFNAE), University of Padova, Viale dell' Università 16, 35020 Legnaro, Italy.
Abstract:
Cheese-making traits in dairy cattle are important to the dairy industry but are difficult to measure at the individual level because there are limitations on collecting phenotypic information. Mid-infrared spectroscopy has its advantages, but it can only be used during monthly milk recordings. Recently, in-line devices for real-time analysis of milk quality have been developed. The AfiLab recording system (Afimilk) offers significant benefits as phenotypes can be collected from each cow at each milking session. The objective of this study was to assess the potential of integrating AfiLab real-time milk analyzer measures with the stacking ensemble learning technique using heterogeneous base learners for the in-line daily monitoring of cheese-making traits in Holstein cattle with a view to developing a precision livestock farming system for monitoring the technological quality of milk. Data and samples for wet-laboratory analyses were collected from 499 Holstein cows belonging to 2 farms where the AfiLab system was installed. The traits of concern were 9 milk coagulation traits [3 milk coagulation properties (MCP), and 6 curd firming traits (CFt)], and 7 cheese-making traits [3 cheese yield (CY) traits, and 4 milk nutrient recovery in the curd (REC) traits]. The near-infrared AfiLab spectral data and on-farm information (days in milk and parity) were used to assess the predictive ability of different statistical methods [elastic net (EN), gradient boosting machine (GBM), extreme gradient boosting (XGBoost), and artificial neural network (ANN)] across different cross-validation scenarios. These statistical methods were considered the base learners, which were then combined in a stacking ensemble learning. Results indicate that including information on the cows (days in milk and parity) in the AfiLab infrared prediction increased its accuracy by 10.3% for traditional MCP, 13.8% for curd firming, 9.8% for CY, and 11.2% for REC traits compared with those obtained from near-infrared AfiLab alone. The statistical approaches exhibited high prediction accuracies (R2) averaged across the cross-validation scenarios for traditional MCP (0.58 for ANN, 0.55 for EN and GBM, 0.52 for XGBoost, and 0.62 for stacking ensemble), CFt (0.55 for ANN, 0.54 for EN and GBM, 0.53 for XGBoost, and 0.61 for stacking ensemble), and similar R2 averages for CY and REC (0.55 for ANN, 0.54 for EN and GBM, 0.53 for XGBoost, and 0.61 for stacking ensemble). The ANN approach was more accurate than the other base learners (EN, GBM, and XGBoost) and improved accuracy across cross-validation scenarios on average by 7% for traditional MCP, 5% for CFt, 8% for CY, and 7% for REC. The stacking ensemble method improved prediction accuracy by 3% to 31% for traditional MCP, 2% to 26% for CFt, 1% to 38% for CY traits, and 2% to 27% for REC traits compared with the base learners. The prediction accuracies of the different approaches evaluated tended to decrease from the 10-fold cross-validation to the independent validation scenario, although there was a smaller reduction in prediction accuracy with the stacking ensemble learning technique across all the cross-validation scenarios. Our results show that combining in-line on-farm information with stacking ensemble machine learning represents an effective alternative for obtaining robust daily predictions of milk cheese-making traits.
Related Concept Videos
Prediction Intervals
However, the point estimate is most likely not the exact value of the population parameter, but close to it. After calculating point estimates, we construct interval estimates, called confidence intervals or prediction intervals. This prediction interval comprises a range of values unlike the point estimate and is a better predictor of the observed sample value, y.
Statistical Analysis: Overview
One of the most commonly used statistical quantifiers is the mean, which is the ratio between the sum of the numerical values of all results and the...

