Adaptive algorithm-based outburst flow prediction method
By introducing generative adversarial network, attention mechanism and adaptive particle swarm optimization algorithm in the prediction of earth-rock dam collapse flow, the problems of scarce data and poor generalization capabilities in the existing prediction models are solved, and high-precision collapse peak flow prediction is achieved.
Patent Information
- Application Number
- CN202510526544.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-25
- Publication Date
- 2025-05-30
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The existing peak flow prediction model for earth and rock dam collapse has problems such as scarcity of data, insufficient feature extraction and poor generalization capabilities, resulting in limited prediction accuracy.
The crash traffic prediction method based on adaptive algorithm is adopted to enhance the historical crash traffic data by introducing a generative adversarial network, and an attention mechanism is introduced into the generative adversarial network to improve the expression ability and prediction performance of the support vector machine model. At the same time, the adaptive particle swarm optimization algorithm is used to adjust the parameters of the support vector machine model to enhance its generalization ability.
It significantly improves the prediction accuracy and stability of the model, realizes accurate prediction of the peak flow of the earth and rock dam collapse, and solves the problems of scarce data, insufficient feature extraction and poor generalization capabilities of the model.
Smart Images

Figure CN120069232A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of machine learning, and particularly relates to a method for predicting breach discharge based on an adaptive algorithm. Background Art
[0002] Accurate prediction of the peak discharge of earth-rock dam breaches is of great significance for flood control and disaster reduction, decision-making support, and post-disaster recovery. In recent years, many scholars have tried to use various methods to predict the peak discharge of earth-rock dam breaches. Common methods include traditional hydrodynamic models, machine learning models, and deep learning models.
[0003] Currently, existing earth-rock dam breach peak discharge prediction models generally have the following problems: First, in the prediction of earth-rock dam breach discharge, data scarcity is a common problem, especially for some rare or special breach events, and historical data is often limited; Second, traditional prediction methods often cannot fully extract the deep features in the data when facing complex input data, which will lead to limited prediction accuracy; Third, traditional machine learning algorithms and models are prone to overfitting or low prediction accuracy when facing high-dimensional and diverse input data.
[0004] Therefore, how to improve the accuracy of earth-rock dam breach peak discharge prediction and achieve accurate prediction of earth-rock dam breach peak discharge is an urgent problem to be solved by those skilled in the art. Summary of the Invention
[0005] In view of this, the present invention provides a method for predicting breach discharge based on an adaptive algorithm to improve the accuracy of earth-rock dam breach peak discharge prediction and achieve accurate prediction of earth-rock dam breach peak discharge.
[0006] Therefore, the present invention provides a method for predicting breach discharge based on an adaptive algorithm, including the following steps: S1: Collect the breach discharge data of the earth-rock dam to be predicted, and preprocess the collected breach discharge data; S2: Input the preprocessed data into the trained support vector machine model to obtain the peak breach discharge of the earth-rock dam to be predicted; Wherein, the training process of the support vector machine model is as follows: S11: Collect the breach discharge data of the breached earth-rock dams, preprocess the collected breach discharge data to obtain historical breach discharge data; S12: Design a generative adversarial network with an attention enhancement mechanism, and use the generative adversarial network to augment the historical breach flow data to obtain a breach flow data set; wherein, the generative adversarial network includes a generator and a discriminator; the generator is used to generate breach flow data through random noise and adjust the generated breach flow data when the discriminator feedbacks that the generated breach flow data is non-real data; the discriminator is used to compare the generated breach flow data with the historical breach flow data and output true and false probability values; when the true and false probability values are greater than or equal to the first threshold, add the generated breach flow data to the historical breach flow data; when the true and false probability values are less than or equal to the second threshold, the discriminator feedbacks to the generator that the generated breach flow data is non-real data; the attention enhancement mechanism is used to extract and weight the features of the historical breach flow data, enhance the discriminator's ability to identify the important features of the historical breach flow data, and guide the generator to learn the important features of the historical breach flow data; S13: Divide the breach flow data set into a training set and a test set; S14: Construct a support vector machine model, input the training set into the support vector machine model, and use the adaptive particle swarm optimization algorithm to train the support vector machine model until the preset maximum number of iterations is reached or the minimum error threshold of the loss function is reached.
[0007] In a possible implementation, in the above-mentioned breach flow prediction method based on the adaptive algorithm provided by the present invention, after the support vector machine model is trained, the following steps are further included: S15: Input the training set and the test set into the trained support vector machine model to obtain the predicted values of the breach peak flow; calculate the root mean square error, determination coefficient and mean absolute error corresponding to the training set, calculate the root mean square error, determination coefficient and mean absolute error corresponding to the test set, and evaluate the performance of the support vector machine model.
[0008] In a possible implementation, in the above-mentioned breach flow prediction method based on the adaptive algorithm provided by the present invention, in step S1, collect the breach flow data of the earth-rock dam to be predicted, and preprocess the collected breach flow data, which is specifically implemented by the following method: Collect the breach flow data of the earth-rock dam to be predicted, including the dam height, reservoir capacity, porosity, and their corresponding peak breach flows; take the dam height, reservoir capacity, porosity, and their corresponding peak breach flows at the same time point as a sample, take the dam height, reservoir capacity, and porosity as input data, and take the peak breach flow corresponding to the dam height, the peak breach flow corresponding to the reservoir capacity, and the peak breach flow corresponding to the porosity as output data, and normalize the input data and output data to [0,1] through mapminmax.
[0009] In a possible implementation manner, in the above-mentioned breach flow prediction method based on the adaptive algorithm provided by the present invention, in S11, collect the breach flow data of the breached earth-rock dams, and preprocess the collected breach flow data to obtain historical breach flow data, which is specifically implemented in the following manner: Collect the breach flow data of the breached earth-rock dams, including the dam height, reservoir capacity, porosity, and their corresponding peak breach flows; take the dam height, reservoir capacity, porosity, and their corresponding peak breach flows at the same time point as a sample, take the dam height, reservoir capacity, and porosity as input data, and take the peak breach flow corresponding to the dam height, the peak breach flow corresponding to the reservoir capacity, and the peak breach flow corresponding to the porosity as output data, and normalize the input data and output data to [0,1] through mapminmax.
[0010] In a possible implementation manner, in the above-mentioned breach flow prediction method based on the adaptive algorithm provided by the present invention, in step S12, the objective function of the generative adversarial network is: (1) Among them, represents the distribution of real data, represents the distribution of random noise, and the generator generates breach flow data by inputting random noise z , and the discriminator D is used to distinguish real data x and the generated breach flow data ; the first term of the objective function means that the discriminator hopes to maximize the recognition ability of real data, so that is close to 1; the second term of the objective function means that the discriminator hopes to minimize the misjudgment of the generated breach flow data, so that is close to 0.
[0011] In a possible implementation manner, in the above-mentioned breach flow prediction method based on the adaptive algorithm provided by the present invention, in step S12, the introduced attention enhancement mechanism specifically includes: Preset the query matrix Q, key matrix K, and value matrix V, , , ; where represents the number of queries, represents the number of keys, represents the dimensions of the query matrix and the key matrix, represents the dimension of the value matrix, and R represents the prefix of the matrix dimension; Calculate the attention score matrix Attention Scores through matrix multiplication, ; where represents the transpose of the key matrix; the size of the attention score matrix is , representing the similarity between each query and each key; Scale the attention score matrix to obtain the scaled attention score matrix Scaled Scores, ; where represents the square root of the dimension of the key matrix; Apply the softmax function to each row in the scaled attention score matrix to obtain the attention weight matrix Attention Weights, ; Perform matrix multiplication on the attention weight matrix and the value matrix to obtain the weighted sum output matrix Attention Output, , and the output matrix is the breach flow dataset.
[0012] In a possible implementation manner, in the above-mentioned breach flow prediction method based on the adaptive algorithm provided by the present invention, in step S12, the value range of the first threshold is , and the value range of the second threshold is .
[0013] In a possible implementation manner, in the above-mentioned breach flow prediction method based on the adaptive algorithm provided by the present invention, in step S14, use the adaptive particle swarm optimization algorithm to train the support vector machine model until the preset maximum number of iterations is reached or the loss function minimization error threshold is reached, which is specifically implemented in the following manner: Initialize the particle swarm: Set the size of the particle swarm and initialize the position and velocity of each particle; the position of the particle represents a set of parameters, which consists of the regularization parameter C and the kernel function parameter ; the velocity of the particle represents a two-dimensional vector, and each component corresponds to the change amount of C and 's change amount respectively; initialize the individual optimal position of each particle and the global optimal position of the entire particle swarm. The individual optimal position is the best position found by each particle during the search process, and the global optimal position is the best position found in the entire particle swarm; Evaluate the fitness value of particles: Define a fitness function to evaluate each particle and calculate the fitness value of each particle; Update the position and velocity of particles: Update the individual optimal position of each particle according to its fitness value; If the fitness value of the current particle is better than that of the particle at the global optimal position, update the position of the current particle to the global optimal position; Calculate the new position of each particle using the updated position formula and calculate the new velocity of each particle using the updated velocity formula; Repeat the operations of evaluating the fitness value of particles and updating the position and velocity of particles until the preset maximum number of iterations is reached or the minimum error threshold of the loss function is achieved.
[0014] In a possible implementation, in the above-mentioned method for predicting breach flow based on an adaptive algorithm provided by the present invention, the fitness function is: (2) (3) (4) Wherein, represents the fitness value of the i-th particle, represents the weight of, represents the weight of; represents the accuracy of the support vector machine model corresponding to the i-th particle, N represents the total number of particles, represents the true category of the i-th particle, represents the predicted category of the support vector machine model for the i-th particle; is an indicator function that returns 1 when the condition in the parentheses holds, otherwise returns 0; represents the complexity of the support vector machine model corresponding to the i-th particle, represents the position value of the i-th particle in the particle swarm in the first dimension, represents the position value of the i-th particle in the particle swarm in the second dimension.
[0015] In a possible implementation, in the above-mentioned method for predicting breach flow based on an adaptive algorithm provided by the present invention, the updated velocity formula is: (5) Wherein, represents the updated velocity of the particle; represents the inertia weight, which is used to control the tendency of the particle to maintain its current velocity; represents the velocity of the particle at the current moment; Represents the individual learning factor, which is used to adjust the intensity of the particle moving towards its own individual optimal position; Represents the social learning factor, which is used to adjust the intensity of the particle moving towards the global optimal position; Represents a random function within the range of [0, 1]; Represents the individual optimal position, Represents the global optimal position; Represents the current position of the particle; The updated position formula is: (6) Among them, Represents the position of the particle after update.
[0016] The above-mentioned method for predicting the breach flow based on the adaptive algorithm provided by the present invention, by introducing a generative adversarial network to perform data augmentation on historical breach flow data and generating more diverse historical data as the training set, can help the support vector machine model still obtain good training effects in the case of scarce data; introducing an attention mechanism in the generative adversarial network can automatically focus on the important features in the data and improve the expression ability and prediction performance of the support vector machine model; adjusting the parameters of the support vector machine model through the adaptive particle swarm optimization algorithm can enhance the generalization ability of the support vector machine model, enabling it to better adapt to different earth-rock dam breach scenarios; the present invention uses the generative adversarial network model and the attention mechanism to perform data augmentation on the training set and inputs the augmented training set into the support vector machine model optimized by the adaptive particle swarm. Through data augmentation and feature adaptive adjustment, the prediction accuracy and stability of the model can be significantly improved, realizing the accurate prediction of the peak flow of the earth-rock dam breach, thereby solving the problems of scarce data, insufficient feature extraction, and poor model generalization ability in the existing methods, and having broad application prospects in the field of earth-rock dam breach flow prediction. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] Figure 1 It is a schematic flowchart of the training process of the support vector machine model in a method for predicting the breach flow based on the adaptive algorithm provided by the present invention; Figure 2 It is a schematic flowchart of training the support vector machine model by using the adaptive particle swarm optimization algorithm in a method for predicting the breach flow based on the adaptive algorithm provided by the present invention; Figure 3a It is a prediction result graph of the peak breach flow on the test set of the existing PSO-SVM model in Embodiment 1 of the present invention; Figure 3b It is a prediction result graph of the peak breach flow on the test set of the adaptive PSO-SVM model of the present invention in Embodiment 1 of the present invention. Specific Embodiment
[0018] The following combines the accompanying drawings to detail the specific embodiment of a method for predicting breach flow based on an adaptive algorithm provided by the present invention.
[0019] A method for predicting breach flow based on an adaptive algorithm provided by the present invention may include the following steps: First step: Collect the breach flow data of the earth-rock dam to be predicted and preprocess the collected breach flow data.
[0020] In specific implementation, during the collection and preprocessing stage of the breach flow data of the earth-rock dam to be predicted, it can be specifically implemented in the following way: (1) Collect the breach flow data of the earth-rock dam to be predicted, including the dam height, reservoir capacity, porosity, peak breach flow corresponding to the dam height, peak breach flow corresponding to the reservoir capacity, and peak breach flow corresponding to the porosity.
[0021] (2) Take the dam height, reservoir capacity, porosity, peak breach flow corresponding to the dam height, peak breach flow corresponding to the reservoir capacity, and peak breach flow corresponding to the porosity at the same time point as a sample. Take the dam height, reservoir capacity, and porosity as input data, and take the peak breach flow corresponding to the dam height, peak breach flow corresponding to the reservoir capacity, and peak breach flow corresponding to the porosity as output data. Normalize the input data and output data to [0,1] through mapminmax.
[0022] Second step: Input the preprocessed data into the trained support vector machine model to obtain the peak breach flow of the earth-rock dam to be predicted.
[0023] Specifically, input the preprocessed data into the trained support vector machine model, and the support vector machine model can output the peak breach flow of the earth-rock dam to be predicted, thus completing the prediction of the breach flow of the earth-rock dam to be predicted.
[0024] The following details the training process of the support vector machine model. In specific implementation, the training process of the support vector machine model, as Figure 1 shown, may include the following steps: First step: Collect the breach flow data of the breached earth-rock dams, preprocess the collected breach flow data, and obtain historical breach flow data.
[0025] In specific implementation, during the collection and preprocessing stage of the breach flow data of the breached earth-rock dams, it can be specifically implemented in the following way: (1) Collect the breach flow data of the breached earth-rock dams, including the dam height, reservoir capacity, porosity, peak breach flow corresponding to the dam height, peak breach flow corresponding to the reservoir capacity, and peak breach flow corresponding to the porosity.
[0026] (2) Take the dam height, reservoir capacity, porosity, peak breach discharge corresponding to the dam height, peak breach discharge corresponding to the reservoir capacity, and peak breach discharge corresponding to the porosity at the same time point as a sample. Take the dam height, reservoir capacity, and porosity as input data, and take the peak breach discharge corresponding to the dam height, peak breach discharge corresponding to the reservoir capacity, and peak breach discharge corresponding to the porosity as output data. Normalize the input data and output data to [0, 1] through mapminmax.
[0027] Step 2: Design a generative adversarial network with an attention enhancement mechanism, and use the generative adversarial network to augment the historical breach discharge data to obtain a breach discharge dataset.
[0028] Specifically, the generative adversarial network (GAN) includes a generator and a discriminator. Train the generator to generate breach discharge data similar to the historical breach discharge data. Specifically, the generator can generate breach discharge data through random noise, and adjust the generated breach discharge data when the discriminator feedbacks that the generated breach discharge data is not real data; the discriminator can compare the generated breach discharge data with the historical breach discharge data and output true and false probability values, so as to judge whether the generated breach discharge data is real data.
[0029] Specifically, the objective function of the generative adversarial network is: (1) Among them, represents the distribution of real data, represents the distribution of random noise, and the generator generates breach discharge data by inputting random noise z , and the discriminator D is used to distinguish real data x and the generated breach discharge data . During the training process, the goal of the discriminator is to maximize its ability to judge real data. The first term of the objective function means that the discriminator hopes to maximize its ability to recognize real data, so that is close to 1; the second term of the objective function means that the discriminator hopes to minimize the misjudgment of the generated breach discharge data, so that is close to 0. The goal of the generator is to maximize the judgment probability of the discriminator for the generated data, so that the generated breach discharge data can deceive the discriminator, that is, make as close to 1 as possible. Through this "game" training process, the generator gradually learns to generate breach discharge data that can "deceive" the discriminator, and the final generated data distribution will be as close as possible to the real data distribution.
[0030] The true / false probability value output by the discriminator represents the likelihood that the input data is real data. The input data can be generated breach flow data or historical breach flow data. When the discriminator discriminates the generated breach flow data, the mathematical expression of the output true / false probability value is ; when the discriminator discriminates the historical breach flow data, the mathematical expression of the output true / false probability value is . When the true / false probability value is greater than or equal to the first threshold, the generated breach flow data is added to the historical breach flow data; when the true / false probability value is less than or equal to the second threshold, the discriminator feeds back to the generator that the generated breach flow data is not real data. The value range of the first threshold can be [0.8, 1), and the value range of the second threshold can be (0, 0.2]. For example, taking the first threshold as 0.8 and the second threshold as 0.2 as an example, when the true / false probability value ≥ 0.8, the generated breach flow data is determined to be real data (historical breach flow data); when the true / false probability value ≤ 0.2, the generated breach flow data is determined to be generated data (data synthesized by the generator), and the discriminator will feed back to the generator that the generated breach flow data is not real data. After receiving the feedback from the discriminator, the generator will adjust the generated breach flow data to make its data distribution gradually approach the historical breach flow data until the true / false probability value output by the discriminator is greater than or equal to the first threshold. When the statistical characteristics (such as mean, variance, and probability distribution) of the breach flow data generated by the generator match the historical breach flow data, it indicates that the quality of the generated breach flow data is high and it is similar to the historical breach flow data, and it can be added to the historical breach flow data set, effectively expanding the breach flow data set.
[0031] It should be noted that the generative adversarial network can enhance the training data for breach flow prediction, thereby helping the support vector machine model extract information from more diverse training data, and further improving the accuracy of breach flow prediction. It should be explained that in the present invention, the historical breach flow data is expanded through the generative adversarial network. Compared with traditional data enhancement methods, such as the SMOTE (Synthetic Minority Over-sampling Technique) method or the enhancement method based on simulation data generation, the generated breach flow data has stronger diversity and higher data quality.
[0032] Furthermore, in order to enhance the learning ability of the generator for the important features of historical breach flow data and improve the quality of the generated breach flow data, the present invention introduces an attention enhancement mechanism into the generative adversarial network. The introduced attention enhancement mechanism can enhance the discriminator's ability to recognize the important features of historical breach flow data and its ability to distinguish between real data and generated data by extracting and weighting the features of historical breach flow data, thereby guiding the generator to learn the important features of historical breach flow data and improving the detail fidelity of the generated breach flow data.
[0033] In specific implementation, the introduced attention enhancement mechanism may include the following: presetting a query matrix Q, a key matrix K, and a value matrix V, , , ; where represents the number of queries, represents the number of keys, represents the dimension of the query matrix and the key matrix, represents the dimension of the value matrix, and R represents the prefix of the matrix dimension; calculating the attention score matrix Attention Scores through matrix multiplication, ; where represents the transpose of the key matrix; the size of the attention score matrix is , representing the similarity between each query and each key; scaling the attention score matrix to obtain the scaled attention score matrix Scaled Scores, ; where represents the square root of the dimension of the key matrix; applying the softmax function to each row in the scaled attention score matrix to obtain the attention weight matrix Attention Weights, ; multiplying the attention weight matrix by the value matrix to obtain the weighted sum output matrix Attention Output, , and the output matrix is the breach flow data set.
[0034] It should be noted that the present invention generates diverse training data through the generative adversarial network and combines the attention mechanism to enhance the features of the training data, so that the support vector machine model can better focus on the important features related to breach flow prediction, thereby significantly improving the prediction accuracy of the support vector machine model under complex non-linear relationships, enhancing its adaptability to changes in sample distribution, effectively avoiding overfitting, and improving the generalization performance of the support vector machine model.
[0035] Step 3: Divide the breach flow data set into a training set and a test set.
[0036] Specifically, for the division of the breach flow dataset, 80% of the breach flow dataset can be used as the training set, and 20% of the breach flow dataset can be used as the test set.
[0037] Step 4: Construct a support vector machine model, input the training set into the support vector machine model, and use the adaptive particle swarm optimization algorithm to train the support vector machine model until the preset maximum number of iterations is reached or the minimum error threshold of the loss function is reached.
[0038] In specific implementation, a support vector machine (SVM) model can be constructed using the RBF (radial basis function) kernel. The adaptive particle swarm optimization algorithm is used to train the support vector machine model to obtain the optimal parameters of the support vector machine model. The optimal parameters are the regularization parameter C and the kernel function parameter optimal solution. The support vector machine model is trained using the optimal parameters until the preset maximum number of iterations is reached or the minimum error threshold of the loss function is reached, that is, the trained support vector machine model is obtained. The minimum error threshold of the loss function here refers to that when training the support vector machine model, the error of the model drops below a certain predetermined minimum value or the error change is very small, indicating that the model has converged and no further optimization is required. Specifically, the adaptive particle swarm optimization algorithm is used to train the support vector machine model, as Figure 2 shown, it can be achieved through the following methods: (1) Initialize the particle swarm: Set the size of the particle swarm, initialize the position and velocity of each particle. Each particle represents a candidate solution, that is, a set of parameters to be optimized. They are continuously updated in the search space, and the goal is to find the parameter combination that makes the SVM model perform optimally on the data; the position of the particle represents a set of parameters, composed of the regularization parameter C and the kernel function parameter ; the velocity of the particle represents a two-dimensional vector, and each component corresponds to the change amount of C and change amount respectively. The change amount includes the moving step size and the update direction; initialize the individual optimal position of each particle and the global optimal position of the entire particle swarm. The individual optimal position is the best position found by each particle during the search process, and the global optimal position is the best position found in the entire particle swarm.
[0039] (2) Evaluate the fitness value of the particle: Define a fitness function to evaluate each particle and calculate the fitness value of each particle.
[0040] Specifically, the defined fitness function is: (2) (3) (4) Among them, denotes the fitness value of the \(i\)th particle; the \(i\)th particle represents a candidate solution in the adaptive particle swarm optimization algorithm, and its position vector is , including model parameters such as the penalty factor and kernel function parameters of the support vector machine, etc.; the position of the \(i\)th particle in the search space determines the performance of its corresponding support vector machine model; denotes the weight of denotes the weight of denotes the accuracy rate of the support vector machine model corresponding to the \(i\)th particle, \(N\) denotes the total number of particles, denotes the true category of the \(i\)th particle, denotes the predicted category of the support vector machine model for the \(i\)th particle; is an indicator function that returns 1 when the condition in the parentheses holds, otherwise returns 0; denotes the complexity of the support vector machine model corresponding to the \(i\)th particle, denotes the position value of the \(i\)th particle in the particle swarm at the first dimension, denotes the position value of the \(i\)th particle in the particle swarm at the second dimension.
[0041] (3) Update the position and velocity of the particle: Update the individual optimal position of each particle according to its fitness value; if the fitness value of the current particle is better than that of the particle at the global optimal position, then update the position of the current particle to the global optimal position; Calculate the new position of each particle using the updated position formula and calculate the new velocity of each particle using the updated velocity formula.
[0042] Specifically, the updated velocity formula is: (5) where denotes the updated velocity of the particle; denotes the inertia weight, which is used to control the tendency of the particle to maintain its current velocity; denotes the velocity of the particle at the current moment; denotes the individual learning factor, which is used to adjust the intensity of the particle moving towards its own individual optimal position; denotes the social learning factor, which is used to adjust the intensity of the particle moving towards the global optimal position; denotes a random function in the range \([0, 1]\); denotes the individual optimal position, denotes the global optimal position; denotes the current position of the particle; The updated position formula is: (6) Among them, represents the position of the particle after update.
[0043] (4) Repeat step (2) to evaluate the fitness value of the particle and step (3) to update the position and velocity of the particle until the preset maximum number of iterations is reached or the minimum error threshold of the loss function is achieved.
[0044] It should be noted that the present invention uses an adaptive particle swarm optimization (PSO) algorithm to optimize the parameters of the support vector machine model. Compared with the existing genetic (GA) algorithm or ant colony optimization (ACO) algorithm, the convergence speed and search efficiency are higher, which is more suitable for the requirements of the present invention.
[0045] In summary, after the iterative training is completed, the trained support vector machine model is obtained. After the support vector machine model is trained, in order to ensure that the support vector machine model has good prediction performance and generalization ability in practical applications, as Figure 2 shown, the following steps may also be included: The fifth step: Perform performance evaluation on the trained support vector machine model.
[0046] Specifically, it can be implemented in the following way: Input the training set and the test set into the trained support vector machine model to obtain the predicted value of the peak breach discharge; calculate the root mean square error (RMSE), coefficient of determination (R²), and mean absolute error (MAE) corresponding to the training set, calculate the root mean square error, coefficient of determination, and mean absolute error corresponding to the test set, and perform performance evaluation on the support vector machine model.
[0047] It should be noted that if the support vector machine model meets the preset performance evaluation index threshold, the support vector machine model can be used for accurate prediction of the breach discharge of the earth-rock dam; if the support vector machine model does not meet the preset performance evaluation index threshold, the support vector machine model needs to be retrained, and it is necessary to optimize the training by means of manual adjustment attempts or optimization algorithms until the support vector machine model meets the preset performance evaluation index threshold.
[0048] After obtaining the trained and evaluated support vector machine model, it can be used for accurate prediction of the breach discharge data of the earth-rock dam to be predicted. Specifically, first, collect the breach discharge data of the earth-rock dam to be predicted, preprocess the collected breach discharge data, and then input the preprocessed data into the trained and evaluated support vector machine model to obtain the peak breach discharge of the earth-rock dam to be predicted, thereby realizing accurate prediction of the breach discharge data of the earth-rock dam to be predicted.
[0049] It should be noted that in addition to using the root mean square error, coefficient of determination, and mean absolute error to evaluate the performance of the support vector machine model, the present invention can also perform denormalization processing on the prediction results, restore the data to the actual value range, draw a comparison chart of the prediction results, compare the actual values and predicted values of the training set, and compare the actual values and predicted values of the test set, so as to intuitively display the prediction performance of the support vector machine model.
[0050] The following is a specific embodiment to detail the specific implementation of the above-mentioned dam-break flow prediction method based on the adaptive algorithm provided by the present invention.
[0051] Embodiment 1: 40 groups of earth-rock dam break cases were obtained through independent experiments as historical dam-break flow data. The 40 groups of historical dam-break flow data were extended to 200 groups through a generative adversarial network to obtain a historical dam-break flow data set. The existing PSO-SVM model and the adaptive PSO-SVM model in the present invention were used to predict the peak dam-break flow respectively. Four parameters were involved in the analysis: dam height, reservoir capacity, porosity, and peak dam-break flow; among them, the dam height, reservoir capacity, and porosity were used as input parameters, and the peak dam-break flow was used as the output parameter. The historical dam-break flow data set (i.e., the earth-rock dam break flow characteristic data) was divided into a training set and a test set according to a ratio of 8:2. The prediction results are as Figure 3a and Figure 3b shown. From Figure 3a and Figure 3b it can be seen that for the same historical dam-break flow data set, the RMSE of the adaptive PSO-SVM model in the present invention on the test set is 0.015085, and the RMSE of the existing PSO-SVM model on the test set is 0.019196. The root mean square error (RMSE) of the adaptive PSO-SVM model in the present invention on the test set is reduced by 21.43% compared with the existing PSO-SVM model. It can be verified that the above-mentioned dam-break flow prediction method based on the adaptive algorithm provided by the present invention has significant advantages in improving the prediction accuracy, indicating that by introducing an adaptive strategy to optimize the particle update mechanism, it is possible to more effectively search for the optimal parameter combination, thereby improving the fitting ability and generalization performance of the support vector machine model in the peak dam-break flow prediction task.
[0052] A method for predicting breach flow based on an adaptive algorithm provided by the present invention enhances historical breach flow data through the introduction of a generative adversarial network, generating more diverse historical data as a training set, which can help the support vector machine model obtain good training effects even in the case of scarce data; introducing an attention mechanism into the generative adversarial network can automatically focus on important features in the data, improving the expression ability and prediction performance of the support vector machine model; adjusting the parameters of the support vector machine model through an adaptive particle swarm optimization algorithm can enhance the generalization ability of the support vector machine model, enabling it to better adapt to different earth-rock dam breach scenarios; the present invention uses the generative adversarial network model and the attention mechanism to enhance the training set, and inputs the enhanced training set into the support vector machine model optimized by the adaptive particle swarm. Through data enhancement and feature adaptive adjustment, the prediction accuracy and stability of the model can be significantly improved, achieving accurate prediction of the peak flow of earth-rock dam breaches, thus solving problems such as scarce data, insufficient feature extraction, and poor model generalization ability in existing methods, and having broad application prospects in the field of earth-rock dam breach flow prediction.
[0053] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalent technologies, the present invention also intends to include these changes and modifications.
Claims
1. A method for predicting burst flow based on an adaptive algorithm, characterized in that: The steps include: S1: Collect the outburst flow data of the earth-rock dam to be predicted, and pre-process the collected outburst flow data; S2: Input the preprocessed data into the trained support vector machine model to obtain the peak flow of the earth-rock dam to be predicted; The training process of the support vector machine model is as follows: S11: collecting burst flow data of collapsed earth-rock dams, preprocessing the collected burst flow data, and obtaining historical burst flow data; S12: Design a generative adversarial network that introduces an attention enhancement mechanism, and use the generative adversarial network to expand the historical traffic flow data to obtain a traffic flow data set; wherein the generative adversarial network includes a generator and a discriminator; the generator is used to generate traffic flow data through random noise, and adjust the generated traffic flow data when the discriminator feeds back that the generated traffic flow data is not real data; the discriminator is used to compare the generated traffic flow data with the historical traffic flow data, and output a true or false probability value; when the true or false probability value is greater than or equal to a first threshold, the generated traffic flow data is added to the historical traffic flow data; when the true or false probability value is less than or equal to a second threshold, the discriminator feeds back to the generator that the generated traffic flow data is not real data; the attention enhancement mechanism is used to extract and weight the features of the historical traffic flow data, enhance the discriminator's ability to recognize the important features of the historical traffic flow data, and guide the generator to learn the important features of the historical traffic flow data; S13: dividing the burst flow data set into a training set and a test set; S14: constructing a support vector machine model, inputting the training set into the support vector machine model, and training the support vector machine model using an adaptive particle swarm optimization algorithm until a preset maximum number of iterations is reached or a loss function minimization error threshold is reached.
2. The method for predicting burst flow based on an adaptive algorithm according to claim 1, characterized in that: After the support vector machine model training is completed, the following steps are also included: S15: Input the training set and the test set into the trained support vector machine model to obtain the predicted value of the peak burst flow; calculate the root mean square error, determination coefficient and mean absolute error corresponding to the training set, calculate the root mean square error, determination coefficient and mean absolute error corresponding to the test set, and perform performance evaluation on the support vector machine model.
3. The method for predicting burst flow based on an adaptive algorithm according to claim 1, characterized in that: Step S1, collecting the burst flow data of the earth-rock dam to be predicted, and preprocessing the collected burst flow data, which is specifically achieved by the following methods: Collect the burst flow data of the earth-rock dam to be predicted, including dam height, reservoir capacity, porosity and their corresponding peak burst flows; take the dam height, reservoir capacity, porosity and their corresponding peak burst flows at the same time point as a sample, take the dam height, reservoir capacity and porosity as input data, take the peak burst flow corresponding to the dam height, the peak burst flow corresponding to the reservoir capacity and the peak burst flow corresponding to the porosity as output data, and normalize the input data and output data to [0,1] through mapminmax.
4. The method for predicting burst flow based on an adaptive algorithm according to claim 1, characterized in that: S11, collecting the burst flow data of the breached earth-rock dam, pre-processing the collected burst flow data, and obtaining the historical burst flow data, which is specifically achieved by the following methods: The burst flow data of collapsed earth-rock dams were collected, including dam height, reservoir capacity, porosity and their corresponding peak burst flows. The dam height, reservoir capacity, porosity and their corresponding peak burst flows at the same time point were taken as a sample, the dam height, reservoir capacity and porosity were taken as input data, the peak burst flow corresponding to the dam height, the peak burst flow corresponding to the reservoir capacity and the peak burst flow corresponding to the porosity were taken as output data, and the input data and output data were normalized to [0,1] through mapminmax.
5. The method for predicting burst flow based on an adaptive algorithm according to claim 1, characterized in that: In step S12, the objective function of the generative adversarial network is: (1) in, represents the distribution of real data, Represents the distribution of random noise. The generator generates burst flow data by inputting random noise z , the discriminator D is used to distinguish the real data x from the generated burst flow data ; The first term of the objective function It means that the discriminator hopes to maximize the recognition ability of real data, so Close to 1; the second term of the objective function It means that the discriminator hopes to minimize the misjudgment of the generated burst flow data, so that Close to 0.
6. The method for predicting burst flow based on an adaptive algorithm according to claim 1, characterized in that: In step S12, the attention enhancement mechanism introduced specifically includes: Preset query matrix Q, key matrix K and value matrix V, , , ;in, Indicates the number of queries, Indicates the number of keys, represents the dimensions of the query matrix and key matrix, Represents the dimension of the value matrix, and R represents the prefix of the matrix dimension; Calculate the attention score matrix Attention Scores through matrix multiplication, ;in, represents the transpose of the key matrix; the size of the attention score matrix is , represents the similarity between each query and each key; The attention score matrix is scaled to obtain a scaled attention score matrix Scaled Scores, ;in, represents the square root of the dimension of the key matrix; Apply the softmax function to each row in the scaled attention score matrix to obtain the attention weight matrix Attention Weights, ; Perform matrix multiplication of the attention weight matrix and the value matrix to obtain the weighted summed output matrix Attention Output, , the output matrix is a burst flow data set.
7. The method for predicting burst flow based on an adaptive algorithm according to claim 1, characterized in that: In step S12, the value range of the first threshold is , the value range of the second threshold is .
8. The method for predicting burst flow based on an adaptive algorithm according to claim 1, characterized in that: In step S14, the support vector machine model is trained using an adaptive particle swarm optimization algorithm until a preset maximum number of iterations is reached or a loss function minimization error threshold is reached, which is specifically achieved in the following manner: Initialize the particle swarm: set the size of the particle swarm and initialize the position and velocity of each particle; the position of the particle represents a set of parameters, which are composed of the regularization parameter C and the kernel function parameter The particle's velocity represents a two-dimensional vector, each component of which corresponds to the change in C and Initialize the individual optimal position of each particle and the global optimal position of the entire particle swarm, where the individual optimal position is the best position found by each particle during the search process, and the global optimal position is the best position found by the entire particle swarm; Evaluate the fitness value of particles: define a fitness function to evaluate each particle and calculate the fitness value of each particle; Update the position and speed of particles: update the individual optimal position of each particle according to its fitness value; if the fitness value of the current particle is better than the fitness value of the particle at the global optimal position, update the position of the current particle to the global optimal position; use the updated position formula to calculate the new position of each particle, and use the updated speed formula to calculate the new speed of each particle; The fitness value of the particle is evaluated and the position and velocity of the particle are updated repeatedly until the preset maximum number of iterations is reached or the loss function minimization error threshold is reached.
9. The method for predicting burst flow based on an adaptive algorithm according to claim 8, characterized in that: The fitness function is: (2) (3) (4) in, represents the fitness value of the i-th particle, express The weight of express The weight of represents the accuracy of the support vector machine model corresponding to the i-th particle, N represents the total number of particles, represents the true category of the ith particle, represents the predicted category of the i-th particle by the support vector machine model; It is an indicator function that returns 1 when the condition in the brackets is true, otherwise it returns 0; represents the complexity of the support vector machine model corresponding to the i-th particle, represents the position value of the i-th particle in the particle swarm in the first dimension, Represents the position value of the i-th particle in the particle swarm in the second dimension.
10. The method for predicting burst flow based on an adaptive algorithm according to claim 8, characterized in that: The updated speed formula is: (5) in, Indicates the updated velocity of the particle; Represents the inertia weight, which is used to control the tendency of particles to maintain their current speed; Indicates the velocity of the particle at the current moment; represents the individual learning factor, which is used to adjust the intensity of the particle moving to its own individual optimal position; represents the social learning factor, which is used to adjust the intensity of particles moving to the global optimal position; represents a random function in the range [0,1]; represents the optimal position of an individual, represents the global optimal position; Indicates the current position of the particle; The updated position formula is: (6) in, Indicates the updated position of the particle.
Citation Information
Patent Citations
Medium and long term runoff forecasting method based on improved particle swarm optimization algorithm and support vector machine
CN112818608A
Drainage basin multi-point water level prediction and early warning method based on generative adversarial network
CN115688579A
Earth and rockfill dam burst flow prediction method based on data enhancement and adaptive network
CN119558231A
Earth and rockfill dam burst peak flow prediction method based on elite strategy
CN119784194A
Prediction method and system of high slope deformation
US20210049515A1
Cited By
Earth and rockfill dam outburst flow prediction method based on physical consistency and attention mechanism
CN121256223A
Method for predicting earth-rock dam breaching discharge based on physical consistency and attention mechanism
CN121256223B