Rainstorm flood data generation model training and rainstorm flood data generation method

CN123012584APending Publication Date: 2026-10-30POWERCHINA HUADONG ENG CORP LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611286708.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-24
Publication Date
2026-10-30

AI Technical Summary

Technical Problem

[0004]本发明提供了一种暴雨洪水数据生成模型的训练及暴雨洪水数据生成方法,以解决相关技术中的洪水预测方法导致的模型精度低,生成的暴雨洪水数据不准确,不符合实际情况的问题

Benefits of technology

[0008]This invention divides a single rainfall event into multiple equal time segments, constructs a rainfall pattern feature vector using the ratio of segmented rainfall to total rainfall, transforms the rainfall time sequence pattern into a calculable numerical vector, predefines standard rainfall pattern modal vectors, and completes a quantitative comparison between the rainfall to be identified and the standard rainfall pattern through vector similarity calculation, thereby realizing automated and quantitative output of rainfall pattern identification. Based on the similarity analysis results, it automatically outputs rainfall pattern labels, realizing automatic classification and labeling of historical rainfall samples.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123012584A_ABST
    Figure CN123012584A_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of data processing, and discloses a training method of a rainstorm flood data generation model and a rainstorm flood data generation method.The training method of the rainstorm flood data generation model comprises: rain type identification for each rainfall event in historical rainstorm flood data; construction of an initial model according to a self-encoding network, a generative adversarial network and a self-attention mechanism; training of the initial rainstorm flood data generation model according to historical rainstorm flood data, rain type labels, actual rainstorm flood data and each set of candidate hyperparameter sets; evaluation of the training result, determination of a target candidate hyperparameter set according to the evaluation result; and training of the initial rainstorm flood data generation model according to the target candidate hyperparameter set to obtain a target rainstorm flood data generation model.The present application effectively captures the dependency between any two time steps in the flood process by introducing a self-attention mechanism, and improves the accuracy of the model by selecting hyperparameters.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of data processing technology, specifically to the training of a rainstorm and flood data generation model and a method for generating rainstorm and flood data. Background Technology

[0002] my country has diverse river basin types and complex climate conditions, leading to frequent and recurring extreme rainstorm and flood events. This places higher demands on the accuracy and timeliness of flood forecasting and early warning. Based on the runoff generation and confluence mechanisms of river basins and constructing high-quality rainstorm and flood data, this is one of the key foundations for improving flood forecasting capabilities.

[0003] In related technologies, commonly used flood prediction methods mainly rely on distributed hydrological models based on physical mechanisms and data-driven intelligent models. These methods all depend on a large amount of continuous, high-quality rainstorm and flood observation data to calibrate parameters or train models. However, due to constraints such as the short construction lifespan of watershed hydrological monitoring stations, the low frequency of extreme flood events, the high confidentiality of observation data, and high storage costs, the number of samples directly available to support the analysis of watershed runoff generation and confluence mechanisms and intelligent flood process prediction under extreme rainstorm scenarios is severely lacking. This results in low accuracy for distributed hydrological models based on physical mechanisms and data-driven intelligent models, leading to inaccurate and unrealistic rainstorm and flood data. Summary of the Invention

[0004] This invention provides a training method for a rainstorm and flood data generation model and a method for generating rainstorm and flood data, in order to solve the problems of low model accuracy and inaccurate rainstorm and flood data generated by flood prediction methods in related technologies, which do not conform to the actual situation.

[0005] In a first aspect, the present invention provides a training method for a rainstorm and flood data generation model, comprising: acquiring historical rainstorm and flood data of a study area; identifying the rainfall pattern of each rainfall event in the historical rainstorm and flood data to obtain a rainfall pattern label for each rainfall event; constructing an initial rainstorm and flood data generation model based on an autoencoder network, a generative adversarial network, and a self-attention mechanism; acquiring multiple sets of candidate hyperparameters; training the initial rainstorm and flood data generation model based on historical rainstorm and flood data, rainfall pattern labels, actual rainstorm and flood data, and each set of candidate hyperparameters; evaluating the training results; determining a target candidate hyperparameter set from the multiple sets of candidate hyperparameters based on the evaluation results; and training the initial rainstorm and flood data generation model based on historical rainstorm and flood data, rainfall pattern labels, actual rainstorm and flood data, and the target candidate hyperparameter set to obtain a target rainstorm and flood data generation model.

[0006] The training method for the rainstorm and flood data generation model of this invention identifies the rainfall pattern of each rainfall event in the historical rainstorm and flood data of the study area, obtaining a rainfall pattern label for each rainfall event. By identifying rainfall patterns and generating rainfall pattern labels for historical rainfall events, the model achieves classification and labeling of the temporal morphology of rainfall processes. This incorporates the temporal distribution characteristics of rainfall events into the model training process, preventing the model from only learning rainfall amplitude while ignoring differences in rainfall pattern structure. This allows the model to distinguish flood response patterns under different rainfall distribution patterns. An initial rainstorm and flood data generation model is constructed using an autoencoder network, a generative adversarial network, and a self-attention mechanism. The model is built by integrating these three mechanisms. The autoencoder network achieves dimensionality reduction and compression of high-dimensional time-series data, the generative adversarial network ensures the fidelity of generated samples, and the self-attention mechanism can capture long-distance dependencies within long-term rainstorm and flood sequences. This allows the initial rainstorm and flood data generation model to simultaneously achieve latent space feature compression, adversarial generation capabilities, and temporal global feature modeling capabilities. The initial rainstorm and flood data generation model is trained based on historical rainstorm and flood data, rainfall pattern labels, actual rainstorm and flood data, and each set of candidate hyperparameters. Multiple sets of candidate hyperparameters are used for model training, with rainfall pattern labels introduced as training constraints to incorporate prior rainfall pattern information into the training process. Training with multiple sets of hyperparameters reduces the subjectivity of manual parameter tuning and covers the model's fitting performance under multiple hyperparameter sets. The training results corresponding to multiple sets of candidate hyperparameters are quantitatively evaluated, and a target candidate hyperparameter set is selected from these sets. This objectively selects the target candidate hyperparameter set with the best overall performance, optimizing hyperparameters from the perspective of model generalization performance, avoiding the selection of overfitting hyperparameter configurations, and improving the model's generalization ability. Using the selected target candidate hyperparameter set, combined with historical rainstorm and flood data, rainfall pattern labels, and actual rainstorm and flood data, the model is retrained to obtain the target rainstorm and flood data generation model. This ensures that the target rainstorm and flood data generation model takes into account rainfall pattern characteristics, temporal accuracy, and data distribution consistency, thereby improving the accuracy of the target rainstorm and flood data generation model.

[0007] In one optional implementation, rainfall pattern identification is performed on each rainfall event in historical rainstorm and flood data to obtain a rainfall pattern label for each rainfall event. This includes: dividing each rainfall event in the historical rainstorm and flood data into multiple equal time periods; obtaining a rainfall pattern feature vector for each rainfall event based on the ratio of rainfall in each equal time period to the total rainfall; acquiring modal vectors of multiple standard rainfall patterns; performing similarity analysis between the rainfall pattern feature vector of each rainfall event and the modal vector of each standard rainfall pattern to obtain multiple similarity analysis results; and performing rainfall pattern identification on each rainfall event based on the multiple similarity analysis results to obtain a rainfall pattern label for each rainfall event.

[0008] This invention divides a single rainfall event into multiple equal time segments, constructs a rainfall pattern feature vector using the ratio of segmented rainfall to total rainfall, transforms the rainfall time sequence pattern into a calculable numerical vector, predefines standard rainfall pattern modal vectors, and completes a quantitative comparison between the rainfall to be identified and the standard rainfall pattern through vector similarity calculation, thereby realizing automated and quantitative output of rainfall pattern identification. Based on the similarity analysis results, it automatically outputs rainfall pattern labels, realizing automatic classification and labeling of historical rainfall samples.

[0009] In one optional implementation, an initial rainstorm and flood data generation model is constructed based on an autoencoder network, a generative adversarial network, and a self-attention mechanism. This includes: constructing an autoencoder based on the autoencoder network; constructing a generator and a discriminator based on the generative adversarial network; embedding the self-attention mechanism into the generator and discriminator; the autoencoder is used to compress and map high-dimensional rainfall time-series data to a low-dimensional latent space; the generator is used to receive random noise and output synthesized flood latent features; and the discriminator is used to determine the adversarial loss. The autoencoder, the generator with the embedded self-attention mechanism, and the discriminator are then assembled to obtain the initial rainstorm and flood data generation model.

[0010] This invention constructs an autoencoder based on an autoencoder network, and a generator and discriminator based on a generative adversarial network. A self-attention mechanism is embedded in the generator and discriminator. The generator uses attention to capture long-distance temporal correlations of long sequences of rainfall and floods, while the discriminator uses attention to identify forgery defects in temporal details, thereby improving the discriminator's ability to identify temporal details. The autoencoder, the generator with self-attention, and the discriminator are assembled to form a complete initial model, forming an end-to-end trainable initial rainstorm and flood data generation model.

[0011] In one optional implementation, multiple sets of candidate hyperparameters are obtained, and an initial rainstorm and flood data generation model is trained based on historical rainstorm and flood data, rainfall pattern labels, actual rainstorm and flood data, and each set of candidate hyperparameters. This includes: performing Cartesian combinations on multiple hyperparameters of the initial rainstorm and flood data generation model to obtain multiple sets of candidate hyperparameters; and inputting historical rainstorm and flood data, rainfall pattern labels, actual rainstorm and flood data, and each set of candidate hyperparameters into the initial rainstorm and flood data generation model for training.

[0012] This invention performs Cartesian combination on the model hyperparameters to generate multiple sets of candidate hyperparameters, achieving a systematic traversal of the hyperparameter space. Historical data, rainfall pattern labels, measured flood data, and each set of candidate hyperparameters are input together into the initial rainstorm and flood data to generate the model for training. Rainfall pattern labels are used as conditional constraints in the training process of each set of hyperparameters, so that the model under different hyperparameters learns the mapping relationship between rainfall pattern and flood, ensuring that the training results of multiple sets are fair and comparable.

[0013] In one optional implementation, the training results are evaluated, and a target candidate hyperparameter set is determined from multiple candidate hyperparameter sets based on the evaluation results. This includes: obtaining the training results corresponding to each candidate hyperparameter set; determining the reconstruction loss and dimensionality reduction overlap of the training results corresponding to each candidate hyperparameter set; and selecting the target candidate hyperparameter set from multiple candidate hyperparameter sets based on the reconstruction loss and dimensionality reduction overlap of the training results corresponding to each candidate hyperparameter set.

[0014] Secondly, the present invention provides a method for generating rainstorm and flood data, comprising: acquiring real-time rainstorm and flood data of a study area; identifying the rainfall pattern of each real-time rainfall event in the real-time rainstorm and flood data to obtain a real-time rainfall pattern label for each real-time rainfall event; and inputting the real-time rainstorm and flood data and the real-time rainfall pattern label into a target rainstorm and flood data generation model trained by the training method of the rainstorm and flood data generation model of the first aspect to obtain sample data of the rainstorm and flood process.

[0015] The rainstorm and flood data generation method of the present invention performs rain pattern recognition on real-time rainfall events to obtain real-time rain pattern labels, transforms the temporal pattern of real-time rainfall into a model-recognizable label, realizes automatic analysis of the rain pattern of newly occurring real-time rainfall, and uses real-time rainstorm and flood data and real-time rainfall pattern labels as input conditions to the target rainstorm and flood data generation model, outputting rainstorm and flood process sample data. It can generate a large number of flood process samples that conform to the statistical characteristics of the rain pattern based on real-time rainfall conditions, expand the hydrological sample library in scenarios where measured flood samples are scarce, and provide a large amount of simulated flood condition data for flood simulation and risk assessment.

[0016] Thirdly, this invention provides a training device for a rainstorm and flood data generation model, comprising: a rain pattern recognition module for acquiring historical rainstorm and flood data of the study area, identifying the rain pattern of each rainfall event in the historical rainstorm and flood data, and obtaining a rain pattern label for each rainfall event; a model building module for constructing an initial rainstorm and flood data generation model based on an autoencoder network, a generative adversarial network, and a self-attention mechanism; a model initial training module for acquiring multiple sets of candidate hyperparameters and training the initial rainstorm and flood data generation model based on historical rainstorm and flood data, rain pattern labels, actual rainstorm and flood data, and each set of candidate hyperparameters; a parameter selection module for evaluating the training results and determining a target candidate hyperparameter set from the multiple sets of candidate hyperparameters based on the evaluation results; and a model training module for training the initial rainstorm and flood data generation model based on historical rainstorm and flood data, rain pattern labels, actual rainstorm and flood data, and the target candidate hyperparameter set to obtain a target rainstorm and flood data generation model.

[0017] Fourthly, the present invention provides a training device for a rainstorm and flood data generation model, comprising: a real-time rainfall pattern recognition module, used to acquire real-time rainstorm and flood data of a study area, perform rainfall pattern recognition on each real-time rainfall event in the real-time rainstorm and flood data, and obtain a real-time rainfall pattern label for each real-time rainfall event; and a data generation module, used to input the real-time rainstorm and flood data and the real-time rainfall pattern label into a target rainstorm and flood data generation model trained by the training method of the rainstorm and flood data generation model of the first aspect, and obtain sample data of the rainstorm and flood process.

[0018] Fifthly, the present invention provides an electronic device, comprising: a memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the computer instructions to perform the training method for the rainstorm and flood data generation model of the first aspect or any corresponding embodiment thereof, or the rainstorm and flood data generation method of the second aspect.

[0019] In a sixth aspect, the present invention provides a computer-readable storage medium storing computer instructions for causing a computer to execute the training method for the rainstorm and flood data generation model of the first aspect or any corresponding embodiment thereof, or the rainstorm and flood data generation method of the second aspect. Attached Figure Description

[0020] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0021] Figure 1 This is a schematic diagram of an application scenario according to an embodiment of the present invention; Figure 2 This is a schematic diagram of the first process of training a rainstorm and flood data generation model according to an embodiment of the present invention; Figure 3 This is a schematic diagram of the second process of training a rainstorm and flood data generation model according to an embodiment of the present invention; Figure 4 This is a schematic diagram of rainfall distribution patterns for multiple standard rain types according to an embodiment of the present invention; Figure 5 This is a schematic diagram of the third process of training a rainstorm and flood data generation model according to an embodiment of the present invention; Figure 6 This is a flowchart illustrating a method for generating rainstorm and flood data according to an embodiment of the present invention; Figure 7 This is a structural block diagram of a training device for a rainstorm and flood data generation model according to an embodiment of the present invention; Figure 8 This is a structural block diagram of a rainstorm and flood data generation device according to an embodiment of the present invention; Figure 9 This is a schematic diagram of the hardware structure of an electronic device according to an embodiment of the present invention. Detailed Implementation

[0022] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0023] It is understood that before using the technical solutions disclosed in the various embodiments of the present invention, users should be informed of the types, scope of use, and usage scenarios of the personal information involved in the present invention and their authorization should be obtained in accordance with relevant laws and regulations through appropriate means.

[0024] The terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this invention, "a plurality of" means two or more, unless otherwise explicitly specified.

[0025] As an optional application scenario of this invention, such as Figure 1 As shown, the training system or the rainstorm and flood data generation system for this model may include at least one terminal device and at least one server. Figure 1 The system is illustrated in the example, which includes a computer 101, a mobile terminal 102, and a server 103, and the terminal devices such as the computer 101 and the mobile terminal 102 are connected to the server 103 through a network 110.

[0026] Specifically, the terminal device can be a smartphone, tablet, laptop, PDA, desktop computer, game console, smart TV, smart wearable device, in-vehicle terminal, VR (Virtual Reality) device, AR (Augmented Reality) device, etc. Server 103 can be a standalone physical server, a server cluster, a distributed system, or a cloud server providing cloud services. Network 110 can be a wired or wireless network, examples of which include, but are not limited to, the Internet, corporate intranet, local area network, wide area network, mobile communication network, and combinations thereof.

[0027] Due to constraints such as the short construction period of watershed hydrological monitoring stations, the low frequency of extreme flood events, the high confidentiality of observation data, and the high storage costs, the number of samples directly available to support the analysis of watershed runoff generation and confluence mechanisms and intelligent flood process prediction under extreme rainfall scenarios is severely lacking. This data scarcity not only increases the difficulty of parameter calibration in runoff generation and confluence mechanism analysis but also easily leads to overfitting of intelligent models during the training phase, thus directly affecting the timeliness and reliability of flood forecasts and warnings. Specifically, regarding existing generative models, traditional GANs (Generative Adversarial Networks) perform well on spatial data such as images, but they have the following drawbacks when directly processing hydrological time series data: insufficient ability to capture temporal dependencies, making it difficult to effectively characterize the temporal dependencies and dynamic evolution characteristics of flood processes; weak temporal correlation of generated data, making it difficult to meet the strict requirements of hydrological forecasting for temporal consistency; and neglect of the coupling characteristics between rainfall and flood, failing to distinguish the inherent physical relationship between different types of rainfall patterns (such as single-peak, double-peak, and uniform types) and flood responses, resulting in poor physical rationality of generated samples. Overfitting is prone to occur. In cases of scarce extreme flood samples, simple GAN structures tend to generate sequences that are highly repetitive with the training samples or lack diversity, and cannot truly expand the effective sample space.

[0028] This invention provides a training method for a rainstorm and flood data generation model. By introducing a self-attention mechanism and hyperparameter selection, the method effectively captures the dependency relationship between any two time steps during the flood process, thereby improving the accuracy of the model.

[0029] According to an embodiment of the present invention, a training method for a rainstorm and flood data generation model is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.

[0030] This embodiment provides a training method for a rainstorm and flood data generation model, which can be used with computer equipment. Figure 2 This is a first flowchart of a training method for a rainstorm and flood data generation model according to an embodiment of the present invention, as follows: Figure 2 As shown, the process includes the following steps: Step S201: Obtain historical rainstorm and flood data for the study area, identify the rainfall pattern for each rainfall event in the historical rainstorm and flood data, and obtain the rainfall pattern label for each rainfall event.

[0031] The study area is the watershed where the rainstorm and flood simulation will be carried out; the historical rainstorm and flood data is a dataset of rainstorms and floods obtained from historical observations, including the time series of rainfall and the corresponding flood time series data for each time period; the rainfall event is a continuous rainfall process, defined by the start and end times of rainfall; the rainfall pattern is the distribution pattern of rainfall in the time dimension, representing the distribution pattern of rainfall in different time periods within the rainfall event; the rainfall pattern label is a marker that indicates which type of rainfall event it belongs to.

[0032] Historical rainstorm and flood data of the study area are retrieved from databases, hydrological yearbooks, monitoring stations, and other databases or monitoring stations. The historical rainstorm and flood data is then cleaned, and the historical rainstorm and flood data for subsequent rainfall pattern identification is the cleaned historical rainstorm and flood data.

[0033] In some optional implementations, each rainfall event is divided into equal-length periods, and the proportion of rainfall in each period to the total rainfall is calculated to construct a rainfall pattern feature vector; several standard rainfall pattern modal vectors are pre-stored, and the similarity between the sample vector to be identified and each standard rainfall pattern vector is calculated. The category with the highest similarity is taken as the rainfall pattern label for this rainfall event.

[0034] In some optional implementations, the temporal morphological features of each rainfall event can be extracted to form a feature matrix, and unsupervised clustering can be performed on all rainfall events using a clustering method. Each cluster corresponds to a type of rainfall, and the cluster number is used as the rainfall type label.

[0035] Step S202: Construct an initial rainstorm and flood data generation model based on autoencoder networks, generative adversarial networks, and self-attention mechanisms.

[0036] While Generative Adversarial Networks (GANs) have achieved good results in image generation, the complex temporal dependencies in time-series data often make it difficult for these methods to capture the dynamic evolution characteristics of the sequence in flood process simulation, resulting in insufficient temporal relevance of the generated data. To generate flood data that conforms to the target region, this invention proposes a spatiotemporally dependent enhanced initial rainstorm and flood data generation model by introducing a self-attention mechanism on top of GANs. This model not only maintains the traditional generator and discriminator networks but also achieves supervised adversarial interaction between real and generated data by introducing real data as a supervision term.

[0037] Autoencoders, or autoencoders, are generative models based on deep neural networks that exhibit excellent feature extraction capabilities in unsupervised and semi-supervised learning. Their core architecture consists of an encoder and a decoder: the encoder compresses high-dimensional data into a low-dimensional latent space representation through a nonlinear mapping, achieving feature extraction; the decoder reconstructs the latent space representation back to the original data space through an inverse mapping. Autoencoders optimize parameters by minimizing the reconstruction error, performing well in tasks such as dimensionality reduction, denoising, and anomaly detection. Essentially, they learn the low-dimensional manifold structure of data through the data compression and reconstruction process, while preserving key feature information, thus forming a self-supervised learning mechanism.

[0038] Generative Adversarial Networks (GANs) are adversarial learning frameworks consisting of a generator and a discriminator. The generator generates samples through a nonlinear mapping from the latent space to the data space, while the discriminator acts as a binary classifier, probabilistically distinguishing between generated samples and real samples.

[0039] The self-attention mechanism dynamically captures the internal dependencies of a sequence, abandoning the sequence propagation limitations of traditional recurrent neural networks, and uses parallel computation to evaluate the correlation strength of feature vectors at each time point, which can accurately quantify the correlation strength of hydrological elements at different times.

[0040] The initial rainstorm and flood data generation model is a basic network architecture that has not yet completed hyperparameter optimization and is yet to be trained.

[0041] In some optional implementations, an autoencoder is built; a GAN generator and a discriminator are built; a self-attention layer is embedded inside the generator and the temporal discriminator, respectively; the autoencoder, the attention-enabled generator, and the discriminator are spliced ​​and assembled to obtain the initial rainstorm and flood data generation model.

[0042] In some alternative implementations, the autoencoder can be fully preserved, multi-head self-attention can be added inside the generator to capture long-term temporal dependencies of rainfall and floods, and a one-dimensional convolutional network can be used for the discriminator to reduce the computational cost of the discriminator. All modules are assembled to obtain the initial rainstorm and flood data generation model.

[0043] Step S203: Obtain multiple sets of candidate hyperparameters, and train the initial rainstorm and flood data generation model based on historical rainstorm and flood data, rain pattern labels, actual rainstorm and flood data, and each set of candidate hyperparameters.

[0044] The candidate hyperparameter set is a set of external parameters pre-set before model training. For example, each candidate hyperparameter set may include learning rate, training epochs, number of hidden layers, number of hidden units, batch size, and self-attention dimension, etc.

[0045] Actual rainstorm and flood data are actual measured rainfall and flood samples obtained through monitoring stations.

[0046] In some alternative implementations, candidate values ​​for each hyperparameter are enumerated, and Cartesian products are combined to obtain a set of candidate hyperparameters. Each set of hyperparameters is used to create a copy of the initial rainstorm and flood data generation model. Historical rainstorm and flood data, rainfall pattern labels, and measured flood data are input separately for independent training. The training of each set of hyperparameters does not interfere with each other.

[0047] In some optional implementations, the range of values ​​for each hyperparameter can be defined, and multiple sets of candidate hyperparameters can be generated by random sampling in the value space. Under each set of hyperparameter configurations, an initial rainstorm and flood data generation model can be trained independently using the same training dataset and rain pattern labels.

[0048] Step S204: Evaluate the training results and determine the target candidate hyperparameter set from multiple candidate hyperparameter sets based on the evaluation results.

[0049] The training results are the models obtained after training each set of hyperparameters, and the corresponding output metrics; the target candidate hyperparameter set is the optimal target candidate hyperparameter set selected from multiple candidate hyperparameter sets.

[0050] In some alternative implementations, various evaluation metrics are calculated for each training result set, and the optimal set of candidate hyperparameters for the target is selected based on the evaluation metrics.

[0051] Step S205: Train the initial rainstorm and flood data generation model based on historical rainstorm and flood data, rain pattern labels, actual rainstorm and flood data, and the target candidate hyperparameter set to obtain the target rainstorm and flood data generation model.

[0052] The target rainstorm and flood data generation model is the final trained model that can be used for inference; the input of the target rainstorm and flood data generation model is historical rainstorm and flood data and rainfall pattern labels, and the output is sample data of rainstorm and flood process.

[0053] In some alternative implementations, historical rainstorm and flood data, rainfall pattern labels, actual rainstorm and flood data, and a target candidate hyperparameter set are input into the initial rainstorm and flood data generation model to obtain the target rainstorm and flood data generation model.

[0054] In some alternative implementations, a completely new initial rainstorm and flood data generation model can be initialized; a target candidate hyperparameter set can be loaded; all historical rainstorm and flood data, rainfall type labels, and actual rainstorm and flood data can be input, and the model can be trained from scratch. After convergence, the target rainstorm and flood data generation model can be obtained.

[0055] The training method for the rainstorm and flood data generation model provided in this embodiment identifies the rainfall pattern of each rainfall event in the historical rainstorm and flood data of the study area, obtaining a rainfall pattern label for each rainfall event. By identifying rainfall patterns and generating rainfall pattern labels for historical rainfall events, the model achieves classification and labeling of the temporal morphology of rainfall processes. The temporal distribution characteristics of rainfall events are introduced into the model training process, avoiding the model's neglect of rainfall pattern structure differences while only learning rainfall amplitude. This enables the model to distinguish flood response patterns under different rainfall distribution patterns. An initial rainstorm and flood data generation model is constructed using an autoencoder network, a generative adversarial network, and a self-attention mechanism. The model is built by integrating these three mechanisms. The autoencoder network achieves dimensionality reduction and compression of high-dimensional time-series data, the generative adversarial network ensures the fidelity of generated samples, and the self-attention mechanism can capture long-range dependencies within long-term rainstorm and flood sequences. This allows the initial rainstorm and flood data generation model to simultaneously achieve latent space feature compression, adversarial generation capabilities, and temporal global feature modeling capabilities. The initial rainstorm and flood data generation model is trained based on historical rainstorm and flood data, rainfall pattern labels, actual rainstorm and flood data, and each set of candidate hyperparameters. Multiple sets of candidate hyperparameters are used for model training, with rainfall pattern labels introduced as training constraints to incorporate prior rainfall pattern information into the training process. Training with multiple sets of hyperparameters reduces the subjectivity of manual parameter tuning and covers the model's fitting performance under multiple hyperparameter sets. The training results corresponding to multiple sets of candidate hyperparameters are quantitatively evaluated, and a target candidate hyperparameter set is selected from these sets. This objectively selects the target candidate hyperparameter set with the best overall performance, optimizing hyperparameters from the perspective of model generalization performance, avoiding the selection of overfitting hyperparameter configurations, and improving the model's generalization ability. Using the selected target candidate hyperparameter set, combined with historical rainstorm and flood data, rainfall pattern labels, and actual rainstorm and flood data, the model is retrained to obtain the target rainstorm and flood data generation model. This ensures that the target rainstorm and flood data generation model takes into account rainfall pattern characteristics, temporal accuracy, and data distribution consistency, thereby improving the accuracy of the target rainstorm and flood data generation model.

[0056] This embodiment provides a training method for a rainstorm and flood data generation model, which can be used with computer equipment. Figure 3 This is a second flowchart of a training method for a rainstorm and flood data generation model according to an embodiment of the present invention, as follows: Figure 3 As shown, the process includes the following steps: Step S301: Obtain historical rainstorm and flood data for the study area, identify the rainfall pattern for each rainfall event in the historical rainstorm and flood data, and obtain the rainfall pattern label for each rainfall event.

[0057] Specifically, step S301 includes: Step S3011: Divide each rainfall event in the historical rainstorm and flood data into multiple equal time periods, and obtain the rainfall pattern feature vector of each rainfall event based on the ratio of rainfall in each equal time period to the total rainfall.

[0058] Based on the measured rainfall process of historical rainstorm and flood data, the time periods of each rainfall event are normalized to establish a rainfall pattern feature vector that represents the characteristics of the rainfall pattern. That is, the rainfall pattern feature vector is composed of the normalized ratio of the rainfall amount in each time period to the total rainfall amount.

[0059] For example, each rainfall event refers to a complete rainfall process in historical rainstorm and flood samples, or it can refer to the rainfall process to be identified that has been acquired during the application phase. The time series of rainfall events needs to be resampled and padded at a uniform time step to ensure that the subsequent rainfall pattern feature vectors have the same dimension. Each rainfall event is divided into... The ratio of rainfall in each equal time period to the total cumulative rainfall of that period can be expressed as: ; in, For the first Rainfall pattern characteristics indicators for different time periods, For the first Rainfall in different time periods, The total rainfall of the rainfall event. This represents the total number of items within the same time period.

[0060] Therefore, the rain pattern feature vector can be represented as: , X This is a rain-shaped feature vector. For the first Rainfall pattern characteristics indicators for different time periods.

[0061] Step S3012: Obtain modal vectors of multiple standard rainfall patterns, perform similarity analysis on the rainfall pattern feature vector of each rainfall event and the modal vector of each standard rainfall pattern, and obtain multiple similarity analysis results.

[0062] A rainstorm process encompasses changes in average rainfall intensity and its spatiotemporal distribution. Rainfall patterns become an important way to intuitively demonstrate the spatiotemporal dynamics of rainstorms. During the confluence period, if the average rainfall intensity remains consistent, the peak flow caused by a triangular rainfall pattern with the peak located in the middle or end of the pattern can be more than 30% higher than that of a uniformly distributed rainfall pattern. Based on numerous actual rainfall records, there are seven standard rainfall patterns (typical rainfall distribution patterns), such as... Figure 4 As shown, Figure 4 This is a schematic diagram of rainfall distribution patterns for multiple standard rain types according to embodiments of the present invention. Figure 4The horizontal axis represents the normalized time or time interval number of the rainfall process, and the vertical axis represents the rainfall amount in each time interval or its normalized proportion to the total rainfall (rainfall pattern characteristic index). According to the location, number of peaks, and rainfall intensity variation characteristics, the seven standard rainfall patterns can be named as front-peak type, rear-peak type, middle-peak type, uniform type, front-and-rear bimodal type, middle-and-rear bimodal type, and multi-peak fluctuation type; in the model, they can also be referred to as rainfall patterns 1 to 7.

[0063] By statistically summarizing historical samples within the same rain pattern, we obtained the modal vectors of seven standard rain patterns. The modal vectors of the seven standard rain patterns are then combined row by row to form the standard rain pattern modal matrix.

[0064] For example, the standard rain pattern mode matrix can be represented as: ; in, For the first Modal vectors of a standard rainfall pattern For the first The standard rainfall pattern in the first Rainfall pattern characteristic indicators for standard rainfall patterns over equal time periods.

[0065] 7 standard rainfall types to 7× by row Standard Rain Pattern Mode Matrix The standard rainfall pattern mode matrix is ​​obtained from historical rainstorm and flood data.

[0066] Rainfall pattern classification is achieved by calculating the similarity function values ​​between the rainfall sequence to be identified and each standard rainfall pattern mode, based on the maximum membership principle. This method quantifies the similarity between the rainfall process and the standard rainfall pattern through the membership function. The maximum membership function can be expressed as: ; in, The maximum membership function value. For the first The standard rainfall pattern in the first Rain pattern characteristic indicators of standard rainfall patterns with multiple feature dimensions. For the first Rain pattern feature index with multiple feature dimensions m The feature dimension used in the proximity calculation is the number of feature components of the equal-time rainfall pattern.

[0067] When the rainfall process to be identified and the standard rainfall pattern are both adopted n When representing equal time intervals, m=n .

[0068] Step S3013: Based on multiple similarity analysis results, rain pattern identification is performed on each rainfall event to obtain a rain pattern label for each rainfall event.

[0069] Calculate separately The maximum membership function value (closeness) at that time. If the first Corresponding to standard rain type If the value of the maximum membership function is the largest among the seven maximum membership function values, then the rainfall process is divided into the first... Rain-like type, the first Rain-like patterns serve as rain type labels for rainfall events.

[0070] This invention divides a single rainfall event into multiple equal time segments, constructs a rainfall pattern feature vector using the ratio of segmented rainfall to total rainfall, transforms the rainfall time sequence pattern into a calculable numerical vector, predefines standard rainfall pattern modal vectors, and completes a quantitative comparison between the rainfall to be identified and the standard rainfall pattern through vector similarity calculation, thereby realizing automated and quantitative output of rainfall pattern identification. Based on the similarity analysis results, it automatically outputs rainfall pattern labels, realizing automatic classification and labeling of historical rainfall samples.

[0071] Step S302: Construct an initial rainstorm and flood data generation model based on autoencoder networks, generative adversarial networks, and self-attention mechanisms.

[0072] Specifically, step S302 includes: Step S3021: Construct an autoencoder based on the autoencoder network, and construct a generator and discriminator based on the generative adversarial network. Embed a self-attention mechanism into the generator and discriminator. The autoencoder is used to compress and map high-dimensional rainfall time series data to a low-dimensional latent space. The generator is used to receive random noise and output synthesized flood latent features. The discriminator is used to determine the adversarial loss.

[0073] The embedding function of an autoencoder effectively improves the generalization ability of the initial rainstorm and flood data generation model by mapping high-dimensional data to a low-dimensional latent space. Based on a recurrent neural network, it uniformly processes dynamic and static features. The dynamic feature mapping utilizes the Markov property of time series data, establishing temporal dependencies through latent state propagation, allowing current features to inherit and integrate historical information. This recursive mechanism preserves the spatiotemporal characteristics of the data while removing redundancy through dimensionality reduction, thus optimizing the model's representational ability. The embedding function expression of the autoencoder is as follows: ; in, The mapped low-dimensional static feature vector This is a static encoding function (static encoder). for The low-dimensional dynamic feature vector at time step. Implement functions for recursive networks (dynamic recursive encoders). for The low-dimensional dynamic feature vector at time step. for The high-dimensional dynamic feature vector at time step, It is a true high-dimensional static feature vector.

[0074] in, In the context of torrential rain and floods, fixed information such as watershed attributes, watershed area, slope, soil type, and rainfall type labels can be used to represent watershed attributes. Its function is to compress and map a high-dimensional static vector s into a low-dimensional representation; In the context of torrential rain and floods, this can represent a hydrological scenario, including rainfall, flow rate, and water level observations.

[0075] The recovery function, as the inverse mapping process of the embedding function, reconstructs the low-dimensional latent space representation into the original high-dimensional feature space through a differentiable nonlinear transformation, realizing dimensionality restoration and feature reconstruction of the data. This provides a theoretical basis for the closed-loop optimization of the encoder-decoder architecture of autoencoders. The expression is as follows: ; in, It is a high-dimensional static feature vector restored by the recovery function. for The high-dimensional dynamic feature vector at time step, It is a bidirectional recursive network. This is the low-dimensional static feature vector after mapping.

[0076] In some optional implementations, the generator employs a dual-channel input architecture, and its core function is to generate highly realistic time-series data through adversarial training. The generator calculation formula is as follows: ; in, To generate subnetworks through static generation The generated static feature vector, To dynamically generate subnetworks recursively The generated dynamic feature vector, Represents a static or dynamic random vector with a known distribution. for Dynamic hidden states generated at any time. for A dynamic random noise vector generated at any given time.

[0077] The feature representation output by the embedding function and the dynamic and static feature vectors generated by the generator are jointly encoded through a concatenation operation, forming a unified feature representation space. The discriminator constructs a discriminant function by calculating the distance between the joint features and the true data distribution. The discriminant function expression is as follows: ; in, Generate classification results from the output static features. For the bidirectional recursive network function of the feedforward output layer, To generate subnetworks through static generation The generated static feature vector, for The dynamic features at any given time generate the classification results. for The joint encoding result at time step, for The high-dimensional dynamic feature vector at any given time.

[0078] In some optional implementations, the self-attention mechanism computation process is divided into three parts. The first part is to calculate the similarity coefficient between the time-series feature vector and the global state based on the hyperbolic tangent transform: ; in, for The similarity coefficient between the feature vector at time step and the global state. The hidden layer outputs a weight matrix, which is used for the second linear projection. The hyperbolic tangent activation function is used. This is the trainable weight matrix from the input layer to the hidden layer, used to perform the first linear transformation. for The hidden state vector at time t. This is the global hidden state matrix.

[0079] The second part is the weight normalization stage, which uses the softmax function to transform the scores into a probability distribution, ensuring that the sum of the weights at each time step is 1. ; in, express Normalized similarity weights for The similarity coefficient between the feature vector at time step and the global state. It is an exponential function.

[0080] The third part, the feature fusion stage, generates an attention matrix with time-aware capabilities through weighted summation: ; in, This is the self-attention output matrix obtained through weighted summation. For the first The hidden state variables at time t. For the first Normalized attention weights at each moment.

[0081] Compared to traditional attention mechanisms, the core advantage of self-attention lies in eliminating dependence on external information and extracting feature correlations entirely from within the sequence. This characteristic can autonomously identify spatiotemporal coupling relationships between different data sources, avoiding the subjectivity of manually designing feature combinations. At the model optimization level, its fully differentiable property supports end-to-end training, synergizing with generative adversarial network frameworks to significantly improve the quality of flood time series data generation.

[0082] Step S3022: Assemble the autoencoder, the generator with embedded self-attention mechanism, and the discriminator to obtain the initial rainstorm and flood data generation model.

[0083] The autoencoder, the generator with an embedded local window self-attention mechanism, and the discriminator are connected according to a preset data flow link to assemble the initial rainstorm and flood data generation model.

[0084] This invention constructs an autoencoder based on an autoencoder network, and a generator and discriminator based on a generative adversarial network. A self-attention mechanism is embedded in the generator and discriminator. The generator uses attention to capture long-distance temporal correlations of long sequences of rainfall and floods, while the discriminator uses attention to identify forgery defects in temporal details, thereby improving the discriminator's ability to identify temporal details. The autoencoder, the generator with self-attention, and the discriminator are assembled to form a complete initial model, forming an end-to-end trainable initial rainstorm and flood data generation model.

[0085] Step S303: Obtain multiple sets of candidate hyperparameters, and train the initial rainstorm and flood data generation model based on historical rainstorm and flood data, rain pattern labels, actual rainstorm and flood data, and each set of candidate hyperparameters.

[0086] Specifically, step S303 includes: Step S3031: Generate multiple hyperparameters of the model based on the initial rainstorm and flood data, and perform Cartesian combination on the multiple hyperparameters to obtain multiple sets of candidate hyperparameters.

[0087] Several hyperparameters include learning rate, number of training epochs, number of hidden layers, number of hidden units, batch size, and self-attention dimension.

[0088] The setting of hyperparameters directly affects the predictive performance of the initial rainstorm and flood data generation model. A reasonable configuration helps the model learn deeper features of the data more effectively, thus achieving better prediction results. This embodiment of the invention determines the key hyperparameters of the initial rainstorm and flood data generation model through grid search: first, initial hyperparameters such as learning rate, training epochs, number of hidden layers, number of hidden units, batch size, and self-attention dimension are set, while non-critical conditions such as random seed, training / validation data partitioning method, optimizer, and loss function are fixed; then, multiple hyperparameters are combined using Cartesian methods to obtain multiple sets of candidate hyperparameters.

[0089] Specifically, Cartesian combination means exhaustively listing all combinations between candidate hyperparameter values, and each set of output results is a complete set of candidate hyperparameters.

[0090] For example, the initial learning rate is set to 0.01, decaying to one-tenth of its original value every 50 training epochs. The optimizer used is Adam, and the loss function includes L2 reconstruction loss, supervised loss, and adversarial loss. The search steps Epochs=200 are used as the baseline training epochs, and the focus is on adjusting parameters such as the number of training epochs, the number of hidden layers, the learning rate, and the batch size. The network weights are initialized using Xavier.

[0091] Step S3032: Input historical rainstorm and flood data, rainfall pattern labels, actual rainstorm and flood data, and each set of candidate hyperparameters into the initial rainstorm and flood data generation model for training.

[0092] For each set of candidate hyperparameters, the initial rainstorm and flood data generation model is trained on the training set.

[0093] Historical rainstorm and flood data, rainfall pattern labels, actual rainstorm and flood data, and each set of candidate hyperparameters are input into the initial rainstorm and flood data generation model for training, and the training results corresponding to each set of candidate hyperparameters are obtained.

[0094] Step S304: Evaluate the training results and determine the target candidate hyperparameter set from multiple candidate hyperparameter sets based on the evaluation results.

[0095] Specifically, step S304 includes: Step S3041: Obtain the training results corresponding to each set of candidate hyperparameters, and determine the reconstruction loss and dimensionality reduction overlap of the training results corresponding to each set of candidate hyperparameters.

[0096] On the validation set, the reconstruction loss, supervision loss, adversarial loss, mean squared error (MSE), and distribution similarity index between generated samples and real samples are calculated for the training results corresponding to each set of candidate hyperparameters.

[0097] Reconstruction loss is an autoencoder branch metric that measures the degree to which the autoencoder reconstructs and restores the real flood time series; the smaller the value, the better the autoencoder feature extraction effect; supervised loss represents the deviation between the predicted value and the true value; adversarial loss is the adversarial branch loss between the GAN generator and the discriminator, which measures the ability of the generated samples to deceive the discriminator; dimensionality reduction overlap includes principal component analysis overlap and random neighbor embedding overlap, which performs dimensionality reduction and projection of real flood samples and model-generated flood samples onto a two-dimensional plane; the degree of overlap between the two types of sample points is observed, and the higher the overlap, the closer the overall statistical distribution of the generated samples is to the real rainstorm flood data.

[0098] Step S3042: Select the target candidate hyperparameter set from multiple candidate hyperparameter sets based on the reconstruction loss and dimensionality reduction overlap of the training results corresponding to each candidate hyperparameter set.

[0099] Finally, a set of hyperparameters with smaller validation errors, stable training processes, and high dimensionality reduction overlap was selected as the target candidate hyperparameter set.

[0100] Step S305: Train the initial rainstorm and flood data generation model based on historical rainstorm and flood data, rain pattern labels, actual rainstorm and flood data, and the target candidate hyperparameter set to obtain the target rainstorm and flood data generation model.

[0101] In some alternative implementations, after training the initial rainstorm and flood data generation model to obtain the target rainstorm and flood data generation model, principal component analysis (PCA) and t-distributed stochastic neighbor embedding (t-SNE) are used to evaluate the target rainstorm and flood data generation model.

[0102] Specifically, during the evaluation, each historical rainstorm and flood data point and each generated rainstorm and flood process sample data point are expanded into a high-dimensional sample vector with the same time step, the same cross-section, and the same hydrological elements, forming a sample matrix A containing N samples and p variables; where N represents the number of samples participating in the evaluation, and p represents the number of variables contained in each sample. For example, when selecting T time steps, S control cross-sections, and V hydrological elements, p = T × S × V; if only the flow process is evaluated, then p = T × S. PCA is used to compare whether the overall distribution of the real samples and generated samples overlaps in the main variance direction, and t-SNE is used to compare whether the two are consistent in local neighborhood structure and rainfall cluster structure.

[0103] For example, in the PCA evaluation process, for a sample containing p variables and n data points... Its covariance matrix can be calculated. From this covariance matrix, we can determine...P eigenvalues And sort them from largest to smallest to get P eigenvalues With the corresponding P eigenvectors Then the first i Principal Components for: ; ; in, For the first i Principal components, For data samples, For the first Eigenvectors with eigenvalues, This represents the total number of variables.

[0104] Historical rainstorm and flood data contain With principal component analysis, the number of variables is significantly reduced. The selection of the number of principal components depends on their contribution rates and cumulative contribution rates. The contribution rate of each principal component is: ; in, For the first The contribution rate of each principal component For the first The eigenvalues ​​of the principal components For the first The eigenvalues ​​of each principal component.

[0105] Generally, the larger the contribution rate of the principal component, the more information from the original data is preserved, including historical rainstorm and flood data. m The cumulative contribution rate of each principal component is: ; in, For the front m The cumulative contribution rate of each principal component For the first The contribution rate of each principal component p For the number of variables, For the first The eigenvalues ​​of each principal component.

[0106] Generally, if the cumulative contribution rate reaches 80% or more, it can be considered that selecting the first few principal components can effectively preserve the information of the original sample. The cumulative contribution rate is the standard for determining the number of principal components to select, and it also reflects the extent to which these principal components preserve the original information.

[0107] Specifically, in the embodiments of this application, the first two or three principal components can be understood as comprehensive features formed by linear combination of original variables such as flow rate at each time period, flow rate near the flood peak, flood volume, and receding process; if the generated sample and the original sample highly overlap on the PC1-PC2 plane, it indicates that the generated sample is close to the real data in terms of global statistical structure such as flood volume, flood peak, and process morphology.

[0108] In fact, due to the different units of the variables, using the sample covariance matrix for principal component analysis is often inaccurate. Therefore, the sample correlation matrix can be used instead of the covariance matrix, and the subsequent calculation process is the same as above. In practical applications, from Extract from variables m Each principal component requires further analysis of this new... m To provide a reasonable interpretation for each variable, it is often necessary to make judgments based on the specific problem and to consider the proportion of the original variables preserved in the principal component, that is, to solve for the factor loadings of the principal component and the original variables. ; in, For the first The principal components in the original... i Factor loadings of each variable (representing the variable's factor loadings) For principal components (the degree of importance) For the first The eigenvalues ​​of the principal components For the covariance array Line number Column elements, For the first The th eigenvector of the th feature vector OK.

[0109] If principal component analysis is performed using a correlation matrix, then the factor loadings are: ; in, For the first The principal components in the original... i Factor loadings of each variable (representing the variable's factor loadings) For principal components (the degree of importance) For the first The eigenvalues ​​of the principal components For the covariance array Line number Column elements, For the first The th eigenvector of the th feature vector OK.

[0110] For example, in the t-distributed random neighbor embedding evaluation process, the high-dimensional data points of t-SNE are the expanded single rainstorm flood sample vectors described above, and the low-dimensional data points are the coordinates of the sample in the two-dimensional visualization plane. If the original samples and generated samples under the same rainfall pattern are mixed in the t-SNE diagram, and the local cluster structure formed by the responses of different rainfall patterns or different control sections is maintained, it indicates that the generated samples not only have similar statistical distributions, but also retain the local topological relationships of the real flood process.

[0111] t-SNE is a nonlinear dimensionality reduction method primarily used for visualizing high-dimensional data. It maps high-dimensional data to a low-dimensional space while preserving the local structure of the data. Given high-dimensional data points... and Similarity in high-dimensional space is defined as: ; in, For conditional similarity probabilities in high-dimensional space, For the high-dimensional primordial space One sample point, For the high-dimensional primordial space One sample point, For sample points The bound Gaussian standard deviation, For the high-dimensional primordial space One sample point, For sample points The bound Gaussian standard deviation.

[0112] Given low-dimensional data points and Similarity in low-dimensional space is defined as: ; in, For conditional similarity probabilities in low-dimensional space, For the low-dimensional primitive space One sample point, For the low-dimensional primitive space One sample point, For the low-dimensional primitive space 1 sample point.

[0113] Optimization objective: Minimize the Kullback-Leibler divergence between the high-dimensional similarity distribution and the low-dimensional similarity distribution, expressed as: ; in, The Kullback-Leibler divergence is the similarity distribution between the high-dimensional space and the low-dimensional space. For conditional similarity probabilities in high-dimensional space, represents the conditional similarity probability in low-dimensional space.

[0114] This embodiment uses principal component analysis to statistically determine the spatial overlap ratio between real and generated sample points, i.e., PCA dimensionality reduction overlap. Based on the Kullback-Leibler divergence between the high-dimensional and low-dimensional spatial similarity distributions of t-distributed random neighbor embedding, two-dimensional embedding coordinates are obtained. The t-SNE dimensionality reduction overlap ratio is then calculated by statistically determining the overlap ratio between the two types of sample points. Higher PCA and t-SNE dimensionality reduction overlap ratios result in higher accuracy of the target rainstorm and flood data generation model.

[0115] In some optional implementations, representative control sections are selected, and the physical rationality of the generated data samples is verified against actual flood events with the same rainfall pattern, similar rainfall intensity, and underlying surface conditions. The selection of control sections follows the principles of representativeness, data integrity, and clear hydraulic connections, prioritizing nodes that can reflect the runoff generation and confluence process, such as watershed outlet sections, major tributary inlets, key hydrological stations or reservoir control sections, and urban flood control sensitive sections. For each rainfall pattern, samples from the generated samples that are similar to the measured events in terms of rainfall duration, total rainfall, peak location, and prior wet conditions are selected. At the corresponding control sections, indicators such as peak flow, peak time, total flood volume, rise and fall duration, receding curve slope, and process correlation coefficient are compared. When the generated process satisfies constraints such as non-negative flow, the sequence of peaks being consistent with the upstream and downstream propagation time, and the flood volume matching the rainfall intensity, the generated sample is deemed to have physical rationality.

[0116] The training method for the rainstorm and flood data generation model provided in this embodiment performs Cartesian combination on the model hyperparameters to generate multiple sets of candidate hyperparameters, realizing a systematic traversal of the hyperparameter space. Historical data, rainfall pattern labels, measured flood data, and each set of candidate hyperparameters are input into the initial rainstorm and flood data generation model for training. Rainfall pattern labels are used as conditional constraints in the training process of each set of hyperparameters, so that the model under different hyperparameters learns the mapping relationship between rainfall pattern and flood, ensuring that multiple sets of training results are fair and comparable.

[0117] This embodiment provides a training method for a rainstorm and flood data generation model, which can be used with computer equipment. Figure 5 This is a third flowchart of a training method for a rainstorm and flood data generation model according to an embodiment of the present invention, as shown below. Figure 5 As shown, the process includes the following steps: In the data processing stage, raw rainfall data and raw flow data are input, and rainfall pattern identification is performed with seven rainfall patterns to obtain a preprocessed dataset. In the model training stage, the dataset is input into the model, which includes an autoencoder network and a generative adversarial network. The autoencoder network includes an embedding module and a reproduction module, and the generative adversarial network includes a generation module and a discriminator module. Latent spatial features are obtained based on the autoencoder network and the generative adversarial network. A supervised error loss function is determined based on the latent spatial features. A first data reconstruction loss function is obtained based on the autoencoder network, and a second data reconstruction loss function is obtained based on the generative adversarial network. The supervised error loss function, the first data reconstruction loss function, and the second data reconstruction loss function are jointly trained to obtain the target rainstorm and flood data generation model.

[0118] This invention addresses the shortcomings of traditional generative adversarial networks (GANs) in characterizing the long-range dependence and dynamic evolution of hydrological time series. By introducing a self-attention mechanism into the model, it enables the model to dynamically capture the correlation strength between different moments within the sequence, thus overcoming the sequence propagation limitations of recurrent neural networks. Experimental results show that the generated data and measured data exhibit high consistency in distribution within the PCA and t-SNE dimensionality reduction spaces, with a cluster overlap rate greater than 90% and a flood peak synchronization error of less than 10%, effectively overcoming the problems of weak temporal correlation and insufficient physical mechanism in existing methods. Furthermore, it enhances the model's generalization ability to extreme floods with multiple rainfall patterns. Many related techniques are limited to single GAN structures and do not consider rainfall pattern differences and their coupling relationship with flood response. This invention employs fuzzy pattern recognition to classify historical rainstorm floods into seven rainfall patterns and performs collaborative modeling based on rainfall pattern characteristics, resulting in generated rainstorm flood samples with better coverage and representativeness in terms of rainfall pattern diversity. This provides flood prediction models with more comprehensive and differentiated training data, significantly improving the model's generalization ability for extreme floods of different rainfall patterns (especially those with peak rainfall in the middle or end of the rainfall period), and more effectively avoiding overfitting compared to existing methods. It provides a dual-quantitative quality verification system to ensure the reliability of the synthesized data, as related technologies lack systematic evaluation methods for the quality of generated hydrological data. This invention employs a dimensionality reduction visualization method combining principal component analysis and t-distributed random neighbor embedding to evaluate the distribution characteristics of the generated data and the original samples from two dimensions: global variance preservation (PCA) and local structural similarity (t-SNE). In actual measurements, the synthesized data successfully reproduced the cluster distribution pattern of 13 hydrological stations in the original dataset, and highly matched the distribution of the measured data, providing quantifiable dual verification for the reliability and usability of the generated samples, filling the gap in existing methods for evaluating the quality of synthesized flood data. This invention aims to shift flood forecasting from a "data-scarce" to a "data-driven" model, improving forecast efficiency and accuracy. Under conditions of severe scarcity of extreme rainfall and flood samples, it generates high-quality synthetic datasets that combine physical plausibility, temporal consistency, and rainfall pattern diversity. This not only provides large-scale data support for runoff generation and confluence mechanism analysis and intelligent model training, reducing reliance on external measured extreme samples, but also effectively reduces the risk of overfitting in extreme scenarios by expanding the coverage of training samples. When applied to actual flood forecasting, it can significantly improve the timeliness and reliability of forecasts and warnings, facilitating the technological leap from "data-scarce" to "data-driven" flood forecasting models.

[0119] This embodiment provides a training method for a rainstorm and flood data generation model, which can be used with computer equipment. Figure 6 This is a flowchart of a method for generating rainstorm and flood data according to an embodiment of the present invention, such as... Figure 6 As shown, the process includes the following steps: Step S601: Obtain real-time rainstorm and flood data for the study area, identify the rainfall pattern for each real-time rainfall event in the real-time rainstorm and flood data, and obtain the real-time rainfall pattern label for each real-time rainfall event.

[0120] The method for identifying the rainfall pattern of each real-time rainfall event in the real-time rainstorm and flood data is the same as the method for identifying the rainfall pattern of each rainfall event in the historical rainstorm and flood data.

[0121] Step S602: Input real-time rainstorm and flood data and real-time rainfall type labels into the system. Figure 2 or Figure 3 or Figure 5 The training method for the rainstorm and flood data generation model is used to train the target rainstorm and flood data generation model and obtain sample data of the rainstorm and flood process.

[0122] The input to the target rainstorm and flood data generation model is real-time rainstorm and flood data and real-time rainfall pattern labels. The output of the target rainstorm and flood data generation model is sample data of the rainstorm and flood process. The input to the target rainstorm and flood data generation model may also include the expected number of samples to be generated, the sequence length, and the random noise sequence. The input to the target rainstorm and flood data generation model may also include the rainfall-flow process under the corresponding rainfall pattern or the flood flow sequence of the specified control section.

[0123] The rainstorm and flood data generation method provided in this embodiment performs rain pattern recognition on real-time rainfall events to obtain real-time rain pattern labels, transforms the temporal pattern of real-time rainfall into a model-recognizable label, realizes automatic analysis of the rain pattern of newly occurring real-time rainfall, takes real-time rainstorm and flood data and real-time rainfall pattern labels as input conditions to the target rainstorm and flood data generation model, and outputs rainstorm and flood process sample data. It can generate a large number of flood process samples that conform to the statistical characteristics of the rain pattern based on real-time rainfall conditions, expand the hydrological sample library in scenarios where measured flood samples are scarce, and provide a large amount of simulated flood condition data for flood simulation and risk assessment.

[0124] This embodiment also provides a training device for a rainstorm and flood data generation model. This device is used to implement the above embodiments and preferred embodiments, and details already described will not be repeated. As used below, the term "module" can be a combination of software and / or hardware that performs a predetermined function. Although the device described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.

[0125] This embodiment provides a training device for a rainstorm and flood data generation model, such as... Figure 7 As shown, it includes: The rainfall pattern recognition module 701 is used to acquire historical rainstorm and flood data of the study area, identify the rainfall pattern of each rainfall event in the historical rainstorm and flood data, and obtain the rainfall pattern label of each rainfall event.

[0126] Model building module 702 is used to build an initial rainstorm and flood data generation model based on autoencoder networks, generative adversarial networks, and self-attention mechanisms.

[0127] The initial training module 703 is used to obtain multiple sets of candidate hyperparameters and to train the initial rainstorm and flood data generation model based on historical rainstorm and flood data, rain pattern labels, actual rainstorm and flood data, and each set of candidate hyperparameters.

[0128] The parameter selection module 704 is used to evaluate the training results and determine the target candidate hyperparameter set from multiple candidate hyperparameter sets based on the evaluation results.

[0129] The model training module 705 is used to train the initial rainstorm and flood data generation model based on historical rainstorm and flood data, rain pattern labels, actual rainstorm and flood data, and the target candidate hyperparameter set, so as to obtain the target rainstorm and flood data generation model.

[0130] In some alternative implementations, the rain pattern recognition module 701 includes: The feature vector determination unit is used to divide each rainfall event in historical rainstorm and flood data into multiple equal time periods, and obtain the rainfall pattern feature vector of each rainfall event based on the ratio of rainfall in each equal time period to the total rainfall.

[0131] The similarity analysis unit is used to obtain the modal vectors of multiple standard rainfall patterns. It performs similarity analysis on the rainfall pattern feature vector of each rainfall event and the modal vector of each standard rainfall pattern, and obtains multiple similarity analysis results.

[0132] The rain pattern recognition unit is used to identify the rain pattern of each rainfall event based on multiple similarity analysis results, and obtain the rain pattern label for each rainfall event.

[0133] In some alternative implementations, the model building module 702 includes: The model building unit is used to build an autoencoder based on an autoencoder network, and to build a generator and discriminator based on a generative adversarial network. The self-attention mechanism is embedded in the generator and discriminator. The autoencoder is used to compress and map high-dimensional rainfall time series data to a low-dimensional latent space. The generator is used to receive random noise and output synthetic flood latent features. The discriminator is used to determine the adversarial loss.

[0134] The model assembly unit is used to assemble the autoencoder, the generator with embedded self-attention mechanism, and the discriminator to obtain the initial rainstorm and flood data generation model.

[0135] In some alternative implementations, the model initial training module 703 includes: The parameter combination unit is used to generate multiple hyperparameters of the model based on the initial rainstorm and flood data, and to perform Cartesian combination of multiple hyperparameters to obtain multiple sets of candidate hyperparameters.

[0136] The initial training unit is used to input historical rainstorm and flood data, rainfall pattern labels, actual rainstorm and flood data, and each set of candidate hyperparameters into the initial rainstorm and flood data generation model for training.

[0137] In some alternative implementations, the parameter selection module 704 includes: The parameter evaluation unit is used to obtain the training results corresponding to each set of candidate hyperparameters, and to determine the reconstruction loss and dimensionality reduction overlap of the training results corresponding to each set of candidate hyperparameters.

[0138] The parameter selection unit is used to select the target candidate hyperparameter set from multiple candidate hyperparameter sets based on the reconstruction loss and dimensionality reduction overlap of the training results corresponding to each candidate hyperparameter set.

[0139] This embodiment provides a rainstorm and flood data generation device, such as... Figure 8 As shown, it includes: The real-time rainfall pattern recognition module 801 is used to acquire real-time rainstorm and flood data of the study area, perform rainfall pattern recognition on each real-time rainfall event in the real-time rainstorm and flood data, and obtain the real-time rainfall pattern label for each real-time rainfall event.

[0140] Data generation module 802 is used to input real-time rainstorm and flood data and real-time rainfall pattern labels into the system. Figure 2 or Figure 3 or Figure 5 The training method for the rainstorm and flood data generation model is used to train the target rainstorm and flood data generation model and obtain sample data of the rainstorm and flood process.

[0141] The training apparatus for the rainstorm and flood data generation model provided in this embodiment of the invention can execute the training method for the rainstorm and flood data generation model provided in any embodiment of the invention. The rainstorm and flood data generation apparatus provided in this embodiment of the invention can execute the rainstorm and flood data generation method provided in any embodiment of the invention, and possesses the corresponding functional modules and beneficial effects for executing the method. Further functional descriptions of the above modules and units are the same as in the corresponding embodiments described above, and will not be repeated here.

[0142] Figure 9 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention.

[0143] The following is a detailed reference. Figure 9 This diagram illustrates a structural schematic suitable for implementing an electronic device according to embodiments of the present invention. The electronic device may include a processor (e.g., a central processing unit, graphics processor, etc.) 901, which can perform various appropriate actions and processes according to a program stored in read-only memory (ROM) 902 or a program loaded from memory 908 into random access memory (RAM) 903. The RAM 903 also stores various programs and data required for the operation of the electronic device. The processor 901, ROM 902, and RAM 903 are interconnected via a bus 904. An input / output (I / O) interface 905 is also connected to the bus 904.

[0144] Typically, the following devices can be connected to I / O interface 905: input devices 906 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 907 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; memory devices 908 including, for example, magnetic tapes, hard disks, etc.; and communication devices 909. Communication device 909 allows electronic devices to exchange data via wireless or wired communication with other devices. Although Figure 9 Electronic devices with various devices are shown, but it should be understood that it is not required to implement or have all of the devices shown, and more or fewer devices may be implemented or have instead.

[0145] In particular, according to embodiments of the present invention, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of the present invention include a computer program product comprising a computer program carried on a non-transitory computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device 909, or installed from a memory 908, or installed from a ROM 902. When the computer program is executed by the processor 901, it performs the functions defined in the training method of the rainstorm and flood data generation model or the rainstorm and flood data generation method of the embodiments of the present invention.

[0146] Figure 9 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of use of the embodiments of the present invention.

[0147] This invention also provides a computer-readable storage medium. The methods described above according to embodiments of the invention can be implemented in hardware or firmware, or implemented as computer code that can be recorded on a storage medium, or implemented as computer code downloaded via a network and originally stored on a remote storage medium or a non-transitory machine-readable storage medium and then stored on a local storage medium. Thus, the methods described herein can be processed by software stored on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. The storage medium can be a magnetic disk, optical disk, read-only memory, random access memory, flash memory, hard disk, or solid-state drive, etc.; further, the storage medium can also include combinations of the above types of memory. It is understood that the computer, processor, microprocessor controller, or programmable hardware includes storage components capable of storing or receiving software or computer code. When the software or computer code is accessed and executed by the computer, processor, or hardware, the training method or rainstorm flood data generation method of the rainstorm flood data generation model shown in the above embodiments is implemented.

[0148] A portion of this invention can be applied as a computer program product, such as computer program instructions, which, when executed by a computer, can invoke or provide the methods and / or technical solutions according to the invention through the operation of the computer. Those skilled in the art will understand that the forms in which computer program instructions exist in a computer-readable medium include, but are not limited to, source files, executable files, installation package files, etc. Correspondingly, the ways in which computer program instructions are executed by a computer include, but are not limited to: the computer directly executing the instructions, or the computer compiling the instructions and then executing the corresponding compiled program, or the computer reading and executing the instructions, or the computer reading and installing the instructions and then executing the corresponding installed program. Here, the computer-readable medium can be any available computer-readable storage medium or communication medium accessible to a computer.

[0149] Although embodiments of the invention have been described in conjunction with the accompanying drawings, those skilled in the art can make various modifications and variations without departing from the spirit and scope of the invention, and such modifications and variations all fall within the scope defined by the appended claims.

Claims

1. A training method for a rainstorm and flood data generation model, characterized in that, The method includes: Historical rainstorm and flood data of the study area are obtained, and rain pattern identification is performed on each rainfall event in the historical rainstorm and flood data to obtain the rain pattern label of each rainfall event; An initial rainstorm and flood data generation model is constructed based on autoencoder networks, generative adversarial networks, and self-attention mechanisms. Multiple sets of candidate hyperparameters are obtained, and the initial rainstorm and flood data generation model is trained based on the historical rainstorm and flood data, the rainfall pattern label, the actual rainstorm and flood data, and each set of candidate hyperparameters. The training results are evaluated, and a target candidate hyperparameter set is determined from multiple sets of candidate hyperparameters based on the evaluation results; The initial rainstorm and flood data generation model is trained based on the historical rainstorm and flood data, the rainfall pattern labels, the actual rainstorm and flood data, and the target candidate hyperparameter set to obtain the target rainstorm and flood data generation model.

2. The method according to claim 1, characterized in that, The step of identifying the rainfall pattern for each rainfall event in the historical rainstorm and flood data to obtain a rainfall pattern label for each rainfall event includes: Each rainfall event in the historical rainstorm and flood data is divided into multiple equal time periods. Based on the ratio of rainfall in each equal time period to the total rainfall, a rainfall pattern feature vector for each rainfall event is obtained. Modal vectors of multiple standard rainfall patterns are obtained, and similarity analysis is performed between the feature vector of the rainfall pattern of each rainfall event and the modal vector of each standard rainfall pattern to obtain multiple similarity analysis results; Rain type identification is performed on each rainfall event based on multiple similarity analysis results to obtain the rain type label for each rainfall event.

3. The method according to claim 1 or 2, characterized in that, The initial rainstorm and flood data generation model is constructed based on autoencoder networks, generative adversarial networks, and self-attention mechanisms, including: An autoencoder is constructed based on the autoencoder network, and a generator and a discriminator are constructed based on the generative adversarial network. The self-attention mechanism is embedded in the generator and the discriminator. The autoencoder is used to compress and map high-dimensional rainfall time-series data to a low-dimensional latent space. The generator is used to receive random noise and output synthesized flood latent features. The discriminator is used to determine the adversarial loss. The autoencoder, the generator embedded with the self-attention mechanism, and the discriminator are assembled to obtain the initial rainstorm and flood data generation model.

4. The method according to claim 1 or 2, characterized in that, The process of obtaining multiple sets of candidate hyperparameters and training the initial rainstorm and flood data generation model based on the historical rainstorm and flood data, the rainfall pattern labels, the actual rainstorm and flood data, and each set of candidate hyperparameters includes: Based on the multiple hyperparameters of the initial rainstorm and flood data generation model, Cartesian combinations are performed on the multiple hyperparameters to obtain multiple sets of candidate hyperparameters; The historical rainstorm and flood data, the rainfall pattern labels, the actual rainstorm and flood data, and each set of candidate hyperparameters are input into the initial rainstorm and flood data generation model for training.

5. The method according to claim 1 or 2, characterized in that, The step of evaluating the training results and determining the target candidate hyperparameter set from multiple candidate hyperparameter sets based on the evaluation results includes: Obtain the training results corresponding to each set of candidate hyperparameters, and determine the reconstruction loss and dimensionality reduction overlap of the training results corresponding to each set of candidate hyperparameters. Based on the reconstruction loss and dimensionality reduction overlap of the training results corresponding to each set of candidate hyperparameters, the target candidate hyperparameter set is selected from multiple sets of candidate hyperparameters.

6. A method for generating rainstorm and flood data, characterized in that, The method includes: Acquire real-time rainstorm and flood data of the study area, identify the rainfall pattern for each real-time rainfall event in the real-time rainstorm and flood data, and obtain the real-time rainfall pattern label for each real-time rainfall event; The real-time rainstorm and flood data and the real-time rainfall pattern label are input into the target rainstorm and flood data generation model trained by the training method of the rainstorm and flood data generation model as described in any one of claims 1-5, so as to obtain sample data of the rainstorm and flood process.

7. A training device for a rainstorm and flood data generation model, characterized in that, The device includes: The rainfall pattern recognition module is used to acquire historical rainstorm and flood data of the study area, perform rainfall pattern recognition on each rainfall event in the historical rainstorm and flood data, and obtain the rainfall pattern label for each rainfall event; The model building module is used to build an initial rainstorm and flood data generation model based on autoencoder networks, generative adversarial networks, and self-attention mechanisms. The initial training module is used to obtain multiple sets of candidate hyperparameters and train the initial rainstorm and flood data generation model based on the historical rainstorm and flood data, the rain type labels, the actual rainstorm and flood data, and each set of candidate hyperparameters. The parameter selection module is used to evaluate the training results and determine the target candidate hyperparameter set from multiple sets of candidate hyperparameters based on the evaluation results. The model training module is used to train the initial rainstorm and flood data generation model based on the historical rainstorm and flood data, the rain pattern labels, the actual rainstorm and flood data, and the target candidate hyperparameter set, so as to obtain the target rainstorm and flood data generation model.

8. A rainstorm and flood data generation device, characterized in that, The device includes: The real-time rainfall pattern recognition module is used to acquire real-time rainstorm and flood data of the study area, perform rainfall pattern recognition on each real-time rainfall event in the real-time rainstorm and flood data, and obtain a real-time rainfall pattern label for each real-time rainfall event. The data generation module is used to input the real-time rainstorm and flood data and the real-time rainfall pattern label into the target rainstorm and flood data generation model trained by the training method of the rainstorm and flood data generation model as described in any one of claims 1-5, so as to obtain sample data of the rainstorm and flood process.

9. An electronic device, characterized in that, include: The system includes a memory and a processor, which are interconnected. The memory stores computer instructions, and the processor executes the computer instructions to perform the training method for the rainstorm and flood data generation model according to any one of claims 1 to 5 or the rainstorm and flood data generation method according to claim 6.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions for causing the computer to execute the training method of the rainstorm and flood data generation model according to any one of claims 1 to 5 or the rainstorm and flood data generation method according to claim 6.