To improve the accuracy of coal spontaneous combustion prediction, a prediction model fusing IWOA and LightGBM was proposed. Firstly, the correlation between the concentration of indicator gases in the coal spontaneous combustion program heating test was analyzed using SPSS 27, and KPCA was used to extract principal component data. Then, in response to the problem of traditional whale optimization algorithm (WOA) easily falling into local optima, Circle chaotic mapping, adaptive weights, and optimal domain perturbation strategy were introduced to improve its global search ability, and LightGBM hyperparameters were optimized to enhance prediction accuracy and suppress overfitting. Finally, the model was applied to the actual prediction scenario of Shajihai coal mine in Xinjiang. The results show that the IWOA-LightGBM model improves Ac in the test samples by 13.33%, 26.66%, 20%, 20%, and 13.33% compared to other models; Pr increases by 12.23%, 24.45%, 18.89%, 18.89%, and 12.23% respectively; Re values increase by 13.1%, 23.02%, 18.1%, 16.07%, and 10.56%, respectively; F1 improves by 12.56%, 23.79%, 18.52%, 17.58%, and 13.15%, respectively. On-site verification has shown the reliability and stability of the model under complex conditions, demonstrating better generalization and robustness than traditional models and providing a new technical solution for early warning of coal spontaneous combustion disasters in mines.