| Drilling efficiency is a key parameter in progress simulation of rock-fill dam excavation, and its prediction accuracy directly affects the reliability of the simulation model. To address low prediction accuracy of existing mathematical methods, the inability of single learners to meet simulation precision requirements, and the insufficient local search granularity of hyperparameter tuning in ensemble learning research, this paper proposes a drilling efficiency prediction model based on Bacterial Foraging Optimization-optimized Stacking ensemble learning. First, a dataset was constructed using drilling efficiency data collected on a rock-fill dam site as the target variable and its influencing factors (e.g., drilling depth, rock properties, elevation) as feature variables. Second, three heterogeneous base learners (XGBoost, LightGBM, and MLP) were trained in parallel, and the Bacterial Foraging Optimization algorithm—simulating chemotaxis and reproduction—was introduced to iteratively optimize each base learner’s hyperparameters by tracking the R2 curve in real time, ensuring stable “meta-features” output. Finally, the base learners’ predictions were input to a Support Vector Regression (SVR) meta-learner; by integrating complementary information from multiple models, the ensemble prediction was obtained while suppressing bias and variance. Experimental results show that after Bacterial Foraging Optimization, each base learner’s R2 reaches above 0.93 and PCC exceeds 0.97; the ensemble model’s learning curve over the full sample set is smooth and stable, residual analysis indicates residuals are evenly distributed around the zero-mean line, and the final PCC approaches 0.98, meeting the requirements of construction process simulation. |