A greenhouse gas emission prediction model of BP neural network optimized by particle swarm algorithm was established with engine torque, injection timing, injection pressure and natural gas substitute rate as the input parameters and CO
2 and CH4 greenhouse gas emissions as the output parameters based on the test data achieved under the conditions of 400, 800, 1 200 and 1 600 N·m at 1 500 r/min on diesel/natural gas dual fuel engine test bench. The prediction results of the model show that the coefficients of determination(R2) of CO2 and CH4 predictions on the test set are 0.997 62 and 0.998 09, the mean absolute percentage errors(MAPE) are 0.97% and 3.85%, and the model has good generalization ability and prediction accuracy. With the model, the mean influence value(MIV) algorithm is used to quantitatively analyze the influence of torque, injection timing, injection pressure and natural gas substitute rate on CO2 and CH4 emissions at 1 500 r/min. The results show that engine torque has a dominant effect on CO2and CH4 emissions with a contribution of 71.8% and 50.8% respectively. When engine torque is set at low load condition in the model, the natural gas substitute rate occupies the greatest weight in all influences of CO2 and CH4 emissions.