In this work, four mainstream machine learning (ML) techniques are used to evaluate the bulk porosity and static elastic modulus of weathered Yungang Grottoes sandstone. Datasets are gathered from the experiments, which includes 432 groups effective experimental data including 8 inputs features. bulk porosity and static elastic modulus were considered as outputs to determine the weathering degrees of Yungang Grottoes sandstone. The 4 performance criteria were used to evaluate the ML models. Results demonstrate that the Artificial Neural Network (ANN) is the best-fitted models for estimating the bulk porosity and static elastic modulus compared to Multiple Linear Regression (MLR), Support Vector Regression (SVR), Gaussian Process Regression (GPR). The accuracy of the trained model for static elastic modulus is slightly higher than that of bulk porosity. The GPR and ANN model can accurately predict the bulk porosity and static elastic modulus in training stages. The ANN with multi-hidden layers developed is competent with high degree of precision and generalization ability for bulk porosity and static elastic modulus compared to other selected regression-based ML models (MLR, SVR, and GPR). The coefficient of determinations of ANN in the range of (0.9537–0.9641) during the testing stages is more stable and higher than that of (0.8883–0.9453) other built ML models. The prediction efficiency of pretrained ANN model was well adjusted for the actual and forecast datasets at the training and testing stages, and the error range was no more than 0.7% and 0.15 GPa at both stages of prediction for bulk porosity and static elastic modulus respectively. And the ANN based static elastic modulus prediction model’s error proportions significantly decreased and were confined to a modest range between + 10% and − 10%. The proposed surrogate models are valid for the bulk porosity ranging from 7 to 14% and the static elastic modulus ranging from 0.7 to 1.4 Gpa, which can be utilized for the accurate and fast prediction of the weathering degrees of Yungang Grottoes sandstone.