Remote sensing water quality monitoring method combining genetic optimization and extreme gradient boosting
By combining genetic optimization and extreme gradient improvement, the remote sensing water quality monitoring method is used to use drone multispectral imaging and machine learning algorithms to solve the time, spatial resolution and cost-effectiveness problems of water quality monitoring in small and medium-sized rivers in cities, and dynamic and refined water quality monitoring is achieved.
Patent Information
- Application Number
- CN202210342843.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-31
- Publication Date
- 2025-04-15
- Estimated Expiration
- 2042-03-31
AI Technical Summary
Existing water quality monitoring methods are difficult to meet the water quality monitoring needs of small and medium-sized urban rivers, especially in terms of time, spatial resolution and cost-effectiveness.
Using a remote sensing water quality monitoring method combining genetic optimization and extreme gradient improvement, a water quality parameter inversion model is constructed, and a drone multispectral imaging and machine learning algorithm are used to achieve dynamic and refined monitoring of urban river water quality.
This method can effectively overcome the timeliness, accuracy and cost problems of the prior art, provide more overall and more refined water quality monitoring data, and meet the needs of urban river water quality monitoring.
Smart Images

Figure CN114782740B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of water quality monitoring, and in particular to a remote sensing water quality monitoring method combining genetic optimization with extreme gradient enhancement. Background Art
[0002] Cities and rivers are closely related. As the most critical ecological carrier of cities, rivers always affect and restrict the survival and development of cities. Urban rivers are the main ecological corridors of urban ecosystems. They play the role of developing agricultural irrigation, supplying water sources, connecting water transportation and ecological balance, improving the quality of human life and the image of cities, and providing irreplaceable ecological functions. In recent years, due to the large-scale expansion of cities and the acceleration of industrialization, urban rivers have gradually transformed into developing river basins and semi-enclosed waters. The waterfront space on both sides has been compressed and has become a lifeless artificial channelized river. With the enhancement of people's awareness of ecological environment protection, urban river water quality monitoring has received widespread attention. The rational development, utilization and protection of water resources are important aspects of ecological environment protection and urban sustainable development. How to continuously and dynamically monitor the water quality of urban rivers is of great significance to protecting the ecological environment and water resources in the urban circle area.
[0003] At present, the means of water quality monitoring are mainly single-point monitoring, relying on manual field sampling combined with laboratory chemical analysis, including manual field sampling and automatic monitoring stations. This method can accurately detect the water quality parameter information of the sampling point, and has the advantages of high monitoring accuracy and strong research pertinence. This type of method is often used for water quality investigation and assessment. However, these methods are greatly affected by prior knowledge, are costly, lack timeliness, and cannot reflect the overall water quality status of the region, making it difficult to meet the needs of a modern urban river monitoring system.
[0004] With the rapid development of remote sensing technology, remote sensing water quality inversion has become one of the research hotspots in the field of water quality monitoring and remote sensing technology, due to its wide-area and timeliness characteristics. On the premise of deeply exploring the complementarity and correlation between remote sensing image data and water quality parameters. Remote sensing water quality inversion provides a more global and refined layout for water quality monitoring. However, urban rivers are often narrow and long, and general remote sensing data sources are difficult to meet their monitoring needs, which brings challenges to the use of remote sensing methods for urban river water quality monitoring. With the development of drone technology, drones equipped with different types of sensors can obtain rich remote sensing image data, and are increasingly used for ecological monitoring. It also has a good application prospect in water quality monitoring and has become a new direction for water quality remote sensing research. With its flexible, fast and efficient operation characteristics, drone remote sensing can ensure the possibility of continuous and dynamic monitoring and capture more details of the water body; the most important point is that the drone remote sensing image acquisition process is not affected by clouds, which is the main limitation of satellite remote sensing. In areas with complex water components and narrow waters, such as urban rivers, UAV remote sensing data combined with a small amount of measured water quality data from sample points can obtain rich and comprehensive water quality conditions and spatial distribution, solving the dual problems of time and spatial resolution in urban river monitoring, and providing an effective reference for urban river water quality monitoring.
[0005] Existing monitoring methods are difficult to meet the water quality monitoring needs of small and medium-sized rivers in cities. How to continuously and dynamically monitor the water quality of urban rivers has become a current research hotspot and a practical difficulty in production. Summary of the invention
[0006] The present invention provides a remote sensing water quality monitoring method combining genetic optimization and extreme gradient enhancement, which can overcome certain or some defects of the prior art.
[0007] A remote sensing water quality monitoring method combining genetic optimization and extreme gradient boosting according to the present invention comprises the following steps:
[0008] First, construct the feature engineering of water quality parameter inversion model input and study the nonlinear relationship between water quality parameter values and spectral characteristics;
[0009] Second, using genetic algorithm as the optimization algorithm and extreme gradient boosting algorithm as the basic regression algorithm, an extreme gradient boosting algorithm based on genetic algorithm optimization is constructed. Taking advantage of the characteristics of genetic algorithm in searching for the global optimal solution, some built-in parameters of the extreme gradient boosting algorithm are globally optimized to construct a water quality parameter inversion model.
[0010] 3. Based on the constructed optimal water quality parameter inversion model, the inversion results of chlorophyll a, total phosphorus, total nitrogen, ammonia nitrogen and turbidity in the river section are obtained, so as to further study the spatial distribution characteristics, spatiotemporal changes and influencing factors of water quality parameters in the river section.
[0011] Preferably, feature engineering includes band combination and sensitive band analysis and feature optimization modules; band combination and sensitive band analysis are used to reduce noise interference, extract effective spectral information, and further screen out features with high model importance as input features through the feature optimization module; the input features are divided into training set, validation set and test set to train the model and verify the accuracy of the model.
[0012] As a preferred embodiment, the extreme gradient boosting algorithm is an integrated algorithm based on the gradient boosting tree. The gradient boosting tree modeling process is as follows: first, a tree is established, and then it is iterated step by step, a tree is added in each iteration, and a powerful estimator that integrates many tree models is gradually formed; the prediction value in the gradient boosting regression tree is the weighted sum of the prediction results on all weak classifiers. For the extreme gradient boosting algorithm, each leaf node will have a prediction score, also called leaf weight. The leaf weight is the regression value of all samples on this leaf node in this tree. The sum of the leaf weights on all weak classifiers is the prediction value.
[0013] As a preferred method, the objective function of the extreme gradient boosting algorithm is: traditional loss function + model complexity, that is:
[0014]
[0015] Where i represents the i-th sample in the dataset, n represents the total amount of data imported into the k-th tree, and k represents all the trees established; the first term represents the loss function of the model, which is used to measure the true label y i With the predicted value The difference between them; the second term represents the regular term of the model; the extreme gradient boosting algorithm minimizes obj to obtain the optimal value in the process of iterating each tree.
[0016] Iteration t:
[0017]
[0018]
[0019] Taylor expansion:
[0020]
[0021]
[0022] where f t (x i ) represents x i The tree constructed at iteration t, g i and h iThey are the first-order derivative and second-order derivative of the loss function. The regularization term includes the L2 regularization of the number of leaf nodes and the weight of the leaf nodes, which can smooth the learning weight of each leaf node to avoid overfitting.
[0023]
[0024] Where γ and λ represent the regularization coefficients, T represents the number of leaf nodes, and w tm Represents the value of the mth leaf node of the weak learner at the tth iteration.
[0025] As a preferred embodiment, the specific steps of the genetic algorithm are as follows:
[0026] 1) Find a coding scheme for the potential solution to the problem;
[0027] 2) Randomly initialize the population;
[0028] 3) Calculate the fitness of each individual through the fitness function;
[0029] 4) Selective elimination through selection function;
[0030] 5) The parent chromosomes cross over to generate offspring;
[0031] 6) Mutate the chromosomes of offspring to increase genetic diversity;
[0032] 7) The new generation of population continues to calculate fitness, and the cycle repeats until the optimal solution is produced.
[0033] The present invention combines UAV multispectral images with machine learning algorithms, providing a reliable basis for further promoting the intelligence and automation level of urban water environment monitoring technology, which is conducive to promoting efficient and high-quality water quality monitoring and protection of urban rivers. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] Figure 1 A flow chart of a remote sensing water quality monitoring method combining genetic optimization and extreme gradient improvement in Example 1;
[0035] Figure 2 These are the inversion results of chlorophyll a, total phosphorus, total nitrogen, ammonia nitrogen and turbidity in a typical section of the Nanfei River in Anhui Province in Example 1. DETAILED DESCRIPTION
[0036] In order to further understand the content of the present invention, the present invention is described in detail in conjunction with the accompanying drawings and embodiments. It should be understood that the embodiments are only for explaining the present invention and are not intended to limit it.
[0037] Example 1
[0038] like Figure 1As shown, this embodiment provides a remote sensing water quality monitoring method combining genetic optimization and extreme gradient improvement, which includes the following steps:
[0039] First, construct the feature engineering of water quality parameter inversion model input and study the nonlinear relationship between water quality parameter values and spectral characteristics;
[0040] Second, using genetic algorithm as the optimization algorithm and extreme gradient boosting algorithm as the basic regression algorithm, an extreme gradient boosting algorithm based on genetic algorithm optimization is constructed. Taking advantage of the characteristics of genetic algorithm in searching for the global optimal solution, some built-in parameters of the extreme gradient boosting algorithm are globally optimized, thereby constructing a water quality parameter inversion model with high accuracy and strong generalization.
[0041] 3. Based on the constructed optimal water quality parameter inversion model, the inversion results of chlorophyll a, total phosphorus, total nitrogen, ammonia nitrogen and turbidity in the river section are obtained, so as to further study the spatial distribution characteristics, spatiotemporal changes and influencing factors of water quality parameters in the river section.
[0042] Feature engineering includes band combination, sensitive band analysis and feature optimization modules; band combination and sensitive band analysis are used to reduce noise interference, extract effective spectral information, and further screen out features with high model importance as input features through the feature optimization module; the input features are divided into training set, validation set and test set to train the model and verify the accuracy of the model.
[0043] The extreme gradient boosting algorithm (eXtreme Gradient Boosting, XGBoost) has many adjustable parameters. The selection of parameters directly affects the accuracy and speed of the model. Reasonable parameter settings can significantly improve the performance of the model. Therefore, this embodiment is based on XGBoost and uses the characteristics of genetic algorithm (Genetic Algorithm, GA) to search for the global optimal solution to construct an extreme gradient boosting algorithm (GA_XGBoost) based on genetic algorithm optimization.
[0044] First, the GA_XGBoost algorithm needs to select the fitness function and the optimized parameters according to the problem to be solved; secondly, create an initial population containing the optimized parameters, set the population size, the number of individuals retained in each generation, and the parameter optimization range; finally, use the defined fitness function to find the optimal fitness value and optimized parameters under the constraints of "survival of the fittest".
[0045] The extreme gradient boosting algorithm is an ensemble algorithm based on the gradient boosting tree. Compared with the traditional gradient boosting algorithm, XGBoost has made many improvements. It can be faster than other ensemble algorithms using gradient boosting, and has been considered to be an advanced estimator with super high performance in both classification and regression. The XGBoost structure can have regression trees or classification trees, both of which use the CART algorithm as the mainstream tree structure. The gradient boosting regression tree is a comprehensive model built on the basis of the regression tree model.
[0046] The model learning process of XGBoost is as follows: (1) First, fit the first weak learner to the entire input data space; (2) Then fit the second model to these residuals to overcome the shortcomings of the weak learner; (3) Repeat the fitting process several times until the stopping criterion is met; (4) The final prediction of the model is obtained by summing the predictions of each learner.
[0047] XGBoost is an algorithm that achieves a balance between model performance and computing speed. Compared with other machine learning algorithms, XGBoost measures the computing efficiency of the algorithm by introducing model complexity. Therefore, the objective function of XGBoost is: traditional loss function + model complexity, that is:
[0048]
[0049] Where i represents the i-th sample in the dataset, n represents the total amount of data imported into the k-th tree, and k represents all the trees established; the first term represents the loss function of the model, which is used to measure the true label y i With the predicted value The second term represents the regularization term of the model; the extreme gradient boosting algorithm minimizes obj to obtain the optimal value in the process of iterating each tree. At the same time, the error rate and complexity of the model are minimized;
[0050] Iteration t:
[0051]
[0052]
[0053] Taylor expansion:
[0054]
[0055]
[0056] where f t (x i ) represents x i The tree constructed at iteration t, g iand h i They are the first-order derivative and second-order derivative of the loss function. The regularization term includes the L2 regularization of the number of leaf nodes and the weight of the leaf nodes, which can smooth the learning weight of each leaf node to avoid overfitting.
[0057]
[0058] Where γ and λ represent the regularization coefficients, T represents the number of leaf nodes, and w tm Represents the value of the mth leaf node of the weak learner at the tth iteration.
[0059] The XGBoost algorithm limits the complexity of the model by introducing regularization terms. In XGBoost, the number of leaf nodes of each tree is penalized, thereby limiting the growth of leaf nodes, making each tree "weak", while reducing the influence of each tree and increasing the number of trees, so that the model achieves a better fitting effect.
[0060] Genetic algorithm is a random global search and optimization method developed by imitating the biological evolution mechanism. It takes all individuals in the population as the object, randomly searches the encoded parameter space efficiently, and through simulating the biological evolution process, the individuals in the population continuously select, cross, and mutate, so as to adaptively search for the global optimal solution. The specific steps of genetic algorithm are as follows:
[0061] 1) Find a coding scheme for the potential solution to the problem;
[0062] 2) Randomly initialize the population;
[0063] 3) Calculate the fitness of each individual through the fitness function;
[0064] 4) Selective elimination through selection function;
[0065] 5) The parent chromosomes cross over to generate offspring;
[0066] 6) Mutate the chromosomes of offspring to increase genetic diversity;
[0067] 7) The new generation of population continues to calculate fitness, and the cycle repeats until the optimal solution is produced.
[0068] This embodiment is based on multi-period UAV multispectral data and field measured water quality parameter data, and constructs a UAV remote sensing urban river water quality intelligent monitoring method based on machine learning methods, in order to propose an intelligent monitoring method that supports polymorphic learning and spectral feature analysis of urban rivers in terms of remote sensing intelligent interpretation.
[0069] like Figure 2As shown in the figure, the inversion results of chlorophyll a, total phosphorus, total nitrogen, ammonia nitrogen and turbidity in a typical section of the Nanfei River in Anhui Province are obtained. Based on the inversion results of chlorophyll a, total phosphorus, total nitrogen, ammonia nitrogen and turbidity, the spatial distribution characteristics of water quality are analyzed, and it is found that the spatial distribution law of water pollution obtained by the water quality inversion model shows the same trend as the measured results.
[0070] The present invention and its embodiments are described schematically above, and the description is not restrictive. The drawings show only one embodiment of the present invention, and the actual structure is not limited thereto. Therefore, if a person skilled in the art is inspired by it and designs a structural method and an embodiment similar to the technical solution without creativity without departing from the purpose of the invention, they shall all fall within the protection scope of the present invention.
Claims
1. A remote sensing water quality monitoring method combining genetic optimization and extreme gradient boosting, characterized by: The following steps are involved: First, construct the feature engineering of water quality parameter inversion model input and study the nonlinear relationship between water quality parameter values and spectral characteristics; Second, using genetic algorithm as the optimization algorithm and extreme gradient boosting algorithm as the basic regression algorithm, an extreme gradient boosting algorithm based on genetic algorithm optimization is constructed. Taking advantage of the characteristics of genetic algorithm in searching for the global optimal solution, some built-in parameters of the extreme gradient boosting algorithm are globally optimized to construct a water quality parameter inversion model. The objective function of the extreme gradient boosting algorithm is: traditional loss function + model complexity, that is: Where i represents the i-th sample in the dataset, n represents the total amount of data imported into the k-th tree, and k represents all the trees established; the first term represents the loss function of the model, which is used to measure the true label y i With the predicted value The difference between them; the second term represents the regular term of the model; the extreme gradient boosting algorithm minimizes obj to obtain the optimal value in the process of iterating each tree. Iteration t: Taylor expansion: where f t (x i ) represents x i The tree constructed at iteration t, g i and h i They are the first-order derivative and second-order derivative of the loss function. The regularization term includes the L2 regularization of the number of leaf nodes and the weight of the leaf nodes, which can smooth the learning weight of each leaf node to avoid overfitting. Where γ and λ represent the regularization coefficients, T represents the number of leaf nodes, and w tm Represents the value of the mth leaf node of the weak learner at the tth iteration; 3. Based on the constructed optimal water quality parameter inversion model, the inversion results of chlorophyll a, total phosphorus, total nitrogen, ammonia nitrogen and turbidity in the river section are obtained, so as to further study the spatial distribution characteristics, spatiotemporal changes and influencing factors of water quality parameters in the river section.
2. The remote sensing water quality monitoring method combining genetic optimization and extreme gradient improvement according to claim 1 is characterized in that: Feature engineering includes band combination, sensitive band analysis and feature optimization modules; band combination and sensitive band analysis are used to reduce noise interference, extract effective spectral information, and further screen out features with high model importance as input features through the feature optimization module; the input features are divided into training set, validation set and test set to train the model and verify the accuracy of the model.
3. The remote sensing water quality monitoring method combining genetic optimization and extreme gradient improvement according to claim 1 is characterized in that: The extreme gradient boosting algorithm is an integrated algorithm based on the gradient boosting tree. The gradient boosting tree modeling process is as follows: first build a tree, then iterate step by step, add a tree in each iteration, and gradually form a powerful estimator that integrates many tree models; the prediction value in the gradient boosting regression tree is the weighted sum of the prediction results on all weak classifiers. For the extreme gradient boosting algorithm, each leaf node will have a prediction score, also called leaf weight. The leaf weight is the regression value of all samples on this leaf node in this tree. The sum of the leaf weights on all weak classifiers is the prediction value.
4. The remote sensing water quality monitoring method combining genetic optimization and extreme gradient improvement according to claim 1 is characterized in that: The specific steps of the genetic algorithm are as follows: 1) Find a coding scheme for the potential solution to the problem; 2) Randomly initialize the population; 3) Calculate the fitness of each individual through the fitness function; 4) Selective elimination through selection function; 5) The parent chromosomes cross over to generate offspring; 6) Mutate the chromosomes of offspring to increase genetic diversity; 7) The new generation of population continues to calculate fitness, and the cycle repeats until the optimal solution is produced.
Citation Information
Patent Citations
Improved DBPSO water quality parameter monitoring method and device
CN107677646A
A river water level prediction method based on chaotic fireflies and a gradient lifting tree model
CN109711636A