Introduction

Urban flooding—which occurs when rainfall overwhelms drainage capacity—is an increasingly pressing challenge for global cities, especially with the compounding effects of climate change1,2. The primary causes of flooding include rapid urbanization, which increases impervious surfaces and reduces natural absorption, as well as inadequate drainage infrastructure that struggles to handle intense precipitation3. These conditions are further exacerbated by climate change, which drives more frequent rainfall events and alters storm patterns4.

The impacts of urban flooding are extensive, causing personal injuries, significant property damage, and disruptions to essential urban infrastructure such as transportation, healthcare, and water services5. These consequences pose substantial barriers to achieving the Sustainable Development Goals (SDGs), notably SDG 11.5 and 13.1, for resilient actions to combat climate change6,7,8. This study spares time on building risk caused by urban flooding and explores potential coping measures.

Previous studies focus on the direct impacts of flooding on building structures and the resulting economic losses9,10,11. However, research on the disruption of building functions (or functional disruptions for short) caused by flooding and its socio-economic implications remains relatively limited5,12. These oversights may underestimate the long-term socio-economic impacts of flooding6, misallocate resources, exacerbate societal burdens in the aftermath of floods11, and hinder the rapid recovery of critical facilities, such as hospitals and shelters, during floods13,14.

In the field of flood risk management and disaster reduction, physically-based models remain a predominant approach for simulating the physical processes contributing to flooding, such as rainfall, runoff, and infiltration. These models are grounded in the fundamental principles of hydrology and physics, offering detailed simulations that enhance our understanding of flood dynamics. Common examples include the MIKE Flood Model, PCSWMM 2D, and HEC-RAS. While these models are highly effective for understanding flood events, they require extensive calibration data and substantial computational resources, which can limit their applicability in regions with inadequate data infrastructure, particularly in developing countries15,16. Furthermore, these models are not well-suited for flood susceptibility modeling in large-scale regions17,18.

Machine learning (ML) methods, on the other hand, are emerging as a promising alternative in flood risk management and disaster reduction19,20. Unlike physically-based models, ML approaches leverage algorithms to automatically learn patterns from historical data, such as rainfall, land use, and flood records21. Popular Algorithms like Random Forest (RF)22,23, Support Vector Machines (SVM)24,25, and CatBoost26,27 are widely applied to predict flood susceptibility. Specifically, previous studies have shown that the RF performs better than methods like LightGBM, Artificial Neural Networks (ANN), and SVM in flood susceptibility mapping16,28.

Rivals of these ML models are the Deep Learning (DL) methods. For example, Convolutional Neural Networks (CNNs) and Recurrent Neural Networks (RNNs) are commonly used in flood susceptibility analysis. The drawbacks of these DL methods include significant computational power, massive historical data, and the complexity of multiple hyperparameters16. These limitations make DL techniques less practical in scenarios where data and computational resources are constrained.

Considering the resource-intensive nature of DL methods and the practical constraints in the analyzed case, this study relies on ML techniques. They offer a balanced solution with limited data availability, combining efficiency and reliability without the need for extensive datasets or complex architectures.

In China, the use of machine learning in flood risk and disaster management research has grown significantly29,30,31. One research area is to testify the performance of single and hybrid ML models in the flood susceptibility analysis. For instance, Yao et al. (2022) compared six ML models (linear regression, K-nearest neighbors, support vector machine, random forest, stacking ensemble models, and blending ensemble models), and used them to evaluate the flash flood susceptibility in Jiangxi32. Another prominent direction involves using new data sources to improve flood susceptibility mapping, addressing the limitations of sparse and insufficient flood inventory data from historical records and field surveys. Li et al. (2023) addressed data scarcity issues in Chengdu by leveraging Sina Weibo data, which allowed for urban flood susceptibility assessment and monitoring33. Fang et al. (2022) incorporated the simulation results of the hydrodynamic model (HEC-HMS/RAS) and rapid flood model (Height Above the Nearest Drainage, HAND) into the RF model to enhance the training and validation procedures for the flood susceptibility assessment of Xinluo watershed18.

Despite these attempts in ML techniques, studies exploring the broader applications of flood susceptibility mapping remain limited in China. Some global studies have utilized susceptibility maps to assess flood risk for critical infrastructures. For instance, Yousefi et al. (2020) and Pourghasemi et al., (2021) evaluated the flood risk to schools and other infrastructures in Iran34,35. Nkeki et al. (2022) examined the urban infrastructural susceptibility of bridges and culverts, road networks, and buildings in Nigeria36. Similarly, Ruiz and Rajib (2022) developed a flood susceptibility index for critical infrastructure in US cities37. In this context, our research seeks to bridge this gap by exploring building flood risk based on susceptibility maps, offering a Chinese case study.

Guangzhou is a deltaic megacity, long been severely affected by flooding, which not only poses a threat to the safety of its residents but also creates ongoing challenges for infrastructure and economic development4,38,39. Although various policy innovations have been implemented since 2000, including the extensive promotion of green infrastructure and the enhancement of urban drainage systems40,41, the importance of building functionality has consistently been overlooked. This phenomenon is common across most cities in China. The findings of this research enrich the knowledge on how different urban elements contribute to city resilience, and how adaptation strategies are designed42,43,44.

Results

Multicollinearity analysis and sensitivity analysis

Figure 1 shows the pairwise correlations between flood conditioning features. The Pearson coefficients for all tested features are under the threshold of 0.8. It indicates that all flood conditioning features are independent, thereby further utilizing the RF model for the FSM.

Fig. 1: The pairwise correlation heatmap of the flood conditioning features.
figure 1

Values range from –1 (strong negative correlation) to +1 (strong positive correlation), with red representing positive correlation and blue indicating negative correlation.

For sensitivity analysis, we used feature importance from the RF model to evaluate the influence of various factors on flooding (Fig. 2). Land use and land cover, NDVI, and distance from roads emerge as the most influential factors. In contrast, features such as elevation, building density (NDBI), and distance from culverts and interchanges exhibit moderate influence. Other features, including distance to rivers, slope, plan curvature, and annual average daily rainfall, show comparatively low feature importance.

Fig. 2
figure 2

Flood conditioning features importance.

Figure 3 illustrates the cumulative variance explained by the first 15 principal components (PCs) derived from the PCA process. It demonstrates that the first 15 principal components cumulatively explain over 80% of the variance in the original dataset, ensuring that these components effectively capture the most significant information.

Fig. 3
figure 3

Cumulative variance explained by first 15 PCA components of building function identification features.

The sensitivity analysis of the CatBoost model was conducted using the feature importance derived from the principal components (PCs). Figure 4 displays the feature importance of the 15 principal components (PCs) as used by the CatBoost model for classifying building functions. The x-axis represents the feature importance score, while the y-axis lists the 15 PCs. PC1, PC2, and PC3 are the most important components, with feature importance scores exceeding 8. These PCs capture the dominant patterns in the data and are crucial for accurately identifying building functions. PC4, PC5, and PC6 show moderate importance, with scores between 5 and 7. These components contribute secondary but still significant information for the model’s predictions. PC10 through PC15 have relatively lower importance, with scores below 4. These PCs account for minor patterns in the data that have a limited impact on the model’s performance.

Fig. 4
figure 4

Feature importance of the PCA components for building function identification.

Urban Flood Susceptibility

Figure 5 presents the distinct spatial distribution of flood susceptibility in Guangzhou across the urban fabrics (resolution: 100 m × 100 m). The “Very High” susceptibility zones are predominantly situated in Guangzhou’s central urban districts, such as Liwan, Yuexiu, Tianhe, Haizhu, and Baiyun districts. The “High” and “Moderate” susceptibility areas are commonly aligned with major road networks. In contrast, the “Low” and “Very low” susceptibility regions are mainly found in Guangzhou’s peripheral northern and eastern districts, such as the Conghua and Zengcheng districts.

Fig. 5
figure 5

The urban flood susceptibility map of Guangzhou (resolution: 100 m × 100 m).

Table 1 shows the area and percentage of each urban flood susceptibility level. A significant 61.45% of the area falls within the “Very Low” susceptibility category, demonstrating areas that are least likely to experience urban flooding under normal circumstances. The “Low” and “Moderate” categories encompass 12.39% and 9.13% of the area, respectively, indicating regions where flood probabilities are present but less extensive. Notably, the “High” and “Very High” susceptibility levels, while comprising just over 8.51% and 8.52%, respectively.

Table 1 The distinction of urban flood susceptibility

“Very High” susceptibility districts are characterized by their dense urban development and substantial population clusters, which can exacerbate the risk and consequences of flooding events. This linear distribution of “Moderate” susceptibility areas along thoroughfares could be indicative of the areas where water tends to accumulate during heavy rainfall, due to the impervious surfaces and possible inadequacies in drainage systems. The “Low” and “Very low” areas are characterized by less intensive development and lower population densities and might benefit from natural drainage basins and more permeable land surfaces, which would reduce flood susceptibility.

Building function vulnerability

Figure 6 presents the map of building functions in Guangzhou. Table 2 provides statistics on the number and proportion of buildings for each function and each function vulnerability. The “Low Vulnerability” category includes 637,966 commercial buildings, accounting for 35.64% of the total, 55,491 industrial buildings, comprising 3.10%, and 1211 cultural buildings, which represent 0.07%. The combined sum for this category is 694,668 buildings, making up 38.81% of the total. Residential buildings fall under the “Moderate Vulnerability” category, with a total count of 1,077,961, representing the largest proportion at 60.22%. The “High Vulnerability” category includes 552 public service buildings (0.03%), 3057 healthcare buildings (0.17%), and 13,903 educational buildings (0.85%). The total count for “High Vulnerability” buildings is 17,512, which constitutes 0.98% of the total.

Fig. 6
figure 6

Building function classification and spatial distribution in Guangzhou.

Table 2 The statistics of building function and function vulnerability

Figure 7 shows the result of building function vulnerability. Figure 8 shows the proportion of buildings of each level of function vulnerability in each district. The spatial distribution of building function vulnerability reveals significant variations across Guangzhou’s districts. Low-vulnerability buildings account for the majority in districts like Yuexiu (64.75%), Liwan (64.67%), and Baiyun (54.66%). Moderate vulnerability buildings (primarily residential buildings) are most prevalent in suburban and less urbanized areas, such as Conghua (83.66%), Nansha (70.62%), and Zengcheng (70.26%). High-vulnerability buildings, including hospitals, schools, and other essential public infrastructure, are rare across all districts, with slightly higher concentrations in Tianhe (4.32%) and Yuexiu (4.10%). These districts may host a greater number of critical public facilities, increasing their vulnerability to flood impacts.

Fig. 7
figure 7

Spatial distribution of building function vulnerability levels in Guangzhou.

Fig. 8
figure 8

The proportion of buildings of each level of function vulnerability in each district.

Building flood risk

Figure 9 shows the result of building flood risk. The flood risk levels of buildings are determined using the natural breaks method. This method seeks to minimize the variance within classes and maximize the variance between classes. Table 3 describes the statistical results of building flood risk. Buildings falling under the “Very Low” and “Low” risk categories account for 13.66% and 24.16%, respectively. This suggests that most buildings are situated in low susceptibility zones or designed with less vulnerable functions. Conversely, the “Very High” risk categories encompass 15.99% of the total buildings. These buildings are likely in flood-prone locations or perform functions critical enough that even minor flooding could result in substantial consequences.

Fig. 9
figure 9

The building flood risk map.

Table 3 The statistical results on building flood risk

Figure 10 shows the percentage of buildings in each flood risk class at the district level. Districts such as Conghua, Nansha, and Zengcheng have a significant proportion of buildings in the very low and low-risk categories (Fig. 10a and b). For instance, Conghua has 34.38% of its buildings in the very low-risk category and 26.44% in the low-risk category, making a combined total of over 60%. Similarly, Zengcheng has 25.80% of buildings at very low risk and 27.22% at low risk, indicating a lower overall flood risk in these districts.

Fig. 10: Proportion of buildings at each flood risk levels across districts in Guangzhou.
figure 10

Radar charts show the proportion of buildings under five flood risk levels across 11 administrative districts in Guangzhou: very low risk (a), low risk (b), moderate risk (c), high risk (d), and very high risk (e). Values on each axis represent the percentage of buildings at that specific risk level within the total buildings in each district. Line colors correspond to the five risk levels, ranging from light yellow (very low) to dark red (very high).

The proportion of moderate-risk buildings is highest in Yuexiu and Liwan (Fig. 10c), accounting for 56.83% and 55.07%, respectively. Districts like Haizhu, Tianhe, and Panyu exhibit higher proportions of buildings in the high and very high-risk categories (Fig. 10e and f). Haizhu stands out with 36.28% of its buildings categorized as very high risk and an additional 10.45% at high risk. Tianhe also shows a considerable proportion of high-risk buildings, with 15.13% at high risk and 30.87% at very high risk. Panyu has 19.67% of its buildings at high risk and 30.61% at very high risk.

This study categorizes Guangzhou’s districts into three types based on the flood susceptibility and functional vulnerability of buildings at very high and high risk. These types are central urban districts (Type I), intermediate urban districts (Type II), and suburban/rural districts (Type III) (Fig. 11). The primary distinction among these types lies in the flood susceptibility range where moderate and high function vulnerability are concentrated. In central urban districts (Tianhe, Liwan, Yuexiu, Haizhu), buildings exhibit the highest flood susceptibility, with values concentrated in the 0.9–1.0 range. Intermediate urban districts (Baiyun, Huangpu, Panyu) show a broader flood susceptibility range, from 0.7 to 0.9, where buildings with moderate to high functional vulnerability face similar levels of risk. In suburban and rural districts (Nansha, Conghua, Huadu, Zengcheng), flood susceptibility is moderate, with values primarily concentrated in the 0.6–0.8 range.

Fig. 11
figure 11

Function Vulnerability and Urban Flood Susceptibility Violin Plot of High and Very High-Risk Buildings in Each District.

Validation

The RF model for urban flood susceptibility mapping demonstrates high accuracy, with a score of 0.9132, further validation through the ROC curve, and an AUC value of 0.9494, as depicted in Fig. 12a. The training accuracy is 0.9627. The 5-fold cross-validation scores for the model are as follows: 0.9179, 0.9254, 0.9254, 0.8731, 0.9328, with a mean cross-validation accuracy of 0.9149. Given these metrics, we assess the model’s predictive performance as adequate for the intended application.

Fig. 12: ROC curves for flood susceptibility mapping and building function identification.
figure 12

a ROC curve showing the classification performance of the flood susceptibility model on the testing dataset. b ROC curves for each class in the building function identification model, including commercial, residential, industrial, and educational categories.

The CatBoost model for building function identification shows relatively high accuracy, with a score of 0.8561. The ROC curves and AUC values for each class are shown in Fig. 12b. The accuracy is as follows: commercial class 0.8333, residential class 0.8595, industrial class 0.8451, and educational class 0.8455. The training accuracy is 0.9320. The 5-fold cross-validation scores for the model are as follows: 0.9235 0.9239, 0.9242, 0.9248, 0.9230, with a mean cross-validation accuracy of 0.9239. This suggests that the model is well-generalized and does not exhibit significant overfitting. We randomly sampled the identified building functions and compared them with satellite imagery and Baidu Street View observations. The analysis revealed a strong alignment between the predicted functions and the actual building uses (Supplementary Table 3).

Discussion

We propose some measures for high-risk and very high-risk buildings, incorporating four strategies: avoidance, resistance, resilience, and reparability12,45,46 (Table 4). Avoidance focuses on reducing exposure by situating buildings in low-risk zones, elevating structures, or employing physical barriers. Resistance emphasizes measures to prevent floodwater from entering buildings, such as installing flood doors and barriers or using waterproof materials. Resilience aims to mitigate long-term damages by incorporating features that facilitate quick drying, cleaning, and re-occupancy while maintaining structural stability. Reparability, as a subset of resilience, highlights the importance of designing elements that are easy to repair or replace, such as modular fixtures or sacrificial finishes.

Table 4 The recommended strategies for high-risk and very high-risk buildings based on Bowker et al. (2007), Tagg et al. (2016), and Meng et al. (2020)

This study makes significant contributions to the existing literature on urban flood risk assessment and aligns directly with the goals of Sustainable Development Goals (SDGs) 11.5 and 13.1, which emphasize reducing the adverse impacts of natural disasters and enhancing adaptive capacity to climate-related hazards. By adopting Random Forest (RF) and CatBoost models for urban flood analysis, the study broadens the application of machine learning (ML) techniques in building flood risk modeling. It is considered as a field where applications remain relatively limited21,47,48.

A notable innovation in this study is the development of a novel approach to defining non-flooded points for the RF model. Specifically, non-flooded points are identified as those beyond the three-quarter mark of the shortest distances between all pairs of flooded points. This criterion significantly enhances model performance (Table 5). This methodological improvement addresses key challenges in flood susceptibility modeling and sets a new standard for similar analyses.

Table 5 Model Performance Comparison

In terms of building function identification, previous studies have often relied on urban land-use data or street-view imagery to infer functions49,50. While Point of Interest (POI) and Area of Interest (AOI) data have been explored, their full potential remains untapped. Existing research has primarily integrated POI, AOI, and building geometry with morphology to infer building functions51,52. This study expands the utilization of POI and AOI data by employing the CatBoost model to infer building functions, particularly in areas where POI and AOI data are sparse.

Additionally, this study advances the understanding of building vulnerability grading in China by drawing inspiration from the United Kingdom. Traditionally, building vulnerability classifications in China have primarily focused on structural and material performance during earthquakes53. To address the gap in flood-related vulnerability assessments, this research adapts and integrates the UK’s National Planning Policy Framework54, using its highest standards as a reference to assign vulnerability values.

The proposed methodology is adaptable to other cities. For the flood susceptibility model, the method for defining non-flooded points can be directly applied in cities with flood records. For building function identification, the integration of POI and AOI data provides a practical framework, as many cities have access to similar datasets or can leverage publicly available resources.

Two points should be cautious in the broader applicability of this methodology. First, flood records may introduce systematic bias, as they are typically obtained from official monitoring stations that are often unevenly distributed. These stations are usually concentrated in urban centers, with limited coverage in suburban or rural areas. Future studies could address this limitation by incorporating additional data sources, such as news reports or social media. Second, feature selection requires local knowledge, including specific building usage patterns, which may vary significantly across different cities.

One limitation of this study lies in the methodology. It includes technical validation and field-based verification. Field validation involved randomly sampling building functions and comparing them with satellite imagery and Baidu Street View. However, the availability of street view data limited the scope of validation, which may leave some uncertainty.

Future research could explore several directions to further advance this study. One promising avenue is to investigate the performance of alternative models, such as deep learning techniques, in flood susceptibility mapping and building function identification, to evaluate their potential advantages and limitations compared to traditional machine learning methods. Additionally, incorporating socioeconomic indicators, such as income levels, housing quality, accessibility to services, and coping capacity metrics, could enhance the comprehensiveness of building function vulnerability models. Another critical area for exploration is the integration of future climate scenarios by including projections of land use and rainfall patterns, enabling more dynamic and time-sensitive flood risk evaluations. Finally, expanding validation efforts by conducting method validation across multiple cities with diverse urban and environmental contexts, supplemented with field-based validation, could improve the robustness and generalizability of the proposed approach.

To conclude, this paper examines building flood risk through the lens of machine learning models and explores how these assessments can inform effective risk management strategies. It provides a comprehensive evaluation of flood risk in Guangzhou by integrating urban floodsusceptibility with building function vulnerability. Leveraging machine learning modelsincluding Random Forest (RF) and CatBoost, the study combines flood records,hydrological and topographical features, human activities, building footprints, and AOl andPOl data to deliver a nuanced analysis of building flood risk.

Key findings from this research offer several important insights for urban flood risk management: (1) The analysis shows significant spatial differences in flood susceptibility across Guangzhou. Central districts, with their high population density and intensive development, exhibit “Very High” flood susceptibility, while peripheral districts generally show “Very Low” susceptibility. (2) The study also reveals that most buildings fall into the moderate function vulnerability category, with less than 2% classified as highly vulnerable. (3) Based on the flood susceptibility and function vulnerability of very high and high-risk buildings, Guangzhou districts are categorized into three types: Type I (central urban districts) with the highest flood susceptibility (0.9–1.0), Type II (intermediate urban districts) with a broader range (0.7–0.9), and Type III (suburban/rural districts) with moderate susceptibility (0.6–0.8). The distinction among these types lies in the susceptibility range where moderate to high function vulnerability is concentrated.

These findings underscore the importance of tailored flood risk management strategies that address the distinct susceptibility and function vulnerability of buildings. By providing urban planners and policymakers with a deeper understanding of the building flood risk, this research equips them with the tools needed to effectively mitigate water-related hazards, particularly in the face of challenges intensified by climate change.

Methods

Study area

Guangzhou is the capital of south China’s Guangdong Province, P. R. China (Fig. 13), with a total terrestrial area of about 7434.40 km2 and over 15 million population. Guangzhou consists of 11 districts: Tianhe, Yuexiu, Haizhu, Baiyun, Huangpu, Liwan, Panyu, Huadu, Nansha, Conghua, and Zengcheng districts. Situated in the subtropical monsoon climate zone, Guangzhou experiences an average annual precipitation ranging from 1673.0 mm to 2004.6 mm. The city’s rainfall is unevenly distributed throughout the year, with about 80% primarily occurring from April to September. Furthermore, Guangzhou averages around 150 precipitation days annually.

Fig. 13
figure 13

Study area.

Rapid urbanization in Guangzhou has significantly increased flood risk due to changes in land use, strained drainage systems, and high population density55,56. The expansion of impervious surfaces, such as roads and buildings, has reduced natural water absorption, leading to greater surface runoff during heavy rainfall57. This, combined with the reduction of green spaces and wetlands, intensifies the city’s vulnerability to flooding58. The rapid growth has also outpaced the capacity of existing drainage infrastructure, which is often outdated and insufficient for managing increased runoff59. Additionally, the city’s dense population heightens exposure and complicates emergency response efforts, as more people are concentrated in flood-prone areas60. Vulnerable communities, particularly those in informal or substandard housing, face amplified risks due to inadequate infrastructure and limited resources61.

Guangzhou is confronting a significant risk of urban flooding62,63. On 8 September 2023, Guangzhou experienced an extraordinary rainstorm, remarkable for its intense downpour and broad impact. The intense rainfall in Guangzhou led to severe waterlogging across various areas, resulting in the temporary closure of Shiqiao Station on Metro Line 3 in Panyu District due to deep water accumulation. In response to the rainstorm warning, several districts in Guangzhou suspended school classes. According to the city’s flood, drought, and typhoon control headquarters, a total of 2516 people had been evacuated from hazardous zones in Guangzhou64.

Research design

Building flood risk is calculated by a function of urban flood susceptibility and building function vulnerability65,66,67,68. This study consists of three steps: (1) mapping urban flood susceptibility, (2) assessing building function vulnerability, and (3) measuring building flood risk (Fig. 14).

Fig. 14
figure 14

Step-wise methodological framework of the study.

Urban flood susceptibility mapping

Fig. 15
figure 15

Flood inventory map of Guangzhou.

  1. (1)

    Ubran Flood Inventory Map Generation: Flood inventory plays a critical role in understanding flood susceptibility by providing a comprehensive database of past flood events, including their locations and causes. Recent studies emphasize that accurate flood inventories are essential for developing reliable flood susceptibility models, as they serve as training datasets for machine learning algorithms21,69. The urban flood inventory list of Guangzhou is provided by the Guangzhou Emergency Management Bureau. The original list contained 488 records, but some were duplicates or no longer relevant due to infrastructure development, thus leaving 479 records of waterlogging after the cleanup. Duplicates were removed by geocoding the flooded points to obtain their geographic coordinates. Points with identical locations were identified and duplicates were deleted. The original format of the list is an Excel spreadsheet, which includes fields such as the name of the waterlogged (inundation) sites, type, and risk level. The ___location of the flooded records is performed through geographic coding based on the names of these waterlogged sites.

    Additionally, an equal number of non-flooded sites is selected. We establish buffer zones around flood points by calculating the nearest neighbor distances between them and selecting the 3/4 quartile for the buffer’s extent. Non-flooded points are required to not only fall outside these buffers but also be located in areas of higher elevation. Figure 15 shows the flood-recorded and non-flooded points in the study area. Of these sites, 70% are randomly chosen for model training, while the remaining 30% are allocated for testing the model70.

  2. (2)

    Feature selection: This study incorporates 15 features from hydrological, topographical, and anthropogenic perspectives71,72,73. For example, higher annual average daily precipitation increases water input, raising flood risk, while areas closer to rivers are more prone to flooding due to overflow. Steeper slopes reduce flood susceptibility by promoting runoff, whereas lower elevations are more vulnerable to water pooling. Urban land use increases susceptibility through impervious surfaces, while vegetative land use mitigates it by absorbing water. Proximity to roads further contributes to flooding by reducing infiltration and altering water flow. Pearson correlation coefficients (PCC) are calculated to avoid multicollinearity in the selected features74. The PCC between two sets of samples \({A}_{i}\,\)(i = 1, 2, 3,…, n) and \({B}_{i}\)(i = 1, 2, 3,…, n) can be represented as Eq. (1):

    $$PCC=\frac{{\sum }_{i=1}^{n}({a}_{i}-\overline{a}){\sum }_{i=1}^{n}({b}_{i}-\overline{b})}{\sqrt{{\sum }_{i=1}^{n}{({a}_{i}-\overline{b})}^{2}{\sum }_{i=1}^{n}{({b}_{i}-\overline{b})}^{2}}}$$
    (1)

    where \({a}_{i}\) and \({b}_{i}\) are variable values for \({A}_{i}\) and \({B}_{i}\), \(\mathop{a}\limits^{\bar{} }\) and \(\mathop{b}\limits^{\bar{} }\) are the average of \({A}_{i}\) and \({B}_{i}\), respectively. A Pearson coefficient approaching 1 signifies a strong positive correlation between two features, while a coefficient near 0 suggests their independence. Previous studies indicated that the absolute value of a Pearson coefficient of more than 0.8 may contribute to collinearity75,76,77.

  3. (3)

    Mapping the Urban Flood Susceptibility based on the Random Forest (RF): The RF model is an ensemble machine learning method that combines multiple decision trees to improve prediction accuracy78. It uses a process called bagging (bootstrap aggregation), where random subsets of data are used to build each tree. This reduces overfitting and enhances model robustness. The RF model is also capable of handling complex, non-linear relationships and identifying key factors influencing flood susceptibility, such as topography, land use, and rainfall intensity.

    The RF has been widely applied in flood susceptibility mapping due to its high accuracy and ability to process large-scale, heterogeneous data72,79,80,81. It is particularly effective for large-scale analyses, such as national or regional assessments23,29,82. Therefore, this study adopts the RF model to map urban flood susceptibility.

    The training data, comprising flood conditioning features, is input into the Random Forest (RF) model, and its performance is evaluated using the test data. To optimize the model and mitigate overfitting, a GridSearchCV approach with 5-fold stratified cross-validation is employed. The hyperparameters of the Random Forest model were optimized using grid search to achieve the best performance. The final configuration included 75 trees (n_estimators), a maximum tree depth of 10 (max_depth), a minimum of 5 samples required to split a node (min_samples_split), and at least 3 samples per leaf node (min_samples_leaf). The max_features parameter was set to sqrt, ensuring a balance between computational efficiency and model accuracy. Once the model’s performance meets the required standards, the study area of Guangzhou is divided into a 100 m × 100 m grid, with center points extracted alongside their corresponding flood conditioning features. These data points are then input into the trained RF model to generate probability outputs, which are subsequently interpolated using the Inverse Distance Weighting (IDW) method to produce a flood susceptibility map for the entire study area.

  4. (4)

    Validation of the Urban Flood Susceptibility Model: The performance of the RF model is evaluated through the accuracy, the receiver operating characteristic (ROC) curve, and the area under the ROC curve (AUC). Accuracy is the ratio of correctly predicted samples to all samples. True positive (TP) and false positive (FP) denote the count of actual flood-recorded and non-flooded points, respectively, that are predicted as flooded points. True negative (TN) and false negative (FN) denote the count of actual flood-recorded and non-flooded points predicted as non-flooded points. Notably, the TP and the TN represent correctly predicted samples. We employed the accuracy (as defined in Eq. (2) to evaluate the predictive performance of the RF model.

$$Accuracy=\frac{TP+TN}{TP+TN+FP+FN}$$
(2)

The ROC curve and the AUC are regarded as some of the best indicators for model assessment83. The ROC curve plots the model’s ratio of correctly predicted pixels (True Positive Rate (TPR) known as sensitivity, Eq. (3)) against the ratio of incorrectly predicted pixels (False Positive Rate (FPR) known as 1-sensitivity, Eq. (4)).

$$TPR=\frac{TP}{TP+FN}$$
(3)
$$FPR=1-\frac{TN}{FP+TN}$$
(4)

The range of the AUC is between 0.5 (poor predictive ability) and 1 (the highest accuracy and reliability). Values greater than 0.8 typically indicate very good model performance84.

Building Function Vulnerability Assessment

Building function vulnerability assessment includes identifying building functions and classifying their vulnerability. This study proposes a CatBoost model for building function identification using building footprints, Points of Interest (POI) data, and Areas of Interest (AOI) data. Catboost uses ordered boosting and permutation-driven techniques to mitigate prediction shift and overfitting, making it particularly effective for handling categorical features85. Using CatBoost in building function identification is an exploratory attempt. The function vulnerability is classified according to the UK’s National Planning Policy Framework (Supplementary Table 1)54, which has been recognized as an effective standard by other researchers11. The detailed processes are listed as follows:

Table 6 Labeled data
Table 7 Building function identification features
Table 8 Building function vulnerability
  1. (1)

    Data Preparation: Building footprints are categorized based on spatial relationships with AOIs and POIs into labeled and unlabeled datasets. AOI and POI data are partly validated against satellite imagery and Baidu Street View (Supplementary Table 2). We reclass the AOIs and POIs data into seven categories, including residential AOIs and POIs, industrial AOIs and POIs, educational AOIs and POIs, commercial POIs, cultural POIs, and public services POIs. It is observed that commercial POIs constituted the largest number and proportion, but most are small businesses, making it difficult to determine the primary function of the buildings. Therefore, POIs are classified into two categories: those with low importance but high density (commercial and industrial), and those with high importance but low density (residential, healthcare, public facilities, education, and cultural)52. If a building contains only the former type of POIs, its function is determined by these POIs. Otherwise, the function is determined by the latter type of POI. Labeled data are presented in Table 6. Due to weak labels inferred from AOI and POI, unsupervised noise reduction is applied49. Labeled data is split into training and test datasets in a 7:3 ratio.

  2. (2)

    Feature Processing: We select twenty-two features across three categories: urban function structure, building geometry, and building surroundings (Table 7). The urban function structure is described using POI kernel density estimation86,87. The building geometry is referenced by Lin et al. (2021). To describe building surroundings, we use the nearest distance to each category of POI. Missing values are handled using the K-nearest neighbors (KNN) method. After standardization, polynomial processing (degree = 2) is first used to enhance the feature set by capturing nonlinear interactions and higher-order relationships. Then PCA is applied to reduce the feature space to 15 components, preserving over 80% of the variance while ensuring computational efficiency and reducing overfitting88.

  3. (3)

    Resampling: To address the imbalanced sample distribution (Table 6), Adaptive Synthetic Sampling Method (ADASYN) resampling is used to balance the training set. ADASYN, proposed by He et al. (2008), generates synthetic data points for minority classes, improving the classifier’s performance on imbalanced datasets by focusing more on difficult-to-classify examples89,90.

  4. (4)

    Model Training and Evaluation: Due to the low number of buildings with public, healthcare, and cultural functions, and based on the assumption that AOIs and POIs can initially identify these, only residential, commercial, educational, and industrial functions are considered during model training. The Categorical Boosting (CatBoost) model, a gradient boosting algorithm, employs ordered boosting to minimize overfitting and reduce prediction bias, ensuring accurate and reliable results85. Additionally, CatBoost is computationally efficient and well-suited for datasets with mixed numerical and categorical variables. Using CatBoost model in building function identification is an exploratory attempt.

    A balanced training dataset is utilized to train the CatBoost model. To improve robustness and prevent overfitting, key hyperparameters such as iterations (1500), learning rate (0.01), L2 regularization (18), and depth (12) were adjusted. A 5-fold stratified cross-validation is also used to validate model performance. Model performance is validated using the test set with the accuracy of each function.

  5. (5)

    Function Classification and vulnerability assessment: The trained Catboost model is used to predict the functions of unlabeled building footprint data. We referenced the UK’s National Planning Policy Framework (NPPF) (Supplementary Table 1), which classifies flood vulnerability based on use and facility. This classification is based partly on the need for some functions to be maintained during flooding such as hospitals and police stations. Then we assigned vulnerability values of 3 to “highly vulnerable” functions, 2 to “more vulnerable” functions, and 1 to “less vulnerable” functions (Table 8). The building function vulnerability results are aggregated by districts for urban management, urban planning, and policy-making.

Building Flood Risk Measuring

In this study, we draw upon the risk matrix to reinterpret risk as the likelihood of a disaster occurring and the potential impact it may have91. The risk matrix is a tool extensively used in natural disaster risk assessment and project risk management92. The Eq. (5) shows the function of the risk matrix.

This research attempts to incorporate the urban flood susceptibility model and building function vulnerability into the risk matrix, thereby extending its practical applications. During the assessment process, “urban flood susceptibility” denotes the likelihood of the flood hazard29,72,93,94, while “function vulnerability” of buildings signifies the impact of flood11,54.

Building flood risk is calculated using Eq. (6). We extract the urban flood susceptibility of each building and multiply it by the function vulnerability. This methodological approach enables a nuanced assessment of risk by integrating both the ___location-specific susceptibility to flooding and the inherent vulnerability determined by the building functions. The building flood risk results are summarized by districts to support urban management, urban planning, and policy-making.

$$Risk=Likelihood\times Impact$$
(5)
$$Risk\,=\,Urban\,Flood\,Susceptibility\times Function\,Vulnerability$$
(6)

Urban flood conditioning features

This study selected 15 features from hydrological, topographical, and anthropogenic perspectives to input into the RF model71,72,73. The hydrological features include the stream power index (SPI), annual average daily precipitation (AP), distance from rivers (DRI), and hydrological soil groups (HSGs). Topographical factors include elevation (EV), slope (SL), topographic wetness index (TWI), convergence index (CI), plan curvature (PLC), and profile curvature (PRC). The anthropogenic factors included in the analysis are distance from roads (DRO), distance from culverts and interchanges (DCI), land use and land cover (LULC), the normalized difference vegetation index (NDVI), and the normalized difference built-up index (NDBI). A detailed description of urban flood conditioning features is shown in Table 9 below and Supplementary Figs. 1, 2, and 3.

Table 9 Urban flood conditioning features

Building function identification features

The building footprint dataset is adopted from Shi et al. (2024)., which is identified based on Google Earth imagery, global urban boundaries, and local climate zones, using a Boundary-enhanced network95. The average recall and precision rates were 84.52% and 81.06%, respectively. Samples of buildings in Guangzhou are shown in Fig. 16. The total number of buildings in Guangzhou is 1,790,141 after data cleaning.

Fig. 16: Samples of building footprints in central and peripheral areas of Guangzhou.
figure 16

Satellite image of a central urban area in Guangzhou (a) and extracted building footprints corresponding to the same central area (b). Satellite image of peripheral area in Guangzhou (c) and extracted building footprints to the same peripheral area (d).

The building function identification features are listed in Table 10. The urban function structure features contain the kernel density estimation (KDE) of residential POI, cultural POI, educational POI, industrial POI, healthcare POI, commercial POI, and public service POI. The building geometry contains area, perimeter, regularity, height, compactness, number of nodes, aspect ratio orientation, and radius shape index of buildings. The building surroundings include the distance from buildings to the nearest residential POI, cultural POI, educational POI, industrial POI, healthcare POI, commercial POI, and public service POI. AOI and POI data are obtained from the Baidu Map and are validated by comparing satellite imagery and Baidu Street View (Supplementary Table 2). All procedures are operated on ArcGIS 10.8 or Python programming.

Table 10 Data sources and processing of building function identification features