With the rapid development of world industrialization, the continuous increase of global carbon dioxide emissions has led to the gradual deterioration of the ecological environment and the obvious aggravation of the greenhouse effect. In this paper, the carbon dioxide content in the air over the European Alps is taken as the research object, and the RNN and LSTM neural network prediction models are respectively used to compare and predict it. The results show that the fitting effect of LSTM is better than that of RNN, and the fitting effect of the prediction model will also improve with the increase of iteration times and sample size. Since carbon monoxide and methane in the air will cause changes in carbon dioxide content, this paper adds the two factors into the LSTM prediction model as influencing factors, and the goodness-of-fit can reach 0.95, which is higher than the prediction results when there are only one influencing factor or no influencing factor. In order to reduce the running time, XGBoost, LightGBM and random forest algorithms are respectively used in this paper and Bayesian optimization algorithm is used to predict the carbon dioxide content. The results show that the prediction effect is slightly lower than LSTM. Therefore, this paper takes the above three algorithms as the base model. Linear regression experiments are carried out for the meta-model's Stacking fusion algorithm. The goodness-of-fit can reach 0.92, which significantly improves the prediction effect compared with the base model. Finally, the sensitivity analysis of the Stacking fusion model is carried out in this paper. The experimental results show that the model has strong stability.