A water quality parameter prediction method and system based on multi-sensor data fusion
By eliminating single-point anomalies through dynamic convolution kernels and anomaly detection gates, and generating global feature vectors by combining spatial relationship weights and frequency dynamic features, the problem of insufficient accuracy in multi-sensor data fusion in traditional water quality monitoring is solved, enabling accurate prediction of water quality parameters and generation of heat maps.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- 湖南省生态环境事务中心
- Filing Date
- 2025-07-04
- Publication Date
- 2026-05-15
AI Technical Summary
In traditional water quality monitoring methods, multi-sensor data fusion suffers from problems such as difficulty in distinguishing anomalies in single-point data and insufficient utilization of the spatial synergy of multi-source data, resulting in insufficient accuracy in water quality prediction.
A multi-sensor data fusion-based approach is adopted, which uses dynamic convolution kernels and anomaly detection gates to remove single-point anomalies. It combines spatial relationship weights and frequency dynamic features to generate a global feature vector, and uses a long short-term memory network to generate a water quality parameter heat map.
It improves the accuracy of water quality prediction, effectively identifies instantaneous equipment failures and water quality deterioration trends, and is suitable for scenarios with parameter coupling and complexity in multi-source sensor data in large-scale water monitoring.
Smart Images

Figure CN120805047B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of water quality testing technology, and in particular to a method and system for predicting water quality parameters based on multi-sensor data fusion. Background Technology
[0002] Water quality monitoring is a crucial aspect of environmental protection and water resource management. Traditional methods primarily rely on single sensors at fixed locations. However, due to the dynamic and spatially heterogeneous nature of aquatic environments, especially in large lakes or river systems, pollutant dispersion is influenced by multiple factors such as wind direction and water flow, making single-point data often insufficient to comprehensively reflect the true water quality. To address this issue, existing technologies expand monitoring coverage by deploying multiple identical sensors at different locations within the water body. These sensors typically employ various deployment methods, including buoy-based, shore-based, or underwater robot-mounted systems, enabling real-time monitoring of key indicators such as dissolved oxygen and turbidity.
[0003] However, the current application of multi-sensor data fusion still faces the following challenges:
[0004] First, due to differences in sensor hardware, environmental interference, or communication failures, it is difficult to quickly distinguish between abnormal data (such as sudden changes or drift) from a single node and a real pollution event or equipment malfunction. For example, when a sensor detects a sudden drop in dissolved oxygen, it may be a real signal of an algal bloom or an abnormal reading caused by sensor membrane contamination. Traditional methods that rely on manual calibration or fixed thresholds are prone to misjudgment. Second, the spatial correlation of multi-source data is not fully utilized. Existing data fusion methods (such as simple averaging or weighted calculation) cannot effectively utilize the characteristics of water flow changes, making it difficult for prediction models to accurately capture pollution diffusion trends or predict future water quality changes. Summary of the Invention
[0005] In view of this, the present invention aims to provide a water quality parameter prediction scheme based on multi-sensor data fusion, so as to solve the problem that traditional methods are difficult to deal with due to the insufficient accuracy of water quality prediction caused by single-point data anomalies and poor spatial coordination of multi-source data.
[0006] To achieve the above objectives, this invention discloses a method for predicting water quality parameters based on multi-sensor data fusion, comprising the following steps:
[0007] S1: Collect raw dissolved oxygen and turbidity data and preprocess them to obtain dissolved oxygen and turbidity data within multiple time windows;
[0008] S2: Based on the dissolved oxygen and turbidity data in each time window, calculate the water quality feature vector, dynamic convolution kernel and anomaly detection probability of each sensor in that time window in turn. Based on the anomaly detection probability, traverse and remove the data of all sensors in all time windows to obtain the complete sensor sequence after single-point anomaly removal.
[0009] The calculation process of the anomaly discrimination probability includes: based on a dynamic convolution kernel, using one-dimensional convolution to extract local features from the water quality feature vector of the sensor, and generating an anomaly discrimination gate through a sigmoid function; based on the anomaly discrimination gate and the Hadamard product operation, weighted fusing the water quality feature vector activated by the ReLU function and the water quality feature vector processed by the multilayer perceptron to obtain a fused feature vector; and processing the fused feature vector by a multilayer perceptron, generating the anomaly discrimination probability of the corresponding sensor within the time window through a sigmoid function.
[0010] S3: Based on the geographic coordinates of the sensors corresponding to each data point in the complete sensor sequence after single-point anomaly removal and the direction of water flow, calculate the spatial relationship weights between the sensors, decompose, optimize and fuse the water quality feature vector to obtain frequency dynamic features, perform weighted fusion of the frequency dynamic features of neighboring sensors based on the spatial relationship weights, process the fusion results through a spatiotemporal gating mechanism, and generate a global feature vector.
[0011] S4: Calculate the water quality parameter tensor based on the global feature vector and the long short-term memory network, and generate a water quality parameter heat map based on the geographic coordinates of the sensor.
[0012] Furthermore, in step S2, the calculation process of the water quality feature vector includes:
[0013] Dissolved oxygen and turbidity data within each time window are concatenated, and the concatenation result is linearly transformed. A sigmoid function is used to generate a water quality parameter interaction gate. The water quality parameter interaction gate is then multiplied with the dissolved oxygen data using a Hadamard product to obtain gated dissolved oxygen data. The result of subtracting the water quality parameter interaction gate from 1 is then multiplied with the turbidity data using a Hadamard product to obtain gated turbidity data. The gated dissolved oxygen data and the gated turbidity data are concatenated, and the concatenation result is processed by a bidirectional gated loop unit to generate water quality feature vectors for each sensor within that time window.
[0014] Furthermore, step S1 includes:
[0015] S11: Deploy the same type of water quality sensors at different locations in the water area, perform time synchronization calibration on all sensors, collect dissolved oxygen data and turbidity data in the water, and record the timestamp, geographic coordinates of the sensor and water flow direction corresponding to each data point to obtain the raw dissolved oxygen data and turbidity data. The geographic coordinates of the sensor include latitude, longitude and elevation values.
[0016] S12: Based on the linear interpolation algorithm, fill in the missing values in the original dissolved oxygen and turbidity data, and use the three-standard-deviation principle to identify and remove data points that exceed the normal fluctuation range to obtain the sorted dissolved oxygen and turbidity data;
[0017] S13: Divide the processed dissolved oxygen and turbidity data into timestamps at fixed intervals to obtain dissolved oxygen and turbidity data within multiple time windows.
[0018] Furthermore, step S2 includes:
[0019] S21: Based on the dissolved oxygen and turbidity data within each time window, the water quality feature vector of each sensor within that time window is calculated using an interactive gating mechanism. The calculation method is as follows:
[0020] ;
[0021] ;
[0022] ;
[0023] ;
[0024] in, This is a water quality parameter interaction gate. For the sigmoid function, This is the water quality parameter interaction weight matrix. This represents the dissolved oxygen data from the i-th sensor within this time window, where i is the first index of the sensor. For splicing operations, Let i be the turbidity data of the i-th sensor within this time window. This is the water quality parameter interaction bias vector. This refers to the gated dissolved oxygen data of the i-th sensor within this time window. For Hadama accumulation, This represents the gated turbidity data of the i-th sensor within this time window. This represents the water quality feature vector of the i-th sensor within the given time window. It is a bidirectional gated loop unit;
[0025] S22: Generate a location-related weight matrix based on the geographic coordinates of the sensors, and combine it with the water quality feature vectors corresponding to the sensors to calculate the dynamic convolution kernels of each sensor within the time window. The calculation method is as follows:
[0026] ;
[0027] in, Let be the position association weight matrix between the i-th sensor and the j-th sensor, where j is the second index of the sensor. To take the exponent of the natural constant, The spatial attenuation coefficient, , Let latitude and longitude be the geographic coordinates of the i-th sensor. Let latitude and longitude be the geographic coordinates of the j-th sensor. The square of the Euclidean distance. Let be the dynamic convolution kernel for the i-th sensor within this time window. Let i be the set of neighboring sensors of the i-th sensor. It is a multilayer perceptron. This is the water quality feature vector of the j-th sensor within the time window;
[0028] S23: Based on the water quality feature vectors of the sensors and the dynamic convolution kernel, the anomaly detection probability of each sensor within this time window is calculated. The calculation method is as follows:
[0029] ;
[0030] ;
[0031] ;
[0032] in, This is the anomaly detection gate for the i-th sensor within the time window. For one-dimensional convolution, Let be the fused feature vector of the i-th sensor within this time window. For ReLU function, Let be the anomaly detection probability of the i-th sensor within this time window;
[0033] S24: Based on the anomaly detection probability, select whether to remove the data points of the corresponding sensor within this time window. If so, then the data points of that sensor are removed. If the data points of the sensor are not found, the data points of the sensor are retained. After traversing all sensors, the sensor sequence after removing single-point anomalies within the time window is obtained. After traversing all time windows, the complete sensor sequence after removing single-point anomalies is obtained.
[0034] It should be further explained that, firstly, this invention dynamically assigns weights to dissolved oxygen and turbidity data through an interactive gating mechanism, generates gating values using a sigmoid function to adaptively adjust the contribution of the two types of parameters, and then captures temporal correlation features through a bidirectional gating loop unit, overcoming the feature interference problem caused by simple splicing of multiple parameters in traditional methods; secondly, based on the spatial attenuation characteristics of sensor geographic coordinates, this invention constructs a location-related weight matrix, enabling the water quality feature vectors of neighboring sensors to obtain differentiated weights during multilayer perceptron fusion, and the generated dynamic convolution kernel can accurately characterize the spatial correlation of local water areas, and finally achieves feature fusion through an anomaly detection gate;
[0035] Compared to conventional threshold detection methods, this invention offers three advantages through its step: First, the interactive gating mechanism addresses the nonlinear coupling characteristics of dissolved oxygen and turbidity in water bodies (such as the synchronous anomaly caused by algal growth), enabling mutual correction between parameters. Second, the dynamic convolution kernel adaptively adjusts the magnitude of neighborhood influence through a position-related weight matrix, effectively addressing the monitoring blind spot problem caused by uneven sensor deployment in lakes. Third, the fusion mechanism based on anomaly discrimination gates can simultaneously capture instantaneous equipment failures (manifested as feature mutations) and actual water quality deterioration (manifested as continuous anomalies), avoiding false rejections due to occasional sensor failures. This is particularly suitable for scenarios involving parameter coupling and complexity in multi-source sensor data during large-scale water monitoring.
[0036] Furthermore, step S3 includes:
[0037] S31: Based on the geographic coordinates of the sensors corresponding to each data point in the complete sensor sequence after single-point anomaly removal and the direction of water flow, calculate the spatial relationship weights between the sensors. The calculation method is as follows:
[0038] ;
[0039] ;
[0040] ;
[0041] in, Let be the Euclidean distance between the i-th sensor and the j-th sensor. For the L2 norm operation, Let the similarity of the water flow direction between the i-th sensor and the j-th sensor be denoted as . For cosine similarity, Let i be the water flow direction vector of the i-th sensor. Let be the water flow direction vector of the j-th sensor. The spatial relationship weights between the i-th and j-th sensors are given. This is the spatial relation weight matrix. The difference between the elevation values of the i-th sensor and the j-th sensor in geographic coordinates.
[0042] S32: Decompose the water quality feature vector of the sensor into low-frequency features and high-frequency features, then perform enhancement and smoothing processes respectively, and finally fuse them to obtain the frequency dynamic features;
[0043] S33: Generate a global feature vector based on spatial relationship weights and frequency dynamic features. The calculation method is as follows:
[0044] ;
[0045] in, For spatial weighted fusion characteristics, The frequency dynamic characteristics of the i-th and j-th sensors are respectively. For the spacetime gating vector, For the spatiotemporal gating weight matrix, For global feature vectors, This is global average pooling.
[0046] Furthermore, step S32 includes:
[0047] S321: Perform frequency decomposition on the water quality feature vector of the sensor to obtain high-frequency and low-frequency features. The calculation method is as follows:
[0048] ;
[0049] ;
[0050] in, Let i be the low-frequency characteristic of the i-th sensor. For one-dimensional average pooling, The high-frequency characteristics of the i-th sensor;
[0051] S322: Gated enhancement of low-frequency features is performed to obtain enhanced low-frequency features. The calculation method is as follows:
[0052] ;
[0053] ;
[0054] in, For low-frequency gating weights, The low-frequency characteristics are enhanced by the i-th sensor. For dilated convolution;
[0055] S323: Perform dynamic Bessel kernel convolution on the high-frequency features to obtain smoothed high-frequency features. The calculation method is as follows:
[0056] ;
[0057] ;
[0058] ;
[0059] in, For dynamic kernel bandwidth coefficient, The kernel is a Bessel function convolution. It is a zero-order Bessel function. The smoothed high-frequency characteristics of the i-th sensor;
[0060] S324: Feature fusion is performed on the enhanced low-frequency features and the smoothed high-frequency features to obtain the frequency dynamic features. The calculation method is as follows:
[0061] ;
[0062] in, For the frequency dynamic characteristics of the i-th sensor, For layer normalization.
[0063] It should be further explained that, firstly, this invention combines the Euclidean distance exponential decay value of the sensor's geographic coordinates, the similarity of water flow direction, and the elevation difference to generate spatial relationship weights. It then uses the sigmoid function to comprehensively evaluate spatial proximity, hydrological connectivity, and terrain elevation, overcoming the limitations of traditional methods that rely solely on distance. Secondly, this invention performs frequency decomposition on the sensor's water quality feature vector and optimizes it by frequency bands. It extracts low-frequency features representing long-term trends through one-dimensional average pooling, and uses the water quality feature vector minus the low-frequency features to separate high-frequency features representing instantaneous fluctuations. Furthermore, it innovatively employs dilated convolution combined with a gating enhancement mechanism to strengthen low-frequency features. The invention extracts watershed-wide gradual changes in frequency characteristics (such as the cumulative effect of pollutant migration) and smooths random interferences in high-frequency characteristics (such as equipment measurement noise) through dynamic Bessel kernel convolution. The two are then fused through layer normalization to form a frequency dynamic feature that considers both trend and noise resistance. Finally, the invention performs weighted fusion of the frequency dynamic features of neighboring sensors based on spatial relationship weights, and then performs nonlinear filtering of the spatially weighted fused features through spatiotemporal gating vectors to dynamically adjust the contribution weight of different regions to the overall feature, effectively addressing the spatial heterogeneity problem caused by uneven sensor deployment density and differences in monitoring target areas in large-scale water monitoring.
[0064] Furthermore, step S4 includes:
[0065] S41: Based on the global feature vector, a water quality parameter tensor is generated using a long short-term memory network. The calculation method is as follows:
[0066] ;
[0067] ;
[0068] ;
[0069] ;
[0070] in, Let be the hidden state vector at time step t, where t is the time step index. The total number of time steps. For Long Short-Term Memory (LSTM) networks, Let be the dissolved oxygen prediction vector at time step t. This is the weight matrix for dissolved oxygen prediction. This is the dissolved oxygen prediction bias vector. Let t be the turbidity prediction vector at the t-th time step. This is the turbidity prediction weight matrix. This is the turbidity prediction bias vector. For water quality parameter tensors, From the first time step to the second The result of concatenating the dissolved oxygen prediction vector and turbidity prediction vector at each time step;
[0071] S42: Generate a water quality parameter heatmap based on the water quality parameter tensor and the geographic coordinates of the sensor. The calculation method is as follows:
[0072] ;
[0073] ;
[0074] in, Let be the spatial distribution matrix at time step t. It is an inverse distance weighted interpolation algorithm. This is the geographic coordinate matrix of the sensor. This is a thermogram of water quality parameters at time step t. It is a pseudo-color mapping function. To normalize the maximum and minimum values, From the first time step to the second The result of splicing the spatial distribution matrices of each time step.
[0075] Based on the above, this invention also discloses an early warning method based on spatiotemporal parameter tensors, the calculation method of which is as follows:
[0076] ;
[0077] in, For the warning result at time step t, For indicator functions, The dissolved oxygen warning threshold, For logical "OR" operation, This is the turbidity warning threshold.
[0078] This invention also discloses a water quality parameter prediction system based on multi-sensor data fusion, comprising:
[0079] Data acquisition and preprocessing module: Acquires raw dissolved oxygen and turbidity data and performs preprocessing to obtain dissolved oxygen and turbidity data within multiple time windows;
[0080] Sensor anomaly data removal module: Based on the dissolved oxygen and turbidity data in each time window, the water quality feature vector, dynamic convolution kernel and anomaly discrimination probability of each sensor in that time window are calculated in sequence. Based on the anomaly discrimination probability, the data of all sensors in all time windows are traversed and removed to obtain the complete sensor sequence after single-point anomaly removal.
[0081] Global Feature Calculation Module: Based on the geographic coordinates of the sensors corresponding to each data point in the complete sensor sequence after single-point anomaly removal and the direction of water flow, calculate the spatial relationship weights between the sensors, decompose, optimize and fuse the water quality feature vector to obtain frequency dynamic features, perform weighted fusion of the frequency dynamic features of neighboring sensors based on spatial relationship weights, process the fusion results through a spatiotemporal gating mechanism, and generate a global feature vector.
[0082] Water quality parameter heat map generation module: Based on the global feature vector, it generates water quality parameter tensors by combining them with a long short-term memory network, and generates water quality parameter heat maps by combining them with the geographic coordinates of the sensors.
[0083] Compared with the prior art, the beneficial effects of the present invention are as follows:
[0084] (1) This invention effectively solves the shortcomings of traditional water quality prediction methods in terms of abnormal data processing and spatial coordination by using a two-stage processing mechanism of sensor single-point anomaly removal and global feature vector construction. First, this invention achieves single-point anomaly detection and removal through interactive gating mechanism and dynamic convolution kernel to ensure the reliability of input data. Then, it constructs global feature vector based on spatial relationship weights and frequency dynamic features, which fully considers the spatial distribution characteristics of sensor network and the spatiotemporal evolution law of water quality parameters. This progressive processing flow not only ensures data quality but also enhances the spatial collaborative representation ability of multi-source data and improves the accuracy of water quality prediction.
[0085] (2) This invention dynamically adjusts the contribution of dissolved oxygen and turbidity parameters through an interactive gating mechanism, which solves the feature interference problem caused by simple parameter splicing in traditional methods. This invention constructs a dynamic convolution kernel through a location-related weight matrix, which realizes accurate characterization of spatial correlation of local water areas. This invention creatively uses an anomaly discrimination gate for feature fusion, which can capture instantaneous equipment failures and identify water quality deterioration trends. It is particularly suitable for scenarios where multi-source sensor data have parameter coupling and complexity in large-scale water monitoring scenarios.
[0086] (3) This invention constructs spatial relationship weights by integrating multi-dimensional geographical parameters such as Euclidean distance, water flow direction and elevation difference, overcoming the limitation of traditional methods that only consider the influence of distance parameters. At the same time, this invention performs frequency decomposition and frequency band optimization on the water quality feature vectors of the sensors, and enhances low-frequency features through dilated convolution and smooths high-frequency features through dynamic Bessel kernel, respectively, to achieve targeted processing of water quality parameters in different frequency bands. Finally, this invention designs a spatiotemporal gating mechanism to dynamically adjust the regional contribution weights, effectively solving the feature fusion problem caused by the spatial heterogeneity of multiple sensors. The resulting water quality parameter heat map can more accurately reflect the migration and diffusion patterns of pollutants in complex aquatic environments. Attached Figure Description
[0087] Figure 1 This is a flowchart illustrating a water quality parameter prediction method based on multi-sensor data fusion provided in Embodiment 1 of the present invention.
[0088] Figure 2 The figure shows a comparison of the changes before and after applying the method of Embodiment 1 of the present invention to the pollution treatment of a lake. Figure (a) is a heat map of water quality parameters before pollution treatment, and Figure (b) is a heat map of water quality parameters after pollution treatment. Detailed Implementation
[0089] The present invention will be further described below with reference to the accompanying drawings, but this is not intended to limit the present invention in any way. Any modifications or substitutions made based on the teachings of the present invention shall fall within the protection scope of the present invention.
[0090] Example 1:
[0091] like Figure 1 As shown, a method for predicting water quality parameters based on multi-sensor data fusion includes the following steps:
[0092] S1: Collect raw dissolved oxygen and turbidity data and preprocess them to obtain dissolved oxygen and turbidity data within multiple time windows; specifically:
[0093] S11: Deploy the same type of water quality sensors at different locations in the water area, perform time synchronization calibration on all sensors, collect dissolved oxygen data and turbidity data in the water, and record the timestamp, geographic coordinates of the sensor and water flow direction corresponding to each data point to obtain the raw dissolved oxygen data and turbidity data. The geographic coordinates of the sensor include latitude, longitude and elevation values.
[0094] S12: Based on the linear interpolation algorithm, fill in the missing values in the original dissolved oxygen and turbidity data, and use the three-standard-deviation principle to identify and remove data points that exceed the normal fluctuation range to obtain the sorted dissolved oxygen and turbidity data;
[0095] S13: Divide the processed dissolved oxygen and turbidity data into multiple time windows by dividing them into 10 timestamps.
[0096] S2: Based on the dissolved oxygen and turbidity data within each time window, calculate the water quality feature vector, dynamic convolution kernel, and anomaly detection probability for each sensor within that time window. Then, based on the anomaly detection probability, iterate through and remove data from all sensors across all time windows to obtain the complete sensor sequence after single-point anomaly removal. Specifically:
[0097] S21: Based on the dissolved oxygen and turbidity data within each time window, the water quality feature vector of each sensor within that time window is calculated using an interactive gating mechanism. The calculation method is as follows:
[0098] ;
[0099] ;
[0100] ;
[0101] ;
[0102] in, This is a water quality parameter interaction gate. For the sigmoid function, This is the water quality parameter interaction weight matrix. This represents the dissolved oxygen data from the i-th sensor within this time window, where i is the first index of the sensor. For splicing operations, Let i be the turbidity data of the i-th sensor within this time window. This is the water quality parameter interaction bias vector. This refers to the gated dissolved oxygen data of the i-th sensor within this time window. For Hadama accumulation, This represents the gated turbidity data of the i-th sensor within this time window. This represents the water quality feature vector of the i-th sensor within the given time window. It is a bidirectional gated loop unit;
[0103] S22: Generate a location-related weight matrix based on the geographic coordinates of the sensors, and combine it with the water quality feature vectors corresponding to the sensors to calculate the dynamic convolution kernels of each sensor within the time window. The calculation method is as follows:
[0104] ;
[0105] in, Let be the position association weight matrix between the i-th sensor and the j-th sensor, where j is the second index of the sensor. To take the exponent of the natural constant, The spatial attenuation coefficient, , Let latitude and longitude be the geographic coordinates of the i-th sensor. Let latitude and longitude be the geographic coordinates of the j-th sensor. The square of the Euclidean distance. Let be the dynamic convolution kernel for the i-th sensor within this time window. Let i be the set of neighboring sensors of the i-th sensor. It is a multilayer perceptron. This is the water quality feature vector of the j-th sensor within the time window;
[0106] S23: Based on the water quality feature vectors of the sensors and the dynamic convolution kernel, the anomaly detection probability of each sensor within this time window is calculated. The calculation method is as follows:
[0107] ;
[0108] ;
[0109] ;
[0110] in, This is the anomaly detection gate for the i-th sensor within the time window. For one-dimensional convolution, Let be the fused feature vector of the i-th sensor within this time window. For ReLU function, Let be the anomaly detection probability of the i-th sensor within this time window;
[0111] S24: Based on the anomaly detection probability, select whether to remove the data points of the corresponding sensor within this time window. If so, then the data points of that sensor are removed. If the data points of the sensor are not found, the data points of the sensor are retained. After traversing all sensors, the sensor sequence after removing single-point anomalies within the time window is obtained. After traversing all time windows, the complete sensor sequence after removing single-point anomalies is obtained.
[0112] In this embodiment, Set it to 0.7.
[0113] S3: Based on the geographic coordinates of the sensors corresponding to each data point in the complete sensor sequence after single-point anomaly removal and the direction of water flow, calculate the spatial relationship weights between the sensors, calculate the frequency dynamic features based on the water quality feature vector, and generate a global feature vector based on the spatial relationship weights and frequency dynamic features; specifically:
[0114] S31: Based on the geographic coordinates of the sensors corresponding to each data point in the complete sensor sequence after single-point anomaly removal and the direction of water flow, calculate the spatial relationship weights between the sensors. The calculation method is as follows:
[0115] ;
[0116] ;
[0117] ;
[0118] in, Let be the Euclidean distance between the i-th sensor and the j-th sensor. For the L2 norm operation, Let the similarity of the water flow direction between the i-th sensor and the j-th sensor be denoted as . For cosine similarity, Let i be the water flow direction vector of the i-th sensor. Let be the water flow direction vector of the j-th sensor. The spatial relationship weights between the i-th and j-th sensors are given. This is the spatial relation weight matrix. The difference between the elevation values of the i-th sensor and the j-th sensor in geographic coordinates.
[0119] S32: The water quality feature vectors of the sensor are decomposed into frequencies and optimized individually, then fused to obtain dynamic frequency features; specifically:
[0120] S321: Perform frequency decomposition on the water quality feature vector of the sensor to obtain high-frequency and low-frequency features. The calculation method is as follows:
[0121] ;
[0122] ;
[0123] in, Let i be the low-frequency characteristic of the i-th sensor. For one-dimensional average pooling, The high-frequency characteristics of the i-th sensor;
[0124] S322: Gated enhancement of low-frequency features is performed to obtain enhanced low-frequency features. The calculation method is as follows:
[0125] ;
[0126] ;
[0127] in, For low-frequency gating weights, The low-frequency characteristics are enhanced by the i-th sensor. For dilated convolution;
[0128] S323: Perform dynamic Bessel kernel convolution on the high-frequency features to obtain smoothed high-frequency features. The calculation method is as follows:
[0129] ;
[0130] ;
[0131] ;
[0132] in, For dynamic kernel bandwidth coefficient, The kernel is a Bessel function convolution. It is a zero-order Bessel function. The smoothed high-frequency characteristics of the i-th sensor;
[0133] S324: Feature fusion is performed on the enhanced low-frequency features and the smoothed high-frequency features to obtain the frequency dynamic features. The calculation method is as follows:
[0134] ;
[0135] in, For the frequency dynamic characteristics of the i-th sensor, For layer normalization;
[0136] S33: Generate a global feature vector based on spatial relationship weights and frequency dynamic features. The calculation method is as follows:
[0137] ;
[0138] in, For spatial weighted fusion characteristics, The frequency dynamic characteristics of the i-th and j-th sensors are respectively. For the spacetime gating vector, For the spatiotemporal gating weight matrix, For global feature vectors, This is global average pooling.
[0139] S4: Based on the global feature vector, a water quality parameter tensor is generated using a long short-term memory network, and a water quality parameter heatmap is generated using the geographic coordinates of the sensor; specifically:
[0140] S41: Based on the global feature vector, a water quality parameter tensor is generated using a long short-term memory network. The calculation method is as follows:
[0141] ;
[0142] ;
[0143] ;
[0144] ;
[0145] in, Let be the hidden state vector at time step t, where t is the time step index. The total number of time steps. For Long Short-Term Memory (LSTM) networks, Let be the dissolved oxygen prediction vector at time step t. This is the weight matrix for dissolved oxygen prediction. This is the dissolved oxygen prediction bias vector. Let t be the turbidity prediction vector at the t-th time step. This is the turbidity prediction weight matrix. This is the turbidity prediction bias vector. For water quality parameter tensors, From the first time step to the second The result of concatenating the dissolved oxygen prediction vector and turbidity prediction vector at each time step;
[0146] S42: Generate a water quality parameter heatmap based on the water quality parameter tensor and the geographic coordinates of the sensor. The calculation method is as follows:
[0147] ;
[0148] ;
[0149] in, Let be the spatial distribution matrix at time step t. It is an inverse distance weighted interpolation algorithm. This is the geographic coordinate matrix of the sensor. This is a thermogram of water quality parameters at time step t. It is a pseudo-color mapping function. To normalize the maximum and minimum values, From the first time step to the second The result of splicing the spatial distribution matrices of each time step.
[0150] The method in this embodiment was applied to the follow-up observation of the pollution control of a certain lake, and the changes before and after were compared as follows: Figure 2 As shown in the figure, Figure (a) shows that there was a clear red high-pollution core area (pentagonal position) in the lower left corner of the lake at the beginning. The overall pollution diffusion showed a gradient decreasing distribution trend from southwest to northeast. Figure (b) shows that after the lake was treated, the original high-pollution area was greatly reduced, with only a small red area remaining. The entire area was dominated by blue low-pollution areas (probability below 0.2). The position of the yellow pentagram mark remained fixed (the pollution core position did not move and the outline shape was basically maintained). This further shows that the treatment process was precisely targeted at the pollution source and did not disturb the overall hydrodynamic environment of the lake. The treatment effect can be clearly seen by comparing the two figures.
[0151] Example 2:
[0152] This invention also discloses a water quality parameter prediction system based on multi-sensor data fusion, comprising the following modules:
[0153] Data acquisition and preprocessing module: Acquires raw dissolved oxygen and turbidity data and performs preprocessing to obtain dissolved oxygen and turbidity data within multiple time windows;
[0154] Sensor anomaly data removal module: Based on the dissolved oxygen and turbidity data in each time window, the water quality feature vector, dynamic convolution kernel and anomaly discrimination probability of each sensor in that time window are calculated in sequence. Based on the anomaly discrimination probability, the data of all sensors in all time windows are traversed and removed to obtain the complete sensor sequence after single-point anomaly removal.
[0155] Global Feature Calculation Module: Based on the geographic coordinates of the sensors corresponding to each data point in the complete sensor sequence after single-point anomaly removal and the direction of water flow, calculate the spatial relationship weights between the sensors, decompose, optimize and fuse the water quality feature vector to obtain frequency dynamic features, perform weighted fusion of the frequency dynamic features of neighboring sensors based on spatial relationship weights, process the fusion results through a spatiotemporal gating mechanism, and generate a global feature vector.
[0156] Water quality parameter heat map generation module: Based on the global feature vector, it generates water quality parameter tensors by combining them with a long short-term memory network, and generates water quality parameter heat maps by combining them with the geographic coordinates of the sensors.
[0157] The water quality parameter prediction system provided in this embodiment is used to implement the water quality parameter prediction method in Embodiment 1 above. The functions implemented by each functional module of the water quality parameter prediction system correspond one-to-one with the steps of the water quality parameter prediction method; therefore, they will not be described in detail here.
[0158] It should be noted that the sequence numbers of the above embodiments of the present invention are merely for descriptive purposes and do not represent the superiority or inferiority of the embodiments. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, apparatus, article, or method that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, apparatus, article, or method. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, apparatus, article, or method that includes that element.
[0159] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as described above, and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of the present invention.
[0160] The above are merely preferred embodiments of the present invention and do not limit the scope of the patent. Any equivalent structural or procedural transformations made based on the description and drawings of the present invention, or direct or indirect applications in other related technical fields, are similarly included within the scope of patent protection of the present invention.
Claims
1. A method for predicting water quality parameters based on multi-sensor data fusion, characterized in that, Includes the following steps: S1: Collect raw dissolved oxygen and turbidity data and preprocess them to obtain dissolved oxygen and turbidity data within multiple time windows; S2: Based on the dissolved oxygen and turbidity data in each time window, calculate the water quality feature vector, dynamic convolution kernel and anomaly detection probability of each sensor in that time window in turn. Based on the anomaly detection probability, traverse and remove the data of all sensors in all time windows to obtain the complete sensor sequence after single-point anomaly removal. S3: Based on the geographic coordinates of the sensors corresponding to each data point in the complete sensor sequence after single-point anomaly removal and the direction of water flow, calculate the spatial relationship weights between the sensors, decompose, optimize and fuse the water quality feature vector to obtain frequency dynamic features, perform weighted fusion of the frequency dynamic features of neighboring sensors based on the spatial relationship weights, process the fusion results through a spatiotemporal gating mechanism, and generate a global feature vector. S4: Calculate the water quality parameter tensor based on the global feature vector and the long short-term memory network, and generate a water quality parameter heat map based on the geographic coordinates of the sensor. Step S2 includes: S21: Based on the dissolved oxygen and turbidity data within each time window, the water quality feature vector of each sensor within that time window is calculated using an interactive gating mechanism. The calculation method is as follows: ; ; ; ; in, This is a water quality parameter interaction gate. For the sigmoid function, This is the water quality parameter interaction weight matrix. This represents the dissolved oxygen data from the i-th sensor within this time window, where i is the first index of the sensor. For splicing operations, Let i be the turbidity data of the i-th sensor within this time window. For water quality parameter interaction bias vectors, This refers to the gated dissolved oxygen data of the i-th sensor within this time window. For Hadama accumulation, This represents the gated turbidity data of the i-th sensor within this time window. This represents the water quality feature vector of the i-th sensor within the given time window. It is a bidirectional gated loop unit; S22: Generate a location-related weight matrix based on the geographic coordinates of the sensors, and combine it with the water quality feature vectors corresponding to the sensors to calculate the dynamic convolution kernels of each sensor within the time window. The calculation method is as follows: ; in, Let be the position association weight matrix between the i-th sensor and the j-th sensor, where j is the second index of the sensor. To take the exponent of the natural constant, The spatial attenuation coefficient, , Let latitude and longitude be the geographic coordinates of the i-th sensor. Let latitude and longitude be the geographic coordinates of the j-th sensor. The square of the Euclidean distance. Let be the dynamic convolution kernel for the i-th sensor within this time window. Let i be the set of neighboring sensors of the i-th sensor. It is a multilayer perceptron. This is the water quality feature vector of the j-th sensor within the time window; S23: Based on the water quality feature vectors of the sensors and the dynamic convolution kernel, the anomaly detection probability of each sensor within this time window is calculated. The calculation method is as follows: ; ; ; in, This is the anomaly detection gate for the i-th sensor within the time window. For one-dimensional convolution, Let be the fused feature vector of the i-th sensor within this time window. For ReLU function, Let be the anomaly detection probability of the i-th sensor within this time window; S24: Based on the anomaly detection probability, select whether to remove the data points of the corresponding sensor within this time window. If so, then the data points of that sensor are removed. If the data points of the sensor are not found, the data points of the sensor are retained. After traversing all sensors, the sensor sequence after removing single-point anomalies within the time window is obtained. After traversing all time windows, the complete sensor sequence after removing single-point anomalies is obtained.
2. The water quality parameter prediction method based on multi-sensor data fusion according to claim 1, characterized in that, Step S1 includes: S11: Deploy the same type of water quality sensors at different locations in the water area, perform time synchronization calibration on all sensors, collect dissolved oxygen data and turbidity data in the water, and record the timestamp, geographic coordinates of the sensor and water flow direction corresponding to each data point to obtain the raw dissolved oxygen data and turbidity data. The geographic coordinates of the sensor include latitude, longitude and elevation values. S12: Based on the linear interpolation algorithm, fill in the missing values in the original dissolved oxygen and turbidity data, and use the three-standard-deviation principle to identify and remove data points that exceed the normal fluctuation range to obtain the sorted dissolved oxygen and turbidity data; S13: Divide the processed dissolved oxygen and turbidity data into timestamps at fixed intervals to obtain dissolved oxygen and turbidity data within multiple time windows.
3. The water quality parameter prediction method based on multi-sensor data fusion according to claim 2, characterized in that, Step S3 includes: S31: Based on the geographic coordinates of the sensors corresponding to each data point in the complete sensor sequence after single-point anomaly removal and the direction of water flow, calculate the spatial relationship weights between the sensors. The calculation method is as follows: ; ; ; in, Let be the Euclidean distance between the i-th sensor and the j-th sensor. For the L2 norm operation, Let the similarity of the water flow direction between the i-th sensor and the j-th sensor be denoted as . For cosine similarity, Let i be the water flow direction vector of the i-th sensor. Let be the water flow direction vector of the j-th sensor. The spatial relationship weights between the i-th and j-th sensors are given. This is the spatial relation weight matrix. The difference between the elevation values of the i-th sensor and the j-th sensor in geographic coordinates. S32: Decompose the water quality feature vector of the sensor into low-frequency features and high-frequency features, then perform enhancement and smoothing processes respectively, and finally fuse them to obtain the frequency dynamic features; S33: Generate a global feature vector based on spatial relationship weights and frequency dynamic features. The calculation method is as follows: ; in, For spatial weighted fusion characteristics, The frequency dynamic characteristics of the i-th and j-th sensors are respectively. For the spacetime gating vector, For the spatiotemporal gating weight matrix, For global feature vectors, This is global average pooling.
4. The water quality parameter prediction method based on multi-sensor data fusion according to claim 3, characterized in that, Step S32 includes: S321: Perform frequency decomposition on the water quality feature vector of the sensor to obtain high-frequency and low-frequency features. The calculation method is as follows: ; ; in, Let i be the low-frequency characteristic of the i-th sensor. For one-dimensional average pooling, The high-frequency characteristics of the i-th sensor; S322: Gated enhancement of low-frequency features is performed to obtain enhanced low-frequency features. The calculation method is as follows: ; ; in, For low-frequency gating weights, The low-frequency characteristics are enhanced by the i-th sensor. For dilated convolution; S323: Perform dynamic Bessel kernel convolution on the high-frequency features to obtain smoothed high-frequency features. The calculation method is as follows: ; ; ; in, For dynamic kernel bandwidth coefficient, The kernel is a Bessel function convolution. It is a zero-order Bessel function. The smoothed high-frequency characteristics of the i-th sensor; S324: Feature fusion is performed on the enhanced low-frequency features and the smoothed high-frequency features to obtain the frequency dynamic features. The calculation method is as follows: ; in, For the frequency dynamic characteristics of the i-th sensor, For layer normalization.
5. The water quality parameter prediction method based on multi-sensor data fusion according to claim 3, characterized in that, Step S4 includes: S41: Based on the global feature vector, a water quality parameter tensor is generated using a long short-term memory network. The calculation method is as follows: ; ; ; ; in, Let be the hidden state vector at time step t, where t is the time step index. The total number of time steps. For Long Short-Term Memory (LSTM) networks, Let be the dissolved oxygen prediction vector at time step t. This is the weight matrix for dissolved oxygen prediction. This is the dissolved oxygen prediction bias vector. Let t be the turbidity prediction vector at the t-th time step. This is the turbidity prediction weight matrix. This is the turbidity prediction bias vector. For water quality parameter tensors, From the first time step to the second The result of concatenating the dissolved oxygen prediction vector and turbidity prediction vector at each time step; S42: Generate a water quality parameter heatmap based on the water quality parameter tensor and the geographic coordinates of the sensor. The calculation method is as follows: ; ; in, Let be the spatial distribution matrix at time step t. It is an inverse distance weighted interpolation algorithm. This is the geographic coordinate matrix of the sensor. This is a thermogram of water quality parameters at time step t. It is a pseudo-color mapping function. To normalize the maximum and minimum values, From the first time step to the second The result of splicing the spatial distribution matrices of each time step.
6. A water quality parameter prediction system based on multi-sensor data fusion, characterized in that, include: Data acquisition and preprocessing module: Acquires raw dissolved oxygen and turbidity data and performs preprocessing to obtain dissolved oxygen and turbidity data within multiple time windows; Sensor anomaly data removal module: Based on the dissolved oxygen and turbidity data in each time window, the water quality feature vector, dynamic convolution kernel and anomaly discrimination probability of each sensor in that time window are calculated in sequence. Based on the anomaly discrimination probability, the data of all sensors in all time windows are traversed and removed to obtain the complete sensor sequence after single-point anomaly removal. Global Feature Calculation Module: Based on the geographic coordinates of the sensors corresponding to each data point in the complete sensor sequence after single-point anomaly removal and the direction of water flow, calculate the spatial relationship weights between the sensors, decompose, optimize and fuse the water quality feature vector to obtain frequency dynamic features, perform weighted fusion of the frequency dynamic features of neighboring sensors based on spatial relationship weights, process the fusion results through a spatiotemporal gating mechanism, and generate a global feature vector. Water quality parameter heat map generation module: Based on the global feature vector, it generates water quality parameter tensors by combining them with a long short-term memory network, and generates water quality parameter heat maps by combining them with the geographic coordinates of the sensors; To achieve the water quality parameter prediction method based on multi-sensor data fusion as described in any one of claims 1-5.