Article

September 29, 2026

Interpretation of drivers associated with the occurrence of floods through explainable artificial intelligence

Interpretation of Drivers Associated with the Occurrence of Floods through Explainable Artificial Intelligence

Abderraman Róger de Amorim Brandão; Wagner Wilson Bortoletto

DOI: 10.22167/2675-6528-202602619

Article derived from a Course Conclusion Work (TCC), with content based on the student’s original work and adapted to the editorial format of the E&S Magazine with the support of the ResumeAI tool, an artificial intelligence solution developed by Instituto Pecege for textual synthesis and organization.

Summary

Flood events in Brazil have intensified, but their factors are still difficult to generalize due to regional contrasts and nonlinear interactions. The study characterized the spatio-temporal distribution of flood events in Brazilian river basins and evaluated the ability of a Random Forest (RF) model to detect days associated with these events based on antecedent hydrometeorological conditions. The research covered 735 basins in the period from 1980 to 2010. Events were identified in daily flow series, using a basin-specific threshold (50th percentile of annual maximums) and a minimum interval of 10 days between peaks. The RF model was trained with dynamic predictors and interpreted with TreeSHAP. The results indicated seasonal differences between biomes, with a higher concentration of events in certain months in the Amazon, Cerrado, Caatinga, and Atlantic Forest, and a more uniform distribution in the Pampa. In the test set, the model achieved a PR-AUC of 0.41, ROC-AUC of 0.96, F1 of 0.35, and balanced accuracy of 0.86. SHAP analyses highlighted the accumulated climatic water balance (P – ETP) and accumulated precipitation in windows of 14 to 60 days as the main predictors. These patterns were compatible with the influence of antecedent conditions but did not establish causal relationships.

Keywords: Antecedent conditions; Large sample hydrology; Random Forest; Hydrological simulation; XAI.

1. Introduction

In Brazil, extreme hydrological events, such as floods, have become more frequent and intense in recent decades, affecting different regions of the country. In the Amazon, for example, an expansion of floodable areas has been observed (Fleischmann et al., 2023; Silva et al., 2023), while the South recorded extreme floods in 2023 and 2024 (Alvalá et al., 2024; Collischonn et al., 2025), with 340 municipalities in a state of emergency (ANA, 2024). Similar occurrences have been documented in the Northeast (Seigerman et al., 2024; Santos et al., 2024), the Center-West (Marengo et al., 2022), and the Southeast. In the state of São Paulo, an average of 73 events per year were recorded in the 2010s (Brandão et al., 2026).

The intensification of these extreme hydrological events poses significant challenges, especially in a country with great dependence on water resources, where 49% of electricity is of hydroelectric origin, irrigation accounts for 50% of water withdrawals, and urban supply for 23.34% (ANA, 2024). Globally, disasters associated with weather, climate, and water caused more than two million deaths and losses of US$ 3.64 trillion between 1970 and 2019, with floods accounting for 44% of these events (WMO, 2021). In Brazil, reported losses in this period totaled US$ 41.7 billion (WMO, 2021). More recently, between 2020 and 2024, 771.75 thousand people were reported affected by floods, with material damages of R$ 3.68 billion and public and private losses exceeding R$ 9 billion (Brasil, 2026). These data reinforce the urgency in understanding the factors associated with floods.

The occurrence of floods results from the complex interaction between atmospheric processes and the physical characteristics of river basins (Sharma et al., 2018; Livneh et al., 2024). The isolated analysis of precipitation, by itself, is often insufficient to represent the contribution of antecedent conditions and nonlinear interactions that modulate the hydrological response of basins. The difficulty in generalizing flood drivers on a national scale, due to strong regional contrasts and nonlinear interactions between climate and hydrological response, represents a significant gap in knowledge and predictive capability.

In this context, machine learning (ML) emerges as a promising tool to represent complex relationships between multiple predictors and support the investigation of patterns associated with extremes (Reichstein et al., 2019; Nearing et al., 2024). However, ML models, such as tree ensembles, can present decisions that are difficult to inspect (Baehrens et al., 2010; Lundberg & Lee, 2017). Explainable artificial intelligence (XAI), through techniques like SHapley Additive exPlanations (SHAP), allows for local and global interpretations of predictions (Lundberg & Lee, 2017), helping to relate input features to model outputs more transparently and to engage with physical knowledge. This approach is fundamental to overcoming the limitations of traditional physics-based models, which, despite being well-founded, do not always produce accurate predictions and are computationally intensive and difficult to generalize (Nearing et al., 2021; Zounemat-Kermani et al., 2021).

Given the increasing frequency and impact of floods in Brazil and the complexity of their drivers, this study is justified by the need to deepen the understanding of the spatio-temporal patterns of these events and by the application of advanced machine learning and XAI methods to identify their predictors. The objective of this study was to characterize the spatio-temporal distribution of fluvial flood events, defined by a flow exceedance criterion, in Brazilian river basins. The ability of a Random Forest (RF) model to detect days associated with these events from hydrometeorological variables was also evaluated. Finally, we sought to identify, through SHAP, the predictors that contributed most to the classifications, with an emphasis on the hydrological interpretation of the learned patterns.

2. Material and Methods

The methodology of this study was structured in three main stages: data organization and identification of flood events, development of the machine learning model, and finally, evaluation and interpretation of the results. This flow guided the research from the preparation of the database to the final analysis of the model.

The study covered 735 Brazilian hydrographic basins, distributed across different biomes and hydroclimatic conditions, with a predominance of tropical climate A (Beck et al., 2018). The CABra dataset — Catchment Attributes for Brazil (Almagro et al., 2021) provided daily flow series from the National Water and Basic Sanitation Agency (ANA) and hydroclimatic information from various sources, including physical and hydrological attributes, for the period from 1980 to 2010.

River flood events were identified from daily discharge series. An event was defined when the daily discharge exceeded a specific threshold for each basin, established as the 50th percentile of annual maxima (Brunner et al., 2020; Götte & Brunner, 2024). A minimum interval of ten days between successive peaks was adopted for event separation (Diederen et al., 2019). For the daily classifier, event days were labeled as 1 and others as 0.

The development of the machine learning model used a Random Forest (RF) classifier (Breiman, 2001; James et al., 2023). The model was built with 39 dynamic hydroclimatic predictors, calculated to represent the antecedent conditions to floods. These predictors included accumulated precipitation over different time windows, sums of actual and potential evapotranspiration, daily climatic water balance and its accumulations, as well as moving averages of temperature, humidity, wind speed, and solar radiation. The month and day of the year were included for seasonality.

From the initial 39 predictors, 15 with the lowest global contributions, measured by the average of absolute SHAP values in an exploratory model, were excluded, resulting in 24 variables for the final model. The RF hyperparameters were evaluated by RandomizedSearchCV (Bergstra & Bengio, 2012), testing 50 random configurations with cross-validation in three partitions and grouping by basin (GroupKFold). The average precision (AP) was the selection criterion.

The final configuration of the RF model consisted of 603 trees, entropy criterion, maximum depth of 40, square root of the number of attributes per split, minimum of 11 samples per leaf and 20 samples for node splitting, with `balanced_subsample` weighting and `bootstrap` sampling. To handle class imbalance, the training set included all positive examples and a random sampling of negatives per basin, limited to up to 20 negatives per positive, an `undersample` strategy.

The separation between the training and testing sets was performed by watershed, using the GroupShuffleSplit method. 588 watersheds (80%) were allocated for model development and 147 watersheds (20%) for evaluation on watersheds not used in training, preventing days from the same watershed from appearing simultaneously in both sets.

The contribution of the predictors was interpreted with SHapley Additive exPlanations (SHAP), an explainable artificial intelligence (XAI) approach (Lundberg & Lee, 2017; Lundberg et al., 2020). TreeSHAP was used to calculate Shapley values, employing the `tree-path-dependent` approach. SHAP values were calculated from a stratified sample of the 147 test basins, with up to 200 event days and 400 non-event days per basin, and a global limit of 5,000 observations. The global importance of each predictor was calculated by the mean of its absolute SHAP values.

The classifier’s performance was evaluated on the test set using metrics appropriate for binary classification in an imbalanced context: ROC-AUC, PR-AUC, F1-score, and balanced accuracy (BA). PR-AUC was the primary metric due to the low prevalence of positive days (Saito & Rehmsmeier, 2015). Threshold-dependent metrics were calculated with a value of 0.5 for converting probabilities into binary classes. Precision, sensitivity, F1-score, and balanced accuracy were defined according to their standard formulations in classification problems.

3. Results and Discussion

The investigation of river flood patterns in Brazilian watersheds revealed a complex dynamic, influenced by spatio-temporal factors and antecedent hydrometeorological conditions. The initial analysis of flood events, identified by a threshold of excess daily flow, demonstrated an episodic nature. It was observed that most years in the period from 1980 to 2010 presented low or moderate event counts, around 5,000 occurrences, punctuated by peak years with approximately 20,000 records in some biomes. This temporal variability underscores the non-stationarity of extreme events, a crucial aspect for water resource planning and management in Brazil.

The spatial distribution of flood events highlighted the heterogeneity of the monitoring network and the intrinsic characteristics of each biome. The Atlantic Forest and the Cerrado concentrated the largest number of basins in the sample, with 371 and 219 basins, respectively, followed by the Amazon (78 basins) and Caatinga (50 basins). The Pampa, with 16 basins, and the Pantanal, with only one, showed less representation. This disparity in data coverage is an important factor to consider in the interpretation of the results, as it may limit the generalization of patterns to less represented biomes, such as the Pantanal.

The seasonality of flood events showed distinct patterns among biomes. In the Amazon, Cerrado, Caatinga, and Atlantic Forest, events were concentrated in the months of December to April or May, with a notable reduction during the winter period. This behavior is consistent with regional differences in flood seasonality, as pointed out by Bartiko et al. (2019). In contrast, the Pampa exhibited a more uniform distribution of events throughout the year, which aligns with the absence of a well-defined dry season in this region. In the Cerrado, the frequency of events decreased more rapidly throughout the year, which can be attributed to both the greater depth of the rocky basement and the strong seasonal concentration of rainfall.

The analysis of peak flows revealed that the Amazon presented a greater dispersion of values, while the Pantanal, with its single basin in the sample, registered high peaks. It is fundamental to consider that these differences in peak flows are influenced by the drainage area and the size of the rivers, and do not necessarily indicate variations in the relative intensity of floods between the biomes. The interpretation of this data must, therefore, take into account the geomorphological and hydrological characteristics of each basin, which modulate the hydrological response to precipitation events.

Regarding the predictive capability of the Random Forest (RF) model to detect days associated with flood events, the overall performance on the external test set was evaluated by specific metrics for imbalanced binary classification problems. The prevalence of positive days in the test set was 1.49%, indicating the rarity of the events. In this scenario, the area under the Precision-Recall curve (PR-AUC) reached 0.41, a value approximately 27.4 times higher than the random baseline, demonstrating the model’s relevance for rare classes (Saito & Rehmsmeier, 2015).

Complementarily, the area under the Receiver Operating Characteristic curve (ROC-AUC) was 0.96, suggesting a good relative class ordering capability by the model. However, the F1 score of 0.35 and the balanced accuracy of 0.86, calculated with a threshold of 0.5, indicate that although the model is effective in discrimination, the balance between precision and sensitivity still presents limitations at this threshold. This performance difference is expected, given the highly unbalanced and temporally explicit nature of the flood classification problem, compared to spatial susceptibility studies that often use balanced samples.

In comparative terms, the PR-AUC of 0.41 obtained in this study is at the lower limit of values reported in other applications of RF models for classifying floodable areas or flood susceptibility. For example, studies in Kunming (Ren et al., 2024), Salzburg (Nachappa et al., 2020), the Peneus basin (Tepetidis et al., 2025), and the eastern Brazilian Amazon (Amaral et al., 2024) reported AUC values between 0.87 and 0.99. However, this comparison should be made with caution, as most of these works focused on the spatial classification of flooded points or pixels, often with balanced samples, unlike the present study which addresses the detection of rare events in a temporal context.

The spatial variability of the model’s performance, measured by PR-AUC per basin, was predominantly moderate, with most values concentrated between 0.3 and 0.6. It was observed that some of the highest PR-AUC values occurred in the Northeast, while intermediate and low performances were distributed across other regions. The relationship between the event rate per basin and PR-AUC revealed a positive trend: basins with a higher frequency of events tended to show higher PR-AUC values. In contrast, basins with very rare events exhibited greater dispersion and lower metric values, reflecting the intrinsic difficulty of learning in minority classes and the greater instability of the metric in this context.

The interpretation of the contribution of predictors through SHapley Additive exPlanations (SHAP) was crucial for understanding the model’s behavior. Global importance analyses highlighted that the greatest contributions were associated with predictors accumulated over windows of 14 to 60 days. In particular, the accumulated climatic water balance (P – ETP) and accumulated precipitation were the most influential predictors. The climatic water balance, which represents the difference between precipitation and potential evapotranspirative demand, acts as an indirect indicator of antecedent conditions, although it does not directly measure soil moisture or water storage in the basin.

This pattern of predictor importance is consistent with the hydrological literature, which emphasizes the joint contribution of precipitation and antecedent conditions to flood generation (Sharma et al., 2018; Livneh et al., 2024). Basin aridity has also been recognized as a central parameter in modulating hydrological processes (Almagro et al., 2024; Brandão et al., 2025; Correa et al., 2025). The results obtained refine this interpretation by highlighting that the “basin memory”, represented by accumulated hydrometeorological variables in different time windows, is a significant component in flood prediction.

Thermoclimatic variables, such as the 30-day average minimum temperature, showed a less monotonic relationship with SHAP values, suggesting their influence is more indirect, reflecting effects of seasonality, precipitation, and evapotranspiration, as well as regional differences. This indicates that, while precipitation and water balance exert a more direct influence on flood occurrence, thermoclimatic variables act mainly as seasonal and regional conditioners, modulating the hydrological response of the basins.

The spatial distribution of the local importance of predictors also revealed regional contrasts. The 30- and 60-day accumulated precipitation and P – ETp were more important in the Northeast, Center-East, and Southeast. In contrast, the 7- and 14-day accumulated precipitation and P – ETp had greater relevance in parts of the South and Southeast. The 30-day average minimum temperature, in turn, showed a greater contribution in the South region. These regional patterns highlight the complexity of flood drivers and the need for approaches adapted to the specificities of each Brazilian region.

SHAP dependency plots for the most important variables revealed non-linear relationships between predictor values and their contributions to the model output. Low values of P – PET and accumulated precipitation in 7, 14, 30, and 60-day windows were generally associated with negative SHAP values, meaning they reduced the predicted probability of event occurrence. As these accumulations increased, contributions tended to become positive, raising the probability of flooding. This transition in contribution sign, where SHAP equals zero, represents a shift in the predictor’s influence relative to the model’s baseline, rather than a physical flood threshold.

This behavior is hydrologically coherent, as floods are the result of both recent rainfall and antecedent soil moisture conditions in the basin. The visual separation between points classified as events (concentrated in regions with positive SHAP) and non-events (more frequent in ranges with negative SHAP) reinforces the high discriminative power of these variables, especially for the 30- and 60-day accumulated P – ETP and precipitation. This suggests that the RF model effectively uses hydrological memory on weekly to monthly scales to identify patterns associated with flood occurrence.

Despite the relevance of the identified patterns, some limitations must be considered. The definition of flood events, based on the 50th percentile of annual maxima, influences the results, although previous studies indicate that the choice of thresholds affects absolute values more than dominant relative patterns (Brunner and Chartier-Rescan, 2024; Götte and Brunner, 2024). The absence of static attributes in the final model limits the direct representation of basin structural controls, which could enrich the understanding of hydrological processes.

The balancing strategy, which used all positive examples and a random sampling of negative examples per basin, was adequate to reduce information leakage between basins, but did not completely eliminate the challenges associated with the strong spatial heterogeneity of performance and the low prevalence of events in some test basins. Furthermore, the SHAP-based interpretation, while useful for describing model behavior, should not be interpreted as direct causal evidence, as correlations between predictors can influence the distribution of contributions.

No formal tests for temporal or spatial autocorrelation were performed, meaning that the possible dependence between consecutive days and between neighboring or hydrologically connected basins remains a limitation. The heterogeneity of the sample, especially the presence of only one basin in the Pantanal, limits the extrapolation of observed patterns to the entire territory of each biome. These aspects highlight the need for future research that addresses these dependencies, incorporates static attributes, and evaluates explicit forecasting horizons.

In summary, this study characterized the spatio-temporal distribution of riverine flood events in Brazil and demonstrated the capability of the Random Forest model in detecting them based on antecedent hydrometeorological conditions. The results indicated seasonal differences between biomes and highlighted the accumulated climatic water balance and accumulated precipitation in 14- to 60-day windows as the most important predictors. These findings are consistent with the influence of basin hydrological memory on the classifications, providing valuable insights into the patterns associated with floods, despite the inherent limitations of the hydrological system’s complexity and the nature of the data.

4. Conclusion

This study aimed to characterize the spatio-temporal distribution of riverine flood events in Brazilian river basins and to evaluate the capacity of a Random Forest (RF) model to detect them from hydrometeorological variables, in addition to identifying the most relevant predictors through SHAP. It was found that flood events exhibited an episodic nature and distinct seasonal patterns among biomes, with a higher concentration in certain months in the Amazon, Cerrado, Caatinga, and Atlantic Forest, and a more uniform distribution in the Pampa. The RF model demonstrated good discriminative capacity on the test set, with PR-AUC of 0.41 and ROC-AUC of 0.96, indicating its relevance for detecting rare classes. SHAP analyses highlighted the accumulated climatic water balance (P – ETP) and accumulated precipitation in 14- to 60-day windows as the most influential predictors, revealing non-linear and hydrologically coherent relationships that emphasize basin memory. The main contribution lies in the in-depth understanding of patterns associated with floods on a national scale and in demonstrating the applicability of explainable artificial intelligence methods to interpret the influence of antecedent conditions.

Despite the advances, the study presented limitations, such as the dependence of the results on the definition of the flood threshold and the absence of static attributes in the final model, which could represent structural controls of the basins. The strong spatial heterogeneity of the model’s performance and the low prevalence of events in some test basins also posed challenges, and the interpretation based on SHAP should not be considered direct causal evidence. For future studies, it is suggested to evaluate temporal and spatial autocorrelation, incorporate static attributes, and explore different definitions of events and prediction horizons. It is also recommended to compare the RF model with Long Short-Term Memory (LSTM) networks to assess the gain of sequential representation, maintaining data consistency and evaluation metrics.

Bibliographic References

Agência Nacional De Águas E Saneamento Básico – ANA (Brasil). Conjuntura dos recursos hídricos no Brasil 2024

Alvalá, S. R. C., Ribeiro, D. F., Marengo, J. A., Seluchi, M. E., Gonçalves, D. A., da Silva, L. A., … & Saito, S. M. (2024). Analysis of the hydrological disaster occurred in the state of Rio Grande do Sul, Brazil in September 2023: vulnerabilities and risk management capabilities. International Journal of Disaster Risk Reduction, 110, 104645.

Collischonn, W., Fan, F. M., Possantti, I., Dornelles, F., Paiva, R., Medeiros, M. S., … & Piccilli, D. G. A. (2025). The exceptional hydrological disaster of April-May 2024 in southern Brazil. RBRH, 30, e1.

Fleischmann, A. S., Papa, F., Hamilton, S. K., Fassoni-Andrade, A., Wongchuig, S., Espinoza, J. C., … & Collischonn, W. (2023). Increased floodplain inundation in the Amazon since 1980. Environmental Research Letters, 18(3), 034024.

Silva et al., 2023 [Full reference not found in the original document]

Article originating from the Final Course Project of the Specialization in Data Science and Analytics of the MBA USP/Esalq

To learn more about the course, click here and access the MBX Academy platform

You may also like

Economy, Investments And Banking

October 23, 2026

Financial Education, Behaviors and Biases in Financial Decision Making

Personal financial management represents a growing challenge, influenced by cognitive biases that affect decision-making, even in individuals with high knowledge. The present study analyzed the relationship between the level of financial education and the occurrence of behavioral biases in the financial decision-making of adults residing in Brazil. An applied, quantitative, and descriptive-correlational field survey was conducted by administering a structured questionnaire to 163 respondents. The instrument included sociodemographic variables, financial knowledge and habits, and hypothetical situations to identify cognitive biases. The results indicated that higher levels of financial education were associated with better financial control, saving, and investment practices, with significant correlations with income and schooling. However, the presence of behavioral biases (anchoring, loss aversion, scarcity, optimism/negativity, present bias, status quo, overconfidence, and mental accounting) persisted even among individuals with higher schooling and income, with no statistically significant association with the analyzed sociodemographic variables. It was concluded that financial education, although essential for financial organization and control, was not sufficient to neutralize the influence of cognitive biases. The incorporation of behavioral approaches into financial education programs is suggested.

Keywords: Financial behavior; Behavioral economics; Personal finance; Cognitive heuristics; Cognitive biases.

October 22, 2026

Consumer Journey in the Decision to Purchase Infoproducts in the Digital Environment

The expansion of e-commerce and technological transformation have driven the need to understand consumer behavior regarding infoproducts, whose perceived experience has become crucial for professional development. The study aimed to analyze the factors that influenced the purchase decision of infoproducts in the digital environment, considering the stages of the consumer journey. An applied, quantitative, and descriptive research was conducted through a field survey with 100 consumers from Serra Gaúcha. Data collection occurred via a structured questionnaire, using non-probabilistic sampling. The results revealed a qualified audience with strong “mobile-first” behavior. It was found that the availability of detailed information and social approval were the main attraction triggers in the pre-purchase phase. In the transactional and subsequent stages, the minimization of operational friction, the agility of immediate access, and system security proved crucial for conversion and satisfaction, although gaps in human support efficiency were identified. Retention was based on the trust generated by positive past experiences, overcoming the price factor. It was concluded that the infoproduct consumer journey operates as an integrated system, requiring alignment between technological infrastructure, content curation, and support humanization to ensure engagement.

Keywords: E-commerce; Consumer behavior; Consumer experience; Loyalty; Virtual business.

October 22, 2026

Forecast of Aggregate Default in the Brazilian Financial System by Sarimax Model with Macroeconomic Variables

Aggregate non-payment in the Brazilian financial system is a crucial indicator of credit risk, the prediction of which is regulated by CMN Resolutions n.° 4.557/2017 and 4.966/2021 for the prospective measurement of expected losses. Aggregate non-payment was modeled and predicted using the SARIMAX model, projecting its trajectory until December 2026 under optimistic, base, and pessimistic scenarios. 164 monthly observations (July/2012 to February/2026) and macroeconomic variables such as unemployment, Selic, IPCA, IBC-Br, and household debt were used. The specification with contemporaneous variables was selected based on information criteria and coefficient stability, and residual diagnostics confirmed statistical adequacy, with a MAPE of 3.12%. Historical non-payment ranged between 4.33% and 7.64%. The estimation identified unemployment (β = 0.2534; p < 0.001) and Selic (β = 0.2128; p < 0.001) as the main positive determinants, with strong temporal persistence (AR(1) = 0.8965). Selic showed increasing correlation with non-payment (r = 0.62 at lag 12), while unemployment demonstrated a contemporaneous effect (r = 0.33). Projections indicated non-payment between 6.30% and 7.98% in December 2026, with a range of 1.68 percentage points, highlighting direct implications for provisioning in financial institutions.

Keywords: Unemployment; Predictive modeling; Monetary policy; Loss provisioning; Time series.