In order to ensure the safety of coal mine production, a mine water source identification model is proposed to improve the accuracy of mine water inrush source identification and effectively prevent water inrush accidents based on kernel principal component analysis (KPCA) and improved sparrow search algorithm (ISSA) optimized kernel extreme learning machine (KELM). Taking Zhaogezhuang mine as the research object, firstly, Na+, Ca2+, Mg2+, Cl-, SO2- 4 and HCO- 3 were selected as evaluation indexes, and their correlation was analyzed by SPSS27 software, with reducing the dimension of the original data by KPCA. Secondly, the Sine Chaotic Mapping, dynamic adaptive weights, and Cauchy Variation and Reverse Learning were introduced to improve the Sparrow Search Algorithm (SSA) to strengthen global search ability and stability. Meanwhile, the ISSA was used to optimize the kernel parameters and regularization coefficients in the KELM to establish a mine water inrush source discrimination model based on the KPCA-ISSA-KELM. Then, the mine water source data are input into the model for discrimination in compared with discrimination results of KPCA-SSA-KELM, KPCA-KELM, ISSA-KELM, SSA-KELM and KELM models. The results of the study show as follows: The discrimination results of the KPCA-ISSA-KELM model are in agreement with the actual results. Compared with the other models, the accuracy of the KPCA-ISSA-KELM model is improved by 8.33%, 12.5%, 4.17%, 21.83%, and 25%, respectively. Finally, when these models were applied to discriminate water sources in a coal mine in Shanxi, and the misjudgment rates of each model were 28.57%, 19.05%, 14.29%, 23.81%, 9.52% and 4.76%, respectively. From this, the KPCA-ISSA-KLEM model is the most accurate about discrimination and significantly better than other models in other evaluation indicators, verifying the universality and stability of the model. It can be effectively applied to the discrimination of inrush water sources in mines, providing important guarantees for mine safety production.