The concentration-based selection mechanism in the immune theory can avoid the shortcomings of the particle swarm algorithm in balancing population convergence and individual diversity, and enable the improved particle swarm algorithm to optimize the configuration of BP neural network parameters and improve the accuracy of short-term traffic flow prediction. The simulation experiments show that the immune particle swarm optimized BP neural network can effectively improve the prediction accuracy of short-term traffic flow and reduce the prediction error.