October 16, 2026
High precipitation forecast in Rio Grande do Sul for the prevention of hydrometeorological disasters
High Precipitation Forecast in Rio Grande do Sul for Prevention of Hydrometeorological Disasters
Priscila Resende Nascimento; Abdoulaye Mohamed
DOI: 10.22167/2675-6528-202603366
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
In April 2024, Rio Grande do Sul faced the greatest climate tragedy in its history, highlighting the need to improve strategies for forecasting and preventing hydrometeorological disasters. The study aimed to develop a predictive model based on Long Short-Term Memory (LSTM) neural networks to classify high precipitation events in the state. Historical data from the National Institute of Meteorology (INMET) between 2013 and 2025, collected from 44 automatic weather stations, were used. The methodology included variable selection by the Random Forest algorithm, which identified total hourly precipitation and dew point temperature as the features with the highest predictive power, and modeling with a two-layer LSTM architecture, trained with SMOTE application for handling class imbalance. The model achieved an AUC-ROC of 0.9373 and a recall of 82.4% for extreme events, defined as precipitation above the 95th percentile of the historical distribution (8.60 mm/hour). The capacity to identify the vast majority of high precipitation occurrences in advance was demonstrated, confirming the viability of using LSTM neural networks for forecasting extreme hydrometeorological events. The work offers potential contributions to climate monitoring systems and public policies for natural disaster prevention in Brazil.
Keywords: Hydrometeorological disasters; LSTM; Extreme precipitation; Artificial Neural Networks; Rio Grande do Sul.
1. Introduction
Extreme weather events have become increasingly frequent and intense on a global scale, highlighting the need to improve systems for forecasting, preventing, and responding to natural disasters (IPCC, 2023). Rio Grande do Sul, a state located in a humid subtropical climate region according to the Köppen-Geiger classification (Peel et al., 2007), historically presents a relatively regular rainfall pattern throughout the year. However, the magnitude of the disaster that occurred in 2024 surpassed all previous records, including significant events in 1941 and 2023, marking the greatest climate tragedy in its history.
Climatic and structural factors contributed to the severity of this event, with the El Niño phenomenon intensifying precipitation in the South Region of Brazil (INMET, 2024; INPE, 2024). By the end of April 2024, the climate calamity had affected 478 out of 497 municipalities in Rio Grande do Sul, corresponding to 96.2% of the total, with the greatest impacts concentrated in the Central, Vales, Serra, and Metropolitan regions of Porto Alegre (G1, 2025).
The tragedy resulted in 184 confirmed deaths and 25 missing persons, in addition to affecting approximately 2.4 million people, of whom nearly 200,000 were displaced or homeless (INMET, 2025). Financial losses reached the sum of R$ 801 million, according to a survey by the Porto Alegre City Hall (2024). In just three days of rain, the National Institute for Space Research (INPE, 2024) recorded a precipitation accumulation of over 600 mm in some areas, and above 400 mm in a large part of the state, configuring one of the most intense hydrometeorological episodes in the country’s recent history.
Given the complexity of this scenario and the difficulty of predicting events of such magnitude with traditional methods, Artificial Neural Networks (ANNs) emerge as a promising approach for modeling climatic phenomena. According to Cruz et al. (2010), neural network models offer an advantageous alternative to conventional methods in forecasting hydrometeorological time series. This is because they dispense with prior physical-mathematical knowledge of the complex nonlinear relationships that describe the phenomenon, allowing the model itself to learn these patterns directly from the available historical data.
In particular, Long Short-Term Memory (LSTM) networks are especially suitable for time series analysis, as they have the capacity to capture long-term dependencies between variables over time (Hochreiter and Schmidhuber, 1997). This characteristic is fundamental for modeling climatic patterns, where the evolution of atmospheric variables over extended periods influences the occurrence of extreme events. The application of predictive models based on LSTM can, therefore, provide early support for preventive actions and strategic decisions in public policies, mitigating the impacts of future hydrometeorological disasters.
Considering the intensification of extreme hydrometeorological events and the severe impacts observed in Rio Grande do Sul in 2024, this work seeks to develop a predictive model based on LSTM-type neural networks to classify extreme precipitation events, defined as occurrences above the 95th percentile of the historical distribution of hourly precipitation, using data between 2013 and 2025, with a view to providing early support for preventive actions and strategic decisions in public policies.
2. Material and Methods
This study was characterized as an applied research, aiming to generate knowledge with potential for practical use in the prediction of high precipitation events and in supporting actions for the prevention of hydrometeorological disasters (Vergara, 2016). A quantitative approach was adopted, using numerical data from meteorological time series, treated by statistical and computational techniques for the construction and evaluation of a predictive model (Vergara, 2016).
Regarding the objectives, the research was classified as exploratory, seeking to deepen the understanding of the patterns associated with the occurrence of high precipitation events (Gil, 2019). In terms of technical procedures, the study assumed a documentary character, using secondary data from official public databases of the National Institute of Meteorology (INMET), complemented by a predictive and analytical nature to develop a computational model for classifying extreme events.
The study area comprised the state of Rio Grande do Sul, which has a subtropical temperate climate, classified as Humid Mesothermal according to Köppen (Socioeconomic Atlas of RS, 2024). Precipitation in the region is well distributed throughout the year, varying between 1,299 and 1,800 mm annually.
The data were collected from 44 automatic weather stations of the National Institute of Meteorology (INMET), publicly available at https://portal.inmet.gov.br/dadoshistoricos, covering the period from 2013 to 2025. The variables included total hourly precipitation, air and dew point temperatures, relative humidity, wind speed and direction, atmospheric pressure, and global radiation, according to World Meteorological Organization (WMO) standards.
After collection, the data underwent a treatment and organization process, called “Data Wrangling”, to ensure consistency and integrity. Null or missing values were identified and treated according to the nature of each variable, applying temporal interpolation with bidirectional filling for time series.
Precipitation was treated differently: missing values were replaced by zero, considering its sparse nature and to prevent synthetic values from crossing the extreme event threshold of 8.60 mm/hour. Exploratory analysis was performed with the decomposition of the daily precipitation time series into additive and multiplicative models, with a seasonal period of 365 days.
To identify the variables with the greatest predictive power, the Random Forest algorithm (scikit-learn library) was used as a preprocessing step. The Random Forest was configured with 400 decision trees and trained as a binary classifier, with the occurrence of a high precipitation event as the target variable.
Lagged features (lags) were created at intervals of 1, 3, 6, 12, and 24 hours for each of the eight base meteorological variables. Class imbalance was addressed by the SMOTE (Synthetic Minority Oversampling Technique) technique, applied exclusively to the training data. The six variables with the highest aggregate importance were selected to compose the input of the LSTM model, with the high precipitation event threshold defined as 8.60 mm/hour, corresponding to the 95th percentile of the historical positive precipitation distribution.
For predictive modeling, a Long Short-Term Memory (LSTM) type recurrent neural network was used, implemented through the TensorFlow library with Keras interface, in a Python 3.10 environment, with GPU acceleration. The six selected variables were normalized by the MinMaxScaler method to the range between 0 and 1. Time windows of 24 hours were created, where each observation represented the history of the variables in the previous 24 hours.
The data split was sequential: 70% for training, 15% for validation, and 15% for testing. SMOTE was applied to the training set to balance the classes. The model architecture consisted of two stacked LSTM layers (64 and 32 neurons), interspersed with Dropout layers (20%), and an output layer with sigmoid activation. Training used the Adam optimizer and binary crossentropy loss function, with EarlyStopping to prevent overfitting. Evaluation metrics included precision, recall, F1-score, accuracy, confusion matrix, and AUC-ROC, prioritizing the recall of the positive class.
3. Results and Discussion
The analysis of the research results revealed important insights into the dynamics of precipitation in Rio Grande do Sul and the capacity of an LSTM model to predict extreme events, contributing to the objective of developing a predictive system to support preventive actions. Initially, the investigation focused on characterizing precipitation patterns, which proved to be the central variable for understanding hydrometeorological disasters. The historical series of monthly precipitation, covering the period from 2013 to 2025, showed remarkable temporal variability and the occurrence of significant peaks over the years, with a clear intensification of extreme events starting in 2019. This pattern culminated in 2023 and, more sharply, in 2024, when the highest monthly precipitation volumes were recorded at several stations.
The three highest peaks of monthly precipitation were observed in May 2024, with the Soledade station (A837) recording 738 mm, Serafina Corrêa (A894) with 714 mm, and Canela (A879) with 706 mm. These values highlight the exceptional magnitude of the events that occurred, which surpassed previous records and reinforce the urgency of effective alert systems. On a daily scale, the most intense events included 238.6 mm in Rio Pardo (A813) on November 11, 2013, 229.2 mm in Uruguaiana (A809) on January 09, 2019, and 207.0 mm in Santa Maria (A803) on April 30, 2024. The concentration of these extreme events in time and space underscores the non-linear nature of precipitation and the need for advanced predictive approaches.
The decomposition of the daily precipitation time series, using additive and multiplicative models, allowed for a deep understanding of its components. The observed series exhibited the typical behavior of pluviometric variables, characterized by extensive periods of low precipitation interspersed with extreme peaks. Trend analysis revealed relative stability between 2013 and 2021, followed by a significant increase from 2022 onwards, with the years 2023 and 2024 presenting the greatest impacts. The reduction in the trend in 2025 is attributed to the fact that the series does not contemplate the full year, not indicating a reversal of the intensification pattern.
The seasonal component, in turn, indicated the presence of an annual cycle, but with weak intensity. The seasonality strength calculated was 0.087 for the additive model and 0.096 for the multiplicative model, both below the threshold of 0.4, which is considered indicative of moderate seasonality (Wang, Smith and Hyndman, 2006). This finding is consistent with the climatic characterization of Rio Grande do Sul, where precipitation is historically well distributed throughout the year, without a defined dry season (Atlas Socioeconômico do RS, 2024). The monthly seasonal average pointed to October (+52.6 mm) and May (+51.1 mm) as the months with the greatest contribution, and August (-42.6 mm) as the one with the least, with a seasonal amplitude of approximately 95 mm and an irregular pattern.
The decomposition residual concentrated abrupt values that could not be explained by trend or seasonality, representing extreme precipitation events. This finding is crucial for predictive modeling, as it demonstrates that critical hydrometeorological phenomena are associated with nonlinear fluctuations that are difficult to capture by conventional statistical methods. Consequently, the use of recurrent neural networks, such as LSTMs, is justified as a promising alternative for identifying complex patterns and anticipating these events, aligning with the study’s proposal to employ advanced machine learning techniques for disaster forecasting.
Variable Selection
To identify the variables with the greatest predictive power, the Random Forest algorithm was employed as a binary classifier. The target variable was defined as the occurrence of precipitation above 8.60 mm/hour, which corresponds to the 95th percentile of the historical positive precipitation distribution. This threshold proved consistent with the magnitude of extreme events observed in April 2024, which showed hourly averages consistently above this value during the critical period. The established prediction horizon was one hour, aiming for event anticipation. Given the rarity of extreme events, which represent only 0.42% of observations, the prioritized evaluation metrics were AUC-ROC and recall of the extreme class, considered more suitable for imbalanced class contexts than global accuracy.
To enrich the model’s discriminative capacity, 40 lagged features (lags) were created for each of the eight base meteorological variables, at intervals of 1, 3, 6, 12, and 24 hours. This procedure allowed the model to incorporate the temporal behavior of the variables in the hours preceding each observation, indirectly capturing the accumulated precipitation behavior without the need to explicitly create accumulated precipitation variables. The initial approach to handling class imbalance, using the `class_weight=’balanced’` parameter of RandomForestClassifier, was not effective, resulting in a recall of zero for the minority class, which indicated the model’s inability to identify high precipitation events.
Given this limitation, the SMOTE (Synthetic Minority Oversampling Technique) technique was adopted and demonstrated superiority by generating synthetic samples of the minority class in the training data. This strategy allowed the model to learn the patterns associated with extreme events more effectively, preserving the real distribution of data in the test set for a valid evaluation. The importance of each variable was calculated based on the average impurity reduction in the decision trees of the Random Forest, and the six variables with the highest aggregated importance were selected for the LSTM model input, optimizing the dimensionality of the problem.
Hourly total precipitation stood out as the variable of greatest aggregate importance, with a value of 0.4939, representing almost triple that of the second-ranked variable. This result is physically expected, as recent precipitation history is the most direct predictor for the occurrence of new extreme events. Dew point temperature occupied the second position, with an importance of 0.1628, reflecting its direct relationship with the water vapor content in the atmosphere, a crucial factor for intense rainfall. The other selected variables were relative air humidity (0.0856), dry bulb air temperature (0.0608), global radiation (0.0571), and maximum wind gust (0.0548), all recognized in the literature as precursors of extreme hydrometeorological events.
The analysis of the importance of variables by lag revealed the predominance of total hourly precipitation in the most recent lags, indicating a strong immediate temporal dependence for the occurrence of extreme events. Variables such as dew point temperature, relative humidity, and global radiation also showed relevance distributed across the lags, suggesting that the accumulated atmospheric behavior in previous hours significantly influences the model’s predictive capacity. Although Random Forest achieved an AUC-ROC of 0.9350 on the test set, its recall of 13.8% for the extreme class confirmed that its main function in this study was variable selection, not the final prediction, which would be performed by the LSTM model.
LSTM Modeling
The predictive model was built using a Long Short-Term Memory (LSTM) recurrent neural network, implemented with the TensorFlow and Keras library. The model’s input consisted of the six variables selected by Random Forest: total hourly precipitation, dew point temperature, relative air humidity, dry-bulb air temperature, global radiation, and maximum wind gust speed. The input data were normalized using the MinMaxScaler method, which rescaled the values to the range between zero and one, preventing magnitude differences between variables from affecting the model’s learning. Subsequently, 24-hour time windows were created, where each observation represented the history of the six variables over the previous 24 hours.
The architecture of the LSTM model was composed of two stacked LSTM layers, with 64 and 32 neurons, respectively, and interleaved by Dropout layers with a rate of 20% to mitigate overfitting. An intermediate dense layer with 16 neurons and ReLU activation was added before the output layer, which used one neuron with a sigmoid activation function to produce the probability of high precipitation event occurrence. The model totaled 31,137 trainable parameters. The training was configured for up to 50 epochs, with a batch size of 256 and the Adam optimizer, using the binary crossentropy loss function. To avoid overfitting, the EarlyStopping callback was implemented with a patience of five epochs, monitoring the validation loss and automatically restoring the best weights.
The LSTM model training was interrupted by EarlyStopping at the sixth epoch, as the best validation performance was achieved in the first epoch, with a validation loss of 0.1491. Subsequent epochs showed a progressive increase in training loss and growing oscillations in validation loss, indicating that the model did not maintain its generalization capability. This behavior justified the adoption of EarlyStopping, ensuring that the final model corresponded to the configuration with the lowest observed validation loss, guaranteeing the model’s robustness in predicting extreme events. Model evaluation was performed using metrics such as precision, recall, F1-score, accuracy, confusion matrix, and AUC-ROC.
The results obtained on the test set demonstrated the effectiveness of the LSTM model. The AUC-ROC reached 0.9373, indicating a very good discriminative capacity between normal and extreme precipitation events, with a 93.73% probability of correctly classifying an extreme event relative to a normal event. This performance is considered excellent in the literature for classification problems with imbalanced classes. The recall for the extreme class was 0.824 (82.4%), meaning the model was able to identify the vast majority of high precipitation occurrences in advance, a crucial result for the prevention of hydrometeorological disasters.
The confusion matrix revealed that the model correctly identified 3,235 out of 3,925 extreme events present in the test set, confirming a recall of 82.4%. However, 690 undetected extreme events (false negatives) and 64,933 false alarms (normal situations incorrectly classified as extreme) were recorded. The precision value for the extreme class was 0.047, reflecting the number of false alarms generated. This behavior is expected in models calibrated to maximize recall in disaster prevention contexts, where the non-detection of a real event poses a significantly greater risk than issuing an unnecessary alert. The reduction of false alarms, while an opportunity for improvement, can be explored in future work by adjusting the classification threshold or incorporating additional variables.
In summary, the research results confirm the viability and effectiveness of the predictive model based on LSTM neural networks for classifying high precipitation events in Rio Grande do Sul. The ability to identify 82.4% of extreme events in advance, combined with a high discriminative capacity (AUC-ROC of 0.9373), demonstrates the model’s potential to provide valuable early support for preventive actions and strategic decisions in public policies for hydrometeorological disaster prevention. Although the challenge of false alarms persists, prioritizing recall for extreme events is justified by the risk mitigation context, consolidating this work’s contribution to climate monitoring and population safety.
4. Conclusion
The present study aimed to develop a predictive model based on Long Short-Term Memory (LSTM) neural networks to classify high precipitation events in Rio Grande do Sul, seeking to provide early support for preventive actions and strategic decisions in public policies. It was observed that precipitation in the state showed notable temporal variability and significant peaks, with a clear intensification of extreme events from 2019 onwards, culminating in the highest monthly and daily volumes in 2023 and 2024. Time series decomposition analysis revealed a trend of significant increase from 2022 and weak seasonality, indicating that critical hydrometeorological phenomena are associated with nonlinear fluctuations. Through the Random Forest algorithm, total hourly precipitation and dew point temperature were identified as the variables with the greatest predictive power. Handling class imbalance with SMOTE was crucial for the model’s learning. The developed LSTM model achieved an AUC-ROC of 0.9373, demonstrating excellent discriminative capacity, and a recall of 82.4% for the extreme class, evidencing its effectiveness in identifying the vast majority of high precipitation occurrences in advance.
The main contribution of this work lies in its potential to offer valuable early support for climate monitoring systems and public policies for the prevention of hydrometeorological disasters in Brazil, mitigating the impacts of future extreme events. However, an identified limitation was the number of false alarms generated by the model, reflected in a precision value of 0.047 for the extreme class. Although this behavior is expected in models calibrated to maximize recall in prevention contexts, the excess of unnecessary alerts can compromise user confidence. As future developments, it is suggested to explore adjusting the classification threshold to optimize the balance between precision and recall, incorporating additional variables such as terrain data and climate indices, and evaluating more complex neural network architectures or hybrid models. The adoption of temporal validation by sliding window and the integration of the model into existing operational systems at INMET and Civil Defense for practical application of the results are also recommended.
Bibliographic References
Instituto Nacional de Meteorologia [INMET]. 2024. El Niño: saiba como foi a atuação do fenômeno no Brasil. Disponível em: <https://portal.inmet.gov.br/noticias/el-niño-saiba-como-foi-a-atuação-do-fenômeno-no-brasil>. Acesso em: 15 de março 2025.
Instituto Nacional de Pesquisas Espaciais [INPE].
IPCC. 2023. Climate Change 2023: Synthesis Report. Contribution of Working Groups I, II and III to the Sixth Assessment Report of the Intergovernmental Panel on Climate Change. Geneva: IPCC. Disponível em: <https://www.ipcc.ch/report/ar6/syr/downloads/report/IPCC_AR6_SYR_FullVolume.pdf>. Acesso em: 15 de março 2025.
Peel, M. C.; Finlayson, B. L.; McMahon, T. A. 2007. Updated world map of the Köppen-Geiger climate classification. Hydrology and Earth System Sciences, v. 11, n. 5, p. 1633–1644. Disponível em: <https://hess.copernicus.org/articles/11/1633/2007/>. Acesso em: 15 de março 2025.
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