In batch processes, existing soft sensing methodologies encounter substantial challenges when confronted with nonlinearity and multi‐phase issues. In response to these challenges, an innovative soft sensing framework known as the multi‐phase stacking ensemble model with self‐selected primary learner is proposed. The main innovation of this framework lies in the solution to the primary learner selection issue within the stacking model. To commence, the batch process is divided into multiple phases employing a Gaussian mixture model, thereby establishing local ensemble models for each phase. Subsequently, the iterative self‐selection of primary learners strategy is proposed, which iteratively selects suitable primary learners for these models, optimizing their combination of primary learners for each local model. This primary learner selection strategy effectively enhances the accuracy of predictions in the stacking ensemble model. To further enhance the performance, Bayesian optimization is utilized to tune the hyperparameters of each local ensemble model. This step guarantees optimal performance of the model across diverse phases. Extensive simulation experiments are conducted on an industrial penicillin fermentation process to validate the effectiveness of the proposed framework. According to the findings, the model demonstrated superior performance compared to existing single‐learner soft sensing methods and commonly utilized ensemble‐based soft sensing methods in terms of both R2 score (0.97584) and RMSE (0.0513). Overall, this framework offers a novel approach for selecting primary learners in stacking ensemble models and enhancing the predictive performance in batch processes for soft sensing.