An Algae Biomass Prediction Method Based on a Bidirectional Coupled Hydrodynamic Model and a Physics-Informed Neural Network
By combining hydrodynamic model and physical information neural network, the shortcomings of existing algae prediction methods in accuracy and adaptation to extreme environmental changes are solved, and high-precision and stable algae biomass prediction are achieved.
Patent Information
- Application Number
- CN202510629396.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-16
- Publication Date
- 2025-08-01
- Estimated Expiration
- 2045-05-16
AI Technical Summary
The existing algae prediction methods have shortcomings in accuracy and adaptation to extreme environmental changes. The process mechanism model is difficult to ensure accuracy, and the data-driven model has insufficient spatial and temporal resolution and is difficult to describe local hydrodynamic effects.
The algae biomass prediction method is constructed based on a two-way coupled hydrodynamic model and a physical information neural network. By acquiring and preprocessing water conditions, water quality and meteorological data, combining shallow water equations and wind stress-turbulence models, the target loss function is constructed, and the physical information neural network is trained to realize the spatiotemporal alignment and feature fusion of multi-dimensional physical field data.
It improves the accuracy and reliability of algae biomass prediction, enhances the model's adaptability and ability to respond to extreme environmental changes, and is suitable for complex and changeable practical application scenarios.
Smart Images

Figure CN120145942B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of algal biomass prediction, and particularly to an algal biomass prediction method based on a bidirectional coupled hydrodynamic model and a physics-informed neural network. Background Art
[0002] The growth and migration of algae in water bodies are complex non-linear processes jointly affected by multiple factors. Currently, algal prediction methods are mainly divided into two categories: process mechanism models and data-driven models. Process mechanism models integrate sub-modules in three aspects: hydrodynamics, water quality, and water ecology to construct a comprehensive prediction system, such as the representative Taihu Lake model in China. However, due to the complexity of the biochemical process itself and the uniqueness of parameters in different regions, it is difficult to fully guarantee the accuracy of such models in predicting algal growth. On the other hand, data-driven models, especially those based on artificial neural networks, perform well in dealing with complex ecological phenomena and non-linear relationships and are particularly suitable for short-term prediction. Nevertheless, these models are limited by the insufficient spatio-temporal resolution of training data, making it difficult to finely describe local hydrodynamic effects and their impacts on algal growth, and they perform particularly poorly in predicting algal growth after extreme events (such as typhoons and heavy rains). Therefore, although both types of models have their advantages, they both face certain challenges in practical applications. Summary of the Invention
[0003] In order to achieve accurate prediction of algal biomass, the present invention proposes an algal biomass prediction method based on a bidirectional coupled hydrodynamic model and a physics-informed neural network, including:
[0004] Obtain and preprocess hydrological data, water quality data, and meteorological data to obtain time series corresponding to each type of data;
[0005] Construct a hydrodynamic model based on the shallow water equations; the hydrodynamic model is coupled with advection-diffusion equations and wind stress-turbulence models to simulate the spatial distribution of nutrient concentrations, water temperature distribution, and vertical and horizontal mixing processes caused by wind-driven forces;
[0006] Run the hydrodynamic model based on the time series of meteorological data and hydrological data. During the running process, interpolate the time series of meteorological data to the calculation area of the hydrodynamic model, and output multi-dimensional physical field data including velocity fields, temperature fields, and mixing degree fields;
[0007] Perform spatial interpolation on the time series of water quality data, map it to the grid nodes of the hydrodynamic model to achieve spatial alignment, and unify the time step lengths of the time series corresponding to each type of data to the same time step length as the hydrodynamic model, and output the spatially and temporally aligned water quality time series and meteorological time series;
[0008] Construct a training set containing multiple training samples; the training samples include: multi-dimensional physical field data, water quality time series, and meteorological time series;
[0009] Construct an objective loss function by taking the residual in the shallow water equations as a regularization term;
[0010] Construct a physical information neural network including a first channel, a second channel, and a merging channel; train the physical information neural network with the training set and the objective loss function to obtain an objective prediction model; where:
[0011] The first channel is used to extract the spatial features of the multi-dimensional physical field data; the second channel is used to extract the time series features of the water quality time series and the meteorological time series; the merging channel is used to fuse the extracted spatial features and time series features and output the predicted value, i.e., the algal biomass;
[0012] Predict the algal biomass through the objective prediction model.
[0013] Further, the simulation of the spatial distribution of the simulated nutrient concentration, the water temperature distribution, and the vertical and horizontal mixing processes caused by wind driving is specifically as follows:
[0014] Simulate the distribution characteristics of the nutrient concentration and the water temperature in space through the advection-diffusion equation, calculate the wind stress through the square wind speed formula, and combine the wind stress-turbulence model to dynamically solve the vertical turbulent viscosity, so as to simulate the vertical and horizontal mixing processes under wind driving.
[0015] Further, the training label corresponding to the training sample is the algal biomass; the training of the physical information neural network with the training set and the objective loss function to obtain the objective prediction model is specifically as follows:
[0016] S1: Initialize the network parameters of the physical information neural network and the adjustable parameters of the hydrodynamic model, and set the initial number of training times to 1; the network parameters include weights and biases; the adjustable parameters include: initial conditions, boundary conditions, and physical coefficients;
[0017] S2: Input the training samples into the physical information neural network to obtain the predicted algal biomass;
[0018] S3: Calculate the total loss corresponding to the current training sample through the objective loss function;
[0019] S4: Perform backpropagation according to the calculated total loss, calculate the gradient of the physical information neural network, and use the gradient descent method to update the network parameters of the network; adjust the adjustable parameters of the hydrodynamic model based on the prediction error to achieve the bidirectional coupling of the hydrodynamic model and the physical information neural network; the prediction error is the difference between the predicted value and the measured value;
[0020] S5: Increment the number of training iterations by 1, and determine whether the number of training iterations is greater than a preset value. If so, end the training; if not, return to step S2 to start the input of the next round of training samples.
[0021] Further, among the adjustable parameters:
[0022] The initial conditions include:
[0023] The initial water level is the water level height at each grid node at the start of the simulation.
[0024] The initial flow velocity, which includes the velocity components in the horizontal and vertical directions.
[0025] The initial temperature field, which includes the water temperature at each grid node.
[0026] The initial nutrient concentration.
[0027] The boundary conditions include:
[0028] The flow boundary is the inflow or outflow discharge.
[0029] The water level boundary is the water level height set at the boundary.
[0030] The physical coefficients include: the diffusion coefficient, the vertical turbulent viscosity, and the nutrient diffusion coefficient.
[0031] Further, the method for adjusting the adjustable parameters of the hydrodynamic model based on the prediction error is specifically as follows:
[0032] Reverse map the prediction error to the multi-dimensional physical field data, and use the sensitivity analysis technique to evaluate the sensitivity of the simulation results of the hydrodynamic model to this error.
[0033] Based on the sensitivity analysis results, use the gradient descent method to update the adjustable parameters in the hydrodynamic model.
[0034] Feed the updated adjustable parameters back to the hydrodynamic model for generating the multi-dimensional physical field data of the next round of training samples.
[0035] Further, the shallow water equations include the continuity equation and the momentum equation; the method for constructing the target loss function with the residual in the shallow water equations as the regularization term is specifically as follows:
[0036] Use the mean square error to calculate the data-driven error term between the predicted value and the measured value of the physics-informed neural network; the calculation formula for the data-driven error term is:
[0037] ;
[0038] In the formula, is the number of training samples; 、 respectively represent the predicted value and the measured value corresponding to the th training sample; represents the data-driven error term;
[0039] Obtain the continuity residual term based on the continuity equation and the momentum residual term based on the momentum equation;
[0040] Calculate the attention mechanism weight penalty term by generating a weight matrix representing the attention mechanism, identifying the time steps of extreme events, and penalizing the regions where the attention weights are lower than a preset threshold;
[0041] Construct an objective loss function through the data-driven error term, the continuity residual term, the momentum residual term, and the attention mechanism weight penalty term.
[0042] Furthermore, the method for obtaining the continuity residual term is as follows:
[0043] Calculate the time derivative and the spatial divergence term of the continuity equation;
[0044] Calculate the continuity equation residual of each grid node by using the time derivative and the spatial divergence term of the continuity equation through automatic differentiation technology;
[0045] Calculate the continuity residual term based on the continuity equation residual of each grid node;
[0046] The method for obtaining the momentum residual term is as follows:
[0047] Calculate the time derivative and the spatial divergence term of the momentum equation;
[0048] Calculate the momentum equation residual of each grid node by using the time derivative and the spatial divergence term of the momentum equation through automatic differentiation technology;
[0049] Calculate the momentum residual term based on the momentum equation residual of each grid node.
[0050] Furthermore, the calculation method of the attention mechanism weight penalty term includes:
[0051] Calculate and generate a weight matrix representing the correlation between different time steps through the self-attention mechanism;
[0052] Detect and mark the time steps when extreme events occur based on the threshold of physical quantities; the physical quantities are wind speed or rainfall or water temperature; the extreme events include typhoons and heavy rains;
[0053] For the regions in the weight matrix where the attention weights are lower than the preset threshold, calculate the attention mechanism weight penalty term by applying a squared loss penalty term, and the calculation formula is:
[0054] ;
[0055] In the formula, represents the length of any time series in the training samples, represents the set of time steps at which extreme events occur; represents the degree of attention of the t-th time step to the t'-th time step, which is an element in the weight matrix; represents a preset threshold; represents the attention mechanism weight penalty term.
[0056] Furthermore, the formula expression of the objective loss function is:
[0057] ;
[0058] In the formula, represents the continuity residual term; represents the momentum residual term; and represents the set physical constraint weight, represents the total loss.
[0059] Furthermore, the water regime data includes: flow velocity, water temperature and mixing degree; among them, the mixing degree represents the intensity of mass exchange in the vertical and horizontal directions inside the water body simulated by the hydrodynamic model through coupling the convection-diffusion equation and the wind stress-turbulence model;
[0060] The water quality data includes: chlorophyll a, total nitrogen, total phosphorus, dissolved oxygen and pH value;
[0061] The meteorological data includes: wind speed, wind direction, rainfall and light intensity;
[0062] The preprocessing specifically includes:
[0063] Filling the missing values in the water regime data, water quality data and meteorological data;
[0064] Normalizing the filled data of each type;
[0065] Processing the normalized data by using the sliding window technique to obtain the time series corresponding to each type of data.
[0066] Compared with the prior art, the present invention has at least the following beneficial effects:
[0067] (1) The present invention first obtains and preprocesses water regime data, water quality data, and meteorological data, and then constructs a hydrodynamic model based on the shallow water equations, which couples the convection-diffusion equation and the wind stress-turbulence model to simulate the spatial distribution of nutrient concentrations, water temperature distribution, and vertical and horizontal mixing processes driven by wind; runs this model based on the time series of meteorological and water regime data to output multi-dimensional physical field data; then, performs spatial interpolation on the water quality data to align it with the spatio-temporal coordinates of the grid nodes of the hydrodynamic model; constructs an objective loss function by taking the residuals in the shallow water equations as regularization terms, and trains a physics-informed neural network, finally obtaining an objective prediction model; by comprehensively considering the influence of various environmental factors, the hydrodynamic model can more accurately reflect the actual water body environment; the hydrodynamic model based on the shallow water equations combined with the convection-diffusion equation and the wind stress-turbulence model can accurately simulate the nutrient concentration, water temperature distribution, and mixing processes driven by wind, providing a highly realistic simulation of the algae growth background; introducing an objective loss function with residuals as regularization terms not only improves the learning ability and generalization ability of the model, but also enhances its physical consistency and improves the accuracy and reliability of algae biomass prediction.
[0068] (2) The present invention trains a physics-informed neural network based on the hydrodynamic model. First, it initializes the network parameters and the adjustable parameters of the hydrodynamic model, and dynamically adjusts the network parameters based on the prediction error, and updates the adjustable parameters of the hydrodynamic model in combination with sensitivity analysis techniques, making the objective prediction model have stronger adaptive capabilities; this method can not only effectively identify the key parameters in the hydrodynamic model that have a significant impact on the prediction results, but also optimize the settings of the hydrodynamic model according to the feedback of the prediction error, thus significantly improving the robustness, stability, and generalization ability of the objective prediction model; at the same time, by clearly defining and flexibly adjusting the adjustable parameters such as initial conditions, boundary conditions, and key physical coefficients, the applicability and adaptability of the hydrodynamic model in different environmental scenarios are enhanced. This method not only improves the accuracy and reliability of algae biomass prediction, but also shows better performance in practical application scenarios with complex and changeable conditions or lack of prior knowledge, ensuring that the model can provide high-precision prediction results under various conditions.
[0069] (3) The present invention constructs an objective loss function by introducing continuity residual terms and momentum residual terms, and combining an attention mechanism weight penalty term, comprehensively considering the data-driven error, physical process constraints, and the influence of extreme events, effectively simulating the real physical process and enhancing the response ability of the objective prediction model to sudden environmental changes (such as typhoons and heavy rains).
[0070] (4) The present invention trains a physics-informed neural network through a target loss function that integrates multiple factors, achieving an organic unity of physical consistency and data fitting ability, significantly improving the accuracy of algal biomass prediction and the robustness of the target prediction model, and being applicable to complex and variable actual application scenarios. Description of the Drawings
[0071] Figure 1 It is a flowchart of an algal biomass prediction method based on a bidirectional coupled hydrodynamic model and a physics-informed neural network;
[0072] Figure 2 It is a structural diagram of a physics-informed neural network. Detailed Embodiments
[0073] The following are specific embodiments of the present invention in combination with the drawings to further describe the technical solutions of the present invention, but the present invention is not limited to these embodiments.
[0074] Aiming at the limitations of traditional process mechanism models in terms of parameter sensitivity, computational efficiency, and accuracy, as well as the problems that pure data-driven models lack physical mechanisms and are difficult to accurately predict the impact of extreme events such as typhoons and heavy rains on algal blooms, as Figure 1 shown, the present invention proposes an algal biomass prediction method based on a bidirectional coupled hydrodynamic model and a physics-informed neural network, including:
[0075] Obtain and preprocess water regime data, water quality data, and meteorological data to obtain time series corresponding to various types of data;
[0076] The water regime data includes: flow velocity, water temperature, and mixing degree; among them, the mixing degree represents the intensity of mass exchange in the vertical and horizontal directions inside the water body simulated by the hydrodynamic model through coupling the convection-diffusion equation and the wind stress-turbulence model;
[0077] The water quality data includes: chlorophyll a, total nitrogen, total phosphorus, dissolved oxygen, and pH value;
[0078] The meteorological data includes: wind speed, wind direction, rainfall, and light intensity.
[0079] In order to construct an accurate target prediction model, in this embodiment, water regime data, water quality data, and meteorological data are first obtained and preprocessed, and these data are all from the monthly actual measurements in the forecast area in the past 3 years.
[0080] The preprocessing specifically includes:
[0081] Fill in the missing values in the water regime data, water quality data, and meteorological data;
[0082] Normalize the filled data of various types;
[0083] Process the normalized data using the sliding window technique to obtain the time series corresponding to various types of data;
[0084] Perform spatio-temporal alignment on the time series corresponding to various types of data.
[0085] Construct a hydrodynamic model based on the shallow water equations; the hydrodynamic model is coupled with the advection-diffusion equation and the wind stress-turbulence model to simulate the spatial distribution of nutrient concentrations, water temperature distribution, and the vertical and horizontal mixing processes caused by wind-driven forces;
[0086] The simulation of the spatial distribution of nutrient concentrations, water temperature distribution, and the vertical and horizontal mixing processes caused by wind-driven forces is specifically as follows:
[0087] Simulate the distribution characteristics of nutrient concentrations and water temperature in space through the advection-diffusion equation, calculate the wind stress using the squared wind speed formula, and dynamically solve the vertical turbulent viscosity in combination with the wind stress-turbulence model, thereby simulating the vertical and horizontal mixing processes under wind-driven forces.
[0088] To further explain, the hydrodynamic model, by coupling the advection-diffusion equation and the wind stress-turbulence model, is used to simulate the spatial evolution of nutrient concentrations, the distribution characteristics of water temperature in space, and the vertical and horizontal material and heat mixing processes within the water body due to wind forces. In this way, it can more realistically reflect the transmission mechanism of substances and heat within the water body, provide a more accurate environmental background simulation for algal growth, and improve the reliability of algal biomass prediction.
[0089] The shallow water equations include the continuity equation and the momentum equation; where:
[0090] The formula expression of the continuity equation is:
[0091] ;
[0092] The momentum equation includes:
[0093] The x-direction momentum equation:
[0094] ;
[0095] The y-direction momentum equation:
[0096] ;
[0097] In the formula, represents the water depth (unit: meter); represents the time (unit: second); represents the horizontal Average flow velocity in the direction (unit: m / s); Average flow velocity in the horizontal direction (unit: m / s); Momentum flux in the horizontal direction (unit: kg·m / (s²)); Coriolis force coefficient; Gravitational acceleration; Component of the horizontal wind stress in the direction (unit: N / m²); Chezy coefficient (dimensionless); and Diffusion coefficients in the and directions respectively (unit: m² / s); Momentum flux in the horizontal direction (unit: kg·m / (s²)); Component of the horizontal wind stress in the direction (unit: N / m²).
[0098] The formula expression of the advection-diffusion equation is:
[0099] ;
[0100] In the formula, represents the rate of change of concentration with time, that is, the change of concentration per unit time; represents the change of concentration caused by fluid flow (advection), represents the concentration gradient; represents the diffusion coefficient; represents the source or sink term, that is, the generation or consumption of substances per unit volume per unit time.
[0101] It should be noted here that and and represent the diffusion characteristics in different physical processes. In the advection-diffusion equation, D represents the diffusion coefficient of substances or temperature; while in the momentum equation, and are the diffusion coefficients related to momentum diffusion.
[0102] The interaction between the wind field and the water body is realized through wind stress calculation and the wind stress-turbulence model. Wind stress is the key bridge for the energy transfer from the wind field to the water body.
[0103] The formula expression of the squared wind speed formula is:
[0104] ;
[0105] represents the wind stress; represents the air density; represents the drag coefficient; represents the wind speed.
[0106] The wind stress is introduced into or the turbulence model to drive the calculation of the turbulent kinetic energy and the dissipation rate so as to dynamically solve the vertical turbulent viscosity . The vertical turbulent viscosity reflects the influence of the wind stress on the vertical mixing and affects the vertical momentum transfer through the diffusion term . Specifically, the material transport and water temperature distribution are simulated through the convection-diffusion equation, and this method supports the coupling of multiple physical processes. Temperature and salinity jointly affect the water body density and feedback to the momentum equation through the buoyancy term, achieving an accurate simulation of the thermohaline convection. Among them, represents the average flow velocity in the horizontal direction along the vertical direction gradient. Here, represents the coordinate axis perpendicular to the horizontal direction (usually the vertical height or depth with the upward direction being positive). This derivative measures the rate of change of the velocity in the vertical direction, that is, how the velocity changes with height.
[0107] Run the hydrodynamic model based on the time series corresponding to meteorological data and water regime data. During the running process, use the spatio-temporal joint interpolation method to interpolate the time series of meteorological data to the calculation area of the hydrodynamic model, and output multi-dimensional physical field data including the flow velocity field, temperature field, and mixing degree field;
[0108] Perform spatial interpolation on the time series of water quality data, map it to the grid nodes of the hydrodynamic model to achieve spatial alignment, and unify the time step of the time series of various data to the same time step as the hydrodynamic model through the sliding window averaging method, and output the time series of water quality and the time series of meteorological data after spatio-temporal alignment;
[0109] It should be noted that in order to solve the shallow water equations (in this embodiment, the finite volume method is used to discretely solve the shallow water equations), the research area is discretized into multiple grid nodes, and each grid node represents a calculation point, where physical quantities such as flow velocity, water level, and water temperature are stored and calculated. In this way, numerical simulation of the entire research area can be carried out. This discretization method enables the computer to effectively process complex physical processes, thereby more accurately simulating phenomena such as water flow, temperature distribution, and mass transfer. This method not only improves the calculation efficiency of the hydrodynamic model but also enhances the simulation accuracy of the actual water environment.
[0110] Construct a training set containing multiple training samples; the training samples include: multi-dimensional physical field data, water quality time series, and meteorological time series; the training label corresponding to the training sample is the algal biomass.
[0111] Construct an objective loss function by taking the residual in the shallow water equations as a regularization term.
[0112] The specific method of constructing the objective loss function by taking the residual in the shallow water equations as a regularization term is as follows:
[0113] Calculate the data-driven error term between the predicted value and the measured value of the physics-informed neural network using the mean squared error; the calculation formula for the data-driven error term is:
[0114] ;
[0115] In the formula, is the number of training samples; , respectively represent the predicted value and the measured value corresponding to the th training sample; represents the data-driven error term;
[0116] Obtain the continuity residual term based on the continuity equation and the momentum residual term based on the momentum equation.
[0117] The method for obtaining the continuity residual term is as follows:
[0118] Calculate the time derivative and the spatial divergence term of the continuity equation;
[0119] Calculate the continuity equation residual of each grid node by using the time derivative and the spatial divergence term of the continuity equation through automatic differentiation technology; the calculation formula is:
[0120] ;
[0121] Calculate the continuity residual term based on the continuity equation residual of each grid node.
[0122] ;
[0123] In the formula, represents the number of grid nodes, represents the residual of the continuity equation for the j-th grid node.
[0124] The method for obtaining the momentum residual term is as follows:
[0125] Calculate the time derivative and spatial divergence terms of the momentum equation;
[0126] Use the time derivative and spatial divergence terms of the momentum equation to calculate the momentum equation residual for each grid node through automatic differentiation technology; the calculation formula is:
[0127] ;
[0128] In the formula, represents the rate of change of the horizontal momentum flux with respect to time; represents the convective term, which describes the transport of momentum in space; represents the pressure gradient force under the action of gravity; represents the diffusion term, which describes the momentum diffusion caused by viscosity and turbulence; represents the external force (such as wind stress); represents the momentum equation residual for the j-th grid node;
[0129] Calculate the momentum residual term based on the momentum equation residual for each grid node; the calculation formula is:
[0130] ;
[0131] Calculate the attention mechanism weight penalty term by generating a weight matrix representing the attention mechanism, identifying the time steps of extreme events, and penalizing the regions where the attention weights are lower than the preset threshold;
[0132] The calculation method of the attention mechanism weight penalty term includes:
[0133] Calculate and generate a weight matrix representing the correlation between different time steps through the self-attention mechanism;
[0134] Detect and mark the time steps when extreme events occur based on the threshold of physical quantities; the physical quantities are wind speed or rainfall or water temperature; the extreme events include typhoons and heavy rains;
[0135] For the regions in the weight matrix where the attention weights are lower than the preset threshold, calculate the attention mechanism weight penalty term by applying a squared loss penalty term, and the calculation formula is:
[0136] ;
[0137] Wherein, represents the length of any time series in the training samples, represents the set of time steps at which extreme events occur; represents the attention weight, i.e., the degree of attention of the t-th time step to the t'-th time step, which is an element in the weight matrix; represents a preset threshold; represents the attention mechanism weight penalty term.
[0138] In addition, represents: calculating the difference between the attention weight and the preset threshold, and taking the maximum value of it and 0. If the attention weight is less than the preset threshold, the difference is positive, otherwise it is 0; : performing a square operation on the difference to amplify the penalty effect in the area with insufficient attention.
[0139] In this embodiment , represents the minimum attention weight requirement of the model for the time steps of extreme events. When is less than , it indicates insufficient weight and triggers the penalty term.
[0140] Construct a target loss function through the data-driven error term, continuity residual term, momentum residual term, and attention mechanism weight penalty term.
[0141] The formula expression of the target loss function is:
[0142] ;
[0143] Wherein, represents the continuity residual term; represents the momentum residual term; and represent the set physical constraint weight, represents the total loss.
[0144] The present invention constructs a target loss function by introducing the residuals in the shallow water equations as regularization terms and combining the attention mechanism weight penalty term, which not only strengthens the physical meaning of the target prediction model but also improves its response ability to extreme events; this design helps to enhance the stability and prediction accuracy of the target prediction model, especially under complex environmental conditions.
[0145] Among them, "physical meaning" means that the model not only depends on the statistical characteristics of the data during training and prediction, but also follows actual physical laws and processes. Specifically, by introducing the residuals in the shallow water equations as regularization terms, it is ensured that the model output conforms to known physical laws (such as mass conservation, momentum conservation, etc.), thereby making the model more realistic and reliable. This method enables the model to not only learn the patterns in the data, but also maintain the internal consistency with the physical world, so as to better simulate complex dynamic processes in the real environment, such as the algae growth and water body mixing processes. This physical consistency is particularly important for improving the stability and prediction accuracy of the model under complex environmental conditions.
[0146] Construct a physics-informed neural network including a first channel, a second channel, and a merging channel; train the physics-informed neural network with a training set and a target loss function to obtain a target prediction model; where:
[0147] The first channel is used to extract the spatial features of multi-dimensional physical field data; the second channel is used to extract the time series features of water quality time series and meteorological time series; the merging channel is used to fuse and process the extracted spatial features and time series features, and output the predicted value, that is, the algae biomass;
[0148] As Figure 2 shown, in this embodiment:
[0149] The first channel includes a convolutional layer, a pooling layer, and a flattening layer connected in sequence. This channel takes the velocity field, temperature field, and mixing degree field as inputs, and extracts spatial features through the convolutional layer, pooling layer, and flattening layer connected in sequence. The convolutional layer is used to capture the convolutional features in the input data, the pooling layer is used to reduce the feature dimension and retain the most important information, and the flattening layer converts the two-dimensional feature map into a one-dimensional vector for subsequent processing.
[0150] The second channel is a long short-term memory network (LSTM). This channel uses LSTM to specifically process water quality time series and meteorological time series. LSTM can effectively capture the long-term dependencies in the time series, so as to identify the historical change laws of water quality data and meteorological data.
[0151] The merging channel includes a fully connected layer, an attention layer, and an output layer connected in sequence. In this part, the spatial features and time series features extracted from the first channel and the second channel are fused together. The fully connected layer is used to integrate these features, and the attention layer enhances the model's attention to key features, especially being more sensitive to data mutations during extreme events such as typhoons and heavy rains. Finally, the output layer outputs the predicted algae biomass.
[0152] This model architecture not only utilizes the advantages of convolutional layers in extracting spatial features and the capabilities of LSTM in processing time-series data, but also improves the model's response ability to sudden environmental changes by introducing an attention mechanism, thereby significantly enhancing the accuracy and reliability of algal biomass prediction. This method is particularly suitable for complex and variable practical application scenarios, ensuring high-precision prediction results.
[0153] The target prediction model is obtained by training a physics-informed neural network with a training set and a target loss function, specifically as follows:
[0154] S1: Initialize the network parameters of the physics-informed neural network and the adjustable parameters of the hydrodynamic model, and set the initial number of training times to 1; the network parameters include weights and biases; the adjustable parameters include: initial conditions, boundary conditions, and physical coefficients;
[0155] Among the adjustable parameters:
[0156] The initial conditions include:
[0157] The initial water level is the water level height at each grid node at the start time of the simulation;
[0158] The initial flow velocity, which includes the velocity components in the horizontal and vertical directions;
[0159] The initial temperature field, which includes the water temperature at each grid node;
[0160] The initial water temperature is the average water surface temperature at the start time of the simulation;
[0161] The initial nutrient concentration, such as the initial distribution of nutrients such as total nitrogen and total phosphorus;
[0162] The boundary conditions include:
[0163] The flow boundary is the inflow or outflow flow rate;
[0164] The water level boundary is the water level height set at the boundary;
[0165] The physical coefficients include: diffusion coefficient, vertical turbulent viscosity, and nutrient diffusion coefficient.
[0166] S2: Input the training samples into the physics-informed neural network to obtain the predicted algal biomass;
[0167] S3: Calculate the total loss corresponding to the current training samples through the target loss function;
[0168] S4: Perform backpropagation based on the calculated total loss, calculate the gradients of the physics-informed neural network, and update the network parameters of the network using the gradient descent method; adjust the adjustable parameters of the hydrodynamic model based on the prediction error to achieve bidirectional coupling between the hydrodynamic model and the physics-informed neural network; the prediction error is the difference between the predicted value and the measured value.
[0169] The adjustment of the adjustable parameters of the hydrodynamic model based on the prediction error is specifically as follows:
[0170] Backward map the prediction error to the multi-dimensional physical field data, and use sensitivity analysis techniques (global sensitivity analysis or automatic differentiation) to evaluate the sensitivity of the simulation results of the hydrodynamic model to this error.
[0171] Based on the sensitivity analysis results, use the gradient descent method to update the adjustable parameters in the hydrodynamic model.
[0172] Feed the updated adjustable parameters back to the hydrodynamic model for generating the multi-dimensional physical field data of the next round of training samples.
[0173] To explain the specific process of adjusting the adjustable parameters of the hydrodynamic model based on the prediction error, the following takes the two parameters of water temperature and nutrient diffusion coefficient as specific examples:
[0174] 1. The initial parameters of the hydrodynamic model are set as follows:
[0175] Initial water temperature: ;
[0176] Nutrient diffusion coefficient: (empirical value).
[0177] 2. Forward propagation stage:
[0178] Run the hydrodynamic model using the above parameters to generate the multi-dimensional physical field data under the current training samples, including: velocity field (u, v), temperature field, and mixing degree field.
[0179] Input the multi-dimensional physical field data, water quality time series, and meteorological time series into the physics-informed neural network, and the predicted algal biomass output is: 12 mg / L.
[0180] 3. Calculate the prediction error:
[0181] The measured value is: ;
[0182] .
[0183] 4. Backward map the error to the multi-dimensional physical field data:
[0184] Introduce automatic differentiation technology to calculate the gradient of the prediction error with respect to each physical field variable:
[0185] (It indicates that an increase in temperature will significantly increase the predicted value). Specifically, this value represents the rate of change of the predicted value of algal biomass when the temperature field changes. The value "0.3" is the gradient value calculated during the model training process, which reflects the degree of influence of temperature on the predicted result of algal biomass; if this gradient value is positive (such as 0.3), it means that an increase in temperature will lead to an increase in the predicted value of algal biomass. In this example, the positive value of 0.3 indicates a positive correlation between temperature and algal biomass, that is, for every one-unit increase in temperature, the predicted value of algal biomass increases by an average of 0.3 units.
[0186] (This expression indicates the sensitivity of the prediction error of algal biomass with respect to changes in nutrient concentration). Specifically, the value "0.7" is the gradient value calculated during the model training process, which reflects the degree of influence of nutrient concentration on the predicted result of algal biomass. This value is automatically calculated during the training process through optimization methods such as backpropagation algorithm and gradient descent, and is used to measure the change in the prediction error caused by each unit change in nutrient concentration. If this gradient value is relatively high (such as 0.7), it means that the change in nutrient concentration has a significant impact on the prediction of algal biomass. Specifically, the positive value of 0.7 indicates a strong positive correlation between nutrient concentration and algal biomass, that is, for every one-unit increase in nutrient concentration, the predicted value of algal biomass increases by an average of 0.7 units. A relatively high gradient value (such as 0.7) means that nutrient concentration is a key driving factor, and its change will have a significant impact on algal growth. Therefore, in this case, it can be considered that nutrients are one of the main factors affecting the prediction of algal biomass.
[0187] 5. Use sensitivity analysis to evaluate the error sources:
[0188] Through global sensitivity analysis (in this embodiment, the Sobol index method is used for global sensitivity assessment to identify the parameters in the hydrodynamic model that contribute the most to the prediction error), evaluate the degree of influence of different parameters in the hydrodynamic model on the prediction error:
[0189] Sensitivity ranking: Nutrient diffusion coefficient > Initial water temperature;
[0190] It shows that the uncertainty of the nutrient diffusion coefficient has the greatest impact on the final prediction result.
[0191] 6. Update the adjustable parameters of the hydrodynamic model:
[0192] Update the nutrient diffusion coefficient according to the gradient descent method:
[0193]
[0194] In this embodiment, represents the updated nutrient diffusion coefficient; represents the nutrient diffusion coefficient before update ( ); represents the learning rate, which takes the value of 0.01 in this embodiment. Based on this, is calculated;
[0195] Similarly, if it is found that the initial water temperature is also sensitive, a small adjustment is made to it, for example, it is reduced to 19.5 °C.
[0196] 7. Feed the updated parameters back to the hydrodynamic model:
[0197] Use the new nutrient diffusion coefficient and initial water temperature to re-run the hydrodynamic model to generate the multi-dimensional physical field data required for a new round of training samples.
[0198] These updated data are closer to the real situation, which helps to improve the accuracy of subsequent neural network predictions.
[0199] The present invention first initializes the network parameters of the physical information neural network and the adjustable parameters of the hydrodynamic model, and then conducts model training. In each iteration process, training samples including multi-dimensional physical field data, water quality time series, and meteorological time series are input, and the total error of the current model output is calculated through the objective loss function. According to the calculated error, the weights of the physical information neural network are updated using the backpropagation algorithm, and the key parameters (such as initial conditions, boundary conditions, and physical coefficients) in the hydrodynamic model are adjusted based on the sensitivity analysis results. This dynamic adjustment mechanism ensures that the model can continuously learn and adapt to new environmental condition changes, thereby achieving more accurate prediction of algal biomass. In this way, the closed-loop training of the model is realized, the learning ability and generalization ability of the model are enhanced, and its stability and accuracy in complex and changeable actual application scenarios are also significantly improved.
[0200] It should be further noted that the present invention introduces a feedback mechanism. First, the hydrodynamic model generates multi-dimensional physical field data, which are input into the physics-informed neural network as training samples for predicting algal biomass. Then, the prediction error is inversely mapped to the multi-dimensional physical field data, and the global sensitivity analysis (such as the Sobol index method) is combined to evaluate the influence of each parameter in the hydrodynamic model on the prediction error, and the key parameters of the hydrodynamic model (such as initial conditions, boundary conditions, and physical coefficients) are dynamically adjusted accordingly. This two-way coupling mechanism realizes the interaction and collaborative optimization between the hydrodynamic model and the physics-informed neural network, not only enabling the model to continuously adapt to new environmental changes, but also significantly improving the accuracy, stability, and generalization ability of algal biomass prediction, especially suitable for complex and changeable practical application scenarios.
[0201] S5: Increment the number of training times by 1, and determine whether the number of training times is greater than the preset value. If so, end the training; if not, return to step S2 to start the input of the next round of training samples.
[0202] Predict the algal biomass through the target prediction model.
[0203] It should be noted that the algal biomass refers to the total amount of algae per unit volume or area at a specific time point, usually expressed by chlorophyll a concentration, cell number, or dry and wet weight, and is one of the important indicators for evaluating water quality health, eutrophication degree, and ecosystem status.
[0204] The algal biomass prediction method further includes the steps:
[0205] Set an early warning threshold, which is determined based on historical algal bloom data and expert experience, and is updated using a dynamic adjustment strategy to consider the influence of seasonal changes and environmental conditions. Through statistical methods and empirical formulas, the early warning threshold can be dynamically adjusted. For example, during the high-temperature period in summer, considering the accelerated growth rate of algae, the early warning threshold can be appropriately increased; after a typhoon, since the release of nutrients may promote the rapid reproduction of algae, in this case, the early warning threshold can be dynamically adjusted according to the nutrient release situation.
[0206] The early warning trigger logic is designed as follows: Regularly obtain the data from Internet of Things sensing and laboratory tests (water condition data, water quality data, and meteorological data). Each time the input data is updated, the target prediction model will be automatically called for analysis and calculation. When the predicted algal biomass exceeds the early warning threshold, an early warning notice will be issued. This can ensure effective early warning and intervention before the algal biomass reaches a potentially dangerous level.
[0207] The present invention first acquires and preprocesses water regime data, water quality data, and meteorological data, and then constructs a hydrodynamic model based on the shallow water equations, which couples the convection-diffusion equation and the wind stress-turbulence model to simulate the spatial distribution of nutrient concentrations, water temperature distribution, and vertical and horizontal mixing processes driven by wind; runs the model based on the time series of meteorological and water regime data to output multi-dimensional physical field data; then, performs spatial interpolation on the water quality data to align it with the spatio-temporal grid nodes of the hydrodynamic model; constructs an objective loss function by taking the residuals in the shallow water equations as the regularization term, and trains a physics-informed neural network to finally obtain an objective prediction model; by comprehensively considering the influence of various environmental factors, the hydrodynamic model can more accurately reflect the actual water body environment; the hydrodynamic model based on the shallow water equations combined with the convection-diffusion equation and the wind stress-turbulence model can accurately simulate the nutrient concentration, water temperature distribution, and mixing processes driven by wind, providing a highly realistic simulation of the background for algal growth; introducing an objective loss function with residuals as the regularization term not only improves the learning ability and generalization ability of the model, but also enhances its physical consistency and improves the accuracy and reliability of algal biomass prediction.
[0208] It should be noted that all directional indications (such as up, down, left, right, front, back...) in the embodiments of the present invention are only used to explain the relative positional relationship and movement conditions between components in a specific posture (as shown in the drawings). If the specific posture changes, the directional indication will also change accordingly.
[0209] In addition, in the present invention, descriptions such as "first", "second", "one", etc. are only for descriptive purposes and cannot be understood as indicating or implying their relative importance or implicitly indicating the quantity of the indicated technical features. Thus, features defined with "first" and "second" may explicitly or implicitly include at least one such feature. In the description of the present invention, the meaning of "a plurality" is at least two, such as two, three, etc., unless otherwise specifically defined.
[0210] In the present invention, unless otherwise clearly defined and limited, terms such as "connection" and "fixation" should be understood in a broad sense. For example, "fixation" can be a fixed connection, a detachable connection, or integrated; it can be a mechanical connection or an electrical connection; it can be directly connected or indirectly connected through an intermediate medium, and can be the internal communication of two components or the interaction relationship between two components, unless otherwise clearly limited. For those of ordinary skill in the art, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0211] In addition, the technical solutions between the various embodiments of the present invention can be combined with each other, but it must be based on the ability of those of ordinary skill in the art to implement. When the combination of technical solutions results in contradictions or cannot be implemented, it should be considered that such a combination of technical solutions does not exist and is not within the scope of protection required by the present invention.
Claims
1. A method for predicting algal biomass based on a bidirectional coupled hydrodynamic model and a physics-informed neural network, characterized in that, It includes: Obtain and preprocess hydrological data, water quality data, and meteorological data to obtain time series corresponding to various types of data; Construct a hydrodynamic model based on the shallow water equations; the hydrodynamic model is coupled with a convection-diffusion equation and a wind stress-turbulence model to simulate the spatial distribution of nutrient concentrations, water temperature distribution, and the vertical and horizontal mixing processes caused by wind driving; Run the hydrodynamic model based on the time series corresponding to the meteorological data and hydrological data. During the running process, interpolate the time series of the meteorological data to the calculation area of the hydrodynamic model, and output multi-dimensional physical field data including velocity field, temperature field, and mixing degree field; Perform spatial interpolation on the time series of water quality data, map it to the grid nodes of the hydrodynamic model to achieve spatial alignment, and unify the time step of the time series corresponding to various types of data to the same time step as the hydrodynamic model, and output the time series of water quality and the time series of meteorological data after spatio-temporal alignment; Construct a training set containing multiple training samples; the training samples include: multi-dimensional physical field data, time series of water quality data, and time series of meteorological data; Construct an objective loss function with the residual in the shallow water equations as the regularization term; Construct a physics-informed neural network containing a first channel, a second channel, and a merging channel; train the physics-informed neural network with the training set and the objective loss function to obtain an objective prediction model; where: The first channel is used to extract the spatial features of the multi-dimensional physical field data; the second channel is used to extract the time series features of the time series of water quality data and meteorological data; the merging channel is used to fuse and process the extracted spatial features and time series features, and output the predicted value, that is, the algal biomass; Predict the algal biomass through the objective prediction model.
2. The algal biomass prediction method based on the two-way coupled hydrodynamic model and the physics-informed neural network according to claim 1, characterized in that The simulation of the spatial distribution of nutrient concentrations, water temperature distribution, and the vertical and horizontal mixing processes caused by wind driving is specifically: Simulate the distribution characteristics of nutrient concentrations and water temperature in space through the convection-diffusion equation, calculate the wind stress through the quadratic wind speed formula, and combine the wind stress-turbulence model to dynamically solve the vertical turbulent viscosity, so as to simulate the vertical and horizontal mixing processes under wind driving.
3. A method for predicting algal biomass based on a bidirectional coupled hydrodynamic model and a physics-informed neural network according to claim 2, characterized in that The training label corresponding to the training sample is the algal biomass; the training of the physics-informed neural network with the training set and the objective loss function to obtain the objective prediction model is specifically: S1: Initialize the network parameters of the physics-informed neural network and the adjustable parameters of the hydrodynamic model, and set the initial number of training times to 1; the network parameters include weights and biases; the adjustable parameters include: initial conditions, boundary conditions, and physical coefficients; S2: Input the training sample into the physics-informed neural network to obtain the predicted algal biomass; S3: Calculate the total loss corresponding to the current training sample through the objective loss function; S4: Perform backpropagation according to the calculated total loss, calculate the gradient of the physics-informed neural network, and use the gradient descent method to update the network parameters of the network; adjust the adjustable parameters of the hydrodynamic model based on the prediction error to achieve the two-way coupling of the hydrodynamic model and the physics-informed neural network; the prediction error is the difference between the predicted value and the measured value; S5: Increment the number of training times by 1, and determine whether the number of training times is greater than the preset value. If so, end the training; if not, return to step S2 to start the input of the next round of training samples.
4. A method for predicting algal biomass based on a bidirectional coupled hydrodynamic model and a physics-informed neural network according to claim 3, characterized in that Among the adjustable parameters: The initial conditions include: The initial water level is the water level height at each grid node at the start time of the simulation. The initial flow velocity, which includes the velocity components in the horizontal and vertical directions. The initial temperature field, which includes the water temperature at each grid node. The initial nutrient concentration. The boundary conditions include: The flow boundary is the inflow or outflow rate. The water level boundary is the water level height set at the boundary. The physical coefficients include: the diffusion coefficient, the vertical turbulent viscosity, and the nutrient diffusion coefficient.
5. A method for predicting algal biomass based on a bidirectional coupled hydrodynamic model and a physics-informed neural network according to claim 4, wherein Adjusting the adjustable parameters of the hydrodynamic model based on the prediction error is specifically as follows: Backward map the prediction error to the multi-dimensional physical field data, and use the sensitivity analysis technique to evaluate the sensitivity of the simulation results of the hydrodynamic model to this error. Based on the sensitivity analysis results, use the gradient descent method to update the adjustable parameters in the hydrodynamic model. Feed the updated adjustable parameters back to the hydrodynamic model for generating the multi-dimensional physical field data of the next round of training samples.
6. The algal biomass prediction method based on the bidirectional coupled hydrodynamic model and the physics-informed neural network according to claim 5, wherein The shallow water equations include the continuity equation and the momentum equation; constructing the objective loss function with the residuals in the shallow water equations as the regularization term is specifically as follows: Calculate the data-driven error term between the predicted value and the measured value of the physics-informed neural network using the mean square error; the calculation formula of the data-driven error term is: ; Wherein, is the number of training samples; , respectively represent the predicted value and the measured value corresponding to the th training sample; represents the data-driven error term; Obtain the continuity residual term based on the continuity equation and the momentum residual term based on the momentum equation. Calculate the attention mechanism weight penalty term by generating the weight matrix representing the attention mechanism, identifying the time steps of extreme events, and penalizing the regions where the attention weights are lower than the preset threshold. Construct the objective loss function through the data-driven error term, the continuity residual term, the momentum residual term, and the attention mechanism weight penalty term.
7. A method for predicting algal biomass based on a two-way coupled hydrodynamic model and a physics-informed neural network according to claim 6, characterized in that, The method for obtaining the continuity residual term is: Calculate the time derivative and the spatial divergence term of the continuity equation. Calculate the continuity equation residual at each grid node by using the time derivative and the spatial divergence term of the continuity equation through the automatic differentiation technique. Calculate the continuity residual term based on the continuity equation residuals at each grid node. The method for obtaining the momentum residual term is: Calculate the time derivative and the spatial divergence term of the momentum equation. Calculate the momentum equation residual at each grid node by using the time derivative and the spatial divergence term of the momentum equation through the automatic differentiation technique. Calculate the momentum residual term based on the momentum equation residuals at each grid node.
8. A method for predicting algal biomass based on a bidirectional coupled hydrodynamic model and a physics-informed neural network according to claim 7, characterized in that The calculation method of the attention mechanism weight penalty term includes: Calculate and generate the weight matrix representing the correlation between different time steps through the self-attention mechanism. Detect and mark the time steps when extreme events occur based on the threshold of physical quantities; the physical quantities are wind speed or rainfall or water temperature; the extreme events include typhoons and heavy rains. For the regions in the weight matrix where the attention weights are lower than the preset threshold, calculate the attention mechanism weight penalty term by applying the squared loss penalty term, and the calculation formula is: ; wherein, represents the length of any time series in the training samples, represents the set of time steps at which extreme events occur; represents the degree of attention of the t-th time step to the t'-th time step, which is an element in the weight matrix; represents a preset threshold; represents the attention mechanism weight penalty term.
9. A method for predicting algal biomass based on a bidirectional coupled hydrodynamic model and a physics-informed neural network according to claim 8, wherein The formula expression of the objective loss function is: ; In the formula, represents the continuity residual term; represents the momentum residual term; and represents the set physical constraint weight, represents the total loss.
10. A method for predicting algal biomass based on a two-way coupled hydrodynamic model and a physics-informed neural network according to any one of claims 1 to 9, characterized in that the water condition data includes: flow velocity, water temperature and mixing degree; wherein, the mixing degree represents the intensity of mass exchange in the vertical and horizontal directions inside the water body simulated by the hydrodynamic model through coupling the convection-diffusion equation and the wind stress-turbulence model; the water quality data includes: chlorophyll a, total nitrogen, total phosphorus, dissolved oxygen and pH value; the meteorological data includes: wind speed, wind direction, rainfall and light intensity; the preprocessing specifically includes: filling the missing values in the water condition data, water quality data and meteorological data; performing normalization processing on the filled data of each type; processing the normalized data by using the sliding window technique to obtain the time series corresponding to the data of each type.
Citation Information
Patent Citations
Ocean dynamic simulation result generation method for target sea area
CN119106629A
Data dual-drive method, apparatus, and device for predicting power grid failure during typhoon
WO2023045278A1