Abstract:Carbon dioxide (CO2) concentration is a critical parameter influencing the ecological cycle and crop yield in aquaponic-mushroom symbiotic greenhouses, yet its accurate prediction remains challenging due to the highly nonlinear and strongly coupled multi-environmental factors. To address the low prediction accuracy and difficulty in achieving autonomous and efficient hyperparameter optimization of existing models, a hybrid prediction model (BOA – BiLSTM) was proposed integrating the Bayesian optimization algorithm (BOA) with a bidirectional long short-term memory (BiLSTM) network. Initially, principal component analysis (PCA) combined with agricultural system dynamics was employed to select five core driving factors, involving aquaponic area temperature, substrate temperature, pH value, salinity, and atmospheric pressure as input features, thereby reducing data redundancy and significantly enhancing model interpretability. The BOA was then utilized to automatically optimize the critical hyperparameters of the BiLSTM model. Comparative experiments on optimization algorithms revealed that, compared with genetic algorithm ( GA), particle swarm optimization ( PSO), and hippopotamus optimization (HO), the BOA-optimized model achieved maximum reductions of 27.67% and 24.17% in mean absolute error (MAE) and root mean square error (RMSE), respectively, alongside a maximum of 152.63% improvement in the coefficient of determination (R2). Furthermore, the BOA – BiLSTM model was comprehensively evaluated across multiple prediction horizons (2 min, 10 min, 30 min, and 1 h) against baseline models, including temporal convolutional network-Transformer (TCN-Transformer), bidirectional long short-term memory gated recurrent unit ( BiLSTM-GRU), convolutional neural network recurrent neural network (CNN-RNN), and mind evolutionary algorithm back propagation neural network (MEA-BP). In 2-min single-step prediction, the proposed model demonstrated superior performance with an R2, RMSE, and MAE of 0.982, 7.217 μmol/ mol, and 5.739 μmol/ mol, respectively, while exhibiting remarkable anti-decay stability in multi-step forecasting tasks. Ablation studies among LSTM, BiLSTM, BOA LSTM, and BOA – BiLSTM architectures further confirmed that the integration of the bidirectional structure and BOA global optimization significantly mitigated local optima traps and maximized feature extraction synergy. Practically, the model secured a substantial advantage in identifying threshold exceedance events during abnormal CO2 mutations with an F1 score of 0.926, maintaining a low average inference time of 0.726 ms. Finally, the dominant factors driving CO2 changes were revealed to be pH value and aquaponic temperature through the integral gradient method, in order to improve the interpretability of the model. This approach can provide a highly accurate, robust, and deployable technical foundation for intelligent environmental regulation and precision management in symbiotic greenhouse facilities.