Hongmei
Wang
,
Qiaoling
Du
* and
Xin
Wang
State Key Laboratory on Integrated Optoelectronics, College of Electronic Science and Engineering, Jilin University, Changchun 130012, China. E-mail: 1056205694@qq.com; duql@jlu.edu.cn; 1426210775@qq.com
First published on 16th December 2025
Purpose: determining small concentrations of chemical oxygen demand (COD) is crucial for domestic drinking water safety. Ultraviolet-visible spectroscopy (UV-vis spectroscopy) is important for COD determination, but the multi-wavelength method has low accuracy and stability for small-concentration COD due to turbidity interference. This paper presents an enhanced parrot optimizer (EPO) algorithm for back propagation neural network (BPNN) parameter optimization to improve small-concentration COD prediction, which includes accuracy and stability. Results: firstly, the EPO algorithm uses the LHS population initialization strategy, which generates the initial population with the help of Latin hypercube sampling and improves the population diversity from the source; secondly, the EPO algorithm adopts the persistence-random-boundary (PRB) location update strategy, improves the position update formula in the residence phase, and integrates the simulated annealing idea to dynamically adjust the search step length to realize the precise balance between global exploration and local development ability; finally, this article proposed the contraction and whirl (CAW) individual elimination strategy, combined with the elite retention logic of the whale optimization algorithm, to periodically eliminate the inferior individuals to avoid premature maturation of the algorithm, and to strengthen the evolutionary momentum of the population. The synergistic effect of the above strategies can accurately optimize the weights and thresholds of the BPNN, and finally build a small concentration COD prediction model that is resistant to low turbidity interference. The core logic of the model's anti-turbidity interference lies in that the BPNN simultaneously learns the mapping relationship of “COD concentration – turbidity concentration – spectrum” and automatically identifies and deducts the contribution of turbidity to the spectrum when predicting COD, thereby offsetting its nonlinear interference and ultimately achieving accurate prediction of low concentration COD. Conclusions: the EPO–BPNN model is outstanding in convergence speed and accuracy. On the standard drinking water quality simulation data set, the coefficient of determination (R2) reached 0.9976, the root mean square error (RMSE) was as low as 0.3930 mg L−1, the mean absolute percentage error (MAPE) was only 3.47%, the percentage bias (PBIAS) was −0.081%, and the maximum relative standard deviation (RSD) was 2.26% (<3%). In the interference of multiple substances in the monitoring data of the inter-reservoir, the standard deviation (SD) of COD concentration values predicted by the model was 0.2876 and 0.3437, respectively; the fluctuations were 81.88% and 79.61% lower than those of the traditional model.
Water impactThis paper proposes the EPO–BPNN model to improve the detection accuracy and anti-interference ability of low-concentration COD, providing a reliable technical solution for drinking water safety monitoring and helping to deepen the scientific understanding of water quality control and its related water environment impacts. |
BPNNs can deal with nonlinear relationships in data, are adaptable to small sample data sets, and can achieve high prediction performance using a small number of feature wavelength.14 This method can be used to solve the problem of poor accuracy and stability in the detection of small concentration COD values in drinking water with turbidity interference. In the field of water quality concentration prediction, accurate and practical application demand-oriented prediction methods have attracted much attention. Existing research has explored the innovation and integration of multiple types of prediction frameworks, such as integrating multimodal data through basic models and optimizing cross-domain generalization capabilities to enhance the reliability of medical scenario predictions,15 or integrating traditional probabilistic models with machine learning methods and constructing profit-oriented prediction frameworks to strengthen the practical decision-making value of prediction results.16 Or, use swarm intelligence algorithms to optimize the network model, focusing on the improvement of predictive capabilities in specific environments.17–20 Drawing on the prediction research approach of “method fusion optimization” and “focusing on actual needs”, this paper adopts the optimized PO algorithm to improve the BPNN model.
The parrot optimizer (PO) is an emerging swarm intelligence optimization algorithm proposed in 2024, which demonstrates superior performance on the classic CEC2022 test set, highlighting the strong ability of the parrot optimizer to deal with nonlinear relationships.21 PO mimics the intelligent behaviors of parrots in foraging and socializing, and it has a strong global search capacity. It can better balance the exploration of new regions and the use of existing advantageous solutions in limited samples and complex feature data, avoiding prematurely falling into local optima, so as to more accurately search for the appropriate combination of weights and thresholds and improve the performance of the BPNN algorithm. In this paper, a training set of 90 samples is utilized to detect small concentration COD values, which is a small number of samples. Predicting COD concentration using 20 features in the training set, the optimized weights and threshold dimensions are relatively high. The PO algorithm shows a unique advantage in this case. Therefore, this paper investigates the prediction method of the PO–BPNN for small-concentration COD values to improve the accuracy of small-concentration COD prediction algorithms. However, the PO algorithm also has some drawbacks. At the start of the algorithm, the conventional population initialization method may result in a lack of initial population diversity, which makes it impossible to adequately sample each region at the beginning of the solution space exploration. This leads to the possibility that some potentially high-quality solution regions may be overlooked, which in turn affects the efficiency of the algorithm in utilizing the entire solution space. As the search advances, the limitations of the PO algorithm's search range gradually emerge. When encountering a more complex parameter space with a discrete distribution of solutions, it is difficult to effectively expand to a wider region to explore possible better solutions, resulting in a relatively limited search path that is unable to fully explore all possible combinations of high-quality weights and thresholds. At the later stage of iteration, the convergence of the PO algorithm slows down significantly. In the context of data optimization tasks that require timeliness, this slow convergence process slows down the overall optimization process and reduces efficiency. To solve the above problems, this paper proposes an improved EPO algorithm to optimize the BPNN and construct a quantitative prediction algorithm for small-concentration COD to improve the detection accuracy and stability of small-concentration COD values in mixed solutions. Firstly, an improved EPO algorithm is proposed with the PRB position update strategy, CAW individual elimination strategy and the LHS population search strategy and is introduced to improve the performance of the PO algorithm. Secondly, this paper constructs a prediction algorithm for small-concentration COD values based on the EPO–BPNN. Compared with other methods, the EPO–BPNN algorithm improves the detection accuracy of small-concentration COD values in mixed solutions and has high stability.
The data sources for this study are divided into three parts: elevation and base map data, simulation experiment data, and reservoir sampling data.
This paper selects the BPNN as the basic prediction model. The core basis lies in its adaptability to the detection scenarios of low-concentration COD and its efficient synergy with the EPO optimization strategy, specifically as follows:
1. Scene task adaptability: this study requires the inversion of low-concentration COD from ultraviolet spectral data with turbidity interference, which has the characteristics of low signal and high interference. Essentially, it is a nonlinear mapping from high-dimensional spectra to low concentration values. The BPNN, through multi-layer nonlinear transformation, can effectively capture the weak correlation between spectra and COD, can meet the amplification requirements of low-concentration signals, and does not require presetting mapping relationships. It can adaptively learn the difference patterns between turbidity interference and COD signals.
2. Advantages of collaborative optimization with the EPO: the performance of the BPNN depends on the initial weights and thresholds. The traditional gradient descent is prone to fall into the local optimum, resulting in prediction deviations for low-concentration COD. The global optimization feature of the EPO can specifically solve this problem. Meanwhile, the BPNN has a simple structure and fewer parameters compared to deep learning models, matching the optimization efficiency of the EPO: it can not only precisely optimize key parameters through the EPO but also avoid a sharp increase in optimization costs due to excessive parameters, ensuring efficient convergence to a stable solution with small samples.
The BPNN can solve the problem of nonlinear data processing, but there are problems such as slow convergence speed and ease of falling into local optimal solutions. The main cause of these problems is the initial values of weights and thresholds. In the prediction of COD concentration, the spectral information dimension is high, and the initial weights and thresholds of the BPNN are mostly taken randomly, which will lead to a slow convergence speed of the model, and it is difficult to jump out of the local optimal solution, affecting the prediction effect. Therefore, to improve the model prediction ability and quickly find the global optimal solution, this paper adopts the enhanced PO algorithm to optimize the parameters of the initial values of weights and thresholds.
In this study, a standard three-layer BPNN was used to construct the model. The number of neuron nodes in the input layer was set to 20. The characteristic wavelengths are shown in Table 1. The number of neuron nodes in the hidden layer was determined to be 7 with the help of empirical formulae. The number of neuron nodes in the output layer was 2. The transformed outputs corresponded to the predicted values of turbidity and COD concentration.
| Num | Wavelength | Num | Wavelength | Num | Wavelength | Num | Wavelength |
|---|---|---|---|---|---|---|---|
| 1 | 200 nm | 6 | 224 nm | 11 | 306 nm | 16 | 311 nm |
| 2 | 201 nm | 7 | 225 nm | 12 | 307 nm | 17 | 312 nm |
| 3 | 202 nm | 8 | 226 nm | 13 | 308 nm | 18 | 313 nm |
| 4 | 222 nm | 9 | 227 nm | 14 | 309 nm | 19 | 314 nm |
| 5 | 223 nm | 10 | 228 nm | 15 | 310 nm | 20 | 316 nm |
The BPNN has a fully connected mode between the layer and layer neurons, with no connections between neurons in the same layer. The hidden layer activation function was selected as the hyperbolic tangent function (TANH) and the output layer activation function was set as the rectified linear unit (RELU). The data set was divided according to the ratio of the training set: test set = 9
:
1. The experimental code was written in Python 3.7. For the hardware environment, the CPU model was Intel (R) Core (TM) i7-9750H CPU@2.60 GHz 2.59 GHz. The system environment has been successfully configured with Python third-party libraries such as pandas, numpy, Scikit-learn, pyDOE, and so on.
| x0i = lb + rand(0, 1) × (ub − lb) | (1) |
In eqn (1), x0i denotes the initial position of the i individual in the parrot population, ub and lb denote the upper and lower bounds of the search space, and rand(0, 1) denotes the generation of a random number between 0 and 1.
![]() | (2) |
![]() | (3) |
x t i denotes the current position of the i body. xt+1i denotes the position of the first body at the next moment. xbest denotes the best position searched so far, and it also denotes the position of the parrot owner. t and Maxiter denote the current iteration and the maximum iteration. dim denotes the dimensionality of the problem under study. ϒ is set to 1.5.
![]() | (4) |
x t mean denotes the average position of the current population, as shown in eqn (4). N is the number of individuals in the parrot population and k represents the k individual in the population.
| xt+1i = xti + xbest + Levy(dim) + rand(0, 1) × ones(dim) | (5) |
In eqn (5), xbest × Levy(dim) denotes flying to the current best position, i.e., the owner's position. ones(dim) denotes a vector of dimension 1. rand(0, 1) × ones(dim) denotes random staying at a certain position on the owner's body.
![]() | (6) |
![]() | (7) |
The PO algorithm demonstrates superior performance on the classic CEC2022 test set for processing limited samples with complex feature data. Therefore, the PO can be combined with the BPNN to optimize the performance of the neural network. However, the conventional population initialization method used by the algorithm at start-up may result in a lack of initial population diversity, leading to potential high-quality solution regions that may be overlooked. As the search progresses, the limitations of the search scope gradually appear. When encountering a more complex, discrete distribution of solutions in the parameter space, it is difficult to effectively expand to a wider region to explore the possible existence of better solutions, resulting in the search path being relatively limited and not being able to be fully excavated to find out all the possible combinations of high-quality weights and thresholds. In the late iteration, the convergence of the algorithm slows down significantly. In the context of time-sensitive data optimization tasks, this slow convergence process slows down the overall optimization process and reduces efficiency. Therefore, appropriate improvements to the PO algorithm are also needed, which are described in detail in section 3.3 of this paper.
The pseudocode of the PO algorithm is as follows:
| Algorithm 1: PO algorithm |
|---|
| 1: Initialize the PO parameters |
| 2: Initialize the solution's positions randomly |
| 3: For i = 1:Max_iter do |
| 4: Calculate the fitness function |
| 5: Find the best position |
| 6: For j = 1:N do |
| 7: St= randi([1, 4]) |
| 8: Behavior 1: the foraging behavior |
| 9: If St= =1 then |
| 10: Update position by eqn (2) |
| 11: Behavior 2: the staying behavior |
| 12: Else if St= =2 then |
| 13: Update position by eqn (5) |
| 14: Behavior 3: the communicating behavior |
| 15: Else if St= =3 then |
| 16: Update position by eqn (6) |
| 17: Behavior 4: fearful behavior towards strangers |
| 18: Else if St= =4 then |
| 19: Update position by eqn (7) |
| 20: END |
| 21: END |
| 22: Return the best solution |
| 23: End |
(1) Determine the population size N and dimensions dim of the problem.
(2) Determine the upper ub and lower limits lb for each dimension.
(3) Divide each dimension [lb, ub] interval into N equal parts.
(4) Randomly sample a point in a sub-interval
of each dimension.
(5) Combine the sampled points of each dimension to form the initial population.
to obtain eqn (8).![]() | (8) |
Using eqn (8), it is possible to improve the convergence accuracy of the algorithm. At the beginning of the iterations, this modification allows the algorithm to select the stay strategy with a large random perturbation, to better explore the solution space, and to exhibit a strong global search capability. As the number of iterations increases, the magnitude of the random search gradually decreases, which enhances the local search capability and allows the algorithm to focus more on fine search near the optimal solution. A balance between global and local search is achieved, effectively expanding the population search range.
![]() | (9) |
![]() | (10) |
![]() | (11) |
The PRB position update strategy significantly improves the search range of the algorithm and enhances the exploration of the complex parameter space by improving the above three aspects. At the same time, the PRB position update strategy regulates the randomness and certainty in the search process through a reasonable mechanism, so that the algorithm can search methodically when facing the complex parameter space, which in turn ensures the stability of the algorithm.
(1) Select N/2 individuals in a population of parrots to implement a culling mechanism.
(2) For the selected individuals, judge the values of A and P.
When P < 0.5 and A ≤ 1, use the shrink–wrap mechanism to update the position of the individual at the next moment, as shown in eqn (13).
When P ≥ 0.5 and A ≤ 1, the spiral update mechanism is used to update the position of the individual at the next moment, as shown in eqn (13). In eqn (13), b is a constant that defines the shape of the logarithmic spiral. l is a random number between [−1, 1].
When A > 1, the best replacement mechanism is used to update the next moment position of an individual. That is, for the parrot individual selected to implement the elimination mechanism, its next moment position is updated as the best position of the current population.
(3) Calculate the value of the objective function corresponding to the individual after the position update.
![]() | (12) |
![]() | (13) |
![]() | (14) |
| Algorithm 2: WOA algorithm |
|---|
| 1: Initialize the WOA parameters |
| 2: Initialize the solution's positions randomly |
| 3: For i = 1:Max_iter do |
| 4: Generate random numbers and calculate the convergence factor a |
| 5: Update individual positions based on the shrink–wrap and spiral update position update strategies |
| 6: Check boundaries, preserve better solutions, and update the global optimal individual |
| 7: Return the best solution |
| 8: End |
As shown in eqn (14), if the individual objective function value after the position update is reduced, the position and objective function value are updated to the current value. In contrast, the current position is modified to the optimal individual position, and the objective function value is adjusted to the optimal objective function value. Eqn (14) aims to eliminate some of the current non-optimal solutions and replace them with the current optimal solutions. Such an operation is conducive to strengthening the current optimal solution in the local region of the search efficiency and rate, which in turn promotes the algorithm to accelerate the convergence, prompting the algorithm to converge on the global optimal solution more efficiently and enhance the overall accuracy and speed of the algorithm to find the optimal solution.
The pseudocode of the EPO algorithm is as follows:
| Algorithm 3: EPO algorithm |
|---|
| 1: Initialize the EPO parameter |
| 2: Initialize the solutions' positions by the LHS initialization strategy |
| 3: For i = 1: Max_iter do |
| 4: Calculate the fitness function |
| 5: Find the best position |
| 6: For j = 1:N do |
| 7: St= randi([1, 4]) |
| 8: Behavior 1: the foraging behavior |
| 9: If St= =1 then |
| 10: Update position by eqn (2) |
| 11: Behavior 2: the staying behavior |
| 12: Else if St= =2 then |
| 13: Update position by eqn (8) |
| 14: Behavior 3: the communicating behavior |
| 15: Else if St= =3 then |
| 16: Update position by eqn (6) |
| 17: Behavior 4: fearful behavior towards strangers |
| 18: Else if St= =4 then |
| 19: Update position by eqn (7) |
| 20: Random perturbation by eqn (9) |
| 21: Boundary correction by eqn (11) |
| 22: END |
| 23: END |
| 24: CAW elimination: eliminate inferior solutions periodically by eqn (13) |
| 25: Return the best solution |
| 26: END |
The flowchart of the EPO algorithm is shown in Fig. 2.
1. Accumulate spectral data of simulated drinking water mixed solutions and reservoir solutions.
2. For the EPO–BPNN prediction model, determine the input and output variables. In this study, the COD concentration was considered as the output variable. On the other hand, the UV visible absorption spectrum data of the mixed solution and the solution concentration were selected as input variables for the EPO–BPNN model.
3. Before applying the proposed model, perform feature extraction and normalization of the maximum and minimum values on the data.
4. Divide the simulated data into two parts, with 90% of the data used for training and the remaining 10% used for testing.
5. Use the EPO–BPNN algorithm and other machine learning methods to determine the optimal weights and thresholds for the BPNN.
6. To minimize the error, use the root mean square error (RMSE) metric given in formula (17) as the fitness function.
7. Use the optimal parameters found by the EPO–BPNN to predict the COD concentration value in drinking water, and perform inverse normalization on the predicted results.
8. To validate the predictive results of the EPO–BPNN model and evaluate its predictive performance, the proposed model was compared with other benchmark models (i.e. BPNN, PSO–BPNN, WOA–BPNN, RIME–BPNN, and PO–BPNN) on a numerical basis using our evaluation metrics. The formula for technical indicators is shown in formulas (16)–(18).
9. For visual inspection, use five graphical representations to compare the predictive performance of the proposed EPO–BPNN model, including performance analysis of the EPO algorithm, error convergence plots, final convergence values, radar chart and PBIAS chart.
To verify the predictive effect of the EPO–BPNN model on COD concentration in drinking water, this article analyzes it from three dimensions: algorithm theory analysis, simulation data test set validation, and reservoir measurement data validation.
Firstly, in terms of algorithm theory analysis, on the one hand, we will deeply analyze the inherent characteristics of the algorithm, and on the other hand, compare it with commonly used models to clarify its theoretical advantages. Secondly, for the simulated data test set, the model prediction accuracy is measured by R2, RMSE, and MAPE, the deviation of COD concentration prediction is measured by PBIAS, and the repeatability of the model prediction results is measured by RSD. Finally, in the validation of reservoir measurement data, RMSE, which can intuitively reflect the actual error amplitude, and SD, which reflects the deviation degree between the data and the average, are selected as the core measurement standards to evaluate the actual prediction performance of the proposed model in real water samples. The quantitative formula for evaluation indicators is shown in eqn (15)–(20).3,4,24–27
![]() | (15) |
![]() | (16) |
![]() | (17) |
![]() | (18) |
![]() | (19) |
![]() | (20) |
Simulation experimental conditions: set the number of individuals in the population to 20 and the maximum number of iterations to 50. For each algorithm, run it independently 100 times. The average of the results of the 100 runs is taken as the final evaluation index.
The error convergence plots of the EPO, PO, WOA, PSO, and RIME algorithms on the CEC2005 benchmark test function are shown in Fig. 6. Compared to the other algorithms, the EPO shows superior performance on the CEC2005 benchmark function. Within the same number of iterations, the EPO algorithm converges significantly faster in the early stage, which is due to the LHS strategy and PRB strategy in the early stage of the algorithm and the search process to improve the diversity of the population, expanding the search range, and the CAW strategy to improve the BPNN convergence speed is slow, to avoid the neural network to fall into the local optimum, and to be able to approach the optimal solution more quickly while maintaining a higher degree of accuracy. This advantage makes the EPO show stronger efficiency and accuracy when dealing with complex problems.
The error convergence plots of the EPO, PO, WOA, PSO, and RIME algorithms on the CEC2022 benchmark test functions are shown in Fig. 7. Although the convergence of the EPO is slightly worse than that of some of the other algorithms on some basis functions (e.g., F3) and hybrid functions (e.g., F9), it still demonstrates faster convergence and lower average error on most benchmark test functions. From the single-peak benchmark test function test results, it can be seen that the EPO algorithm exhibits faster convergence performance during the search process, mainly due to the PRB position update strategy, which can accelerate the search speed of the global optimal solution of the algorithm during the iteration process. On most of the multi-peak benchmark test functions, hybrid benchmark test functions, and combined benchmark test functions, the EPO shows extremely fast convergence speed in the initial stage, which is due to the LHS population initialization strategy to enrich the population diversity in the initial stage, expanding the upper search range and laying the foundation for finding the global optimal solution. Besides, the EPO shows high convergence accuracy in the short term, which is due to the CAW individual elimination strategy and because the searchability of the global optimal solution is strong.
The worst (Worst), optimal (Best), mean (Mean), median (Median), and standard deviation (Std) of the convergence values of the different algorithms on the CEC2005 and CEC2022 base test functions are plotted as bar charts as shown in Fig. 8 and 9.
As can be seen from Fig. 8, among the first 13 benchmark test functions of CEC2005, compared with the other algorithms, the EPO shows the best results in the five metrics of Worst, Best, Mean, Median, and Std. This indicates that the EPO algorithm has relatively high accuracy and consistency in its convergence effect. Specifically, the closer the optimal value is to the standard value, the higher the convergence accuracy of the EPO can find solutions that are close to the global optimal solution. The closer the median and mean values are to the standard values, the better the stability of the algorithm is, which performs consistently over multiple runs. The smaller the worst value and the standard deviation are, the more consistently the EPO algorithm performs in multiple experiments, with less volatility in the convergence results. The indicators show that the EPO algorithm can not only effectively reduce the variation of the solution in the optimization problem, but also keep smaller fluctuations in multiple runs, thus improving the consistency and accuracy of the overall performance. As can be seen from Fig. 9, among the first 10 benchmark test functions of CEC2022, the EPO shows good results on the vast majority of benchmark test functions in the five indicators of Worst, Best, Mean, Median, and Std.
Due to the large volume of convergence value data of different algorithms within the corresponding number of iterations, we have uploaded the data related to Fig. 6–9 to https://doi.org/10.6084/m9.figshare.30589553 to facilitate quantitative comparison.
N reflects the computational overhead caused by the sorting operation. As can be seen from Table 2, the time complexity of the EPO is slightly higher than that of comparison algorithms such as PSO, because the introduction of sorting operations and diversified search strategies increases additional computational overhead. However, according to the convergence results in Fig. 6 and 7, the EPO has higher convergence accuracy and faster speed for high-dimensional nonlinear functions under the same number of iterations. The moderate increase in its computational complexity has led to stronger adaptability to complex optimization requirements and a substantial improvement in solution quality.
| Method | Initialization phase | Single core iteration | Total complexity |
|---|---|---|---|
| PSO | O(N × dim + N × F) | O(N × dim + N × F) | O(Max_iter × N × (dim + F)) |
| WOA | O(N × dim + N × F) | O(N × dim + N × F) | O(Max_iter × N × (dim + F)) |
| RIME | O(N × dim + N × F) | O(N × dim + N × F) | O(Max_iter × N × (dim + F)) |
| PO |
O(N × dim + N × F + N log N) |
O(N × dim + N × F + N log N) |
O(Max_iter × N × (dim + F + log N)) |
| EPO |
O(N × dim + N × F + N log N) |
O(N × dim + N × F + N log N) |
O(Max_iter × N × (dim + F + log N)) |
:
test set of 9
:
1. On the test set, the COD concentration was predicted using the BPNN, PSO–BPNN, RIME–BPNN, WOA–BPNN, PO–BPNN, and EPO–BPNN algorithms. The results are shown in Fig. 10, and the specific data are shown in Table 3. As shown in Fig. 10(a), the accuracy metrics (R2, RMSE, and MAPE) of the test set are presented under different models. Among them, the BPNN model without an optimization algorithm performed the worst: its RMSE and MAPE were the highest among all the models, while its R2 was the lowest. To observe in more detail the differences in accuracy indicators among the other five optimized models (since the performance gap between BPNN and these five algorithms is significant, we have excluded it from the comparison), further plot Fig. 10(b). From Fig. 10(b), it can be seen that the R2 of the EPO–BPNN model is the highest among all the models, while the RMSE and MAPE are at the lowest levels. This indicates that the EPO optimization algorithm can effectively improve the predictive performance of the BPNN. By enhancing the model's ability to fit data patterns (higher R2), reducing the absolute magnitude of prediction errors (lower RMSE) and relative proportion (lower MAPE), the prediction accuracy and stability of the EPO–BPNN on the test set are significantly better than those of the comparison models.
| Method | TUR | COD | ||||
|---|---|---|---|---|---|---|
| RMSE (mg L−1) | MAPE | R 2 | RMSE (mg L−1) | MAPE | R 2 | |
| BPNN | 1.2642 | 0.7200 | 0.3467 | 3.6129 | 0.6039 | 0.6436 |
| PSO–BPNN | 0.5891 | 0.3511 | 0.9369 | 0.4896 | 0.0426 | 0.9952 |
| RIME–BPNN | 0.6024 | 0.3581 | 0.9301 | 0.4256 | 0.0410 | 0.9963 |
| WOA–BPNN | 0.7050 | 0.3744 | 0.9126 | 0.4003 | 0.0357 | 0.9970 |
| PO–BPNN | 0.5813 | 0.3505 | 0.9308 | 0.4265 | 0.0376 | 0.9974 |
| EPO–BPNN | 0.4932 | 0.3405 | 0.9396 | 0.3930 | 0.0347 | 0.9976 |
As can be seen from Table 3, the EPO–BPNN prediction algorithm has the highest accuracy in predicting turbidity and COD concentrations compared to the other algorithms. In predicting small concentrations of COD, the RMSE of the algorithm is 0.3930, which is 89.12%, 19.73%, 7.66%, 1.82%, and 7.86% lower compared to those of the BPNN, PSO–BPNN, RIME–BPNN, WOA–BPNN, and PO–BPNN algorithms. The MAPE of the algorithm is 3.47%, which is 94.25%, 18.54%, 15.37%, 2.80%, and 7.71% lower than those of the BPNN, PSO–BPNN, RIME–BPNN, and PO–BPNN algorithms. R2 can reach 0.9976, which is the strongest predictive correlation compared to the other methods. The experimental results show that the small concentration COD prediction algorithm based on the EPO–BPNN improves the prediction accuracy of small concentration COD values.
From Fig. 11, it can be seen that the PBIAS of the BPNN model is as high as 38.585%, significantly greater than 0, indicating a systematic bias of overestimating the actual value; the PBIAS of the PSO–BPNN is −1.473%, that of the RIME–BPNN is 0.898%, that of the WOA–BPNN is −0.623%, and that of the PO–BPNN is 0.449%. Although their PBIAS is close to 0, there are still slight overestimation or underestimation cases. The PBIAS of the EPO BPNN is −0.081%, which is approximately 0, fully reflecting its advantage in predicting bias control. This indicates that EPO optimization effectively corrects the systematic error of the BPNN, making the model prediction closer to the actual value and demonstrating better stability and accuracy in the bias control dimension.
| Random test sample | Concentration value | Number of experiments/concentration value | RSD | Standard | |||||
|---|---|---|---|---|---|---|---|---|---|
| 1 | 2 | 3 | 4 | 5 | 6 | ||||
| Sample 1 | 10 mg L−1 | 10.44 | 10.63 | 10.56 | 10.23 | 10.25 | 10.48 | 1.56% | <3% |
| Sample 2 | 18 mg L−1 | 18.11 | 18.32 | 17.46 | 17.45 | 18.36 | 17.89 | 2.26% | <3% |
As can be seen from Table 4, the RSD values of COD concentration are at a low level and meet the stringent requirements of less than 3% as stipulated in the national standards. The experimental results show that the small concentration COD prediction algorithm based on the EPO–BPNN is excellent in terms of repeatability and has high stability.
| Sample | Method | Repeat count | RMSE (mg L−1) | SD (mg L−1) | |||||
|---|---|---|---|---|---|---|---|---|---|
| 1 | 2 | 3 | 4 | 5 | 6 | ||||
| SAMPLE1 | BPNN | 9.269810 | 8.372337 | 5.298523 | 6.421083 | 10.38374 | 5.041649 | 5.7451 | 2.0106 |
| PSO–BPNN | 8.295607 | 7.102257 | 6.818201 | 9.539236 | 5.873040 | 5.608294 | 5.6483 | 1.3615 | |
| WOA–BPNN | 6.628190 | 9.098687 | 6.628190 | 8.352554 | 8.519474 | 8.555843 | 4.9044 | 0.9718 | |
| RIME–BPNN | 4.590708 | 9.282539 | 4.887689 | 8.767553 | 7.473460 | 8.132808 | 5.8651 | 1.8209 | |
| PO–BPNN | 8.437826 | 10.40252 | 10.8165 | 8.248908 | 11.46336 | 9.578685 | 3.2035 | 1.1881 | |
| EPO–BPNN | 10.10278 | 9.642706 | 9.786047 | 9.394301 | 9.204108 | 9.509941 | 3.1318 | 0.2876 | |
| SAMPLE2 | BPNN | 9.673257 | 8.38944 | 5.129623 | 6.725695 | 10.90253 | 5.142403 | 6.9756 | 2.1876 |
| PSO–BPNN | 9.258589 | 8.453915 | 7.572746 | 10.97453 | 6.314971 | 5.747759 | 6.4864 | 1.7661 | |
| WOA–BPNN | 8.100370 | 11.68670 | 8.002072 | 10.80380 | 10.63405 | 10.81767 | 4.6247 | 1.4237 | |
| RIME–BPNN | 5.402566 | 12.00706 | 6.174425 | 10.63089 | 9.523114 | 10.29072 | 5.9221 | 2.4002 | |
| PO–BPNN | 10.10042 | 12.40033 | 9.122895 | 9.351872 | 13.90045 | 11.46351 | 3.7501 | 1.7136 | |
| EPO–BPNN | 12.17917 | 11.70645 | 11.88201 | 11.23247 | 11.20955 | 11.70868 | 2.7109 | 0.3437 | |
However, the high-dimensional and strong coupling characteristics of BPNN parameters make classic swarm intelligence optimization algorithms such as PSO, WOA, and RIME face progressive bottlenecks such as insufficient initial exploration, search balance imbalance, and attenuation of evolutionary momentum during the optimization process, and these bottlenecks cannot be solved by a single strategy. The three major strategies of LHS, PRB and CAW included in the EPO proposed in this study are not simply superimposed, but form a closed-loop collaborative mechanism of source control – process regulation – result reinforcement. Their interaction relationship and innovativeness can be fully demonstrated through the progressive logic of bottleneck resolution.
Firstly, the LHS initialization strategy provides high-quality starting point support for the PRB search strategy. If the initial population of “full coverage and low overlap” in high-dimensional space achieved by the LHS strategy through Latin hypercube sampling is lacking, the PRB strategy will misjudge the convergence signal due to the initial population clustering in local areas, resulting in premature entry into local fine search and inability to play a role in global exploration. Secondly, the dynamic search mechanism of the PRB strategy provides a continuous guarantee for the initial advantage of the LHS strategy. Even if LHS generates a high-quality initial population, if the search method of PSO (which updates particle positions through dynamic velocity but is prone to losing diversity due to the rapid aggregation of population particles towards the global optimum) or the random perturbation search of RIME is adopted, the diversity of the initial population will still rapidly decrease. The PRB strategy expands the search range through the combined effect of three specific mechanisms, avoids premature convergence of the population, retains the population diversity established by LHS, and provides a foundation for subsequent evolution. Then, the CAW elimination strategy provides reinforcement and correction for the effects of the first two major strategies. The synergy of the LHS and PRB strategies can enhance the overall quality of the population, but it still generates some low-fitness inferior individuals. If RIME's indiscriminate elimination is adopted, individuals carrying potential optimal solution information may be mistakenly deleted. However, the CAW strategy extracts information from the elite individuals screened out by the first two strategies and generates new individuals in a targeted manner, which not only avoids inferior individuals occupying iterative resources but also accelerates the convergence speed of the global optimal solution. The optimization achievements of the first two major strategies were further transformed into directed evolution. Meanwhile, the high-quality new individuals generated by CAW can feed back into the state perception mechanism of PRB, making signals such as population distribution density and fitness differences clearer and more accurate, and helping PRB to more accurately judge the population search status.
1. The current research simulates the drinking water environment using COD concentration and turbidity as model input parameters. Its robustness against other common interfering substances has not been fully verified. However, typical interfering substances such as dissolved organic matter, nitrates, and various ions in actual drinking water, as well as parameters like temperature and conductivity, can also interfere with COD prediction. In the future, the diverse water sample set will be further expanded. The characteristic spectral bands of target substances will be screened through competitive adaptive re-weighted sampling, and an interference compensation mechanism will be constructed at the same time. For instance, based on the spectral library of typical distractors, the coupling law between the target signal and the distractor signal is learned by using the residual network, and the compensation factor is dynamically generated to correct the original spectrum, so as to enhance the robustness of the model to complex water.
2. The model proposed in this study only evaluated the predictive performance of COD concentration during normal water periods, while the water quality of the reservoir exhibits dynamic changes with different hydrological periods such as glacial periods and dry seasons. Therefore, further work can be conducted to comprehensively validate the performance of the model in scenarios such as glacial periods and dry seasons, in order to improve its applicability under different hydrological conditions.
3. Currently, the validation data for the model only include 100 simulated datasets and 2 real datasets, with limited sample coverage. Particularly due to the limitations of on-site sampling conditions and accessibility of open drinking water reservoirs, this study only collected actual water samples from two reservoirs in Jilin Province that met the screening criteria, and the coverage and diversity of the samples were seriously insufficient. The concentration prediction model constructed based on spectral data is difficult to learn the general rules of the correlation between spectra and concentrations. The risk of overfitting objectively exists, and the generalization ability and reliability of the model in actual water samples have not been fully verified. In the future, it is planned to expand the sampling scope to over 60 different types of open drinking water reservoirs, covering various river basins, climate zones and hydrological cycles. Based on the expanded dataset, K-fold cross-validation is carried out. By randomly dividing the training set and the validation set multiple times, the performance fluctuations of the model on different data subsets are evaluated to verify its stability. And a third-party open drinking water reservoir measurement dataset is introduced for independent testing to evaluate the model's prediction accuracy for new scenarios and verify its generalization ability.
4. To expand the practical application value of the EPO–BPNN model, it can be extended to simulate and predict other hydrological variables such as total nitrogen concentration and total phosphorus concentration, assisting in the comprehensive evaluation of water quality levels and further testing the potential of the model in the field of hydrological environment monitoring.
In this paper, we studied the small concentration COD detection in drinking water and improved the small concentration COD detection accuracy and stability in the presence of turbidity interference. This paper provided a prediction algorithm for drinking water quality testing, which is expected to be widely used in the actual drinking water quality monitoring work, promote the development of drinking water quality testing technology in a more accurate direction, and help protect the safety of residents' drinking water.
| This journal is © The Royal Society of Chemistry 2026 |