Buildings' carbon emissions are the main contributor to climate change. The world needs to be able to foresee and further reduce construction carbon emissions if it wants to prevent the worst effects of climate change. The main challenge in carbon emission prediction for buildings is how to increase algorithm accuracy. Therefore, a novel technique for calculating carbon emissions is proposed in this study. The proposed technique uses improved particle swarm optimization (PSO) and deep neural network (DNN) to anticipate carbon emissions. DNN is employed in the proposed technique to forecast carbon emissions. The parameters used are fine-tuned using the improved PSO. Additionally, it chooses features that increase the predictability of carbon emissions. In this study, many methods for predicting carbon emissions are examined, including decision tree (DT), random forest (RF), support vector regression (SVR), DNN, and the proposed method. The outcomes demonstrate that the proposed technique can lower root mean square logarithmic error (RMSLE) prediction, and the final testing result of RMLSE is 0.3476 in this study. It demonstrates that the proposed method performs better than other alternatives when compared and has good implementation ability.