In deep learning differential privacy protection, adding noise based on gradient has become a mainstream algorithm, but excessive gradient perturbation noise causes accuracy degradation. To solve this problem, a differential privacy protection algorithm based on differential evolution and particle swarm optimization is proposed to realize hyperparameter optimization in differential privacy, reduce the impact of noise on the model, and effectively improve the accuracy. On the one hand, the differential evolution scheme performs selection, crossover and mutation on learning rate η, make it approach the global optimal solution, and improve the computational efficiency of the algorithm. On the other hand, the particle swarm optimization scheme is adopted. Without changing the parameters and gradient structure, the parameters are optimized by using the network propagation attributes, which reduces the influence of noise on the accuracy. Experiments are performed on three datasets: Cifar10, Mnist and FashionMnist. Compared with the existing differential privacy algorithms, under the same privacy budget, the proposed algorithm has better accuracy and higher efficiency.