arXiv:2611.00433cs.LGOct 2026

Manuscript Offprint

arXiv:2611.00433

Local Spatial TreeSHAP: Geographically Explainable AI Revealing Urbanization-Dependent Spatial Heterogeneity in Flood Resilience

Zeyu Zhao, Xiaoshan Zhou, Fanxin Meng, Dongping Fang, Helen X. H. Bao

Abstract

Urban flood resilience emerges from complex interactions among natural, built, and socio-economic systems, yet most recovery policies implicitly assume that resilience mechanisms are spatially uniform. To address this gap, this study develops a spatially explainable machine learning framework that integrates geographically weighted random forests with a novel Local Spatial TreeSHAP algorithm, enabling nonlinear resilience mechanisms to be identified and interpreted at the community scale. The framework is applied to 779 communities affected by the July 2023 extreme rainstorm in Beijing. Results reveal that resilience mechanisms exhibit substantially stronger spatial heterogeneity than the underlying physical and socio-economic conditions themselves, with SHAP-value spatial autocorrelation decreasing by 66.2% on average relative to predictor variables. This finding suggests that resilience is governed less by the absolute availability of resources than by the locally contingent ways in which those resources interact. Three distinct resilience regimes emerge across the urbanization gradient. Highly urbanized communities benefit from synergistic interactions among commercial infrastructure and accommodation services; transitional medium urbanized communities are constrained by infrastructure-development mismatches that create facility gaps despite continued urban expansion; and low urbanized communities are dominated by ecological and topographic thresholds, where adverse interactions between transportation and river-network structures undermine recovery capacity. Field investigations and interviews with 12 stakeholders corroborate these patterns. These findings challenge the spatial-uniformity assumption that underpins many existing disaster recovery frameworks and demonstrate that effective resilience governance requires mechanism-specific rather than indicator-specific interventions. By linking geographically weighted machine learning with locally grounded attribution analysis, the proposed framework provides a new pathway for uncovering spatially varying resilience mechanisms and translating them into place-based recovery strategies under increasing climate extremes.

Keywords: Urban resilience; Human needs; Spatial heterogeneity; Local TreeSHAP; Extreme rainstorms

1. INTRODUCTION

Flooding remains one of the most destructive natural hazards worldwide, posing persistent threats to human livelihoods, infrastructure systems, and economic development. The challenge has intensified in recent decades due to climate change, rapid urbanization, and increasing population exposure [1,2]. In China, flood disasters caused an average annual direct economic loss of approximately 224.5 billion yuan over the past decade [3]. Consequently, strengthening flood resilience has become a central objective of sustainable urban development and disaster risk reduction strategies [4]. However, as cities continue to expand, flood resilience is increasingly shaped by complex interactions among environmental conditions, urban infrastructure, and socioeconomic characteristics [5,6], making effective resilience planning a challenging task.

To support evidence-based decision making, a growing body of research has investigated the factors influencing flood resilience [7–9]. Existing studies generally highlight three categories of drivers: natural environmental conditions, built environment characteristics, and socioeconomic factors. Natural factors such as topography, hydrological conditions, and impervious surface coverage have consistently been identified as critical determinants of flood susceptibility and resilience[10–13]. Built environment characteristics, including land-use patterns, building functions, infrastructure provision, and drainage systems, have also been shown to substantially affect flood impacts and recovery capacity [14–16]. At the same time, socioeconomic conditions such as population characteristics, resource availability, fiscal capacity, and emergency support systems influence both preparedness and post-disaster recover [17,18]. Recent advances in machine learning and interpretable artificial intelligence have further enabled researchers to identify and quantify the relative importance of these factors, revealing important resilience mechanisms across different regions [11,19–21].

Despite these advances, important knowledge gaps remain regarding the mechanisms through which flood resilience drivers operate across urban systems. First, current spatial analyses largely focus on broad regional differences, i.e., contrasts between urban cores and peripheral areas [15,16], or comparisons across cities and provinces [22,23]. While they provide valuable insights into large-scale resilience disparities, substantial heterogeneity at the community level has been overlooked [24,25]. Communities located within the same urban zone, however, may differ considerably in environmental exposure, infrastructure provision, social vulnerability, leading to distinct resilience outcomes. Consequently, interventions that are effective in one setting may be ineffective or even counterproductive in another. For instance, impervious surface expansion that benefits drainage capacity in well-engineered urban cores may amplify flood risk in peri-urban communities that lack compensatory gray infrastructure. From a governance perspective, resilience investments should be guided not only by administrative equity but also by spatial effectiveness, recognizing that the benefits of resilience interventions vary across local environmental, infrastructural, and socioeconomic contexts [26,27].

Second, most studies implicitly assume resilience drivers exert linear and monotonic effects; however, urban systems are characterized by complex feedback mechanisms and threshold behaviors [28,29]. For example, urban densification often increase impervious surfaces and reduce ecosystem-based flood regulation, thereby increasing flood risks [30]. Yet higher urban density may simultaneously improve access to emergency services, infrastructure redundancy, and post-disaster accommodation capacity, potentially enhancing resilience under certain conditions. Such dual and potentially competing mechanisms suggest that resilience drivers cannot be adequately understood through linear or globally average relationships alone. The overall contribution of a given factor may change across different development stages, and critical thresholds may exist beyond which resilience effects shift direction or magnitude.

Third, the influence of a particular factor rarely occurs in isolation, but limited attention has been given to how natural, built, and socioeconomic factors jointly shape resilience outcomes. For instance, the effectiveness of drainage infrastructure may depend on local topography, while the benefits of urban development may vary according to existing social vulnerability and public service capacity. Nevertheless, most studies interpret results primarily based on feature importance rankings while paying little attention to interaction structures and contextual dependencies [13,16]. Even when such relationships are considered, existing research focuses on how resource can be prioritized at the community level during short-term post-disaster recovery periods [31–33]. This study, however, seeks to generate insights for long-term rebuilding and resilience enhancement, with the goal of strengthening community preparedness for future disturbances and informing real-world urban governance.

To address these knowledge gaps, this study builds upon recent advances in spatial machine learning for resilience assessment, such as geographically weighted random forests (GWRF) [34] and the Shapley Additive exPlanations (SHAP) approach [35], but addresses their limitation in geographically weighted SHAP studies of using global reference distributions when calculating feature contributions in the latest literature. While MGWR permits different processes to operate at different spatial scales [36,37],Geographical XGBoost extends this logic to gradient boosted trees [38–40], and GeoShapley treats geographic coordinates as a joint player in a model-agnostic Shapley games [41]. Their practice may introduce systematic bias in spatially heterogeneous contexts because communities should ideally be evaluated against locally relevant conditions rather than a global baseline. For example, communities located in mountainous regions should be compared with similar mountainous communities rather than highly urbanized areas, otherwise localized mechanisms may be obscured or overestimated.

To overcome this limitation, we develop a spatially explainable machine learning framework that integrates GWRF with a novel Local Spatial TreeSHAP approach. By replacing global reference distributions with geographically weighted local baselines, the proposed method enables more geographically meaningful attribution of feature contributions and improves the interpretation of resilience drivers in spatially heterogeneous environments. Beyond identifying key determinants, the framework systematically investigates nonlinear marginal effects, interaction mechanisms, and their variation along the urbanization gradient.

Empirically, the proposed framework is applied to the 2023 Beijing flood event, which affected 779 communities across diverse urban and peri-urban environments. Community-level perceived resilience data are integrated with multi-source environmental, infrastructural, and socioeconomic indicators. To further validate the data-driven findings, field interviews and post-disaster reports are incorporated to examine the consistency between model-derived explanations and practical governance experiences. By revealing how resilience drivers vary across different urbanization contexts and identifying critical nonlinear thresholds and interaction effects, this study aims to provide actionable evidence for community-scale resilience planning and long-term urban flood governance.