A water quality biological relationship mapping and sensitivity analysis method
Through the LSTM model and sensitivity analysis technology, the mapping sensitivity relationship between water quality and biological populations is revealed, which solves the difficult problem of analyzing the relationship between water quality and biological populations in existing technologies, realizes accurate judgment of water quality changes and scientific basis for protection measures, and provides a powerful tool for environmental protection and water resources management.
Patent Information
- Application Number
- CN202411811166.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-10
- Publication Date
- 2025-09-09
- Estimated Expiration
- 2044-12-10
AI Technical Summary
Existing technologies have problems with data acquisition and high model complexity in sensitivity analysis of the relationship between water quality and biological populations, making it difficult to accurately judge the impact of changes in water quality parameters on biological populations and unable to provide a scientific basis for formulating targeted water quality protection measures.
The LSTM model is combined with sensitivity analysis technology. By acquiring and preprocessing water quality and biological data, feature extraction and data alignment are performed, an LSTM model is established and trained and verified, and sensitivity analysis is used to reveal the mapping sensitivity relationship between biological populations and water quality.
It has achieved an in-depth understanding of the impact of water quality changes on biological populations, provided a scientific basis for the formulation of targeted protection measures, and can accurately judge water quality, improve the efficiency of water quality monitoring and assessment, and support environmental protection and water resources management.
Smart Images

Figure CN119740121B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of water resource management, and in particular relates to a water quality biological relationship mapping and sensitivity analysis method. Background Art
[0002] In existing water quality monitoring and assessment systems, understanding the relationship between water quality and biological populations primarily relies on traditional statistical analysis and ecological models. While these methods can, to a certain extent, reveal the impact of water quality changes on biological populations, they often have numerous shortcomings.
[0003] For example, existing technologies have limitations in sensitivity analysis of the relationship between water quality and biological populations. In the field of water quality biology, due to the difficulty in obtaining data and the high complexity of models, sensitivity analysis is difficult to conduct in depth. This makes it difficult for us to accurately determine which changes in water quality parameters have the most significant impact on biological populations, and thus cannot provide a scientific basis for formulating targeted water quality protection measures.
[0004] To address this issue, the inventors proposed a water quality-biological relationship mapping and sensitivity analysis method to solve the above problems. Summary of the Invention
[0005] The purpose of the present invention is to provide a water quality biological relationship mapping and sensitivity analysis method to solve the problems raised in the above background technology.
[0006] To achieve the above object, the present invention provides the following technical solutions:
[0007] A water quality biological relationship mapping and sensitivity analysis method, comprising:
[0008] Obtain data on water quality parameters and aquatic species populations, perform data preprocessing, and obtain water quality data and aquatic species data respectively;
[0009] Performing feature extraction on the water quality data to obtain statistical measurement data of each water quality data within a unit time interval, and aligning the statistical measurement data with the aquatic species data using a timestamp to obtain feature data;
[0010] Establishing an LSTM model, training and verifying the LSTM model using the feature data, and deploying the LSTM model after verification to obtain a deployed LSTM model;
[0011] A comprehensive analysis was conducted using sensitivity analysis techniques combined with the deployed LSTM model to obtain the mapping sensitivity relationship between biological populations and water quality.
[0012] Based on the mapping sensitivity relationship and combined with the aquatic species data, the corresponding water quality is obtained.
[0013] Preferably, the statistical measurement value data is at least one of chemical oxygen demand COD, dissolved oxygen DO, pH value, ammonia nitrogen NH3-N and total phosphorus.
[0014] Preferably, the LSTM model is used to predict the impact of water quality changes on the number of organisms, and its expression is:
[0015] Forget Gate:
[0016] f t =σ(W f ·[h t-1 ,x t ]+b f )
[0017] where f t : The output of the forget gate, indicating the part of the previous unit state that needs to be forgotten;
[0018] W f : weight matrix of the forget gate;
[0019] b f : Bias vector of forget gate;
[0020] [h t-1 ,x t ]: represents the previous hidden state h t-1 and the current cell state x t splicing;
[0021] σ is the Sigmoid activation function;
[0022] Input Gate:
[0023] i t =σ(W i ·[h t-1 ,x t ]+b i )
[0024]
[0025] Where it: the output of the input gate, which represents the part of the current input that needs to be added to the cell state;
[0026] σ is the Sigmoid activation function;
[0027] W i : weight matrix of input gate;
[0028] [h t-1 ,x t ]: represents the previous hidden state h t-1 and the current cell state x t splicing;
[0029] b i : bias vector of input gate;
[0030] The candidate unit state calculated by the tanh activation function;
[0031] W c : The weight matrix used to calculate the candidate unit state;
[0032] b c : bias vector used to calculate the candidate unit state;
[0033] Output Gate:
[0034] o t =σ(W o ·[h t-1 ,x t ]+b o )
[0035] Among them O t : The output of the output gate indicates that the current unit state needs to be output to the hidden state h t Part of;
[0036] W o : The weight matrix of the output gate;
[0037] b o : bias vector of the output gate;
[0038] σ is the Si gmo id activation function;
[0039] [h t-1 ,x t ]: represents the previous hidden state h t-1 and the current cell state x t splicing;
[0040] Unit status update:
[0041]
[0042] Ct: The new cell state, which is composed of the old cell state part determined by the forget gate and the new candidate cell state part determined by the input gate;
[0043] f t : Output of the forget gate;
[0044] C t-1 : old unit status part;
[0045] New Candidate Unit Status section;
[0046] Hide status update:
[0047] ht=ot*tanh(Ct)
[0048] ht: The new hidden state, which is obtained by passing the unit state part determined by the output gate through the tanh activation function;
[0049] O t : Output of the output gate;
[0050] Ct: New cell state.
[0051] Preferably, the sensitivity analysis is used to determine the degree of influence of different water quality parameters on the number of aquatic organisms, including univariate sensitivity analysis and multivariate sensitivity analysis.
[0052] Preferably, the expression of the univariate sensitivity analysis is:
[0053]
[0054] Among them S COD is the sensitivity coefficient of biomass to COD, ΔN is the change in biomass, and ΔCOD is the change in COD;
[0055] The larger the SCOD value, the more sensitive the biomass is to COD.
[0056] Preferably, the expression of the multivariate sensitivity analysis is:
[0057]
[0058] Among them S i represents the sensitivity index of the total effect of the i-th water quality parameter on the number of organisms Y, X i It is a water quality parameter.
[0059] Preferably, the data preprocessing includes data cleaning, removing outliers, filling missing values and standardization.
[0060] Preferably, the feature data is divided into a training set, a validation set and a test set;
[0061] Using the training set to train the LSTM model to obtain a trained LSTM model;
[0062] The LSTM model is cross-validated using the validation set and the test set, and the LSTM model is deployed after validation.
[0063] Preferably, the performance indicators of the cross-validation are mean square error (MSE) and root mean square error (RMSE).
[0064] Compared with the prior art, the present invention has the following beneficial effects:
[0065] (1) This paper establishes an LSTM model and uses sensitivity analysis technology to analyze the LSTM model, revealing the mapping sensitivity relationship between biological populations and water quality. This helps to gain a deeper understanding of the impact mechanism of water quality changes on biological populations and provides a scientific basis for formulating targeted water quality protection measures.
[0066] (2) The present invention is based on mapping sensitivity relationships and aquatic species data. The model can accurately judge the water quality, which not only provides a new method for water quality monitoring and assessment, but also provides a powerful tool for environmental protection and water resources management. It is of great significance for maintaining ecological balance and protecting human health. BRIEF DESCRIPTION OF THE DRAWINGS
[0067] Figure 1 This is a flow chart of the composition of a water quality biological relationship mapping and sensitivity analysis method of the present invention. DETAILED DESCRIPTION
[0068] The following will provide a clear and complete description of the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making any creative efforts shall fall within the scope of protection of the present invention.
[0069] Example 1:
[0070] See also Figure 1 As shown, a water quality biological relationship mapping and sensitivity analysis method includes:
[0071] Obtain data on water quality parameters and aquatic species populations, perform data preprocessing, and obtain water quality data and aquatic species data respectively;
[0072] Performing feature extraction on the water quality data to obtain statistical measurement data of each water quality data within a unit time interval, and aligning the statistical measurement data with the aquatic species data using a timestamp to obtain feature data;
[0073] Establishing an LSTM model, training and verifying the LSTM model using the feature data, and deploying the LSTM model after verification to obtain a deployed LSTM model;
[0074] A comprehensive analysis was conducted using sensitivity analysis techniques combined with the deployed LSTM model to obtain the mapping sensitivity relationship between biological populations and water quality.
[0075] Based on the mapping sensitivity relationship and combined with the aquatic species data, the corresponding water quality is obtained.
[0076] As can be seen from the above, by establishing an LSTM model and using sensitivity analysis techniques to analyze the LSTM model, we have revealed the mapping sensitivity relationship between biological populations and water quality. This helps us to gain a deeper understanding of the impact of water quality changes on biological populations and also provides a scientific basis for formulating targeted water quality protection measures.
[0077] Based on mapping sensitivity relationships and aquatic species data, the model can accurately judge water quality, which not only provides a new method for water quality monitoring and assessment, but also provides a powerful tool for environmental protection and water resources management, and is of great significance for maintaining ecological balance and protecting human health.
[0078] Example 2:
[0079] The data preprocessing includes data cleaning, removing outliers, filling missing values and standardization.
[0080] Specifically, the statistical measurement data include chemical oxygen demand COD, dissolved oxygen DO, pH value, ammonia nitrogen NH3-N and total phosphorus.
[0081] Specifically, the LSTM model is used to predict the impact of water quality changes on the number of organisms, and its expression is:
[0082] Forget Gate:
[0083] f t =σ(W f ·[h t-1 ,x t ]+b f )
[0084] where f t : The output of the forget gate, indicating the part of the previous unit state that needs to be forgotten;
[0085] W f : weight matrix of the forget gate;
[0086] b f : Bias vector of forget gate;
[0087] [h t-1 ,x t ]: represents the previous hidden state h t-1 and the current cell state x t splicing;
[0088] σ is the Sigmoid activation function;
[0089] Input Gate:
[0090] i t =σ(W i ·[h t-1 ,x t ]+b i )
[0091]
[0092] Where it: the output of the input gate, which represents the part of the current input that needs to be added to the cell state;
[0093] σ is the Si gmo id activation function;
[0094] W i : weight matrix of input gate;
[0095] [h t-1 ,x t ]: represents the previous hidden state h t-1 and the current cell state x t splicing;
[0096] b i : bias vector of input gate;
[0097] The candidate unit state calculated by the tanh activation function;
[0098] W c : The weight matrix used to calculate the candidate unit state;
[0099] b c : bias vector used to calculate the candidate unit state;
[0100] Output Gate:
[0101] o t =σ(W o ·[h t-1 ,x t ]+b o )
[0102] Among them O t : The output of the output gate indicates that the current unit state needs to be output to the hidden state h t Part of;
[0103] W o : The weight matrix of the output gate;
[0104] b o : bias vector of the output gate;
[0105] σ is the Si gmo id activation function;
[0106] [h t-1 ,x t ]: represents the previous hidden state h t-1 and the current cell state x t splicing;
[0107] Unit status update:
[0108]
[0109] Ct: The new cell state, which is composed of the old cell state part determined by the forget gate and the new candidate cell state part determined by the input gate;
[0110] f t : Output of the forget gate;
[0111] C t-1 : old unit status part;
[0112] New Candidate Unit Status section;
[0113] Hide status update:
[0114] ht=ot*tanh(Ct)
[0115] ht: The new hidden state, which is obtained by passing the unit state part determined by the output gate through the tanh activation function;
[0116] O t : Output of the output gate;
[0117] Ct: new cell state;
[0118] LSTM networks use memory cells to effectively capture long-term dependencies in time series. For the water quality-organism relationship mapping model, LSTM achieves accurate predictions of aquatic organism populations by memorizing and updating water quality time series data.
[0119] Specifically, the sensitivity analysis is used to determine the degree of influence of different water quality parameters on the number of aquatic organisms, including univariate sensitivity analysis and multivariate sensitivity analysis;
[0120] The expression of the univariate sensitivity analysis is:
[0121]
[0122] Among them S COD is the sensitivity coefficient of biomass to COD, ΔN is the change in biomass, and ΔCOD is the change in COD.
[0123] The larger the SCOD value, the more sensitive the biomass is to COD. Sensitivity analysis can help us determine the degree of response of biomass to different water quality parameters.
[0124] The expression of the multivariate sensitivity analysis is:
[0125]
[0126] Among them S i represents the sensitivity index of the total effect of the i-th water quality parameter on the number of organisms (model output) Y, X i It is a water quality parameter.
[0127] This formula measures the degree to which water quality parameters affect organism abundance and helps identify the combined effects of multiple water quality factors on specific organisms;
[0128] Specifically, the feature data is divided into a training set, a validation set, and a test set;
[0129] Using the training set to train the LSTM model to obtain a trained LSTM model;
[0130] The LSTM model is cross-validated using the validation set and the test set, and the LSTM model is deployed after validation.
[0131] The performance indicators of the cross-validation are mean square error (MSE) and root mean square error (RMSE), which are used to evaluate the explanatory power of the model.
[0132] From the above, we can see that by constructing an LSMT model to identify the impact of different water quality parameters on aquatic organisms, we can use changes in the number of organisms or community structure to reversely infer the water quality conditions. This method can provide a more ecological water quality monitoring solution based on traditional chemical monitoring methods, so that even in the absence of chemical monitoring equipment, water quality can be estimated through ecological data.
[0133] Sensitivity analysis identifies "indicator organisms" most sensitive to water quality changes, helping managers identify species that respond most significantly to environmental changes. Monitoring these species allows for more efficient prediction and assessment of changes in the water environment, effectively streamlining the monitoring process and improving efficiency.
[0134] This model can help identify the impacts of pollution sources on water bodies, such as when a specific pollutant exceeds a permitted level, leading to an abnormal increase or decrease in the number of aquatic organisms. This information provides a scientific basis for developing ecological restoration plans, supporting targeted pollution source control, minimizing ecological damage, and achieving effective ecosystem management.
[0135] The model's mapping of changes in water quality and biomass can provide a certain degree of early warning. By continuously monitoring biomass changes, water quality fluctuations can be predicted early and preventative measures can be taken, reducing the probability of environmental emergencies and providing a proactive response technology for aquatic environmental protection.
[0136] Example 3:
[0137] This design has specific applications in environmental protection, water resource management, and ecological restoration. In the ecosystem of a large freshwater lake, the model can be used to monitor and assess water quality and its impact on aquatic populations. Lake management departments can use the model to collect real-time lake water quality parameters such as dissolved oxygen, pH, total phosphorus, and nutrient concentrations, as well as aquatic species population data such as the types and numbers of shrimp, plankton, and benthic organisms. Through data preprocessing and feature extraction, the model can generate a series of characteristic data on the relationship between water quality and aquatic species.
[0138] Using a trained LSTM model, management departments can predict future water quality trends and the potential impacts of these changes on aquatic populations. Through sensitivity analysis, the model can also reveal which water quality parameters are most sensitive to specific species, helping management departments identify key water quality indicators and potential ecological risk points.
[0139] In practical applications, this model could serve as a crucial component of a lake water quality monitoring and early warning system. If the model predicts potential water quality deterioration or threats to biological populations, management can immediately take measures, such as adjusting water flow, reducing pollution emissions, and implementing ecological restoration projects, to protect the lake's ecological balance and water quality.
[0140] Further, data collection and preprocessing
[0141] Data Collection: Collect historical data on water quality and aquatic life populations. This data covers multiple water quality parameters, including chemical oxygen demand (COD), dissolved oxygen (DO), pH, ammonia nitrogen (NH3-N), and total phosphorus. For aquatic life, this includes data on the number of different species, such as algae and shrimp.
[0142] Data cleaning: remove outliers from the data and fill in missing values.
[0143] Data standardization: Water quality parameters and biomass data were standardized to provide consistent model inputs.
[0144] Data (partial):
[0145]
[0146] Feature extraction
[0147] Calculate characteristics of water quality parameters and aquatic organism populations, such as mean, variance, extreme values, and rate of change, to help the model capture trends in the data.
[0148] Average COD value: 49.8 mg / L
[0149] DO average value: 4.7 mg / L
[0150] pH value variance: 0.03
[0151] Average total phosphorus: 0.22 mg / L
[0152] NH3-N maximum value: 0.05mg / L
[0153] Algae population change rate: (450-310) / 310=45.2%
[0154] Model building
[0155] The long short-term memory network (LSTM) model was selected to capture the dynamic changes of water quality time series.
[0156] Dataset construction: Water quality data is used as model input and aquatic organism quantity data is used as output.
[0157] Train the model: Use 70% of the data as a training set, 15% as a validation set, and 15% as a test set.
[0158] Sensitivity analysis
[0159] Through sensitivity analysis after model training, the sensitive relationship between water quality indicators and the number of aquatic organisms is identified.
[0160] Univariate sensitivity analysis:
[0161] Change the COD value (for example, from 40 mg / L to 60 mg / L) and observe the changes in the number of algae.
[0162] Calculate the sensitivity coefficient of algae to COD:
[0163]
[0164] Multivariate sensitivity analysis:
[0165] At the same time, increase the COD and NH3-N values and observe the changes in the number of algae and shrimp.
[0166] Model validation and performance evaluation
[0167] The mean square error (MSE) and root mean square error (RMSE) were used to evaluate the prediction accuracy of the model.
[0168] Mean Squared Error (MSE):
[0169]
[0170] The model predicts that the number of algae is 450 / m 3 , the actual quantity is 500 pieces / m 3 ,but
[0171]
[0172] MSE = (500-450)21 = 2500
[0173] Root Mean Square Error (RMSE):
[0174]
[0175] From the above, we can see that based on the results of sensitivity analysis, it is possible to identify "indicator organisms" that are highly sensitive to specific water quality indicators, such as the sensitivity of algae to COD and NH3-N, and the sensitivity of shrimp to DO. This model can be used to infer water quality indicators through changes in the number of biological species in actual water quality monitoring.
[0176] By constructing a water quality-organism quantity mapping model, it can be used for water quality monitoring and ecosystem management, helping decision makers identify key water quality parameters in aquatic ecosystems.
[0177] While embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions, and variations may be made to these embodiments without departing from the principles and spirit of the invention, and that the scope of the invention is defined by the appended claims and their equivalents.
Claims
1. A water quality biological relationship mapping and sensitivity analysis method, characterized in that: include: Obtain data on water quality parameters and aquatic species populations, perform data preprocessing, and obtain water quality data and aquatic species data respectively; Performing feature extraction on the water quality data to obtain statistical measurement data of each water quality data within a unit time interval, and aligning the statistical measurement data with the aquatic species data using a timestamp to obtain feature data; Establishing an LSTM model, training and verifying the LSTM model using the feature data, and deploying the LSTM model after verification to obtain a deployed LSTM model; A comprehensive analysis was conducted using sensitivity analysis techniques combined with the deployed LSTM model to obtain the mapping sensitivity relationship between biological populations and water quality. Based on the mapped sensitivity relationship and in combination with the aquatic species data, a corresponding water quality is obtained; The sensitivity analysis is used to determine the impact of different water quality parameters on the number of aquatic organisms, including univariate sensitivity analysis and multivariate sensitivity analysis; The expression of the univariate sensitivity analysis is: Among them S COD is the sensitivity coefficient of biomass to COD, ΔN is the change in biomass, and ΔCOD is the change in COD; S COD The larger the value, the higher the sensitivity of the biomass to COD; The expression of the multivariate sensitivity analysis is: Among them S i represents the sensitivity index of the total effect of the i-th water quality parameter on the number of organisms Y, X i is the water quality parameter; Dataset construction: Water quality data is used as model input and aquatic organism quantity data is used as output.
2. The method for water quality biological relationship mapping and sensitivity analysis according to claim 1, characterized in that: The LSTM model is used to predict the impact of water quality changes on the number of organisms, and its expression is: Forget Gate: f t =σ(W f ·[h t-1 ,x t ]+b f ) where f t : The output of the forget gate, indicating the part of the previous unit state that needs to be forgotten; W f : weight matrix of the forget gate; b f : Bias vector of forget gate; [h t-1 ,x t ]: represents the previous hidden state h t-1 and the current cell state x t splicing; σ is the Sigmoid activation function; Input Gate: i t =σ(W i ·[h t-1 ,x t ]+b i ) Where it: the output of the input gate, which represents the part of the current input that needs to be added to the cell state; σ is the Sigmoid activation function; W i : weight matrix of input gate; [h t-1 ,x t ]: represents the previous hidden state h t-1 and the current cell state x t splicing; b i : bias vector of input gate; The candidate unit state calculated by the tanh activation function; W c : The weight matrix used to calculate the candidate unit state; b c : bias vector used to calculate the candidate unit state; Output gate: the t =σ(W o ·[h t-1 ,x t ]+b o ) Among them O t : The output of the output gate indicates that the current unit state needs to be output to the hidden state h t Part of; W o : The weight matrix of the output gate; b o : bias vector of the output gate; σ is the Sigmoid activation function; [h t-1 ,x t ]: represents the previous hidden state h t-1 and the current cell state x t splicing; Unit status update: Ct: The new cell state, which is composed of the old cell state part determined by the forget gate and the new candidate cell state part determined by the input gate; f t : Output of the forget gate; C t-1 : old unit status part; New Candidate Unit Status section; Hide status update: h t =o t *tanh(C t ) ht: The new hidden state, which is obtained by passing the unit state part determined by the output gate through the tanh activation function; O t : Output of the output gate; Ct: New cell state.
3. The water quality biological relationship mapping and sensitivity analysis method according to claim 1, characterized in that: The data preprocessing includes data cleaning, removing outliers, filling missing values and standardization.
4. The method for water quality biological relationship mapping and sensitivity analysis according to claim 1, characterized in that: The statistical measurement value data is at least one of chemical oxygen demand COD, dissolved oxygen DO, pH value, ammonia nitrogen NH3-N and total phosphorus.
5. The method for water quality biological relationship mapping and sensitivity analysis according to claim 1, characterized in that: The feature data is divided into a training set, a validation set and a test set; Using the training set to train the LSTM model to obtain a trained LSTM model; The LSTM model is cross-validated using the validation set and the test set, and the LSTM model is deployed after validation.
6. The method for water quality biological relationship mapping and sensitivity analysis according to claim 5, characterized in that: The performance indicators of the cross-validation are mean square error (MSE) and root mean square error (RMSE).
Citation Information
Patent Citations
Drainage basin water quality short-term prediction method based on improved LSTM
CN114386686A
Water drainage pipe network water quality prediction method based on machine learning
CN118396149A