River hypoxia phenomenon classification system construction and cause analysis method
By constructing a classification system for river hypoxia phenomena using data quality control and a random forest model, the problems of data gaps, spatiotemporal heterogeneity, and collinearity in existing technologies are solved, enabling accurate attribution and factor identification of hypoxia phenomena.
Patent Information
- Application Number
- CN202511755037.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-26
- Publication Date
- 2026-02-27
AI Technical Summary
Existing technologies for identifying key factors in river hypoxia suffer from insufficient data quality control, neglect of spatiotemporal heterogeneity, subjective threshold setting, and multicollinearity issues, resulting in inadequate accuracy and comprehensiveness of the results.
By using data quality control, hierarchical clustering, and random forest models, we screened hypoxic sites, constructed a hypoxic classification system, identified key influencing factors for different categories, and conducted attribution analysis using relative contribution rates and partial dependence values.
This improved the robustness and accuracy of the research results, ensured the relevance and comprehensiveness of the attribution of hypoxia, quantified the contribution of each explanatory variable, and identified the causes of hypoxia.
Smart Images

Figure CN121580185A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of water quality monitoring and data analysis technology, specifically relating to a method for constructing a classification system for river hypoxia phenomena and analyzing its causes. Background Technology
[0002] Oxygen is a core element for sustaining life, and the dissolved oxygen concentration in rivers plays a crucial role in maintaining aquatic ecosystems and biogeochemical cycles. A sustained decline in river dissolved oxygen levels triggers hypoxia, adversely affecting aquatic ecosystems. The formation of river hypoxia is complex, influenced by a combination of meteorological conditions, hydrodynamic processes, and the migration and transformation of pollutants. Identifying the main driving factors and conducting causal analysis among numerous potential influencing factors presents significant challenges. Traditional methods such as correlation analysis or multiple linear regression can only capture the linear relationship between dissolved oxygen and influencing factors, failing to effectively identify the implicit nonlinear and time-varying characteristics, thus exhibiting considerable limitations.
[0003] The invention patent "Identification Method of Key Factors of Dissolved Oxygen in Rivers Based on Nonlinear and Time-Varying Characteristics" (CN120596880A) discloses the following steps: constructing an initial factor set and calculating the maximum information coefficient (MIC) between dissolved oxygen and each influencing factor; setting a MIC threshold and selecting factors higher than the threshold to form a second factor set; calculating the cross-wavelet power spectrum, phase spectrum, and coherent condensation spectrum between dissolved oxygen and each factor in the second factor set; plotting the cross-wavelet power spectrum and phase spectrum to determine whether there is a significant correlation between dissolved oxygen and each factor; and finally quantifying the influence of each parameter on dissolved oxygen through principal component analysis, thereby identifying and outputting key influencing factors.
[0004] However, this invention patent still has the following shortcomings: (1) Lack of data quality control. In actual monitoring, due to factors such as the operational stability of water quality stations and budget constraints, monitoring sequences such as dissolved oxygen often contain missing or outlier values. If these problematic data are not processed, they will directly affect the accuracy of subsequent factor identification. This invention does not explain whether the original data is missing or outlier, nor does it mention corresponding data cleaning or correction methods.
[0005] (2) The spatiotemporal heterogeneity of dissolved oxygen changes at different stations was not fully considered. Dissolved oxygen in rivers is affected by the interaction of multiple factors, and different stations may exhibit drastically different hypoxia patterns during the wet and dry seasons. Ignoring the spatial differences in these temporal characteristics and directly identifying key factors may lead to results that deviate from the actual situation.
[0006] (3) Subjectivity exists in the key factor screening process. In step S2, the invention uses MIC to initially screen influencing factors, but the threshold setting is relatively subjective, which may exclude some potential key influencing factors, thereby affecting the comprehensiveness of the final identification results.
[0007] (4) The problem of multicollinearity among influencing factors has not been addressed. For example, parameters such as total nitrogen and ammonia nitrogen, and salinity and conductivity are usually strongly correlated. This invention does not consider the interference that such multicollinearity may cause to principal component analysis and other statistical processes. Summary of the Invention
[0008] The purpose of this application is to overcome the above-mentioned shortcomings of the existing technology and propose a novel method for constructing a classification system for river hypoxia and analyzing its causes. By improving the anti-interference capability of the research results through data quality control, the main hypoxia categories are identified through the construction of the classification system, and the key influencing factors and causes of different hypoxia categories are clarified through the random forest model. It has good technicality and operability.
[0009] The specific technical solution is as follows: A classification system for river hypoxia and a method for analyzing its causes include the following steps: S1. Dataset Construction; Dissolved oxygen, hydrological elements, water quality elements, and meteorological elements from various stations within the region were collected to construct the original dataset; S2. Data quality control; Assess the completeness of the original dataset and impute missing data using the mean substitution method to ensure data integrity; S3. Screening of low-oxygen sites; Dissolved oxygen at each station was analyzed, and the hypoxia frequency was calculated with a threshold of 5 mg / L. When the hypoxia frequency was greater than 0, the station was listed as a hypoxia station, thus forming a hypoxia station dataset. Non-hypoxia stations were not included in the subsequent analysis. S4. Construction of a hypoxia classification system; For the selected hypoxic stations, a hierarchical clustering method was used to obtain the clustering phylogenetic diagram of each station. Based on the distance metric method of the clustering phylogenetic diagram, the hypoxic stations were divided into different categories, and each category consisted of several stations. S5. Analysis of the causes of hypoxia; Random forest machine learning models were constructed for different types of hypoxic stations to obtain the relative importance of each variable to dissolved oxygen and clarify the causes of hypoxia in different types of hypoxic stations.
[0010] This invention enhances the robustness of research results through data quality control, screens hypoxic stations, constructs different hypoxic categories using a classification system, and clarifies the key influencing factors and causes of different hypoxic categories using a random forest model. Overall, it ensures the integrity and accuracy of the data, guaranteeing the robustness of the research results.
[0011] Specifically, S1. Dataset construction includes the following steps: S11. Clarify the number and location of hydrological stations, water quality stations, and meteorological stations within the study area; S12. Collect hydrological data, water quality data, and meteorological data from each station; S13. Merge the water quality data of one water quality station with the hydrological and meteorological data of the nearest hydrological and meteorological stations into one dataset; S14. Based on the number of water quality stations, repeat step S13 until a complete original dataset D-origin is constructed.
[0012] Specifically, S2. Data quality control includes the following steps: S21. Select the null and outlier values from the original dataset constructed in S1 as missing data. Outliers are selected using the interquartile range method, and an outlier is defined as less than 1 / 3 of a certain value. Q 1 -1.5IQR or greater than Q 3 +1.5IQR The value of, among which Q 1 represents the first quartile, which means that 25% of the values in the sorted dataset are less than or equal to it. Q 3 represents the third quartile, which means that 75% of the values in the sorted dataset are less than or equal to it. IQR Represents the interquartile range. IQR =Q 3 -Q 1; S22. Calculate the missing rate of the data sequence using the following formula: M=M N / T N In the formula: M represents the missing rate; M N T represents the amount of missing data; N Represents the total amount of data; S23. When the missing data rate of the data sequence is below 20%, the missing data is imputed using the mean of the data at adjacent time points; otherwise, the data sequence is removed from the original data to enhance the robustness of the results. S24. After data quality control, a new dataset D-new is generated.
[0013] Specifically, S3. Screening of hypoxic sites includes the following steps: S31. Analyze the dissolved oxygen sequence of each water quality station in the dataset after data quality control. Using 5 mg / L as the threshold for Class III surface water, a value below the threshold indicates hypoxia. Calculate the frequency of hypoxia at each water quality station. The specific calculation formula is as follows: F=N L / N T In the formula: F represents the frequency of hypoxia, N L N represents the number of sequences with dissolved oxygen concentrations below a threshold. T Represents the total amount of dissolved oxygen in the sequence; S32. When the hypoxia frequency is greater than 0, it means that a hypoxia event has occurred at the water quality station. The water quality station is then classified as a hypoxia station. Combined with the hydrological and meteorological data corresponding to the hypoxia station, a new dataset D-low is formed. Non-hypoxia stations are no longer included in the subsequent analysis.
[0014] Specifically, S4. Construction of the hypoxia classification system: Based on the dissolved oxygen data of each water quality station in the dataset, a hierarchical clustering method is used to obtain the clustering hierarchy diagram of each water quality station. Based on the distance metric method of the clustering hierarchy diagram, the hypoxia stations are divided into different categories, each category consisting of several hypoxia stations; including the following steps: S41. Treat each sample as an independent initial cluster (G1(0), G2(0),..., Gn(0)), calculate the pairwise distance d(x, y) between all clusters, and construct the initial distance matrix D(0); In the formula: m represents the number of sample features; x and y represent different sample sequences; k represents the sample feature index; Find the two clusters with the smallest distance in the distance matrix and merge them into a new cluster to obtain a new set of clusters. The number of clusters in this set is reduced by 1 compared to the total number of the initial clusters. Repeat the above steps until all samples are merged into one cluster; S42. Using the vertical axis to represent the distance between clusters and the horizontal axis, i.e., the water quality stations, to represent clusters, connect the clusters that are merged each time with line segments to form a clustering phylogenetic diagram; S43. Cut at the same distance on the vertical axis to obtain the final clustering result. Each category contains several water quality stations, and it can be assumed that the main controlling factor of hypoxia in these water quality stations is consistent.
[0015] Specifically, the analysis of the causes of hypoxia in S5 includes the following steps: S51. Integrate the hydrological, meteorological, and water quality data from different hypoxic categories into different datasets D1, D2, ..., D... n Each dataset represents one hypoxia category; S52. Determine the collinearity among hydrological, meteorological, and water quality series other than dissolved oxygen, and perform dimensionality reduction on series with high collinearity; S53. Integrate dissolved oxygen, elements without high collinearity, and the first principal components with high collinearity into a new dataset D. 1-new D 2-new ,...,D n-new And according to the standardization method in S52, all elements in each dataset are standardized to form D. 1-stand D 2-stand ,...,D n-stand ; S54. Regarding D 1-stand D 2-stand ,...,D n-stand The dataset is used to construct random forest models with dissolved oxygen as the target variable and other factors as explanatory variables. S55. Draw a relative contribution rate plot to identify the main controlling factors of hypoxia in different categories, draw a partial dependence plot, and analyze the main controlling factors.
[0016] Preferably, S52. Determine the collinearity among the various hydrological, meteorological, and water quality series other than dissolved oxygen, and perform dimensionality reduction processing on the series with high collinearity; specifically, this includes the following operations: First, calculate the correlation coefficient R between the sequences; In the formula: x i and y i Representing different sequences, and Represents the mean of different sequences; When |R|≥0.7, it indicates that the sequences are highly correlated and exhibit significant collinearity. In this case, a matrix X is formed from the highly collinear sequences. n Number of samples, p The number of elements; standardize matrix X to obtain standardized matrix Z, as shown in the following formula: In the formula: and are the mean and standard deviation of the j-th element, respectively; Secondly, calculate the covariance matrix of the standardized data: Perform eigenvalue decomposition on the covariance matrix to obtain the eigenvalues. ,... and the corresponding feature vectoru 1 , ...u p ; The top m principal components (m) are selected based on their variance contribution rates. <p): Contribution rate Then, calculate the score of the kth principal component. t ik And select the first principal component as the representative of the elements with high collinearity; (i=1,2,...,n; k=1,2,...m).
[0017] Preferably, the random forest model is constructed in S54 as follows: First, the data sequence is divided into training sets according to an 80%:20% ratio. D-train and test set D-test Second, the four hyperparameters in the random forest model—number of decision trees, number of split features, maximum depth of decision trees, and minimum number of samples for node splits—are set to different candidate values to form hyperparameter combinations; Third, D-train The data in the middle is divided into K Divide into equal parts, select each time. K-1 One set is used as the training set, and the remaining set is used as the validation set. Different combinations of hyperparameters are used to test... K-1 One sample is used for training, and the remaining sample is used for validation, until... K All data sets have been used for training and validation, and the output for each validation is... R value, R The hyperparameter combination with the largest value is the optimal hyperparameter combination; fourth, based on the optimal hyperparameter combination on the complete training set... D-train The final random forest model is trained using the test set. D-test To evaluate the generalization ability of the final model, calculate the generalization performance on the test set. R Value, when R When the value is above 0.7, the model is considered to be completed; fifth, the relative contribution rate and partial dependence value of each explanatory variable on dissolved oxygen are directly output from the model.
[0018] Specifically, the formula for calculating the relative contribution rate is as follows: In the formula: Parent As the parent node, child1 and child2 These are the two child nodes after the split; cumulative features j In all trees / nodes MSEThe relative contribution rate is obtained through standardization; The formula for calculating the partial dependency value is as follows: In the formula: f(v) This is a value with partial dependency. n The number of samples; RF*() This is the prediction function for the final optimal random forest model; For the first i Each sample X j Other feature values; x j =v Indicates the first j Each feature is fixed to a value. v .
[0019] This invention also provides the application of the aforementioned classification system for river hypoxia and its causal analysis method in the field of water quality monitoring.
[0020] Compared with the prior art, this application has the following technical effects: (1) Before attributing the hypoxia phenomenon, this invention first screened out hypoxia sites and used a systematic clustering analysis method based on the inconsistency of dissolved oxygen time-varying characteristics to divide each hypoxia site into different hypoxia categories, ensuring that the attribution is targeted. (2) After collecting various explanatory variables, this invention diagnoses the collinearity of the explanatory variables. For explanatory variables with strong collinearity, the first principal component extracted by principal component analysis is used to represent them, thus avoiding the problem of missing key factors caused by manually setting thresholds. (3) Before conducting data analysis, the present invention first carried out a data quality control process, selected null values and outliers, and imputed the missing data to ensure the anti-interference of the research results.
[0021] (4) This invention uses relative contribution rate and partial dependence value for attribution, which not only quantifies the relative contribution of each explanatory variable to hypoxia, but also identifies how each explanatory variable affects dissolved oxygen changes in terms of mechanism. Attached Figure Description
[0022] Figure 1 This is a schematic diagram illustrating the relative contributions of various indicators in different types of hypoxia in embodiments of the present invention; Figure 2 This is a partial dependence plot of water temperature and permanganate index in a low-oxygen environment throughout the year, according to an embodiment of the present invention. Detailed Implementation
[0023] To enable those skilled in the art to better understand the present invention, the present invention will now be further described in conjunction with specific embodiments.
[0024] In the following description, the embodiments of this application are for illustrative purposes and not for limiting purposes, so as to provide a thorough understanding of the embodiments of this application. However, those skilled in the art will understand that the embodiments of this application may also be implemented in other embodiments without these specific details. The terms "comprising," "including," "having," and variations thereof all mean "including but not limited to," unless otherwise specifically emphasized.
[0025] This section only introduces content related to the inventive points; other details can be obtained from relevant technologies and will not be described in detail here. The following embodiments only illustrate several implementation methods of this application, and their descriptions are relatively specific and detailed, but they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make several modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this patent application should be determined by the appended claims.
[0026] Example 1: In this embodiment, a method for constructing a classification system for river hypoxia and analyzing its causes includes the following steps.
[0027] S1. Construct the dataset.
[0028] S11 Clarify the number and location of hydrological stations, water quality stations, and meteorological stations within the study area; in this implementation case, there are 20 water quality stations, 10 meteorological stations, and 4 hydrological stations along the rivers in the area.
[0029] S12 collects hydrological, meteorological, and water quality data from various stations; In this case study, a total of 11 indicators were collected, including dissolved oxygen, water temperature, permanganate index, ammonia nitrogen, total phosphorus, total nitrogen, conductivity, turbidity, pH, rainfall, and flow rate.
[0030] S13 merges the water quality data of one water quality station with the hydrological and meteorological data of the nearest hydrological and meteorological stations into one dataset; S14. Based on the number of water quality monitoring stations, repeat step S13 until a complete original dataset is constructed. D- origin .
[0031] In this implementation case D-origin Specifically as follows: D-origin S2 Data Quality Control.
[0032] S21 Select the dataset D-originNull values and outliers in the data are treated as missing data. Outliers are selected using the interquartile range method, and an outlier is defined as less than 1 / 2 quartile. Q 1 -1.5IQR or greater than Q 3 +1.5IQR The value of, among which Q 1 represents the first quartile, which means that 25% of the values in the sorted dataset are less than or equal to it. Q 3 represents the third quartile, which means that 75% of the values in the sorted dataset are less than or equal to it. IQR Represents the interquartile range. IQR = Q 3 - Q 1 。
[0033] In this implementation case, the data sequence contains some null values and outliers.
[0034] S22 calculates the missing rate of each indicator for each site, using the following formula: In the formula: M Represents the missing rate; M N This represents the amount of missing data; T N This represents the total amount of data.
[0035] S23 When the missing data rate of the data sequence is below 20%, the missing data is imputed using the average of the data at adjacent time points; otherwise, the data sequence is removed from the original data to enhance the robustness of the results.
[0036] A new dataset is generated after S24 data quality control. D-new .
[0037] In this implementation case, the missing data rate was below 20%, so the data was imputed to form a new dataset. D-new .
[0038] S3 Screening for low-oxygen sites.
[0039] S31 Analyze Dataset D-new The dissolved oxygen (DO) values at various water quality monitoring stations were used, with a threshold of 5 mg / L for Class III surface water. A DO level below this threshold indicated hypoxia. The frequency of hypoxia at each station was calculated using the following formula: In the formula: F This represents the frequency of hypoxia. N L This represents the number of sequences with dissolved oxygen concentrations below a threshold.N T This represents the total amount of dissolved oxygen in the sequence.
[0040] S32 When the hypoxia frequency is greater than 0, it indicates that a hypoxia event has occurred at the water quality station. The station is then classified as a hypoxia station, and a new dataset is created by combining the corresponding hydrological and meteorological data. D-low Non-hypoxia stations will not be included in subsequent analyses.
[0041] In this implementation case, hypoxia occurred at 18 stations; therefore, the data from these 18 hypoxic stations were compiled into a new dataset. D-low This will be included in subsequent analysis.
[0042] S4 Construct a hypoxia classification system.
[0043] Based on dataset D-low Dissolved oxygen data from various water quality stations were collected, and a hierarchical clustering method was used to obtain a clustering phylogenetic diagram for each water quality station. Based on the distance metric method of the clustering phylogenetic diagram, the hypoxic stations were divided into different categories, and each category consisted of several stations.
[0044] S41 treats each sample as an independent initial cluster ( G 1 (0) , G 2 (0) ,..., G n (0) ), calculate the pairwise distances between all clusters d(x, y) Construct the initial distance matrix D (0) ; In the formula: m Represents the number of features in the sample; x and y Each represents a different sample sequence; k Represents the sample feature number.
[0045] Find the two clusters with the smallest distance in the distance matrix and merge them into a new cluster, resulting in a new set of clusters. The number of clusters in this set is reduced by 1 compared to the total number of the initial clusters.
[0046] Repeat the above steps until all samples are merged into one cluster.
[0047] S42 uses the vertical axis to represent the distance between clusters and the horizontal axis to represent clusters (i.e., water quality stations). Line segments connect the clusters that are merged each time to form a clustering phylogenetic diagram. S43 cuts at the same distance on the vertical axis to obtain the final clustering results. Each category contains several water quality stations, and it can be assumed that the main controlling factor of hypoxia in these water quality stations is consistent.
[0048] In this implementation case, the 18 hypoxic sites were classified into three categories through systematic cluster analysis: year-round hypoxic, flood season hypoxic, and summer hypoxic.
[0049] S5 Analysis of the causes of hypoxia.
[0050] S51 From the dataset D-low The data on hydrology, meteorology, and water quality for each hypoxic category are integrated into different datasets. D 1 , D 2 ,...,D n Each dataset represents one hypoxia category; S52 determines the collinearity among hydrological, meteorological, and water quality series other than dissolved oxygen, and performs dimensionality reduction on series with high collinearity. First, calculate the correlation coefficient between the sequences. R ; In the formula: x i and y i Representing different sequences, and Represents the mean of different sequences.
[0051] When | R When |≥0.7, it indicates a high degree of correlation between sequences, with significant collinearity. In this case, a matrix is formed from the highly collinear sequences. X ( n Number of samples, p (number of elements), for the matrix X Standardization is performed to obtain the standardization matrix. Z The formula is as follows: In the formula: and The first j The mean and standard deviation of each factor.
[0052] Calculate the covariance matrix of the standardized data : Perform eigenvalue decomposition on the covariance matrix to obtain the eigenvalues. ,... and the corresponding feature vector u 1 , ...u p ; Select the top performers based on variance contribution rate. m Principal components ( m < p ): Contribution rate Calculate the first k Principal component scores t ik And select the first principal component as the representative of the elements with high collinearity; (i = 1, 2,..., n; k = 1, 2,...m) S53 integrates dissolved oxygen, elements without high collinearity, and the first principal component of elements with high collinearity into a new dataset. D 1-new , D 2-new ,...,D n-new And according to the standardization method in S52, all elements in each dataset are standardized to form D 1-stand , D 2-stand ,...,D n-stand ; In this implementation case, the correlation coefficient between total nitrogen and ammonia nitrogen R The correlation coefficient among the other factors is 0.843. R Both were below 0.7. Dimensionality reduction was performed on the total nitrogen and ammonia nitrogen sequences, and the first principal component (PPC) representing the variation patterns of total nitrogen and ammonia nitrogen was extracted. This PPC was then merged with other sequences and standardized to form... D 1-stand , D 2-stand ,...,D n-stand .
[0053] S54 for D 1-stand , D 2-stand ,...,D n-stand Using datasets such as dissolved oxygen as the target variable and other factors as explanatory variables, random forest models were constructed. First, the data sequences were divided into training and training sets in an 80%:20% ratio. D-train and test set D-test Secondly, the four hyperparameters in the random forest model—number of decision trees, number of split features, maximum depth of decision trees, and minimum number of samples for node splits—are set to different candidate values to form hyperparameter combinations; thirdly, the following are... D-trainThe data in the middle is divided into K Divide into equal parts, select each time. K-1 One set is used as the training set, and the remaining set is used as the validation set. Different combinations of hyperparameters are used to test... K-1 One sample is used for training, and the remaining sample is used for validation, until... K All data sets have been used for training and validation, and the output for each validation is... R value, R The hyperparameter combination with the largest value is the optimal hyperparameter combination; fourth, based on the optimal hyperparameter combination on the complete training set... D-train The final random forest model is trained using the test set. D-test To evaluate the generalization ability of the final model, calculate the generalization performance on the test set. R Value, when R When the value is above 0.7, the model is considered complete. Finally, the relative contribution rate and partial dependence value of each explanatory variable on dissolved oxygen are directly output from the model. The formula for calculating the relative contribution rate is as follows: In the formula: Parent As the parent node, child1 / 2 These are the two child nodes after the split.
[0054] Cumulative features j In all trees / nodes MSE The relative contribution rate was obtained through standardization.
[0055] The formula for calculating the partial dependency value is as follows: In the formula: f(v) This is a value with partial dependency. n The number of samples; RF*() This is the prediction function for the final optimal random forest model; For the first i Each sample X j Other feature values; x j =v Indicates the first j Each feature is fixed to a value. v .
[0056] S55 Draw a relative contribution rate diagram to identify the main controlling factors of hypoxia in different categories, draw a partial dependence diagram, analyze how the main controlling factors affect hypoxia changes, and clarify the causes of hypoxia.
[0057] In this case study, the attribution methods described above were used to reveal the main controlling factors and causes of hypoxia in different categories. For example... Figure 1As shown, taking the year-round low-oxygen type as an example, water temperature has the largest relative contribution to hypoxia, followed by permanganate index, total phosphorus, and ammonia nitrogen / total nitrogen, indicating that hypoxia in this category is affected by a combination of water temperature and pollution input; combined with Figure 2 The partial dependence plot shows that, in the absence of other variables, dissolved oxygen and pollutants such as water temperature and permanganate index are negatively correlated. This indicates that the higher the water temperature and the higher the concentration of pollutants such as permanganate index, the lower the dissolved oxygen concentration and the more obvious the hypoxia phenomenon.
[0058] Based on the disclosure and teachings of the foregoing specification, those skilled in the art can make changes and modifications to the above embodiments. Therefore, the present invention is not limited to the specific embodiments disclosed and described above, and some modifications and changes to the present invention should also fall within the protection scope of the claims of the present invention. Furthermore, although some specific terms are used in this specification, these terms are only for convenience of explanation and do not constitute any limitation on the present invention.
Claims
1. A method for constructing a classification system and analyzing the causes of river hypoxia, characterized in that, Includes the following steps: S1. Dataset Construction; Dissolved oxygen, hydrological elements, water quality elements, and meteorological elements from various stations within the region were collected to construct the original dataset; S2. Data quality control; Assess the completeness of the original dataset and impute missing data using the mean substitution method to ensure data integrity; S3. Screening of low-oxygen sites; Dissolved oxygen at each station was analyzed, and the hypoxia frequency was calculated with a threshold of 5 mg / L. When the hypoxia frequency was greater than 0, the station was listed as a hypoxia station, thus forming a hypoxia station dataset. Non-hypoxia stations were not included in the subsequent analysis. S4. Construction of a hypoxia classification system; For the selected hypoxic stations, a hierarchical clustering method was used to obtain the clustering phylogenetic diagram of each station. Based on the distance metric method of the clustering phylogenetic diagram, the hypoxic stations were divided into different categories, and each category consisted of several stations. S5. Analysis of the causes of hypoxia; Random forest machine learning models were constructed for different types of hypoxic stations to obtain the relative importance of each variable to dissolved oxygen and clarify the causes of hypoxia in different types of hypoxia.
2. The method for constructing a classification system and analyzing the causes of river hypoxia as described in claim 1, characterized in that, S1. Dataset construction includes the following steps: S11. Clarify the number and location of hydrological stations, water quality stations, and meteorological stations within the study area; S12. Collect hydrological data, water quality data, and meteorological data from each station; S13. Merge the water quality data of one water quality station with the hydrological and meteorological data of the nearest hydrological and meteorological stations into one dataset; S14. Based on the number of water quality stations, repeat step S13 until a complete original dataset D-origin is constructed.
3. The method for constructing a classification system and analyzing the causes of river hypoxia as described in claim 1, characterized in that, S2. Data quality control, including the following steps: S21. Select the null and outlier values from the original dataset constructed in S1 as missing data. Outliers are selected using the interquartile range method, and an outlier is defined as less than 1 / 3 of a certain value. Q 1 -1.5IQR or greater than Q 3 +1.5IQR The value of, among which Q 1 represents the first quartile, which means that 25% of the values in the sorted dataset are less than or equal to it. Q 3 represents the third quartile, which means that 75% of the values in the sorted dataset are less than or equal to it. IQR Represents the interquartile range. IQR=Q 3 - Q 1; S22. Calculate the missing rate of the data sequence using the following formula: M=M N / T N In the formula: M represents the missing rate; M N T represents the amount of missing data; N Represents the total amount of data; S23. When the missing data rate of the data sequence is below 20%, the missing data is imputed using the mean of the data at adjacent time points; otherwise, the data sequence is removed from the original data to enhance the robustness of the results. S24. After data quality control, a new dataset D-new is generated.
4. The method for constructing a classification system and analyzing the causes of river hypoxia as described in claim 2, characterized in that, S3. Screening of hypoxic sites, including the following steps: S31. Analyze the dissolved oxygen sequence of each water quality station in the dataset after data quality control. Using 5 mg / L as the threshold for Class III surface water, a value below the threshold indicates hypoxia. Calculate the frequency of hypoxia at each water quality station. The specific calculation formula is as follows: F=N L / N T In the formula: F represents the frequency of hypoxia, N L N represents the number of sequences with dissolved oxygen concentrations below a threshold. T Represents the total amount of dissolved oxygen in the sequence; S32. When the hypoxia frequency is greater than 0, it means that a hypoxia event has occurred at the water quality station. The water quality station is then classified as a hypoxia station. Combined with the hydrological and meteorological data corresponding to the hypoxia station, a new dataset D-low is formed. Non-hypoxia stations are no longer included in the subsequent analysis.
5. The method for constructing a classification system and analyzing the causes of river hypoxia as described in claim 4, characterized in that, S4. Construction of a hypoxia classification system Based on dissolved oxygen data from various water quality monitoring stations in the dataset, a hierarchical clustering method was used to obtain cluster phylogenetic diagrams for each station. Using a distance metric based on these cluster phylogenetic diagrams, the hypoxic stations were divided into different categories, each consisting of several hypoxic stations. The process included the following steps: S41. Treat each sample as an independent initial cluster (G1(0), G2(0),..., Gn(0)), calculate the pairwise distance d(x, y) between all clusters, and construct the initial distance matrix D(0); In the formula: m represents the number of sample features; x and y represent different sample sequences; k represents the sample feature index; Find the two clusters with the smallest distance in the distance matrix and merge them into a new cluster to obtain a new set of clusters. The number of clusters in this set is reduced by 1 compared to the total number of the initial clusters. Repeat the above steps until all samples are merged into one cluster; S42. Using the vertical axis to represent the distance between clusters and the horizontal axis, i.e., the water quality stations, to represent clusters, connect the clusters that are merged each time with line segments to form a clustering phylogenetic diagram; S43. Cut at the same distance on the vertical axis to obtain the final clustering result. Each category contains several water quality stations, and it can be assumed that the main controlling factor of hypoxia in these water quality stations is consistent.
6. The method for constructing a classification system and analyzing the causes of river hypoxia as described in claim 5, characterized in that, S5. Analysis of the causes of hypoxia, including the following steps: S51. Integrate the hydrological, meteorological, and water quality data from different hypoxic categories into different datasets D1, D2, ..., D... n Each dataset represents one hypoxia category; S52. Determine the collinearity among hydrological, meteorological, and water quality series other than dissolved oxygen, and perform dimensionality reduction on series with high collinearity; S53. Integrate dissolved oxygen, elements without high collinearity, and the first principal components with high collinearity into a new dataset D. 1-new D 2-new ,...,D n-new And according to the standardization method in S52, all elements in each dataset are standardized to form D. 1-stand D 2-stand ,...,D n-stand ; S54. Regarding D 1-stand D 2-stand ,...,D n-stand The dataset is used to construct random forest models with dissolved oxygen as the target variable and other factors as explanatory variables. S55. Draw a relative contribution rate plot to identify the main controlling factors of hypoxia in different categories, draw a partial dependence plot, and analyze the main controlling factors.
7. The method for constructing a classification system and analyzing the causes of river hypoxia as described in claim 6, characterized in that, S52. Determine the collinearity among hydrological, meteorological, and water quality series other than dissolved oxygen, and perform dimensionality reduction on series with high collinearity; specifically, this includes the following operations: First, calculate the correlation coefficient R between the sequences; In the formula: x i and y i Representing different sequences, and Represents the mean of different sequences; When |R|≥0.7, it indicates that the sequences are highly correlated and exhibit significant collinearity. In this case, a matrix X is formed from the highly collinear sequences. n Number of samples, p The number of elements; standardize matrix X to obtain standardized matrix Z, as shown in the following formula: In the formula: and are the mean and standard deviation of the j-th element, respectively; Secondly, calculate the covariance matrix of the standardized data: Perform eigenvalue decomposition on the covariance matrix to obtain the eigenvalues. ,... and the corresponding feature vector u 1 ,...u p ; The top m principal components (m) are selected based on their variance contribution rates. <p): Contribution rate Then, calculate the score of the kth principal component. t ik And select the first principal component as the representative of the elements with high collinearity; (i=1,2,...,n; k=1,2,...m)。 8. The method for constructing a classification system and analyzing the causes of river hypoxia as described in claim 6, characterized in that, The steps to build a random forest model in S54 are as follows: First, the data sequence is divided into training sets according to an 80%:20% ratio. D-train and test set D-test ; Second, the four hyperparameters in the random forest model—number of decision trees, number of split features, maximum depth of decision trees, and minimum number of samples for node splits—are set to different candidate values to form hyperparameter combinations; third, D-train The data in the middle is divided into K Divide into equal parts, select each time. K-1 One set is used as the training set, and the remaining set is used as the validation set. Different combinations of hyperparameters are used to test... K-1 One sample is used for training, and the remaining sample is used for validation, until... K All data sets have been used for training and validation, and the output for each validation is... R value, R The hyperparameter combination with the largest value is the optimal hyperparameter combination; fourth, based on the optimal hyperparameter combination on the complete training set... D-train The final random forest model is trained using the test set. D-test To evaluate the generalization ability of the final model, calculate the generalization performance on the test set. R Value, when R When the value is above 0.7, the model is considered to be completed; fifth, the relative contribution rate and partial dependence value of each explanatory variable on dissolved oxygen are directly output from the model.
9. The method for constructing a classification system and analyzing the causes of river hypoxia as described in claim 8, characterized in that, The formula for calculating the relative contribution rate is as follows: In the formula: Parent As the parent node, child1 and child2 These are the two child nodes after the split; Grand total feature j In all trees / nodes MSE The relative contribution rate is obtained through standardization; The formula for calculating the partial dependency value is as follows: In the formula: f(v) This is a value with partial dependency. n The number of samples; RF*() This is the prediction function for the final optimal random forest model; For the first i Each sample X j Other feature values besides; i>x j =v Indicates the first j Each feature is fixed to a value. v .
10. The application of the classification system for river hypoxia phenomenon and the method for analyzing its causes as described in claim 1 in the field of water quality monitoring.
Citation Information
Patent Citations
River dissolved oxygen key factor identification method based on nonlinearity and time-varying characteristics
CN120596880A
Marine wind power plant environment factor monitoring system
CN107331135A
A river water quality prediction and an evaluation method of water quality influencing factors
CN109242203A
Hydrology and water quality data acquisition method and system based on web crawler technology
CN111859067A
Taihu Lake water quality prediction method based on clustering and LSTM
CN116050573A