Abstract Accurate coal seam gas content assists in the effective prevention of coal and gas outburst accidents. To solve this problem, an IDBO-DHKELM coal seam gas content prediction model is proposed by combining improved Dung Beetle optimization algorithm (IDBO) with a deep hybrid kernel extreme learning machine (DHKELM). First, the index factors of the coupled gas content are determined according to the influence factors of coal seam gas content and the actual situation of mine production. The correlation of index factors is analyzed by SPSS 27 software via Pearson correlation coefficient matrix. Then, the principal components of the original data are extracted using the principal component analysis method (KPCA). Second, sine chaotic mapping, fusion improved sinusoidal algorithm, and fusion adaptive Gauss–Cauchy hybrid mutation perturbation are introduced to improve the Dung Beetle optimization algorithm (DBO) to enhance its global search capability. Third, IDBO is used to optimize the number of hidden layer nodes, regularization coefficient, penalty coefficient, and kernel parameter in DHKELM, which improves the prediction accuracy and further avoid the phenomenon of overfitting. Finally, the principal component extracted by KPCA is taken as the model’s input, and the gas content as the model’s output. The results are compared and analyzed with those of PSO-BPNN, GA-BPNN, PSO-SVM, and DPO-DHKELM models. The results demonstrate that the IDBO-DHKELM model’s performance is the best in each performance index. Compared with other models, the mean absolute error of test samples in the IDBO-DHKELM model is reduced by 0.402, 0.4407, 0.3554, and 0.0646, respectively. The mean absolute percentage error is decreased by 3.67%, 4.07%, 8.27%, and 6.35%, respectively. The root mean square error decreased by 0.7861, 0.7148, 0.3384, and 0.1186, respectively. The coefficient of determination (R 2) is increased by 0.1544, 0.1404, 0.0955, and 0.0396, respectively. Finally, the IDBO-DHKELM model and other models are applied to an experimental mine. The resulting IDBO-DHKELM model is the closest to the actual value, which further verifies the universality and reliability of the model. Therefore, the model is more suitable for the prediction of coal seam gas content.