The increasing demand for cement-based composites (CBCs) due to the advancement of infrastructure causes the exhaustion of natural materials and environmental pollution. Also, dumping industrial and agro-derived waste materials in landfills has negative impacts. Therefore, producing waste-derived CBCs by partially replacing cement and sand will be a favourable approach. Since CBCs' performance degrades when exposed to hazardous substances, their efficacy in a hostile environment is the key concern. This work utilised new computing methods to estimate the reduction in compressive strength (CS) of eggshell and glass powder-modified cement mortar (EG-CM) exposed to acidic conditions. Machine learning-based methods, including gene expression programming (GEP), decision tree (DT), multilayer perceptron neural network (MLPNN), and support vector machine (SVM), were employed. In addition, to examine the effectiveness of eggshell and glass powder for acid resistance, the SHapley Additive exPlanations (SHAP) approach was used. The built models exhibited good prediction performance for evaluating the loss in CS of EG-CM after the acid attack. SVM was noted to be the most accurate predictor with the highest R2 and least errors. SVM, DT, MLPNN, and GEP yielded results with R2 values of 0.88, 0.87, 0.85, and 0.85, respectively. The mean absolute percentage error for MLPNN was 17.9%, GEP was 15.5%, DT was 15.0%, and SVM was 10.6%. These error evaluations further confirmed the SVM's greater accuracy compared to other models. The SHAP study showed that glass powder was the most important element for EG-CM's resistance to CS loss after an acid attack, followed by 90-day CS, eggshell powder, cement, sand, silica fume water, and superplasticiser.