Water quality monitoring method for small and micro water areas based on improved least square method
By using drones to collect multispectral remote sensing images and improving the least squares regression model, the problems of resource consumption and insufficient resolution of remote sensing satellites in traditional water quality monitoring have been solved, enabling real-time and accurate monitoring of water quality parameters in small water bodies.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- CHINA THREE GORGES UNIV
- Filing Date
- 2023-01-31
- Publication Date
- 2026-04-24
AI Technical Summary
Traditional laboratory water quality monitoring methods consume a lot of manpower and resources and cannot obtain information on water pollution in small water bodies in a timely manner. Remote sensing satellites have limited spatial resolution and cannot effectively monitor the water quality of small urban water bodies.
By using UAVs to collect multispectral remote sensing images and improving the least squares regression model, a high-precision inversion model of water quality elements and spectral band reflectance is established to achieve accurate calculation of the spatial distribution of water quality parameters.
This method enables real-time monitoring of water quality parameters in small water bodies, improves model accuracy, controls overfitting, and provides a fast and efficient water quality monitoring method.
Smart Images

Figure CN116108653B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of ecological environment monitoring, specifically relating to a water quality monitoring method for small water bodies based on the improved least squares method. Background Technology
[0002] Water quality monitoring typically employs laboratory testing methods. This requires personnel to collect water samples strictly according to wastewater monitoring standards, based on a scientifically planned and strategically placed sampling point layout. Then, following laboratory standards and methods, the concentration values of water quality parameters under real-world conditions are obtained. A comprehensive analysis of the water quality status of the area is then conducted according to relevant evaluation systems. While this measurement method can obtain accurate water quality element concentrations at sampling points, its sampling area is very limited, and it requires significant human, material, and time resources. Since most water quality monitoring targets are dynamic and subject to change, traditional laboratory methods cannot promptly obtain information on water pollution levels in the monitoring area. New methods and approaches are needed to achieve real-time water quality monitoring and, together with traditional methods, construct a new water quality monitoring system.
[0003] The rapid development of spatial information technology and the widespread application of remote sensing technology, due to its advantages such as low cost, high speed, good data synchronization, and large observation area, have led to its extensive use in dynamic water quality monitoring, providing new technical support for water quality monitoring. However, remote sensing satellites have limited spatial resolution, only able to identify large bodies of water such as oceans and lakes, posing significant limitations for water quality monitoring of small urban water bodies. Summary of the Invention
[0004] The purpose of this invention is to address the above-mentioned problems by providing a water quality monitoring method for small water areas based on an improved least squares method. This method utilizes unmanned aerial vehicles (UAVs) to collect multispectral remote sensing images of the water area and selects spectral band combinations with high correlation to the water quality parameters. The least squares regression model is improved to establish a high-precision inversion model of water quality elements and the reflectance of the water area's spectral band group, enabling accurate calculation of the spatial distribution of water quality parameters and facilitating real-time monitoring of water ecological changes.
[0005] The technical solution of this invention is a water quality monitoring method for small water bodies based on the improved least squares method, comprising the following steps:
[0006] Step 1: Acquire multispectral remote sensing images of small water bodies, and stitch and crop the remote sensing images to obtain the reflectance of a single channel;
[0007] Step 2: Perform combination calculations on the bands of a single channel to select and determine the combination of spectral bands that are highly correlated with the water quality parameters of a small area of water.
[0008] Step 3: Improve the least squares regression model and use it to establish an inversion model for water quality elements;
[0009] Step 4: Compare the inversion model obtained in Step 3 with the water quality element inversion models established by polynomial functions, linear functions, and power functions, and select the optimal inversion model with the highest accuracy for each water quality element.
[0010] Step 5: Extract the study area from the remote sensing image of the water body to be measured, and use the optimal inversion model of each water quality element obtained in Step 4 to calculate the water quality parameters corresponding to each pixel of the water body, so as to obtain the distribution of water quality parameters of the water body.
[0011] Furthermore, step 2 specifically includes the following sub-steps:
[0012] Step 2.1: On-site water sampling and drone-captured water images are carried out simultaneously. Water quality parameters are measured in the laboratory according to national standard testing methods. Water quality parameters include total nitrogen, total phosphorus, turbidity and algae density.
[0013] Step 2.2: Import the water area image obtained in Step 2.1 into remote sensing image processing software and perform band calculations to obtain the reflectance of each band sampling point;
[0014] Step 2.3: Try different combinations of calculations, perform correlation analysis, and select the reflectance corresponding to the band combination formula with high correlation as the independent variable of the model.
[0015] Preferably, in step 2.1, the total nitrogen in the water is determined by alkaline potassium persulfate digestion ultraviolet spectrophotometry.
[0016] Preferably, in step 2.1, the total phosphorus in the water is determined by ammonium molybdate spectrophotometry.
[0017] Preferably, in step 2.1, the algal density is determined using spectrophotometry.
[0018] In step 3, highly correlated band combinations are selected as independent variables, and an improved least squares method is used to establish an inversion model of each water quality parameter and band factor. The least squares method finds the best-matching straight line for the sample points with the minimum sum of squared errors, so that the total fitting error, i.e. the total residual, is minimized.
[0019] Sample regression model:
[0020]
[0021] In the formula Y i X represents the predicted value of the i-th sample; i Represents the i-th sample; e i This represents the error of the i-th sample; All are regression coefficients.
[0022] Sum of squared residuals:
[0023]
[0024] In the formula, Q represents the sum of squared residuals of the sample data; n represents the total number of sample points; This represents the true value of the i-th sample.
[0025] The fitted line for the sample points is determined by minimizing Q, i.e., the line is determined. by If we treat these variables as functions of Q, the problem becomes finding extrema, which can be solved by taking derivatives.
[0026] Find Q for two parameters to be estimated. Partial derivatives:
[0027]
[0028] Solving
[0029]
[0030]
[0031] Considering the relationship between the dependent variable (water quality parameter value) and the independent variable (reflectivity) in the regression model, some independent variables may only affect certain dependent variables and not necessarily others. The improved least squares method uses a stepwise regression algorithm with double screening, which not only screens the independent variables but also the dependent variables, eliminating independent and dependent variables with insignificant correlation. This allows the dependent variables to be grouped according to the relationship between the dependent and independent variables, and also reflects the influence of each independent variable on each dependent variable. Finally, the regression equation is established by grouping the variables.
[0032] Furthermore, the specific calculation process of the stepwise regression algorithm with dual screening is as follows:
[0033] 1) Determine the selection criteria for independent and dependent variables in the inversion model;
[0034] Let F x and F y Let the critical values for the introduction and removal of the independent and dependent variables be respectively taken.
[0035] F x =F(p / 2,n-(p+m) / 2)(6)
[0036] F y =F(m / 2,n-(p+m) / 2)(7)
[0037] In the formula, m and p are the number of independent and dependent variables, respectively. The critical value is taken to be greater than or equal to zero to ensure that the stepwise variable screening process stops after a finite number of steps.
[0038] 2) Randomly select one dependent variable;
[0039] 3) Check each independent variable individually to see if it needs to be removed;
[0040] 4) Check each variable individually to see if it needs to be introduced. If any variable is introduced, proceed to step 3).
[0041] 5) Check each dependent variable individually to see if it needs to be removed. If any dependent variable is removed, proceed to step 3).
[0042] 6) Introduce the dependent variable and proceed to step 3);
[0043] 7) Calculate the regression equation.
[0044] Compared with the prior art, the beneficial effects of the present invention include:
[0045] 1) Compared with water quality element inversion models established by polynomial functions, linear functions and power functions, the improved least squares regression model of this invention has a significant improvement in model accuracy and effectively controls overfitting.
[0046] 2) This invention combines the band reflectance of remote sensing images of water bodies with an improved least squares regression model to provide a fast and efficient real-time monitoring method for multiple water quality elements in small water areas, which can reflect the ecological changes of water bodies in a timely and comprehensive manner.
[0047] 3) Verification shows that the improved least squares regression model of this invention has an inversion accuracy for water quality parameters that is close to that of traditional satellite remote sensing. It achieves accurate monitoring of the spatial distribution of water quality parameters in the study area, has good practicality, and has certain engineering application level and promotion value. Attached Figure Description
[0048] The present invention will be further described below with reference to the accompanying drawings and embodiments.
[0049] Figure 1 This is a flowchart illustrating the water quality monitoring method for small water bodies according to an embodiment of the present invention.
[0050] Figure 2 This is a schematic diagram of UAV remote sensing image stitching according to an embodiment of the present invention. Figure 2 The red dots indicate the sampling range determined based on the latitude and longitude of the drone imagery.
[0051] Figure 3aThis is a comparison chart showing the results of the inversion models for total nitrogen in water and spectral reflectance of remote sensing images of water bodies established by linear function, polynomial function, power function models and improved least squares method in embodiments of the present invention.
[0052] Figure 3b This is a comparison chart showing the results of the inversion models for total phosphorus in water and spectral reflectance of remote sensing images of water bodies established by linear function, polynomial function, power function models and improved least squares method in embodiments of the present invention.
[0053] Figure 3c This is a comparison of the results of the inversion models of water turbidity and spectral reflectance of remote sensing images of water bodies established by linear function, polynomial function, power function models and improved least squares method in embodiments of the present invention.
[0054] Figure 3d This is a comparison of the results of the inversion models of algal density and spectral reflectance of water remote sensing images established by linear function, polynomial function, power function models and improved least squares method in embodiments of the present invention.
[0055] Figure 4a This is a scatter plot of the measured and fitted values of total nitrogen in the improved least squares inversion model according to an embodiment of the present invention.
[0056] Figure 4b This is a scatter plot of the measured and fitted values of total phosphorus in the improved least squares inversion model according to an embodiment of the present invention.
[0057] Figure 4c This is a scatter plot of the measured and fitted values of turbidity in the improved least squares inversion model according to an embodiment of the present invention.
[0058] Figure 4d This is a scatter plot of the measured and fitted values of algal density in the improved least squares inversion model according to an embodiment of the present invention.
[0059] Figure 5a This is a graph showing the total nitrogen inversion results of an embodiment of the present invention.
[0060] Figure 5b This is a graph showing the total phosphorus inversion results of an embodiment of the present invention.
[0061] Figure 5c This is a diagram showing the turbidity inversion results of an embodiment of the present invention.
[0062] Figure 5d This is a diagram showing the algal density inversion results of an embodiment of the present invention. Detailed Implementation
[0063] In this embodiment, a drone equipped with one visible light sensor and five multispectral monochromatic sensors was used to acquire remote sensing images of the water area, and on-site sampling of the water area was carried out simultaneously with the drone's image capture. The multispectral sensors can capture information in five bands: blue band B (450nm±16nm), green band G (560nm±16nm), red band R (650nm±16nm), red-edge band RE (730nm±16nm), and near-infrared band NIR (840nm±16nm). Pix4DCapture was used to stitch and crop the images to obtain a complete multispectral image of the study area, as shown below. Figure 2 As shown, Figure 2 The red dots in the diagram represent sampling areas determined based on latitude and longitude.
[0064] like Figure 1 As shown, the water quality monitoring method for small water bodies based on the improved least squares method includes the following steps:
[0065] Step 1: Acquire multispectral remote sensing images of small bodies of water, and then stitch and crop the images, such as... Figure 2 As shown, the reflectivity of a single channel is obtained;
[0066] Step 2: Perform combination calculations on the bands of a single channel, and select and determine the combination formula of spectral bands that are highly correlated with the water quality parameters of a small area of water.
[0067] Step 2.1: On-site water sampling and drone-captured water images are carried out simultaneously. Water quality parameters are measured in the laboratory according to national standard testing methods. Water quality parameters include total nitrogen, total phosphorus, turbidity and algae density.
[0068] Sampling points were evenly distributed on both sides of the river, with an interval of 100-150 meters between each sampling point. The location information of the sampling points was recorded using the mobile app "JiYinZuji" during sampling. Following the technical guidelines for water quality sampling, water samples were collected at a depth of 0.5 meters below the water surface. Water quality parameters were measured in the laboratory within three days of sampling. In this example, four water quality parameters were collected: total nitrogen, total phosphorus, turbidity, and algae density. All water quality parameters were measured according to national standard testing methods. Total nitrogen was determined using alkaline potassium persulfate digestion ultraviolet spectrophotometry; total phosphorus was determined using ammonium molybdate spectrophotometry; turbidity was measured directly using a turbidimeter; and algae density was determined using spectrophotometry.
[0069] Step 2.2: Import the water area image obtained in Step 2.1 into ENVI 5.3 software and perform band calculations to obtain the reflectance of each band sampling point;
[0070] Based on latitude and longitude coordinates, water surface sampling points were located, and 5×5 matrices centered on the sampling points were constructed as regions of interest (ROIs). Three 5×5 ROIs were drawn for each sampling point, and the average spectral reflectance of all points within the region was used as the spectral reflectance data for that point.
[0071] Step 2.3: Try different combinations of calculations, perform correlation analysis, and select the reflectance corresponding to the band combination formula with high correlation as the independent variable of the model.
[0072] Step 3: Improve the least squares regression model and use it to establish an inversion model for water quality elements;
[0073] We select highly correlated band combinations as independent variables and use an improved least squares method to establish an inversion model of each water quality parameter and band factor. The least squares method finds the best-matching straight line for the sample points with the minimum sum of squared errors, so that the total fitting error, i.e. the total residual, is minimized.
[0074] Sample regression model:
[0075]
[0076] In the formula Y i X represents the predicted value of the i-th sample; i Represents the i-th sample; e i This represents the error of the i-th sample; All are regression coefficients.
[0077] Sum of squared residuals:
[0078]
[0079] In the formula, Q represents the sum of squared residuals of the sample data; n represents the total number of sample points; This represents the true value of the i-th sample.
[0080] The fitted line for the sample points is determined by minimizing Q, i.e., the line is determined. by If we treat these variables as functions of Q, the problem becomes finding extrema, which can be solved by taking derivatives.
[0081] Find Q for two parameters to be estimated. Partial derivatives:
[0082]
[0083] Solving
[0084]
[0085] Considering the relationship between the dependent variable (water quality parameter value) and the independent variable (reflectivity) in the regression model, some independent variables may only affect certain dependent variables and not necessarily others. The improved least squares method uses a stepwise regression algorithm with double screening, which not only screens the independent variables but also the dependent variables, eliminating independent and dependent variables with insignificant correlation. This allows the dependent variables to be grouped according to the relationship between the dependent and independent variables, and also reflects the influence of each independent variable on each dependent variable. Finally, the regression equation is established by grouping the variables.
[0086] Step 4: Compare the inversion model obtained in Step 3 with the water quality element inversion models established by polynomial functions, linear functions, and power functions, and select the optimal inversion model with the highest accuracy for each water quality element.
[0087] Step 5: Extract the study area from the remote sensing image of the water body to be measured, and use the optimal inversion model of each water quality element obtained in Step 4 to calculate the water quality parameters corresponding to each pixel of the water body, so as to obtain the distribution of water quality parameters of the water body.
[0088] In this embodiment, the method for determining total nitrogen in the water body is the same as that disclosed in the paper "Interference Factors and Optimization Method for Determining Total Nitrogen in Water Body by Ultraviolet Spectrophotometry" by Fu Yao et al., published in the 4th issue of "Shandong Chemical Industry" in 2021. The method for determining algal density is the same as that disclosed in the paper "Study on Determining Cell Density of Microcystis aeruginosa by Spectrophotometry" by Zhou Xushen et al., published in the 5th issue of "Water Conservancy Technology Supervision" in 2016.
[0089] In this embodiment, the stepwise regression algorithm with dual screening is calculated as follows:
[0090] 1) Determine the selection criteria for independent and dependent variables in the inversion model;
[0091] Let F x F y If the critical values for introducing and removing the independent and dependent variables are respectively determined, then take...
[0092] F x =F(p / 2,n-(p+m) / 2) (6)
[0093] F y =F(m / 2,n-(p+m) / 2)(7)
[0094] In the formula, m and p are the number of independent and dependent variables, respectively. The critical value is taken to be greater than or equal to zero to ensure that the stepwise variable screening process stops after a finite number of steps.
[0095] 2) Randomly select one dependent variable;
[0096] 3) Check each independent variable individually to see if it needs to be removed;
[0097] 4) Check each variable individually to see if it needs to be introduced. If any variable is introduced, proceed to step 3).
[0098] 5) Check each dependent variable individually to see if it needs to be removed. If any dependent variable is removed, proceed to step 3).
[0099] 6) Introduce the dependent variable and proceed to step 3);
[0100] 7) Calculate the regression equation.
[0101] In the embodiments, spectral band combinations with a correlation coefficient of 0.5 or higher are selected, as shown in Table 1.
[0102] Table 1. Spectral Band Combination Methods of Remote Sensing Images
[0103]
[0104]
[0105] Figure 3a , 3b Figures 3c and 3d are accuracy evaluation diagrams for the inversion models of water quality elements and spectral band reflectance of remote sensing images of water bodies, established using linear functions, polynomial functions, power functions, and the improved least squares method, respectively. It can be seen that the R-values of the inversion models for each water quality parameter are... 2 The values are all above 0.5. The coefficients of determination are the same for the polynomial model and the improved least squares model. However, the RMSE of the improved least squares model is smaller, indicating that the improved least squares model has certain improvements in model accuracy and control of overfitting.
[0106] The validation set data was fitted with the estimates from the improved least squares model. Figure 4a , 4b Figures 4c and 4d show the fitted graphs for total nitrogen, total phosphorus, turbidity, and algal density, respectively. Predicted values are represented by red dots, and the black straight line represents the 1:1 line. The closer the predicted value is to the 1:1 line, the higher the R-value. 2 The closer the value is to 1, the more accurate the estimation result. It is evident that algal density has the highest prediction accuracy, while total phosphorus has the lowest.
[0107] Figure 5a , 5b Figures 5c and 5d show the inversion results for total nitrogen, total phosphorus, turbidity, and algal density, respectively. The inversion results show that the concentration of total nitrogen in the study area ranges from 0.02 to 0.2 mg / L, the concentration of total phosphorus ranges from 0.01 to 0.1 g / L, the turbidity ranges from 8 to 30 ntu, and the algal density ranges from 0.2 to 1.4 cells / L. The higher total phosphorus content in some areas is likely due to the influence of leaf litter in the nearshore region.
Claims
1. A water quality monitoring method for small water bodies based on the improved least squares method, characterized in that, Includes the following steps: Step 1: Acquire multispectral remote sensing images of small water bodies, and stitch and crop the remote sensing images to obtain the reflectance of a single channel; Step 2: Perform combination calculations on the bands of a single channel to select and determine the combination of spectral bands that are highly correlated with the water quality parameters of a small area of water. Step 3: Improve the least squares regression model and use it to establish an inversion model for water quality elements; Step 4: Compare the inversion model obtained in Step 3 with the water quality element inversion models established by polynomial functions, linear functions and power functions, and select the optimal inversion model with the highest accuracy for each water quality element. Step 5: Extract the study area from the remote sensing image of the water body to be measured, and use the optimal inversion model of each water quality element obtained in Step 4 to calculate the water quality parameters corresponding to each pixel of the water body, and obtain the distribution of water quality parameters of the water body. In step 3, highly correlated band combinations are selected as independent variables, and an improved least squares method is used to establish an inversion model of each water quality parameter and band factor. The least squares method finds the best-fitting line for the sample points by minimizing the sum of squared errors, thus minimizing the total fitting error, i.e., the total residual. Sample regression model: ;(1) In the formula Indicates the first i Predicted values for each sample; Indicates the first i One sample; Indicates the first i Error per sample; , All are regression coefficients; Sum of squared residuals: ;(2) In the formula This represents the sum of squared residuals of the sample data; n This indicates the total number of sample points; Indicates the first i The true value of each sample; pass The fitted line that minimizes the number of sample points, i.e., determines... , ,by , Treat them as variables, and consider them as The function becomes an extremum problem, which can be solved by finding its derivative; beg For two parameters to be estimated , Partial derivatives: ;(3) Solving ;(4) ;(5) Considering the relationship between the dependent variable (water quality parameter value) and the independent variable (reflectivity) in the regression model, some independent variables may only affect certain dependent variables and not necessarily others. The improved least squares method uses a stepwise regression algorithm with double screening, which not only screens the independent variables but also the dependent variables, eliminating independent and dependent variables with insignificant correlation. This allows the dependent variables to be grouped according to the relationship between the dependent and independent variables, and also reflects the influence of each independent variable on each dependent variable. Finally, the regression equation is established by grouping the variables.
2. The method for monitoring water quality in small bodies of water according to claim 1, characterized in that, Step 2 specifically includes the following sub-steps: Step 2.1: On-site water sampling and drone-captured water images were carried out simultaneously, and water quality parameters were measured in the laboratory; Step 2.2: Import the water area image obtained in Step 2.1 into remote sensing image processing software and perform band calculations to obtain the reflectance of each band sampling point; Step 2.3: Try different combinations of calculations, perform correlation analysis, and select the reflectance corresponding to the band combinations with high correlation as the independent variables of the model.
3. The method for monitoring water quality in small water bodies according to claim 2, characterized in that, In step 2.1, the total nitrogen in the water was determined by alkaline potassium persulfate digestion ultraviolet spectrophotometry.
4. The method for monitoring water quality in small bodies of water according to claim 2, characterized in that, In step 2.1, the total phosphorus in the water was determined by ammonium molybdate spectrophotometry.
5. The method for monitoring water quality in small water bodies according to claim 2, characterized in that, In step 2.1, the algal density was determined using spectrophotometry.
6. The method for monitoring water quality in small bodies of water according to claim 5, characterized in that, The stepwise regression algorithm with dual screening is calculated as follows: 1) Determine the selection criteria for independent and dependent variables in the inversion model; set up , The critical values for introducing and removing independent and dependent variables are respectively taken. ;(6) ; (7) In the formula m , p The numbers of independent and dependent variables are respectively, and the critical value is greater than or equal to zero to ensure that the stepwise variable screening process stops after a finite number of steps. 2) Randomly select one dependent variable; 3) Check each independent variable individually to see if it needs to be removed; 4) Check each variable individually to see if an independent variable needs to be introduced. If an independent variable is introduced, proceed to step 3). 5) Check each dependent variable individually to see if it needs to be removed. If any dependent variable is removed, proceed to step 3). 6) Introduce the dependent variable and proceed to step 3). 7) Calculate the regression equation.
Citation Information
Patent Citations
Inversion method and apparatus for water quality parameter concentration based on optimal combination of multiple bands
CN107421895A
Improved DBPSO water quality parameter monitoring method and device
CN107677646A