The Particle Swarm Optimizer (PSO) has previously been used to train neural networks and generally met with success. The advantage of the PSO over many of the other optimization algorithms is its relative simplicity and quick convergence. But those particles collapse so quickly that it exits a potentially dangerous property: stagnation, which state would make it impossible to arrive at the global optimum, even a local optimum. The ecological and physical universal laws enlighten us to improve the PSO algorithm. We introduce a concept, swarm's survival density, into PSO for balancing the gravity and repulsion forces between two particles. A modified algorithm, survival density particle swarm optimization (SDPSO) is proposed for neural network training in this paper. Then it is applied to benchmark function minimization problems and neural network training for benchmark dataset classification problems. The experimental results illustrate its efficiency.