In this paper, based on the BP neural network, several main optimization models in the prediction of foundation pit deformation are analyzed, including GA-BP, PSO-BP, SSA-BP, ACO-BP prediction models. Several different models predict the deformation during the construction of the foundation pit, and clarify the advantages and disadvantages of different models and the advantages of integrating the algorithm into the deformation prediction of deep foundation pits in civil engineering.