论文信息

Parham Khalifehzadeh / Mostafa Ghaderi‐Zefrehei / Farjad Rafeie 等 8 人

Scientific Reports

论文解读

AI 辅助整理
方法
11.9万条荷斯坦牛输精记录,经Cramér's V、聚类编码、SMOTE-NC
发现
Stacking_Voting混合集成最优,准确率0.784、AUC 0.846、精确率0.889。
机会点
可引入时序繁殖事件与传感器数据,探索可解释集成模型在牧场实时决策中的落地。

论文摘要

准确估计非返情率(non-return rate,即奶牛在人工授精后规定时期内未返情的比例)对于优化奶牛生产系统中的精准繁殖效率和经济可持续性至关重要。然而,利用大规模异质数据集预测非返情率面临诸多分析挑战,原因在于数据不平衡、类别复杂性以及生物与管理因素之间的非线性交互作用。本研究对来自伊朗荷斯坦牛群的118,996条授精记录实施了广泛的多阶段预处理流程,以确保数据完整性并为预测建模提供最优特征表示。分类变量依赖性通过Cramér's V进行量化;采用凝聚层次聚类进行具有生物学依据的分类编码;以互信息指导特征选择;并使用四分位距准则剔除异常值。连续变量通过Yeo–Johnson函数进行变换以实现归一化,随后经最小–最大缩放进行标准化。类别不平衡通过针对名义和连续特征的人工少数类过采样技术(Synthetic Minority Over-sampling Technique for Nominal and Continuous features)进行调整,以保持少数类与多数类之间的结构一致性。随后,在PyCaret(Python)框架内实现并优化了十五种机器学习分类器,涵盖统计、核方法和树集成等范式。分类器包括岭分类器、线性判别分析、逻辑回归、朴素贝叶斯、二次判别分析、支持向量机、虚拟分类器、轻量梯度提升机、随机森林、极端梯度提升、极端随机树、梯度提升、决策树、K近邻和AdaBoost。在此基础上,构建了一种称为Stacking_Voting Hybrid的两层混合集成模型。第一层通过多数投票聚合轻量梯度提升机、随机森林、极端梯度提升和极端随机树的预测结果,第二层则利用堆叠元分类器将该输出与梯度提升分类器、决策树、K近邻和AdaBoost的预测结果相结合。Stacking-Voting Hybrid集成模型在所有主要指标上均取得优越性能——准确率(0.784)、受试者工作特征曲线下面积(0.846)、精确率(0.889)、F1分数(0.751)、Cohen's kap

全文

Scientific Reports

ARTICLE | Article in Press
https://doi.org/10.1038/s41598-026-79443-9
This Article in Press is shared early to give you faster access to new research. It is citable and carries a permanent DOI.
The final edited version will replace it automatically.
Scientific Reports
Scientific Reports
Hybrid ensemble learning for precision reproductive
and decision support in dairy cattle
Parham Khalifehzadeh · Mostafa Ghaderi-Zefrehei · Farjad Rafeie ·
Mohammadreza Hashemi · Somayeh Sharifi · Mahsa Rahmani · Saeid Ansari Mahyari ·
Mustafa Muhaghegh-Dolatabady
Received: 27 February 2026 / Accepted: 31 October 2026
© The Author(s) 2026
Abstract
Accurate estimation of the non-return rate—the proportion of dairy cows not returning to estrus within a
defined period following artificial insemination—is fundamental for optimizing precision reproductive effi -
ciency and economic sustainability in dairy production systems. Leveraging large-scale, heterogeneous datasets
to predict Non-Return Rate, however, poses substantial analytical challenges due to data imbalance, categori -
cal complexity, and nonlinear interactions among biological and management factors. In this study, 118,996
insemination records from Iranian Holstein herds were subjected to an extensive multi-stage pre-processing
pipeline to ensure data integrity and optimal feature representation for predictive modeling. Categorical depen -
dencies were quantified via Cramér’s V; agglomerative hierarchical clustering was employed for biologically
informed categorical encoding; mutual information guided feature selection; and the interquartile range cri -
terion was used to remove outliers. Continuous variables were transformed using the Yeo–Johnson function
for normalization and subsequently standardized by min–max scaling. Class imbalance was adjusted through
the Synthetic Minority Over-sampling Technique for Nominal and Continuous features, preserving the struc -
tural consistency between minority and majority classes. Then, fifteen machine learning classifiers—spanning
statistical, kernel-based, and tree-ensemble paradigms—were implemented and optimized within the PyCaret
(Python) framework. Classifiers included Ridge Classifier, Linear Discriminant Analysis, Logistic Regression,
Naïve Bayes, Quadratic Discriminant Analysis, Support Vector Machine, Dummy Classifier, Light Gradient
Boosting Machine, Random Forest, Extreme Gradient Boosting, Extra Trees, Gradient Boosting, Decision Tree,
K-Nearest Neighbors, and AdaBoost. Building upon these, a two-tier hybrid ensemble termed Stacking_V oting
Hybrid was constructed. The first tier aggregated predictions of Light Gradient Boosting Machine, Random
Forest, Extreme Gradient Booosting, and Extra Trees through majority voting, while the second tier combined
this output with Gradient Boosting Classifier, Decision Tree, K-Nearest Neighbors, and AdaBoost predictions
using a stacking meta-classifier. The Stacking-V oting Hybird ensemble achieved superior performance across
all major metrics—accuracy (0.784), area under the Receiver Operating Characteristic curve (0.846), preci -
sion (0.889), F1 score (0.751), Cohen’s kappa (0.568), and Matthews correlation coefficient (0.591)—while
RandomForest attained slightly higher recall (0.728). These results confirm the superiority of hybrid ensemble
architectures in capturing complex reproductive dynamics. The proposed Stacking-V oting Hybrid framework,

Article in Press
Scientific Reports
https://doi.org/10.1038/s41598-026-79443-9
together with the integrated pre-processing strategy, provides robust methodological guidance for advanced
predictive modeling within precision dairy cattle systems and data-driven reproductive management.
Keywords Hybrid ensemble · Non-return rate · Machine learning · Dairy cattle reproduction · Precision
breeding · Class imbalance
Abbreviations
NRR Non-return rate
AI Artificial insemination
SMOTE-NC Synthetic minority over-sampling technique for nominal and continuous features IQR: Inter-
quartile range
MI Mutual information
ROC Receiver operating characteristic
AUC Area under the receiver operating characteristic curve
CAI Cow age at insemination
MCC Matthews correlation coefficient
TP True positive
TN True negative
FP False positive
FN False negative
SHAP SHapely additive explanations
LIME Local interpretable model-agnostic explanations
RC Ridge classifier
LDA Linear discriminant analysis
LR Logistic regression
NB Naïve bayes
QDA Quadratic discriminant analysis
SVM Support vector machine
DC Dummy classifier
LGBM Light gradient boosting machine
RF Random forest
XGBoost Extreme gradient boosting
ET Extra trees
GBC Gradient boosting classifier
DT Decision tree
KNN K-nearest neighbors
AB AdaBoost
SVH Stacking-voting hybrid
API Application programming interface
CTGAN Conditional tabular generative adversarial network
IACUC Institutional animal care and use committee
MOI Month of Insemination

Article in Press
Scientific Reports
https://doi.org/10.1038/s41598-026-79443-9
Introduction
Suboptimal conception rates directly impair herd profitability 1, hinder genetic advancement2, and challenge the
sustainability of farming operations 3. Among field-applied fertility metrics, NRR has emerged as a pragmatic
and early indicator of reproductive success 4,5. Defined as the proportion of cows not observed in estrus within
a defined interval (typically 60–90 days) AI, NRR integrates the cumulative effects of key biological, manage -
rial, and environmental determinants 6–8. While pregnancy diagnosis via palpation or ultrasonography provides
definitive confirmation, this confirmation is not absolute; it is resource-intensive, requires specialized expertise,
does not guarantee sustained gestation, and its accuracy can be influenced by factors such as operator skill and
the timing of the examination 9–11. Consequently, the NRR has been widely adopted as a complementary, field
practical metric4. By simply monitoring the absence of estrus a defined interval post insemination, NRR offers a
timely, cost efficient proxy for early reproductive management, enabling critical adjustments to maintain optimal
calving intervals in commercial herds 12. Nevertheless, despite its operational utility, NRR exhibits substantial
field-level variability, with average on-farm performance consistently lagging 15–25% points below estimated
genetic potential13,14. This persistent gap stems from the inherently multifactorial and nonlinear nature of con -
ception, where NRR integrates inputs across four primary domains: (i) genetic and seminal factors (sire fertility,
semen quality, and underlying genomic architecture) 14; (ii) cow-level physiology (parity, metabolic status, and
uterine health)13; (iii) management practices (AI technician skill, heat stress mitigation, and estrus detection pro-
tocols)13,15; and (iv) environmental interactions that modulate these components14. Critically, these determinants
do not act additively; they engage in dynamic interactions across temporal and hierarchical scales (e.g., seasonal
heat stress exacerbating parity-specific metabolic dysfunction) 15. Consequently, conventional linear modeling
approaches often fail to capture this complexity, limiting their utility for accurate, individual cow prediction 14.
The economic implications of failing to accurately predict NRR are profound. Globally, reproductive inefficiency
results in annual losses, with intensive systems facing direct costs of $300–500 per cow each year 13. This finan-
cial burden stems from the severe consequences of a low NRR: each 1-percentage-point drop erodes net returns
by $8–12 per cow annually, driven by extended calving intervals 13,15, diminished milk yield (15–20% loss per
affected lactation), elevated culling rates (≈ 30%), and delayed genetic progress 14. Therefore, developing accu -
rate, early, and individualized predictive models for NRR transcends a mere technical challenge; it represents
a critical leverage point for enhancing the economic sustainability and resilience of modern dairy operations15.
While existing ensemble methods show strong aggregate performance in pregnancy outcome prediction, they
mask critical heterogeneity in reliability for individual cows 16–20, especially given commercial herd challenges
such as high-cardinality categorical features, non-Gaussian distributions, temporal autocorrelation, and severe
class imbalance (NRR > 75%) that bias models toward the majority class 21–26. Prior machine-learning applica -
tions in reproduction have been limited by (1) insufficient preprocessing of heterogeneous farm data, (2) reliance
on single-model architectures that miss complex interactions, and (3) lack of rigorous large-scale benchmarking,
reducing generalizability21,27–31. To close these gaps, we built a domain-specific pipeline that uses clustering-
based categorical encoding and stratified SMOTE-NC, preserving categorical logic while improving minority-
class representation21,26. We then engineered a two-tier hybrid ensemble that combines diverse base learners
through soft voting and meta-learning stacking, enhancing robustness and accuracy26,32. An exhaustive compara-
tive evaluation of 15 machine-learning algorithms on a large-scale dataset established a definitive performance
benchmark, demonstrating that the hybrid approach outperforms monolithic models across precision, recall, and
AUC metrics32. By delivering reliable cow-level predictions, the framework translates into tangible economic
benefits—reducing insemination costs, shortening calving intervals, and optimizing culling decisions—thereby
bridging the gap between algorithmic performance and on-farm utility33.
The present study develops a domain-informed preprocessing pipeline capable of handling high-cardinality
categorical variables and class imbalance through clustering-based encoding and SMOTE-NC resampling. The
proposed framework is evaluated using a large-scale dataset of 118,996 artificial insemination records collected

Article in Press
Scientific Reports
https://doi.org/10.1038/s41598-026-79443-9
Feature Full Name Preprocessing Steps Rationale and method Final rep-
resentation
in model
Animal Animal ID Excluded High-cardinality identifier; no direct predictive signal; risk
of overfitting

PAS Parturition Status [Stillbirth-
natural = 12, stillbirth = 1,
natural = 2]
retained Captures nonlinear association with fertility (e.g., stillbirth
linked to uterine inflammation); preserves empirical risk
per category
categorical
BT Birth Type [Singlets = 1,
twins = 2, triplets = 3]
Excluded Statistically independent of PS; redundant with Sex and
WB

SEX Calf Sex [Singlet-
Male = M, Singlet-
Female = F, Mixed = 2,
Twins-Female=2 F,
Twins-Male=2 M]
Converting non-numeric
data to numeric data and
removing incorrect data
Encodes sex-specific embryonic loss patterns (e.g.,
male conceptuses more vulnerable); handles mixed-sex
multiples
categorical
WB Birth weight of calf at calv-
ing before insemination

  1. Yeo–Johnson transfor-
    mation (λ = 0.125)
  2. IQR outlier removal
    (6.63%)
  3. Min–max scaling
    extreme right skew; extreme values biologically plausible
    but distort model gradients
    continuous
    DS Dystocia score at calving retained Nonlinear fertility impact: scores ≥ 4 sharply reduce con-
    ception; preserves clinical severity gradient
    continuous
    RP Retained Placenta [Yes = 1,
    No = 0]
    retained Low missingness; strong predictor of metritis and delayed
    uterine involution
    binary
    TNR Total number of retained
    placenta in total parties
    Hierarchical clustering
    (Ward, Euclidean on target
    means) → 4 clusters
    Severe imbalance; rare categories noisy; clustering stabi-
    lizes signal
    categorical
    DR Dry Period 1. Yeo–Johnson (λ = 0.323)
  4. Min–max scaling
    Right-skewed; optimal dry period (45–60 d) critical for
    metabolic reset
    continuous
    GL Gestation Length 1. Yeo–Johnson (λ = 9.69)
  5. IQR outlier removal
    (3.15%)
  6. Min–max scaling
    extreme left skew; prolonged gestation linked to fetal
    overgrowth and dystocia
    continuous
    DMP Days in milk at first insemi-
    nation of current lactation
    period
    Excluded Redundant with DM (days in milk at this insemination);
    minimal added information

DFS Age at first insemination 1.Yeo–Johnson (λ=
−0.000820)
2. IQR outlier removal
(1.79%)
3. Min–max scaling
Right-skewed; early puberty insemination affects lifetime
reproductive efficiency
continuous
NPA Number of previous
abortion
retained Low cardinality; abortion history signals chronic repro-
ductive dysfunction (e.g., infectious, genetic)
continuous
IFI Interval form insemination
to previous abortion
Excluded (96.7% missing) Extreme missingness precludes reliable estimation; not
imputable without bias

DIM DIM ID Excluded High-cardinality proxy; fully redundant with LP and DM -
SIR SIR ID Excluded High-cardinality; direct use risks overfitting; sire fertility
proxied via TP = 2 (AI)

CAI Age Insemination 1.Yeo–Johnson (λ= −0.47)
3. Min–max scaling
Right-skewed; older age at AI linked to declining oocyte
quality
continuous
DI Day of insemination based
upon lunar calendar
retained Sparse but captures fine-grained temporal trends (e.g.,
lunar phase effects hypothesized in regional practice)
categorical
MOI Month of insemination
based upon lunar calendar
retained Balanced distribution; strong seasonal signal (e.g., heat
stress in summer months)
categorical
YI Year of insemination based
upon lunar calendar
retained Captures inter-annual variation (e.g., feed quality, disease
outbreaks, management changes)
categorical
LP Lactation Period One-hot encoding Strong, heterogeneous association with PS (SD = 0.085);
sufficient sample per level
14 binary
features
Table 1 Feature inventory, biological definitions, and complete preprocessing pipeline for NRR prediction.

Article in Press
Scientific Reports
https://doi.org/10.1038/s41598-026-79443-9
under commercial production conditions, enabling robust benchmarking against multiple conventional machine
learning algorithms. The Materials and Methods are presented, including the computational setup, dataset descrip-
tion, and the multi-stage preprocessing pipeline encompassing initial data curation, feature relevance analysis
using mutual information and Cramér’s V , categorical encoding strategies, normalization of continuous variables,
and class balancing via SMOTE-NC. The machine-learning framework is subsequently described, followed by
the benchmarking of base learners. The proposed hybrid ensemble architecture is then introduced, and the evalu-
ation metrics used for model assessment are outlined. The results are presented and further interpreted through
discussion of their methodological and biological implications. Finally, the study concludes by summarizing the
key findings and their relevance for precision reproductive management in dairy cattle systems.
Materials and methods
Mathematical formulation of the prediction framework
To ensure full reproducibility and theoretical transparency, this section details the mathematical underpinnings of
the proposed predictive framework. The pipeline transforms a raw, heterogeneous feature space 𝐗𝐗 ∈ ℝ𝑁𝑁𝑁 𝑁𝑁 (where
𝑁𝑁 𝑁 𝑁𝑁𝑁 ,996 is the sample size and 𝑃𝑃 is the number of initial features) into a refined representation 𝐗𝐗*, which is
subsequently mapped to a binary NRR target vector 𝐲𝐲 ∈{ 0,1}
𝑁𝑁
via a two-tier hybrid ensemble.
Computational setup
The experimental workflow was executed within the Google Colab computational platform, leveraging a CPU-
based runtime instance configured with an Intel® Xeon® processor (2.20 GHz, 4 physical/8 logical cores, x86_64
architecture), 51 GB of system memory, and 226 GB of NVMe SSD storage—specifications. The Google Colab,
operating under Linux kernel 6.6.105+ (with glibc 2.35), provided a robust and standardized infrastructure for data
Feature Full Name Preprocessing Steps Rationale and method Final rep-
resentation
in model
TP Type of gestation
[Natural = 1, Artificial-
insemination = 2,
Embryo-transfer = 3]
retained AI (vs. natural) is primary intervention; ET rare but high-
value; encodes conception method risk
continuous
S Sperm ID excluded High-cardinality; batch effects confounded with storage,
technician, and sire; sire effects addressed via TP

AIT Artificial Insemination
Technician
excluded High-cardinality; skill variation captured at herd/cluster
level in sensitivity checks

DM Days in milk in
insemination
1.Yeo–Johnson (λ = 0.105)
2. Min–max scaling
Critical predictor (optimal window: 60–80 DIM); mild left
skew
continuous
AM Average milk yield on the
day of insemination
1-IQR outlier removal
(1.12%)
2-min–max scaling
Near-symmetric; proxy for metabolic status (high yield →
negative energy balance)
continuous
CL Classification of lunar date
day into four categories
retained low association with PS; likely record-keeping artifact categorical
CI Classification of insemi-
nation time into four
categories
retained Time of day may influence sperm transport and uterine
environment; captures operational variation
categorical
PS
(target)
Pregnancy Status
[Return-to-estrus = 0,
non-return-to-estrus = 2]

  1. Removal of singleton
    error
  2. SMOTE-NC
    oversampling
  3. Shuffling
    Initial imbalance (76.3%:23.7%); SMOTE-NC preserves
    categorical feature integrity while balancing classes
    Balanced
    binary
    (50:50)
    Table 1 (continued)

Article in Press
Scientific Reports
https://doi.org/10.1038/s41598-026-79443-9
preprocessing, exploratory feature analysis, and iterative model training. The complete Python environment—
including package names, dependencies, and exact version numbers—was systematically documented within
the project’s internal records to ensure reproducibility and permit methodological verification upon request. The
library versions were presented in Supplementary File 1.
Dataset features
The dataset employed in this study encompasses 118,996 records and 29 features, meticulously documenting the
reproductive conditions of dairy cows on a single farm, with a particular emphasis on the presence or absence of
estrus. For the sake of convenience, the feature names were modified, as illustrated in Table 1. The dataset com-
prises structured herd management records from Iranian Holstein herds, with features categorized by domain:
(i) calving and neonatal characteristics (e.g., PAS: parturition status coded as 12 = stillbirth–natural, 1 = stillbirth,
2 = natural; BT: birth type; WB: calf birth weight [kg]; DS: dystocia score on a standardized 1–5 scale); (ii)
postpartum health indicators (e.g., RP: retained placenta [binary]; TNR: cumulative count of retained placenta
events); (iii) lactation and reproductive timeline metrics (e.g., DR: dry period length [days]; GL: gestation length
[days]; DMP: days in milk at first insemination; LP: current lactation number; IFI: interval [days] from prior
abortion to insemination; NPA: number of prior abortions); (iv) insemination event descriptors (e.g., TP: type of
conception [1 = natural, 2 = AI, 3 = embryo transfer]; S: sire/sperm batch ID; AIT: inseminator technician ID; DM:
days in milk at insemination; AM: 305-day-equivalent milk yield [kg] averaged over ± 3 days around insemina-
tion); (v) temporal covariates, including lunar-calendar–based insemination timing (DI: day, MOI: month, YI:
year; CL: lunar phase quartile classification; C1: time-of-day quartile); and (vi) demographic traits (e.g., CAI:
cow age at insemination [months]; DFS: age at first insemination [months]; Sex: calf sex configuration, includ -
ing mixed-sex multiples). The dependent variable, PS (Pregnancy Status), defines NRR as a binary outcome:
0 = return to estrus within 56 days (failure), 1 = no return to estrus (presumed conception). A comprehensive,
multi-stage preprocessing pipeline was implemented to address the structural and statistical challenges inherent
in large-scale dairy herd records, ensuring model robustness, interpretability, and generalizability. The workflow
comprised five sequential phases: (i) initial data curation, (ii) feature relevance assessment, (iii) categorical vari-
able encoding, (iv) continuous variable normalization and outlier treatment, and (v) class balancing.
Initial data curation
The raw dataset comprised 118,996 AI records with 29 initial features. Six features were excluded a priori:
Animal, DIM, SIR, S, AIT, and IFI. The first five served as high-cardinality identifiers (e.g., animal ID, sire ID,
technician ID) with no direct mechanistic link to the binary NRR outcome and were retained only for downstream
hierarchical encoding; IFI was discarded due to extreme missingness (96.2%). Rows with inconsistent biologi -
cal entries (n = 407 records), implausible values (e.g., DMP < 0, n = 10), and exact duplicates were removed. The
final curated dataset comprised 101,736 records across 20 features (7 continuous, 13 categorical), with missing -
ness < 2% for all retained features and imputed via median (continuous) or mode (categorical) where necessary.
Mutual information and cramér’s V
To prioritize biologically and statistically informative features, feature relevance was quantified using MI—an
information-theoretic measure capable of capturing both linear and nonlinear dependencies between features and
the target (PS: NRR at 56 days) (Fig. 1)34,35. For continuous–discrete pairs (e.g., WB vs. PS), MI was estimated
via adaptive discretization followed by kernel density estimation; for discrete–discrete pairs (e.g., CL vs. PS),
empirical probability mass functions were used. MI scores revealed three low-relevance features (CL, BT, DMP;
MOI < 0.005), suggesting minimal predictive utility. To corroborate this for categorical variables, Cramér’s V—a
normalized χ²-based association metric invariant to table dimensionality 36—was computed (Fig. 11). Both CL

Article in Press
Scientific Reports
https://doi.org/10.1038/s41598-026-79443-9
Fig. 2 Dendrogram illustrating hierarchical clustering of TNR categories based on similarity in PS.

Fig. 1 Mutual information scores between each predictor features and PS.

Article in Press
Scientific Reports
https://doi.org/10.1038/s41598-026-79443-9
and BT exhibited negligible association with PS (V < 0.01), confirming statistical independence. Consequently,
CL, BT, and DMP were excluded, yielding a final feature set of 14 predictors. Feature selection was driven by
two complementary information-theoretic and association metrics to discard non-informative predictors. For
categorical features, the strength of association with the binary target 𝐲𝐲 was quantified using Cramér’s V , defined
as: 𝑉𝑉𝑉 √
𝜒𝜒 2
𝑛𝑛⋅ min(𝑘𝑘𝑘𝑘,𝑟𝑟𝑘𝑘)
, where 𝜒𝜒 2 is the Pearson chi-squared statistic computed from the contingency table, 𝑛𝑛 is the
total sample size, and 𝑘𝑘 and 𝑟𝑟 are the number of unique categories in the feature and target, respectively ( 𝑟𝑟𝑟𝑟
for NRR). Values of 𝑉𝑉 𝑉 𝑉𝑉𝑉𝑉 were interpreted as indicating negligible association. For a discrete target 𝑌𝑌 and a
continuous feature 𝑋𝑋, MI is estimated via: 𝐼𝐼 (𝑋𝑋𝑋 𝑋𝑋) = ∑ 𝑦𝑦∈ {0,1} ∫ 𝑝𝑝 (𝑥𝑥,𝑦𝑦) log (
𝑝𝑝(𝑥𝑥,𝑦𝑦)
𝑝𝑝(𝑥𝑥)𝑝𝑝(𝑦𝑦)
) 𝑑𝑑𝑥𝑥, where 𝑝𝑝 (𝑥𝑥,𝑦𝑦) is the joint prob-
ability density (estimated via kernel density estimation) and 𝑝𝑝 (𝑥𝑥) and 𝑝𝑝 (𝑦𝑦) are the marginal distributions. Features
yielding 𝐼𝐼 (𝑋𝑋𝑋 𝑋𝑋) < 0.005 were excluded.
Categorical variable encoding
Two high-cardinality categorical features required domain-informed encoding to mitigate sparsity and preserve
signal: TNR exhibited severe class imbalance (e.g., level 0: 68.8% of samples; levels ≥ 8: <0.12% each). To sta-
bilize estimation and reduce noise from rare categories, we applied target-mean embedding followed by agglom-
erative hierarchical clustering using Ward linkage and Euclidean distance on the per-category PS means 37–39.
Specifically, each category 𝒸𝒸 was mapped to the conditional expectation of the target, 𝜇𝜇 𝒸𝒸 =𝔼𝔼 [𝑦𝑦𝑦 X =𝒸𝒸 ]. Catego-
ries were then clustered using Ward’s minimum-variance method, which minimizes total within-cluster variance.
The distance between two categories 𝔦𝔦 and 𝔧𝔧 merging into cluster 𝓈𝓈 was defined as: 𝑑𝑑2𝑖𝑖𝑖𝑖 = |𝑖𝑖||𝑖𝑖||𝑠𝑠| ‖‖𝜇𝜇𝑖𝑖 −𝜇𝜇 𝑖𝑖‖‖22, where |𝒾𝒾|
, |𝒿𝒿| and |𝓈𝓈| denote the sample sizes of the corresponding groups. The resulting clustered categories replaced the
original TNR levels, preserving biological signal while reducing sampling noise from rare events. The dendro -
gram (Fig. 2) supported a four-cluster solution: Cluster 0 = {0, 9}; Cluster 1 = {1, 2, 4, 5, 7}; Cluster 2 = {3,
6}; and Cluster 3 = {8, 10}. The resultant TNR-merged feature (4 levels) retained discriminative power while
improving statistical reliability (Fig. 3). Importantly, the original TNR variable was retained alongside the newly
constructed TNR-merged feature to enable comparative evaluatin of raw versus clustered representations within
the learning framework. This dual-representation strategy allowed the model to assess both fine-grained and
aggregated behavioral patterns. Consequently, the final dataset dimensionally increased due to feature engineer-
ing, resulting in 34 total features and 101,736 samples after preprocessing. The LP showed stronger and more
heterogeneous associations with PS (inter-category SD = 0.085 vs. 0.054 for TNR), with sufficient sample sizes
even in mid-frequency categories. The LP feature was subsequently transformed into a 14-dimensional one-hot
encoded representation to capture fine-grained parity-specific effects while avoiding any ordinal assupmtions.
This expansion allowed the model to explicitly represent each lactation stage as an independent feature dimen -
sion, improving flexibility in learning non-linear reproductive patterns. Therefore, one-hot encoding was applied
to preserve category-specific effects without aggregation 40. The remaining nominal features (PAS, Sex, TP, and
C1) were not encoded via target-mean encoding41. Instead, they were transformed into their native numeric rep-
resentations, with any non-convertible entries parsed as NaN. This approach was chosen to preserve the inherent
scale of these features while avoiding the dimensionality inflation associated with expansion-based encoding
methods, such as one-hot encoding. Consequently, this allowed the ensemble models to directly partition the
original numeric scale of these variables during the learning process.
Continuous features normalization
Seven continuous biological features underwent a standardized, four-step normalization pipeline to ensure com-
patibility with distance- and gradient-based learning algorithms.

Article in Press
Scientific Reports
https://doi.org/10.1038/s41598-026-79443-9
Skewness assessment Distributional asymmetry was quantified using the adjusted Fisher–Pearson coefficient
of skewness (G1)42,43. For sample 𝓍𝓍𝓍 {𝓍𝓍1,𝓍𝓍2,...,𝓍𝓍𝑁𝑁} of size N, with sample mean −𝑥𝑥 = 1𝑁𝑁 ∑ 𝑁𝑁𝑖𝑖𝑖1𝓍𝓍𝑖𝑖, the i-th biased central moment is defined as 𝑚𝑚𝑖𝑖 = 1𝑁𝑁 ∑ 𝑁𝑁𝑖𝑖𝑖1(𝓍𝓍𝑖𝑖− −𝑥𝑥)𝑟𝑟. The bias-corrected skewness coefficient, which accounts for sample size to improve estimator accuracy, was computed as 48,49: 𝐺𝐺1 = [ √𝑁𝑁𝑁𝑁𝑁𝑁1𝑁𝑁𝑁𝑁𝑁 ] × [ 𝑚𝑚3
𝑚𝑚
3
𝑁
𝑁
], where 𝑚𝑚3 and 𝑚𝑚2
denote the second and third biased central moments, respectively. Distributions were classified as approximately
symmetric ( |𝐺𝐺1| < 0.5 ), moderately skewed ( 0.5 ≤ |𝐺𝐺1| <1 ), or highly skewed ( |𝐺𝐺1| ≥ 1). Features with |𝐺𝐺1| ≥ 0.5
were selected for transformation.
Yeo–Johnson transformation To mitigate skewness and stabilize variance, selected variables were transformed
using the Yeo–Johnson power transformation, with the parameter λ estimated via maximum likelihood44. Unlike
the Box–Cox framework, the Yeo–Johnson method natively handles zero and negative values 44,45. The trans -
formed value 𝓍𝓍(𝜆𝜆 ) is defined piecewise as:

𝑓𝑓𝑓𝑓𝑓𝑓 𝑓𝑓 ≥ 0∶ 𝑓𝑓(𝜆𝜆 ) = {
(𝑓𝑓𝓍𝓍𝓍𝜆𝜆 −𝓍
𝜆𝜆
, 𝜆𝜆 ≠ 0
𝑙𝑙𝑙𝑙𝑙𝑙𝑙 𝑙 𝑙𝑙 , 𝜆𝜆 =0
𝑓𝑓 𝑓𝑓 𝑓𝑓𝑓𝑓𝑓 0∶ 𝑓𝑓(𝜆𝜆 ) = {
(−𝑓𝑓𝓍𝓍𝓍2−𝜆𝜆 −𝓍
2−𝜆𝜆
, 𝜆𝜆 ≠ 2
−𝑙𝑙𝑙𝑙𝑙−𝑙𝑙 𝑙 𝑙𝑙 , 𝜆𝜆 =2
Post-transformation, skewness was reduced to |𝐺𝐺1| < 0.2 for all variables, indicating near-symmetric distributions.
Table 2 presents the results of applying the Y eo-Johnson transformation to address the skewness issue.
Fig. 3 The distribution of PS within each level of the engineered feature TNR_MERGED (clustered Total Number of
Retained Placentas).

Article in Press
Scientific Reports
https://doi.org/10.1038/s41598-026-79443-9
Outlier removal Outliers were identified using IQR( 𝐼𝐼𝐼𝐼𝐼𝐼 𝐼 𝐼𝐼 3 −𝐼𝐼 1) method46. Observations falling outside the
interval [𝑄𝑄𝑄 𝑄 𝑄𝑄𝑄 𝑄 𝑄𝑄𝑄𝑄𝑄𝑄 , 𝑄𝑄 𝑄𝑄𝑄 𝑄 𝑄𝑄 𝑄𝑄 𝑄𝑄 𝑄𝑄] were considered outliers. Given the biological plausibility of extreme val -
ues, outlier exclusion was applied conservatively; only 6.8% of observations across all features were removed.
Min-max scaling Finally, all transformed features were rescaled to the [0,1] interval using min–max normaliza -
tion47: 𝓍𝓍𝑆𝑆𝑆𝑆𝑆𝑆𝑆𝑆𝑆𝑆𝑆𝑆 = 𝓍𝓍𝓍𝓍𝓍 𝑚𝑚𝑚𝑚𝑚𝑚𝓍𝓍𝑚𝑚𝑆𝑆𝑚𝑚 𝓍𝓍𝓍𝑚𝑚𝑚𝑚𝑚𝑚 . This ensures that all features contribute equitably to the model, preventing variables with larger magnitudes from exerting disproportionate influence during downstream training.
Class balancing via SMOTE-NC
The target PS exhibited substantial class imbalance (NRR = 1: 76.3%; NRR = 0: 23.7%), which could bias model
training toward the majority class. To rectify this imbalance, SMOTE-NC50 for Nominal and Continuous features
was applied to the minority class observations. At this stage, the fully preprocessed dataset comprised 101,736
samples and 34 features. For a given minority sample 𝓍𝓍𝒾𝒾, its k nearest minority neighbors were identified using
Euclidean distance in the continuous feature subspace. A synthetic observation 𝓍𝓍𝑛𝑛𝑛𝑛𝑛𝑛 was then generated by
linear interpolation between 𝓍𝓍𝒾𝒾 and a randomly selected neighbor 𝓍𝓍𝓏𝓏𝓏𝓏 : 𝑥𝑥𝑛𝑛𝑛𝑛𝑛𝑛 =𝑥𝑥 𝑖𝑖 + 𝛿𝛿𝛿𝑥𝑥 𝑧𝑧𝑖𝑖 −𝑥𝑥 𝑖𝑖), 𝛿𝛿 ∼ 𝑈𝑈𝑈𝑈𝑈𝑈𝑈𝑈𝑈𝑈𝑈𝑈𝑈𝑈 𝛿0, 1).
Crucially, categorical features were not interpolated. Instead, for each categorical variable, SMOTE-NC assigns
the most frequent category observed among the k nearest neighbors, thereby preserving structural biological
constraints (e.g., calf sex or parturition status) during oversampling. This hybrid treatment ensures that synthetic
samples remain biologically plausible while enriching the minority decision space. Following oversampling,
the class distribution was balanced to an equal 50:50 ratio, increasing the dataset size from 101,736 to 141,896
samples while preserving the same 34-feature representation. The balanced dataset was then randomly shuffled
to eliminate any sequence-related bias prior to model training. This preprocessing pipeline—integrating domain
knowledge (e.g., biological plausibility thresholds), statistical rigor (e.g., MI and Cramér’s V for feature rele -
vance; Yeo–Johnson for distributional normalization), and machine-learning best practices (e.g., SMOTE-NC for
imbalance correction)—resulting in a balanced dataset of 141,896 samples—ensures that downstream modeling
is conducted on a dataset optimized for both predictive robustness and biological interpretability. Table 1 sum-
marizes all preprocessing operations applied to each variable.
Machine learning
Base learner benchmarking
To establish a robust empirical foundation for ensemble construction, we conducted a systematic benchmark
of fifteen supervised classification algorithms, spanning five algorithmic families that represent the spectrum
of inductive biases in modern machine-learning (Table 3). All models were trained and hyper parameter-tuned
using PyCaret 3.051,52 a reproducible ML orchestration library that ensures standardized preprocessing, stratified
k-fold cross-validation (k = 10), and consistent evaluation. The dataset was processed using Pycaret, which inter-
nally performed stratified k-fold cross-validation and train-test partitioning. Model performance was assessed
Feature Skewness_Before Lambda (Λ) Skewness_After
WB 24.619073 0.125694 0.355934
GL −5.041256 9.691543 0.389441
DMP 2.775063 −0.849891 0.020304
DFS 2.70596 −0.00082 −0.000636
DR 1.623063 0.323128 −0.35053
DM 1.414756 −0.10564 0.019432
CAI 1.290745 −0.47136 0.063438
AM −0.130945 0 −0.130945
Table 2 Skewness metrics
before and after Yeo–John-
son transformation for
eight continuous predictor
features.

Article in Press
Scientific Reports
https://doi.org/10.1038/s41598-026-79443-9
on the test set using seven complementary metrics, with accuracy serving as the primary ranking criterion for
base learner selection. For reproducibility, the final optimized hyperparameter settings of the Tier 1 base learn -
ers (LightGBM, Random Forest, XGBoost, and Extra Trees) obtained through the PyCaret tuning workflow are
reported in Supplementary File 2.
Hybrid ensemble architecture
Motivated by the limitations of monolithic models and grounded in ensemble-learning theory53, we engineered a
novel two-tier hybrid architecture, termed SVH, as illustrated in Fig. 4. The SVH framework hierarchically inte-
grates probabilistic consensus with meta-learned arbitration to address model instability, feature interaction com-
plexity, and the bias–variance trade-off inherent in heterogeneous dairy datasets. Let the final preprocessed and
balanced feature vector for an individual cow be denoted by X
∗
∈ ℝ𝑑𝑑. The SVH architecture maps X∗ to a binary
prediction ˆ𝓎𝓎∈ {0,1}, through a two-tier mechanism. In the first tier, four high-capacity tree-ensemble learners—
LightGBM54, RF55, XGBoost56, and ET57—are deployed. Their probabilistic outputs are fused via unweighted
soft voting to produce a consensus probability, P𝑣𝑣𝑣𝑣𝑣𝑣𝑣𝑣, defined as: P𝑣𝑣𝑣𝑣𝑣𝑣𝑣𝑣(𝓎𝓎 𝓎 𝓎𝓎 X
∗
)𝓎
1
4
∑ 4𝑚𝑚𝑚1 P𝑚𝑚(𝓎𝓎 𝓎 𝓎𝓎 X∗), where
P𝑚𝑚 is the probability of non-return assigned by each base learner. To construct the second tier, P𝑣𝑣𝑣𝑣𝑣𝑣𝑣𝑣 is concat-
enated with the individual probabilistic predictions of four additional diverse learners—GBC 58, DT59, KNN60,
and AB61—to form a 5-dimensional meta-feature vector, 𝓏𝓏𝓏 [ P𝑣𝑣𝑣𝑣𝑣𝑣𝑣𝑣,P 𝐺𝐺𝐺𝐺𝐺𝐺,P 𝐷𝐷𝐷𝐷,P 𝐾𝐾𝐾𝐾𝐾𝐾,P 𝐴𝐴𝐺𝐺] T ∈ ℝ5. This vector is pro-
vided to a GBC meta-learner, 𝑓𝑓𝑚𝑚𝑚𝑚𝑚𝑚𝑚𝑚 (𝓏𝓏), trained to learn the optimal, nonlinear combination of base predictions,
yielding the final prediction: ˆ𝓎𝓎 𝓎I [𝑓𝑓𝑚𝑚𝑚𝑚𝑚𝑚𝑚𝑚 (𝓏𝓏) ≥ 0.5] ,𝑤𝑤𝑤𝑤𝑤𝑤𝑤𝑤𝑤 I (0) denotes the indicator function. To ensure unbiased
meta-learning and prevent information leakage, the meta-feature matrix 𝒵𝒵 for the training set is constructed
exclusively via 5-fold out-of-fold predictions. For each fold k, the base models are trained on K-1 folds and
used to generate probability predictions for the held-out fold k; the meta-learner is subsequently trained on the
complete, leakage-free 𝑍𝑍𝑂𝑂𝑂𝑂𝑂𝑂 matrix using hyperparameters, (max_depth=3, learning_rate=0.1, subsample=1.0).
Fig. 4 Schematic of the two-tier hybrid ensemble architecture SVH for NRR prediction.

Family Algorithms (Abbreviation)
Linear/Probabilistic RC, LR, LDA, QDA, NB
Distance/Kernel-Based KNN, SVM
Tree-Based Ensembles LGBM, RF, XGBoost, ET, GBC
Single-Tree/Boosting DT, AB
Baseline Control DC
Table 3 Classification of
machine learning algorithms
evaluated in this study,
grouped by methodological
family and inductive bias.

Article in Press
Scientific Reports
https://doi.org/10.1038/s41598-026-79443-9
This architecture is theoretically grounded in the bias–variance decomposition of prediction error. Tier 1 miti -
gates variance through ensemble averaging of four powerful tree ensembles, smoothing random fluctuations
in sparse or noisy data regions. Conversely, Tier 2 targets bias reduction by enabling the meta-learner to learn
context-aware weighting rules that compensate for systematic weaknesses in individual predictors. For instance,
in sparsely represented subpopulations (e.g., first-parity cows), the meta-learner can dynamically down-weight
potentially overfitted models (e.g.,RF)) in favor of more conservative learners (e.g., KNN), ensuring robust gen-
eralization across heterogeneous dairy regimes. All implementations were conducted using Scikit-learn v1.3.0
with a fixed random_state = 42, ensuring full computational reproducibility.
Evaluation metrics
Model performance was assessed using seven rigorously defined metrics, computed from the confusion matrix
(Table 4), where: TP: Correctly predicted NRR (PS = 1), TN: Correctly predicted return (PS = 0), FP: Return mis-
classified as non-return, FN: NRR misclassified as return. We prioritized MCC and AUC 62 as primary metrics
due to class imbalance (NRR ≈ 76%), as they are insensitive to prevalence and provide holistic assessment of
discriminative power63–65. All metrics were computed on the held-out test set to ensure unbiased estimation. The
entire workflow of our study is show in Fig. 5.
Results
The histograms in Fig. 6 illustrate the raw distributional characteristics of eight critical continuous predictors,
highlighting pervasive right-skewness (e.g., WB, GL, DM, AM) and left-skewness (e.g., DR, DFS), with some
features exhibiting bimodality (e.g., CAI) or extreme tails (e.g., DMP). These patterns reflect biological reali -
ties—such as the concentration of birth weights around 40–50 kg, or the clustering of inseminations at 60–100
DIM—but also introduce challenges for parametric and distance-based machine-learning algorithms. The dry
period distribution showed a notable point mass at zero days (Fig. 6), indicating that a substantial proportion of
cows in this dataset were milked continuously through late gestation with no recorded dry period. This pattern is
biologically and managerially plausible rather than artifactual, for three reasons. First, continuous milking (omit-
ting the dry period) is a recognized management strategy in commercial dairy production, particularly for late-
lactation, low-yielding cows that do not meet the yield threshold at which pharmacological or abrupt drying-off
is warranted; such cows are frequently milked until calving 66. Second, in the low-input production system from
which these records originate, a deliberate dry-off event is not systematically recorded for low producers, so a
Metric Formula Interpretation
Accuracy 𝑇𝑇𝑇𝑇𝑇𝑇𝑇𝑇𝑇
𝑇𝑇𝑇𝑇𝑇𝑇𝑇𝑇𝑇𝑇𝑇𝑇𝑇𝑇𝑇𝑇𝑇𝑇𝑇
Overall correctness; sensitive to class imbalance.
Recall (Sensitivity) 𝑇𝑇𝑇𝑇
𝑇𝑇𝑇𝑇𝑇𝑇𝑇𝑇𝑇
Ability to identify true NRR; critical for minimizing missed
conceptions.
Precision 𝑇𝑇𝑇𝑇
𝑇𝑇𝑇𝑇𝑇𝑇𝑇𝑇𝑇
Reliability of predicted NRR; avoids unnecessary
interventions.
F1-Score 2 . (𝑝𝑝𝑝𝑝𝑝𝑝𝑝𝑝𝑝𝑝𝑝𝑝𝑝𝑝𝑝𝑝𝑝𝑝 . 𝑝𝑝𝑝𝑝𝑝𝑝𝑝𝑝𝑝𝑝𝑝𝑝𝑝
𝑝𝑝𝑝𝑝𝑝𝑝𝑝𝑝𝑝𝑝𝑝𝑝𝑝𝑝𝑝𝑝𝑝𝑝 𝑝 𝑝𝑝𝑝𝑝𝑝𝑝𝑝𝑝𝑝𝑝𝑝𝑝
Harmonic mean of precision/recall; balances Type I/II errors.
Matthews Cor-
relation Coefficient
(MCC)
𝑇𝑇𝑇𝑇 𝑇 𝑇𝑇𝑇𝑇 𝑇 𝑇𝑇𝑇𝑇 𝑇 𝑇𝑇𝑇𝑇
√(𝑇𝑇𝑇𝑇𝑇𝑇𝑇𝑇𝑇𝑇 𝑇 (𝑇𝑇𝑇𝑇𝑇𝑇𝑇𝑇𝑇𝑇 𝑇 (𝑇𝑇𝑇𝑇𝑇𝑇𝑇𝑇𝑇𝑇 𝑇 (𝑇𝑇𝑇𝑇𝑇𝑇𝑇𝑇𝑇𝑇
Balanced measure for imbalanced data; range [− 1, + 1] (− 1:
total disagreement; +1: perfect).
Cohen’s Kappa (κ) 2 . (𝑇𝑇𝑇𝑇 . 𝑇𝑇𝑇𝑇 𝑇 𝑇𝑇𝑇𝑇 . 𝑇𝑇𝑇𝑇𝑇
(𝑇𝑇𝑇𝑇𝑇𝑇𝑇𝑇𝑇𝑇 . (𝑇𝑇𝑇𝑇𝑇𝑇𝑇𝑇𝑇𝑇 𝑇 (𝑇𝑇𝑇𝑇𝑇𝑇𝑇𝑇𝑇𝑇 . (𝑇𝑇𝑇𝑇𝑇𝑇𝑇𝑇𝑇𝑇
Agreement corrected for chance; robust to prevalence bias.
AUC 𝐴𝐴𝐴𝐴𝐴𝐴 𝐴 𝑆𝑆𝑝𝑝 −𝓃𝓃𝑝𝑝 (𝓃𝓃𝓃𝓃 +1)/2
𝓃𝓃𝑝𝑝 𝓃𝓃𝓃𝓃
Ability to discriminate classes
AUC-ROC ∫01TPR(t)dFPR(t)
where 
TPR = Recall, FPR 
= FP+TNFP
Probability that a random non-return is ranked higher than a
random return; threshold-invariant.
Table 4 Evaluation metrics
for binary classification
performance.

Article in Press
Scientific Reports
https://doi.org/10.1038/s41598-026-79443-9
Fig. 6 Distributional profiles of eight continuous predictor variables used in NRR modeling.

Fig. 5 End-to-end preprocessing and modeling pipeline for NRR prediction in dairy cattle.

Article in Press
Scientific Reports
https://doi.org/10.1038/s41598-026-79443-9
computed interval of zero days genuinely reflects the absence of a dry period rather than a missing-value place -
holder; this was confirmed by cross-checking that all zero-DR records had a complete preceding lactation and a
recorded subsequent calving. Third, omitting the dry period is known to improve energy balance and metabolic
status in early lactation and has been proposed precisely as a strategy to mitigate negative energy balance and
heat stress in warmer climates66,67, making it an attractive option in the study region. Zero values were therefore
retained as genuine observations. Because DR was strongly right-skewed with this point mass at zero, we applied
a Yeo–Johnson transformation (λ = 0.323) followed by mean–max scaling (Table 4), which handles non-positive
values without requiring an arbitrary offset or exclusion of these cows. In effect, the zero-DR stratum represents
a distinct, biologically meaningful management category whose fertility outcomes are of substantive interest for
NRR prediction. To mitigate these effects, all continuous features underwent Yeo–Johnson power transforma -
tion followed by min–max scaling, while outliers beyond 1.5×IQR were removed. This preprocessing ensured
that downstream models operated on normalized, homoscedastic inputs without sacrificing biological signal—a
necessary step for achieving robust generalization in heterogeneous dairy datasets. Each histogram in Fig. 7
displays the frequency distribution of transformed values for BW, DR, GL, DMP, DFS, CAI, DM, and AM. All
features exhibit significantly reduced skewness with most approaching near-normal or symmetric shapes — vali-
dating the efficacy of the Yeo–Johnson transformation for stabilizing variance and improving compatibility with
machine-learning algorithms sensitive to feature scaling and distributional assumptions. Following the applica -
tion of the Yeo–Johnson power transformation, the skewed distributions of all eight continuous features were
substantially normalized, as evidenced by the unimodal, symmetric, or near-symmetric histograms in Fig. 7. For
instance, previously right-skewed variables such as WB, GL, and AM now show tighter clustering around the
mean, while left-skewed variables like DR and DFS exhibit balanced tails. This preprocessing step was critical to
ensure that downstream models—particularly distance-based (KNN) and gradient-boosted (LGBM, XGBoost)
learners—operated on features with stabilized variance and reduced sensitivity to extreme values. The resulting
distributions support more reliable coefficient estimation, improved convergence during training, and enhanced
generalization performance—essential for accurate NRR prediction in heterogeneous dairy datasets. Skew -
ness values computed using the adjusted Fisher–Pearson coefficient (G₁). Positive values indicate right-skew;
Fig. 7 Distribution of eight continuous predictor variables following skewness mitigation via Yeo–Johnson transformation.

Article in Press
Scientific Reports
https://doi.org/10.1038/s41598-026-79443-9
negative, left-skew. Lambda (λ) denotes the optimal power parameter estimated via maximum likelihood for
the Yeo–Johnson transformation. The Yeo–Johnson transformation effectively mitigated skewness across eight
continuous predictors. Pre-transformation, most features exhibited marked asymmetry (e.g., WB: G 1 = 24.62;
GL: G1 = − 5.04), which risks distorting model performance and inflating variance in distance- or gradient-based
algorithms. Post-transformation—using optimal λ parameters estimated via maximum likelihood—all features
achieved near-symmetry ( ∣G1∣≤0.39∣), with DFS and AM demonstrating exceptional balance ( ∣G1∣<0.01) and
DR, AI retaining minimal residual skew attributable to biological constraints. Figure 8 bar charts display obser-
vation counts per category across PAS, BT, SEX, DS, RP, TNR, NPA, DI, MOI, YI, LP, TP, CL, C1, and PS,
revealing pronounced class imbalances and structural heterogeneity in categorical predictors—key consider -
ations for model design and preprocessing. Features such as TNR (highly skewed toward 0) and LP (long-tailed
high-parity categories) necessitated specialized encoding (hierarchical clustering and one-hot, respectively). The
TNR encoding was not intended to suggest that categories such as 0 and 9 are biologically identical. Instead, this
step served as a regularization method based on target-mean/Ward-clustering to address extreme sparsity and
improve predictive stability for rare categories. Therefore, this transformation should be understood as a data-
driven technique for reducing noise and enhancing robustness, rather than a biological reclassification of retained
placenta events. BT and CL exhibited negligible NRR association (confirmed via MI and Cramér’s V), warrant-
ing exclusion; PS showed moderate imbalance (76% non-return), requiring SMOTE-NC oversampling. After
SMOTE-NC, the dataset contained 141,896 observations with an equal class distribution(50:50). These patterns
validated the need for ensemble architectures robust to sparse, non-uniform categorical farm data, underpinning
our hybrid approach.
Figure 9 boxplots display post-transformation distributions of WB, DR, GL, DMP, DFS, CAI, DM, and AM,
with medians (central lines), IQR boxes (Q1–Q3), whiskers (1.5×IQR), means (red dashed lines), and outliers
(dots beyond whiskers). Most features show compact IQRs and minimal outliers (e.g., CAI, DM, AM), while
Fig. 8 Frequency distributions of 15 categorical predictor features used in NRR modeling and PS itself.

Article in Press
Scientific Reports
https://doi.org/10.1038/s41598-026-79443-9
WB, GL, and DMP retain visible extremes reflecting genuine variability—such as high WB for twins/triplets
and extended GL for late-term pregnancies—ensuring model robustness to real-world biological signal without
artificial data truncation. Regarding the residual asymmetry observed in DR and GL, it is important to note that
some degree of non-symmetry persisted despite the application of the Yeo-Johnson transformation. However,
this transformation effectively mitigated skewness and stabilized variance across continuous predictors, thereby
improving compatibility with the machine learning models employed in this study. The remaining asymmetry
is attributed to underlying biological heterogeneity inherent in the reproductive and physiological data, rather
than an artifact requiring removal. Consequently, DR and GL were deemed suitable for inclusion in the analysis,
as their transformed distributions still satisfied the modeling assumptions and preserved meaningful biological
variation. This decision ensures that the models remain sensitive to clinically relevant patterns while maintain -
ing statistical robustness. Figure 10 panels display kernel-smoothed density distributions of WB, DR, GL, DMP,
DFS, CAI, DM, and AM post-Yeo–Johnson transformation and IQR outlier capping, revealing near-normal or
unimodal shapes optimal for model training. Most features exhibit improved symmetry (e.g., WB, GL, AM), with
DR, DFS, CAI showing tight clustering and DMP, DM retaining slight multimodality from operational patterns—
ensuring well-behaved inputs for homoscedastic models like LR and SVM.The accompanying MI bar chart ranks
features by information content (bits) with PS: DR leads (MI = 0.0046), followed by MOI, WB, CAI; low-MI fea-
tures (BT, CL, DMP < 0.001) were excluded. This model-agnostic analysis confirmed biological relevance (dry
period recovery, seasonal effects, fetal viability, oocyte quality) and guided feature selection for enhanced effi -
ciency and generalizability. Figure 11 displays the Cramér’s V matrix of pairwise associations among categorical
features, with values from 0 (independence) to 1 (perfect association); color intensity indicates magnitude (red:
Fig. 9 Boxplots of eight continuous predictor variables following outlier removal via the Interquartile Range (IQR) method.
Note that red elements are outlier markers.

Article in Press
Scientific Reports
https://doi.org/10.1038/s41598-026-79443-9
high; blue: low). Diagonal self-correlations are fixed at 1.0. BT and CL show negligible PS association (V < 0.03),
confirming exclusion; strong clinical links appear in DS–RP (0.62) and TNR–RP (0.62), reflecting dystocia-
retained placenta relationships. This normalized association measure validated feature selection: minimal BT/
CL–PS dependency (V ≈ 0.00) justified removal, while moderate DS–RP (0.4) and strong TNR–RP (0.62) cor -
relations confirmed biological relevance—linking calving difficulty to uterine health and conception risk—ensur-
ing interpretable, domain-relevant inputs for modeling. Table 5 quantifies predictive relationships between TNR
and LP levels and binary PS outcome. TNR category 0 dominates (68.8% records) with moderate NRR (0.313),
while rare levels (8–10) show higher means (up to 0.417) but minimal support (< 0.12%), indicating sampling
noise—prompting hierarchical clustering into four groups for stable estimation. LP exhibits stronger, distinct
associations: early lactations (1–2) yield higher NRR (0.33–0.29), later parities (≥ 12) show elevated/depressed
rates (e.g., LP = 14: 0.50) with adequate support; higher inter-category SD (0.0848 vs. TNR 0.0535) justified
one-hot encoding to preserve parity-specific effects essential for precision reproduction management. Figure 12
bars display TNR categories (0–10) with PS = 0 (blue) and PS = 1 (green) proportions. TNR = 0 dominates (68.7%
records) with 68.7% returns (PS = 0); higher TNR shows increasing non-returns (e.g., TNR = 10: 41.7% PS = 1)
but extreme rarity (< 0.12%).This confirms weak-to-moderate TNR–PS association confounded by imbalance
(> 68% in TNR = 0), where high-TNR NRR gains likely reflect sampling noise. Agglomerative hierarchical clus-
tering grouped similar levels by target means into four clusters—reducing sparsity, stabilizing signal, and enhanc-
ing model robustness for rare-event dairy data without losing biological patterns. Figure 13 bars display LP
categories (1–14) with PS = 0 (blue) and PS = 1 (green) proportions. Early lactations (1–2) show higher returns
(66.1%–71.0% PS = 0), while late parities (≥ 12) exhibit elevated non-returns (e.g., LP = 14: 50.0% PS = 1). This
reveals a biologically meaningful non-linear LP–PS relationship: early parities reflect uterine/metabolic stress,
mid-parities (4–8) peak fertility (up to 74.2% returns), and late parities show oocyte decline—supported by
Fig. 10 Kernel density-estimated histograms of eight continuous predictor features after skewness mitigation and outlier
removal.

Article in Press
Scientific Reports
https://doi.org/10.1038/s41598-026-79443-9
adequate sample sizes (e.g., LP = 14: n ≈ 1,042). Unlike sparse TNR, LP’s heterogeneity justified one-hot encod-
ing to preserve parity-specific signals essential for precision reproductive management.
Table 6 reports performance metrics—Accuracy, AUC, Recall, Precision, F1-score, Cohen’s Kappa, MCC, and
TT [sec; training time on held-out test set, n = 28,380; rounded]—across 16 classifiers. SVH achieves superior
performance: highest AUC (0.855), F1 (0.751), and MCC (0.590), with competitive efficiency (~ 524 s). SVH
outperforms individual models (e.g., RF, LGBM: Accuracy > 0.75, AUC > 0.82) via tiered integration—reduc -
ing variance through voting, correcting bias via stacking. Baselines (DC, NB) perform near-chance, confirm -
ing NRR prediction complexity requires ensembles capturing nonlinear interactions; practical training times
validate real-world scalability for precision reproductive management. Figure 14 radar chart plots normalized
metrics (0–1; Recall, Precision, F1, Kappa, MCC) across axes, with larger polygon areas indicating superior
multi-objective performance. SVH (yellow) forms the outermost polygon—excelling in Precision (0.889) and
MCC (0.590)—while baselines (DC, NB) cluster near origin, confirming poor generalization. This visualization
reveals SVH’s balanced dominance across metrics, unlike single models (e.g., RF strong on Recall = 0.728 but
weaker elsewhere), validating ensemble diversity for handling imbalanced NRR prediction and multi-objective
Fig. 11 Cramér’s V correlation matrix for categorical predictor variables and the target (PS: NRR).

Article in Press
Scientific Reports
https://doi.org/10.1038/s41598-026-79443-9
trade-offs essential for real-world dairy decision support. In addition to the proposed SVH ensemble, it is note -
worthy that the LGBM also demonstrated consistently strong performance across multiple evaluation metrics. As
shown in Fig. 14, LGBM achieved the highest Precision among all models, with a value of 0.961, outperforming
SVH (0.889) in this specific metric. This exceptional precision can be attributed to LGBM’s leaf-wise growth
strategy and gradient-based one-side sampling, which efficiently handle large, imbalanced datasets by focusing
on instances with larger gradients and thereby reducing the impact of noisy or less informative samples. More -
over, LGBM exhibited competitive performance in other metrics, including MCC (0.562), F1-score (0.721), and
Accuracy (0.882), ranking second only to SVH in these measures. The robust overall performance of LGBM
underscores its value as a powerful standalone model and highlights the complementary strengths of different
ensemble approaches in precision livestock applications. While LGBM excelled in Precision, SVH’s strength lies
in its balanced dominance across all five metrics simultaneously—achieving MCC of 0.590, F1-score of 0.751,
and competitive Precision of 0.889—unlike single models that often excel in one metric at the expense of others
(e.g., RF strong on Recall = 0.728 but weaker in Precision = 0.774). This balanced performance of SVH validates
the effectiveness of ensemble diversity for handling imbalanced NRR prediction and multi-objective trade-offs
essential for real-world dairy decision support, which ultimately justified its selection as the primary ensemble
method despite LGBM’s superior Precision. Figure 15 confusion matrices display predicted vs. actual NRR
labels (rows: Actual 0 = return, 1 = non-return; columns: Predicted 0,1), with cell counts for TN (top-left), FP
(top-right), FN (bottom-left), TP (bottom-right). SVH achieves optimal balance: highest TP (9,219 non-returns)
and lowest FN (4971 missed conceptions), minimizing both over-prediction (vs. LGBM/XGBoost FP = 363)
and under-detection (vs. DT FN = 9,415). This hybrid architecture mitigates individual biases, reducing Type I/
II errors for enhanced clinical utility and economic efficiency in precision dairy reproduction. Figure 16 confu-
sion matrix displays SVH classification: rows Actual (0 = return, 1 = non-return), columns Predicted (0,1), with
Feature Category Relative Frequency Target Mean (NRR)
TNR 0 0.68777 0.313387
1 0.186443 0.282159
2 0.064589 0.275909
3 0.031346 0.264346
4 0.013987 0.288124
5 0.007755 0.288973
6 0.004315 0.250569
7 0.002025 0.281553
8 0.001189 0.206612
9 0.000462 0.340426
10 0.000118 0.416667
Standard Deviation — 0.0535
LP 1 0.345532 0.338634
2 0.271074 0.289796
3 0.164878 0.287409
4 0.101891 0.279471
5 0.056804 0.273577
6 0.030736 0.260953
7 0.015766 0.259975
8 0.007628 0.257732
9 0.003489 0.283708
10 0.001484 0.235411
11 0.00055 0.321429
12 0.000069 0.428571
13 0.000069 0.142857
14 0.00002 0.5
Standard Deviation — 0.0848
Table 5 Per-category rela-
tive frequency distribution
and target mean NRR for
high-cardinality categorical
features TNR and LP.

Article in Press
Scientific Reports
https://doi.org/10.1038/s41598-026-79443-9
Fig. 13 Stacked bar plot showing the distribution of pregnancy status PS within each level of LP.

Fig. 12 Stacked bar plot showing the distribution of pregnancy status PS within each level of TNR.

Article in Press
Scientific Reports
https://doi.org/10.1038/s41598-026-79443-9
Table 6 Performance comparison of 16 machine learning models on NRR prediction.
MODEL ACCURACY AUC RECALL PRECISION F1 KAPPA MCC TT [SEC]
SVH 0.7842 0.8546 0.6497 0.8888 0.7507 0.5684 0.5902 523.794
LGBM 0.7712 0.8204 0.5656 0.9606 0.7120 0.5424 0.5950 83.348
RF 0.7577 0.8374 0.7282 0.7739 0.7503 0.5154 0.5163 5.189
XGBoost 0.7522 0.8130 0.5822 0.8823 0.7015 0.5045 0.5365 0.554
ET 0.7501 0.8132 0.7459 0.7523 0.7490 0.5002 0.5003 4.281
GBC 0.7367 0.7943 0.5911 0.8339 0.6918 0.4733 0.4948 6.451
DT 0.6605 0.6605 0.6617 0.6601 0.6609 0.3210 0.3210 0.571
KNN 0.6300 0.6800 0.7121 0.6148 0.6599 0.2659 0.2693 2.995
AB 0.6215 0.6730 0.6322 0.6192 0.6255 0.2430 0.2432 1.410
RC 0.5749 0.6037 0.6127 0.5696 0.5904 0.1497 0.1502 0.037
LDA 0.5749 0.6037 0.6126 0.5696 0.5903 0.1497 0.1502 0.095
LR 0.5661 0.5912 0.6125 0.5605 0.5853 0.1321 0.1327 3.232
NB 0.5255 0.5744 0.8980 0.5161 0.6524 0.0510 0.0800 0.039
QDA 0.5093 0.6000 0.1865 0.8943 0.1414 0.0185 0.0628 0.371
SVM 0.5056 0.5743 0.6885 0.4739 0.4710 0.0112 0.0309 2.574
DC 0.5000 0.5000 0.2000 0.1000 0.1333 0.0000 0.0000 0.035
Fig. 14 Radar chart comparing the performance of machine learning models across five key evaluation metrics. The SVH
(yellow) forms the outermost polygon, demonstrating superior balance across metrics, with particularly strong performance
in MCC (0.590), F1 (0.751), and competitive precision (0.889). While LGBM achieved the highest precision (0.961) among
all models—attributable to its leaf-wise growth strategy and gradient-based one-side sampling that efficiently handle large,
imbalanced datasets—SVH’s strength lies in its balanced dominance across all five metrics simultaneously, unlike single
models that often excel in one metric at the expense of others (e.g., RF strong on Recall = 0.728 but weaker in Preci -
sion = 0.774). Baseline models (DC, NB, QDA) cluster near the origin, confirming poor generalization. This visualization
reveals SVH’s balanced dominance across metrics, validating ensemble diversity for handling imbalanced NRR prediction
and multi-objective trade-offs essential for real-world dairy decision support.

Article in Press
Scientific Reports
https://doi.org/10.1038/s41598-026-79443-9
counts TN = 13,037, FP = 1,153, FN = 4,971, TP = 9,219. SVH achieves high specificity (91.9%; TN/(TN + FP))
and moderate sensitivity (65.0%; TP/(TP + FN)), prioritizing low FP (7.8%) to avoid unnecessary interventions
while capturing most non-returns (TP = 9,219)—aligning with dairy management priorities of minimizing over-
treatment costs and enabling targeted culling/resynchronization, despite FN = 4,971 room for refinement via tem-
poral/biomarker features.
Fig. 16 Confusion matrix for the proposed SVH model on
the held-out test set (n = 28,380). Rows: Actual (0 = return,
1 = non-return); Columns: Predicted (0,1). Cell counts:
TN = 13,037, FP = 1,153, FN = 4,971, TP = 9,219. SVH
achieves high specificity (91.9%; TN/(TN + FP)) and
moderate sensitivity (65.0%; TP/(TP + FN)), prioritizing
low FP (7.8%) to avoid unnecessary interventions while
capturing most non-returns (TP = 9,219)—aligning with
dairy management priorities of minimizing over-treatment
costs and enabling targeted culling/resynchronization,
despite FN = 4,971 room for refinement via temporal
features.

Fig. 15 Confusion matrices for eight top-performing ML models on the held-out test set (n = 28,380).

Article in Press
Scientific Reports
https://doi.org/10.1038/s41598-026-79443-9
Discussions
This study introduces SVH, a novel two-tier ensemble architecture designed to improve individual-level predic-
tion of NRR in commercial dairy herds. Evaluated on a large-scale dataset comprising 101,736 AI records, which
was subsequently balanced to 141,896 observations using SMOTE-NC, SVH achieved an AUC of 0.855 and an
MCC of 0.590, outperforming all 15 benchmark models including strong tree-based ensembles such as Light -
GBM (AUC = 0.820) and RF (AUC = 0.837). The improved performance arises from the complementary design
of the two-tier architecture. The first tier employs probabilistic soft voting among multiple high-capacity tree
ensembles to reduce prediction variance, whereas the second tier uses stacking to correct systematic bias through
a meta-learner trained on out-of-fold predictions. This design effectively resolves the common trade-off between
precision and recall observed in single-model approaches, enabling SVH to achieve both high precision (0.889)
and acceptable recall (0.650). The present findings suggest that architectural integration—rather than algorithm
choice alone—plays a central role in achieving robust predictive performance in complex agricultural datasets.
The superiority of SVH is closely linked to the domain-informed preprocessing pipeline implemented in this
study. To mitigate sparsity while preserving biologically meaningful structure, TNR categories were aggregated
using agglomerative hierarchical clustering based on target-mean embeddings (Fig. 12). This strategy reduced
noise arising from sparse technician identifiers while retaining herd-level signal relevant to reproductive out -
comes. In contrast, variables with clear categorical interpretation and moderate dimensionality, such as LP, were
encoded using one-hot encoding, enabling the model to capture non-linear stage-specific fertility effects without
imposing artificial ordinal relationships. Several variables exhibited substantial skewness, which can destabilize
gradient-based learning algorithms and inflate prediction variance. Application of the Yeo–Johnson transfor -
mation reduced skewness to |G₁| < 0.4 across all continuous predictors, improving numerical stability during
model training. By stabilizing feature distributions prior to training, the preprocessing pipeline ensured that the
ensemble models operated within statistically well-behaved feature spaces. The third methodological challenge
addressed class imbalance in the NRR outcome, where approximately 76% of records corresponded to successful
non-return events. To mitigate bias toward the majority class, SMOTE-NC was applied to oversample the minor-
ity class while preserving the categorical structure of variables such as Sex and TP. Unlike standard oversampling
techniques that treat all variables as continuous, SMOTE-NC maintains categorical logic during synthetic sample
generation, thereby preventing unrealistic combinations of herd attributes. The resulting balanced training distri-
bution improved minority-class sensitivity while maintaining stable overall discrimination. Following SMOTE-
NC, the dataset increased from 101,736 to 141,896 observations with an equal class distribution, providing a
more balanced representation for subsequent model development.
MI rankings (Fig. 1) identified DR as the most informative predictor. This finding is physiologically consis -
tent with established reproductive management principles, as optimal dry periods of approximately 50–60 days
are essential for uterine involution and endometrial recovery following lactation. Deviations from this window
are known to compromise subsequent conception probability, suggesting that the model successfully captured
biologically meaningful variation rather than spurious statistical correlations. The MOI also emerged as a promi-
nent predictor (Fig. 1), reflecting seasonal heat-stress effects commonly observed in dairy production systems.
Elevated ambient temperatures negatively influence oocyte competence, endocrine balance, and early embryonic
development, thereby increasing the likelihood of reproductive failure. The model’s identification of MOI as
a key predictor therefore aligns with well-documented physiological mechanisms underlying seasonal fertil -
ity variation. The Cramér’s V matrix (Fig. 11) revealed a notable association between DS and RP (V = 0.40),
reflecting a recognized pathological cascade in dairy cattle whereby difficult calving increases the risk of uterine
inflammation and subsequent placental retention. Feature exclusion was based on a dual-metric approach com -
bining Cramér’s V (threshold < 0.01) and MI (threshold < 0.005), rather than Cramér’s V alone (Fig. 11). Features
such as BT and CL were excluded because they simultaneously exhibited negligible association with the target
and extremely low information content, whereas features like SEX, TP, RP, NPA, and DI were retained as they

Article in Press
Scientific Reports
https://doi.org/10.1038/s41598-026-79443-9
did not violate both thresholds and carry indispensable clinical relevance in dairy cattle reproduction. While
single monolithic models often struggle to model these context-dependent biological interactions within a uni -
fied decision surface, the two-tier SVH framework employs multiple high-capacity learners in the first stage to
capture distinct interaction patterns and thresholds, while the second-stage meta-learner integrates these partial
representations into a robust structure. This hierarchical design provides a more flexible and biologically faithful
representation of the multifactorial processes underlying NRR, validating why the SVH framework achieves a
more balanced performance profile across the multiple metrics shown in the radar chart (Fig. 14). Furthermore,
LP exhibited a non linear relationship with reproductive success (Fig. 13). Early parity animals demonstrated
more variable fertility outcomes, likely reflecting the physiological burden of simultaneous growth and lactation.
Fertility performance stabilized during middle parities before becoming increasingly unpredictable in later lacta-
tions, where cumulative metabolic stress and age related reproductive decline may influence conception probabil-
ity. By employing one-hot encoding for LP, the modeling framework allowed these discrete life-stage effects to be
represented explicitly without imposing unrealistic linear assumptions. However, these global feature importance
measures do not fully explain individual predictions. Future implementations could incorporate local explana -
tion techniques such as SHAP to provide cow-specific reasoning for model outputs and enhance transparency
for farm-level decision making. From a management perspective, the predictive trade-off between precision and
recall carries important economic implications. In dairy herd economics, prediction errors are not symmetric. A
false positive—incorrectly predicting pregnancy in a cow that is actually open—may result in a missed estrus
cycle of approximately 21 days, potentially leading to substantial production losses. In contrast, false negatives
typically result only in additional pregnancy checks or redundant insemination attempts, which carry compara -
tively lower costs. As illustrated in the radar comparison (Fig. 14) and confusion matrix (Figs. 15 and 16), the
standalone RF achieved higher recall (0.728) than SVH (0.650), indicating a greater ability to identify true
pregnancies. However, SVH demonstrated substantially higher precision (0.889 compared to 0.774 for RF). By
prioritizing precision, SVH reduces the likelihood of such economically detrimental errors. The confusion matrix
of SVH (Fig. 16) further shows a specificity of 91.9%, indicating reliable identification of non-pregnant cows
and supporting timely reproductive management decisions. These results suggest that the model implicitly learns
a cost-sensitive decision boundary that aligns with real-world economic priorities in dairy herd management.
Within the broader landscape of machine-learning applications in dairy science, SVH represents a methodologi-
cal advancement beyond conventional single-tier ensemble strategies. From an operational perspective, SVH
also offers several practical advantages. The model is computationally efficient, requiring approximately 524 s
of training time, and produces cow-level probability estimates that can be thresholded according to farm-specific
economic preferences. Interpretability is enhanced through feature-relevance analysis and association matrices,
enabling practitioners to link predictions to biologically plausible drivers such as dry period management, sea -
sonal stress, and calving difficulty. Furthermore, the PyCaret-based implementation facilitates scalability to large
national databases, making the framework suitable for integration into precision dairy management systems.
Despite these strengths, several avenues for further development remain. Incorporating genomic informa -
tion could improve prediction accuracy for genetically elite animals, while integration with temporal modeling
approaches such as recurrent neural networks may enable dynamic updating of NRR predictions across the lacta-
tion cycle. Multi-task learning frameworks capable of simultaneously predicting reproductive outcomes, dystocia
risk, and herd health indicators may further enhance decision-support capabilities. Although the present model
was trained on records from an Iranian Holstein population, the underlying modeling pipeline was designed
around common structural challenges in dairy herd data, including high-cardinality categorical variables, class
imbalance, and non-Gaussian feature distributions. Because the framework relies primarily on routinely recorded
management and phenotypic variables rather than region-specific inputs, the overall methodology is potentially
transferable to other dairy production systems. In other words, we transparently acknowledge that the current lack
of accessible, high-quality datasets from pasture-based or other alternative production systems within Iran con -
stitutes a limitation of this study. Accordingly, we encourage future research to externally validate the proposed
framework across diverse production systems and environmental conditions as such data become available. Also

Article in Press
Scientific Reports
https://doi.org/10.1038/s41598-026-79443-9
future work should prioritize the integration of SHAP and LIME to provide cow-specific attribution of pre -
dictions and improve transparency, trustworthiness, and practical utility in on-farm decision support. Finally,
prospective validation across diverse environments is necessary to confirm generalizability beyond the Iranian
Holstein population analyzed in this study.
Conclusion
This study establishes the SVH framework as a robust solution for individual-level NRR prediction, achiev -
ing superior discriminative power (AUC = 0.855, MCC = 0.590) through a novel two-tier ensemble architecture.
By integrating hierarchical clustering-based categorical encoding, Yeo–Johnson normalization, and SMOTE-NC
oversampling, SVH effectively addresses the heterogeneity and class imbalance inherent in large-scale dairy
records. Translationally, the model converts NRR from a lagging fertility proxy into an actionable decision-
support tool, enabling precise risk stratification for culling and insemination management. Deployment within
national registries could optimize genetic gain by safeguarding elite genetics while identifying subfertile dams,
thereby shortening generation intervals. Ultimately, SVH advances precision breeding from reactive manage -
ment to proactive, data-driven reproductive stewardship. Despite robust performance, several limitations guide
future inquiry. Generalizability is currently constrained by the single-herd, semi-intensive Iranian Holstein data-
set; multi-breed and multi-environment validation are required to confirm transportability across pasture-based
systems and divergent climatic stressors. Methodologically, the cross-sectional design predicts fixed 56-day
NRR, precluding dynamic risk updating; integrating temporal architectures22 could enable sequential refinement
aligned with lactation stages. Furthermore, feature representation excludes genomic and real-time sensor data;
hybridizing SVH with genomic prediction 68 or sensor-fusion pipelines 33 may unlock synergistic gains for elite
selection. While post-hoc metrics provide global interpretability, the ensemble retains “black-box” characteris -
tics; integrating SHAP or LIME frameworks is necessary for cow-level actionable explanations. Additionally,
although SMOTE-NC preserves categorical logic, alternative imbalance strategies (e.g., focal loss, generative
adversarial oversampling) merit comparison to mitigate synthetic artifacts. Computational demands (~ 524 s
training) suggest a need for model distillation or edge-optimized APIs for real-time deployment. Finally, prospec-
tive economic validation is critical to quantify ROI from SVH-guided interventions. Addressing these challenges
through multi-institutional collaboration and causal inference frameworks will position SVH as a foundational
component of adaptive, data-driven reproductive management systems.
Supplementary Information The online version contains supplementary material available at https://doi.org/10.1038/
s41598-026-79443-9.
Author contributions Parham Khalifehzadeh: Conceptualization, methodology, software, formal analysis, visualization,
writing—original draft. Mostafa Ghaderi-Zefrehei: Conceptualization, supervision, biological interpretation, writing—orig-
inal draft, writing—review & editing, project administration. Farjad Rafeie: Supervision, software, writing—original draft,
writing—review & editing. Mohammadreza Hashemi: Genomic context, formal analysis. Somayeh Sharifi: Genomic con -
text, critical review of precision breeding implications. Mahsa Rahmani: Statistical oversight, skewness and imbalance anal-
ysis, validation of preprocessing. Saeid Ansari Mahyari: Domain expertise, feature validation, interpretation of reproductive
metrics. Mustafa Muhaghegh-Dolatabady: Supervision, resource coordination, writing—review & editing. All authors read
and approved the final manuscript.
Funding This research did not receive any funding or financial support.
Data availability The data study are available from the corresponding author upon reasonable request. Raw data cannot be
shared due to farm confidentiality agreements; however, a synthetic dataset replicating statistical properties (via CTGAN) is
included for reproducibility. All code is openly available under the MIT License on GitHub: [diary-estrus-prediction](https:/
github.com/Parham-4056/diary-estrus-prediction).

Article in Press
Scientific Reports
https://doi.org/10.1038/s41598-026-79443-9
Declarations
Competing interests The authors declare no competing interests.
Ethics approval This study utilized anonymized, routinely collected farm management data. No animals were handled or
sampled for research purposes; all records were extracted post-hoc from existing herd databases. As such, ethical approval
was waived by the IACUC of Yasouj University (Ref: YU-IACUC-2024-032).
Open Access This article is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 Interna-
tional License, which permits any non-commercial use, sharing, distribution and reproduction in any medium or format, as
long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence,
and indicate if you modified the licensed material. You do not have permission under this licence to share adapted material
derived from this article or parts of it. The images or other third party material in this article are included in the article’s Cre-
ative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article’s
Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you
will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit h t t p : / / c r e a t i v e c o m m o
n s . o r g / l i c e n s e s / b y - n c - n d / 4 . 0 / .
References

  1. Pecsok, S. R. et al. Conception Rates. 2. Economic value of unit differences in percentages of sire conception rates. J. 
    Dairy. Sci. 77, 3016–3021. https://doi.org/10.3168/jds.s0022-0302(94)77243-x (1994).
  2. Satoh, M. Improving management for higher reproduction accelerates genetic improvement in closed herd of swine.
    Anim. Sci. J. 75, 499–502. https://doi.org/10.1111/j.1740-0929.2004.00219.x (2004).
  3. Ashworth, C. J. et al. Nutritional effects on oocyte and embryo development in mammals: implications for reproductive
    efficiency and environmental sustainability. Philos. Trans. R Soc. Lond. B Biol. Sci. 364, 3351–3361. h t t p s : / / d o i . o r g / 1 0 .
    1 0 9 8 / r s t b . 2 0 0 9 . 0 1 8 4 (2009).
  4. Grossman, M. et al. Multiphasic analysis of reproductive efficiency of dairy bulls. J. Dairy. Sci. 78, 2871–2876. h t t p s : / /
    d o i . o r g / 1 0 . 3 1 6 8 / j d s . s 0 0 2 2 - 0 3 0 2 ( 9 5 ) 7 6 9 1 7 - x (1995).
  5. Setiaji, A. et al. Bayesian estimates of genetic parameters of non-return rate and success in first insemination in Japanese
    Black cattle. Anim. Biosci. 34, 1100–1104. https://doi.org/10.5713/ajas.20.0150 (2021).
  6. Fouz, R. et al. Factors associated with 56-day non-return rate in dairy cattle. Pesq agropec bras. 46, 648–654. h t t p s : / / d o
    i . o r g / 1 0 . 1 5 9 0 / S 0 1 0 0 - 2 0 4 X 2 0 1 1 0 0 0 6 0 0 0 1 1 (2011).
  7. Hyppänen, K. & Juga, J. Environmental and genetic effects on the 60-day nonreturn rate in Finnish AI bulls. Interbull 
    Bul. 18, 91–98 (1998).
  8. Rabidas, S. et al. Factors affecting first service non-return rate of crossbred bulls in Bangladesh condition. Indian J. Anim. 
    Sci. 82, 1574–1577. https://doi.org/10.56093/ijans.v82i12.25698 (2012).
  9. Hanzen, C. et al. Relative accuracy of the identification of ovarian structures in the cow by ultrasonography and palpation
    per rectum. Vet. J. 159, 161–170. https://doi.org/10.1053/tvjl.1999.0398 (2000).
  10. White, M. E. et al. Calving outcomes for cows diagnosed pregnant or nonpregnant by per rectum examination at various
    intervals after insemination. Can. Vet. J. 30, 867–870 (1989).
  11. Szelényi, Z. et al. Practical Aspects of Twin Pregnancy Diagnosis in Cattle. Animals 11, 1061. h t t p s : / / d o i . o r g / 1 0 . 3 3 9 0 / a
    n i 1 1 0 4 1 0 6 1 (2021).
  12. Utomo, B. et al. Reproductive performance and fertility traits in Madrasin cattle: The influence of growth differentiation
    factor-9 gene expression on reproductive tract size, cervical mucus characteristics, and fertility rate. Vet. World. 18,
    1799–1806. https://doi.org/10.14202/vetworld.2025.1799-1806 (2025).
  13. Al-Katanani, Y . M. et al. Factors affecting seasonal variation in 90-day nonreturn rate to first service in lactating Holstein
    cows in a hot climate. J. Dairy. Sci. 82, 2611–2616. https://doi.org/10.3168/jds.s0022-0302(99)75516-5 (1999).
  14. Shao, B. et al. Genetic Features of Reproductive Traits in Bovine and Buffalo: Lessons From Bovine to Buffalo. Front. 
    Genet. 12, 617128. https://doi.org/10.3389/fgene.2021.617128 (2021).
  15. Tiezzi, F. et al. Including gene networks to predict calving difficulty in Holstein, Brown Swiss and Jersey cattle. BMC 
    Genet. 19, 20. https://doi.org/10.1186/s12863-018-0606-y (2018).
  16. Khadidos, A. O. et al. Ensemble machine learning framework for predicting maternal health risk during pregnancy. Sci. 
    Rep. 14, 21483. https://doi.org/10.1038/s41598-024-71934-x (2024).
  17. Ferreira, I. et al. Ensemble learning for fetal ultrasound and maternal–fetal data to predict mode of delivery after labor
    induction. Sci. Rep. 14, 15275. https://doi.org/10.1038/s41598-024-65394-6 (2024).

Article in Press
Scientific Reports
https://doi.org/10.1038/s41598-026-79443-9
18. Brown, M. M. et al. Development and validation of super learner models to predict small and large for gestational age in
the second generation. Sci. Rep. 15, 33212. https://doi.org/10.1038/s41598-025-18466-0 (2025).
19. Kaur, D. & Virk, A. K. An IoT-Driven hybrid AI model for health monitoring of cows. Discov Artif. Intell. 5, 346. h t t p s :
/ / d o i . o r g / 1 0 . 1 0 0 7 / s 4 4 1 6 3 - 0 2 5 - 0 0 6 1 0 - 4 (2025).
20. Alom, M. D. S. et al. A Comprehensive approach to fetal health prediction using machine learning and ensemble models. 
27th Int. Conf. Comput. Inform. Tech. (ICCIT). 2345–2350. (2024). https://doi.org/10.1109/ICCIT64611.2024.11022051.
(2024).
21. Nadeem, G. et al. Improving bovine disease detection through multilabel classification. Sci. Rep. 15, 34766. h t t p s : / / d o i .
o r g / 1 0 . 1 0 3 8 / s 4 1 5 9 8 - 0 2 5 - 1 8 4 9 1 - z (2025).
22. Naghashi, V . et al. A bi-directional cross-channel RNN model for time-series forecasting of dairy production. Sci. Rep.
15, 44967. https://doi.org/10.1038/s41598-025-28864-z (2025).
23. Pan, L. et al. Machine learning-based clinical mastitis detection in dairy cows using milk electrical conductivity and
somatic cell count. Front. Vet. Sci. 12, 1671186. https://doi.org/10.3389/fvets.2025.1671186 (2025).
24. Guo, R. et al. Research on the prediction model of mastitis in dairy cows based on time series characteristics. Front. Vet. 
Sci. 12, 1575525. https://doi.org/10.3389/fvets.2025.1575525 (2025).
25. Marzougui, A. et al. Machine learning-derived cumulative health measure for assessing disease impact in dairy cattle.
Front. Anim. Sci. 6, 1532385. https://doi.org/10.3389/fanim.2025 (2025).
26. Gouda, H. F. & Abdallah, F. D. M. Comparative performance of bagging and boosting ensemble models for predicting
lumpy skin disease with multiclass-imbalanced data. Sci. Rep. 15, 39373. https://doi.org/10.1038/s41598-025-23846-7
(2025).
27. Mansour, H. A. E. H. Integration of assisted reproductive technologies and artificial intelligence for optimizing fertility
and genetic selection in livestock production. Discov Appl. Sci. 7, 1143. https://doi.org/10.1007/s42452-025-07380-9
(2025).
28. Sudha, S. P. & Loret, J. B. S. A review on machine learning-based precision agriculture techniques for crop farming
monitoring with IOT. Discov Environ. 4, 10. https://doi.org/10.1007/s44274-025-00305-8 (2026).
29. Camargo, M. et al. Learning business process simulation models: A Hybrid process mining and deep learning approach.
Inf. Sys. 117, 102248. https://doi.org/10.1016/j.is.2023.102248 (2023).
30. Kate, M. & Neethirajan, S. Big data approaches to bovine bioacoustics: a FAIR-compliant dataset and scalable ML
framework for precision livestock welfare. Front. Big Data. 8, 1723155. https://doi.org/10.3389/fdata.2025.1723155
(2026).
31. Katharria, A. et al. Information Fusion in Smart Agriculture: Machine Learning Applications and Future Research
Directions. Inf. Fusion. 129, 104040. https://doi.org/10.2139/ssrn (2025).
32. Alsahaf, A. et al. Pre-insemination prediction of dystocia in dairy cattle. Prev. Vet. Med. 210, 105812. h t t p s : / / d o i . o r g / 1 0 .
1 0 1 6 / j . p r e v e t m e d . 2 0 2 2 . 1 0 5 8 1 2 (2023).
33. Marques, T. C. et al. Machine learning to predict pregnancy in dairy cows: An approach integrating automated activity
monitoring and on-farm data. Animals 14, 1567. https://doi.org/10.3390/ani14111567 (2024).
34. Batina, L. et al. Mutual Information Analysis: A Comprehensive Study. J. Crypt. 24, 269–291. h t t p s : / / d o i . o r g / 1 0 . 1 0 0 7 / s
0 0 1 4 5 - 0 1 0 - 9 0 8 4 - 8 (2011).
35. Hoque, N. et al. MIFS-ND: A mutual information-based feature selection method. Exp. Sys Appl. 41, 6371–6385. h t t p s : /
/ d o i . o r g / 1 0 . 1 0 1 6 / j . e s w a . 2 0 1 4 . 0 4 . 0 1 9 (2014).
36. Afrianti, Y . S. et al. The Study of Cramer’s V for Variables Association on Stainless Steels Corrosion Problem. In: Wan
Yaacob, W. F. (Eds.). Decision Mathematics, Statistical Learning and Data Mining. Springer Proc. Math. Stat. 461,
161–168. https://doi.org/10.1007/978-981-97-3450-4_11. (2024).
37. Ward, J. H. Hierarchical Grouping to Optimize an Objective Function. J. Am. Stat. Ass. 58, 236–244. h t t p s : / / d o i . o r g / 1 0 .
1 0 8 0 / 0 1 6 2 1 4 5 9 . 1 9 6 3 . 1 0 5 0 0 8 4 5 (1963).
38. Giordani, P. et al. Hierarchical Clustering. In: Giordani, P. (Eds.). An Introduction to Clustering with R, Behaviormetrics:
Quantitative Approaches to Human Behavior. Springer Singapore. 1, 9–73. (2020). h t t p s : / / d o i . o r g / 1 0 . 1 0 0 7 / 9 7 8 - 9 8 1 - 1
3 - 0 5 5 3 - 5 _ 2
39. Gower, J. C. Properties of Euclidean and non-Euclidean distance matrices. Lin Alg Appl. 67, 81–97. h t t p s : / / d o i . o r g / 1 0 . 1
0 1 6 / 0 0 2 4 - 3 7 9 5 ( 8 5 ) 9 0 1 8 7 - 9 (1985).
40. Al-Shehari, T. & Alsowail, R. A. An Insider Data Leakage Detection Using One-Hot Encoding. Synthetic Minority
Oversampling and machine learning techniques. Entropy 23, 1258. https://doi.org/10.3390/e23101258 (2021).
41. Micci-Barreca, D. A preprocessing scheme for high-cardinality categorical attributes in classification and prediction
problems. ACM SIGKDD Explor. News. 3, 27–32. https://doi.org/10.1145/507533.507538 (2001).
42. Virtanen, P. et al. SciPy 1.0: fundamental algorithms for scientific computing in Python. Nat. Methods. 17, 261–272.
https://doi.org/10.1038/s41592-019-0686-2 (2020).
43. Doane, D. P. & Seward, L. E. Measuring Skewness: A Forgotten Statistic? J. Stat. Edu. 19, 3. h t t p s : / / d o i . o r g / 1 0 . 1 0 8 0 / 1 0
6 9 1 8 9 8 . 2 0 1 1 . 1 1 8 8 9 6 1 1 (2011).

Article in Press
Scientific Reports
https://doi.org/10.1038/s41598-026-79443-9
44. Yeo, I. K. & Johnson, R. A. A new family of power transformations to improve normality or symmetry. Biometrika 87,
954–959. https://doi.org/10.1093/biomet/87.4.954 (2000).
45. Box, G. E. P. & Cox, D. R. An Analysis of Transformations. J. R Stat. Soc. Ser. B Stat. Meth. 26, 211–243. h t t p s : / / d o i . o r
g / 1 0 . 1 1 1 1 / j . 2 5 1 7 - 6 1 6 1 . 1 9 6 4 . t b 0 0 5 5 3 . x (1964).
46. Yaro, A. S. et al. Outlier Detection in Time-Series Receive Signal Strength Observation Using Z-Score Method with Sn
Scale Estimator for Indoor Localization. Appl. Sci. 13, 3900. https://doi.org/10.3390/app13063900 (2023).
47. Shantal, M. et al. A Novel Approach for Data Feature Weighting Using Correlation Coefficients and Min–Max
Normalization. Symmetry 15, 2185. https://doi.org/10.3390/sym (2023).
48. D’Agostino, R. B. Transformation to Normality of the Null Distribution of g1. Biometrika 57, 679. h t t p s : / / d o i . o r g / 1 0 . 2 3
0 7 / 2 3 3 4 7 9 4 (1970).
49. Joanes, D. N. & Gill, C. A. Comparing measures of sample skewness and kurtosis. J. R Stat. Soc. Ser. D. 47, 183–189.
https://doi.org/10.1111/1467-9884.00122 (1998).
50. Chawla, N. V . et al. SMOTE: Synthetic Minority Over-sampling Technique. J. Arti Intel Res. 16, 321–357. h t t p s : / / d o i . o r
g / 1 0 . 1 6 1 3 / j a i r . 9 5 3 (2002).
51. Gul, S. et al. PyCaret for Predicting Type 2 Diabetes: A Phenotype- and Gender-Based Approach with the Nurses’ Health
Study and the Health Professionals’ Follow-Up Study. Datasets J Person Med. 14, 804. h t t p s : / / d o i . o r g / 1 0 . 3 3 9 0 / j p m 1 4 0
8 0 8 0 4 (2024).
52. Kim, Y . et al. A Study on Sugar Content Improvement and Distribution Flow Response through Citrus Sugar Content
Prediction Based on the PyCaret Library. Horticulturae 10, 630. https://doi.org/10.3390/horticulturae10060630 (2024).
53. Pedregosa, F. et al. Scikit-learn: Machine Learning in Python. J. Mach. Learn. Res. 12, 2825–2830 (2011).
54. Ke, G. et al. LightGBM: A Highly Efficient Gradient Boosting Decision Tree. Proc. 31st Int. Con. Neu. Inf. Process. Sys.
3149–3157. (2017).
55. Breiman, L., Random & Forests Mach. Learn. 45, 5–32. https://doi.org/10.1023/A: 1010933404324 (2001).
56. Chen, T., Guestrin, C. & XGBoost: A Scalable Tree Boosting System. Proc. 22nd ACM SIGKDD Int. Conf. Know. Disc. 
Data Min. 785–794. (2016). https://doi.org/10.1145/2939672. 2939785 (2016).
57. Geurts, P. et al. Extremely randomized trees. Mach. Learn. 63, 3–42. https://doi.org/10.1007/s10994-006-6226-1 (2006).
58. Friedman, J. H. Greedy function approximation: A gradient boosting machine. Ann. Stat. 29 h t t p s : / / d o i . o r g / 1 0 . 1 2 1 4 / a o s /
1 0 1 3 2 0 3 4 5 1 (2001).
59. Breiman, L. et al. Classification and Regression Trees. Chapman Hall/CRC. https://doi.org/10.1201/9781315139470
(1984).
60. Cover, T. & Hart, P. Nearest neighbor pattern classification. IEEE Transac Inf. Theory. 13, 21–27. h t t p s : / / d o i . o r g / 1 0 . 1 1 0
9 / T I T . 1 9 6 7 . 1 0 5 3 9 6 4 (1967).
61. Freund, Y . & Schapire, R. E. A decision-theoretic generalization of on-line learning and an application to boosting. J. 
Comput. Sys Sci. 55, 119–139. https://doi.org/10.1006/jcss.1997 (1997).
62. Hossin, M. & Sulaiman, M. N. A Review on Evaluation Metrics for Data Classification Evaluations. Int. J. Data Min. 
Knowl. Manag Process. 5, 01–11. https://doi.org/10.5121/ijdkp.2015.5201 (2015).
63. Chicco, D. et al. The matthews correlation coefficient (mcc) is more informative than cohen’s kappa and brier score in
binary classification assessment. IEEE Acc. 9, 78368–78381. https://doi.org/10.1109/ACCESS.2021.3084050 (2021).
64. Rainio, O. et al. Evaluation metrics and statistical tests for machine learning. Sci. Rep. 14, 6086. h t t p s : / / d o i . o r g / 1 0 . 1 0 3 8
/ s 4 1 5 9 8 - 0 2 4 - 5 6 7 0 6 - x (2024).
65. Valero-Carreras, D. et al. Comparing two SVM models through different metrics based on the confusion matrix. Comput. 
Oper. Res. 152, 106131. https://doi.org/10.1016/j.cor.2022.106131 (2023).
66. Kok, A. et al. Review: Dry period length in dairy cows and consequences for metabolism and welfare and customised
management strategies. Animal 13 (S1), s42–s51. https://doi.org/10.1017/S1751731119001174 (2019).
67. van Knegsel, A. T. et al. Effects of shortening the dry period of dairy cows on milk production, energy balance, health,
and fertility: a systematic review. Vet. J. 198, 707–713. https://doi.org/10.1016/j.tvjl.2013.10.005 (2013).
68. Divina, F. et al. A stacking ensemble learning approach for cattle activity prediction. SSRN Elec J. h t t p s : / / d o i . o r g / 1 0 . 2 1 3
9 / s s r n . 4 1 7 9 2 1 4 (2022).
Publisher’s note Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional
affiliations.

Article in Press
Scientific Reports
https://doi.org/10.1038/s41598-026-79443-9
Authors and Affiliations
Parham Khalifehzadeh1 · Mostafa Ghaderi-Zefrehei2 · Farjad Rafeie3 ·
Mohammadreza Hashemi4 · Somayeh Sharifi5 · Mahsa Rahmani6 · Saeid Ansari Mahyari5 ·
Mustafa Muhaghegh-Dolatabady2
Mostafa Ghaderi-Zefrehei
mghaderi@yu.ac.ir; mosmos741@Yahoo.com
Mustafa Muhaghegh-Dolatabady
mmuhaghegh@yu.ac.ir
1 Department of Computer Engineering, Faculty of engineering, University Collage of Nabi Akram, Tabriz, Iran
2 Department of Animal Science, Faculty of Agriculture, Yasouj University, Yasouj, Iran
3 Department of Agricultural Biotechnology, Faculty of Agricultural Sciences, University of Guilan, Rasht, Iran
4 Department of Genetics and Animal Breeding, Faculty of Agricultural Sciences, University of Tehran, Karaj, Iran
5 Department of Animal Science, College of Agriculture, Isfahan University of Technology, Isfahan, Iran
6 Department of Mathematical Statistics, Faculty of Science, Yasouj University, Yasouj, Iran

论文原文与出版信息

Scientific Reports
查看论文原文

继续探索