The accurate identification of the gas–liquid two-phase flow pattern within the impeller of a centrifugal pump is critical to develop a reliable model for predicting the gas–liquid two-phase performance of the centrifugal pump. The influences of the inlet gas volume fraction, the liquid phase flow rate and the pump rotational speed on the flow characteristics of the centrifugal pump were investigated experimentally. Four typical flow patterns in the impeller of the centrifugal pump, i.e., the bubble flow, the agglomerated bubble flow, the gas pocket flow and the segregated flow, were obtained, and the corresponding flow pattern maps were drawn. After oversampling based on the SMOTE algorithm, a four-layer artificial neural network model with two hidden layers was constructed. By selecting the appropriate network super parameters, including the neuron numbers in the hidden layer, the learning rate and the activation function, the different flow patterns in the centrifugal pump impeller were identified. The identification rate of the model increased from 89.91% to 94.88% when the original data was oversampled by the SMOTE algorithm. It is demonstrated that the SMOTE algorithm is an effective method to improve the accuracy of the artificial neural network model. In addition, the Kappa coefficient, the Macro-F1 and the Micro-F1 were 0.93, 0.95 and 0.95, respectively, indicating that the model established in this paper can well identify the flow pattern in the impeller of a centrifugal pump.