Biorefineries are designed to utilize a combination of various technologies to transform biomass derived raw materials into different valueadded products. This strategy has been highlighted in the literature for reducing waste, increasing profitability, and improving the process resilience to uncertain biomass feedstocks. In this work, a two-stage stochastic programming (TSSP) model is developed to maximize profit and minimize emissions under different sources of uncertainties. Data-driven surrogate models are built for biorefinery's flexibility index (FI) to quantify and improve its operational flexibility. The neural network with rectified linear unit (ReLU) activation function is established as the appropriate surrogate model because it closely approximates the flexibility index while retaining the mixed-integer linear characteristics of the overall design formulation. Moreover, the stochastic programming demonstrates the magnitude of environmental impact uncertainty quantitatively in each scenario using empirical price/demand/supply uncertainty information, which cannot be addressed by the traditional Pedigree-based life cycle assessment (LCA) uncertainty analysis.