In today's big data era, the application of artificial neural network (ANN) in the field of machine learning has attracted increasing attention. But there are still some problems in the research of BP neural network, such as slow convergence speed, over-fitting and so on. As an optimization algorithm, particle swarm optimization algorithm can overcome some problems existing in BP neural network at present. Based on this background, PSO optimization algorithm is used to optimize BP neural network in order to improve the performance of neural network. Our results show that the average absolute error (MAE) of PSO-BP model is 0.005 and 0.023 lower than that of GA-BP model and single BP model. In terms of root mean square error (RMSE), PSO-BP model shows a smaller RMSE (0.105), while GA-BP model and single BP model have RMSE of 0.128 and 0.208. In addition, PSO-BP model achieved a higher R2 value (0.96), while GA-BP model and single BP model achieved a higher R2 value of 0.92 and 0.84. The most striking thing is that in the classification task, the accuracy of PSO-BP neural network reaches 91.7526 % , which is 2.3253% and 12.0174% higher than GA-BP model and pure BP model. These results show that the BP neural network optimized by particle swarm optimization algorithm has higher accuracy and better performance than the unoptimized BP model and GA-BP model. To sum up, this study has made some contributions in the field of machine learning, and provided an important method for improving prediction performance and optimizing neural network models.