Transparent energy optimization in near-zero energy mosques: integrating passive design, photovoltaics, and explainable AI in hot-arid climates

Mosques represent a significant yet underexplored public building typology in hot-arid regions, characterized by high cooling demand, intermittent occupancy, and limited renewable energy integration. This study develops an integrated and explainable framework combining passive envelope retrofits, rooftop photovoltaic (PV) systems, and Explainable Artificial Intelligence (XAI) to optimize mosque energy performance in Saudi Arabia. Field measurements from six mosques in Najran (114-237 m2) were used to characterize energy consumption patterns and identify dominant influencing parameters. A representative mosque (Firas bin Habis) was modelled using DesignBuilder/EnergyPlus and calibrated against measured data, achieving less than 5% deviation. The proposed retrofit package, comprising 5 cm XPS wall insulation, 5 cm EPS roof insulation, double-glazed windows, and a 34.4 kWp rooftop PV system, reduced cooling demand by approximately 25% and generated a 59% annual energy surplus. Economic analysis indicated a payback period of 9.4 years, while large-scale deployment across Saudi mosques could reduce national CO2 emissions by up to 725,000 tons annually. XAI analyses (LIME, SHAP, permutation importance, and correlation) identified occupancy rate, lighting power density, number of split airconditioning units, building area, construction year, and ambient temperature as the primary drivers of energy use. Sensitivity analysis further confirmed the dominant influence of envelope insulation and occupancy behavior. The study provides a transparent, data-driven decision-support framework to guide designers, policymakers, and religious authorities toward near-zero-energy mosque retrofits aligned with Saudi Vision 2030.