Intelligent monitoring and control of harmful gas in a coal mine is an important aspect of the building on intelligent and green mine. It is a hot spot of artificial intelligence research in the coal mine to study the new technology of dynamic prediction of harmful gas by using artificial intelligence, big data and other interdisciplinary fusion methods, and gradually replace the artificial monitoring work. By researching the gas diffusion theory and the characteristics of the coal mine environment, this paper uses the Gaussian plume model to simulate the gas diffusion law of coal mine roadway, and puts forward a gas prediction model optimized by genetic algorithm and BP neural network. The algorithm takes the absolute error between the predicted output of gas source term and the field measured value as the peculiar fitness value and optimizes it. The results show that the optimized BP neural network can obtain the best concentration prediction value for short time and a small error. Compared with the traditional gas prediction method in coal mine, this method has the advantages of small calculation amount and high prediction accuracy, and it can improve the reliability of the model by continuous machine learning combined with daily monitoring, which provides a new technical solution for the intelligent detection of environmental information in coal mine roadway.