Algae biomass prediction method based on state evolution consistency constraint
By combining algal growth kinetic equations with deep learning models, an algal biomass prediction method with state evolution consistency constraints is constructed. This solves the problems of insufficient adaptability of physical models and lack of physical constraints in deep learning models in existing technologies, and achieves high-precision and stable algal biomass prediction.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- HOHAI UNIV
- Filing Date
- 2026-01-27
- Publication Date
- 2026-05-15
AI Technical Summary
Existing methods for predicting algal biomass are difficult to calibrate the parameters of physical mechanism models and are hard to adapt to complex aquatic environments. Deep learning models lack physical constraints, resulting in prediction results that do not conform to the growth patterns of algae, especially with significant errors in extreme environments.
By integrating algal growth kinetic equations with multivariate deep learning, a prediction method with state evolution consistency constraints is constructed through STL temporal decomposition, kinetic embedding temporal prediction model, and kinetic consistency gating mechanism. A time step prediction correction mechanism is introduced to correct the prediction results.
It improves the accuracy and stability of algal biomass prediction, enhances the interpretability and adaptability of the model to complex environments, and reduces prediction errors under extreme conditions.
Smart Images

Figure CN122045673A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of water environment prediction technology, and relates to algal biomass prediction technology, specifically to an algal biomass prediction method based on state evolution consistency constraints. Background Technology
[0002] Under the dual pressures of global warming and intensified human activities, eutrophication of water bodies is becoming increasingly prominent, with the frequency and intensity of algal blooms continuing to rise, posing a serious threat to aquatic ecological security. On the one hand, global warming leads to increased water temperatures and changes in hydrological indicators, creating favorable conditions for algal proliferation, while frequent extreme weather events further exacerbate the suddenness and destructiveness of algal blooms. On the other hand, with the rapid development of industry and agriculture and the acceleration of urbanization, large amounts of nitrogen and phosphorus nutrients are discharged into water bodies, providing ample material basis for algal growth, leading to a chain of ecological crises such as drinking water source pollution and a decline in aquatic biodiversity. Algal biomass, as a direct indicator of algal blooms, has become a core element in water environment risk early warning, and is of great significance for ensuring water supply security and maintaining aquatic ecological health.
[0003] Existing methods for predicting algal biomass are mainly divided into two categories: physical mechanism models and deep learning models. Physical mechanism models are based on algal growth kinetic equations (such as the Monod equation), describing the regulatory effects of environmental factors such as temperature, light, and nutrients on algal growth through differential equations, and possess clear physical interpretability. However, these models require precise measurement of a large number of physiological parameters (such as maximum growth rate and half-saturation constant), making parameter calibration difficult. Furthermore, they are ill-suited to the complex and ever-changing real-world aquatic environment, and are prone to prediction bias in practical applications. Deep learning models, on the other hand, employ statistical methods (such as time series analysis). While they can quickly establish input-output mapping relationships, they neglect the biological mechanisms of algal growth, have limited ability to express nonlinear relationships, and their predictive reliability significantly decreases during sudden environmental changes, making it difficult to accurately capture the critical transition processes of algal blooms.
[0004] In recent years, deep learning technology has shown great potential in the field of algae prediction, especially time-series models such as Long Short-Term Memory (LSTM) networks, which can effectively handle the high dimensionality, nonlinearity, and temporal dependence of water quality data. However, most existing deep learning models adopt a purely data-driven "black box" paradigm. Although they can fit historical data patterns, they have two fundamental drawbacks: first, the model predictions often violate the basic dynamics of algal growth; second, they lack physical constraints on algal physiological mechanisms, leading to long-term prediction errors. When faced with extreme hydrological scenarios not covered by training data, model predictions often deviate significantly from actual algal growth patterns, making it difficult to support critical water environment risk decisions.
[0005] The core contradiction currently facing the field of algae prediction is that mechanistic models have physical interpretability but lack practicality, while deep learning models have strong fitting ability but lack physical consistency. Summary of the Invention
[0006] Purpose of the invention: In order to overcome the shortcomings of the existing technology, this invention provides an algal biomass prediction method based on state evolution consistency constraints. It integrates physical laws and multivariate deep learning, makes up for the lack of interpretability of deep learning models, and adds algal growth dynamics equation constraints to improve the interpretability of the model and promote the improvement of model performance.
[0007] Technical Solution: To achieve the above objectives, this invention provides a method for predicting algal biomass based on state evolution consistency constraints, comprising the following steps:
[0008] S1: Acquire river water quality observation data and time-series hydro-meteorological driving data that have spatiotemporal heterogeneity;
[0009] S2: Preprocess the data obtained in step S1, including handling missing values, removing outliers, and unifying time.
[0010] S3: Perform STL time-series decomposition on the algae density term in the preprocessed data and retain the trend term to obtain the algae density trend component;
[0011] S4: Based on the algal growth kinetics equation, physical constraints are established to obtain the specific growth rate dynamic equation;
[0012] S5: Construct a dynamically embedded time-series prediction model, which represents the state of algal ecosystems with implicit ecological state vectors, and models the changes in ecological state between adjacent time steps through state transition prediction units. Introduce a dynamic consistency gating mechanism to constrain the state update process.
[0013] S6: Input the preprocessed data in step S2 and the algal density trend component obtained in step S3 into the time-series prediction model of dynamic embedding in step S5 for training and evaluation, and combine the time step prediction correction mechanism to correct the ecological state during the prediction process to obtain an optimized model for algal biomass prediction.
[0014] S7: Output the predicted value of algal biomass using the optimized model from step S6.
[0015] Furthermore, the preprocessing in step S2 includes:
[0016] The original data is standardized using the Z-score standardization method, which is based on the mean and standard deviation of the original data. This ensures that the processed data conforms to a standard normal distribution. The calculation formula is as follows:
[0017]
[0018] in, This represents the new data after standardization. Represents the original data. This represents the mean of the original data. This represents the standard deviation of the original data.
[0019] Furthermore, in step S3, the algal density time series is set as follows: It is split into three components using STL timing decomposition:
[0020]
[0021] in, This represents time series data on algal density. Indicates trend components, Indicates seasonal quantity. This indicates the amount of residual ginseng.
[0022] Furthermore, in step S3, algae density data is obtained through iterative iteration. The iterative process includes:
[0023] A1: Detrending, the calculation formula is as follows:
[0024]
[0025] Among them, the initial value ; and These are the difference order and the number of iterations, respectively.
[0026] A2: Seasonal subsequence smoothing: ... Divide into p subsequences according to period p. For each subsequence, a Loess local weighted regression is performed, calculated using the following formula:
[0027]
[0028] The locally weighted regression formula is as follows:
[0029]
[0030] in, The weighting function is calculated using the following formula:
[0031]
[0032]
[0033]
[0034] in, The distance is relative. To smooth the window width;
[0035] A3: Seasonal Noise Reduction:
[0036] right Low-pass filtering is performed to extract slowly changing low-frequency signals, remove high-frequency noise from seasonal components, and preserve periodic characteristics to obtain... To obtain the seasonal portion:
[0037]
[0038] A4: Deseasonalization:
[0039]
[0040] A5: Extract trend components:
[0041]
[0042] A6: Robust handling: Use the following function to reduce the impact of outliers:
[0043] When satisfied hour, ;
[0044] when hour, ;
[0045] in, ; This refers to the amount of residual ginseng.
[0046] A7: Output the denoised trend component as algal density data:
[0047] .
[0048] Further, step S4 includes:
[0049] The differential equation for algal growth kinetics is established as follows:
[0050]
[0051] in, Indicates algal density, represents the specific growth rate, and m represents the specific mortality rate;
[0052] Transform the equation into a time step. Difference form:
[0053]
[0054] Define the specific growth rate For nonlinear functions of environmental factors:
[0055]
[0056] in, This represents the water temperature at time t. Represents the light intensity at time t. This represents the total nitrogen concentration at time t. This represents the total phosphorus concentration at time t;
[0057] Set the loss function as follows:
[0058]
[0059] in, The weighting coefficients are used, and the main loss function uses RMSE as an indicator, which measures the deviation between the predicted value and the actual value. The calculation formula is as follows:
[0060]
[0061] Where RMSE represents the root mean square error, and n is the sample size. This represents the i-th true value. This represents the i-th predicted value;
[0062] Based on the difference form of the differential equation of algal growth kinetics, set The equation is as follows:
[0063]
[0064] Final output: Specific growth rate .
[0065] Furthermore, the time-series prediction model constructed in step S5 includes an enhanced gating unit to achieve state transition prediction and time step prediction correction, namely a forget gate, a memory gate, a dynamic consistency gating, an output gate, and a time step prediction correction, wherein:
[0066] Forgotten Gate:
[0067]
[0068] in, This represents the activation function of the forget gate. This represents the Sigmoid activation function. The weight matrix represents the forget gate. This indicates the hidden state of the previous time step. This represents the current time step input. This represents the bias vector of the forget gate. This represents the dynamic residual of the previous time step. This is the state prediction value from the previous time step. This is the adjustment coefficient;
[0069] Memory Gate:
[0070]
[0071]
[0072] in, This represents the activation function of the input gate. This represents the weight matrix of the input gate. This represents the bias vector of the input gate. Indicates the candidate cell state. It is the hyperbolic tangent function. This is the state prediction value from the previous time step. This is the adjustment coefficient;
[0073] Cell status update:
[0074]
[0075]
[0076]
[0077] in, and These represent the cell states at the current time step and the previous time step, respectively. This indicates element-wise multiplication. For dynamic consistency gating weights, Indicates residual sensitivity. For gated bias. Indicates the activation function;
[0078] Dynamic consistency gating:
[0079]
[0080]
[0081]
[0082] Output gate:
[0083]
[0084]
[0085] in, This represents the activation function of the output gate. This represents the weight matrix of the output gate. This represents the bias vector of the output gate. This indicates the hidden state at the current time step;
[0086] Time step prediction correction:
[0087] when At that time, backtrack and correct the previous state:
[0088]
[0089]
[0090] in, This is the corrected algal density from the previous moment. To control the adjustment range, This is the gradient value of the residual with respect to the state at the previous time step.
[0091] Furthermore, the training method of the LSTM model in step S6 is as follows: the algal growth dynamics differential equation is embedded as a physical constraint in the training process of the LSTM model, and dynamic consistency gating and time step prediction correction are introduced at the same time. Under the premise of ensuring physical consistency, the algal density prediction value at the next moment is corrected, thereby completing the prediction of algal density.
[0092] Furthermore, in step S6, the Nash efficiency coefficient (NSE) is used as an evaluation index for model performance, and the calculation formula is as follows:
[0093]
[0094] in, The Nash efficiency coefficient. For the sample size, These are observed values. These are model predictions. It is the average of the observed values.
[0095] This invention deeply integrates algal growth dynamics with the state evolution of a deep learning time-series prediction model, avoiding the lack of physical consistency in data-driven models. By using dynamic consistency constraints and time-step prediction correction of extreme values, it improves the model's adaptability to complex hydrological environments, enhances prediction accuracy, and increases interpretability.
[0096] Beneficial Effects: Compared with existing technologies, this invention embeds the algal growth kinetic equation as a physical constraint into a deep learning model, and introduces kinetic consistency gating, state transition regulation, and time step prediction backtracking correction mechanisms, achieving high-precision, physically consistent, and stable prediction of algal biomass. This invention possesses the following beneficial effects:
[0097] 1. Achieving coupling between algal growth mechanisms and deep learning models:
[0098] This invention not only uses algal growth kinetics as a loss function for constraint, but also directly embeds the algal growth kinetics differential equation into the state transition process of the LSTM model. By comparing the consistency of algal density changes, the model prediction is dynamically adjusted. While retaining the powerful fitting ability of deep learning, it ensures that the prediction results conform to the algal growth law and improves the interpretability of the model.
[0099] 2. Introduce dynamic consistency gating to suppress transitions that do not conform to physical laws:
[0100] This invention constructs a dynamic consistency gating mechanism based on the residual between predicted transitions and theoretical transitions, adaptively adjusting the algal density state update amplitude according to the degree of dynamic consistency. When the model weakens the transition when the predicted quantity deviates from the physical mechanism, it avoids the deep learning model from generating abrupt changes that do not conform to physical laws under noise perturbation.
[0101] 3. Reduce the cumulative effect of errors through state transition adjustment and time step prediction backtracking correction:
[0102] To address the problem of error accumulation over time in time series forecasting, this invention further introduces a time step forecast backtracking correction mechanism based on gating adjustment. When the deviation between the forecast result and the kinetic constraint exceeds a threshold, the algal density state of the previous time step is reversed and the current forecast result is recalculated, effectively suppressing the spread of errors in long-term forecasting and improving the stability and reliability of the model on the time scale.
[0103] 4. Enhance model generalization ability and prediction robustness in complex environments:
[0104] Through the combined effects of dynamic constraints, gating adjustment, and backtracking correction, this invention can effectively cope with complex environmental scenarios such as nutrient pulse input, continuous high temperature, and sudden hydrological changes, significantly reducing the prediction distortion problem of traditional data-driven models under drastic environmental changes, thereby improving the model's generalization ability in different watersheds and climate backgrounds.
[0105] 5. Improve prediction accuracy under noise interference:
[0106] This invention decomposes algal density time series data into STL and extracts trend components as model input, reducing the interference of random noise and periodic perturbations on model training. Together with the dynamic consistency constraint mechanism, it effectively improves prediction accuracy under conditions of large observation errors and uneven data quality. Attached Figure Description
[0107] Figure 1 This is a schematic flowchart of the method of the present invention;
[0108] Figure 2 Time series plot of algae density at site31;
[0109] Figure 3 Scatter plot of predicted and actual values of algae density and chlorophyll at site31. Detailed Implementation
[0110] The present invention will be further illustrated below with reference to the accompanying drawings and specific embodiments. It should be understood that these embodiments are for illustrative purposes only and are not intended to limit the scope of the invention. After reading this invention, any modifications of the invention in various equivalent forms by those skilled in the art will fall within the scope defined by the appended claims.
[0111] Example 1:
[0112] like Figure 1 As shown, this embodiment provides a method for predicting algal biomass based on state evolution consistency constraints, including the following steps:
[0113] S1: Acquire river water quality observation data and time-series hydrological and meteorological driving data with spatiotemporal heterogeneity to enable the model to capture spatiotemporal characteristics;
[0114] The water quality observation data includes latitude and longitude information of multiple river stations, time series data with specific time intervals, and water quality parameters including algae density, water temperature, total nitrogen, and total phosphorus.
[0115] Hydrometeorological data include daily precipitation, light intensity, average temperature, maximum temperature, and minimum temperature.
[0116] S2: Preprocess the data obtained in step S1;
[0117] The preprocessing in this embodiment includes:
[0118] Data cleaning: Detecting and removing duplicate records from data, identifying and handling outliers, and detecting and handling missing values in data;
[0119] Data transformation: The Z-score method is used to standardize the data, making it present a standard normal distribution with a mean of 0 and a standard deviation of 1, ensuring consistency across different scales. The specific calculation formula is as follows:
[0120]
[0121] in, This represents the new data after standardization. Represents the original data. This represents the mean of the original data. This represents the standard deviation of the original data.
[0122] Data partitioning: The data is divided into training and test sets at 70% and 30% respectively to ensure model performance.
[0123] S3: Perform STL time-series decomposition on the algae density term in the preprocessed data and retain the trend term to obtain the algae density trend component;
[0124] Let the algal density time series be It is split into three components using STL timing decomposition:
[0125]
[0126] in, This represents time series data on algal density. Indicates trend components, Indicates seasonal quantity. This indicates the amount of residual ginseng.
[0127] Algal density data is obtained through iterative iteration. The iterative process includes:
[0128] A1: Detrending, the calculation formula is as follows:
[0129]
[0130] Among them, the initial value ; and These are the difference order and the number of iterations, respectively.
[0131] A2: Seasonal subsequence smoothing: ... Divide into p subsequences according to period p. , For each subsequence, a Loess local weighted regression is performed, calculated using the following formula:
[0132]
[0133] The locally weighted regression formula is as follows:
[0134]
[0135] in, The weighting function is calculated using the following formula:
[0136]
[0137]
[0138]
[0139] in, The distance is relative. To smooth the window width;
[0140] A3: Seasonal Noise Reduction:
[0141] Seasonal Quantities Low-pass filtering is performed to extract slowly changing low-frequency signals, remove high-frequency noise from seasonal components, and preserve periodic characteristics to obtain... To obtain the seasonal portion:
[0142]
[0143] A4: Deseasonalization:
[0144]
[0145] A5: Extract trend components:
[0146]
[0147] A6: Robust handling: Use the following function to reduce the impact of outliers:
[0148] When satisfied hour, ;
[0149] when hour, ;
[0150] in, ; This refers to the amount of residual ginseng.
[0151] A7: Output the denoised trend component as algal density data:
[0152] .
[0153] S4: Based on the algal growth kinetics equation, physical constraints are established to obtain the specific growth rate dynamic equation;
[0154] Step S4 includes:
[0155] The differential equation for algal growth kinetics is established as follows:
[0156]
[0157] in, This indicates algal density (cells / ml). Indicates specific growth rate ( ), m represents the rate of death ( In this embodiment, m is taken as 0.05-0.5. ;
[0158] Transform the equation into a time step. Difference form:
[0159]
[0160] Define the specific growth rate For nonlinear functions of environmental factors:
[0161]
[0162] in, This represents the water temperature at time t. Represents the light intensity at time t. This represents the total nitrogen concentration at time t. This represents the total phosphorus concentration at time t;
[0163] Set the loss function as follows:
[0164]
[0165] in, For weighting coefficients, the main loss function is... RMSE is used as an indicator to measure the deviation between the predicted value and the actual value. The calculation formula is as follows:
[0166]
[0167] Where RMSE represents the root mean square error, and n is the sample size. This represents the i-th true value. This represents the i-th predicted value;
[0168] Based on the difference form of the differential equation of algal growth kinetics, set The equation is as follows:
[0169]
[0170] Final output: Specific growth rate .
[0171] S5: Construct a dynamically embedded time-series prediction model, which represents the state of algal ecosystems with implicit ecological state vectors, and models the changes in ecological state between adjacent time steps through state transition prediction units. Introduce a dynamic consistency gating mechanism to constrain the state update process.
[0172] After completing data preprocessing, algal density trend component extraction, and kinetic differential equation construction, this embodiment constructs a long short-term memory network model that integrates algal growth kinetic constraints for time-series prediction of algal biomass.
[0173] While retaining the basic structure of the traditional LSTM forget gate, memory gate, and output gate, the model introduces a dynamic consistency gating unit to improve the cell state update process and the model state transition process, so that the model prediction process can meet the data-driven requirements while conforming to the basic dynamic laws of algal growth.
[0174] The model uses the preprocessed multivariate water quality, hydrological, and meteorological data from step S2, as well as the algal density trend component obtained in step S3, as input vectors. In the LSTM layer, the calculation formulas for each part are as follows:
[0175] Forgotten Gate:
[0176]
[0177] in, This represents the activation function of the forget gate. This represents the Sigmoid activation function. The weight matrix represents the forget gate. This indicates the hidden state of the previous time step. This represents the current time step input. This represents the bias vector of the forget gate. This represents the dynamic residual of the previous time step. This is the state prediction value from the previous time step. This is the adjustment coefficient;
[0178] Memory Gate:
[0179]
[0180]
[0181] in, This represents the activation function of the input gate. This represents the weight matrix of the input gate. This represents the bias vector of the input gate. Indicates the candidate cell state. It is the hyperbolic tangent function. This is the state prediction value from the previous time step. This is the adjustment coefficient;
[0182] Cell status update:
[0183]
[0184]
[0185]
[0186] in, and These represent the cell states at the current time step and the previous time step, respectively. This indicates element-wise multiplication. For dynamic consistency gating weights, Indicates residual sensitivity. For gated bias. Indicates the activation function;
[0187] Dynamic consistency gating:
[0188]
[0189]
[0190]
[0191] Output gate:
[0192]
[0193]
[0194] in, This represents the activation function of the output gate. This represents the weight matrix of the output gate. This represents the bias vector of the output gate. This indicates the hidden state at the current time step;
[0195] Time step prediction correction:
[0196] when At that time, backtrack and correct the previous state:
[0197]
[0198]
[0199] in, This is the corrected algal density from the previous moment. To control the adjustment range, This is the gradient value of the residual with respect to the state at the previous time step.
[0200] S6: Input the preprocessed multivariate water quality, hydrological and meteorological driving data in step S2, as well as the algal density trend component obtained in step S3, into the enhanced LSTM time series prediction model constructed in step S5. Train and evaluate the model, and optimize and update the model parameters based on the evaluation results to finally obtain the algal biomass prediction model LSTMA that integrates algal growth dynamics constraints.
[0201] The training method is as follows: the differential equation of algal growth kinetics is embedded as a physical constraint into the time-series prediction and state update process of the model, and a kinetic consistency gating mechanism and a time-step prediction backtracking correction mechanism are introduced; at each time step, the model first predicts the state transition of algal biomass based on the input environmental factors, and evaluates the consistency between the predicted transition and the theoretical transition of algal growth kinetics through kinetic consistency gating; when the prediction result is consistent with the kinetic constraint, the model increases the confidence level of the current transition; when the prediction result deviates from the law of algal growth kinetics, unreasonable transitions are suppressed through gating weights.
[0202] Meanwhile, during training, when the dynamic residual between adjacent time steps exceeds a preset threshold, a time step prediction backtracking correction mechanism is implemented to correct the algal density state of the previous time step and re-complete the algal density prediction for the current time step based on the corrected state. This allows for dynamic correction of the algal density prediction value for the next moment while ensuring physical consistency.
[0203] The evaluation method is as follows: the Nash efficiency coefficient (NSE) is used as an evaluation index for model performance to quantify the degree of fit between the model's predicted values and the actual observed data. The value of NSE ranges from (-∞, 1]. The closer the NSE value is to 1, the higher the model's prediction accuracy and the better the fit. When the value is close to 0, it indicates that the model's simulation results are comparable to the average level of the observed values. If the NSE value is less than 0, it indicates that the model's prediction performance is low.
[0204] The calculation formula is as follows:
[0205]
[0206] in, The Nash efficiency coefficient. For the sample size, These are observed values. These are model predictions. It is the average of the observed values.
[0207] S7: Outputs daily simulated algal density and chlorophyll values using the optimized model.
[0208] Based on the above, the innovative points of this invention can be summarized as follows:
[0209] This invention proposes an enhanced LSTM time-series prediction model that integrates algal growth kinetic constraints. It couples the algal growth kinetic equation with the LSTM gating structure, introduces kinetic consistency gating, and adaptively adjusts the model state update process. While ensuring the fitting ability of the deep learning model, it significantly improves the physical consistency and rationality of the algal biomass prediction results.
[0210] This invention breaks through the traditional modeling approach that uses physical constraints only as regularization terms in the loss function. By constructing a gating adjustment based on dynamic residuals, it transforms the algal growth dynamics equations... By directly embedding the state transitions and time step updates of the model, the prediction process of algal biomass is constrained, rather than simply penalizing the loss after prediction.
[0211] This invention models the algal growth process based on state transitions and introduces a time-step prediction backtracking correction mechanism. When the prediction results of adjacent time steps deviate from the dynamic law, the state at the previous time step is backtracked and corrected, thereby effectively suppressing the error accumulation problem in time series prediction and significantly improving the stability and reliability of the model in medium- and long-term prediction tasks.
[0212] This invention improves the quality of input data by using STL to extract trend terms from raw algal density data in the data processing section, thereby eliminating seasonal fluctuations and random noise interference.
[0213] This invention learns a specific growth rate function driven by environmental factors using LSTM. It replaces traditional empirical formulas to achieve dynamic calculation of complex nonlinear relationships.
[0214] Example 2:
[0215] To verify the effectiveness and predictive performance of the LSTM prediction method with integrated algal growth kinetic constraints proposed in this invention in a real aquatic environment, the following experimental analysis was conducted in this embodiment.
[0216] This embodiment selects 40 water quality monitoring stations in different river basins in China as the research objects, spanning from January 2021 to December 2024. The selected stations differ in hydrological conditions, nutrient levels, and algal growth characteristics, which can be used to test the generalization ability and stability of the proposed model under complex environmental driving and kinetic constraints.
[0217] The input data includes hydrological and meteorological driving data and water quality monitoring time series data. The hydrological and meteorological driving data is constructed on a daily scale and mainly includes light intensity, daily precipitation, average temperature, maximum temperature, and minimum temperature, which are used to characterize the external environmental drivers in the algal growth process. The water quality monitoring data includes algal density, total nitrogen, total phosphorus, and water temperature observations, which are used to support the model's learning of algal growth status and its dynamic changes.
[0218] During model training, the algal density time series not only serves as the prediction target, but also participates in constructing physical constraint terms based on the algal growth kinetic equation, and is further used to drive the dynamic consistency gating and time step prediction backtracking correction mechanism to test the model's effectiveness in state transition prediction and error accumulation suppression.
[0219] During the data preprocessing stage, the Z-score method was used to standardize various input variables. To ensure sufficient data coverage for the model during training and testing, the standardized data was divided into a training period (January 1, 2021 – December 31, 2023) and a testing period (January 1, 2024 – December 31, 2024). Algal density data and environment-driven data used the same time division method to ensure temporal consistency during multi-time-step state updates and backtracking corrections.
[0220] The Nash efficiency coefficient (NSE) was used as the evaluation index for model performance evaluation. It was used to quantitatively measure the degree of fit between the model prediction results and the measured algal density, thereby verifying the improvement effect of the method of the present invention on the accuracy and stability of algal biomass prediction under real hydrological environment after introducing dynamic constraints, gating enhancement and time step correction mechanism.
[0221] In this embodiment, it was obtained Figure 2 and Figure 3 The test data, Figure 2 The time series of algae density at site31 is shown. Figure 3 The scatter plot shows the predicted and actual values of algae density and chlorophyll at site31.
[0222] from Figure 2 and Figure 3 It can be seen that the model proposed in this invention performs well in fitting the overall time-series periodicity, reflecting the long-term trend of water quality variables, and exhibits better simulation performance under extreme conditions, providing theoretical guidance for water environment protection and water pollution control.
Claims
1. A method for predicting algal biomass based on state evolution consistency constraints, characterized in that, Includes the following steps: S1: Acquire river water quality observation data and time-series hydro-meteorological driving data that have spatiotemporal heterogeneity; S2: Preprocess the data obtained in step S1, including handling missing values, removing outliers, and unifying time. S3: Perform STL time-series decomposition on the algae density term in the preprocessed data and retain the trend term to obtain the algae density trend component; S4: Based on the algal growth kinetics equation, physical constraints are established to obtain the specific growth rate dynamic equation; S5: Construct a dynamically embedded time-series prediction model, which represents the state of algal ecosystems with implicit ecological state vectors, and models the changes in ecological state between adjacent time steps through state transition prediction units. Introduce a dynamic consistency gating mechanism to constrain the state update process. S6: Input the preprocessed data in step S2 and the algal density trend component obtained in step S3 into the time-series prediction model of dynamic embedding in step S5 for training and evaluation, and combine the time step prediction correction mechanism to correct the ecological state during the prediction process to obtain an optimized model for algal biomass prediction. S7: Output the predicted value of algal biomass using the optimized model from step S6.
2. The algal biomass prediction method based on state evolution consistency constraints according to claim 1, characterized in that, The preprocessing in step S2 includes: The original data is standardized using the Z-score standardization method, which is based on the mean and standard deviation of the original data. This ensures that the processed data conforms to a standard normal distribution. The calculation formula is as follows: ; in, This represents the new data after standardization. Represents the original data. This represents the mean of the original data. This represents the standard deviation of the original data.
3. The algal biomass prediction method based on state evolution consistency constraints according to claim 1, characterized in that, In step S3, the algal density time series is set as follows: It is split into three components using STL timing decomposition: ; in, This represents time series data on algal density. Indicates trend components, Indicates seasonal quantity. This indicates the amount of residual ginseng.
4. The algal biomass prediction method based on state evolution consistency constraints according to claim 3, characterized in that, In step S3, algae density data is obtained through iterative iteration. The iterative process includes: A1: Detrending, the calculation formula is as follows: ; Among them, the initial value ; and These are the difference order and the number of iterations, respectively. A2: Seasonal subsequence smoothing: ... Divide into p subsequences according to period p. For each subsequence, a Loess local weighted regression is performed, calculated using the following formula: ; The locally weighted regression formula is as follows: ; in, The weighting function is calculated using the following formula: ; ; ; in, The distance is relative. To smooth the window width; A3: Seasonal Noise Reduction: right Low-pass filtering is performed to extract slowly changing low-frequency signals, remove high-frequency noise from seasonal components, and preserve periodic characteristics to obtain... To obtain the seasonal portion: ; A4: Deseasonalization: ; A5: Extract trend components: ; A6: Robust handling: Use the following function to reduce the impact of outliers: When satisfied hour, ; when hour, ; in, ; This refers to the amount of residual ginseng. A7: Output the denoised trend component as algal density data: 。 5. The algal biomass prediction method based on state evolution consistency constraints according to claim 4, characterized in that, Step S4 includes: The differential equation for algal growth kinetics is established as follows: ; in, Indicates algal density, represents the specific growth rate, and m represents the specific mortality rate; Transform the equation into a time step. Difference form: ; Define the specific growth rate For nonlinear functions of environmental factors: ; in, This represents the water temperature at time t. Represents the light intensity at time t. This represents the total nitrogen concentration at time t. This represents the total phosphorus concentration at time t; Set the loss function as follows: ; in, The weighting coefficients are used, and the main loss function uses RMSE as an indicator, which measures the deviation between the predicted value and the actual value. The calculation formula is as follows: ; Where RMSE represents the root mean square error, and n is the sample size. This represents the i-th true value. This represents the i-th predicted value; Based on the difference form of the differential equation of algal growth kinetics, set The equation is as follows: ; Final output: Specific growth rate .
6. The algal biomass prediction method based on state evolution consistency constraints according to claim 5, characterized in that, The time-series prediction model constructed in step S5 includes an enhanced gating unit. This enhanced gating unit combines LSTM gating with dynamic constraint mechanisms to achieve state transition prediction and time step prediction correction, wherein: Forgotten Gate: ; in, This represents the activation function of the forget gate. This represents the Sigmoid activation function. The weight matrix represents the forget gate. This indicates the hidden state of the previous time step. This represents the current time step input. This represents the bias vector of the forget gate. This represents the dynamic residual of the previous time step. This is the state prediction value from the previous time step. This is the adjustment coefficient; Memory Gate: ; ; in, This represents the activation function of the input gate. This represents the weight matrix of the input gate. This represents the bias vector of the input gate. Indicates the candidate cell state. It is the hyperbolic tangent function. This is the state prediction value from the previous time step. This is the adjustment coefficient; Cell status update: ; ; ; in, and These represent the cell states at the current time step and the previous time step, respectively. This indicates element-wise multiplication. For dynamic consistency gating weights, Indicates residual sensitivity. For gated bias. Indicates the activation function; Dynamic consistency gating: ; ; ; Output gate: ; ; in, This represents the activation function of the output gate. This represents the weight matrix of the output gate. This represents the bias vector of the output gate. This indicates the hidden state at the current time step.
7. The algal biomass prediction method based on state evolution consistency constraints according to claim 6, characterized in that, In the time-series prediction model of step S5, the time-step prediction correction includes: when At that time, backtrack and correct the previous state: ; ; in, This is the corrected algal density from the previous moment. To control the adjustment range, This is the gradient value of the residual with respect to the state at the previous time step.
8. The algal biomass prediction method based on state evolution consistency constraints according to claim 7, characterized in that, The training method of the LSTM model in step S6 is as follows: the differential equation of algal growth dynamics is embedded as a physical constraint into the training process of the LSTM model. At the same time, dynamic consistency gating and time step prediction correction are introduced. Under the premise of ensuring physical consistency, the algal density prediction value at the next moment is corrected, thereby completing the prediction of algal density.
9. The algal biomass prediction method based on state evolution consistency constraints according to claim 8, characterized in that, In step S6, the Nash efficiency coefficient (NSE) is used as an evaluation index for model performance, and the calculation formula is as follows: ; in, The Nash efficiency coefficient. For the sample size, These are observed values. These are model predictions. It is the average of the observed values.