Gas accumulation is the primary cause of explosions in underground mines, and preventing it requires effective gas detection. To address this, we propose an approach combining machine learning (ML) and density functional theory (DFT) for designing nanoscale gas sensors. Our study demonstrates that a back-propagation neural network (BPNN) model, optimized with suitable hyperparameters, achieves high accuracy with an R 2 (coefficient of determination) of 0.92 and a low RMSE (root-meansquare error) of 0.24 in predicting the substrate material formed by transition metal (TM)-doped Mo 2 C and its interaction with key gas molecules (CO, H 2 S, CH 4 , and C 2 H 6 ). Based on these interaction strengths, we have analyzed the materials in more depth. Additionally, we find that certain features directly affect the increase or decrease of interaction strengths within a specific range, providing insights that contribute to the design of more efficient nanoscale sensors.