An essential step in surface wave exploration is the inversion of dispersion curves. By inverting dispersion curves, we can effectively establish the shear-wave velocity model and obtain reliable subsurface stratigraphic information. The inversion of dispersion curves is an inversion problem with multiple parameters and multiple poles, and obtaining a high precision solution is difficult. Among the methods of inversion of dispersion curves, local search methods are prone to fall into local extremes, and global search methods such as particle swarm optimization (PSO) and genetic algorithm (GA) present the disadvantages of slow convergence speed and low precision. Deep learning models with strong nonlinear mapping capability can effectively solve nonlinear problems. Therefore, we propose a method called PSO-optimized long short-term memory (LSTM) network (PSO-LSTM) to invert the dispersion curves in order to improve the effect of inversion of dispersion curves. The method is based on the LSTM network, and PSO is used to optimize the LSTM network structure and other parameters that need to be given manually to improve the prediction of the network. Two theoretical geological models are used in the paper: Model A and Model B to test the PSO-LSTM. The tests include the noisy data test and noise-free data test. Model A was tested without noise, and Model B was tested with noise. In addition, PSO and LSTM were tested on model A to compare the performance of PSO-LSTM. In Model A, the maximum relative errors of PSO and LSTM are 20.76% and 5.85%, respectively, and the maximum standard deviations of PSO and LSTM are 57.37 and 1.97, respectively. For PSO-LSTM, the maximum relative errors of Model A and Model B in the inverse results are 2.05% and 2.09%, and the maximum standard deviations of Model A and Model B in the inverse results are 1.23 and 3.87, respectively. The test results of Model A show that the inversion performance of PSO-LSTM is better than those of LSTM and PSO, and the performance of the network can be improved after PSO is used to optimize the network parameters. The inverse results from Model B show that the PSO-LSTM is robust and can invert the dispersion curves well even after adding noise to the model. Finally, the PSO-LSTM is used to invert the actual data from Wyoming, USA, which demonstrates that the PSO-LSTM can be used for the quantitative interpretation of Rayleigh wave dispersion curves.