Surrounding rock classification of tunnel is a major factor that has a very significant impact on underground engineering design and construction. In this study, Back Propagation (BP) neural network was used to classify surrounding rock classification and build the three-dimensional (3D) prediction model of surrounding rock of tunnel, and particle swarm optimization (PSO) was used to optimize the input weight matrix and the hidden layer bias in BP network. Five quantitative surrounding rock parameters were used as input for the PSO-BP network, including the elastic longitudinal wave velocity of rock mass and rock, the influence of groundwater, the attitude influence of the main weak structural plane, uniaxial saturation compression of rock. The network was used to learn from a database of 48 collected surrounding rock cases in the research area, on which the PSO-BP surrounding rock classification prediction model was established and verified using eight validation samples. The PSO-BP model was then tested on a tunnel surrounding rock in the research area, and the 3D prediction model of surrounding rock of the tunnel was built according to the prediction results. The results showed that the 3D prediction model of tunnel surrounding rock based on the PSO-BP algorithm performed well in surrounding rock classification prediction. In addition, the model showed superior performance compared with BP model unoptimized, which underscores its utility in future surrounding rock classification prediction and 3D visualized modelling.