Water quality index dynamic evaluation method and system based on multi-modal machine learning
By dynamically adjusting the weights of water quality indices using multimodal machine learning methods, the problems of fixed weights and poor robustness in existing technologies are solved, enabling adaptive evaluation of different water bodies and pollution characteristics, and improving the stability and flexibility of the evaluation.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-02-25
- Publication Date
- 2026-04-07
AI Technical Summary
Existing water quality index evaluation methods suffer from poor robustness and insufficient cross-scenario applicability due to fixed weights. They are difficult to adapt to the differences in different water bodies and pollution types, and are sensitive to sensor noise and extreme values.
A multimodal machine learning approach is adopted, which dynamically adjusts the weights through data preprocessing, water quality parameter scoring, weight calculation and intelligent fusion modules. Combined with entropy weighting, isolated forest, autoencoder and contrastive learning algorithms, dynamic weights are generated and inverse variance weighted fusion is performed to output the water quality index.
It enables adaptive evaluation of different water bodies and pollution characteristics, reduces sensor noise and interference from extreme values, improves the stability and flexibility of the evaluation, and supports batch evaluation across multiple locations.
Smart Images

Figure CN121810089A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to an environmental monitoring method, in particular to a water quality index dynamic evaluation method and system based on multi-modal machine learning. BACKGROUND
[0002] The current common water quality index (WQI) evaluation method mostly relies on fixed weight distribution (such as entropy weight method, expert experience weight), and the related technical scheme is disclosed in the Chinese patent publication No. CN107036974A, entitled "Water quality parameter multi-model collaborative inversion method based on deterministic set modeling", which records: "The water quality parameter multi-model collaborative inversion method based on deterministic set modeling, the sampling points are arranged in the study area, the water quality parameter concentration and the corresponding hyperspectral remote sensing reflectivity at the sampling points are obtained; the measured hyperspectral remote sensing reflectivity of the water body is pretreated, and the pretreated hyperspectral reflectivity or band combination with better correlation with the water quality parameter concentration is selected to construct a plurality of water quality parameter inversion models; the entropy weight method and the set pair principle are used to determine the weight of each single model, and the weighted sum of the inversion results of each single model is obtained to realize the multi-model collaborative inversion of the water quality parameter". Such method has the following disadvantages: Firstly, the weight is rigid, the importance of each parameter is different under different water bodies and different pollution types, and the fixed weight cannot be dynamically adapted; secondly, it is abnormally sensitive, the sensor noise, missing data and extreme value will directly affect the WQI result, leading to distortion; thirdly, the cross-scene is insufficient, the water quality characteristics of different monitoring points and different basins are significantly different, and the traditional method is difficult to unify the evaluation. SUMMARY
[0003] The technical problem to be solved by the present application is to provide a water quality index dynamic evaluation method and system based on multi-modal machine learning, which can automatically identify abnormality, dynamically adjust weight and support cross-point batch evaluation, in view of the defects of weight fixation, poor robustness and insufficient cross-scene applicability of the prior art.
[0004] To solve the above technical problems, the present application adopts the following technical solutions.
[0005] A dynamic evaluation method for water quality index based on multimodal machine learning is proposed. This method is implemented using a data preprocessing module, a water quality parameter scoring module, a weight calculation module, and an intelligent fusion module. The method includes the following steps: Step S1, the data preprocessing module cleans and normalizes the raw monitoring data; Step S2, the water quality parameter scoring module constructs a piecewise function scoring model, mapping the monitored concentration values to a standard score of 0-100; Step S3, the weight calculation module performs multimodal weight calculation and dynamic weight fusion steps: Step S30, entropy weighting, isolated forest, autoencoder, and contrastive learning algorithms are used in parallel to analyze the normalized data from four different dimensions: information content, anomaly resistance, intrinsic structure, and contrast differentiation, generating four sets of preliminary weights; Step S31, the inverse variance weighting method is used to fuse the four sets of weights, outputting dynamic weights; Step S4, the intelligent fusion module weights and aggregates the standard scores and dynamic weights to calculate the water quality index and classifies the water quality level according to a preset threshold.
[0006] Preferably, in step S1, the data cleaning process includes: step S10, inputting raw monitoring data; step S11, validity check, automatically identifying the time column and each monitoring parameter column in the raw monitoring data, identifying invalid data and replacing it with missing values NaN; step S12, matrix construction, constructing the valid parameters into a matrix. matrix Where n is the number of valid days and m is the number of valid parameters; Step S13, data cleaning, removing rows containing missing values NaN to obtain a clean data matrix. In step S1, the normalization process includes: scaling each parameter to the [0,1] interval using the Min-Max normalization method to form a matrix. .
[0007] Preferably, in step S2, the scoring rule module is invoked according to a preset standard to construct a piecewise function for each parameter. This step unifies water quality parameters of different dimensions into a standardized scoring matrix. This serves as the input for subsequent dynamic weight calculations.
[0008] Preferably, in step S30, the processing based on the entropy weight method includes: calculating the weight: for the normalized matrix For each column, calculate the proportion of its value in the total sum of that column. Calculate information entropy: Calculate the information entropy of each parameter. Calculate the weights: Calculate the weights based on the entropy values. Among them, the smaller the entropy, the larger the difference coefficient of the parameter, and the higher the weight.
[0009] Preferably, in step S30, the process based on isolated forest includes: model training: using a matrix Train an IsolationForest model; extract feature importance: traverse each tree in the isolation forest and count the number of times each parameter is used in the split nodes of the tree; calculate weights: average the usage frequency of each parameter in all trees and normalize it to obtain the weight vector. The more times a parameter is used to split nodes, the greater its contribution to isolating samples, and the higher its weight.
[0010] Preferably, in step S30, the autoencoder-based processing includes: model construction and training: constructing a single-hidden-layer autoencoder to achieve the desired result. 𝑛𝑜𝑟𝑚 Simultaneously used as both input and target output for training; calculation of reconstruction error: using the trained model on 𝑋 𝑛𝑜𝑟𝑚 To make predictions, calculate the mean squared error (MSE) of each parameter at each sample point; calculate the weights: calculate the average reconstruction error of each parameter across all samples; where the reciprocal of the error is taken and normalized to obtain the weight vector. .
[0011] Preferably, in step S30, the contrastive learning-based processing includes: model construction and training: constructing a simple projection network model, training it using a custom contrastive loss function, enabling the model to learn to map input data to a discriminative low-dimensional space; weight extraction: after training, extracting the weight matrix of the first layer of the network; weight calculation: calculating the norm of the weight matrix along the output direction. The larger the norm, the greater the contribution of the input parameter to forming a discriminative projection. Normalizing the norm vector yields the weight vector. .
[0012] Preferably, step S31 includes: constructing a weight matrix: stacking the four weight vectors into one. matrix Calculate the variance: Calculate the variance of the weights obtained by each method on each parameter. ; Calculate the inverse variance weights: for each parameter j Calculate its fusion weight .
[0013] Preferably, step S4 includes: parameter scoring: for each parameter value for each day, converting it into a score between 0 and 100 according to a preset scoring rule. Weighted summation: This calculates the scores for each parameter for each day. The fusion weights obtained from the fusion Multiply and sum to obtain the core water quality index for that day. ; water quality classification: according to the calculated value, compare with the preset water quality classification standard, determine the final water quality classification.
[0014] A water quality index dynamic evaluation system based on multi-modal machine learning, comprising: a data preprocessing module for cleaning and normalizing the original monitoring data; a water quality parameter scoring module for constructing a segmented function scoring model to map the monitoring concentration value to a standard score of 0-100; a weight calculation module for performing a multi-modal weight calculation step and a dynamic weight fusion step: in the multi-modal weight calculation step, entropy weight method, isolation forest, autoencoder and contrast learning algorithm are used in parallel to analyze the normalized data from four different dimensions of information quantity, anomaly resistance, internal structure and contrast distinction, generating four sets of preliminary weights; in the dynamic weight fusion step, inverse variance weighting method is used to fuse the four sets of weights to output dynamic weights; an intelligent fusion module for weighting and aggregating the standard score and the dynamic weight to calculate the water quality index, and dividing the water quality classification according to the preset threshold.
[0015] In the dynamic evaluation method for water quality indices based on multimodal machine learning disclosed in this invention, the data preprocessing module cleans, calculates, and normalizes the raw monitoring data, providing a standardized data matrix for subsequent analysis. The water quality parameter scoring module, using the "Groundwater Quality Standard" as its core, establishes piecewise scoring functions for various parameters such as pH, ammonia nitrogen, and heavy metals, uniformly mapping concentration values to standard scores of 0-100, thus completing the evaluation of "absolute standards." In the weight calculation module, based on the multimodal weight calculation steps, four machine learning algorithms—entropy weighting, isolated forest, autoencoder, and contrastive learning—are used in parallel to analyze the normalized data from four different dimensions: information content, anomaly resistance, intrinsic structure, and contrastive differentiation, generating four sets of preliminary weights. Based on the dynamic weight fusion step, the inverse variance weighting method is used to intelligently fuse the four sets of weights, thereby automatically identifying the reliability of each algorithm's results and finally outputting a set of dynamic weights that can adapt to the characteristics of the current data. Finally, based on the intelligent fusion module, the "standard score" and "dynamic weight" are weighted and aggregated to calculate the final water quality index, and the water quality level is classified according to a preset threshold. Compared with the prior art, this invention adopts a multimodal dynamic weight fusion mechanism: it proposes and implements parallel computing and intelligent fusion of four heterogeneous algorithms, namely entropy weight method, isolated forest, autoencoder, and contrastive learning, to determine the weights of water quality parameters; at the same time, this invention realizes data-driven dynamic weight adjustment: the weight values of different parameters are not fixed, but dynamically generated according to the data distribution characteristics of the input water quality data, thereby realizing adaptive evaluation of different water bodies and different pollution characteristics; furthermore, this invention is based on robustness enhancement design: outlier removal is combined in the data preprocessing stage, and a fusion strategy is adopted in the weight calculation stage, which effectively reduces the interference of sensor noise and extreme values on the evaluation results and ensures the stability of the index; in addition, this invention adopts a standard and data dual-driven model: a dual-core evaluation model combining "water quality parameter score" and "water quality parameter weight" is constructed, which not only ensures the standardization of the evaluation, but also gives the evaluation flexibility and intelligence. Attached Figure Description
[0016] Figure 1 This is a flowchart of the dynamic evaluation method for water quality index based on multimodal machine learning, as described in this invention. Figure 2 This is a chart of daily series changes in the WQI index in one embodiment of the present invention; Figure 3 This is a water quality grade distribution map according to one embodiment of the present invention; Figure 4 This is a WQI distribution histogram in one embodiment of the present invention; Figure 5 This is a parameter fusion weight heatmap in one embodiment of the present invention. Detailed Implementation
[0017] The application will be described in more detail below with reference to the accompanying drawings and embodiments.
[0018] The application discloses a water quality index dynamic evaluation method based on multi-modal machine learning, please see Figure 1 The method is realized based on a data preprocessing module, a water quality parameter scoring module, a weight calculation module and an intelligent fusion module, and comprises the following steps: Step S1, the data preprocessing module performs data cleaning and normalization processing on original monitoring data; Step S2, a segmented function scoring model is constructed by using the water quality parameter scoring module, and monitoring concentration values are mapped into standard scores of 0-100; Step S3, the weight calculation module is used to perform a multi-modal weight calculation step and a dynamic weight fusion step: Step S30, entropy weight method, isolation forest, self-encoder and contrast learning algorithm are used in parallel to analyze the normalized data from four different dimensions of information quantity, abnormal resistance, internal structure and contrast distinction, and four sets of preliminary weights are generated; Step S31, inverse variance weighting method is used to fuse the four sets of weights, and output dynamic weights; Step S4, the intelligent fusion module performs weighted aggregation on the standard scores and the dynamic weights, calculates the water quality index, and divides the water quality level according to the preset threshold.
[0019] In the above method, the data preprocessing module cleans, calculates, and normalizes the raw monitoring data, providing a standardized data matrix for subsequent analysis. The water quality parameter scoring module, based on the "Groundwater Quality Standard" (GB / T14848-2017), establishes segmented scoring functions for various parameters such as pH, ammonia nitrogen, and heavy metals, mapping concentration values uniformly to a standard score of 0-100, thus completing the "absolute standard" evaluation. In the weight calculation module, based on the multimodal weight calculation step, four machine learning algorithms—entropy weighting, isolated forest, autoencoder, and contrastive learning—are used in parallel to analyze the normalized data from four different dimensions: information content, anomaly resistance, intrinsic structure, and contrastive differentiation, generating four sets of preliminary weights. Based on the dynamic weight fusion step, the inverse variance weighting method is used to intelligently fuse the four sets of weights, automatically identifying the reliability of each algorithm's results (weights with smaller variance are more reliable), and finally outputting a set of dynamic weights that can adapt to the characteristics of the current data period. Finally, based on the intelligent fusion module, the "standard score" and "dynamic weight" are weighted and aggregated to calculate the final water quality index, and the water quality level is classified according to a preset threshold. Compared with the prior art, this invention adopts a multimodal dynamic weight fusion mechanism: it proposes and implements parallel computing and intelligent fusion of four heterogeneous algorithms, namely entropy weight method, isolated forest, autoencoder, and contrastive learning, to determine the weights of water quality parameters; at the same time, this invention realizes data-driven dynamic weight adjustment: the weight values of different parameters are not fixed, but dynamically generated according to the data distribution characteristics of the input water quality data, thereby realizing adaptive evaluation of different water bodies and different pollution characteristics; furthermore, this invention is based on robustness enhancement design: outlier removal is combined in the data preprocessing stage, and a fusion strategy is adopted in the weight calculation stage, which effectively reduces the interference of sensor noise and extreme values on the evaluation results and ensures the stability of the index; in addition, this invention adopts a standard and data dual-driven model: a dual-core evaluation model combining "water quality parameter score" and "water quality parameter weight" is constructed, which not only ensures the standardization of the evaluation, but also gives the evaluation flexibility and intelligence.
[0020] Furthermore, in step S1, the data cleaning process includes: Step S10: Input the raw monitoring data, ensuring that the input data is the cleaned daily average value; Step S11, validity check: automatically identify the time column and each monitoring parameter column in the original monitoring data, identify invalid data and replace it with missing value NaN, that is, automatically filter out the parameter columns that are not empty and valid in the dataset; Step S12, matrix construction, constructing the effective parameters as follows matrix Where n is the number of valid days and m is the number of valid parameters; Step S13, data cleaning, remove rows containing missing values NaN, get pure data matrix .
[0021] In step S1, the normalization process includes: Use Min-Max normalization method to scale each parameter to the interval [0, 1] to form a matrix :
[0022] This step aims to eliminate the influence of dimension, and provide a fair starting point for subsequent distance and distribution-based algorithms.
[0023] As a preferred way, in step S2, according to the preset standard, call the scoring rule module to construct a segmented function for each parameter, which unifies the water quality parameters of different dimensions into a standardized score matrix , as the input of subsequent dynamic weight calculation.
[0024] This step involves the design idea and basis of water quality parameter scoring system (Sj), including: 1. Core idea of scoring system: 2. Establish a segmented function scoring model for each groundwater quality parameter to map the detection concentration to a standard score of 0-100 , which follows the basic principle of "the lower / closer to the ideal value, the higher the score; the more serious the concentration exceeds the standard, the lower the score", and differentiates design according to the health risks and use effects of different parameters; 2. Scoring design idea and method: ① Determine the scoring benchmark, mainly based on: "Groundwater Quality Standard (GB / T14848-2017)" of the People's Republic of China. Auxiliary basis: World Health Organization (WHO) "Drinking Water Quality Guidelines", United States Environmental Protection Agency (USEPA) drinking water standards and other authoritative toxicology research, used for supplement and verification.
[0025] ② Parameter classification and scoring strategy, according to the influence of parameters on health and use function, different scoring function forms are adopted: a. Limited parameters (pollutants); Characteristics: There is a clear upper limit of concentration, the lower the better.
[0026] Typical parameters: ammonia nitrogen, heavy metals (arsenic, lead, chromium, etc.), fluoride, chloride, sulfate, COD.
[0027] Scoring idea: 1. Below the limit of Class I water: give high score (90-100 points), indicating clean, almost no pollution; 2. In the range of Class I to Class III water limits: score linearly or stepwise decreases (70-90 points), indicating good to qualified water quality, suitable for various uses; 3. Exceeding the limit of Class III water (exceeding the standard): the score decreases significantly (<70 points), and decreases sharply according to the extent of exceeding the standard, until the minimum score (0-20 points), reflecting that the water quality is not suitable for direct use and there is a health risk.
[0028] b. Moderate interval type parameters; Features: There is an optimal interval, and too high or too low indicates poor water quality; Typical parameters: pH, total hardness, total dissolved solids; Scoring idea: 1. In the optimal interval (usually within the Class I water standard): give full marks (100 points); 2. In the acceptable interval (Class II-III water standard): the score decreases from the boundary of the optimal interval to both sides; 3. Exceeding the acceptable interval: the score further decreases, reflecting the impact of water quality on pipe corrosion (pH too low / TDS too low) or scaling (hardness too high / TDS too high), as well as taste and health risks.
[0029] c. Sensory properties and general chemical indicators; Features: Mainly affect the use experience and apparent quality of water, and some indicators too high may imply pollution; Typical parameters: color, turbidity, odor and taste, iron, manganese; Scoring idea: Refer to the "sensory properties and general chemical indicators" limits in the standard to design a gradient score from satisfaction to dissatisfaction.
[0030] ③ Threshold determination and function construction, strictly taking the I, II, III, IV, V class water quality limits in GB / T14848-2017 as the core scoring threshold points. Convert the limits of each category into anchor points of the scoring ladder, construct a piecewise linear or step function, and realize the mapping from concentration to score.
[0031] Further, the step S30 comprises: Modal one: entropy weight method; goal: according to the discrete degree (uncertainty) of the distribution of each parameter data, allocate weights. The more discrete the data, the more information it provides, and the higher the weight.
[0032] Specifically, the processing process based on the entropy weight method comprises: Calculate the proportion: for each column of the normalized matrix , calculate the proportion of its value in the total sum of the column ; Calculate the information entropy: calculate the information entropy of each parameter ; Calculate weight: calculate weight according to entropy value ; In the above formula, m represents the total number of water quality parameters participating in evaluation (such as pH, EC, COD, etc.), for example, there are 6 parameters, then m=6; j represents the subscript of "this parameter whose weight is being calculated", for example, when the weight of COD is calculated, j is the serial number corresponding to COD; k is an index variable, which is only a counter for summation in this formula and has no actual meaning, and is only used for counting, which is used to traverse all parameters in the denominator. In practical application, the smaller the entropy (the smaller the uncertainty), the larger the coefficient of variation (CV) of the parameter, and the higher the weight.
[0033] In the step S30 of the present application, the second mode involved is Isolation Forest based on anomaly resistance; the target is to evaluate the contribution of each parameter in distinguishing normal and abnormal samples, and the parameter with greater contribution to anomaly identification has higher weight.
[0034] Specifically, the processing process based on Isolation Forest includes: Model training: use matrix Train an IsolationForest model; Extract feature importance: traverse each tree in the Isolation Forest, and count the number of times each parameter is used in the splitting node of the tree; Calculate weight: average the usage frequency of each parameter in all trees and normalize to get the weight vector ; Wherein, the more times used in the splitting node, the greater the contribution of the parameter to the isolation of the sample, and the higher the weight.
[0035] In the step S30 of the present application, the third mode includes Autoencoder based on internal structure; the target is to measure the importance of the parameter by the difficulty of its reconstruction, and the parameter that is difficult to be accurately reconstructed by the model usually contains more complex or more critical patterns, and has higher weight.
[0036] Specifically, the processing process based on Autoencoder includes: Model construction and training: construct a single hidden layer autoencoder to train 𝑛𝑜𝑟𝑚 At the same time, train as input and target output; Calculate reconstruction error: use the trained model to predict 𝑛𝑜𝑟𝑚 Calculate the mean square error (MSE) of each parameter at each sample point; about samples: in the training process of the autoencoder, "samples" are all derived from the normalized matrix X 𝑛𝑜𝑟𝑚 after data processing in the step S1, and the matrix X 𝑛𝑜𝑟𝑚 Each row of the matrix corresponds to the observation value of all valid parameters of a certain day after the original monitoring data is cleaned and processed daily, and the original monitoring data is one-to-one corresponding in time.
[0037] The autoencoder takes the matrix as input and target output, both of which are based on the original monitoring data and can be one-to-one corresponding in time (in units of days) with the original monitoring data Calculate weights: calculate the average reconstruction error of each parameter on all samples; Where the inverse of the error is taken (the smaller the error, the greater the weight), and normalized to obtain the weight vector .
[0038] In the step S30 of the application, the modal four: contrast learning-based contrast differentiation; goal: when learning a low-dimensional representation that can distinguish different samples, evaluate the importance of each parameter in this process.
[0039] Specifically, the processing process based on contrast learning includes: Model construction and training: build a simple projection network model, use a custom contrast loss function for training, and make the model learn to map input data to a low-dimensional space with distinguishing degree; Extract weights: after training, extract the weight matrix of the first layer of the network (directly connected to the input); Calculate weights: calculate the norm (such as L2 norm) of the weight matrix along the output direction, the larger the norm, the greater the contribution of the input parameter to the formation of the projection with distinguishing degree, and normalize the norm vector to obtain the weight vector .
[0040] Further, the step S31 involves inverse variance weighted fusion; goal: intelligently fuse the above four weight vectors into an optimal final weight, the core idea is: for the weight obtained by each method, more trust those components with smaller variance. Specifically includes: Build a weight matrix: stack the four weight vectors into a Matrix ; Calculate variance: calculate the variance of the weight obtained by each method on each parameter ; Calculate inverse variance weight: for each parameter j , calculate its fusion weight .
[0041] The underlying logic involved in this step is: if the weight value of a parameter fluctuates greatly (large variance) in the four methods, it means that different methods have a large difference in judging its importance, so the trust degree is low, and a smaller fusion weight is given. On the contrary, if the weight given by the four methods is very close (small variance), it means that the importance of the parameter is a consensus, so the trust degree is high, and a larger fusion weight is given.
[0042] The step S4 of the present application involves The calculation of water quality classification, specifically includes: Parameter scoring: for each parameter value of each day, it is converted into a score between 0-100 according to the preset scoring rule (such as piecewise linear function) ; Weighted summation: multiply the score of each parameter of each day With the fusion weight obtained by fusion Sum up to get the core water quality index of the day :
[0043] Water quality classification: according to the calculated Value, against the preset water quality level standard (such as: ≥90 is "excellent", 70-89 is "good", etc.), determine the final water quality level.
[0044] On this basis, the present application also proposes a water quality index dynamic evaluation system based on multi-modal machine learning, which includes: A data preprocessing module for cleaning and normalizing the original monitoring data; A water quality parameter scoring module for constructing a piecewise function scoring model to map the monitoring concentration value to a standard score of 0-100; A weight calculation module for performing a multi-modal weight calculation step and a dynamic weight fusion step: in the multi-modal weight calculation step, entropy weight method, isolation forest, autoencoder and contrast learning algorithm are used in parallel to analyze the normalized data from four different dimensions of information quantity, anomaly resistance, internal structure and contrast distinction, generating four sets of preliminary weights; in the dynamic weight fusion step, inverse variance weighting method is used to fuse the four sets of weights to output dynamic weights; An intelligent fusion module for weighting and aggregating the standard scores and the dynamic weights to calculate the water quality index and divide the water quality level according to the preset threshold.
[0045] A specific embodiment is provided below to explain the technical solution of the present application.
[0046] Example 1: In this embodiment, the online monitoring data of groundwater in a certain landfill is selected as the original input file. The data comes from a multi-parameter online sensor installed in the groundwater monitoring well of the landfill. The monitoring parameters include pH, ammonia nitrogen, DO, COD, EC, and ORP. The monitoring time span is from early May to the end of October in 2025. The specific implementation process is as follows: (1) Data import and cleaning. First, read the original monitoring file and automatically identify the time column and each monitoring parameter column. All abnormal values are identified as invalid data and replaced with missing values (NaN). Then, the system automatically removes empty columns and invalid rows to ensure that the input matrix only retains observation parameters with valid values. By converting 10-minute interval monitoring data into daily average value matrix, the standardized input sample of each day is obtained.
[0047] (2) Standardization and national standard score mapping. The system automatically calls the scoring rule module according to the "Groundwater Quality Standard (GB / T 14848-2017)" to construct a segmented function for each parameter, realizing the mapping of parameter value to water quality score (WQI). This step unifies water quality parameters of different dimensions into a standardized score matrix as the input for subsequent dynamic weight calculation.
[0048] (3) Four algorithms parallel weight calculation. The system runs four algorithms on each day's valid data subset to independently generate four groups of weights: Entropy weight method: assign weights based on parameter information quantity (discrete degree); Isolation Forest: determine parameter importance based on anomaly recognition ability; Autoencoder: evaluate the representativeness of parameters in internal structure according to reconstruction error; Contrastive learning: measure the discriminative power of each parameter through sample clustering consistency.
[0049] The weight vectors output by each algorithm are normalized to ensure the total weight sum is 1.
[0050] (4) Inverse variance weighted fusion. To integrate the results of the four algorithms and weaken the influence of single model bias, the system uses the inverse variance weighted method (IVW) to fuse the four groups of weights. Algorithms with small variance (i.e., high stability) are given higher trust in fusion, forming the final adaptive weight vector . This step embodies the core innovation points of multi-modal fusion and adaptive weighting.
[0051] (5) Daily WQI calculation and water quality classification. According to the daily parameter score mean and the fusion weight vector, the daily water quality index (WQI) is calculated: ; Automatic determination of water quality grade according to the set threshold value: ≥ 90 is "excellent", 70-89 is "good", 50-69 is "general", 25-49 is "poor", and < 25 is "very poor".
[0052] (6) Result visualization and analysis. Four core charts are used to show dynamic characteristics and evaluation results: 1. Please refer to Figure 2 , which is a WQI time series chart showing the change of WQI with time and grade threshold line, revealing the dynamic trend of water quality; Figure 2 shows the daily sequence change of WQI index of the landfill groundwater monitoring well from April to October 2025, the blue line is the daily dynamic weight WQI value, and the dotted line indicates the result of different water quality grades. The result shows that WQI fluctuates between 40 and 70, indicating that the algorithm output is stable and resistant to anomalies, and the rise in July-August reflects the system's response to rainfall dilution, and the fall in September-October is consistent with daily production activities on site, verifying the reasonableness of the result. Figure 2 It proves that the algorithm has dynamic response and anti-anomaly ability in the time dimension.
[0053] 2. Please refer to Figure 3 , which is a water quality grade distribution chart (statistics of the number of days of each grade, reflecting the overall water quality status). According to statistics, the proportion of days of each water quality grade is: "poor" 96 days, "general" 85 days, and "good" 1 day. Figure 3 , the grade distribution is continuous and the proportion is reasonable, indicating that the algorithm has good discrimination ability and output stability, Figure 3 reflecting the grade discrimination ability and long-term stability of the algorithm, providing support for continuous water quality evaluation.
[0054] 3. Please refer to Figure 4 , which is a WQI distribution histogram, presenting the frequency distribution and mean of WQI, verifying the stability of the system; Figure 4 shows the frequency distribution of WQI values, with the red dotted line representing the mean value of 49.0, and the distribution concentrated in the 40-55 interval, showing a unimodal structure, indicating that the algorithm output is smooth and suppresses the interference of outliers, Figure 4 verifying the statistical stability and anti-noise performance of the model.
[0055] 4. Please refer to Figure 5 , which is a parameter fusion weight heat map, showing the daily change of the weight of the six indicators, reflecting the system's self-learning and interpretation ability for pollution characteristics. Figure 5In the figure, the horizontal axis is the date, the vertical axis is the weight value of the monitoring parameter (pH, ammonia nitrogen, DO, COD, EC, ORP), and the color depth represents the weight size. The long-term high weight of NH3-N and COD, the rising weight of COD in summer, and the rising weight of NH3-N in autumn show that the algorithm can adapt to environmental changes and identify the main pollution factors. Figure 5 The multi-modal dynamic weight self-learning and interpretability are embodied.
[0056] Based on the above embodiments, the present application effectively solves the technical problems of fixed weight, poor robustness, and insufficient cross-scene applicability in the prior art. At the same time, the dynamic weight fusion method based on multi-modal machine learning proposed by the present application realizes the dynamic adjustment of the weight, the robustness enhancement after the removal of abnormal values, and the adaptability across monitoring points and regions, and better meets the application requirements.
[0057] The above is only the preferred embodiment of the present application, and is not used to limit the present application. Any modification, equivalent replacement or improvement made within the technical scope of the present application shall be included in the scope of protection of the present application.
Claims
1. A dynamic evaluation method for water quality indices based on multimodal machine learning, characterized in that, This method is implemented based on a data preprocessing module, a water quality parameter scoring module, a weight calculation module, and an intelligent fusion module. The method includes the following steps: Step S1: The data preprocessing module performs data cleaning and normalization on the raw monitoring data; Step S2: Construct a piecewise function scoring model using the water quality parameter scoring module to map the monitored concentration values to a standard score of 0-100. Step S3: Utilize the weight calculation module to perform the multimodal weight calculation step and the dynamic weight fusion step. Step S30: The entropy weighting method, isolation forest, autoencoder and contrastive learning algorithm are used in parallel to analyze the normalized data from four different dimensions: information content, anomaly resistance, internal structure and contrastive differentiation, to generate four sets of preliminary weights. Step S31: The four sets of weights are fused using the inverse variance weighting method to output dynamic weights; In step S4, the intelligent fusion module weights and aggregates the standard score and the dynamic weight to calculate the water quality index, and classifies the water quality level according to the preset threshold.
2. The dynamic evaluation method for water quality index based on multimodal machine learning as described in claim 1, characterized in that, In step S1, the data cleaning process includes: Step S10: Input the raw monitoring data; Step S11, validity check: automatically identify the time column and each monitoring parameter column in the original monitoring data, identify invalid data and replace it with missing value NaN; Step S12, matrix construction, constructing the effective parameters as follows matrix Where n is the number of valid days and m is the number of valid parameters; Step S13: Data cleaning, removing rows containing missing NaN values to obtain a clean data matrix. In step S1, the normalization process includes: The parameters are scaled to the [0,1] interval using the Min-Max normalization method to form a matrix. :
3. The dynamic evaluation method for water quality index based on multimodal machine learning as described in claim 1, characterized in that, In step S2, the scoring rule module is invoked according to preset standards to construct a piecewise function for each parameter. This step unifies water quality parameters of different dimensions into a standardized scoring matrix. This serves as the input for subsequent dynamic weight calculations.
4. The dynamic evaluation method for water quality index based on multimodal machine learning as described in claim 3, characterized in that, In step S30, the processing based on the entropy weight method includes: Calculate the weighting: for the normalized matrix For each column, calculate the proportion of its value in the total sum of that column. ; Calculate information entropy: Calculate the information entropy of each parameter. ; Calculate the weights: Calculate the weights based on the entropy values. ; Among them, the smaller the entropy, the larger the difference coefficient of the parameter, and the higher the weight.
5. The dynamic evaluation method for water quality index based on multimodal machine learning as described in claim 4, characterized in that, In step S30, the processing based on isolated forests includes: Model training: using matrices Train an IsolationForest model; Extracting feature importance: Traverse each tree in the isolated forest and count the number of times each parameter is used in the split nodes of the tree; Calculate the weights: Average the usage frequency of each parameter in all trees and then normalize it to obtain the weight vector. ; The more times a parameter is used to split nodes, the greater its contribution to isolating samples, and the higher its weight.
6. The dynamic evaluation method for water quality index based on multimodal machine learning as described in claim 4, characterized in that, In step S30, the processing based on the autoencoder includes: Model Construction and Training: Construct a single-hidden-layer autoencoder to train the model. 𝑛𝑜𝑟𝑚 Simultaneously used as both input and target output for training; Calculate reconstruction error: Use the trained model to reconstruct the error. 𝑛𝑜𝑟𝑚 To make predictions, calculate the mean square error (MSE) of each parameter at each sample point; Calculate the weights: Calculate the average reconstruction error of each parameter across all samples; Here, the reciprocal of the error is taken and normalized to obtain the weight vector. .
7. The dynamic evaluation method for water quality index based on multimodal machine learning as described in claim 4, characterized in that, In step S30, the contrastive learning-based processing includes: Model building and training: Build a simple projection network model and train it using a custom contrastive loss function so that the model learns to map the input data into a discriminative low-dimensional space; Weight Extraction: After training, extract the weight matrix of the first layer of the network; Calculate the weights: Calculate the norm of the weight matrix along the output direction. The larger the norm, the greater the contribution of the input parameter to forming a discriminative projection. Normalize this norm vector to obtain the weight vector. .
8. The dynamic evaluation method for water quality index based on multimodal machine learning as described in claim 1, characterized in that, Step S31 includes: Constructing the weight matrix: Stack the four weight vectors into one. matrix ; Calculate the variance: Calculate the variance of the weights obtained by each method on each parameter. ; Calculate the inverse variance weights: for each parameter j Calculate its fusion weight .
9. The dynamic evaluation method for water quality index based on multimodal machine learning as described in claim 1, characterized in that, Step S4 includes: Parameter scoring: For each parameter value for each day, it is converted into a score between 0 and 100 according to a preset scoring rule. ; Weighted summation: summing the scores of each parameter for each day. The fusion weights obtained from the fusion Multiply and sum to obtain the core water quality index for that day. : Water quality grading: based on calculations The value is compared with the preset water quality standard to determine the final water quality level.
10. A dynamic evaluation system for water quality indices based on multimodal machine learning, characterized in that, include: The data preprocessing module is used to clean and normalize the raw monitoring data; The water quality parameter scoring module constructs a piecewise function scoring model, mapping the monitored concentration values to a standard score of 0-100. The weight calculation module is used to execute the multimodal weight calculation step and the dynamic weight fusion step: In the multimodal weight calculation step, the entropy weight method, isolation forest, autoencoder and contrastive learning algorithm are used in parallel to analyze the normalized data from four different dimensions: information content, anomaly resistance, internal structure and contrast differentiation, respectively, to generate four sets of preliminary weights. In the dynamic weight fusion step, the inverse variance weighting method is used to fuse the four sets of weights and output dynamic weights. The intelligent fusion module is used to weight and aggregate the standard score and the dynamic weight to calculate the water quality index, and classify the water quality level according to the preset threshold.
Citation Information
Patent Citations
Multi-model collaborative inversion method used for water quality parameters and based on deterministic set modeling
CN107036974A