Optimization problem is the problem which can be often encountered mostly in industrial design, and the key of optimization is to find the global optimum and higher constriction speed. This paper proposes a PSO algorithm based on BP neural network by neural network trains and selects individual extreme best randomly, to make the particle follow the optimal particle in the solution space search, and obtain the optimum extreme best in the whole situation. Through the application of the simulation experiment on image segmentation showed that the algorithm is suitable in dealing with multiple types function and constraint, with fast convergence speed, and easy combination with traditional optimization methods, thus improving its own limitations, and solving problems more efficiently.