Method and system for monitoring water quality of urban river channels and lakes

By integrating the characteristic bands of multispectral images from unmanned aerial vehicles into a water quality inversion model, the problem of limited spatiotemporal coverage of traditional water quality monitoring methods in urban rivers has been solved. This has enabled high-precision inversion of parameters such as chemical oxygen demand, improving the efficiency and reliability of water environment monitoring and supporting intelligent perception and digital governance of urban water environment.

CN121933457APending Publication Date: 2026-04-28EAST CHINA NORMAL UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
EAST CHINA NORMAL UNIV
Filing Date
2026-02-03
Publication Date
2026-04-28

AI Technical Summary

Technical Problem

Traditional water quality monitoring methods in urban rivers suffer from limited spatiotemporal coverage, high costs, and long cycles, making it difficult to meet the needs of high-frequency, large-scale, and near-real-time water quality monitoring. In particular, the accuracy and robustness of remote sensing inversion for non-optical active parameters such as chemical oxygen demand (COD) are insufficient.

Method used

A water quality inversion model is integrated by fusing feature bands from UAV multispectral images. The nonlinear correlation between key bands is strengthened through a self-attention mechanism. Combined with the uncertainty of multi-source prediction, a water quality parameter inversion model based on extreme gradient boosting algorithm and Bayesian optimization is constructed. The hyperparameters are optimized using Bayesian optimization method to improve the inversion accuracy and robustness.

Benefits of technology

It has achieved high-precision inversion of water quality parameters in small urban waterways, possesses good cross-scenario adaptability and robustness, supports dynamic monitoring and refined management of urban water environment, and promotes the improvement of intelligent perception and digital governance of water environment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121933457A_ABST
    Figure CN121933457A_ABST
Patent Text Reader

Abstract

The invention discloses a method and a system for monitoring water quality of urban rivers and lakes. The comprehensive performance of remote sensing inversion of water quality parameters of urban small rivers is effectively improved. According to the method, the inversion precision and stability of non-optical active water quality parameters such as chemical oxygen demand can be remarkably improved, and the limitation of insufficient space-time coverage of a traditional monitoring method is overcome. By enhancing key spectral feature extraction and fusing multi-source uncertainty, the method enhances the generalization ability and robustness of the model in a complex urban water environment, and realizes more accurate description of water quality spatial heterogeneity. Finally, high-timeliness, low-cost and reliable data support is provided for urban water environment dynamic monitoring, pollution traceability early warning and refined treatment, and development of intelligent water affair and water environment digital management capability is powerfully promoted.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of water quality monitoring, and specifically to a method and system for monitoring the water quality of urban rivers and lakes. Background Technology

[0002] Global water scarcity and the lack of water environment management are key factors restricting human survival and development, making rapid and large-scale water quality monitoring an urgent need for environmental management. As an important component of urban ecosystems, urban rivers not only fulfill basic functions such as flood control, drainage, and landscaping, but also serve as crucial indicators of urban water environment health. However, against the backdrop of rapid urbanization, multiple pressure sources, including industrial wastewater discharge, direct discharge of domestic sewage, and surface runoff pollution, have led to the continuous deterioration of urban river water quality. This water degradation not only threatens urban drinking water safety but may also trigger secondary environmental problems such as black and odorous water bodies and algal blooms, thereby damaging the river's ecosystem service functions.

[0003] Remote sensing technology, with its advantages of wide coverage, periodicity, and low cost, provides water quality monitoring with spatial coverage and dynamic monitoring capabilities that are difficult to achieve with traditional sampling methods. However, while satellite remote sensing technology provides an effective means for monitoring large-scale water bodies, its limited spatial resolution makes it difficult to meet the high-precision dynamic monitoring needs of water quality parameters in small urban rivers. Emerging unmanned aerial vehicle (UAV) remote sensing technology, with its sub-meter spatial resolution and high mobility, is particularly suitable for high-frequency, high-precision monitoring of complex urban water systems. The core principle of water quality remote sensing monitoring lies in the spectral response mechanism of water body optical properties. Different components in water exhibit characteristic absorption and scattering characteristics in specific wavelength bands due to differences in molecular structure and particle size distribution, thus forming identifiable spectral fingerprints. This allows for the establishment of inversion models to achieve quantitative monitoring of water component concentrations.

[0004] Currently, research on remote sensing inversion of water quality parameters has been carried out in depth in multiple disciplines, with different scholars systematically exploring the optical characteristics of various water quality indicators and their remote sensing monitoring methods. Chemical Oxygen Demand (COD) is a key comprehensive indicator for measuring the degree of organic pollution in water bodies, reflecting the total amount of reducing substances (mainly organic pollutants) in water bodies that can be oxidized by strong oxidants. As one of the core monitoring parameters in my country's "Surface Water Environmental Quality Standard" (GB 3838–2002), COD concentration is directly related to water body functional zoning, pollution source supervision, water environment capacity assessment, and governance effectiveness evaluation. However, traditional COD monitoring relies on manual sampling and laboratory chemical analysis, which has inherent limitations such as high cost, long cycle, and limited spatial coverage, making it difficult to meet the needs of high-frequency, large-scale, and near-real-time monitoring of dynamic changes in the water environment. Especially in urban river networks, around industrial parks, and in the context of sudden pollution events, water quality exhibits strong spatiotemporal heterogeneity, making it difficult to capture pollution hotspots and diffusion paths with only sparse monitoring stations. Against this backdrop, efficient and non-contact COD retrieval based on remote sensing technology can not only overcome the spatiotemporal constraints of in-situ monitoring but also provide crucial data support for refined water environment management, pollution source tracing and early warning, and smart water management. Although COD itself does not possess direct optical properties, it is often highly correlated with optically active components such as suspended solids and colored dissolved organic matter, making indirect retrieval via remote sensing signals possible. Therefore, developing robust and transferable COD remote sensing retrieval methods has become an important technological direction for promoting intelligent sensing and digital governance of the water environment.

[0005] Remote sensing inversion of non-optically active parameters such as chemical oxygen demand (COD), total phosphorus (TP), and dissolved oxygen (DOO) still faces significant challenges. Because these substances lack optical activity at the sensing wavelength, the generalization ability of algorithms is weak. In recent years, breakthroughs in artificial intelligence (AI) technology have provided a new paradigm for remote sensing big data processing. AI's adaptive learning capabilities can effectively solve the nonlinear modeling problem of multi-source heterogeneous remote sensing data (such as satellite / UAV imagery), demonstrating significant advantages in improving the accuracy of water quality parameter inversion, multi-source data fusion, and spatiotemporal resolution enhancement. Research shows that machine learning methods have significantly better overall accuracy than traditional methods in water quality parameter inversion; ensemble learning methods achieve dual optimization of accuracy improvement and robustness enhancement through model combination strategies; and deep learning, through its multi-level automatic feature extraction capabilities, exhibits stronger representation learning capabilities and end-to-end modeling advantages when processing high-dimensional nonlinear data. Given that COD is a core indicator characterizing the degree of organic pollution in water bodies, although it lacks direct optical properties, it is often highly correlated with optical components such as suspended solids and colored dissolved organic matter, possessing the potential for indirect inversion through multispectral signals. Summary of the Invention

[0006] To address the aforementioned technical challenges, this invention proposes a water quality inversion model based on fused feature bands for UAV multispectral imagery, specifically designed for high-precision COD concentration retrieval in urban small waterways. This model enhances the nonlinear correlation between key bands through a self-attention mechanism and integrates multi-source prediction uncertainties, effectively improving the accuracy, robustness, and cross-scenario generalization ability of COD retrieval. This provides a feasible technical path for low-cost, high-timeliness intelligent monitoring of urban water environments.

[0007] To achieve the above objectives, the present invention provides a method for monitoring the water quality of urban rivers and lakes, the method comprising the following steps:

[0008] S1. Collect multispectral data from UAVs and synchronous ground-based water quality sampling data;

[0009] S2. Based on the UAV multispectral data, obtain the preprocessed surface reflectance data;

[0010] S3. Based on the geographical location of the ground synchronous water quality sampling data and the surface reflectance data, obtain the matched training dataset;

[0011] S4. Based on the training dataset, obtain the band features that are most strongly correlated with the target water quality parameters;

[0012] S5. Based on the band characteristics and the training dataset, construct a water quality parameter inversion model, and complete water quality parameter monitoring based on the model.

[0013] Preferably, S1 includes:

[0014] Acquire multispectral data collected by a drone equipped with a multispectral camera in the experimental area;

[0015] Simultaneously, ground water quality sampling data is acquired in sync with UAV aerial surveys. This ground water quality sampling data includes the geographical coordinates of the sampling points and the concentration of target water quality parameters obtained from laboratory analysis.

[0016] Preferably, S3 includes:

[0017] Based on the geographical coordinates of the sampling points, the corresponding sampling buffer is determined from the surface reflectance data;

[0018] Within the sampling buffer, a central pixel and several randomly distributed pixels are selected to obtain the spectral reflectance data of the central pixel and the multiple randomly distributed pixels.

[0019] The multispectral reflectance data of the central pixel and randomly distributed pixels are matched with the average concentration of the target water quality parameters obtained from laboratory analysis of the corresponding sampling points to form a training dataset.

[0020] Preferably, the step of selecting the central pixel and several randomly distributed pixels within the sampling buffer includes:

[0021] The pixel closest to the geographical coordinates of the sampling point is determined as the center pixel;

[0022] After excluding the center pixel from all valid pixels in the sampling buffer, a predetermined number of pixels are extracted as randomly distributed pixels using a uniform random sampling method without replacement.

[0023] Preferably, S4 includes:

[0024] Calculate the Pearson correlation coefficient between reflectance in each band and the concentration of the target water quality parameter;

[0025] Based on the Pearson correlation coefficient, a predetermined number of bands with the largest absolute values ​​of the correlation coefficients are selected as band features.

[0026] Preferably, S5 includes:

[0027] The extreme gradient boosting algorithm is used as the basic model, and the hyperparameters of the extreme gradient boosting algorithm model are searched and optimized using the Bayesian optimization method to obtain the optimal combination of hyperparameters.

[0028] Using the extreme gradient boosting algorithm model with the optimal hyperparameter combination, a water quality parameter inversion model is constructed by training based on band features and training dataset.

[0029] Preferably, the Bayesian optimization method aims to minimize the prediction loss of the extreme gradient boosting algorithm model on the validation set, and iteratively searches within a predefined hyperparameter search space to determine the optimal hyperparameter combination.

[0030] The present invention also provides a monitoring system for the water quality of urban rivers and lakes. The system is used to implement the above method and includes: a data acquisition module, a preprocessing module, a first acquisition module, a second acquisition module, and a monitoring module.

[0031] The acquisition module is used to acquire multispectral data from the UAV and synchronous ground water quality sampling data.

[0032] The preprocessing module is used to obtain preprocessed surface reflectance data based on the UAV multispectral data;

[0033] The first acquisition module is used to acquire a matched training dataset based on the geographical location of the ground synchronous water quality sampling data and the surface reflectance data;

[0034] The second acquisition module is used to acquire the band features that are most strongly correlated with the target water quality parameters based on the training dataset;

[0035] The monitoring module is used to construct a water quality parameter inversion model based on the band characteristics and the training dataset, and to complete water quality parameter monitoring based on the model.

[0036] Compared with the prior art, the beneficial effects of the present invention are as follows:

[0037] This invention effectively overcomes the limitations of traditional water quality monitoring methods in terms of spatiotemporal coverage and efficiency, significantly improving the accuracy and reliability of remote sensing inversion of water quality parameters in urban small waterways. By enhancing the model's ability to capture key spectral features and its anti-interference capabilities, it achieves more accurate and stable inversion results for non-optical active parameters such as chemical oxygen demand. This method possesses good cross-scenario adaptability and robustness, effectively characterizing the spatial heterogeneity of water quality, and providing efficient and reliable data support for dynamic monitoring, pollution source tracing, and refined management of urban water environments, thereby promoting the improvement of intelligent sensing and digital governance of the water environment. Attached Figure Description

[0038] To more clearly illustrate the technical solution of the present invention, the drawings used in the embodiments are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0039] Figure 1 This is a schematic diagram of the method flow according to an embodiment of the present invention. Detailed Implementation

[0040] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0041] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0042] Example 1

[0043] like Figure 1 The diagram shown is a schematic representation of the method flow in this embodiment, and the steps include:

[0044] S1. Collect multispectral data from UAVs and synchronous ground water quality sampling data.

[0045] (1) UAV data acquisition

[0046] Multispectral data was obtained by using a DJI M300 drone equipped with a Changguang Yucheng AQ600 Pro multispectral camera during flight over the experimental area. This drone model has sufficient flight stability and payload capacity. The multispectral camera includes five spectral lenses with center wavelengths and bandwidths of 450nm±15nm (blue band), 555nm±13.5nm (green band), 660nm±11nm (red band), 720nm±5nm (red edge band), and 840nm±15nm (near-infrared band). The multispectral camera has a field of view of 48.8°×37.5°.

[0047] (2) Acquisition of surface water quality sampling data

[0048] This study utilizes a combination of UAV multispectral aerial surveying and synchronous ground sampling to achieve collaborative air-to-ground data acquisition. A dense sampling scheme was employed, with 30 ground sampling points systematically deployed within the study area. A 30 cm diameter water sampler was used to sample at a depth of 20 cm below the water surface. Each sampling covered a circular area with a radius of 35 cm, and sampling was repeated five times at each point. The resulting water samples were then transferred to a mixing container for thorough mixing, ensuring that 3 L of mixed water sample was obtained from each sampling point for subsequent water quality analysis. The water samples were sealed, labeled, and stored in opaque brown glass bottles in an insulated box to prevent any changes in water quality during transportation that could alter the test results. The geographical location of each sampling point was measured using a high-precision GPS receiver, and its latitude and longitude coordinates were recorded. This embodiment, based on the "GB3838-2002 Surface Water Environmental Quality Standard," primarily measures COD in the water.

[0049] S2. Based on the UAV multispectral data, obtain the preprocessed surface reflectance data.

[0050] The acquired UAV multispectral data requires preprocessing including sensor radiometric calibration, geometric correction, image stitching, and reflectance calculation to obtain surface reflectance data. Reflectance calculation uses a laboratory-calibrated reference board. After extracting the radiance values ​​at the corresponding locations on the calibration board from the UAV multispectral image, a linear regression is performed between the standard radiance reflectance value (R) of the calibration board and the radiance value (L) on the multispectral remote sensing image to obtain the calibration coefficients for each band. The formulas for calculating the remote sensing reflectance and radiance values ​​for the five bands are as follows:

[0051]

[0052] In the formula, a t and b t ρ represents the calibration coefficient for the t-th band. t L represents the corrected reflectance. t This represents the radiance value.

[0053] S3. Based on the geographical location and surface reflectance data of the ground synchronous water quality sampling data, obtain the matched training dataset.

[0054] The UAV imagery resolution is 10 cm. The sampling results for each location are the average of five water samples taken within a 35 cm radius. Considering the relatively small variation in river water quality within a small area, a 35 cm buffer zone was calculated based on the location's latitude and longitude coordinates. Within this buffer zone, the central pixel (the closest to the sampling point's coordinates) and nine randomly distributed pixels were extracted to obtain their multispectral reflectance data. Simultaneously, five repeated samplings were conducted at each location to obtain a mixed water sample (3 L) within a 35 cm radius for laboratory analysis. Considering the spatial homogeneity of river water quality at the sub-meter scale, the reflectance of the 10 pixels was matched with the measured water quality parameters at the corresponding locations. This approach reduced the impact of positioning errors while fully utilizing the spatial information from the UAV imagery, effectively enhancing the data at each location.

[0055] Let P0 = (x0, y0) be the center coordinates (latitude and longitude) of the sampling point. The center coordinates are a point on a two-dimensional plane, which is uniquely determined by the horizontal coordinate x0 and the vertical coordinate y0.

[0056] R = 0.35m was set as the buffer radius, defining the radius of the circular region centered at P0. This value was chosen based on the assumption of spatial homogeneity of river water quality at the sub-meter scale, meaning that water quality parameters (such as COD) do not change significantly within this range.

[0057] Set r=0.10m as the resolution of the UAV image. A water sample mixing zone (a circle with a radius of 35cm) approximately covers π(0.35 / 0.10). 2 ≈38 pixels.

[0058] B(P) is a circular buffer zone centered at point P with radius R. For any point Q, the condition for it to belong to the buffer zone is:

[0059]

[0060] in, It is the Euclidean distance from point Q to point P.

[0061] Set ρ ij is the spectral reflectance (multi-band vector) at pixel (i,j). Reflectance is the ability of a ground object (here, water surface) to reflect solar radiation. It is usually between 0 and 1 and is the core input feature for establishing the association between "image" and "water quality".

[0062] set up This represents the mean water quality parameters of the mixed water sample measured in the laboratory. It also represents the spatial integral mean of the water quality within a circular region centered at P0 and with radius R.

[0063] In this embodiment, the geometric conditions for pixel selection are as follows:

[0064] (1) The set of cells in the buffer

[0065] For any pixel in the image The condition for it to belong to the sample set is:

[0066]

[0067] Where the Euclidean distance is:

[0068]

[0069] This section defines a set S of all pixels within a circular region. This condition is used to filter out all image pixels whose center point falls within B(P0).

[0070] (2) Theoretical calculation of the number of pixels

[0071] By calculating the area πR of the circular buffer zone with radius R. 2 and using πR 2 Divide by the ground area r represented by a single pixel 2 This gives the theoretical number of pixels that can be covered. Rounding down gives the final theoretical value, which is the theoretical number of pixels in the buffer:

[0072]

[0073] Where, N total The buffer represents the theoretically maximum number of pixels that can be contained within it, expressed in "pixels"; ⌊·⌋ represents the floor function, which rounds down to the largest integer not greater than the value within the parentheses, because a pixel is a discrete, indivisible smallest unit, and the calculation result must be an integer; π is the mathematical constant pi, which in this embodiment is approximately equal to 3.1416; R represents the buffer radius, which in this embodiment is R = 0.35 meters, the radius of the circular area defined around the sampling point P0; r represents the spatial resolution of the UAV image, which in this embodiment is r = 0.10 meters, meaning that each pixel of the image represents a 0.10m × 0.10m square area on the ground.

[0074] This embodiment considers that the pixels are discrete grids rather than continuous surfaces, and the relative positional relationship between the pixel center and the boundary, and uses the following formula to calculate the actual effective number of pixels:

[0075]

[0076] Where: N actual This represents the actual number of valid cells in the buffer, and |{·}| represents the cardinality of the set, i.e., the number of elements in the set. Here, it is used to calculate the cells P that satisfy the following conditions. ij How many; P ij d(P) represents the pixel in the i-th row and j-th column of the image; ij P0) represents pixel P ij The Euclidean distance from the center point to the sampling point P0; The buffer radius divided by the pixel resolution indicates how many pixels constitute the buffer radius at the "pixel scale".

[0077] It should be noted that in the above formula... This represents a compensation term with a value of approximately 0.707, derived from geometric considerations: the distance from the center point of a pixel to its farthest corner point is... r. This is added to ensure that boundary cells whose center point is slightly outside the buffer but whose pixels themselves partially fall within the buffer are also correctly included in the statistics.

[0078] This embodiment determines a pixel P by setting the following conditions. ij Whether a pixel falls within the buffer: Check if the distance from the pixel center point to the sampling point (in pixels of size r) is less than or equal to the "buffer radius at the pixel scale" plus "compensation for half a pixel diagonal". If so, the pixel is considered to belong to the buffer.

[0079] In this embodiment, the central formula is calculated as follows: the pixel that best represents the location of the field water quality sampling point P0 is found from the UAV imagery. The mathematical definition of the nearest neighbor pixel is as follows.

[0080]

[0081] The above formula means the following: Traverse each candidate cell P in the buffer S. ij Calculate the distance d between these pixels and the sampling point P0, and then find the pixel that minimizes the distance d. This "pixel that minimizes the distance" is itself the "center pixel" P defined in this embodiment. c .

[0082] After determining the pixel that minimizes the distance, the key lies in calculating the distance d. This embodiment uses pixel coordinate distance:

[0083]

[0084] Where, d pixel (P ijP(0) represents the specific implementation of the distance function d, and the subscript pixel indicates that the distance is calculated in pixel coordinates; i, j represent candidate pixels P ij The coordinates in the image; i0, j0 represent the pixel coordinates of the sampling point P0 in the image.

[0085] This embodiment employs a multi-pixel matching strategy, effectively smoothing out positioning errors (such as pixel shifts caused by GPS errors) and local noise (such as water surface ripples and floating objects) through spatial averaging, while preserving sub-meter scale spatial variability information in water quality. The reflectance data of all pixels are matched with the mean values ​​of laboratory water quality parameters at the corresponding locations, forming a high-quality training dataset that provides reliable basic data support for subsequent remote sensing inversion models of water quality parameters. This method, through a rigorous mathematical framework (including buffer geometry conditions, nearest neighbor search, and probability sampling), ensures the scientific rigor, repeatability, and statistical rationality of the sampling process, significantly improving the accuracy and reliability of water quality remote sensing monitoring.

[0086] Specifically, the mathematical formula for randomly sampling 9 pixels in this embodiment has the following sampling method, distribution form, and constraints:

[0087] (1) Uniformly distributed random sampling

[0088] Let the set of valid cells in the buffer be S = {P1, P2, ..., P}. N}, where N = |S|. Nine pixels are randomly sampled without replacement:

[0089]

[0090] Formula meaning: Remove P from S c Then, nine unique pixels are randomly selected uniformly. This sampling method ensures that each eligible pixel has an equal chance of being selected. Sampling without replacement avoids repeatedly selecting the same pixel. It also increases the spatial representativeness of the sample and reduces bias caused by local anomalies (such as water ripples or floating objects). S = {P1, P2, ..., P} N} represents the set of all valid pixels within a buffer zone with a radius of 35 cm centered at the sampling point, where N = |S| is the total number of pixels in the set. Pᴄ is the previously determined center pixel closest to the sampling point. c} indicates that the central cell is removed from set S, thus forming a set of candidate cells for random selection. This represents 9 pixels that will be randomly selected, with indices r1 to r9 indicating the random order. The ~ symbol is read as "follows a distribution of...". Uniform(S\{P c}, 9, replace=False) then fully defines the uniform distribution rule followed by the sampling: it is based on S\{P c} represents the population, and 9 pixels are drawn independently and with equal probability without replacement (replace=False).

[0091] (2) Probability distribution form

[0092]

[0093] This formula describes the probability of each pixel being selected under uniform random sampling. Wherein, P represents a probability function; k ∈{P r1 , ..., P r9} represents pixel P k It is contained within the 9 selected pixels; This represents the probability of each pixel being selected. The numerator is the number of pixels extracted (9), and the denominator is the total number of candidate pixels (N-1, because Pc is excluded).

[0094] This probability formula shows that under a uniform sampling strategy, each cell that meets the conditions has an equal chance of being selected, which is the mathematical basis for ensuring unbiased sampling.

[0095] (3) Spatial distribution uniformity constraint

[0096]

[0097] This embodiment takes This formula defines the minimum distance constraint between selected pixels to ensure they are spatially uniformly distributed. Where, min1 ≤ m <n≤9d(P rm P rn ) represents all selected pixel pairs (P rm ,P rn Find the minimum distance in d(P). rm P rn ) represents pixel P rm and P rn The Euclidean distance between them; δ represents the minimum distance threshold, and in this implementation, δ = 3R ≈ 0.117m (i.e., one-third of the buffer radius).

[0098] This constraint prevents the selected pixels from becoming overcrowded in space, forcing them to be dispersed throughout the buffer zone, thus better representing the spatial distribution characteristics of water quality.

[0099] S4. Based on the training dataset, obtain the band features that are most strongly correlated with the target water quality parameters.

[0100] In remote sensing water quality inversion, band selection is a crucial prerequisite for constructing a high-precision inversion model. Due to the complex optical properties of water bodies, different water quality parameters exhibit significant differences in their spectral responses to specific wavelengths. Redundant band information provided by multispectral or hyperspectral sensors may introduce noise, increase model complexity, and reduce generalization ability. Therefore, a scientific band selection strategy is needed to identify the spectral intervals most sensitive to the target water quality parameter. Correlation analysis, as a classic and efficient initial feature screening method, can quantitatively assess the statistical correlation strength between the reflectance of each band (or its transformed forms, such as band ratios, normalization indices, etc.) and the measured water quality concentration. By calculating the Pearson correlation coefficient, sensitive bands with strong positive / negative correlations to the target parameter are identified, while weakly correlated or irrelevant bands are excluded. For the reflectance ρ of the b-th band... b The correlation coefficient between the water quality parameter C and the water quality parameter C is calculated as follows:

[0101]

[0102] Where, r w ρ represents the Pearson correlation coefficient between the w-th band and the water quality parameter, with a value range of [−1, 1]; n represents the sample size; ρ w,u This represents the reflectance of the w-th sample in the u-th band; C represents the sample mean of the reflectance of the w-th band; u This represents the measured water concentration of the u-th sample; This represents the sample mean of water quality concentration.

[0103] This method not only helps to reveal the potential spectral indication characteristics of water quality parameters, but also provides concise and highly informative input variables for subsequent machine learning or physical models, thereby improving the stability, interpretability, and computational efficiency of the inversion model.

[0104] After correlation coefficient calculation, the four bands selected in this embodiment are as follows:

[0105]

[0106] In the formula, ρ1 represents the reflectance at 450nm±15nm (blue band); ρ2 represents the reflectance at 555nm±13.5nm (green band); ρ3 represents the reflectance at 660nm±11nm (red band); ρ4 represents the reflectance at 720nm±5nm (red edge band); and ρ5 represents the reflectance at 840nm±15nm (near-infrared band).

[0107] S5. Based on the band characteristics and training dataset, construct a water quality parameter inversion model, and complete water quality parameter monitoring based on the model.

[0108] A remote sensing inversion model for water quality parameters is constructed using the Extreme Gradient Boosting (XGBoost) algorithm combined with Bayesian optimization. This method combines an efficient ensemble learning framework with an intelligent hyperparameter search strategy, aiming to fully utilize the nonlinear information characteristics of multispectral remote sensing data to achieve high-precision inversion of key water quality parameters such as COD and ammonia nitrogen. XGBoost effectively captures the complex nonlinear relationship between water quality parameters and spectral reflectance by integrating multiple weak learners (decision trees) and employing a gradient boosting strategy. Bayesian optimization, on the other hand, constructs a probabilistic surrogate model of the objective function, intelligently searching for the optimal hyperparameter combination of XGBoost with the goal of minimizing validation loss, thus avoiding the inefficiencies of traditional grid search and random search. As an improved algorithm based on Gradient Boosting Decision Tree (GBDT), XGBoost has significant advantages in water quality inversion tasks. The objective function is as follows:

[0109]

[0110] in, It is a loss function that measures the predicted value. Compared with the true value y i To account for the differences, this embodiment uses the mean square error:

[0111]

[0112] Ω(f k The ) term is a regularization term that controls model complexity and prevents overfitting.

[0113]

[0114] In the formula, T is the number of leaf nodes in the tree; w is the weight of the leaf node; γ and λ are regularization coefficients.

[0115] Bayesian optimization is employed for efficient search and tuning of hyperparameters in the XGBoost model. Compared to traditional grid search or random search, Bayesian optimization constructs a surrogate model (such as a Gaussian process) to probabilistically model the objective function (such as the mean squared error under cross-validation) and intelligently balances exploration and utilization based on the acquisition function (such as the desired improvement in EI), rapidly approximating the globally optimal hyperparameter combination within a limited number of iterations. The formula is as follows:

[0116]

[0117] In the formula, θ∗ This represents the optimal hyperparameter vector, which is the ultimate goal of the algorithm's search. In water quality inversion modeling, this represents the set of parameter settings that make the XGBoost model perform best on the validation set, including the learning rate, tree depth, and feature sampling ratio.

[0118] `argmin` is a mathematical operator that finds the parameters that minimize the function. Unlike a simple "minimum," it returns "what the input is when the minimum is reached." `θ` is a hyperparameter vector representing the set of all adjustable model parameters. In the XGBoost water quality inversion model, `θ = (η, dmax, subsample, ...)` specifically includes: `η` (learning rate, controlling the contribution weight of each tree to the final model; a smaller value results in robust training but requires more trees), `dmax` (maximum tree depth, controlling the complexity of a single decision tree; greater depth leads to stronger fitting but also increases the risk of overfitting), and `subsample` (row sampling ratio, the proportion of training samples randomly used by each tree, used to enhance model diversity and prevent overfitting), etc. `Θ` represents the hyperparameter search space, which is the set of all possible values ​​for `θ`. In Bayesian optimization settings, this is typically a multi-dimensional "box" with upper and lower bounds for each dimension; for example, `η` is between [0.01, 0.3], and `dmax` is an integer from 3, 4, ..., 10. The algorithm performs intelligent search within this predefined space. Lval(θ) is the validation set loss function, which measures the prediction error on an independent validation dataset after the model has been trained with specific hyperparameters θ. In your water quality inversion task, this is typically the root mean square error (RMSE) or mean absolute error (MAE), used to evaluate the deviation between the model's predicted values ​​for water quality parameters such as COD and ammonia nitrogen and the laboratory measured values. The smaller this value, the better the model's generalization performance under that set of hyperparameters.

[0119] Finally, the constructed model was used to monitor the water quality (chemical oxygen demand) of rivers and lakes.

[0120] Example 2

[0121] To verify the superiority of the present invention over the prior art, this embodiment is provided for comparison.

[0122] In the study of COD inversion, a non-optically active water quality parameter of rivers, using UAV multispectral remote sensing, the coefficient of determination (R) is introduced. 2 The inversion accuracy of different models is evaluated using two metrics: (1) and (2) mean square error (RMSE). The calculation method is shown in the following formula:

[0123]

[0124] Where p represents one of the ground-based water quality monitoring points, n is the total number of samples, and x z This is the zth ground-based measured water quality monitoring data. This is the z-th water quality monitoring data obtained based on the inversion model. The average value is the result of 11 ground-based measured water quality monitoring data. Support vector regression and random forest were also introduced to compare the model performance, and the results are shown in Table 1.

[0125] Table 1

[0126] .

[0127] A systematic evaluation of the performance of three machine learning models—Support Vector Regression (SVR), Random Forest (RF), and XGBoost—in the water quality parameter inversion task was conducted. The results show that the XGBoost model exhibits significant advantages in both accuracy and stability. Specific performance indicators are shown in Table 1. Among them, XGBoost achieved a determination coefficient (R²) of 0.95 and reduced the root mean square error (RMSE) to 1.003, both of which are significantly better than the other comparative models.

[0128] Example 3

[0129] This embodiment also provides a monitoring system for urban river and lake water quality, including: a data acquisition module, a preprocessing module, a first acquisition module, a second acquisition module, and a monitoring module; the data acquisition module is used to acquire UAV multispectral data and ground-based synchronous water quality sampling data; the preprocessing module is used to acquire preprocessed surface reflectance data based on the UAV multispectral data; the first acquisition module is used to acquire a matched training dataset based on the geographical location and surface reflectance data of the ground-based synchronous water quality sampling data; the second acquisition module is used to acquire the band features most strongly correlated with the target water quality parameters based on the training dataset; the monitoring module is used to construct a water quality parameter inversion model based on the band features and the training dataset, and complete water quality parameter monitoring based on the model.

[0130] The embodiments described above are merely preferred embodiments of the present invention and are not intended to limit the scope of the present invention. Various modifications and improvements made to the technical solutions of the present invention by those skilled in the art without departing from the spirit of the present invention should fall within the protection scope defined by the claims of the present invention.

Claims

1. A method for monitoring water quality in urban rivers and lakes, characterized in that, The method includes the following steps: S1. Collect multispectral data from UAVs and synchronous ground-based water quality sampling data; S2. Based on the UAV multispectral data, obtain the preprocessed surface reflectance data; S3. Based on the geographical location of the ground synchronous water quality sampling data and the surface reflectance data, obtain the matched training dataset; S4. Based on the training dataset, obtain the band features that are most strongly correlated with the target water quality parameters; S5. Based on the band characteristics and the training dataset, construct a water quality parameter inversion model, and complete water quality parameter monitoring based on the model.

2. The method for monitoring water quality in urban rivers and lakes according to claim 1, characterized in that, S1 includes: Acquire multispectral data collected by a drone equipped with a multispectral camera in the experimental area; Simultaneously, ground water quality sampling data is acquired in sync with UAV aerial surveys. This ground water quality sampling data includes the geographical coordinates of the sampling points and the concentration of target water quality parameters obtained from laboratory analysis.

3. The method for monitoring water quality in urban rivers and lakes according to claim 2, characterized in that, S3 includes: Based on the geographical coordinates of the sampling points, the corresponding sampling buffer is determined from the surface reflectance data; Within the sampling buffer, a central pixel and several randomly distributed pixels are selected to obtain the spectral reflectance data of the central pixel and the multiple randomly distributed pixels. The multispectral reflectance data of the central pixel and randomly distributed pixels are matched with the average concentration of the target water quality parameters obtained from laboratory analysis of the corresponding sampling points to form a training dataset.

4. The method for monitoring water quality in urban rivers and lakes according to claim 3, characterized in that, The steps for selecting the center pixel and several randomly distributed pixels within the sampling buffer include: The pixel closest to the geographical coordinates of the sampling point is determined as the center pixel; After excluding the center pixel from all valid pixels in the sampling buffer, a predetermined number of pixels are extracted as randomly distributed pixels using a uniform random sampling method without replacement.

5. The method for monitoring water quality in urban rivers and lakes according to claim 1, characterized in that, S4 includes: Calculate the Pearson correlation coefficient between reflectance in each band and the concentration of the target water quality parameter; Based on the Pearson correlation coefficient, a predetermined number of bands with the largest absolute values ​​of the correlation coefficients are selected as band features.

6. The method for monitoring water quality in urban rivers and lakes according to claim 1, characterized in that, S5 includes: The extreme gradient boosting algorithm is used as the basic model, and the hyperparameters of the extreme gradient boosting algorithm model are searched and optimized using the Bayesian optimization method to obtain the optimal combination of hyperparameters. Using the extreme gradient boosting algorithm model with the optimal hyperparameter combination, a water quality parameter inversion model is constructed by training based on band features and training dataset.

7. The method for monitoring water quality in urban rivers and lakes according to claim 6, characterized in that, The Bayesian optimization method aims to minimize the prediction loss of the extreme gradient boosting algorithm model on the validation set by iteratively searching within a predefined hyperparameter search space to determine the optimal hyperparameter combination.

8. A monitoring system for water quality in urban rivers and lakes, the system being used to implement the method described in any one of claims 1-7, characterized in that, include: The system comprises a data acquisition module, a preprocessing module, a first acquisition module, a second acquisition module, and a monitoring module. The acquisition module is used to acquire multispectral data from the UAV and synchronous ground water quality sampling data. The preprocessing module is used to obtain preprocessed surface reflectance data based on the UAV multispectral data; The first acquisition module is used to acquire a matched training dataset based on the geographical location of the ground synchronous water quality sampling data and the surface reflectance data; The second acquisition module is used to acquire the band features that are most strongly correlated with the target water quality parameters based on the training dataset; The monitoring module is used to construct a water quality parameter inversion model based on the band characteristics and the training dataset, and to complete water quality parameter monitoring based on the model.