Liang Yuan, Jiawei Yao, Yuxin Zhou, John Kaiser Calautit, Chenyu Huang, Zhicheng Fang, Feng Yang, Mosha Zhao, Yixi Wang, Xianluo Hu
Amid accelerating climate change, enhancing indoor and outdoor thermal comfort (IOTC) via passive design is critical, yet architectural-scale studies remain scarce. This study introduces an AI-driven framework combining a genetic algorithm (GA) and explainable machine learning to optimize spatial morphological parameters (SMPs) for three courtyard typologies (E-shape, C-shape, and enclosed). Using Rhino/Grasshopper for parametric modeling, Ladybug/Honeybee for thermal simulations, and Wallacei for multi-objective optimization, we evaluate 2,500 design variants against indoor Predicted Mean Vote (PMV) and outdoor Universal Thermal Climate Index (UTCI). The Pareto-optimal set reduces summer UTCI by 2.17–3.07 °C and PMV by 0.89–1.08, while increasing winter UTCI by 1.06–1.91 °C and PMV by 0.21–0.40. An ensemble of regressors identifies Extreme Gradient Boosting (XGBoost; R 2 ≥ 0.95) as optimal; Shapley Additive exPlanations (SHAP) highlight Form Factor Shape Coefficient (FSC), Building Shape Index (BSI), and Building Courtyard Ratio (BCR) as primary drivers—FSC > BSI > BCR for E−/C-shapes, and BCR > FSC > BSI for enclosed cases. Nonlinear SHAP-derived intervals ensuring seasonal comfort include FSC 0.25–0.26, BSI 90–100, BCR ≥1.7 (E-shape); FSC 0.18–0.22, BSI 30–33, BCR 0.8–1.3 (C-shape); and, for enclosed courtyards, BCR 1.8–4.0 with FSC ≤0.22 in summer or FSC ≤0.35 with BSI ≥300 and BCR ≥1.2 in winter. This passive optimization strategy significantly improves IOTC, lowers energy demand, and guides early-stage morphological decisions for low-carbon, healthy building retrofits.