River water quality inversion method and system

By clustering and model optimization of hyperspectral data in the river water quality inversion method, the problems of time-consuming and low accuracy in the existing technology are solved, and efficient water quality monitoring and prediction are achieved.

CN119323732AInactive Publication Date: 2025-01-17HUARUI ENVIRONMENTAL PROTECTION TECH SUQIAN CO LTD

Patent Information

Application Number
CN202411490070.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-24
Publication Date
2025-01-17
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The existing river water quality inversion method takes a long time during the training process, and the accuracy is reduced after using optimization methods, so it is impossible to fully tap deep features in big data, resulting in low inversion accuracy.

Method used

A river water quality inversion method is adopted, by obtaining hyperspectral data of the river area, radiation correction and index construction are performed, the correlation between each index and water quality parameters is calculated, clustering and model training is performed, and inversion is performed using the XGBoost model. Optimize the split index selection and stop conditions of the decision tree to improve model efficiency and prediction performance.

Benefits of technology

Through clustering and optimization model training, the complexity and training time of the model are reduced, the inversion accuracy and prediction performance of water quality parameters are improved, overfitting and underfitting are avoided, and efficient water quality monitoring is achieved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119323732A_ABST
    Figure CN119323732A_ABST
Patent Text Reader

Abstract

The invention relates to a river water quality inversion method and system, and specifically, the method comprises the steps: obtaining the hyperspectral data of a river region, carrying out the radiation correction of the hyperspectral data, constructing a plurality of indexes according to the wave band in the hyperspectrum, calculating the correlation between each index and a water quality parameter, and sorting the indexes according to the correlation. Determining an index set corresponding to the water quality parameters based on an index sorting result; clustering the water quality parameters based on the correlation of the water quality parameters and the correlation of the index set of the water quality parameters; in the training process, for each cluster, the importance of indexes is determined according to the correlation between the indexes in the index set of the cluster and water quality parameters in the cluster, the splitting index selection probability during splitting of each tree is determined based on the importance of the indexes, and splitting stop conditions are determined according to the contour coefficient of the cluster; and performing inversion on the new hyperspectral data by using the trained model to obtain water quality parameters.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of environmental protection, and in particular to a river water quality inversion method and system. Background Art

[0002] With the advancement of industrialization and the intensification of urbanization, water pollution is becoming increasingly serious, directly affecting the sustainability of global water resources and the stability of regional ecology. As an important part of water resources, the water quality of rivers is not only related to biodiversity and ecological balance, but also has a profound impact on the production and life of human society. Therefore, accurate and timely river water quality monitoring plays an important role in environmental protection. Traditional water quality monitoring methods mostly rely on manual sampling and laboratory analysis. Although these methods can provide accurate results, the operation process is time-consuming and costly, and it is difficult to achieve real-time monitoring in a wide range of waters. This makes it difficult for existing water quality monitoring methods to meet the increasing demand for environmental protection, and there is an urgent need for efficient and intelligent water quality monitoring and prediction technologies.

[0003] With the development of remote sensing technology and machine learning technology, the inversion of water quality parameters has become an important means to improve the efficiency of water quality monitoring. Among the existing inversion methods, those based on statistical models and traditional machine learning algorithms have limitations in dealing with complex nonlinear problems and cannot fully explore the deep features in big data, resulting in low inversion accuracy. In recent years, XGBoost (eXtreme Gradient Boosting), as an integrated learning algorithm, has gradually become a research hotspot in the field of water quality inversion due to its superior performance in dealing with large-scale data, nonlinear problems and noisy data. However, in the application of water quality inversion, the existing XGBoost model needs to build a model for each water quality parameter, and there are problems such as long training time and reduced accuracy after optimization. Summary of the invention

[0004] In view of the problem that the inversion training process is time-consuming in the prior art of river water quality inversion, the present invention provides a river water quality inversion method, characterized in that the method comprises the following steps: Acquire the hyperspectral data of the river area, perform radiation correction on the hyperspectral data, construct multiple indicators based on the bands in the hyperspectral data, calculate the correlation between each indicator and the water quality parameters, sort the indicators according to the correlation, and determine the indicator set corresponding to the water quality parameters based on the indicator sorting results; cluster the water quality parameters based on the correlation of the water quality parameters and the correlation of the indicator set of the water quality parameters; During the training process, for each cluster, the importance of the indicator is determined according to the correlation between the indicator in the indicator set of the cluster and the water quality parameters in the cluster. The probability of selecting the split indicator when each tree is split is determined based on the importance of the indicator, and the split stopping condition is determined according to the silhouette coefficient of the cluster. The trained model is used to invert the new hyperspectral data to obtain water quality parameters.

[0005] Preferably, the calculation of the correlation between each indicator and the water quality parameter is specifically as follows: Using multiple preset models to fit each indicator and water quality parameter; the multiple preset models are linear model, quadratic polynomial model, cubic polynomial model and exponential model; The minimum value of the root mean square error or the mean absolute percentage error of the multiple preset models is used as the correlation between the indicator and the water quality parameter.

[0006] Preferably, the clustering of water quality parameters based on the correlation of water quality parameters and the correlation of indicator sets of water quality parameters is specifically as follows: Establishing a correlation relationship between two water quality parameters through a linear model, calculating a root mean square error or a mean absolute percentage error of the linear model, and using the root mean square error or the mean absolute percentage error as the correlation of the water quality parameters; Calculating the intersection and union of two water quality parameter indicator sets, and using the ratio of the number of the intersections to the number of the unions as the correlation of the water quality parameter indicator sets; Calculating the distances between water quality parameters through the correlation of water quality parameters and the correlation of the indicator set of water quality parameters; The water quality parameters are clustered according to the distances.

[0007] Preferably, the distance between the water quality parameters is calculated by the correlation of the water quality parameters and the correlation of the indicator set of the water quality parameters, specifically: The correlation of water quality parameters is squared and weighted, and the correlation of the indicator set of water quality parameters is squared after 1 is subtracted and weighted again, and the sum of the two square weights is taken as the distance between water quality parameters.

[0008] Preferably, the importance of the indicator is determined according to the correlation between the indicator in the indicator set of the cluster and the water quality parameter in the cluster, specifically: The union of the indicator sets corresponding to all water quality parameters in the cluster is taken as the indicator set of the cluster; For each indicator in the indicator set of the cluster, if the indicator is in the indicator set corresponding to the water quality parameter in the cluster, the correlation between the indicator and the water quality parameter is accumulated to obtain the importance of the indicator.

[0009] Preferably, the probability of selecting a splitting indicator when each tree is split based on the importance of the indicator is determined as follows: The importance of each indicator in the cluster's indicator set is normalized after taking the inverse, and the normalized value is used as the probability of selecting the split indicator during splitting.

[0010] Preferably, the splitting stop condition is determined according to the silhouette coefficient of the cluster, specifically: Get the preset maximum tree depth, minimum number of samples, and information gain threshold for stopping splitting, and calculate the silhouette coefficient of the cluster; Calculate the product of the silhouette coefficient and the adjustment factor, and use the difference between the maximum depth and the product as the maximum depth when the tree stops splitting; The product of the silhouette coefficient and the minimum number of samples is used as the minimum number of samples when the tree stops splitting; The product of the silhouette coefficient and the information gain threshold is used as the information gain threshold when the tree stops splitting.

[0011] In addition, the present invention also provides a river water quality inversion system, which includes the following modules: The data acquisition module is used to obtain the hyperspectral data of the river area, perform radiation correction on the hyperspectral data, construct multiple indicators based on the bands in the hyperspectral data, calculate the correlation between each indicator and the water quality parameter, sort the indicators according to the correlation, and determine the indicator set corresponding to the water quality parameter based on the indicator sorting result; cluster the water quality parameters based on the correlation of the water quality parameters and the correlation of the indicator set of the water quality parameters; A training module is used to determine the importance of the indicator for each cluster according to the correlation between the indicator in the indicator set of the cluster and the water quality parameter in the cluster during the training process, determine the probability of selecting the split indicator when each tree is split based on the importance of the indicator, and determine the splitting stop condition according to the silhouette coefficient of the cluster; The inversion module is used to invert new hyperspectral data using the trained model to obtain water quality parameters.

[0012] Preferably, the calculation of the correlation between each indicator and the water quality parameter is specifically as follows: Using multiple preset models to fit each indicator and water quality parameter; the multiple preset models are linear model, quadratic polynomial model, cubic polynomial model and exponential model; The minimum value of the root mean square error or the mean absolute percentage error of the multiple preset models is used as the correlation between the indicator and the water quality parameter.

[0013] Preferably, the clustering of water quality parameters based on the correlation of water quality parameters and the correlation of indicator sets of water quality parameters is specifically as follows: Establishing a correlation relationship between two water quality parameters through a linear model, calculating a root mean square error or a mean absolute percentage error of the linear model, and using the root mean square error or the mean absolute percentage error as the correlation of the water quality parameters; Calculating the intersection and union of two water quality parameter indicator sets, and using the ratio of the number of the intersections to the number of the unions as the correlation of the water quality parameter indicator sets; Calculating the distances between water quality parameters through the correlation of water quality parameters and the correlation of the indicator set of water quality parameters; The water quality parameters are clustered according to the distances.

[0014] Preferably, the distance between the water quality parameters is calculated by the correlation of the water quality parameters and the correlation of the indicator set of the water quality parameters, specifically: The correlation of water quality parameters is squared and weighted, and the correlation of the indicator set of water quality parameters is squared after 1 is subtracted and weighted again, and the sum of the two square weights is taken as the distance between water quality parameters.

[0015] Preferably, the importance of the indicator is determined according to the correlation between the indicator in the indicator set of the cluster and the water quality parameter in the cluster, specifically: The union of the indicator sets corresponding to all water quality parameters in the cluster is taken as the indicator set of the cluster; For each indicator in the indicator set of the cluster, if the indicator is in the indicator set corresponding to the water quality parameter in the cluster, the correlation between the indicator and the water quality parameter is accumulated to obtain the importance of the indicator.

[0016] Preferably, the probability of selecting a splitting indicator when each tree is split based on the importance of the indicator is determined as follows: The importance of each indicator in the cluster's indicator set is normalized after taking the inverse, and the normalized value is used as the probability of selecting the split indicator during splitting.

[0017] Preferably, the splitting stop condition is determined according to the silhouette coefficient of the cluster, specifically: Get the preset maximum tree depth, minimum number of samples, and information gain threshold for stopping splitting, and calculate the silhouette coefficient of the cluster; Calculate the product of the silhouette coefficient and the adjustment factor, and use the difference between the maximum depth and the product as the maximum depth when the tree stops splitting; The product of the silhouette coefficient and the minimum number of samples is used as the minimum number of samples when the tree stops splitting; The product of the silhouette coefficient and the information gain threshold is used as the information gain threshold when the tree stops splitting.

[0018] Finally, the present invention also provides a computer device, which includes at least a processor and a readable storage medium, wherein a computer program is stored on the readable storage medium, and the computer program implements the method described above when executed by the processor.

[0019] The present invention clusters water quality parameters, classifies similar water quality parameters into one category, and establishes a model for each cluster separately, thereby avoiding the need to establish a model for each water quality parameter. In addition, the decision tree gives priority to those indicators that are more relevant to the water quality parameters when splitting, which can not only improve the efficiency of the model, but also enhance the model's attention to key features, thereby improving the model's predictive performance. For clusters with higher silhouette coefficients, the splitting depth can be limited to avoid overfitting; for clusters with lower silhouette coefficients, more splits can be allowed to avoid underfitting, effectively balancing the complexity and accuracy of the model. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] Figure 1 This is a flow chart of Embodiment 1; Figure 2 It is a clustering diagram; Figure 3 This is a schematic diagram of the XGBoost structure. DETAILED DESCRIPTION

[0021] In this article, relational terms such as first and second, etc. are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "comprise", "include" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the statement "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.

[0022] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0023] Specific embodiment 1, as Figure 1 As shown, the present invention provides a river water quality inversion method, characterized in that the method comprises the following steps: S1, obtaining the hyperspectral data of the river area, performing radiation correction on the hyperspectral data, constructing multiple indicators according to the bands in the hyperspectral data, calculating the correlation between each indicator and the water quality parameter, sorting the indicators according to the correlation, and determining the indicator set corresponding to the water quality parameter based on the indicator sorting result; clustering the water quality parameters based on the correlation of the water quality parameters and the correlation of the indicator set of the water quality parameters; Hyperspectral data refers to detailed information covering different bands of the spectrum obtained through remote sensing technology. In river water quality monitoring, hyperspectral data can reflect the reflectance spectrum of the water body, containing up to hundreds of bands, and can provide rich information, such as suspended matter and dissolved organic matter in the water. In one embodiment, a river is monitored using a hyperspectral imaging device carried by a drone. The hyperspectral imaging device obtains spectral data of multiple bands. In the original hyperspectral data obtained by the drone, the spectral values ​​may be biased due to factors such as sunlight reflection and atmospheric attenuation. Through radiation correction, the observed values ​​are corrected to the true surface reflectance to ensure the accuracy of subsequent water quality parameter calculations.

[0024] Different bands have different sensitivities to different water quality parameters (such as suspended solids, total nitrogen, total phosphorus, etc.), and multiple water quality related indicators are constructed through these bands. These indicators are based on the spectral data itself or a specific combination or ratio. In one embodiment, the indicator is the band itself or calculated based on the band, such as the NIR band, or the Normalized Difference Water Index (NDWI), Enhanced Water Index (EWI), New Water Index (NWI), etc. The indicators calculated based on the band can be obtained from papers or literature related to water quality inversion.

[0025] Each constructed spectral index may have different correlations with different water quality parameters (such as dissolved oxygen, suspended solids concentration, etc.). By calculating the correlation between each index and a specific water quality parameter, these indexes can be sorted to find the index that is most closely related to the water quality parameter. In one embodiment, the correlation is calculated by linear correlation. Among them, the water quality parameter is an indicator that reflects the water quality, such as water transparency, suspended solids index, total nitrogen, total phosphorus, etc. For example, the correlation coefficient between the water quality parameter total nitrogen and NDWI is 0.85, while the correlation coefficient between the water quality parameter total nitrogen and NWI is 0.75. The correlation of NDWI is stronger, and it will be ranked first in the sorting.

[0026] In another optional embodiment, the calculation of the correlation between each indicator and the water quality parameter is specifically as follows: Using multiple preset models to fit each indicator and water quality parameter; the multiple preset models are linear model, quadratic polynomial model, cubic polynomial model and exponential model; The minimum value of the root mean square error or the mean absolute percentage error of the multiple preset models is used as the correlation between the indicator and the water quality parameter.

[0027] Because the relationship between water quality parameters and hyperspectral indicators may not always be linear, multiple models are used for fitting; these models include linear models, quadratic polynomial models, cubic polynomial models, exponential models, etc. Each model can reveal different forms of relationships, such as linear relationships, nonlinear relationships, or exponential relationships. Then, the root mean square error or mean absolute percentage error is used to calculate the errors of different models in the fitting process. The smaller the root mean square error or mean absolute percentage error, the better the fitting effect, which means that the correlation between the two is better.

[0028] According to the above sorting results, the most relevant indicators are selected to construct an indicator set. These indicators will be used as input features for subsequent model training to predict target water quality parameters. This not only reduces the dimension of the features, thereby reducing the amount of calculation, but also retains the features with high correlation, prevents interference from irrelevant features or features with low correlation, and improves accuracy. In one embodiment, indicators are selected by using a threshold method, and the relationship between the correlation and the threshold is compared to determine the selected indicator; in another embodiment, indicators are selected by using a preset number method, wherein the preset number is any integer between 4 and 10, that is, a preset number of indicators are selected from the sorted indicators and put into the indicator set.

[0029] In the past, multiple features were used to output a water quality parameter. If multiple water quality parameters were to be inverted, multiple models needed to be established. In the present invention, water quality parameters are clustered based on the correlation of water quality parameters and the correlation of the indicator set of water quality parameters. If the water quality parameters in this application have a strong correlation and their corresponding indicator sets also have a strong correlation, one model can be used to predict multiple water quality parameters. In one embodiment, K-means or hierarchical clustering methods are used to divide water quality parameters into several clusters.

[0030] In another optional embodiment, the clustering of water quality parameters based on the correlation of water quality parameters and the correlation of indicator sets of water quality parameters is specifically as follows: Establishing a correlation relationship between two water quality parameters through a linear model, calculating a root mean square error or a mean absolute percentage error of the linear model, and using the root mean square error or the mean absolute percentage error as the correlation of the water quality parameters; Calculating the intersection and union of two water quality parameter indicator sets, and using the ratio of the number of the intersections to the number of the unions as the correlation of the water quality parameter indicator sets; Calculating the distances between water quality parameters through the correlation of water quality parameters and the correlation of the indicator set of water quality parameters; The water quality parameters are clustered according to the distances.

[0031] There are also correlations between different water quality parameters. For example, the greater the concentration of suspended particulate matter, generally speaking, the higher the total nitrogen content. For each pair of water quality parameters, a linear model is used to fit the relationship between them, and the correlation is determined by calculating the root mean square error or mean absolute percentage error. If the correlation is small, the two have a good linear correlation and can be predicted simultaneously in one model.

[0032] For each water quality parameter, there may be multiple related spectral indicators. The intersection represents the common indicators in the indicator sets corresponding to the two water quality parameters, and the union represents all the indicators of the two water quality parameters. By calculating the ratio of the intersection to the union, the indicator set correlation of the two water quality parameters can be obtained. The larger the ratio, the more indicators the two water quality parameters share, and there may be a strong correlation between them. The smaller the ratio, the fewer common indicators they have and the weaker the correlation, and the worse the prediction effect will be when they are put in a model. Figure 2 A schematic diagram of a cluster is shown.

[0033] In a specific embodiment, the distance between water quality parameters is calculated by the correlation of water quality parameters and the correlation of the indicator set of water quality parameters, specifically: The correlation of water quality parameters is squared and weighted, and the correlation of the indicator set of water quality parameters is squared after 1 is subtracted and weighted again, and the sum of the two square weights is taken as the distance between water quality parameters.

[0034] Among them, 1 is subtracted from the correlation of the indicator set of water quality parameters, the square is calculated and then weighted. Specifically, 1 is subtracted from the correlation of the indicator set of water quality parameters to obtain a first value, and the first value is squared and then weighted.

[0035] For example, the correlation between suspended particulate matter and total nitrogen is 0.8, and the correlation of the indicator set is 0.5. If we further assume that the first weight is 0.6 and the second weight is 0.4, the distance is 0.356.

[0036] In another specific embodiment, the distance between water quality parameters is calculated by the correlation of water quality parameters and the correlation of the indicator set of water quality parameters, specifically: The distance between water quality parameters was calculated as 1 minus the correlation of the indicator set of the water quality parameter plus the correlation of the water quality parameter.

[0037] It should be noted that the correlation between the indicators and water quality parameters is calculated by the root mean square error or the mean absolute percentage error, and the correlation between the indicators is also calculated by the root mean square error or the mean absolute percentage error. The smaller the value, the greater the correlation; and the correlation of the indicator set of water quality parameters is obtained by calculating the ratio of the intersection and the union. The larger the value, the greater the correlation.

[0038] S2, during the training process, for each cluster, the importance of the indicator is determined according to the correlation between the indicator in the indicator set of the cluster and the water quality parameters in the cluster, the probability of selecting the split indicator when each tree is split is determined based on the importance of the indicator, and the splitting stop condition is determined according to the silhouette coefficient of the cluster; During the training process, since the water quality parameters in the clusters have good correlation, a model is constructed for each cluster. The preferred model is the XGBoost model, such as Figure 3 If there are multiple clusters, each cluster will have a model. Different clusters have different water quality parameters and corresponding indicator sets, so the trained models are also different.

[0039] In addition, the same indicator has different importance in different clusters. For some clusters, its importance is higher, while for other clusters, its importance is lower. In an optional embodiment, the importance of the indicator is determined according to the correlation between the indicator in the indicator set of the cluster and the water quality parameter in the cluster, specifically: The union of the indicator sets corresponding to all water quality parameters in the cluster is taken as the indicator set of the cluster; For each indicator in the indicator set of the cluster, if the indicator is in the indicator set corresponding to the water quality parameter in the cluster, the correlation between the indicator and the water quality parameter is accumulated to obtain the importance of the indicator.

[0040] The spectral indicators associated with all water quality parameters belonging to the same cluster are summarized to form an indicator set of a cluster. For each spectral indicator of the cluster, check whether the indicator is in the indicator set of a certain water quality parameter of the cluster. If so, add up the correlation between the indicator and the water quality parameter to finally get the importance of the indicator. The importance reflects the role of the indicator in predicting multiple water quality parameters. The higher the correlation and the more times it appears, the greater the importance of the indicator.

[0041] In the XGBoost model, many decision trees are constructed. When determining the splitting nodes of each tree, not all features are used. This prevents overfitting on the one hand, and can increase the speed of decision tree construction on the other hand. However, the selection of features used as splitting points is random. For example, if 80% of the features are used, assuming there are 10 features, only 8 of them will be used for splitting. This may lead to too many attempts to split on features with low correlation. The present invention uses a probabilistic method to determine the features selected when the decision tree splits. In the present invention, the features are also the indicators. In one embodiment, the probability of selecting the splitting indicator when each tree is split is determined based on the importance of the indicator, specifically: The importance of each indicator in the cluster's indicator set is normalized after taking the inverse, and the normalized value is used as the probability of selecting the split indicator during splitting.

[0042] The importance of an indicator comes from the correlation, which is calculated by the root mean square error or the mean absolute percentage error of the correlation. The smaller the calculated value is, the greater the correlation is, that is, the smaller the importance value is, the more important it is. In this embodiment, the importance is normalized after taking the inverse, that is, the importance values ​​of all indicators are converted into probability values ​​between 0 and 1, to ensure that each indicator has a certain probability of being selected when splitting.

[0043] In decision tree construction, the stopping condition determines when the growth of the tree stops, which directly affects the complexity and prediction performance of the model. When training a tree, if unlimited growth is allowed, each leaf node may contain a sample, and the model accuracy on the training data is almost 100%. When new data enters, the model cannot be effectively predicted, resulting in poor generalization ability. The silhouette coefficient of the cluster reflects the internal compactness of the cluster. A high silhouette coefficient indicates that the points within the cluster are highly similar. By adjusting the splitting condition of the tree through the silhouette coefficient, the model can stop splitting earlier in a compact cluster and allow more splits in loose or complex clusters, thereby improving the adaptability of the model. In one embodiment, the splitting stop condition is determined according to the silhouette coefficient of the cluster, specifically: Get the preset maximum tree depth, minimum number of samples, and information gain threshold for stopping splitting, and calculate the silhouette coefficient of the cluster; Calculate the product of the silhouette coefficient and the adjustment factor, and use the difference between the maximum depth and the product as the maximum depth when the tree stops splitting; the higher the silhouette coefficient, the more similar the data points in the cluster are. The depth of the tree should be smaller and the splitting should stop earlier to avoid overfitting. Assuming the silhouette coefficient is 0.8, the adjustment factor is 2, and the maximum depth is 10, then calculate the silhouette coefficient multiplied by the adjustment factor to be 1.6, subtract it from the maximum depth, and get the adjusted maximum depth of 8.4, which is rounded down to 8, that is, the maximum depth of the tree is set to 8.

[0044] The product of the silhouette coefficient and the minimum number of samples is used as the minimum number of samples when the tree stops splitting; when the cluster is relatively loose, the silhouette coefficient is smaller, the minimum number of samples obtained is also smaller, and the tree can continue to split.

[0045] The product of the silhouette coefficient and the information gain threshold is used as the information gain threshold when the tree stops splitting. When the silhouette coefficient is high, the data similarity within the cluster is high, and a higher information gain threshold is set to ensure that each split can bring significant gains. When the silhouette coefficient is low, the water quality parameters in the cluster vary greatly. The information gain threshold can be appropriately lowered to allow more splits and improve the fit. In the above process, the silhouette coefficient is always positive. If the silhouette coefficient is negative, it indicates that the clustering is unreasonable and the cluster is deleted directly.

[0046] S3, use the trained model to invert the new hyperspectral data to obtain water quality parameters.

[0047] After the model training is completed, new hyperspectral data can be input into the model, and the decision tree model can be used to predict the corresponding water quality parameters, thereby realizing water quality inversion.

[0048] Specific embodiment 2, the present invention also provides a river water quality inversion system, the system includes the following modules: The data acquisition module is used to obtain the hyperspectral data of the river area, perform radiation correction on the hyperspectral data, construct multiple indicators based on the bands in the hyperspectral data, calculate the correlation between each indicator and the water quality parameter, sort the indicators according to the correlation, and determine the indicator set corresponding to the water quality parameter based on the indicator sorting result; cluster the water quality parameters based on the correlation of the water quality parameters and the correlation of the indicator set of the water quality parameters; A training module is used to determine the importance of the indicator for each cluster according to the correlation between the indicator in the indicator set of the cluster and the water quality parameter in the cluster during the training process, determine the probability of selecting the split indicator when each tree is split based on the importance of the indicator, and determine the splitting stop condition according to the silhouette coefficient of the cluster; The inversion module is used to invert new hyperspectral data using the trained model to obtain water quality parameters.

[0049] Preferably, the calculation of the correlation between each indicator and the water quality parameter is specifically as follows: Using multiple preset models to fit each indicator and water quality parameter; the multiple preset models are linear model, quadratic polynomial model, cubic polynomial model and exponential model; The minimum value of the root mean square error or the mean absolute percentage error of the multiple preset models is used as the correlation between the indicator and the water quality parameter.

[0050] Preferably, the clustering of water quality parameters based on the correlation of water quality parameters and the correlation of indicator sets of water quality parameters is specifically as follows: Establishing a correlation relationship between two water quality parameters through a linear model, calculating a root mean square error or a mean absolute percentage error of the linear model, and using the root mean square error or the mean absolute percentage error as the correlation of the water quality parameters; Calculating the intersection and union of two water quality parameter indicator sets, and using the ratio of the number of the intersections to the number of the unions as the correlation of the water quality parameter indicator sets; Calculating the distances between water quality parameters through the correlation of water quality parameters and the correlation of the indicator set of water quality parameters; The water quality parameters are clustered according to the distances.

[0051] Preferably, the distance between the water quality parameters is calculated by the correlation of the water quality parameters and the correlation of the indicator set of the water quality parameters, specifically: The correlation of water quality parameters is squared and weighted, and the correlation of the indicator set of water quality parameters is squared after 1 is subtracted and weighted again, and the sum of the two square weights is taken as the distance between water quality parameters.

[0052] Preferably, the importance of the indicator is determined according to the correlation between the indicator in the indicator set of the cluster and the water quality parameter in the cluster, specifically: The union of the indicator sets corresponding to all water quality parameters in the cluster is taken as the indicator set of the cluster; For each indicator in the indicator set of the cluster, if the indicator is in the indicator set corresponding to the water quality parameter in the cluster, the correlation between the indicator and the water quality parameter is accumulated to obtain the importance of the indicator.

[0053] Preferably, the probability of selecting a splitting indicator when each tree is split based on the importance of the indicator is determined as follows: The importance of each indicator in the cluster's indicator set is normalized after taking the inverse, and the normalized value is used as the probability of selecting the split indicator during splitting.

[0054] Preferably, the splitting stop condition is determined according to the silhouette coefficient of the cluster, specifically: Get the preset maximum tree depth, minimum number of samples, and information gain threshold for stopping splitting, and calculate the silhouette coefficient of the cluster; Calculate the product of the silhouette coefficient and the adjustment factor, and use the difference between the maximum depth and the product as the maximum depth when the tree stops splitting; The product of the silhouette coefficient and the minimum number of samples is used as the minimum number of samples when the tree stops splitting; The product of the silhouette coefficient and the information gain threshold is used as the information gain threshold when the tree stops splitting.

[0055] Specific embodiment three, the present invention further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the method described in embodiment one is implemented.

[0056] Through the description of the above implementation methods, technicians in this field can clearly understand that each implementation method can be implemented by adding a necessary general hardware platform, and of course can also be implemented by combining hardware and software. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a computer product, and the present invention can be in the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.

[0057] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it, and other embodiments may also be used. Although the present invention has been described in detail with reference to the aforementioned embodiments, ordinary technicians in this field should understand that they can still modify the technical solutions recorded in the aforementioned embodiments, or replace some of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A river water quality inversion method, characterized in that: The method comprises the following steps: Acquire the hyperspectral data of the river area, perform radiation correction on the hyperspectral data, construct multiple indicators based on the bands in the hyperspectral data, calculate the correlation between each indicator and the water quality parameters, sort the indicators according to the correlation, and determine the indicator set corresponding to the water quality parameters based on the indicator sorting results; cluster the water quality parameters based on the correlation of the water quality parameters and the correlation of the indicator set of the water quality parameters; During the training process, for each cluster, the importance of the indicator is determined according to the correlation between the indicator in the indicator set of the cluster and the water quality parameters in the cluster. The probability of selecting the split indicator when each tree is split is determined based on the importance of the indicator, and the split stopping condition is determined according to the silhouette coefficient of the cluster. The trained model is used to invert the new hyperspectral data to obtain water quality parameters.

2. The method according to claim 1, characterized in that The calculation of the correlation between each indicator and the water quality parameter is specifically as follows: Using multiple preset models to fit each indicator and water quality parameter; the multiple preset models are linear model, quadratic polynomial model, cubic polynomial model and exponential model; The minimum value of the root mean square error or the mean absolute percentage error of the multiple preset models is used as the correlation between the indicator and the water quality parameter.

3. The method according to claim 1, characterized in that The clustering of water quality parameters based on the correlation of water quality parameters and the correlation of the indicator set of water quality parameters is specifically as follows: Establishing a correlation relationship between two water quality parameters through a linear model, calculating a root mean square error or a mean absolute percentage error of the linear model, and using the root mean square error or the mean absolute percentage error as the correlation of the water quality parameters; Calculating the intersection and union of two water quality parameter indicator sets, and using the ratio of the number of the intersections to the number of the unions as the correlation of the water quality parameter indicator sets; Calculating the distances between water quality parameters through the correlation of water quality parameters and the correlation of the indicator set of water quality parameters; The water quality parameters are clustered according to the distances.

4. The method according to claim 3, characterized in that The distance between the water quality parameters is calculated by the correlation of the water quality parameters and the correlation of the indicator set of the water quality parameters, specifically: The correlation of water quality parameters is squared and weighted, and the correlation of the indicator set of water quality parameters is squared after 1 is subtracted and weighted again, and the sum of the two square weights is taken as the distance between water quality parameters.

5. The method according to claim 1, characterized in that The importance of the indicator is determined according to the correlation between the indicator in the indicator set of the cluster and the water quality parameter in the cluster, specifically: The union of the indicator sets corresponding to all water quality parameters in the cluster is taken as the indicator set of the cluster; For each indicator in the indicator set of the cluster, if the indicator is in the indicator set corresponding to the water quality parameter in the cluster, the correlation between the indicator and the water quality parameter is accumulated to obtain the importance of the indicator.

6. The method according to claim 1, characterized in that The probability of selecting the splitting indicator when each tree is split is determined based on the importance of the indicator, specifically: The importance of each indicator in the cluster's indicator set is normalized after taking the inverse, and the normalized value is used as the probability of selecting the split indicator during splitting.

7. The method according to claim 1, characterized in that The splitting stop condition is determined according to the silhouette coefficient of the cluster, specifically: Get the preset maximum tree depth, minimum number of samples, and information gain threshold for stopping splitting, and calculate the silhouette coefficient of the cluster; Calculate the product of the silhouette coefficient and the adjustment factor, and use the difference between the maximum depth and the product as the maximum depth when the tree stops splitting; The product of the silhouette coefficient and the minimum number of samples is used as the minimum number of samples when the tree stops splitting; The product of the silhouette coefficient and the information gain threshold is used as the information gain threshold when the tree stops splitting.

8. A river water quality inversion system, characterized in that: The system includes the following modules: The data acquisition module is used to obtain the hyperspectral data of the river area, perform radiation correction on the hyperspectral data, construct multiple indicators based on the bands in the hyperspectral data, calculate the correlation between each indicator and the water quality parameters, sort the indicators according to the correlation, and determine the indicator set corresponding to the water quality parameters based on the indicator sorting results; Clustering water quality parameters based on the correlation of water quality parameters and the correlation of indicator sets of water quality parameters; A training module is used to determine the importance of the indicator for each cluster according to the correlation between the indicator in the indicator set of the cluster and the water quality parameter in the cluster during the training process, determine the probability of selecting the split indicator when each tree is split based on the importance of the indicator, and determine the splitting stop condition according to the silhouette coefficient of the cluster; The inversion module is used to invert new hyperspectral data using the trained model to obtain water quality parameters.

9. The system according to claim 8, characterized in that The calculation of the correlation between each indicator and the water quality parameter is specifically as follows: Using multiple preset models to fit each indicator and water quality parameter; the multiple preset models are linear model, quadratic polynomial model, cubic polynomial model and exponential model; The minimum value of the root mean square error or the mean absolute percentage error of the multiple preset models is used as the correlation between the indicator and the water quality parameter.

10. A computer storage device, wherein a computer program is stored on the storage device, characterized in that: When the computer program is executed by a processor, the computer program implements the method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Image fusion method based on sliding window mixed pixel decomposition

    CN104809691A

  • Watershed water environment quality detection method and device based on unmanned aerial vehicle remote sensing

    CN113640233A

  • Satellite-borne GNSS-R soil humidity inversion method and system based on dielectric constant

    CN114814173A

  • Data processing method and device for XGBoost federated learning model training

    CN117648992A

  • Spectral inversion parameter prediction method and device based on meteorological sensitivity analysis

    CN118196151A

Cited By

  • Non-optically active water environment parameter flux monitoring method based on hyperspectral detection

    CN119649957A