Deformation prediction is significant to the safety of foundation pits. Against with low accuracy and limited applicability of a single model in forecasting, a PSO-GM-BP model was established, which used the PSO optimization algorithm to optimize and improve the GM (1, 1) model and the BP network model, respectively. Combining a small amount of measured data during the excavation of a bottomless foundation pit in a Changsha subway station, the calculations based on the PSO-GM model, the PSO-BP network model, and the PSO-GM-BP model compared. The results show that both the GM (1, 1) and BP neural network models can predict accurate results. The prediction optimized by the particle swarm algorithm is more accurate and has more substantial applicability. Due to its reliable accuracy and wide application range, the PSO-GM-BP model can effectively guide the construction of foundation pits, and it also has certain reference significance for other engineering applications.