Aiming at the complexity of prefabricated construction project input cost estimation and the subjectivity and limitation of manual estimation, a method of cost prediction based on BP neural network is proposed. In this paper, 144 sets of assembled engineering data are selected and collected. By using the mapping relationship between construction cost and 11 cost impact indicators, the prediction results are compared and analyzed after training and prediction. The results show that BP neural network can effectively predict cost, but the convergence is slow and the fitting effect is not good. In this paper, three algorithms, Adam, SGD and Adadelta, are proposed to optimize the BP neural network respectively, and the prediction results are compared and analyzed. The maximum error of SGD-BP neural network prediction model is 6.56% and the minimum error is 0.91%, the maximum error of Adadelta-BP neural network prediction model is 17.10% and the minimum error is 0.82%, the Adam-BP neural network prediction model has a maximum error of 3.89% and a minimum error of 0.11%. From the error analysis, it can be seen that the prediction results of Adam-BP neural network prediction model are more accurate, with good generalization effect, providing more accurate assembly building construction cost reference data for decision makers to judge the feasibility of the project.