A coastal river network pollutant evidence fusion early warning method based on adaptive sliding window LSTM
By combining an adaptive sliding window LSTM model with an attention mechanism and a fuzzy membership model for pollutant levels, real-time prediction and accurate assessment of pollutant concentrations in river networks were achieved, solving the problems of insufficient timeliness and accuracy in traditional methods and enabling timely early warning of pollutants in river networks.
Patent Information
- Application Number
- CN202510095307.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-21
- Publication Date
- 2026-02-24
- Estimated Expiration
- 2045-01-21
AI Technical Summary
Traditional methods for monitoring pollutants in river networks suffer from poor timeliness and low accuracy, making it difficult to predict and accurately assess pollutant concentrations in real time, which in turn makes it impossible to prevent environmental pollution in a timely manner.
An adaptive sliding window LSTM-based approach is adopted, combining an attention mechanism and a long short-term memory network model. By constructing feature sequences of pollutant indicators and an adaptive sliding window adjustment model, the sliding window size is dynamically adjusted to build a fuzzy membership model of pollutant levels. Data weighted fusion is then performed to achieve real-time early warning of pollutant levels.
It improves the accuracy and timeliness of pollutant concentration prediction, enabling timely alerts and preventing further damage to the river network ecosystem.
Smart Images

Figure CN120012015B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the field of river network water pollution treatment, and relates to a coastal river network pollutant evidence fusion early warning method based on an adaptive sliding window LSTM. BACKGROUND
[0002] With the continuous improvement of industrialization, the degradation difficulty and discharge of pollutants are also rapidly increasing. On the other hand, people's environmental awareness is still lacking, and news of being punished for illegally discharging sewage is not uncommon. If environmental pollution exceeds the environmental capacity, it will cause devastating damage to the local ecosystem, and with the circulation of matter and energy, it will pose a great threat to people's lives, which poses a great challenge to environmental law enforcement departments. Traditionally, relying on manual monitoring and experience-based judgment, there are problems such as poor timeliness and low accuracy.
[0003] Therefore, it is particularly crucial to predict the concentration of pollutants in the river network in real time and accurately assess the pollution level to prevent further damage to the river network ecosystem. With the continuous development of artificial intelligence technology, it is of great significance and value to use big data analysis and advanced artificial intelligence algorithms to predict the concentration of pollutants in the river network. SUMMARY
[0004] The present application proposes a coastal river network pollutant evidence fusion early warning method based on an adaptive sliding window LSTM to address the deficiencies of the prior art.
[0005] The present application comprises the following steps:
[0006] (1) In the coastal river network pollutant collaborative monitoring system, the COD concentration (C(t)), soil pH value (pH(t)) and chlorophyll a concentration (Chl(t)) of the monitoring point at time t are obtained online through the sensor, the collected data is preprocessed, and the characteristic sequence of the first (n=1, 2, 3) pollutant index is obtained.
[0007] (2) An attention mechanism long short-term memory network model (LSTM) for the pollutant index is constructed, the input is the characteristic sequence , the statistical characteristics of the first two characteristic values and the characteristic value at the current time t, the output is the characteristic prediction value at the future time t+1, and accordingly the characteristic prediction value of the pollutant index can be obtained.
[0008] (3) constructing an adaptive sliding window adjustment model (M) for each pollutant index (i) based on the historical pollutant index data (X) and the real-time pollutant index data (X) of the monitoring point (j) at the time point (t) and the time point (t+1), and outputting the sliding window size (W) of the time point (t+1) and the predicted value (Y) of the time point (t+1) of the pollutant index (i) based on the predicted value (Y) of the time point (t) of the pollutant index (i) and the real-time pollutant index data (X) of the monitoring point (j) at the time point (t+1), and using the sliding window size (W) of the time point (t+1) in step (2).
[0009] (4) iteratively optimizing the parameters of the model (M) and the model (M) based on the historical feature samples, so that the predicted results of the model (M) and the model (M) are close to the true values.
[0010] (5) constructing a pollution level fuzzy membership model (M) for the pollutant index (i), and inputting the iteratively optimized model (M) into the model (M) for the feature prediction value of the pollutant index (i) to obtain the confidence distribution of the pollution level.
[0011] (6) weighting and fusing the pollution level confidence distributions of the pollutant index COD concentration (i), the soil pH value (i) and the chlorophyll a concentration (i), and performing over-limit alarm according to the confidence distribution obtained after fusion. The evidence fusion early warning method for pollutants in a coastal river network based on an adaptive sliding window LSTM provided by the present application first acquires pollutant index data of a monitoring point in real time from a coastal river network pollutant collaborative monitoring system, and obtains a pollutant index feature sequence after preprocessing.
[0012] The model (M) is constructed for each pollutant index, and the sliding window size of the model (M) is dynamically adjusted by introducing (W). The model (M) is constructed to convert the obtained pollutant index prediction sequence into a confidence distribution of a pollution level. Finally, the pollution level confidence distributions of different pollutant indexes are weighted and fused, and timely alarm is realized for the over-limit situation of the pollutant index concentration according to the fused confidence distribution. The evidence fusion early warning method for pollutants in a coastal river network based on an adaptive sliding window LSTM provided by the present application has the following beneficial effects:
[0013]
[0014] 1. This invention integrates the attention mechanism with the LSTM model to enhance the LSTM model's ability to identify key information in the feature sequence. Through this integration, the LSTM model can more accurately extract important historical information from the feature sequence and use this information to improve the accuracy of feature sequence prediction.
[0015] 2. This invention uses the ER model to dynamically infer the input sliding window size that is suitable for the AM-LSTM model. This process helps the model to adapt more flexibly to different data features, thereby improving prediction accuracy.
[0016] 3. Based on historical feature sample data, this invention obtains an initial reference evidence matrix table for the input and output of the ER model to describe the nonlinear relationship between the input and output. The sequential linear programming method is used to optimize and update the relevant parameters in the model, thereby further improving the prediction accuracy of AM-LSTM and enabling accurate and efficient early warning of pollutants in coastal river networks. Attached Figure Description
[0017] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the accompanying drawings used in the embodiments will be briefly described below. Referring to the accompanying drawings will provide a clearer understanding of the features and advantages of the present invention. The drawings are illustrative and should not be construed as limiting the present invention in any way. For those skilled in the art, other drawings can be obtained based on these drawings without any creative effort. Wherein:
[0018] Figure 1 This is a flowchart of the method of the present invention;
[0019] Figure 2 It is a pollution level map after the pollutant indicators are integrated. Detailed Implementation
[0020] This application proposes a method for early warning of pollutants in coastal river networks based on adaptive sliding window LSTM, and its flowchart is shown below. Figure 1 As shown, it includes the following steps:
[0021] (1) In the coastal river network pollutant collaborative monitoring system, data is acquired online from sensors. COD concentration at monitoring points at all times ), soil pH value ) and chlorophyll a concentration ( The data for the three pollutant indicators were preprocessed to obtain the results. indivual( Characteristic sequences of pollutant indicators (=1,2,3) ;
[0022] (2) Constructing pollutant indicators of The model takes a sequence as its input. Statistical characteristics and current The feature values at each time point are used as the output for the future. Predicted feature value at time +1;
[0023] (3) Construct about of The model takes a sequence as its input. Statistical characteristics and The error between the predicted and actual values of the time-series features is output as follows: +1 moment Sliding window size ;
[0024] (4) Using historical feature samples Model and The model's parameters are iteratively optimized to achieve the desired result. The predicted results approximate the actual values;
[0025] (5) Constructing pollutant indicators of The model will Substitute the feature prediction values The model is used to obtain the reliability distribution of pollutant levels;
[0026] (6) , , The reliability distributions of pollutant levels are weighted and fused, and an over-limit alarm is triggered based on the reliability distribution obtained after fusion.
[0027] The specific steps of step (1) are as follows:
[0028] (1-1) Receive raw data from monitoring points, including COD concentration in the river water ( ), soil pH value ) and chlorophyll a concentration ( It identifies and marks outliers and missing values in the data. For outliers, it corrects or deletes them according to a preset threshold. For missing values, it uses interpolation methods to fill in the missing values.
[0029] (1-2) The processed data above are used as the characteristic data of pollutant indicators, and the characteristic sequences of pollutant indicators are obtained according to the sampling time. .
[0030] The specific steps of step (2) are as follows:
[0031] (2-1) For the construction of attention mechanisms AM and LSTM The model was configured with the following parameters: 1 hidden layer, 64 hidden nodes, 0.008 learning rate, and 300 iterations.
[0032] (2-2) Obtain the feature sequence according to step (1) It can be determined Model input vector The formula is as follows:
[0033] (1)
[0034] (2)
[0035] (3)
[0036] in, for The sliding window size adapts to changes in real time, and its value is a positive integer greater than or equal to 3. The standard deviation of the sample is 1. It is the length of the sequence.
[0037] (2-3) Using attention mechanisms The layer's output is weighted to extract the most relevant features. The output of the layer is ,in yes The hidden state vector at time step 1. It is the hidden state at each sampling time of the input sequence.
[0038] (2-4) Calculate the attention weight at each sampling time point using the following formula:
[0039] (4)
[0040] in, It is the hidden state of the target time step. It is a learnable weight matrix.
[0041] (2-5) Normalize the calculated attention weights and use the attention weights to... The features output by the layer are weighted and combined as follows:
[0042] (5)
[0043] (6)
[0044] in, yes The attention weight of the moment, softmax is a normalized exponential function.
[0045] (2-6) will For full connection layer processing, and predict the output +1 moment feature prediction value .
[0046] For ease of understanding, the steps (2-2) ~ (2-6) are illustrated as follows:
[0047] An input sample of the model is composed of the pollutant index feature sequence The vector of the moment, and the adaptive sliding window adjustment model In step (3) Inferred The adaptive sliding window size of the moment The feature vector is composed of. The sliding window size Can be 3, 4, 5, for the first input sample of the model, at least when =6 moment, set =5, by formula (1), (2) and (3) , , , Therefore, the first set of input vectors Model can be obtained According to this step, all input vectors can be obtained; the obtained input vectors are input into the LSTM model, and all hidden states Layer can be obtained , which is weighted and processed by using the attention mechanism, and The obtained attention weight is normalized to obtain , ; will Used for subsequent Full connection layer processing, get sequence prediction value.
[0048] The specific steps of step (3) are as follows:
[0049] (3-1) construct The model about The input vector , the calculation formula is as follows:
[0050] (7)
[0051] (8)
[0052] (9)
[0053] in, yes The model in The feature prediction value at time +1; and based on The input of the model can be obtained +1 time Sliding window size .
[0054] (3-2) Setting based on historical feature samples Model input vector The corresponding reference vector is .
[0055] At the same time, set Model output The reference value is , The value is a positive integer greater than or equal to 3, and has < ...< ...< , ≥3 represents the number of reference values output.
[0056] (3-3) Obtain the corresponding initial reference evidence matrix table based on historical feature sample data to describe Model input vector and output The nonlinear mapping relationship between them. The initial reference evidence matrix is shown in Table 1, where... Represents the input reference vector Corresponding evidence; This indicates that when the model input vector for At that time, the model output for The reliability satisfies And there are .
[0057] Table 1 Input Vectors Initial reference evidence matrix table
[0058]
[0059] (3-4) Obtain the input vector Its corresponding reference vectors ,…, ,..., The Euclidean distance between them is used, and its normalized result is used as the activation weight for reference evidence. The calculation is as follows:
[0060] (10)
[0061] (3-5) Obtain the activation weights of reference evidence Then, the rules of evidence reasoning were used to analyze the reference evidence matrix table. The reference evidence was fused, and the fusion result is as follows:
[0062] (11)
[0063] (12)
[0064] In equations (11) and (12): (Refer to the evidence) , This indicates that when the model input vector For the first When there are 1 reference vector, the model outputs for No. The confidence level of each reference vector.
[0065] (3-6) Estimate the value based on the fusion result obtained in step (3-5). +1 moment Model output ,
[0066] The calculation formula is as follows:
[0067] (13)
[0068] In equation (13): Output for the model Reference value, This represents the reliability of the model output.
[0069] To facilitate understanding, steps (3-2) to (3-6) are illustrated below:
[0070] Here, pollutant indicators are used. For example, to introduce Model Input , and The reference value set is as follows: , and At the same time, set Model output The reference value is An initial reference evidence matrix table can be obtained based on historical feature sample data. At time =6, by Model Input , and The model input vector can be obtained. Input vector Activate all evidence in the reference evidence matrix table. According to steps (3-4), the activation weights of each piece of evidence can be obtained from the model input at this time. Then, the activated evidence is fused according to formulas (11) and (12), and the fusion result is [0.2974, 0.3470, 0.3556]. The model output is then calculated using formula (13). .
[0071] The specific steps of step (4) are as follows:
[0072] (4-1) Utilize historical feature samples to build a parameter optimization model, using the actual observed values of pollutant index data and the data based on... of The mean absolute percentage error (MAPE) between the predicted values generated by the model is used as the objective function, as follows:
[0073] (14)
[0074] (4-2) Based on the parameter optimization model established in step (4-1), perform... The model parameters are optimized in real time, and the optimized parameters are uploaded to achieve dynamic updates of the reference evidence matrix table. The updated reference evidence matrix table is then used as... The initial parameters of the model at time +1.
[0075] (4-3) Repeat the above steps iteratively, and achieve online optimization and updating of model parameters to realize... The model uses adaptive sliding window adjustment to improve its predictive ability.
[0076] For ease of understanding, the above pollutant indicators will be used. ,exist =6 illustrates the specific optimization process of the optimization model, and the optimization model will... The elements in the confidence matrix table of the inference model are used as the objects of parameter optimization, and it has the characteristics of online optimization and real-time parameter updates.
[0077] for =6 time The inference model input was activated. The confidence matrix table in the model is updated with all the evidence in the table, at this time, the optimization model optimizes the confidence in all activated evidence, after optimization, upload the confidence matrix table correspondingly, as shown in Table 2, and take it as the next time confidence matrix table of the model.
[0078] Table 2 Input vector Reference evidence matrix table of
[0079]
[0080] The specific steps of the step (5) are as follows:
[0081] (5-1) Through the iteration of step 4-3 Get the characteristic prediction sequence of the pollutant index .
[0082] (5-2) Construct a model about the pollutant index River water pollution level set ={I,II,III}, "I" represents that the river water pollution level is low, "II" represents that the river water pollution level is medium, and "III" represents that the river water pollution level is high. Establish the membership function of the pollutant index
[0083] to the level "I", denoted as , and set the upper limit of the fuzzy threshold value as , the lower limit of the fuzzy threshold value as , and < , the formula is as follows:
[0084] (15)
[0085] Establish the membership function of the pollutant index to the level "II", denoted as , and set the upper limit of the fuzzy threshold value as , the middle value of the fuzzy threshold value as , the lower limit of the fuzzy threshold value as , and , the formula is as follows:
[0086] (16)
[0087] Similarly, establish the membership function of the pollutant index to the level "III", denoted as and set the upper limit of the blur threshold as , the lower limit of the blur threshold as , and , the formula is as follows:
[0088] (17)
[0089] (5-3) the characteristic prediction value of is brought into the model , and the confidence distribution about the pollutant level is obtained as .
[0090] In order to facilitate understanding, steps (5-1) to (5-3) are illustrated as follows:
[0091] Taking the pollutant index as an example, the prediction value at time =7 is obtained as =7.4373, and the prediction value is brought into the pollutant level fuzzy membership model constructed by us, wherein =8, =8.8, =9.6, and the confidence distribution of the pollutant level at time =7 can be obtained as .
[0092] The specific steps of the step (6) are as follows:
[0093] The obtained confidence distributions of the three pollutant levels are determined by weighted fusion to determine the pollution level, and the weights are respectively , , , and satisfy , the confidence distributions of the three pollutant indexes are weighted and fused according to the weights, and the formula is as follows:
[0094] (18)
[0095] According to the fused confidence distribution , the final pollutant level is determined, and an alarm is issued if the pollutant level is “III”.
[0096] The embodiments of the method of the application are described in detail below with reference to the accompanying drawings:
[0097] 1. In the coastal river network pollutant collaborative monitoring system, the COD concentration of the monitoring point at time t is obtained online from the sensor, the soil pH value) and chlorophyll a concentration ) three pollutant index data, the collected data are preprocessed to obtain the characteristic sequence of the first =1, 2, 3) pollutant index =48.
[0098] 2. Here, taking the pollutant index as an example, first, the parameters of the model are set, the number of hidden layers is set to 1, the number of hidden nodes is set to 64, the learning rate is set to 0.008, and the number of iterations is set to 300; and according to the characteristic sequence , the input vector of the model is obtained, in this embodiment, the size of the sliding window can be 3, 4, 5. Set =5, , the first input sample of the model, when =6, the , , , the first group of input vectors of the model is obtained =[7.3536, 0.0005, -0.2183], and the predicted value at =7 is obtained =7.4374.
[0099] 3. Through step (3), the input vector of the model at =6 is obtained , , =[0.0005, -0.2183, 0.0838]. Through the initial evidence reasoning table, the input vector activates all the evidences in the reference evidence matrix table, according to step (3-4), the activation weight of each evidence activated by the model input at this time can be obtained, and the activated evidences are fused according to formulas (11) and (12), and the fusion result is [0.2974, 0.3470, 0.3556], and the output of the model is calculated by formula (13) =4.
[0100] 4. The parameter optimization model is constructed, the elements in the belief matrix table in the reasoning model and other parameters of the model are taken as optimization objects, which has the characteristics of online optimization and real-time updating of parameters, and for the above =6 time Inference model input, activated All evidence in the belief matrix table in the model, at this time, the optimization model optimizes the confidence in all activated evidence, after optimization, upload the corresponding update of the elements in the belief matrix table in the model, get the new belief matrix table, as shown in Table 3, and take it as the belief matrix table of the next time Model; Model;
[0101] Table 3 Input vector Reference evidence matrix table
[0102]
[0103] For the pollution index , According to the above steps, the characteristic prediction sequence can be obtained.
[0104] 5. According to the above steps, the characteristic prediction sequence of the pollution index Can be obtained, and through the model constructed by step (5), the belief distribution about the pollution level is obtained, as shown in Table 4:
[0105] Table 4 Belief distribution table of pollution level
[0106]
[0107] 6. The belief distribution of the pollution level obtained above is determined by weighted fusion to determine the pollution level, and the weights are respectively , , , and satisfy , the belief distributions of the three pollution indexes are weighted fused according to their weights, and the formula is as follows:
[0108] (19)
[0109] According to the fused belief distribution , the final pollution level is determined, if the pollution level is "III", an alarm is sent, and the alarm is sent at =36 time, and the result is as shown in Figure 2 .
Claims
1. A pollutant evidence fusion and early warning method for coastal river networks based on adaptive sliding window LSTM, characterized in that, Includes the following steps: Step 1: Obtain coastal river network data using sensors The data for each pollutant indicator were preprocessed to obtain the first... pollutant indicators Feature sequences ; Step 2: Construct pollutant indicators Attention mechanism Long Short-Term Memory Network Model The input is a feature sequence. , Statistical properties of each eigenvalue and current The feature values at each time point are used as the output for the future. +1 time-time characteristic prediction value, from which pollutant indicators are obtained. The predicted value of the feature; Step 3, Build about Adaptive sliding window adjustment model ,based on The predicted value of the feature at time moment is output as follows: +1 moment Sliding window size And used in step 2; Step 4: Utilize historical feature samples Model and The model's parameters are iteratively optimized to achieve the desired result. The predicted results approximate the actual values; Step 5: Construct pollutant indicators Fuzzy membership model of pollution level The iterated version for The feature prediction values are fed into the model. To obtain the reliability distribution of pollutant levels; Step 6: Weight and fuse the reliability distributions of pollutant levels for each pollutant indicator, and issue an over-limit alarm based on the reliability distribution obtained after fusion.
2. The method for early warning of pollutants in coastal river networks based on adaptive sliding window LSTM according to claim 1, characterized in that, The specific implementation process of step 1 is as follows: Step 1-1: Receive raw data from monitoring points, including COD concentration in the river water. Soil pH value and chlorophyll a concentration It identifies and marks outliers and missing values in the data. For outliers, it corrects or deletes them according to a preset threshold. For missing values, it uses interpolation methods to fill in the missing values. Steps 1-2: Use the processed data above as characteristic data for pollutant indicators, and obtain the characteristic sequences of pollutant indicators based on the sampling time. .
3. The method for early warning of pollutants in coastal river networks based on adaptive sliding window LSTM according to claim 2, characterized in that, The specific implementation process of step 4 is as follows: Step 4-1: Build a parameter optimization model using historical feature samples, combining the actual observed values of pollutant index data with those based on... of The mean absolute percentage error (MAPE) between the predicted values generated by the model is used as the objective function. Step 4-2: Optimize the model based on the parameters. The model parameters are optimized in real time, and the optimized parameters are uploaded to achieve dynamic updates of the reference evidence, which is then used as the reference evidence. Initial parameters of the model at time +1; Step 4-3: Repeat steps 4-1 and 4-2 iteratively, and achieve online optimization and updating of model parameters to achieve... The model uses adaptive sliding window adjustment to improve its predictive ability.
4. The method for early warning of pollutants in coastal river networks based on adaptive sliding window LSTM according to claim 3, characterized in that, The specific implementation process of step 5 is as follows: Step 5-1, after iteration through step 4-3 Obtain the characteristic prediction sequences of pollutant indicators; Step 5-2: Construct pollutant indicators of Model, River Water Pollution Level Set ={I,II,III}, where I, II, and III represent the river water pollution levels as low, medium, and high, respectively; Step 5-3, The feature prediction values are substituted into the model. To obtain the reliability distribution of pollutant levels.
5. The method for early warning of pollutants in coastal river networks based on adaptive sliding window LSTM according to claim 4, characterized in that, The specific implementation process of step 6 is as follows: The confidence distributions of the three pollutant levels are assigned weights as follows: , , ,and The reliability distributions of the three pollutant indicators are weighted and fused according to their respective weights. Based on the fused reliability distribution... Determine the final pollutant level, and issue an alarm if the pollutant level is III.
Citation Information
Patent Citations
Water quality index prediction method based on hybrid long-short-term memory neural network
CN110852515A
Grain processing process pollutant data expansion and risk prediction method based on LSTM-DFGAN
CN116777196A