||Searching optimal evacuation path under toxic gas release incident is challenging work due to unpredictable gas dispersion with changing many variables surrounding the environment. Computational fluid dynamics can simulate and analyze the risk of different release scenarios. However, since CFD requires high computational load and time, it is not appropriate to be applied to a real-time response system. To ease the computation cost of CFD, a machine learning-based surrogate model which is composed of the variational autoencoder and deep convolutional neural network was developed for immediate prediction of local risk in geographic maps. The optimization model is formulated as mixed-integer linear programming to rapidly find the minimum risk path under different incident scenarios. Moreover, it can handle a time-varying system that reflects the risk predicted from the surrogate model under different time windows. The result shows that the risk-based optimized route would be a better safe way than the shortest path to the shelter. The developed model also enables further sensitivity analysis between variables and provides specific insight into the construction of safety facilities.