Aiming at the precocious convergence, low search accuracy and easy divergence of most particle swarm optimizations with velocity terms, a particle swarm optimization (IWPSO) with random inertia weights and quantization is proposed. First, the inertia weights are obeyed to be distributed randomly, and the learning factors are adjusted asynchronously to optimize the parameters in BP network. Secondly, BP network is trained using the IWPSO algorithm based on the sample data. Finally, simulation experiments prove that the algorithm has significantly improved search speed, convergence accuracy, and stability compared with existing improved algorithms. Due to the characteristics of IWPSO algorithm, the BP neural network optimized by IWPSO has better global convergence performance and is an efficient particle swarm optimization.