Water quality parameter prediction modeling method based on improved neural network of AdaBoost
The improved neural network water quality parameter prediction modeling method using AdaBoost solves the problems of overfitting and local extrema in BPNN, achieving higher accuracy and stable water quality parameter prediction. It is applicable to the measurement of various water bodies and water quality parameters, and requires no additional reagents, thus avoiding secondary pollution.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- XIAN INST OF OPTICS & PRECISION MECHANICS CHINESE ACAD OF SCI
- Filing Date
- 2022-12-01
- Publication Date
- 2026-05-15
AI Technical Summary
In existing water quality parameter modeling, backpropagation neural networks (BPNN) are prone to overfitting and getting stuck in local extrema, leading to training failure. Furthermore, traditional methods are costly, complex, and may cause secondary pollution.
A neural network-based water quality parameter prediction modeling method based on AdaBoost is adopted. By adjusting the sample weights and weak predictor weights through the AdaBoost algorithm, multiple BPNN models are combined to form a strong predictor, thereby reducing errors and improving model stability.
It improves the nonlinear fitting ability and stability of water quality parameter concentration prediction, reduces errors, enhances prediction accuracy, and avoids secondary pollution. It is suitable for predicting various water bodies and water quality parameters.
Smart Images

Figure CN115953049B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to a water quality parameter modeling method, specifically to a neural network-based water quality parameter prediction modeling method based on AdaBoost. Background Technology
[0002] For monitoring water quality parameters, most traditional chemical methods are generally expensive, complex to operate, and time-consuming, requiring reagents and easily causing secondary pollution of water bodies. In practical applications, water body types are complex and varied, and the parameters for measuring water quality are also diverse. The pollution factors of the water environment are complex, random, and comprehensive; different water qualities have different pollution sources and influencing factors, resulting in a wide variety of spectral data.
[0003] like Figure 1 As shown, existing backpropagation neural networks (BPNNs) for water quality parameter modeling have strong nonlinear fitting capabilities and can apply learned results to new knowledge. However, BPNNs used for water quality parameter modeling suffer from overfitting and are prone to getting trapped in local optima, leading to training failures. Summary of the Invention
[0004] The purpose of this invention is to solve the technical problems of "overfitting" and easy getting trapped in local extrema in existing BPNN neural networks used for water quality parameter modeling, which leads to network training failure. The invention provides a neural network water quality parameter prediction modeling method based on AdaBoost, which can combine the prediction results of multiple BPNN models in proportion, take the best from each model, and thus reduce errors and improve the stability of the model.
[0005] To solve the above-mentioned technical problems, the technical solution adopted by the present invention is as follows:
[0006] The AdaBoost-based improved neural network water quality parameter prediction modeling method is characterized by the following steps:
[0007] 1) Preprocess the measured water quality sample data; divide the preprocessed sample set into a training set and a test set; the training set is... The number of training rounds is J, x i Let y represent the spectrum of the i-th sample. i Let m represent the concentration of the i-th sample, m represent the number of samples, m is an integer greater than or equal to 1, and i = 1, 2, ..., m;
[0008] 2) Initialize the weights of m samples in the training set obtained in step 1), train J weak predictors using the AdaBoost algorithm, and obtain a strong predictor of water quality parameter concentration; the weak predictors in the AdaBoost algorithm adopt the BPNN water quality parameter concentration prediction model.
[0009] 3) Test the strong predictor using test set data to obtain a water quality parameter concentration prediction model.
[0010] Furthermore, step 2) specifically involves:
[0011] 2.1) Initialize the weights of the m samples in the training set obtained in step 1).
[0012] 2.2) The BPNN water quality parameter concentration prediction model is used to predict the concentration of water quality parameters on the m training sets initialized in step 2.1). Make predictions and calculate the prediction error rate of the weak predictor.
[0013]
[0014] Among them, err i j Let i be the prediction error rate of the i-th sample using the j-th weak predictor. Let J be the predicted concentration of the water quality parameter for the i-th sample using the j-th weak predictor, where j = 1, 2, ..., J;
[0015] 2.3) Set the error threshold t, weight factor s, and error factors of J weak predictors, and set the j-th error factor E j Initialize to 0;
[0016] 2.4) Based on the err obtained in step 2.2), i j The weights of the m samples in step 2.1) are updated according to the error threshold t in step 2.3) using the following formula:
[0017] W i j+1 =W i j ×s
[0018] When err i j When ≥ t, s = 1.1, E j =E j +W i j ;
[0019] When err i j When t < , s = 1;
[0020] Among them, W i j This represents the sample weight of the i-th sample in the training set when using the j-th weak predictor;
[0021] 2.5) Normalization step 2.4) results in the obtained sample weights:
[0022]
[0023] 2.6) Calculate the weights of the j-th weak predictor
[0024]
[0025] 2.7) Based on the weights of the j-th weak predictor obtained in step 2.6), By linearly combining the weak predictors, a strong predictor Y is obtained:
[0026]
[0027] Furthermore, step 3) specifically involves:
[0028] Substitute the test set obtained in step 1) into the strong predictor obtained in step 2.7), output the prediction results, and obtain the water quality parameter concentration prediction model.
[0029] Furthermore, it also includes step 4): evaluating the water quality parameter concentration prediction model;
[0030] Using RMSEP and R 2 Evaluation indicators are used to assess the predictive performance of the water quality parameter concentration prediction model established in step 3).
[0031] Compared with the prior art, the beneficial effects of the technical solution of the present invention are:
[0032] 1. This invention is based on an improved neural network water quality parameter prediction modeling method using AdaBoost. After improving the traditional BPNN modeling by using the AdaBoost algorithm, it models water quality parameters for various water bodies, making the water quality parameter concentration prediction model have good nonlinear fitting ability and prediction stability. It can also be better applied to the prediction of various water bodies and various water quality parameters. It also solves the technical problem that the network training will fail when using BPNN modeling because it is easy to get trapped in local extrema.
[0033] 2. This invention is based on an improved neural network water quality parameter prediction modeling method using AdaBoost. By combining the strong nonlinear fitting ability of BPNN, it improves the problem of weak generalization ability of BPNN modeling. AdaBoost can proportionally combine the prediction results of multiple BPNN models to reduce errors, enhance the stability of water quality parameter model prediction, and improve the accuracy of water quality parameter concentration prediction.
[0034] 3. This invention presents a neural network-based water quality parameter prediction modeling method based on AdaBoost. It offers advantages such as convenient and rapid measurement, no need for additional reagents, and no secondary pollution to the water body, thus making it suitable for measuring water quality parameter concentrations. This method utilizes the principle of the absorption of ultraviolet-visible spectral radiation by the measured substance, substituting the spectral data into the prediction model to predict the concentration of new samples, exhibiting high sensitivity and accuracy.
[0035] 4. This invention, based on an improved AdaBoost neural network-based water quality parameter prediction modeling method, can convert the predicted TOC concentration in mixed solution samples from R... 2 =0.9110, RMSEP=0.0962, upgraded to R 2 =0.9676, RMSEP=0.0521. Attached Figure Description
[0036] Figure 1 This is a schematic diagram of the existing AdaBoost algorithm.
[0037] Figure 2 This is a flowchart of the BPNN-AdaBoost concentration prediction model modeling process in the AdaBoost-based improved neural network water quality parameter prediction modeling method of this invention.
[0038] Figure 3 This is an example of the original spectral curves of 50 TOC turbidity mixed solutions in an embodiment of the AdaBoost-based improved neural network water quality parameter prediction modeling method of the present invention.
[0039] Figure 4 This is a partial TOC turbidity mixed solution spectral curve after spectral information extraction, as shown in an embodiment of the AdaBoost-based improved neural network water quality parameter prediction modeling method of the present invention.
[0040] Figure 5 This is a schematic diagram illustrating the prediction results of TOC concentration in a sample after modeling using traditional BPNN.
[0041] Figure 6 This is a schematic diagram of the predicted TOC concentration in the sample in an embodiment of the AdaBoost-based improved neural network water quality parameter prediction modeling method of the present invention. Detailed Implementation
[0042] like Figure 1 As shown, the existing AdaBoost algorithm works by adjusting the weights of the m samples in the training set and the weights of the weak predictors to combine the weak predictors into a strong predictor. The weak predictors are trained on the m-sample training set, and each subsequent weak predictor is trained on a different weight set of the previous sample. The weight of each sample is determined by its learning performance, which is estimated from the output of the weak predictors in the previous steps.
[0043] The basic idea behind using a neural network-based water quality parameter prediction modeling method improved by AdaBoost to model and predict water quality parameter concentrations is as follows:
[0044] First, the measured sample data is preprocessed and sample weights are initialized. Then, a BPNN is used as a weak predictor to train the preprocessed training set data to obtain the weak predictor weights. The sample weights are then adjusted based on the prediction results before entering the next round of weak predictor training. After reaching the preset number of iterations, the prediction results of all weak predictors are linearly combined according to the weak predictor weights to obtain the final strong predictor. Finally, the prediction performance of the strong predictor is evaluated using test set data.
[0045] In verifying and evaluating the above algorithm, this invention uses a portion of the sample data as a training set to build the model and another portion as a test set to verify the prediction accuracy of the model. Finally, it obtains the AdaBoost algorithm water quality parameter concentration prediction model with BPNN as a weak predictor.
[0046] like Figure 2 As shown, the specific steps of the AdaBoost algorithm of this invention are as follows:
[0047] Step 1) Preprocess the measured water quality sample data; divide the preprocessed sample set into a training set and a test set; where the training set is... The number of training epochs (number of weak predictors) is J, x i Let y represent the spectrum of the i-th sample. i Let m represent the concentration of the i-th sample, m represent the number of samples, m is an integer greater than or equal to 1, and i = 1, 2, ..., m;
[0048] In this embodiment, the ultraviolet-visible spectral data of the sample set are acquired; the ultraviolet-visible spectral data are preprocessed to remove the noise generated by the instrument and the influence of solid precipitate particles in the liquid on the ultraviolet-visible spectral curve; and the samples are divided into training set and test set.
[0049] 2) After initializing the weights of m samples in the training set obtained in step 1), J weak predictors are trained using the AdaBoost algorithm to obtain a strong predictor of water quality parameter concentration; the weak predictors in the AdaBoost algorithm adopt the BPNN water quality parameter concentration prediction model.
[0050] 2.1) Initialize the training set obtained in step 1). Weights of m samples
[0051]
[0052]
[0053] 2.2) The BPNN water quality parameter concentration prediction model is used, combined with the weights of the m samples initialized in step 2.1) to adjust the training set. Make predictions and obtain Then, the prediction error rate of the weak predictor is calculated.
[0054]
[0055] Among them, err i j Let i be the prediction error rate of the i-th sample using the j-th weak predictor. Let J be the predicted concentration of the water quality parameter for the i-th sample using the j-th weak predictor, where j = 1, 2, ..., J;
[0056] 2.3) Set the error threshold t, weight factor s, and error factors of J weak predictors, and set the j-th error factor E j Initialize to 0;
[0057] 2.4) Based on the err obtained in step 2.2), i j The weights of the m samples in step 2.1) are updated according to the error threshold t in step 2.3) using the following formula:
[0058] W i j+1 =W i j ×s
[0059] When err i j When ≥ t, s = 1.1, E j =E j +W i j ;
[0060] When err i j When t < , s = 1;
[0061] Among them, W i j This represents the sample weight of the i-th sample in the training set when using the j-th weak predictor;
[0062] 2.5) Normalization step 2.4) results in the obtained sample weights:
[0063]
[0064] 2.6) Calculate the weights of the j-th weak predictor
[0065] Depend on achievable
[0066]
[0067] 2.7) Based on the weights of the j-th weak predictor obtained in step 2.6), By linearly combining the weak predictors, a strong predictor Y is obtained:
[0068]
[0069] Step 3) Use the test set data to evaluate the prediction effect of the strong predictor and obtain the water quality parameter concentration prediction model.
[0070] Substitute the test set obtained in step 1) into the strong predictor obtained in step 2.7), output the prediction results, and obtain the water quality parameter concentration prediction model.
[0071] Step 4): Evaluate the water quality parameter concentration prediction model;
[0072] Accuracy evaluation is primarily based on the root mean square error (RMSEP) and coefficient of determination (R²) of the validation parameters. 2 To ensure a comprehensive description of the model, RMSEP and R are used. 2 Evaluation indicators are used to assess the predictive performance of the water quality parameter concentration prediction model established in step 3).
[0073] To further illustrate the AdaBoost-based improved neural network water quality parameter prediction modeling method of this invention, the following example is provided:
[0074] The proposed BPNN-AdaBoost modeling and prediction method was validated using a mixed solution of TOC and turbidity. The concentration range of TOC was 0.1–0.9 mg / L, with a concentration interval of 0.2 mg / L; the concentration range of turbidity was 0.5–5 NTU, with a concentration interval of 0.5 NTU. A total of 50 samples were obtained by arranging the concentrations of the two substances in the solution. The original spectral curves of these 50 samples are shown below. Figure 3As shown; the spectral curves of samples with a pretreated TOC concentration of 0.3 mg / L and a turbidity concentration range of 0.5-5 NTU are shown below. Figure 4 As shown, the specific corresponding concentration values are illustrated in the legend. From Figure 3 and Figure 4 As can be seen, when the TOC concentration is the same but the chromaticity and turbidity are different, turbidity will have a significant impact on the full spectrum curve of the sample.
[0075] Ten samples were randomly selected from 50 samples as the test set, and the remaining 40 samples were used as the training set. The prediction results of TOC concentration in the samples were compared using only traditional BPNN and the proposed BPNN-AdaBoost method. The parameter settings of BPNN remained consistent under both modeling methods. R² was calculated based on the prediction results. 2 The RMSEP values are shown in Table 1. Among them, R... 2 R0 is the coefficient of determination, RMSEP is the root mean square error of prediction, and R0 is the root mean square error of prediction. 2 The larger the value and the smaller the RMSEP, the higher the accuracy of the model and the stronger its generalization ability.
[0076] Table 1 Comparison of TOC concentration prediction results in mixed solution samples using different methods
[0077] Modeling methods <![CDATA[R 2 ]]> RMSEP BPNN 0.9110 0.0962 BPNN-AdaBoost 0.9676 0.0521
[0078] As shown in Table 1 of the above experiments, the prediction results of BPNN-AdaBoost are significantly improved compared to traditional BPNN, specifically in R... 2 It increases, while RMSEP decreases.
[0079] Under the two modeling and prediction methods, the relative errors between the predicted values and the actual measured values of the 10 samples in the test set are as follows: Figure 5 , Figure 6 As shown, the prediction results using the BPNN-AdaBoost method are superior to those using traditional BPNN modeling. The relative error of some samples exceeding 100% when using BPNN for prediction also indicates the high stability of the BPNN-AdaBoost method. In this embodiment, the prediction results of TOC concentration in the mixed solution sample are transformed by R... 2 =0.9110, RMSEP=0.0962, upgraded to R 2 =0.9676, RMSEP=0.0521.
Claims
1. A neural network-based water quality parameter prediction and modeling method based on AdaBoost, characterized in that, Includes the following steps: 1) Preprocess the measured water quality sample data; divide the preprocessed sample set into a training set and a test set; the training set is... , This represents the spectrum of the i-th sample. Let m represent the concentration of the i-th sample, and m represent the number of samples, where m is an integer greater than or equal to 1. ; 2) After initializing the weights of m samples in the training set obtained in step 1), J weak predictors are trained using the AdaBoost algorithm to obtain a strong predictor of water quality parameter concentration; the weak predictors in the AdaBoost algorithm adopt the BPNN water quality parameter concentration prediction model; specifically: 2.1) Initialize the weights of the m samples in the training set obtained in step 1). ; 2.2) The BPNN water quality parameter concentration prediction model is used to analyze the m training sets initialized in step 2.1). Perform predictions and calculate the prediction error rate of the weak predictor: ; in, Let i be the prediction error rate of the i-th sample using the j-th weak predictor. This is the predicted value of the water quality parameter concentration for the i-th sample using the j-th weak predictor. ; 2.3) Set the error threshold t and weighting factor. J error factors of weak predictors, and the j-th error factor Initialize to 0; 2.4) Based on the results obtained in step 2.2) The weights of the m samples in step 2.1) are updated using the following formula, based on the error threshold t in step 2.3): ; when hour, , ; when hour, ; in, This represents the sample weight of the i-th sample in the training set when using the j-th weak predictor; 2.5) Normalization step 2.4) The resulting sample weights: ; 2.6) Calculate the weights of the j-th weak predictor : ; 2.7) Based on the weights of the j-th weak predictor obtained in step 2.6), A strong predictor is obtained by linearly combining the weak predictors. : ; 3) Test the strong predictor using test set data to obtain a water quality parameter concentration prediction model.
2. The method for predicting and modeling water quality parameters based on an improved neural network using AdaBoost as described in claim 1, characterized in that, Step 3) specifically involves: Substitute the test set obtained in step 1) into the strong predictor obtained in step 2.7), output the prediction results, and obtain the water quality parameter concentration prediction model.
3. The method for predicting and modeling water quality parameters based on an improved neural network using AdaBoost as described in claim 2, characterized in that, It also includes step 4): evaluating the water quality parameter concentration prediction model; Using RMSEP and R 2 Evaluation indicators are used to assess the predictive performance of the water quality parameter concentration prediction model established in step 3).