Plasma vertical displacement control is essential for the stable operation of tokamak devices. The traditional plasma vertical displacement calculation method is not suitable for balancing speed and accuracy simultaneously, which is necessary for real-time feedback control. In this study, neural networks are used to rapidly detect vertical displacement recognition. Based on a fully connected neural network, the vertical displacement calculation model is trained and tested using magnetic data of approximately 2000 shots. To compare the effects of different inputs on vertical displacement calculation, different magnetic measurement diagnostic signals are used to train and test the model. Compared with a full magnetic measurement dataset, 39 magnetic measurement signals (38 magnetic probes and plasma current) show better accuracy with mean square error <0.0005. The model is tested using historical experimental data, and it demonstrates accurate vertical displacement calculation even in the case of a vertical displacement event. In general, neural network algorithm has great application potential in vertical displacement calculation.