CN117875504A - Dam break prediction and model training method and device, electronic equipment and storage medium - Google Patents

Dam break prediction and model training method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN117875504A
CN117875504A CN202410056883.1A CN202410056883A CN117875504A CN 117875504 A CN117875504 A CN 117875504A CN 202410056883 A CN202410056883 A CN 202410056883A CN 117875504 A CN117875504 A CN 117875504A
Authority
CN
China
Prior art keywords
dam
training
dam break
break prediction
model
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202410056883.1A
Other languages
Chinese (zh)
Inventor
陈新海
刘杰
颜君峻
龚春叶
杨博
王庆林
张庆阳
李胜国
甘新标
陈旭光
肖调杰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
National University of Defense Technology
Original Assignee
National University of Defense Technology
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by National University of Defense Technology filed Critical National University of Defense Technology
Priority to CN202410056883.1A priority Critical patent/CN117875504A/en
Publication of CN117875504A publication Critical patent/CN117875504A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q10/00Administration; Management
    • G06Q10/04Forecasting or optimisation specially adapted for administrative or management purposes, e.g. linear programming or "cutting stock problem"
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/214Generating training patterns; Bootstrap methods, e.g. bagging or boosting
    • G06F18/2155Generating training patterns; Bootstrap methods, e.g. bagging or boosting characterised by the incorporation of unlabelled data, e.g. multiple instance learning [MIL], semi-supervised techniques using expectation-maximisation [EM] or naïve labelling
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/0499Feedforward networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • G06N3/084Backpropagation, e.g. using gradient descent
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • G06N3/0895Weakly supervised learning, e.g. semi-supervised or self-supervised learning
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q50/00Information and communication technology [ICT] specially adapted for implementation of business processes of specific business sectors, e.g. utilities or tourism
    • G06Q50/10Services
    • G06Q50/26Government or public services
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2123/00Data types
    • G06F2123/02Data types in the time domain, e.g. time-series data
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02ATECHNOLOGIES FOR ADAPTATION TO CLIMATE CHANGE
    • Y02A10/00TECHNOLOGIES FOR ADAPTATION TO CLIMATE CHANGE at coastal zones; at river basins
    • Y02A10/40Controlling or monitoring, e.g. of flood or hurricane; Forecasting, e.g. risk assessment or mapping

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Business, Economics & Management (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • General Engineering & Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Evolutionary Computation (AREA)
  • General Health & Medical Sciences (AREA)
  • Human Resources & Organizations (AREA)
  • Tourism & Hospitality (AREA)
  • Molecular Biology (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Computational Linguistics (AREA)
  • Computing Systems (AREA)
  • Strategic Management (AREA)
  • Biomedical Technology (AREA)
  • Economics (AREA)
  • Biophysics (AREA)
  • General Business, Economics & Management (AREA)
  • Marketing (AREA)
  • Development Economics (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Evolutionary Biology (AREA)
  • Primary Health Care (AREA)
  • Educational Administration (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Game Theory and Decision Science (AREA)
  • Entrepreneurship & Innovation (AREA)
  • Operations Research (AREA)
  • Quality & Reliability (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The application discloses dam break prediction and model training method and device, electronic equipment and readable storage medium, and is applied to the technical field of artificial intelligence. The method comprises the steps of dispersing a time-space domain corresponding to a dam bank data training sample set into a two-dimensional grid and generating a training data point set. Constructing a dam break prediction model by using a fully-connected neural network model which takes space-time coordinates as input, predicts a physical field as output and comprises a plurality of hidden layers; and selecting sampling points meeting the conditions from the dam bank data sampling points by taking a physical information model describing the dam break phenomenon as a confidence coefficient as pseudo tag training data points. And determining a dam break prediction loss function of the dam break prediction model based on the training data point set and the pseudo tag training data point set, and training the dam break prediction model. The dam break prediction method and device can solve the problem that the dam break prediction precision and efficiency of the related technology cannot meet the actual demands of users, and can effectively improve the dam break prediction precision and efficiency.

Description

Dam break prediction and model training method and device, electronic equipment and storage medium
Technical Field
The present disclosure relates to the field of artificial intelligence, and in particular, to a dam break prediction and model training method, apparatus, electronic device, and readable storage medium thereof.
Background
Dam break, i.e. dam break, is a disastrous water flow phenomenon, and in order to reduce the damage of dam break, related technologies generally utilize pins (Physics-informed Neural Networks, physical information neural network) to analyze a mathematical model describing the dam break problem, and predict the dam break by simultaneously learning the distribution rule of training data samples and the physical law described by the mathematical model.
However, the accuracy of the dam break result predicted by the PINN is not high, and the training process of the PINN is not easily converged, so that the dam break prediction efficiency is not high.
In view of this, improving accuracy and efficiency of dam break prediction is a technical problem that one skilled in the art needs to solve.
Disclosure of Invention
The application provides a dam break prediction and model training method, device, electronic equipment and readable storage medium thereof, which can effectively improve the accuracy and efficiency of dam break prediction.
In order to solve the technical problems, the application provides the following technical scheme:
in one aspect, the present application provides a dam break prediction model training method, including:
dispersing a time-space domain corresponding to a dam bank data training sample set into a two-dimensional grid, and generating a training data point set by analyzing the two-dimensional grid; the training data point set comprises dam bank data sampling points, water flow boundary points and initial water depth points;
Constructing a dam break prediction model for predicting the free water surface height after the dam break phenomenon occurs based on a fully-connected neural network model which takes space-time coordinates as input, predicts a physical field as output and comprises a plurality of hidden layers; the predicted physical field comprises a water flow speed and a free water surface height;
selecting a target sampling point meeting a preset confidence coefficient condition from the dam bank data sampling points as a pseudo tag training data point based on a physical information model describing dam break phenomenon as a confidence coefficient;
determining a dam break prediction loss function of the dam break prediction model based on the dam bank data sampling point, the water flow speed boundary point, the initial water depth point and the pseudo tag training data point respectively;
and training the dam break prediction model through the dam break prediction loss function by utilizing the training data points and the pseudo tag training data points until a preset model termination condition is met.
Illustratively, the dispersing the time-space domain corresponding to the dam bank data training sample set into a two-dimensional grid, and generating the training data point set by analyzing the two-dimensional grid includes:
dispersing a space domain in which the position information of the dam data training sample set is located into a first position vector and a second position vector, and dispersing a time domain in which the time information of the dam data training sample set is located into a time vector;
Combining the first position vector, the second position vector and the time vector, calling a grid creation function to generate a first position grid, a second position grid and a time grid, and stretching the first position grid, the second position grid and the time grid to a one-dimensional vector with a target length;
and correspondingly storing the first position grid, the second position grid and the time grid into a pre-constructed dam bank data sampling point storage structure, a water flow speed boundary point storage structure and an initial water depth point storage structure respectively.
Illustratively, the selecting, based on the physical information model describing the dam break phenomenon as the confidence, the target sampling point satisfying the preset confidence condition from the dam bank data sampling points as the pseudo tag training data point includes:
in the training process of each turn of the dam break prediction model, current dam bank data sampling points acquired in a current batch are input into the dam break prediction model under the current training turn to obtain a current prediction physical field;
calculating a residual value of the physical information model based on the current predicted physical field;
selecting a target residual value meeting a preset confidence coefficient condition from residual values obtained in each turn;
And taking dam bank data sampling points of batches corresponding to each target residual value as pseudo tag training data points.
Illustratively, training the dam break prediction model with the dam break prediction loss function using the training data points and the pseudo tag training data points comprises:
invoking a gradient clearing function to clear the gradient stored by the optimizer;
the automatic derivative function is called to conduct counter-propagation on the dam break prediction loss function, and the automatic derivative method is called to implicitly calculate gradient according to a chain rule;
and calling a model parameter updating function, and updating the weight parameters of the dam break prediction model by using the calculated new gradient.
Illustratively, the determining the dam break prediction loss function of the dam break prediction model based on the dam bank data sampling point, the water flow rate boundary point, the initial water depth point, and the pseudo tag training data point, respectively, includes:
obtaining a physical control loss item, a boundary loss item, an initial loss item and a pseudo tag loss item according to the dam break prediction model on the data sampling points of the dam bank, the water flow speed boundary points, the initial water depth points and the prediction data of the pseudo tag training data points, the physical information model, the water flow boundary conditions and the initial water depth conditions;
And determining the dam break prediction loss function according to the physical control loss term, the boundary loss term, the initial loss term, the pseudo tag loss term and the weight factors thereof.
Exemplary, the predicting data of the dam bank data sampling point, the water flow speed boundary point, the initial water depth point and the pseudo tag training data point according to the dam break prediction model, the physical information model, the water flow boundary condition and the initial water depth condition, obtains a physical control loss term, a boundary loss term, an initial loss term and a pseudo tag loss term, including:
inputting the current training data point and the current pseudo-label training data point acquired in the current batch into a dam break prediction model under the current training round to obtain a sampling prediction physical field;
determining a sampling residual value of the physical information model based on the sampling prediction physical field, and determining a physical mean square error of the sampling prediction physical field;
determining a physical control loss term according to the sampling residual value and the physical mean square error;
selecting a plurality of water flow speed boundary sampling points from the training data points, and inputting each water flow speed boundary sampling point into a dam break prediction model under the current training round to obtain water flow speed prediction information;
Determining boundary residual values corresponding to water flow boundary conditions based on the water flow speed prediction information, and determining boundary mean square errors of the predicted water flow information;
determining a boundary loss term according to the boundary residual value and the boundary mean square error;
selecting a plurality of initial water depth sampling points from the training data points, and inputting each initial water depth sampling point into a dam break prediction model under the current training round to obtain water depth prediction information;
determining an initial residual value corresponding to an initial water depth condition based on the water depth prediction information, and determining an initial mean square error of the water depth prediction information;
determining an initial loss term according to the initial residual value and the initial mean square error;
selecting a plurality of pseudo tag sampling points from the pseudo tag training data points, and inputting each pseudo tag sampling point into a dam break prediction model under the current training round to obtain pseudo tag prediction information;
and determining a pseudo tag loss term according to the mean square error of the pseudo tag prediction information.
In one aspect, the present application provides a dam break prediction method, including:
training in advance by using the dam break prediction model training method according to any one of the previous claims to obtain a dam break prediction model;
Acquiring a physical information model to be tested and current dam bank data for describing dam break phenomena of a dam to be tested;
based on the physical information model to be detected and the current dam bank data, calling the dam break prediction model to predict and obtain the target water flow speed and the target free water surface height of the dam to be detected;
and generating dam break prediction information of the dam to be tested according to the target water flow speed and the target free water surface height.
Another aspect of the present application provides a dam break prediction model training device, including:
the training data generation module is used for dispersing a time-space domain corresponding to the dam bank data training sample set into a two-dimensional grid and generating a training data point set by analyzing the two-dimensional grid; the training data point set comprises dam bank data sampling points, water flow boundary points and initial water depth points;
the model building module is used for building a dam break prediction model for predicting the free water surface height after the dam break phenomenon occurs based on a fully-connected neural network model which takes space-time coordinates as input, predicts a physical field as output and comprises a plurality of hidden layers; the predicted physical field comprises a water flow speed and a free water surface height;
the false label generating module is used for selecting a target sampling point meeting the preset confidence condition from the dam bank data sampling points as a false label training data point based on a physical information model describing the dam break phenomenon of the dam to be tested as the confidence;
The loss function determining module is used for determining a dam break prediction loss function of the dam break prediction model based on the dam bank data sampling point, the water flow speed boundary point, the initial water depth point and the pseudo tag training data point respectively;
and the model training module is used for training the dam break prediction model through the dam break prediction loss function by utilizing the training data points and the pseudo tag training data points until a preset model termination condition is met.
The application also provides an electronic device comprising a processor for implementing the steps of the dam break prediction model training method and/or the dam break prediction method as described in any one of the preceding claims when executing a computer program stored in a memory.
The present application finally provides a readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of the dam break prediction model training method and/or the dam break prediction method as described in any of the preceding claims.
The technical scheme provided by the application has the advantages that the self-training mechanism is introduced into the training of the dam break prediction model for predicting the free water surface height after the dam break phenomenon occurs, and the utilization rate of physical information in the unsupervised training data points is improved. In the training process, a physical information model describing the dam break phenomenon is used as a confidence level to select a pseudo tag training data point from sampling points, positive feedback is formed between the pseudo tag training data point and the training process, the convergence speed and the training efficiency of the dam break prediction model can be improved, further, the pseudo tag training data point is gradually generated and continuously updated in the iteration process, the vibration phenomenon in the self-training physical information network training process can be alleviated, the training process is more stable, the prediction precision and the training efficiency of the dam break prediction model can be effectively improved, the prediction precision and the efficiency of the dam break prediction model on the free water surface height after the dam break phenomenon are improved, and the change condition of the free water surface height along with time after the dam break phenomenon is effectively and highly accurately obtained.
In addition, the application also provides a dam break prediction method, a corresponding implementation device, electronic equipment and a readable storage medium aiming at the training method of the dam break prediction model, so that the method has practicability, and the dam break prediction method, the device, the electronic equipment and the readable storage medium have corresponding advantages.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the application.
Drawings
For a clearer description of the technical solutions of the present application or of the related art, the drawings that are required to be used in the description of the embodiments or of the related art will be briefly described, and it is obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained according to these drawings without inventive effort for a person of ordinary skill in the art.
FIG. 1 is a schematic diagram of a two-dimensional radial dam break of an exemplary application scenario provided herein;
FIG. 2 is a schematic diagram of a two-dimensional radial dam break at 0.5s after dam break in an exemplary application scenario provided herein;
FIG. 3 is a schematic diagram of a two-dimensional radial dam break at 1s after dam break in an exemplary application scenario provided herein;
FIG. 4 is a schematic diagram of a physical information neural network of an exemplary application scenario provided herein;
fig. 5 is a schematic flow chart of a dam break prediction model training method provided in the present application;
FIG. 6 is a flowchart of another dam break prediction model training method provided in the present application;
fig. 7 is a schematic flow chart of a dam break prediction method provided in the present application;
FIG. 8 is a block diagram of a specific embodiment of a dam-break prediction model training device provided in the present application;
fig. 9 is a block diagram of an embodiment of an electronic device provided in the present application.
Detailed Description
In order to provide a better understanding of the present application, those skilled in the art will now make further details of the present application with reference to the drawings and detailed description. Wherein the terms "first," "second," "third," "fourth," and the like in the description and in the claims and in the above-described figures, are used for distinguishing between different objects and not for describing a particular sequential order. Furthermore, the terms "comprise" and "have," as well as any variations of the two, are intended to cover a non-exclusive inclusion. The term "exemplary" means "serving as an example, embodiment, or illustration. Any embodiment described herein as "exemplary" is not necessarily to be construed as preferred or advantageous over other embodiments.
The dam break problem is one of the works in the hydrodynamic computing process, and a physical information model describing the physical phenomenon generally adopts a mathematical model of a partial differential equation, wherein the partial differential equation (namely, PDEs) is an equation containing a partial derivative (or partial differential) of an unknown function, and has a wide reference in the fields of physics and engineering, and a basic form of the PDEs is generally defined by the following relational expressions (1) - (3):
N[u(x,t);λ]=f(x,t),x∈Ω,t∈(0,T] (1)
where λ is an unknown equation parameter and u (x, t) is the potential solution of the equation. f (x, t) is the source term of the equation, and g (x, t) and h (x) are the boundary condition and the initial condition, respectively. N and B are nonlinear partial differential operators, and those skilled in the art can base partial differential equations described using any of the related techniques, none of which affect the implementation of the present application. The related art generally uses a shallow water equation (Shallow Water Equation) as a physical information model describing a dam break phenomenon, which is a classical partial differential equation, taking a two-dimensional shallow water equation as an example, and the related art generally uses the following relations (4) - (6) to represent the shallow water equation:
wherein u and v represent the speeds in the horizontal and vertical directions, respectively; h represents the water depth and is the main target to be solved for the problem; g r =9.8 is the gravitational acceleration. The equation is derived from the two-dimensional incompressible Navier-Stokes Equations (N-S Equations) and is widely used for the simulation of free surface flow problems. The application aims at a two-dimensional radial dam break scene, and describes the modeling of a circular raised dam with a square central initialization water levelAnd (5) a chemical process. The initial condition of h is shown in the following formula (7):
wherein r is the radius of the circular protruding dam, fig. 1 shows the situation that the dam break phenomenon changes with time, and the center of the square domain at the time t=0 is provided with the circular protruding dam higher than the water surface; after the dam break, the change of the free water level is controlled by the corresponding shallow water, and fig. 2 and 3 also show the corresponding images at the time of t=0.5 s and t=1 s in the subsequent evolution process.
It can be appreciated that the mathematical properties of the shallow water equation are poor and the numerical method is difficult to solve. Neural networks based on physical information, i.e., pins, are typically used to solve supervised learning tasks while respecting any given physical law described by general nonlinear partial differential equations. The training data sample distribution rule can be learned like a traditional neural network, and the physical law described by a mathematical equation can be learned. The related art generally calculates a physical information model such as the shallow water equation described above by using a physical information neural network, that is, adding the physical equation as a constraint to the neural network so that the fitting result satisfies the physical rule, and the architecture is shown in fig. 4. The main structure of PINNs is a fully-connected neural network with space-time coordinates (space coordinates x, y; time coordinates t) as input and physical fields (velocity fields u, v; water surface height h) as output. The method takes physical information such as a physical control equation, boundary conditions, initial value conditions and the like as constraint terms to be put into a loss function of a neural network, so that an equation solving problem is converted into an optimizing problem. During the training process, the optimizer uses gradient descent and back propagation algorithms to optimize the model towards meeting the physical information, thereby calculating the physical information model. For PINNs, data points can be divided into boundary points, initial value points and intra-domain sampling points (sampling points for short) according to the space-time coordinate positions of the read data. Different types of data points correspond to different loss functions, as shown in equations (8) - (11). The sampling points are brought into a control equation, and the residual terms of the sampling points are equation losses, as shown in a formula (8); bringing boundary points into boundary conditions, wherein residual terms are boundary losses, as shown in a formula (9); bringing the initial value point into an initial condition, wherein the residual error term is the initial loss, as shown in a formula (10); finally, the total loss function of the neural network can be obtained by weighted summation of the losses, as shown in the formula (11), the training method and the related framework can be described by referring to any related technology, and the description is omitted here:
L=W f *L f +W b *L b +W 0 *L 0 (11)
However, the use of pins has the problem that accuracy is not high and the training process is prone to non-convergence. In order to solve the technical problem, the method combines a self-training method with the physical information neural network, and trains to obtain the dam break prediction model serving as the self-training physical information neural network. The training process of the physical information neural network comprises a large amount of unsupervised data and a small amount of supervised data, and is a classical semi-supervised learning scene. The self-training mechanism is a semi-supervised learning method common in the machine learning field, and the core idea is to endow samples with large model prediction confidence with a pseudo label. The term "pseudo tag" refers to a model predicted value as a tag, and these data are trained as supervisory data. Therefore, the self-training mechanism can be regarded as a method for converting the unsupervised data into the supervised data, and the method can improve the utilization rate and training efficiency of the data and can effectively improve the accuracy of the dam break prediction model. In an ideal case, with the increase of the training times of the model, the accuracy of the model is continuously increased, the quantity and the quality of the pseudo tag data generated by the model are gradually improved, and the accuracy of the model is further improved by the high-quality and high-quality pseudo tag, so that a positive feedback effect is achieved. The invention utilizes a self-training mechanism to endow pseudo labels to the unsupervised data points with higher confidence of the dam-break prediction model prediction results, and gradually converts the unsupervised data into supervised data, thereby fully utilizing the physical information in the unsupervised data points, accelerating the convergence of the dam-break prediction model and improving the accuracy of the physical information model.
Having described the technical aspects of the present application, various non-limiting embodiments of the present application are described in detail below. Numerous specific details are set forth in the following detailed description in order to provide a better understanding of the present application. It will be understood by those skilled in the art that the present application may be practiced without these specific details. In other instances, well-known methods, procedures, components, and circuits have not been described in detail so as not to obscure the present application.
Referring first to fig. 5, fig. 5 is a schematic flow chart of a dam break prediction method provided in the present application, where the present application may include the following matters:
s501: and dispersing a time-space domain corresponding to the dam bank data training sample set into a two-dimensional grid, and generating a training data point set by analyzing the two-dimensional grid.
In this embodiment, the dam data training sample set is a training sample set for training a dam break prediction model, which may be constructed by acquiring historical dam data and performing a preprocessing operation, where the dam data training sample set includes a large amount of dam data as training samples, and the dam data includes, but is not limited to, historical dam image data, historical tension data, historical water level data, material, size, shape, and inclination angle of the dam body. The data training sample set of the dam bank data is data acquired under space-time coordinates, namely space coordinates and time coordinates, and each dam bank data training sample of the dam bank data training sample set under a time-space domain is subjected to discrete processing and data stored in a two-dimensional grid Analyzing to obtain a dam bank data sampling point, a water flow boundary point and an initial water depth point, and taking the dam bank data sampling point, the water flow boundary point and the initial water depth point as training data points of a follow-up training dam break prediction model
S502: based on a fully-connected neural network model which takes space-time coordinates as input, predicts a physical field as output and comprises a plurality of hidden layers, a dam break prediction model for predicting the free water surface height after the dam break phenomenon occurs is constructed.
In this embodiment, the dam break prediction model may be used to predict the free water surface height after the dam break phenomenon occurs, so as to obtain the situation that the free water surface height changes with time after the dam break phenomenon occurs, which is favorable for maintaining the dam in advance, and making relevant flood control measures. The predicted physical field comprises a water flow speed and a free water surface height; the specific number of hidden layers can be flexibly selected according to actual application scenes, and the application is not limited in any way. For example, in the practical application process, the dam break prediction model building process may include:
step 1, initializing an array Network, wherein the Network can be used for storing a serialization model.
Step 2, adding a full connection layer in the Network, wherein the number of the neurons can be 3, for example, and the number of the neurons represents a space abscissa and a time coordinate;
Step 3, initializing j=1, wherein j represents the hidden layer number of the current constructed neural network;
step 4, adding a full-connection layer into the Network, wherein the number of neurons is 100;
step 5, adding a weight normalization (i.e. weight_norm) layer to the Network;
in step 6, an activation function layer is added to the Network, and the activation function may be, for example, tanh, and of course, other types of activation functions may be used.
Step 7, let j=j+1;
step 8, judging whether j is smaller than 6, if yes, returning to the step 3, and if no, executing the step;
step 9, adding a wholeThe connection layer is used as an output layer, the number of neurons can be 3, for example, and the output speed field is representedAnd->Free water level->
Through the steps 1-9, the construction of the whole dam break prediction model can be completed, and the model is stored in an array Network.
S503: and selecting a target sampling point meeting the preset confidence condition from the dam bank data sampling points as a pseudo tag training data point based on the physical information model describing the dam break phenomenon as the confidence.
In this embodiment, the preset confidence condition is a preset condition based on the confidence, for example, dam bank data sampling points exceeding a preset confidence threshold are target sampling points meeting the preset confidence condition, for example, the dam bank data sampling points with the first n confidence values are sorted from large to small according to the confidence values, and are used as the target sampling points. The pseudo tag training data points are network predictors with high confidence in the training process, which are essentially subsets of the sampling points. In the step, a pseudo tag training data point is generated in each round of training of the dam break prediction model, and the pseudo tag training data point and the training data point set of S501 are used as training sample data of the dam break prediction model together. The pseudo tag data has a separate loss function as a data point independent of the sampling point, the boundary point, and the initial value point, and is described by the following expression (12). Meanwhile, the step screens the pseudo tag training data points according to the physical information model, and can illustratively carry the dam bank data sampling points and the predicted values into the physical information model to obtain residual errors, and the data with small residual errors are given to the pseudo tag. In general, the point with small equation residual error is more likely to be the solution of the equation, so the step has both theoretical basis and practical value:
S504: and determining a dam break prediction loss function of the dam break prediction model based on the dam bank data sampling point, the water flow speed boundary point, the initial water depth point and the pseudo tag training data point.
Based on S501 and S503, the dam break prediction model divides the data points of the training sample into a dam data sampling point, a water flow boundary point and an initial water depth point according to the space-time coordinate position of the read data. Different types of data points correspond to different loss functions, the dam bank data sampling points are brought into a physical information model, and residual items are losses corresponding to the dam bank data sampling points; bringing the water flow speed boundary point into a water flow speed boundary condition, wherein the residual error term is the corresponding loss of the water flow speed boundary point; bringing the initial water depth point into an initial water depth condition, wherein the residual error term is initial loss of the initial water depth point; and finally, carrying out weighted summation on the losses to obtain the total loss function of the dam break prediction model.
S505: training the dam break prediction model by using the training data points and the pseudo tag training data points through the dam break prediction loss function until a preset model termination condition is met.
In this embodiment, the training process of the dam-break prediction model includes two steps of training the physical information neural network and generating the pseudo tag, as shown in fig. 6. The upper line of fig. 6 represents the training process of the physical information network: sending the dam bank data sampling points, the water flow boundary points and the initial water depth points into a neural network for forward propagation calculation prediction values; bringing predicted values of different types of data points into corresponding loss functions; finally updating the parameters of the network through back propagation and gradient descent. The lower line of fig. 6 represents the process of generating pseudo tags and updating the training data point set of S501: all sampling points are put into a neural network to be propagated forward to calculate a predicted value; bringing the predicted value into a physical information model to obtain an equation residual error; sequencing equation residuals and screening sampling points with smaller residual values; the confidence of the sampling points is high, so that pseudo labels are given to the sampling points; during the subsequent training process, the pseudo tag data points are trained in a supervised fashion.
In the model training process, the automatic differentiation technology and the chain rule of the deep learning framework can be utilized to conduct derivative operation on the loss function of the S504, and the neural network model is optimized by using gradient descent and back propagation algorithm, so that the solving process of the physical information model is completed. The complete training process is completed, wherein S501 and S502 are only required to be executed once before training the dam-break prediction model, and the preset model termination condition can be the preset iteration times, namely the times of executing S503-S505, and the accuracy of the dam-break prediction model is larger than a preset accuracy threshold value by repeatedly executing S503-S505 until the preset model termination condition is met, so that the implementation of the application is not affected, the solution of the dam-break prediction model to the physical information model of S503 can be completed when the preset model termination condition is reached, and the change condition of the free water surface height along with time after the dam break phenomenon occurs is further obtained.
In the technical scheme provided by the application, the self-training mechanism is introduced into the training of the dam break prediction model for predicting the free water surface height after the dam break phenomenon occurs, so that the utilization rate of physical information in the unsupervised training data points is improved. In the training process, a physical information model describing the dam break phenomenon is used as a confidence level to select a pseudo tag training data point from sampling points, positive feedback is formed between the pseudo tag training data point and the training process, the convergence speed and the training efficiency of the dam break prediction model can be improved, further, the pseudo tag training data point is gradually generated and continuously updated in the iteration process, the vibration phenomenon in the self-training physical information network training process can be alleviated, the training process is more stable, the prediction precision and the training efficiency of the dam break prediction model can be effectively improved, the prediction precision and the efficiency of the dam break prediction model on the free water surface height after the dam break phenomenon are improved, and the change condition of the free water surface height along with time after the dam break phenomenon is effectively and highly accurately obtained.
In the above embodiment, how to execute step S501 is not limited, and an exemplary generation manner of the training data point set in this embodiment may include the following:
dispersing a space domain in which the position information of the dam data training sample set is located into a first position vector and a second position vector, and dispersing a time domain in which the time information of the dam data training sample set is located into a time vector; combining the first position vector, the second position vector and the time vector, calling a grid creation function recorded by any one of the related technologies to generate a first position grid, a second position grid and a time grid, and stretching the first position grid, the second position grid and the time grid to a one-dimensional vector with a target length; and correspondingly storing the first position grid, the second position grid and the time grid into a pre-constructed dam bank data sampling point storage structure, a water flow speed boundary point storage structure and an initial water depth point storage structure respectively.
Wherein X can be used for representing a first position vector, Y can be used for representing a second position vector, T can be used for representing a time vector, and the boundary of a space domain corresponding to the dam bank data training sample set is X 1 、x 2 、y 1 And y 2 The boundary of the corresponding time domain is t 1 And t 2 The target length may be N x ×N y ×N t The grid creation function may employ a numpy/meshgrid () function, the first location grid, the second location grid, and the time grid may be represented by x_mesh, y_mesh, and t_mesh, respectively, and the dam bank data sampling point storage structure, the water flow rate boundary point storage structure, and the initial water depth point storage structure may be represented by D, H and K, respectively, and an exemplary implementation process of this embodiment may include:
step 1, solving the domain omega E [ x ] in continuous time and space 1 ,x 2 ]×[y 1 ,y 2 ]×[t 1 ,t 2 ]Discrete to N x ×N y ×N t In which the spatial domain [ x 1 ,x 2 ]And [ y ] 1 ,y 2 ]Can be discretized into (N) x Vectors X and (N) of 1) y Vector Y, time domain [ t ] of 1) 1 ,t 2 ]Can be discretized into (N) t Vector T of 1);
step 2, combining the vector X, the vector Y and the vector T, and then calling a numpy.meshgrid () function to generate a two-dimensional grid X_mesh, Y_mesh and T_mesh;
step 3, stretching the X_mesh, the Y_mesh and the T_mesh to be N in length x ×N y ×N t Is a one-dimensional vector of (a);
step 4, initializing arrays D, H, K and P; the method comprises the steps of storing data corresponding to dam bank data sampling points, storing data of water flow boundary points, storing data of initial water depth points, and storing pseudo tag training data points;
step 5, initializing i=0, wherein i represents subscripts of the x_mesh, the y_mesh and the t_mesh;
Step 6, judging the X_mesh [ i ]]Whether or not to equal x 1 Or X_mesh [ i ]]Whether or not to equal x 2 Or Y_mesh [ i ]]Whether or not to be equal to y 1 Or Y_mesh [ i ]]Whether or not to be equal to y 2 If so, then (X_mesh [ i ]],Y_mesh[i],T_mesh[i]) Putting an array H and jumping to the step, otherwise, continuing to execute the step 7;
step 7, judging T_mesh [ i ]]Whether or not it is equal to t 0 If so, then (X_mesh [ i ]],Y_mesh[i],T_mesh[i]) Putting an array K and jumping to the step 9, otherwise, continuing to execute the step 8;
step 8, putting (X_mesh [ i ], Y_mesh [ i ], T_mesh [ i ]) into an array D;
step 9, let i=i+1;
step 10, judging whether i is smaller than N x ×N y ×N t If yes, returning to the step 6; otherwise, the section ends.
Through the steps 1 to 9, the data points for training the dam break prediction model in the embodiment can be all generated, and the whole process is simple and efficient.
In the above embodiment, how to perform step S503 is not limited, and an exemplary generation manner of the pseudo tag training data point given in this embodiment may include the following:
in the training process of each turn of the dam break prediction model, current dam bank data sampling points acquired in the current batch are input into the dam break prediction model under the current training turn to obtain a current prediction physical field; calculating a residual value of the physical information model based on the current predicted physical field; selecting a target residual value meeting a preset confidence coefficient condition from residual values obtained in each turn; and taking dam bank data sampling points of batches corresponding to each target residual value as pseudo tag training data points.
The preset confidence conditions can be that the dam bank data sampling points with the first 2000 confidence values are ordered from big to small according to the confidence values, and the dam bank data sampling points with the first 2000 confidence values are used as target sampling points. An exemplary implementation of this embodiment may include:
step 1, initializing k=0, wherein k is a batch of current processing sampling points;
step 2, initializing an array Q for storing the physical information model residual errors;
step 3, taking D [1000 x k ] from dam bank data sampling point storage structure D]~D[1000*(k+1)]Dam bank data sampling point D of (1) k
Step 4, putting the kth sampling point Dk into a dam break prediction model to obtain a predicted value
Step 5, the kth predicted valueCarrying out calculation of residual Rk by taking into a physical information model;
step 6, equation residual R of the kth sampling point k Put into the corresponding position in array Q;
step 7, let k=k+1;
step 8, if i is smaller than 10, jumping to execute step 3, otherwise, directly executing step 9;
step 9, sorting the data points in the group Q according to the size of the residual value from small to large;
step 10, screening out the first 2000 data in the array Q and giving a pseudo tag as pseudo tag data P generated at this time k
Step 11, initializing a=0, wherein a represents P k Is a subscript position of (2);
step 12, if P k [a]In P, then P is updated k [a]Or else directly to P k [a]Storing P;
step 13, let a=a+1;
step 14, if a is less than 2000, returning to step 12, otherwise, ending the process.
After the step 14 is finished, the pseudo tag training data generated by the present round is generated and stored in the array P.
From the above, the present embodiment introduces the super parameter to control the number of the "pseudo tag points" generated in each round, so as to further improve the accuracy of generating the "pseudo tag points" by the dam-break prediction model, and improve the accuracy of the dam-break prediction model.
In the above embodiment, how to perform step S505 is not limited, and an exemplary training manner of the dam break prediction model by using the training data point and the pseudo tag training data point through the dam break prediction loss function in this embodiment may include the following:
invoking a gradient clearing function to clear the gradient stored by the optimizer; the automatic derivative function is called to conduct back propagation on the dam break prediction loss function, and the automatic derivative method is called to implicitly calculate gradient according to a chain rule; and (3) calling a model parameter updating function, and updating the weight parameters of the dam break prediction model by using the calculated new gradient.
In this embodiment, an optimizer. Zero_grad () function may be used as a gradient emptying function, a loss. Backward () function may be used as an automatic derivative function, and an optimizer. Step () function may be used as a model parameter updating function, which may, of course, also be used by those skilled in the art, which does not affect the implementation of the present application. Based on the above type function, an exemplary implementation of the present embodiment may include:
step 1, calling an optimizer zero_grad () function to clear the gradient stored by the optimizer;
step 2, back-propagating the loss function by calling a loss.backward () function, wherein an automatic differential framework in the deep learning framework implicitly calculates gradient according to a chain rule;
and step 3, calling an optimizer.step () function, and using the solved new gradient to update the weight parameters of the neural network.
In the above embodiment, how to execute step S504 is not limited, and an exemplary generation manner of the dam break prediction loss function given in this embodiment may include the following:
obtaining a physical control loss item, a boundary loss item, an initial loss item and a pseudo tag loss item according to the dam break prediction model on the prediction data of the dam bank data sampling point, the water flow boundary point, the initial water depth point and the pseudo tag training data point, the physical information model, the water flow boundary condition and the initial water depth condition; and determining a dam break prediction loss function according to the physical control loss term, the boundary loss term, the initial loss term, the pseudo tag loss term and the weight factors thereof.
The weight factors of the physical control loss term, the boundary loss term, the initial loss term and the pseudo tag loss term can be flexibly selected according to actual requirements, and of course, each weight factor can be set to be identical by default, and the dam break prediction loss function is the sum of the physical control loss term, the boundary loss term, the initial loss term and the pseudo tag loss term. The determination of the physical control penalty term, the boundary penalty term, the initial penalty term, and the pseudo tag penalty term may include:
inputting the current training data point and the current pseudo-label training data point acquired in the current batch into a dam break prediction model under the current training round to obtain a sampling prediction physical field; determining a sampling residual value of a physical information model based on the sampling prediction physical field, and determining a physical mean square error of the sampling prediction physical field; determining a physical control loss term according to the sampling residual value and the physical mean square error;
selecting a plurality of water flow speed boundary sampling points from training data points, and inputting each water flow speed boundary sampling point into a dam break prediction model under the current training round to obtain water flow speed prediction information; based on the water flow speed prediction information, determining a boundary residual value corresponding to a water flow boundary condition, and determining a boundary mean square error of the predicted water flow information; determining a boundary loss term according to the boundary residual value and the boundary mean square error;
Selecting a plurality of initial water depth sampling points from training data points, and inputting each initial water depth sampling point into a dam break prediction model under the current training round to obtain water depth prediction information; determining an initial residual value corresponding to an initial water depth condition based on the water depth prediction information, and determining an initial mean square error of the water depth prediction information; determining an initial loss term according to the initial residual value and the initial mean square error;
selecting a plurality of pseudo tag sampling points from the pseudo tag training data points, and inputting each pseudo tag sampling point into a dam break prediction model under the current training round to obtain pseudo tag prediction information; and determining a pseudo tag loss term according to the mean square error of the pseudo tag prediction information.
To make the determination of the dam break predicted loss function more clear to those skilled in the art, the present embodiment also provides an exemplary generation process of the dam break predicted loss function:
step 1, randomly selecting 1000 dam bank data sampling points from an array D for storing the dam bank data sampling points;
step 2, 1000 sampling points are sent into a dam break prediction model to obtain corresponding output
Step 3, initializing a physical control Loss item Loss E =0, for storing physical control loss entries;
Step 4, initializing b=0, wherein b representsIs defined by the subscript position of:
step 5, willCarrying out a physical information model to obtain an equation residual error;
step 6, calculatingMean square error of>
Step 7, order
Step 8, let b=b+1;
step 9, if b is smaller than 1000, returning to step 5, otherwise, directly executing step 10;
step 10, randomly selecting 100 water flow boundary points from an array H for storing water flow boundary points;
step 11, sending 100 water flow speed boundary points into a dam break prediction model to obtain corresponding output
Step 12, initializing a boundary Loss term Loss B =0, for storing boundary loss entries;
step 13, initializing c=0, wherein c represents the subscript position of U, V;
step 14, willCarrying out boundary conditions to obtain boundary residual errors;
step 15, calculatingMean square error>
Step 16, order
Step 17, let c=c+1;
step 18, if c is less than 100, returning to step 14, otherwise, directly executing step 19;
step 19, randomly selecting 100 initial water depth points from an array K for storing the initial water depth points;
step 20, feeding N initial water depth points into a dam break prediction model to obtain corresponding output
Step 21, initializing initial Loss item Loss I =0, for storing initial loss entries;
step 22, initializing d=0, wherein d representsIs a subscript position of (2);
step 23, connectingBringing an initial value condition to obtain an initial value residual error;
step 24, calculatingMean square error>
Step 25, order
Step 26, let d=d+1;
step 27, if d is less than 100, returning to step 23, otherwise, directly executing step 28;
step 28, if the array P for storing the pseudo tag training data points is not empty, continuing to execute step 29, otherwise, jumping to step 37;
step 29, randomly selecting 1000 pseudo tag points from the array P;
step 30, feeding the N pseudo tag points into a dam break prediction model to obtain corresponding output
Step 31, initializing a pseudo tag Loss item Loss P =0, to store pseudo tag loss entries;
step 32, initializing e=0, wherein e representsIs a subscript position of (2);
step 33, calculatingMean square error>Wherein H is e Is a pseudo tag;
step 34, order
Step 35, let e=e+1;
step 36, if e is smaller than 1000, returning to step 33, otherwise, continuing to execute step 37;
step 37, let pass=pass E +Loss B +Loss I +Loss P
Finally, the present application also provides a dam break prediction method, as shown in fig. 7, which can be applied to predicting the change situation of the free height of the water surface of any dam after the dam break phenomenon occurs in daily life over time, and can include the following contents:
S701: and training a dam break prediction model in advance.
The dam break prediction model can be obtained by training in advance by using the training method of the dam break prediction model described in any one of the embodiments.
S702: and acquiring a physical information model to be tested and current dam bank data for describing the dam break phenomenon of the dam to be tested.
S703: and based on the physical information model to be measured and the current dam bank data, calling a dam break prediction model to predict and obtain the target water flow speed and the target free water surface height of the dam to be measured.
S704: and generating dam break prediction information of the dam to be tested according to the target water flow speed and the target free water surface height.
The dam break prediction information comprises the change condition of the free height of the water surface after the dam break phenomenon of the dam to be detected occurs along with time, further, corresponding prevention measures and warning information can be given out, and the corresponding warning information is sent to the corresponding client.
It should be noted that, in the present application, the steps may be performed simultaneously or may be performed in a certain preset order as long as the steps conform to the logic order, and fig. 5 and fig. 7 are only schematic, and do not represent only such an execution order.
The application also provides a corresponding device for the dam break prediction model training method and the dam break prediction method, so that the method is more practical. Wherein the device may be described separately from the functional module and the hardware. In the following description, a dam break prediction model training device and a dam break prediction device provided by the present application are described, where the device is configured to implement a corresponding dam break prediction model training method and a corresponding dam break prediction method provided by the present application, where in this embodiment, the dam break prediction model training device and the dam break prediction device may include or be divided into one or more program modules, where the one or more program modules are stored in a storage medium and executed by one or more processors, to implement a dam break prediction method and a dam break prediction model training method disclosed in the first embodiment. Program modules referred to herein means a series of computer program instruction segments capable of performing a particular function, more suitable than the program itself for describing the execution of the dam break prediction model training device and the dam break prediction device in a storage medium. The following description will specifically describe functions of each program module of the present embodiment, and the dam break prediction model training device described below and the dam break prediction model training method described above, the dam break prediction device, and the dam break prediction method described above may be referred to correspondingly with each other.
Based on the angle of the functional module, please refer to fig. 8, fig. 8 is a block diagram of a dam break prediction device provided in the present application under an embodiment, where the device may include:
the training data generating module 801 is configured to discretize a time-space domain corresponding to a dam bank data training sample set into a two-dimensional grid, and generate a training data point set by analyzing the two-dimensional grid; the training data point set comprises dam bank data sampling points, water flow boundary points and initial water depth points;
the model building module 802 is configured to build a dam-break prediction model for predicting a free water surface height after a dam-break phenomenon occurs, based on a fully connected neural network model that takes space-time coordinates as input, predicts a physical field as output, and includes a plurality of hidden layers; the predicted physical field comprises a water flow speed and a free water surface height;
the pseudo tag generation module 803 is configured to select, as a pseudo tag training data point, a target sampling point that satisfies a preset confidence condition from dam bank data sampling points based on a physical information model describing a dam break phenomenon of a dam to be tested as a confidence;
the loss function determining module 804 is configured to determine a dam break prediction loss function of the dam break prediction model based on the dam bank data sampling point, the water flow rate boundary point, the initial water depth point, and the pseudo tag training data point, respectively;
The model training module 805 is configured to train the dam-break prediction model by using the training data point and the pseudo tag training data point through the dam-break prediction loss function until a preset model termination condition is satisfied.
Optionally, in some implementations of this embodiment, the training data generating module 801 may further be configured to:
dispersing a space domain in which the position information of the dam data training sample set is located into a first position vector and a second position vector, and dispersing a time domain in which the time information of the dam data training sample set is located into a time vector;
combining the first position vector, the second position vector and the time vector, calling a grid creation function to generate a first position grid, a second position grid and a time grid, and stretching the first position grid, the second position grid and the time grid to a one-dimensional vector with a target length;
and correspondingly storing the first position grid, the second position grid and the time grid into a pre-constructed dam bank data sampling point storage structure, a water flow speed boundary point storage structure and an initial water depth point storage structure respectively.
Optionally, in other implementations of this embodiment, the pseudo tag generating module 803 may be further configured to:
In the training process of each turn of the dam break prediction model, current dam bank data sampling points acquired in the current batch are input into the dam break prediction model under the current training turn to obtain a current prediction physical field;
calculating a residual value of the physical information model based on the current predicted physical field;
selecting a target residual value meeting a preset confidence coefficient condition from residual values obtained in each turn;
and taking dam bank data sampling points of batches corresponding to each target residual value as pseudo tag training data points.
Illustratively, in some implementations of the present embodiment, the model training module 805 described above may be further configured to:
invoking a gradient clearing function to clear the gradient stored by the optimizer;
the automatic derivative function is called to conduct back propagation on the dam break prediction loss function, and the automatic derivative method is called to implicitly calculate gradient according to a chain rule;
and (3) calling a model parameter updating function, and updating the weight parameters of the dam break prediction model by using the calculated new gradient.
Illustratively, in other implementations of the present embodiment, the loss function determining module 804 may further be configured to:
obtaining a physical control loss item, a boundary loss item, an initial loss item and a pseudo tag loss item according to the dam break prediction model on the prediction data of the dam bank data sampling point, the water flow boundary point, the initial water depth point and the pseudo tag training data point, the physical information model, the water flow boundary condition and the initial water depth condition;
And determining a dam break prediction loss function according to the physical control loss term, the boundary loss term, the initial loss term, the pseudo tag loss term and the weight factors thereof.
As an exemplary implementation of the foregoing embodiment, the foregoing loss function determining module 804 may further be configured to:
inputting the current training data point and the current pseudo-label training data point acquired in the current batch into a dam break prediction model under the current training round to obtain a sampling prediction physical field;
determining a sampling residual value of a physical information model based on the sampling prediction physical field, and determining a physical mean square error of the sampling prediction physical field;
determining a physical control loss term according to the sampling residual value and the physical mean square error;
selecting a plurality of water flow speed boundary sampling points from training data points, and inputting each water flow speed boundary sampling point into a dam break prediction model under the current training round to obtain water flow speed prediction information;
based on the water flow speed prediction information, determining a boundary residual value corresponding to a water flow boundary condition, and determining a boundary mean square error of the predicted water flow information;
determining a boundary loss term according to the boundary residual value and the boundary mean square error;
selecting a plurality of initial water depth sampling points from training data points, and inputting each initial water depth sampling point into a dam break prediction model under the current training round to obtain water depth prediction information;
Determining an initial residual value corresponding to an initial water depth condition based on the water depth prediction information, and determining an initial mean square error of the water depth prediction information;
determining an initial loss term according to the initial residual value and the initial mean square error;
selecting a plurality of pseudo tag sampling points from the pseudo tag training data points, and inputting each pseudo tag sampling point into a dam break prediction model under the current training round to obtain pseudo tag prediction information;
and determining a pseudo tag loss term according to the mean square error of the pseudo tag prediction information.
The functions of each functional module of the dam break prediction device and the dam break prediction model training device described in the application may be specifically implemented according to the method in the above method embodiment, and the specific implementation process may refer to the related description of the above method embodiment, which is not repeated herein.
From the above, the present embodiment can effectively improve the prediction accuracy and training efficiency of the dam-break prediction model, thereby improving the prediction accuracy and efficiency of the dam-break prediction model on the free water surface height after the occurrence of the dam-break phenomenon, and further can efficiently and accurately obtain the time-dependent change condition of the free water surface height after the occurrence of the dam-break phenomenon.
The dam break prediction model training device and the dam break prediction device are described from the angle of the functional module, and further, the application also provides electronic equipment, which is described from the angle of hardware. Fig. 9 is a schematic structural diagram of an electronic device according to an embodiment of the present application in an implementation manner. As shown in fig. 9, the electronic device comprises a memory 90 for storing a computer program; a processor 91 for implementing the steps of the dam break prediction method and/or the training method of the dam break prediction model as mentioned in any of the above embodiments when executing a computer program.
Processor 91 may include one or more processing cores, such as a 4-core processor, an 8-core processor, and processor 91 may also be a controller, microcontroller, microprocessor, or other data processing chip, among others. The processor 91 may be implemented in at least one hardware form of DSP (Digital Signal Processing ), FPGA (Field-Programmable Gate Array, field programmable gate array), PLA (Programmable Logic Array ). The processor 91 may also include a main processor, which is a processor for processing data in an awake state, also called CPU (Central Processing Unit ); a coprocessor is a low-power processor for processing data in a standby state. In some embodiments, the processor 91 may be integrated with a GPU (Graphics Processing Unit, graphics processor) for taking care of rendering and drawing of content that the display screen is required to display. In some embodiments, the processor 91 may also include an AI (Artificial Intelligence ) processor for processing computing operations related to machine learning.
Memory 90 may include one or more computer-readable storage media, which may be non-transitory. Memory 90 may also include high-speed random access memory as well as non-volatile memory, such as one or more magnetic disk storage devices, flash memory storage devices. Memory 90 may be an internal storage unit of the electronic device, such as a hard disk of a server, in some embodiments. The memory 90 may also be an external storage device of the electronic device, such as a plug-in hard disk provided on a server, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash Card (Flash Card), etc. in other embodiments. Further, the memory 90 may also include both internal storage units and external storage devices of the electronic device. The memory 90 may be used to store not only application software installed in an electronic device, but also various types of data, such as: code or the like that performs the dam-break prediction model training method and/or the program during the dam-break prediction method may also be used to temporarily store data that has been output or is to be output. In this embodiment, the memory 90 is at least used for storing a computer program 901, where the computer program, when loaded and executed by the processor 91, can implement the dam break prediction model training method and/or the relevant steps of the dam break prediction method disclosed in any of the foregoing embodiments. In addition, the resources stored in the memory 90 may further include an operating system 902, data 903, and the like, where the storage mode may be transient storage or permanent storage. The operating system 902 may include Windows, unix, linux, among others. The data 903 may include, but is not limited to, dam break prediction model training results and/or data corresponding to dam break prediction results, and the like.
In some embodiments, the electronic device may further include a display 92, an input/output interface 93, a communication interface 94, alternatively referred to as a network interface, a power supply 95, and a communication bus 96. Among other things, the display 92, input output interface 93 such as a Keyboard (Keyboard) pertain to a user interface, which may optionally also include standard wired interfaces, wireless interfaces, etc. Alternatively, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch, or the like. The display may also be referred to as a display screen or display unit, as appropriate, for displaying information processed in the electronic device and for displaying a visual user interface. The communication interface 94 may optionally include a wired interface and/or a wireless interface, such as a WI-FI interface, a bluetooth interface, etc., typically used to establish a communication connection between the electronic device and other electronic devices. The communication bus 96 may be a peripheral component interconnect standard (peripheral component interconnect, PCI) bus, or an extended industry standard architecture (extended industry standard architecture, EISA) bus, among others. The bus may be classified as an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown in fig. 9, but not only one bus or one type of bus.
Those skilled in the art will appreciate that the configuration shown in fig. 9 is not limiting of the electronic device and may include more or fewer components than shown, for example, a sensor 97 that performs various functions.
The functions of each functional module of the electronic device described in the present application may be specifically implemented according to the method in the foregoing method embodiment, and the specific implementation process may refer to the relevant description of the foregoing method embodiment, which is not repeated herein.
From the above, the present embodiment can effectively improve the prediction accuracy and training efficiency of the dam-break prediction model, thereby improving the prediction accuracy and efficiency of the dam-break prediction model on the free water surface height after the occurrence of the dam-break phenomenon, and further can efficiently and accurately obtain the time-dependent change condition of the free water surface height after the occurrence of the dam-break phenomenon.
It will be appreciated that if the dam break prediction model training method and/or the dam break prediction method in the above embodiments are implemented in the form of software functional units and sold or used as independent products, they may be stored in a computer-readable storage medium. Based on such understanding, the technical solution of the present application, or a part contributing to the related art, or all or part of the technical solution, may be embodied in the form of a software product stored in a storage medium, performing all or part of the steps of the methods of the embodiments of the present application. And the aforementioned storage medium includes: a U disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), an electrically erasable programmable ROM, registers, a hard disk, a multimedia card, a card-type Memory (e.g., SD or DX Memory, etc.), a magnetic Memory, a removable disk, a CD-ROM, a magnetic disk, or an optical disk, etc., that can store program code.
Based on this, the present application further provides a readable storage medium storing a computer program, which when executed by a processor, performs the steps of the dam break prediction model training method and/or the dam break prediction method according to any one of the embodiments above.
In this specification, each embodiment is described in a progressive manner, and each embodiment is mainly described in a different point from other embodiments, so that the same or similar parts between the embodiments are referred to each other. For the hardware including the device and the electronic equipment disclosed in the embodiments, the description is relatively simple because the hardware includes the device and the electronic equipment corresponding to the method disclosed in the embodiments, and relevant places refer to the description of the method.
Those of skill would further appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both, and that the various illustrative elements and steps are described above generally in terms of functionality in order to clearly illustrate the interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
The dam break prediction and model training method, device, electronic equipment and readable storage medium provided by the application are described in detail above. Specific examples are set forth herein to illustrate the principles and embodiments of the present application, and the description of the examples above is only intended to assist in understanding the methods of the present application and their core ideas. It should be noted that, based on the embodiments in this application, all other embodiments that can be obtained without inventive labor by those skilled in the art are within the scope of protection of this application. The present application may be subject to numerous improvements and modifications without departing from the principles of the present application, and such improvements and modifications are intended to fall within the scope of the claims of the present application.

Claims (10)

1. The dam break prediction model training method is characterized by comprising the following steps of:
dispersing a time-space domain corresponding to a dam bank data training sample set into a two-dimensional grid, and generating a training data point set by analyzing the two-dimensional grid; the training data point set comprises dam bank data sampling points, water flow boundary points and initial water depth points;
constructing a dam break prediction model for predicting the free water surface height after the dam break phenomenon occurs based on a fully-connected neural network model which takes space-time coordinates as input, predicts a physical field as output and comprises a plurality of hidden layers; the predicted physical field comprises a water flow speed and a free water surface height;
Selecting a target sampling point meeting a preset confidence coefficient condition from the dam bank data sampling points as a pseudo tag training data point based on a physical information model describing dam break phenomenon as a confidence coefficient;
determining a dam break prediction loss function of the dam break prediction model based on the dam bank data sampling point, the water flow speed boundary point, the initial water depth point and the pseudo tag training data point respectively;
and training the dam break prediction model through the dam break prediction loss function by utilizing the training data points and the pseudo tag training data points until a preset model termination condition is met.
2. The method for training a dam break prediction model according to claim 1, wherein the step of discretizing a time-space domain corresponding to a dam-bank data training sample set into a two-dimensional grid and generating a training data point set by analyzing the two-dimensional grid comprises:
dispersing a space domain in which the position information of the dam data training sample set is located into a first position vector and a second position vector, and dispersing a time domain in which the time information of the dam data training sample set is located into a time vector;
combining the first position vector, the second position vector and the time vector, calling a grid creation function to generate a first position grid, a second position grid and a time grid, and stretching the first position grid, the second position grid and the time grid to a one-dimensional vector with a target length;
And correspondingly storing the first position grid, the second position grid and the time grid into a pre-constructed dam bank data sampling point storage structure, a water flow speed boundary point storage structure and an initial water depth point storage structure respectively.
3. The dam break prediction model training method according to claim 1, wherein the selecting, as the pseudo tag training data point, a target sampling point satisfying a preset confidence condition from the dam bank data sampling points based on a physical information model describing a dam break phenomenon as a confidence, comprises:
in the training process of each turn of the dam break prediction model, current dam bank data sampling points acquired in a current batch are input into the dam break prediction model under the current training turn to obtain a current prediction physical field;
calculating a residual value of the physical information model based on the current predicted physical field;
selecting a target residual value meeting a preset confidence coefficient condition from residual values obtained in each turn;
and taking dam bank data sampling points of batches corresponding to each target residual value as pseudo tag training data points.
4. The method of training a dam break prediction model according to claim 1, wherein training the dam break prediction model by the dam break prediction loss function using the training data point and the pseudo tag training data point comprises:
Invoking a gradient clearing function to clear the gradient stored by the optimizer;
the automatic derivative function is called to conduct counter-propagation on the dam break prediction loss function, and the automatic derivative method is called to implicitly calculate gradient according to a chain rule;
and calling a model parameter updating function, and updating the weight parameters of the dam break prediction model by using the calculated new gradient.
5. The method according to any one of claims 1 to 4, wherein determining the dam break prediction loss function of the dam break prediction model based on the dam bank data sampling point, the water flow rate boundary point, the initial water depth point, and the pseudo tag training data point, respectively, comprises:
obtaining a physical control loss item, a boundary loss item, an initial loss item and a pseudo tag loss item according to the dam break prediction model on the data sampling points of the dam bank, the water flow speed boundary points, the initial water depth points and the prediction data of the pseudo tag training data points, the physical information model, the water flow boundary conditions and the initial water depth conditions;
and determining the dam break prediction loss function according to the physical control loss term, the boundary loss term, the initial loss term, the pseudo tag loss term and the weight factors thereof.
6. The method for training a dam break prediction model according to claim 5, wherein the predicting data of the dam bank data sampling point, the water flow speed boundary point, the initial water depth point and the pseudo tag training data point according to the dam break prediction model, the physical information model, the water flow boundary condition and the initial water depth condition, obtains a physical control loss term, a boundary loss term, an initial loss term and a pseudo tag loss term, comprises:
inputting the current training data point and the current pseudo-label training data point acquired in the current batch into a dam break prediction model under the current training round to obtain a sampling prediction physical field;
determining a sampling residual value of the physical information model based on the sampling prediction physical field, and determining a physical mean square error of the sampling prediction physical field;
determining a physical control loss term according to the sampling residual value and the physical mean square error;
selecting a plurality of water flow speed boundary sampling points from the training data points, and inputting each water flow speed boundary sampling point into a dam break prediction model under the current training round to obtain water flow speed prediction information;
determining boundary residual values corresponding to water flow boundary conditions based on the water flow speed prediction information, and determining boundary mean square errors of the predicted water flow information;
Determining a boundary loss term according to the boundary residual value and the boundary mean square error;
selecting a plurality of initial water depth sampling points from the training data points, and inputting each initial water depth sampling point into a dam break prediction model under the current training round to obtain water depth prediction information;
determining an initial residual value corresponding to an initial water depth condition based on the water depth prediction information, and determining an initial mean square error of the water depth prediction information;
determining an initial loss term according to the initial residual value and the initial mean square error;
selecting a plurality of pseudo tag sampling points from the pseudo tag training data points, and inputting each pseudo tag sampling point into a dam break prediction model under the current training round to obtain pseudo tag prediction information;
and determining a pseudo tag loss term according to the mean square error of the pseudo tag prediction information.
7. A dam break prediction method, comprising:
training in advance by using the dam break prediction model training method according to any one of claims 1 to 6 to obtain a dam break prediction model;
acquiring a physical information model to be tested and current dam bank data for describing dam break phenomena of a dam to be tested;
based on the physical information model to be detected and the current dam bank data, calling the dam break prediction model to predict and obtain the target water flow speed and the target free water surface height of the dam to be detected;
And generating dam break prediction information of the dam to be tested according to the target water flow speed and the target free water surface height.
8. The dam break prediction model training device is characterized by comprising:
the training data generation module is used for dispersing a time-space domain corresponding to the dam bank data training sample set into a two-dimensional grid and generating a training data point set by analyzing the two-dimensional grid; the training data point set comprises dam bank data sampling points, water flow boundary points and initial water depth points;
the model building module is used for building a dam break prediction model for predicting the free water surface height after the dam break phenomenon occurs based on a fully-connected neural network model which takes space-time coordinates as input, predicts a physical field as output and comprises a plurality of hidden layers; the predicted physical field comprises a water flow speed and a free water surface height;
the false label generating module is used for selecting a target sampling point meeting the preset confidence condition from the dam bank data sampling points as a false label training data point based on a physical information model describing the dam break phenomenon of the dam to be tested as the confidence;
the loss function determining module is used for determining a dam break prediction loss function of the dam break prediction model based on the dam bank data sampling point, the water flow speed boundary point, the initial water depth point and the pseudo tag training data point respectively;
And the model training module is used for training the dam break prediction model through the dam break prediction loss function by utilizing the training data points and the pseudo tag training data points until a preset model termination condition is met.
9. An electronic device comprising a processor and a memory, the processor being configured to implement the steps of the dam break prediction model training method according to any one of claims 1 to 6 and/or the dam break prediction method according to claim 7 when executing a computer program stored in the memory.
10. A readable storage medium, wherein a computer program is stored on the readable storage medium, which when executed by a processor, implements the steps of the dam break prediction model training method according to any one of claims 1 to 6 and/or the dam break prediction method according to claim 7.
CN202410056883.1A 2024-01-15 2024-01-15 Dam break prediction and model training method and device, electronic equipment and storage medium Pending CN117875504A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410056883.1A CN117875504A (en) 2024-01-15 2024-01-15 Dam break prediction and model training method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410056883.1A CN117875504A (en) 2024-01-15 2024-01-15 Dam break prediction and model training method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN117875504A true CN117875504A (en) 2024-04-12

Family

ID=90582654

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202410056883.1A Pending CN117875504A (en) 2024-01-15 2024-01-15 Dam break prediction and model training method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN117875504A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN118133437A (en) * 2024-05-10 2024-06-04 上海惠生海洋工程有限公司 Ship local structural strength analysis method, device, computer equipment and medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN118133437A (en) * 2024-05-10 2024-06-04 上海惠生海洋工程有限公司 Ship local structural strength analysis method, device, computer equipment and medium

Similar Documents

Publication Publication Date Title
US20220043951A1 (en) Generating integrated circuit floorplans using neural networks
Praveen et al. Low cost PSO using metamodels and inexact pre-evaluation: Application to aerodynamic shape design
WO2022068623A1 (en) Model training method and related device
Georgiou et al. Learning fluid flows
CN109690576A (en) The training machine learning model in multiple machine learning tasks
WO2019081705A1 (en) Using hierarchical representations for neural network architecture searching
CN109559300A (en) Image processing method, electronic equipment and computer readable storage medium
CN117875504A (en) Dam break prediction and model training method and device, electronic equipment and storage medium
CN111524112B (en) Steel chasing identification method, system, equipment and medium
EP3671575A2 (en) Neural network processing method and apparatus based on nested bit representation
CN108334910A (en) A kind of event detection model training method and event detecting method
WO2022100607A1 (en) Method for determining neural network structure and apparatus thereof
WO2020013956A1 (en) Systems, methods, and computer-readable media for improved table identification using a neural network
CN109271957A (en) Face gender identification method and device
Li et al. A two-stage surrogate-assisted evolutionary algorithm (TS-SAEA) for expensive multi/many-objective optimization
Liu et al. Quantum-inspired African vultures optimization algorithm with elite mutation strategy for production scheduling problems
Zhou et al. Comparison of classic object-detection techniques for automated sewer defect detection
Patel et al. Smart adaptive mesh refinement with NEMoSys
Anitha et al. Convolution Neural Network and Auto-encoder Hybrid Scheme for Automatic Colorization of Grayscale Images
US11544425B2 (en) Systems and methods for expediting design of physical components through use of computationally efficient virtual simulations
US11295046B2 (en) Systems and methods for expediting design of physical components through use of computationally efficient virtual simulations
CN110019952A (en) Video presentation method, system and device
KR20200061154A (en) Method and apparatus of analyzing diagram containing visual and textual information
CN109299725A (en) A kind of forecasting system and device based on the decomposition of tensor chain Parallel Implementation high-order dominant eigenvalue
CN115346072A (en) Training method and device of image classification model, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination