Alga biomass prediction method based on bidirectional coupling hydrodynamic model and physical information neural network
By combining hydrodynamic models and physical information neural networks, using multi-dimensional physics data and time series data for training, the challenges of existing algae biomass prediction methods in terms of accuracy and adaptation to complex environmental changes are solved, and more efficient and reliable algae biomass prediction is achieved.
Patent Information
- Application Number
- CN202510629396.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-16
- Publication Date
- 2025-06-13
- Estimated Expiration
- 2045-05-16
AI Technical Summary
Existing algae biomass prediction methods have challenges in accuracy and adaptation to complex environmental changes, especially in poor performance when dealing with local hydrodynamic effects and predictions after extreme events.
The algae biomass prediction method based on the bidirectional coupled hydrodynamic model and physical information neural network is adopted to construct a shallow water equation system hydrodynamic model by acquiring and pre-processing water condition, water quality and meteorological data, and combined with the convection-diffusion equation and wind stress-turbulence model, the nutrient concentration, water temperature and mixing process were simulated. At the same time, a physical information neural network is built, and multi-dimensional physics data, water quality and meteorological time series are used for training, and model parameters are optimized through target loss function and backpropagation.
It improves the accuracy and reliability of algae biomass prediction, enhances the learning ability and physical consistency of the model, especially in complex and changeable environmental conditions, which can better respond to extreme events and adapt to environmental changes.
Smart Images

Figure CN120145942A_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. For example, 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, the accuracy of such models in predicting algal growth is difficult to fully guarantee. 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: Obtain and preprocess water regime 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 concentration, water temperature distribution, and the vertical and horizontal mixing processes caused by wind-driven forces; Run the hydrodynamic model based on the time series of meteorological data and water regime 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 a velocity field, a temperature field, and a 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 spatially and temporally aligned water quality time series and meteorological time series; 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; Construct a target loss function by taking the residuals in the shallow water equations as regularization terms; 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 the target loss function to obtain a target prediction model; where: 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 the extracted spatial features and time series features and output the predicted value, i.e., the algal biomass; Predict the algal biomass through the target prediction model.
[0004] Furthermore, the simulation of the spatial distribution of the simulated nutrient concentration, water temperature distribution, and the vertical and horizontal mixing processes caused by wind driving is specifically as follows: Simulate the distribution characteristics of nutrient concentration and water temperature in space through the advection-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.
[0005] Furthermore, 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 target loss function to obtain the target prediction model is specifically as follows: 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 target 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 bidirectional 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.
[0006] Furthermore, among the adjustable parameters: The initial conditions include: The initial water level, i.e., 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; An initial temperature field, which includes the water temperature of each grid node; 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: diffusion coefficient, vertical turbulent viscosity, and nutrient diffusion coefficient.
[0007] Furthermore, adjusting the adjustable parameters of the hydrodynamic model based on the prediction error is specifically: Backward mapping the prediction error to the multi-dimensional physical field data, and using sensitivity analysis technology to evaluate the sensitivity of the simulation results of the hydrodynamic model to this error; Based on the sensitivity analysis results, using the gradient descent method to update the adjustable parameters in the hydrodynamic model; Feeding back the updated adjustable parameters to the hydrodynamic model for generating the multi-dimensional physical field data of the next round of training samples.
[0008] Furthermore, the shallow water equations include the continuity equation and the momentum equation; constructing the objective loss function by taking the residuals in the shallow water equations as the regularization term is specifically: Calculating 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: ; 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; Obtaining the continuity residual term based on the continuity equation and the momentum residual term based on the momentum equation; Calculating 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; Constructing 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.
[0009] Furthermore, the method for obtaining the continuity residual term is: Calculating the time derivative and the spatial divergence term of the continuity equation; Calculating the continuity equation residual of each grid node using the time derivative and the spatial divergence term of the continuity equation through automatic differentiation technology; Calculate the continuity residual term based on the continuity equation residuals of each grid node; The method for obtaining the momentum residual term is as follows: Calculate the time derivative and spatial divergence terms of the momentum equation; Use the automatic differentiation technique to calculate the momentum equation residuals of each grid node by using the time derivative and spatial divergence terms of the momentum equation; Calculate the momentum residual term based on the momentum equation residuals of each grid node.
[0010] Furthermore, the calculation method of the attention mechanism weight penalty term includes: Calculate and generate a 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 a squared loss penalty term, and the calculation formula is: ; In the formula, represents the length of any time series in the training sample, represents the set of time steps when 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 the preset threshold; represents the attention mechanism weight penalty term.
[0011] Furthermore, the formula expression of the target 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.
[0012] 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; 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: Fill in the missing values in hydrological data, water quality data, and meteorological data; Normalize all types of data after filling; Process the normalized data using the sliding window technique to obtain the time series corresponding to all types of data.
[0013] Compared with the prior art, the present invention has at least the following beneficial effects:
[0014] (1) The present invention first obtains and preprocesses hydrological 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 concentration, water temperature distribution, and the vertical and horizontal mixing processes driven by wind; runs the model based on the time series of meteorological and hydrological data to output multi-dimensional physical field data; then, performs spatial interpolation on the water quality data to align it with the grid nodes of the hydrodynamic model in space and time; constructs an objective loss function by taking the residual in the shallow water equations as a 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 the mixing process driven by wind, providing a highly realistic simulation of the algae growth background; introducing an objective loss function with the residual as a 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 algae biomass prediction.
[0015] (2) The present invention trains a physics-informed neural network based on the hydrodynamic model. First, initialize the network parameters and the adjustable parameters of the hydrodynamic model, and dynamically adjust the network parameters based on the prediction error. Combine the sensitivity analysis technique to update the adjustable parameters of the hydrodynamic model, making the objective prediction model have stronger adaptability; 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 variable conditions or lack of prior knowledge, ensuring that the model can provide high-precision prediction results under various conditions.
[0016] (3) By introducing the continuous residual term and the momentum residual term, and combining the attention mechanism weight penalty term to construct the objective loss function, the present invention comprehensively considers the data-driven error, the physical process constraint, and the influence of extreme events, effectively simulates the real physical process, and enhances the response ability of the target prediction model to sudden environmental changes (such as typhoons and heavy rains).
[0017] (4) By training the physics-informed neural network with the objective loss function of multi-factor fusion, the present invention realizes the organic unity of physical consistency and data fitting ability, significantly improves the accuracy of algae biomass prediction and the robustness of the target prediction model, and is applicable to complex and changeable actual application scenarios. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] Figure 1 It is a flow chart of an algae biomass prediction method based on a bidirectional coupled hydrodynamic model and a physics-informed neural network;
[0019] Figure 2 It is a structural diagram of the physics-informed neural network. DETAILED DESCRIPTION OF THE INVENTION
[0020] The following are specific embodiments of the present invention in combination with the accompanying drawings to further describe the technical solutions of the present invention, but the present invention is not limited to these embodiments.
[0021] 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 algae biomass prediction method based on a bidirectional coupled hydrodynamic model and a physics-informed neural network, including: Obtain and preprocess water regime data, water quality data, and meteorological data to obtain time series corresponding to various types of data; 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; 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.
[0022] In order to construct an accurate target prediction model, this embodiment first obtains and preprocesses water regime data, water quality data, and meteorological data, all of which are from the monthly measured records in the forecast area in the past three years.
[0023] The preprocessing specifically includes: Fill in the missing values in the hydrological data, water quality data, and meteorological data; Normalize the various types of data after filling; Use the sliding window technique to process the normalized data to obtain the time series corresponding to the various types of data; Perform spatio-temporal alignment on the time series corresponding to the various types of data.
[0024] 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 driving;
[0025] 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 as follows: Simulate the distribution characteristics of nutrient concentrations and water temperature in space through the advection-diffusion equation, calculate the wind stress through the squared wind speed formula, and dynamically solve the vertical turbulent viscosity in combination with the wind stress-turbulence model, so as to simulate the vertical and horizontal mixing processes under wind driving.
[0026] To further explain, the hydrodynamic model is used to simulate the spatial evolution of nutrient concentrations, the distribution characteristics of water temperature in space, and the material and heat mixing processes in the vertical and horizontal directions inside the water body due to wind action by coupling the advection-diffusion equation and the wind stress-turbulence model. In this way, it can more realistically reflect the transmission mechanism of substances and heat inside the water body, provide a more accurate environmental background simulation for algal growth, and improve the reliability of algal biomass prediction.
[0027] The shallow water equations include the continuity equation and the momentum equation; among them: The formula expression of the continuity equation is: ; The momentum equation includes: The x-direction momentum equation: ; The y-direction momentum equation: ; In the formula, represents the water depth (unit: meter); represents the time (unit: second); represents the average flow velocity in the horizontal direction (unit: m / s); represents the average flow velocity in the horizontal direction (unit: m / s); represents the horizontal Momentum flux in the direction (unit: kg·m / (s²)); represents the gravitational potential energy term (unit: J / kg); represents the Coriolis force coefficient; represents the horizontal wind stress in the direction component (unit: N / m²); represents the Chezy coefficient (dimensionless); 、 respectively represent the diffusion coefficients in the and directions (unit: m² / s); represents the horizontal direction momentum flux (unit: kg·m / (s²)); represents the horizontal wind stress in the direction component (unit: N / m²).
[0028] The formula expression of the convection-diffusion equation is: ; In the formula, represents the change rate of concentration with time, that is, the change of concentration per unit time; represents the concentration change caused by fluid flow (convection), represents the concentration gradient; represents the diffusion coefficient; represents the source term or sink term, that is, the generation or consumption of substances per unit volume per unit time.
[0029] It should be noted here that and 、 represent the diffusion characteristics in different physical processes. In the convection-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.
[0030] 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 of the wind field to the water body.
[0031] The formula expression of the squared wind speed formula is: ; represents the wind stress; represents the air density; represents the drag coefficient; represents the wind speed.
[0032] Wind stress is introduced into or the turbulence model to drive the calculation of turbulent kinetic energy and dissipation rate for dynamically solving the vertical turbulent viscosity . The vertical turbulent viscosity reflects the influence of wind stress on vertical mixing and affects vertical momentum transfer through the diffusion term . Specifically, the transport of substances and the distribution of water temperature are simulated through the convection-diffusion equation, and this method supports the coupling of multiple physical processes. Temperature and salinity jointly affect the density of water bodies and feedback to the momentum equation through the buoyancy term, achieving an accurate simulation of 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 velocity in the vertical direction, that is, how the velocity changes with height.
[0033] Run the hydrodynamic model based on the time series corresponding to meteorological data and water regime data. During the operation, the time series of meteorological data are interpolated into the calculation area of the hydrodynamic model using the spatio-temporal joint interpolation method, and multi-dimensional physical field data including the flow velocity field, temperature field, and mixing degree field are output; 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 meteorological data after spatio-temporal alignment; It should be noted that in order to solve the shallow water equations (in this embodiment, the finite volume method is combined 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 substance transport. This method not only improves the calculation efficiency of the hydrodynamic model but also enhances the simulation accuracy of the actual water body environment.
[0034] Construct a training set containing multiple training samples; the training samples include: multi-dimensional physical field data, time series of water quality and meteorological data; the training label corresponding to the training sample is algal biomass; Construct the target loss function by taking the residuals in the shallow water equations as the regularization terms; The method of constructing the target loss function by taking the residuals in the shallow water equations as the regularization terms is specifically as follows: 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 of the data-driven error term is: ; 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; Obtain the continuity residual term based on the continuity equation and the momentum residual term based on the momentum equation; The method for obtaining the continuity residual term is as follows: Calculate the time derivative and the spatial divergence term of the continuity equation; Use the automatic differentiation technique to calculate the continuity equation residual of each grid node by using the time derivative and the spatial divergence term of the continuity equation; the calculation formula is: ; Calculate the continuity residual term based on the continuity equation residual of each grid node; ; In the formula, represents the number of grid nodes, represents the continuity equation residual of the jth grid node.
[0035] The method for obtaining the momentum residual term is as follows: Calculate the time derivative and the spatial divergence term of the momentum equation; Use the automatic differentiation technique to calculate the momentum equation residual of each grid node by using the time derivative and the spatial divergence term of the momentum equation; the calculation formula is: ; In the formula, represents the rate of change of the horizontal directional momentum flux with 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); Denote the momentum equation residual of the j-th grid node; Calculate the momentum residual term based on the momentum equation residuals of each grid node; the calculation formula is: ; 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; The calculation method of the attention mechanism weight penalty term includes: Calculate and generate a 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 a squared loss penalty term, and the calculation formula is: ; In the formula, Denote the length of any time series in the training samples, Denote the set of time steps when extreme events occur; Denote the attention weight, that is, the degree of attention of the t-th time step to the t'-th time step, which is an element in the weight matrix; Denote the preset threshold; Denote the attention mechanism weight penalty term.
[0036] In addition, Denote: calculate the difference between the attention weight and the preset threshold, and take 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; : Square the difference to amplify the penalty effect in the region with insufficient attention.
[0037] In this embodiment , denote the minimum attention weight requirement of the model for the time steps of extreme events. When is less than , it means that the weight is insufficient and the penalty term is triggered.
[0038] 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.
[0039] The formula expression of the objective loss function is: ; In the formula, Denote the continuity residual term; represents the momentum residual term; and represents the set physical constraint weight, represents the total loss.
[0040] The present invention constructs an objective loss function by introducing the residual in the shallow water equations as a regularization term and combining the attention mechanism weight penalty term, which not only strengthens the physical meaning of the objective prediction model but also improves its response ability to extreme events; this design helps to enhance the stability and prediction accuracy of the objective prediction model, especially under complex environmental conditions.
[0041] Among them, the "physical meaning" means that the model not only depends on the statistical characteristics of the data during training and prediction but also follows the actual physical laws and processes. Specifically, by introducing the residual in the shallow water equations as a regularization term, 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 the 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.
[0042] Construct a physical information neural network including a first channel, a second channel, and a merging channel; train the physical information neural network with a 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 multi-dimensional physical field data; the second channel is used to extract the time series features of water quality type time series and meteorological type time series; the merging channel is used to fuse the extracted spatial features and time series features and output the predicted value, that is, the algae biomass; As Figure 2 shown, in this embodiment:
[0043] 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.
[0044] The second channel is a long short-term memory network LSTM. This channel uses LSTM to specifically process water quality type time series and meteorological type time series. LSTM can effectively capture the long-term dependencies in the time series, thereby identifying the historical change laws of water quality type data and meteorological type data.
[0045] 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 algal biomass.
[0046] This model architecture not only utilizes the advantages of the convolutional layer in extracting spatial features and the ability of LSTM in processing time series data, but also improves the model's response ability to sudden environmental changes by introducing the attention mechanism, thereby significantly enhancing the accuracy and reliability of algal biomass prediction. This method is particularly suitable for complex and changeable practical application scenarios, ensuring high-precision prediction results.
[0047] The target prediction model is obtained by training the physics-informed neural network with a training set and a target loss function, specifically as follows: 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; 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 water temperature is the average water surface temperature at the start time of the simulation. The initial nutrient concentration, such as the initial distribution of nutrients such as total nitrogen and total phosphorus; The boundary conditions include: The flow boundary is the inflow or outflow flow rate; The water level boundary is the water level height set at the boundary; The physical coefficients include: diffusion coefficient, vertical turbulent viscosity, and nutrient diffusion coefficient.
[0048] S2: Input the training samples into the physics-informed neural network to obtain the predicted algal biomass;
[0049] S3: Calculate the total loss corresponding to the current training samples through the target loss function;
[0050] S4: Perform backpropagation based on the calculated total loss, calculate the gradients 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. Specifically, adjusting the adjustable parameters of the hydrodynamic model based on the prediction error is as follows: Inverse 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. 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.
[0051] To explain the specific process of adjusting the adjustable parameters of the hydrodynamic model based on the prediction error, the following takes two parameters, water temperature and nutrient diffusion coefficient, as specific examples for illustration:
[0052] 1. The initial parameters of the hydrodynamic model are set as follows: Initial water temperature: ; Nutrient diffusion coefficient: (empirical value).
[0053] 2. Forward propagation stage:
[0054] 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.
[0055] 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.
[0056] 3. Calculate the prediction error: The measured value is: ; .
[0057] 4. Inverse map the error to the multi-dimensional physical field data: Introduce the automatic differentiation technique to calculate the gradients of the prediction error with respect to each physical field variable:
[0058] (It indicates that an increase in temperature will significantly improve 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.
[0059] (This expression indicates the sensitivity of the prediction error of algal biomass 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 indicates 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.
[0060] 5. Use sensitivity analysis to evaluate the error sources: 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: Sensitivity ranking: Nutrient diffusion coefficient > Initial water temperature; It shows that the uncertainty of the nutrient diffusion coefficient has the greatest impact on the final prediction result.
[0061] 6. Update the adjustable parameters of the hydrodynamic model: Update the nutrient diffusion coefficient according to the gradient descent method:
[0062] In this embodiment, represents the updated nutrient diffusion coefficient; represents the nutrient diffusion coefficient before update ( ) Denote the learning rate, which takes the value of 0.01 in this embodiment. Based on this, it is calculated that ; 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.
[0063] 7. Feed back the updated parameters to the hydrodynamic model: Re-run the hydrodynamic model with the new nutrient diffusion coefficient and initial water temperature to generate the multi-dimensional physical field data required for a new round of training samples.
[0064] These updated data are closer to the real situation, which helps to improve the accuracy of subsequent neural network predictions.
[0065] 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 target loss function. According to the calculated error, the weights of the physical information neural network are updated by 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, so as to achieve 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.
[0066] 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 used as training samples and input into the physical information neural network 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 (such as initial conditions, boundary conditions and physical coefficients) of the hydrodynamic model are dynamically adjusted accordingly. This two-way coupling mechanism realizes the interaction and collaborative optimization between the hydrodynamic model and the physical information neural network, not only enables the model to continuously adapt to new environmental changes, but also significantly improves the accuracy, stability and generalization ability of algal biomass prediction, especially suitable for complex and changeable actual application scenarios.
[0067] S5: Increase 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 inputting the next round of training samples.
[0068] Predict the algal biomass through the target prediction model.
[0069] It should be noted that algal biomass refers to the total amount of algae in a unit volume or area at a specific point in time, usually expressed by chlorophyll a concentration, cell count, or dry and wet weight, and is one of the important indicators for evaluating water quality health, eutrophication level, and ecosystem status.
[0070] The algal biomass prediction method further includes the steps of: Setting 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 account for seasonal variations and environmental conditions. Through statistical methods and empirical formulas, the early warning threshold can be dynamically adjusted. For example, during high-temperature periods 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 rapid algal reproduction, in this case, the early warning threshold can be dynamically adjusted according to the nutrient release situation.
[0071] The early warning trigger logic is designed as follows: Regularly obtain Internet of Things sensing and laboratory test data (water regime 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.
[0072] 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 concentration, 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 grid nodes of the hydrodynamic model in space and time; constructs a target loss function by taking the residual in the shallow water equations as a regularization term, and trains a physics-informed neural network to finally obtain the target 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 algal growth background; introducing a target loss function with the residual as a 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.
[0073] 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 accompanying drawings). If the specific posture changes, the directional indications will also change accordingly.
[0074] In addition, in the present invention, descriptions such as "first", "second", "one", etc. are only for descriptive purposes and should not be construed as indicating or implying their relative importance or implicitly specifying 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.
[0075] 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 it can be the communication inside 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.
[0076] 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 protection scope required by the present invention.
Claims
1. A method for predicting algae biomass based on a bidirectional coupled hydrodynamic model and a physical information neural network, characterized in that: include: Acquire and preprocess water regime data, water quality data, and meteorological data to obtain the time series corresponding to each type of data; Constructing a hydrodynamic model based on the shallow water equations; the hydrodynamic model is coupled with the convection-diffusion equation and the wind stress-turbulence model to simulate the spatial distribution of nutrient concentration, water temperature distribution, and vertical and horizontal mixing processes driven by wind; The hydrodynamic model is run based on the time series corresponding to the meteorological data and the water regime data. During the operation, the time series of the meteorological data is interpolated to the calculation area of the hydrodynamic model, and multi-dimensional physical field data including velocity field, temperature field and mixing degree field are output; 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 steps of the time series corresponding to each type of data to the time step consistent with the hydrodynamic model, and output the water quality time series and meteorological time series after spatial and temporal alignment; Constructing a training set including a plurality of training samples; the training samples include: multi-dimensional physical field data, water quality time series and meteorological time series; The residual in the shallow water equations is used as a regular term to construct the objective loss function; Construct a physical information neural network including the first channel, the second channel and the merged channel; train the physical information neural network through the training set and the target loss function to obtain the target prediction model; wherein: The first channel is used to extract the spatial features of multidimensional 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 the extracted spatial features and time series features and output the predicted value, i.e., algae biomass; Predict algal biomass through target prediction model.
2. The algae biomass prediction method based on a bidirectional coupling hydrodynamic model and a physical information neural network according to claim 1, characterized in that: The simulated spatial distribution of nutrient concentration, water temperature distribution, and vertical and horizontal mixing processes caused by wind drive are specifically as follows: The convection-diffusion equation is used to simulate the spatial distribution characteristics of nutrient concentration and water temperature, the wind stress is calculated using the square wind speed formula, and the vertical turbulent viscosity is dynamically solved in combination with the wind stress-turbulence model, thereby simulating the vertical and horizontal mixing process driven by wind.
3. The algae biomass prediction method based on a bidirectional coupled hydrodynamic model and a physical information neural network according to claim 2, characterized in that: The training label corresponding to the training sample is algae biomass; the target prediction model is obtained by training the physical information neural network through the training set and the target loss function, specifically: S1: Initializing the network parameters of the physical information neural network and the adjustable parameters of the hydrodynamic model, and setting 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 samples into the physical information neural network to obtain the predicted algae biomass; S3: Calculate the total loss corresponding to the current training sample through the target loss function; S4: performing back propagation according to the calculated total loss, calculating the gradient of the physical information neural network, and updating the network parameters of the network using the gradient descent method; adjusting the adjustable parameters of the hydrodynamic model based on the prediction error to achieve bidirectional coupling between the hydrodynamic model and the physical information neural network; the prediction error is the difference between the predicted value and the measured value; S5: Add 1 to the number of training times, and determine whether the number of training times is greater than a preset value. If so, end the training; if not, return to step S2 to start the next round of training sample input.
4. The algae biomass prediction method based on a bidirectional coupling hydrodynamic model and a physical information neural network according to claim 3, characterized in that: The adjustable parameters are: The initial conditions include: The initial water level is the water level height at each grid node at the beginning of the simulation; Initial flow velocity, which includes velocity components in the horizontal and vertical directions; The initial temperature field, which includes the water temperature at each grid node; Initial nutrient concentration; The boundary conditions include: The flow boundary is the flow in or out; The water level boundary is the water level height at the set boundary; The physical coefficients include diffusion coefficient, vertical turbulent viscosity and nutrient diffusion coefficient.
5. The algae biomass prediction method based on a bidirectional coupled hydrodynamic model and a physical information neural network according to claim 4, characterized in that: The adjustable parameters of the hydrodynamic model are adjusted based on the prediction error, specifically: The prediction error is back-mapped to multi-dimensional physical field data, and sensitivity analysis techniques are used to evaluate the sensitivity of the simulation results of the hydrodynamic model to the error; Based on the sensitivity analysis results, the gradient descent method is used to update the adjustable parameters in the hydrodynamic model; The updated adjustable parameters are fed back to the hydrodynamic model for generating multidimensional physical field data for the next round of training samples.
6. The method for predicting algae biomass based on a bidirectionally coupled hydrodynamic model and a physical information neural network according to claim 5, characterized in that: The shallow water equations include continuity equations and momentum equations; the residual in the shallow water equations is used as a regular term to construct the target loss function, specifically: The data-driven error term between the predicted value and the measured value of the physical information neural network is calculated using the mean square error; the calculation formula of the data-driven error term is: ; In the formula, is the number of training samples; , Respectively represent The predicted value and measured value corresponding to the training samples; 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; The attention mechanism weight penalty term is calculated by generating a weight matrix representing the attention mechanism, identifying extreme event time steps, and penalizing areas where the attention weight is below a preset threshold. The target loss function is constructed by data-driven error term, continuity residual term, momentum residual term and attention mechanism weight penalty term.
7. The algae biomass prediction method based on a bidirectional coupling hydrodynamic model and a physical information neural network according to claim 6, characterized in that: The method for obtaining the continuity residual term is: Compute the time derivative and spatial divergence terms of the continuity equation; The residual of the continuity equation at each grid node is calculated using the time derivative and spatial divergence term of the continuity equation through automatic differentiation technology; Calculate the continuity residual term based on the continuity equation residual at each grid node; The method for obtaining the momentum residual term is: Compute the time derivative and spatial divergence terms of the momentum equation; The residual of the momentum equation at each grid node is calculated using the time derivative and spatial divergence term of the momentum equation through automatic differentiation techniques; The momentum residual term is calculated based on the residual of the momentum equation at each mesh node.
8. The algae biomass prediction method based on a bidirectional coupling hydrodynamic model and a physical information neural network according to claim 7, characterized in that: The calculation method of the attention mechanism weight penalty term includes: The weight matrix representing the correlation between different time steps is calculated and generated through the self-attention mechanism; Detect and mark the time step of extreme events based on the threshold of physical quantities; the physical quantities are wind speed, rainfall or water temperature; the extreme events include typhoons and rainstorms; For areas in the weight matrix where the attention weight is lower than the preset threshold, the attention mechanism weight penalty term is calculated by applying a square loss penalty term. The calculation formula is: ; In the formula, represents the length of any time series in the training sample, represents the set of time steps where extreme events occur; Indicates the degree of attention of the t-th time step to the t′-th time step, which is an element in the weight matrix; Indicates the preset threshold; Represents the attention mechanism weight penalty term.
9. The method for predicting algae biomass based on a bidirectional coupled hydrodynamic model and a physical information neural network according to claim 8, characterized in that: The formula expression of the objective loss function is: ; In the formula, represents the continuous residual term; represents the momentum residual term; and Represents the set physical constraint weight, Represents the total loss.
10. The algae biomass prediction method based on a bidirectional coupling hydrodynamic model and a physical information neural network according to any one of claims 1 to 9, characterized in that: The water condition data include: flow velocity, water temperature and mixing degree; wherein the mixing degree represents the material exchange intensity in the vertical and horizontal directions inside the water body obtained by simulating the hydrodynamic model through coupling the convection-diffusion equation and the wind stress-turbulence model; The water quality data include: chlorophyll a, total nitrogen, total phosphorus, dissolved oxygen and pH value; The meteorological data include: wind speed, wind direction, rainfall and light intensity; The pre-processing specifically includes: Fill in missing values in water regime data, water quality data and meteorological data; Normalize all types of data after filling; The normalized data is processed using sliding window technology to obtain the time series corresponding to each type of data.
Citation Information
Patent Citations
Lake ecological hydraulic regulation and control method and system based on hydrological-ecological response relationship
CN116630122A
Multi-scale space-time diagram convolution blue-green algae forecasting method and device based on hydrodynamic perception
CN119026085A
Ocean dynamic simulation result generation method for target sea area
CN119106629A
Fluid mechanics equation solving method based on physical information neural network
CN119989887A
Data dual-drive method, apparatus, and device for predicting power grid failure during typhoon
WO2023045278A1
Cited By
Cascade reservoir optimization regulation and control method based on nitrogen and phosphorus circulation of water body
CN120509682A
Physical mechanism and data driving collaborative two-stage wind power prediction method
CN121072880A
Mountain torrent automatic identification and real-time early warning system based on deep learning
CN121189243A
Intelligent monitoring method and system for cyanobacterial bloom outbreak
CN121280783A
Method for predicting three-dimensional spatial and temporal distribution of algae in water body based on physical information neural network
CN121997782A