A water quality monitoring method and system for water supply network based on neural network

Through the neural network-based water quality monitoring method of water supply network, multispectral data and neural network models are used to solve the time-consuming and labor-intensive problems of traditional water quality monitoring, and realize fast, accurate and intelligent monitoring of water quality in water supply network.

CN120014409BActive Publication Date: 2025-09-19PIPE NETWORK MANAGEMENT BRANCH OF BEIJING WATERWORKS GRP CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202510090098.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-01-21
Publication Date
2025-09-19
Estimated Expiration
2045-01-21

AI Technical Summary

Technical Problem

Traditional water quality monitoring methods are time-consuming and labor-intensive and cannot provide real-time feedback, making them unable to effectively address the problem of deteriorating water quality in water supply networks.

Method used

A neural network-based water quality monitoring method for water supply networks is adopted. By collecting multispectral data, calculating noise levels and performance indicators, screening band images, constructing training samples, and using 3D-CNN and Transformer networks for water quality monitoring.

Benefits of technology

It improves the accuracy and real-time performance of water quality monitoring, enhances the predictive capability of the model, and ensures rapid and intelligent water quality monitoring.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120014409B_ABST
    Figure CN120014409B_ABST
Patent Text Reader

Abstract

The present invention relates to a neural network-based water quality monitoring method and system for a water supply network, comprising: collecting multispectral data from detection points in the water supply network; calculating the noise level of the multispectral data and screening out band images whose noise levels are within a preset range; evaluating the performance indicators of the band images and screening out feature expression images whose performance indicators are within the preset range; calibrating the water quality indicators corresponding to each feature expression image to form training samples; and inputting the training samples into a neural network for training to obtain a water quality monitoring model. The present invention effectively improves data quality by calculating the noise level and screening out appropriate band images. The evaluation of the band image performance indicators ensures that only feature expression images with good performance are selected, helping the neural network focus on the variables that have the greatest impact on water quality, greatly increasing the model's predictive capabilities and improving the accuracy of water quality monitoring results.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of water quality monitoring, and in particular to a method and system for monitoring water quality in a water supply network based on a neural network. Background Art

[0002] With the acceleration of urbanization, the complexity and importance of water supply networks are becoming increasingly prominent. These networks not only transport water from treatment plants to residents and businesses but also ensure the safety and stability of water quality during transportation. Traditional water quality monitoring methods rely primarily on manual sampling and laboratory analysis, which is not only time-consuming and labor-intensive but also lacks real-time feedback on water quality, potentially creating hidden dangers.

[0003] In recent years, water pollution incidents have occurred frequently. For example, due to aging, corrosion, and leakage of pipe networks, water quality has deteriorated, seriously affecting the health of residents. Therefore, fast, accurate, and intelligent water quality monitoring methods are particularly urgent. Summary of the Invention

[0004] To solve the above problems, an embodiment of the present invention aims to provide a method and system for monitoring water quality in a water supply network based on a neural network.

[0005] A water quality monitoring method for a water supply network based on a neural network, comprising:

[0006] Step 1: Collect multispectral data of water supply network detection points;

[0007] Step 2: Calculate the noise level of the multispectral data and filter out the band images whose noise level is within the preset range;

[0008] Step 3: Evaluate the performance indicators of the band images and select the feature expression images whose performance indicators are within the preset range;

[0009] Step 4: Calibrate the water quality index corresponding to each feature expression image to form a training sample;

[0010] Step 5: Input the training samples into the neural network for training to obtain the water quality monitoring model;

[0011] Step 6: Use the water quality monitoring model to complete water quality monitoring of the target water supply network detection point.

[0012] Preferably, the step 2: calculating the noise level of the multispectral data and screening out band images with noise levels within a preset range includes:

[0013] Step 2.1: Divide the multispectral data image of each band into windows of equal size;

[0014] Step 2.2: Calculate the weight value of each pixel in the window structure;

[0015] Step 2.3: Divide multiple intervals between the minimum and maximum values ​​of the pixel weight value;

[0016] Step 2.4: Divide the corresponding pixel weight values ​​in each window structure into different intervals;

[0017] Step 2.5: The weight value corresponding to the largest window structure in the interval is used as the noise level of the entire band image;

[0018] Step 2.6: Filter out band images with noise levels within a preset range.

[0019] Preferably, in step 2.2, the calculation formula of the pixel weight value in the window structure is:

[0020]

[0021] Among them, lv represents the pixel weight value in the window structure, B represents the length and width of the window structure, and s i Represents the value of the i-th pixel in the window structure, and lm represents the average pixel variance of the window structure.

[0022] Preferably, the step 3 of evaluating the performance index of the band image and screening out the characteristic expression images whose performance index is within a preset range includes:

[0023] Step 3.1: Stretch each band image into a one-dimensional vector to form a flat image;

[0024] Step 3.2: Calculate the correlation between the flattened images of each band;

[0025] Step 3.3: Construct the spectral data correlation matrix based on the correlation;

[0026] Step 3.4: Calculating a band selection threshold based on the spectral data correlation matrix;

[0027] Step 3.5: Filter out the band images corresponding to the band selection threshold whose correlation is less than the band selection threshold as the feature expression image.

[0028] Preferably, the step 3.2: calculating the correlation between the flattened images of each band includes:

[0029] Using the formula:

[0030]

[0031] Calculate the correlation between the flattened images of each band; where p ij represents the correlation between the flattened image of the i-th band and the flattened image of the j-th band, b nirepresents the nth pixel value in the flattened image, Represents the mean value of pixels in the flattened image.

[0032] Preferably, in step 3.3, the spectral data correlation matrix is:

[0033]

[0034] in, Represents the element in the i-th row and j-th column of the spectral data correlation matrix, with 1≤i≤L, 1≤j≤L.

[0035] Preferably, the step 3.4: calculating the band selection threshold according to the spectral data correlation matrix includes:

[0036] Step 3.4.1: Extract the maximum value in the correlation matrix of the spectral data;

[0037] Step 3.4.2: Calculate the band selection threshold using the maximum value; wherein the calculation formula of the band selection threshold is:

[0038]

[0039] Among them, t fine represents the band selection threshold, represents the maximum value in the correlation matrix of spectral data, Represents the band selection function.

[0040] Preferably, the step 5: inputting the training samples into the neural network for training to obtain a water quality monitoring model includes:

[0041] Step 5.1: Input the training samples into 3D-CNN and 2D-CNN to extract features and form feature images; the feature extraction formula is:

[0042]

[0043] Among them, X 3D Represents features extracted using 3D-CNN layers, Conv3D 3×3 represents a 3D-CNN layer with a convolution kernel size of 3, X in represents the input training sample, X conv Represents features extracted using 2D-CNN layers, Conv2D 1×1 Represents a 2D-CNN layer with a convolution kernel size of 1, Conv2D 3×3 Represents a 2D-CNN layer with a convolution kernel size of 3, Conv2D 5×5 represents a 2D-CNN layer with a convolution kernel size of 5, Indicates channel splicing operation, Represents element addition operation, X out Represents the output feature image;

[0044] Step 5.2: Input the feature image into the Transformer network for training to obtain a water quality monitoring model.

[0045] The present invention also provides a water quality monitoring system for a water supply network based on a neural network, comprising:

[0046] Multispectral data acquisition module, used to collect multispectral data of water supply network detection points;

[0047] The band image screening module is used to calculate the noise level of multispectral data and screen out band images with noise levels within a preset range;

[0048] The performance index evaluation module is used to evaluate the performance index of the band image and screen out the feature expression images whose performance index is within the preset range;

[0049] The sample calibration module is used to calibrate the water quality index corresponding to each feature expression image to form a training sample;

[0050] A training module is used to input training samples into a neural network for training to obtain a water quality monitoring model;

[0051] The water quality monitoring module is used to complete water quality monitoring of the target water supply network detection point using the water quality monitoring model.

[0052] The present invention also provides a computer-readable storage medium having a computer program stored thereon, characterized in that when the computer program is executed by a processor, the steps in the above-mentioned method for monitoring water quality of a water supply network based on a neural network are implemented.

[0053] According to the specific embodiments provided by the present invention, the present invention discloses the following technical effects:

[0054] The present invention relates to a water quality monitoring method for a water supply network based on a neural network. Compared with the existing technology, the present invention effectively improves data quality by calculating the noise level and screening suitable band images. The evaluation of band image performance indicators ensures that only feature expression images with good performance are selected, which helps the neural network focus on the variables that have the greatest impact on water quality, greatly increasing the model's predictive ability and improving the accuracy of water quality monitoring results.

[0055] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, preferred embodiments are given below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0056] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0057] Figure 1 A flow chart of a water quality monitoring method for a water supply network based on a neural network provided by the present invention;

[0058] Figure 2 This is a schematic diagram of a water quality monitoring system for a water supply network based on a neural network provided by the present invention. DETAILED DESCRIPTION

[0059] In the description of the present invention, it should be understood that the terms "center", "longitudinal", "lateral", "length", "width", "thickness", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside", "outside", "clockwise", "counterclockwise" and the like to indicate orientations or positional relationships based on the orientations or positional relationships shown in the accompanying drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore should not be understood as limiting the present invention.

[0060] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of the technical features being referred to. Thus, a feature identified as "first" or "second" may explicitly or implicitly include one or more of the features. In the description of the present invention, "plurality" means two or more, unless otherwise specifically defined.

[0061] In the present invention, unless otherwise expressly specified or limited, the terms "mounted," "connected," "connect," "fixed," etc. should be understood broadly. For example, they may refer to fixed, detachable, or integral connections; mechanical or electrical connections; direct or indirect connections through an intermediary; or internal communication between two components. Those skilled in the art will understand the specific meanings of the above terms in the present invention based on specific circumstances.

[0062] See also Figure 1 , a water quality monitoring method for a water supply network based on a neural network, comprising:

[0063] Step 1: Collect multispectral data of water supply network detection points;

[0064] Step 2: Calculate the noise level of the multispectral data and filter out the band images whose noise level is within the preset range;

[0065] Furthermore, step 2 includes:

[0066] Step 2.1: Divide the multispectral data image of each band into windows of equal size;

[0067] Step 2.2: Calculate the weight value of each pixel in the window structure;

[0068] In step 2.2, the calculation formula of the pixel weight value in the window structure is:

[0069]

[0070] Among them, lv represents the pixel weight value in the window structure, B represents the length and width of the window structure, and s i Represents the value of the i-th pixel in the window structure, and lm represents the average pixel variance of the window structure.

[0071] Step 2.3: Divide multiple intervals between the minimum and maximum values ​​of the pixel weight value;

[0072] Step 2.4: Divide the corresponding pixel weight values ​​in each window structure into different intervals;

[0073] Step 2.5: The weight value corresponding to the largest window structure in the interval is used as the noise level of the entire band image;

[0074] Step 2.6: Filter out band images with noise levels within a preset range.

[0075] The present invention divides the band image into windows of equal pixel size and calculates the local variance of these windows. It then divides the image block into N equal-width intervals within the maximum and minimum LV ranges, and assigns all blocks to these intervals based on their values. The noise level of the interval with the largest number of blocks is used as the noise level for the entire band image. By selecting image bands with lower noise, the present invention ensures the quality of subsequent analysis data.

[0076] Step 3: Evaluate the performance indicators of the band images and select the feature expression images whose performance indicators are within the preset range;

[0077] Furthermore, step 3 includes:

[0078] Step 3.1: Stretch each band image into a one-dimensional vector to form a flat image;

[0079] Step 3.2: Calculate the correlation between the flattened images of each band;

[0080] In step 3.2, the present invention may use the Pearson correlation coefficient calculation formula:

[0081]

[0082] Calculate the correlation between the flattened images of each band; where p ij represents the correlation between the flattened image of the i-th band and the flattened image of the j-th band, b ni represents the nth pixel value in the flattened image, b i Represents the mean value of pixels in the flattened image.

[0083] Step 3.3: Construct the spectral data correlation matrix based on the correlation;

[0084] In step 3.3, the spectral data correlation matrix is:

[0085]

[0086] in, Represents the element in the i-th row and j-th column of the spectral data correlation matrix, with 1≤i≤L, 1≤j≤L.

[0087] Step 3.4: Calculating a band selection threshold based on the spectral data correlation matrix;

[0088] Among them, step 3.4 includes:

[0089] Step 3.4.1: Extract the maximum value in the correlation matrix of the spectral data;

[0090] Step 3.4.2: Calculate the band selection threshold using the maximum value; wherein the calculation formula of the band selection threshold is:

[0091]

[0092] Among them, t fine represents the band selection threshold, represents the maximum value in the correlation matrix of spectral data, Represents the band selection function.

[0093] Step 3.5: Filter out the band images corresponding to the band selection threshold whose correlation is less than the band selection threshold as the feature expression image.

[0094] By retaining bands with low correlation, the present invention can discover complementary features between images, which can improve the generalization ability of the model and reduce the risk of overfitting.

[0095] Step 4: Calibrate the water quality index corresponding to each feature expression image to form a training sample;

[0096] Step 5: Input the training samples into the neural network for training to obtain the water quality monitoring model;

[0097] Wherein, step 5 includes:

[0098] Step 5.1: Input the training samples into 3D-CNN and 2D-CNN to extract features and form feature images; the feature extraction formula is:

[0099]

[0100] Among them, X 3D Represents features extracted using 3D-CNN layers, Conv3D 3×3 represents a 3D-CNN layer with a convolution kernel size of 3, X in represents the input training sample, X conv Represents features extracted using 2D-CNN layers, Conv2D 1×1 Represents a 2D-CNN layer with a convolution kernel size of 1, Conv2D 3×3 Represents a 2D-CNN layer with a convolution kernel size of 3, Conv2D 5×5 represents a 2D-CNN layer with a convolution kernel size of 5, Indicates channel splicing operation, Represents element addition operation, X out Represents the output feature image;

[0101] The training sample first passes through a 3D-CNN layer with a convolution kernel size of 3 to fully explore the joint features of space and spectrum, and then passes through a 3-layer 2D convolution block with a convolution kernel size of 1 to further extract spectral information, and then uses a convolution block with a convolution kernel size of 3 to capture spatial information. Finally, multi-granularity feature extraction is performed through convolution blocks with convolution kernel sizes of 1, 3, and 5, and the fine-grained and coarse-grained features are added and fused, and then feature splicing is performed to form the final feature representation. The present invention is based on 3D convolution and multi-layer 2D convolution, which can effectively capture the complex relationship between spatial and spectral information, improve the performance of features, and at the same time combine the method of extracting and fusing features layer by layer, so as to construct features hierarchically from low-level to high-level, thereby improving the network's ability to understand data.

[0102] Step 5.2: Input the feature image into the Transformer network for training to obtain a water quality monitoring model;

[0103] Step 6: Use the water quality monitoring model to complete water quality monitoring of the target water supply network detection point.

[0104] The present invention effectively improves data quality by calculating the noise level and screening suitable band images. The evaluation of band image performance indicators ensures that only feature expression images with good performance are selected, which helps the neural network focus on the variables that have the greatest impact on water quality, greatly increasing the model's predictive ability and improving the accuracy of water quality monitoring results.

[0105] See also Figure 2 The present invention also provides a water quality monitoring system for a water supply network based on a neural network, comprising:

[0106] Multispectral data acquisition module, used to collect multispectral data of water supply network detection points;

[0107] The band image screening module is used to calculate the noise level of multispectral data and screen out band images with noise levels within a preset range;

[0108] The performance index evaluation module is used to evaluate the performance index of the band image and screen out the feature expression images whose performance index is within the preset range;

[0109] The sample calibration module is used to calibrate the water quality index corresponding to each feature expression image to form a training sample;

[0110] A training module is used to input training samples into a neural network for training to obtain a water quality monitoring model;

[0111] The water quality monitoring module is used to complete water quality monitoring of the target water supply network detection point using the water quality monitoring model.

[0112] The present invention also provides an electronic device, comprising a bus, a transceiver, a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the transceiver, the memory, and the processor are connected via the bus, and wherein the computer program, when executed by the processor, implements the steps of the above-mentioned method for monitoring water quality of a water supply network based on a neural network. Compared with the prior art, the beneficial effects of the electronic device provided by the present invention are the same as the beneficial effects of the method for monitoring water quality of a water supply network based on a neural network described in the above-mentioned technical solution, and are not elaborated herein.

[0113] The present invention also provides a computer-readable storage medium having a computer program stored thereon, characterized in that when the computer program is executed by a processor, the steps in the above-mentioned method for monitoring water quality of a water supply network based on a neural network are implemented. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided by the present invention are the same as the beneficial effects of the method for monitoring water quality of a water supply network based on a neural network described in the above technical solution, and will not be elaborated here.

[0114] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any technical solution that can be easily conceived by a person skilled in the art within the technical scope disclosed in the present invention should be included in the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be based on the scope of protection of the claims.

Claims

1. A water quality monitoring method for a water supply network based on a neural network, characterized in that: include: Step 1: Collect multispectral data of water supply network detection points; Step 2: Calculate the noise level of the multispectral data and filter out the band images whose noise level is within the preset range; Step 3: Evaluate the performance indicators of the band images and select the feature expression images whose performance indicators are within the preset range; Step 3: evaluating the performance indicators of the band images and selecting feature expression images whose performance indicators are within a preset range, including: Step 3.1: Stretch each band image into a one-dimensional vector to form a flat image; Step 3.2: Calculate the correlation between the flattened images of each band; The step 3.2: calculating the correlation between the flattened images of each band, includes: Using the formula: Calculate the correlation between the flattened images of each band; where p ij represents the correlation between the flattened image of the i-th band and the flattened image of the j-th band, b ni represents the nth pixel value in the flattened image, Represents the mean value of pixels in the flattened image; Step 3.3: Construct the spectral data correlation matrix based on the correlation; In step 3.3, the spectral data correlation matrix is: in, represents the element in the i-th row and j-th column of the spectral data correlation matrix, and 1≤i≤L, 1≤j≤L; Step 3.4: Calculating a band selection threshold based on the spectral data correlation matrix; The step 3.4: calculating the band selection threshold according to the spectral data correlation matrix, includes: Step 3.4.1: Extract the maximum value in the correlation matrix of the spectral data; Step 3.4.2: Calculate the band selection threshold using the maximum value; wherein the calculation formula of the band selection threshold is: Among them, t fine represents the band selection threshold, represents the maximum value in the correlation matrix of spectral data, represents the band selection function; Step 3.5: Filter out the band images corresponding to the band selection threshold whose correlation is less than the band selection threshold as the feature expression images; Step 4: Calibrate the water quality index corresponding to each feature expression image to form a training sample; Step 5: Input the training samples into the neural network for training to obtain the water quality monitoring model; Step 6: Use the water quality monitoring model to complete water quality monitoring of the target water supply network detection point.

2. The water quality monitoring method of a water supply network based on a neural network according to claim 1, characterized in that: The step 2: calculating the noise level of the multispectral data and screening out band images with noise levels within a preset range, includes: Step 2.1: Divide the multispectral data image of each band into windows of equal size; Step 2.2: Calculate the weight value of each pixel in the window structure; Step 2.3: Divide multiple intervals between the minimum and maximum values ​​of the pixel weight value; Step 2.4: Divide the corresponding pixel weight values ​​in each window structure into different intervals; Step 2.5: The weight value corresponding to the largest window structure in the interval is used as the noise level of the entire band image; Step 2.6: Filter out band images with noise levels within a preset range.

3. The method for monitoring water quality of a water supply network based on a neural network according to claim 2, characterized in that: In step 2.2, the calculation formula of the pixel weight value in the window structure is: Among them, lv represents the pixel weight value in the window structure, B represents the length and width of the window structure, and s i Represents the value of the i-th pixel in the window structure, and lm represents the average pixel variance of the window structure.

4. The water quality monitoring method for a water supply network based on a neural network according to claim 3, characterized in that: Step 5: inputting the training samples into the neural network for training to obtain a water quality monitoring model, including: Step 5.1: Input the training samples into 3D-CNN and 2D-CNN to extract features and form feature images; the feature extraction formula is: Among them, X 3D Represents features extracted using 3D-CNN layers, Conv3D 3×3 represents a 3D-CNN layer with a convolution kernel size of 3, X in represents the input training sample, X conv Represents features extracted using 2D-CNN layers, Conv2D 1×1 Represents a 2D-CNN layer with a convolution kernel size of 1, Conv2D 3×3 Represents a 2D-CNN layer with a convolution kernel size of 3, Conv2D 5×5 represents a 2D-CNN layer with a convolution kernel size of 5, Indicates channel splicing operation, Represents element addition operation, X out Represents the output feature image; Step 5.2: Input the feature image into the Transformer network for training to obtain a water quality monitoring model.

5. A water quality monitoring system for water supply network based on neural network, characterized in that: include: Multispectral data acquisition module, used to collect multispectral data of water supply network detection points; The band image screening module is used to calculate the noise level of multispectral data and screen out band images with noise levels within a preset range; The performance index evaluation module is used to evaluate the performance index of the band image and screen out the feature expression images whose performance index is within the preset range; The performance indicators of the band images are evaluated, and the characteristic expression images with performance indicators within the preset range are screened out, including: Step 3.1: Stretch each band image into a one-dimensional vector to form a flat image; Step 3.2: Calculate the correlation between the flattened images of each band; The step 3.2: calculating the correlation between the flattened images of each band, includes: Using the formula: Calculate the correlation between the flattened images of each band; where p ij represents the correlation between the flattened image of the i-th band and the flattened image of the j-th band, b ni represents the nth pixel value in the flattened image, Represents the mean value of pixels in the flattened image; Step 3.3: Construct the spectral data correlation matrix based on the correlation; In step 3.3, the spectral data correlation matrix is: in, represents the element in the i-th row and j-th column of the spectral data correlation matrix, and 1≤i≤L, 1≤j≤L; Step 3.4: Calculating a band selection threshold based on the spectral data correlation matrix; The step 3.4: calculating the band selection threshold according to the spectral data correlation matrix, includes: Step 3.4.1: Extract the maximum value in the correlation matrix of the spectral data; Step 3.4.2: Calculate the band selection threshold using the maximum value; wherein the calculation formula of the band selection threshold is: Among them, t fine represents the band selection threshold, represents the maximum value in the correlation matrix of spectral data, represents the band selection function; Step 3.5: Filter out the band images corresponding to the band selection threshold whose correlation is less than the band selection threshold as the feature expression images; The sample calibration module is used to calibrate the water quality index corresponding to each feature expression image to form a training sample; A training module is used to input training samples into a neural network for training to obtain a water quality monitoring model; The water quality monitoring module is used to complete water quality monitoring of the target water supply network detection point using the water quality monitoring model.

6. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the water quality monitoring method of a water supply network based on a neural network as described in any one of claims 1 to 4 are implemented.

Citation Information

Patent Citations

  • Hyperspectral water quality parameter estimation method of LBFGS optimization acceleration multilayer sensing network

    CN118552851A