Five-day biochemical oxygen demand prediction method and system based on BP neural network

By constructing a dual-model hybrid architecture of BP neural network and residual attention network, and utilizing COD and TP features, real-time monitoring and high-precision prediction of BOD5 were achieved, solving the problems of long detection cycle and high model complexity in traditional methods, and improving monitoring efficiency and prediction accuracy.

CN121031259APending Publication Date: 2025-11-28HARBIN INSTITUTE OF TECHNOLOGY (SHENZHEN) (INSTITUTE OF SCIENCE AND TECHNOLOGY INNOVATION HARBIN INSTITUTE OF TECHNOLOGY SHENZHEN) +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510848630.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-24
Publication Date
2025-11-28

AI Technical Summary

Technical Problem

Existing BOD5 detection methods have excessively long detection cycles and cannot provide real-time data. Furthermore, existing machine learning models have high computational complexity and heavy data processing burdens, failing to fully explore key features, resulting in insufficient prediction accuracy and generalization ability.

Method used

A dual-model hybrid architecture based on BP neural network is constructed, using chemical oxygen demand (COD) and total phosphorus (TP) as input features. Prediction is performed through low-concentration and high-concentration sub-models respectively. A fusion algorithm and residual attention network structure are used to realize logarithmic transformation and weighting, thereby optimizing the model training process.

Benefits of technology

It enables real-time monitoring and early warning of BOD5, shortens the detection cycle to the second level, improves monitoring efficiency and prediction accuracy, ensures the smoothness and robustness of prediction results, avoids abrupt changes at model switching points, and enhances the ability to fit deep relationships in water quality data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121031259A_ABST
    Figure CN121031259A_ABST
Patent Text Reader

Abstract

The invention discloses a five-day biochemical oxygen demand prediction method and system based on a BP neural network, and the method comprises the steps: obtaining a plurality of water quality data samples including chemical oxygen demand, total phosphorus data and corresponding five-day biochemical oxygen demand, and carrying out the preprocessing of the data samples; constructing a BP neural network adopting a double-model hybrid architecture; training a BP neural network by using the preprocessed data sample; and inputting the chemical oxygen demand and total phosphorus data collected in real time into the trained BP neural network, and outputting a final five-day biochemical oxygen demand predicted value according to a preset concentration division rule and a fusion algorithm. According to the scheme of the invention, real-time monitoring and early warning are realized by constructing the BP neural network model, and the monitoring efficiency is greatly improved. By adopting an innovative double-model hybrid architecture, special prediction is respectively carried out for different high and low concentration intervals, and smoothness and reliability of a prediction result are ensured by utilizing a fusion algorithm, so that the prediction accuracy is remarkably improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application generally relates to the field of water environment monitoring and artificial intelligence. More specifically, the present application relates to a five-day biochemical oxygen demand prediction method and system based on BP neural network. BACKGROUND

[0002] Biochemical oxygen demand (BOD5) is one of the core environmental monitoring indicators that characterizes the degree of organic pollution in water bodies. It reflects the water quality by measuring the amount of dissolved oxygen consumed by aerobic microorganisms in decomposing organic pollutants in water bodies within a specific time (usually 5 days) and temperature (usually 20℃). The value of BOD5 is not only a key basis for evaluating the quality of water bodies, but also directly related to the self-purification capacity and ecological balance of water bodies. Therefore, timely and accurate monitoring of BOD5 is of great significance in the fields of environmental protection, wastewater treatment and water resource management.

[0003] Currently, the standard detection method for BOD5 is mainly the "standard dilution inoculation method". This method dilutes and inoculates the water sample to be tested, and incubates it at 20℃ for 5 days. Finally, the difference in dissolved oxygen concentration between before and after incubation is measured to calculate the BOD5 value. Although this method as a classical detection means has high accuracy and reliability, its inherent defects are increasingly prominent. The most important problem is that the detection period is too long, with a time span of 5 days, which leads to low detection efficiency and cannot provide real-time data of water quality changes, which seriously restricts the modern environmental monitoring and production control scenarios that require rapid response and timely warning.

[0004] In order to overcome the limitations of traditional methods, researchers have begun to explore the use of modern information technology such as machine learning to predict BOD5. Some existing technologies attempt to build prediction models based on multiple water quality parameters (such as pH, turbidity, conductivity, ammonia nitrogen, etc.). However, these methods generally have some problems: first, using too many water quality parameters as model input features may contain more comprehensive information, but also significantly increases the computational complexity and data processing burden of the model, resulting in low model training efficiency and high data integrity requirements. Second, existing models fail to fully exploit and utilize the key features most closely related to BOD5, resulting in ineffective learning of the deep non-linear relationship between features and target values, thereby limiting the prediction accuracy and generalization ability of the model.

[0005] Therefore, it is urgent to provide a five-day biochemical oxygen demand prediction scheme based on BP neural network, which can overcome the above-mentioned defects and build a structure-optimized, efficient and accurate prediction model to replace the traditional time-consuming detection method and achieve rapid and accurate prediction of water quality BOD5 indicators. SUMMARY

[0006] To at least solve one or more technical problems as mentioned above, the present application proposes a five-day biochemical oxygen demand prediction scheme based on a BP neural network in multiple aspects.

[0007] In a first aspect, the present application provides a five-day biochemical oxygen demand prediction method based on a BP neural network, comprising: acquiring a plurality of water quality data samples including chemical oxygen demand, total phosphorus data and corresponding five-day biochemical oxygen demand, and preprocessing the data samples; constructing a BP neural network adopting a double-model hybrid architecture, the BP neural network comprising a low-concentration sub-model for predicting low-concentration five-day biochemical oxygen demand and a high-concentration sub-model for predicting high-concentration five-day biochemical oxygen demand; training the BP neural network using the preprocessed data samples; inputting real-time collected chemical oxygen demand and total phosphorus data into the trained BP neural network, and outputting a final five-day biochemical oxygen demand prediction value according to a preset concentration division rule and a fusion algorithm.

[0008] In some embodiments, in the process of preprocessing the data samples, the acquired chemical oxygen demand and total phosphorus data are normalized, and the normalized chemical oxygen demand and total phosphorus data are logarithmically transformed.

[0009] In some embodiments, the double-model hybrid architecture defines a low-concentration zone and a high-concentration zone, wherein the double-model hybrid architecture divides the five-day biochemical oxygen demand prediction range with a preset five-day biochemical oxygen demand concentration value as a segmentation point to define the low-concentration zone and the high-concentration zone; the low-concentration sub-model is used to predict the five-day biochemical oxygen demand concentration value in the low-concentration zone; and the high-concentration sub-model is used to predict the five-day biochemical oxygen demand concentration value in the high-concentration zone.

[0010] In some embodiments, the preset five-day biochemical oxygen demand concentration value is 250 mg / L.

[0011] In some embodiments, the double-model hybrid architecture further defines a smooth transition zone; the low-concentration sub-model and the high-concentration sub-model are respectively used to predict the five-day biochemical oxygen demand concentration value in the smooth transition zone, to obtain an initial prediction value of the low-concentration sub-model and an initial prediction value of the high-concentration sub-model, and a fusion algorithm is used to calculate a final five-day biochemical oxygen demand prediction value based on the initial prediction value of the low-concentration sub-model and the initial prediction value of the high-concentration sub-model.

[0012] In some embodiments, in the process of calculating the final five-day biochemical oxygen demand prediction value based on the initial prediction value of the low-concentration sub-model and the initial prediction value of the high-concentration sub-model by using the fusion algorithm, the following steps are performed: assigning weights to the initial prediction value of the low-concentration sub-model and the initial prediction value of the high-concentration sub-model, respectively; and performing summation processing on the initial prediction value of the low-concentration sub-model after assigning weights and the initial prediction value of the high-concentration sub-model after assigning weights to obtain the final five-day biochemical oxygen demand prediction value.

[0013] In some embodiments, in the smooth transition zone, the five-day biochemical oxygen demand concentration value of the five-day biochemical oxygen demand ranges from 230 mg / L to 270 mg / L.

[0014] In some embodiments, the low-concentration sub-model and the high-concentration sub-model both use a residual attention network structure.

[0015] In some embodiments, the residual attention network structure includes: an input layer for constructing a nonlinear relationship of input features through a third-order polynomial expansion; at least one residual module for optimizing gradient transmission and feature compression; and an attention layer using Sigmoid activation and multiplication operation to realize feature adaptive weighting.

[0016] In a second aspect, the present application provides a five-day biochemical oxygen demand prediction system based on a BP neural network, which uses the five-day biochemical oxygen demand prediction method based on the BP neural network of any one of the embodiments of the first aspect to predict the five-day biochemical oxygen demand. The system includes: a data acquisition and preprocessing module for acquiring a plurality of water quality data samples including chemical oxygen demand, total phosphorus data and corresponding five-day biochemical oxygen demand, and preprocessing the data samples; a BP neural network construction module for constructing a BP neural network using a double-model hybrid architecture, the BP neural network including a low-concentration sub-model for predicting low-concentration five-day biochemical oxygen demand and a high-concentration sub-model for predicting high-concentration five-day biochemical oxygen demand; a BP neural network training module for training the BP neural network using the preprocessed data samples; and a result acquisition module for inputting real-time collected chemical oxygen demand and total phosphorus data into the trained BP neural network, and outputting a final five-day biochemical oxygen demand prediction value according to a preset concentration division rule and a fusion algorithm.

[0017] By the five-day biochemical oxygen demand prediction scheme based on the BP neural network provided above, the embodiment of the application realizes the replacement of the traditional time-consuming five-day BOD5 (five-day biochemical oxygen demand) laboratory culture method by only using two key indicators of chemical oxygen demand (COD) and total phosphorus (TP) which are easy to monitor online, by constructing a BP neural network model. First, it shortens the detection period from several days to seconds, realizes the real-time monitoring and early warning of BOD5, and greatly improves the monitoring efficiency. Secondly, by adopting an innovative dual-model hybrid architecture, it respectively performs special prediction for high and low concentration intervals, and uses a fusion algorithm to ensure the smoothness and reliability of the prediction results, thereby significantly improving the accuracy of the prediction.

[0018] Further, in some embodiments, by setting an exact concentration dividing point, a wide prediction problem is ingeniously decomposed into two independent and more targeted prediction tasks. By letting the low concentration and high concentration two sub-models focus on learning the data rules in their respective intervals respectively, the precision loss of a single model in fitting complex global relationships is avoided, thereby significantly improving the overall prediction accuracy of the model.

[0019] Further, in some embodiments, by introducing a smooth transition zone and a weighted fusion algorithm, a set of precise and flexible switching mechanism is designed for the previously established high and low concentration dual-model architecture. First, it solves the problem of sudden change or fault of the prediction value at the model switching point by weighted sum of the prediction values of the two sub-models in the transition interval, ensuring the continuity and smoothness of the final output result, making it more consistent with the physical law of real water quality gradual change. Secondly, this fusion strategy effectively hedges the potential deviation of a single model in the uncertain area, thereby improving the robustness and accuracy of the prediction in this key area. Thirdly, not only does it avoid the dramatic jump of system output caused by slight fluctuations in data, but also makes the entire prediction system perform more stably, reliably and intelligently in the face of complex boundary conditions.

[0020] Further, in some embodiments, by using the residual attention network structure for both the low-concentration sub-model and the high-concentration sub-model, the third-order polynomial input layer of the residual attention network structure can actively construct complex nonlinear features, greatly enhancing the fitting ability of the model to the deep relationship between water quality data. The residual module of the residual attention network structure effectively solves the problems of gradient disappearance and network degradation in deep network training by establishing a shortcut connection, so that the model can be constructed deeper and learn more efficiently, thereby capturing more abstract features. Finally, the attention layer of the residual attention network structure gives the model the ability of adaptive focusing, enabling it to intelligently identify and weight the most important input features and ignore noise interference. This structure that integrates polynomial expansion, residual connection and attention mechanism creates a powerful prediction model that can deeply understand data, is easy to optimize and train, and has intelligent judgment, providing a solid foundation for the high performance of the entire method. BRIEF DESCRIPTION OF DRAWINGS

[0021] The above and other objects, features and advantages of the example embodiments of the present application will be more apparent from the following detailed description read in conjunction with the accompanying drawings, in which several embodiments of the present application are shown by way of example, and wherein the same or corresponding elements are referred to by the same or corresponding reference numerals, in which: Figure 1 An example flowchart of a five-day biochemical oxygen demand prediction method based on a BP neural network according to an embodiment of the present application is shown; Figure 2 A result schematic diagram of testing the trained BP neural network by a test set according to an embodiment of the present application is shown; Figure 3 A five-day biochemical oxygen demand concentration prediction result schematic diagram according to an embodiment of the present application is shown; Figure 4 A five-day biochemical oxygen demand concentration error percentage schematic diagram according to an embodiment of the present application is shown; Figure 5 An example structural block diagram of a five-day biochemical oxygen demand prediction system based on a BP neural network according to an embodiment of the present application is shown. DETAILED DESCRIPTION

[0022] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work fall within the scope of protection of the present application.

[0023] It should be understood that the terms "comprise" and "comprising" used in the specification and claims of the present application indicate the presence of the described features, integers, steps, operations, elements, and / or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or groups thereof.

[0024] It should also be understood that the terms used in the specification of the present application are only for the purpose of describing specific embodiments and are not intended to limit the present application. As used in the specification and claims of the present application, the singular forms "a", "an" and "the" are intended to include the plural forms unless the context clearly indicates otherwise. It should be further understood that the term "and / or" used in the specification and claims of the present application means any combination of one or more of the associated listed items and all possible combinations thereof, and includes these combinations.

[0025] Figure 1 An exemplary flowchart of a BP neural network-based five-day biochemical oxygen demand prediction method 100 of an embodiment of the present application is shown.

[0026] As shown in step S110, a plurality of water quality data samples including chemical oxygen demand, total phosphorus data and corresponding five-day biochemical oxygen demand are obtained, and the data samples are preprocessed. Figure 1

[0027] In an embodiment of the present application, 11851 sets of water quality data samples containing chemical oxygen demand (COD), total phosphorus (TP) data and corresponding five-day biochemical oxygen demand (BOD5) are obtained. In order to ensure the comprehensiveness and representativeness of the data, the water quality data samples are collected at different time periods and different sampling points, and the COD, TP and BOD5 are determined synchronously, and auxiliary information such as sampling time, sampling location and weather conditions is collected. The collection period is more than 3 months to ensure the effectiveness and representativeness of the data.

[0028] In an embodiment of the present application, before the data is input into the model training, the data samples are preprocessed including data cleaning, normalization processing, logarithmic transformation processing, etc. to improve the data quality and model performance.

[0029] Specifically, in the data cleaning process, outliers are removed and missing values are filled. For outliers, statistical methods are used for identification and processing. For missing values, interpolation method, mean method, etc. are used for filling.

[0030] ​Specifically, in the normalization process, the input feature data (including COD, TP) is uniformly scaled to the interval of [0, 1] or [-1, 1]. The influence of different indicators due to different units and numerical ranges (i.e. dimensional differences) is eliminated, thereby accelerating the convergence speed of the subsequent model and improving the prediction accuracy.

[0031] Specifically, after normalization, the chemical oxygen demand and total phosphorus data after normalization are subjected to logarithmic transformation processing. Through logarithmic transformation, the data in skew distribution is closer to normal distribution, which helps to stabilize the variance and enhance the effectiveness of the input features.

[0032] Through step S110, extensive sampling is performed under different spatiotemporal conditions for more than three months, ensuring that the obtained multiple sets of water quality samples have high comprehensiveness and representativeness, providing a premise for training a robust model that can adapt to real working conditions. By cleaning to remove outliers and missing values to ensure data purity, by normalization to eliminate dimensional differences to accelerate model convergence and improve accuracy, and by logarithmic transformation to stabilize data variance and enhance feature effectiveness, the data quality is greatly improved. This series of processing procedures maximizes the extraction of effective information from the data, providing a fundamental guarantee for the high-performance prediction of the subsequent BP neural network.

[0033] After step S110 is performed, in step S120, a BP neural network using a dual-model hybrid architecture is constructed, which includes a low-concentration sub-model for predicting low-concentration five-day biochemical oxygen demand and a high-concentration sub-model for predicting high-concentration five-day biochemical oxygen demand.

[0034] In the embodiments of the present application, the aforementioned low-concentration sub-model and high-concentration sub-model both adopt a residual attention network structure.

[0035] In the embodiments of the present application, the residual attention network structure includes an input layer, a fully connected layer, at least one residual module, an attention layer, and an output layer.

[0036] Specifically, through the input layer, the input feature data including chemical oxygen demand (COD) and total phosphorus (TP) is subjected to three-order polynomial expansion, actively constructing high-order nonlinear feature relationships, and combined with standardization operations to enhance the expression ability of the model.

[0037] Specifically, the fully connected layer (Dense) receives the enhanced feature vector from the input layer, which contains multiple nodes and is equipped with batch normalization (Batch Normalization) to realize dynamic adaptation of feature dimensions and stability of the training process.

[0038] In some embodiments of the present application, the number of residual modules is 3, and each residual module is connected in series. In other embodiments of the present application, the number of residual modules can also be set according to actual needs and historical experience, as long as it is greater than or equal to 1.

[0039] Specifically, the residual module receives the output result of the full connection layer, which is used to optimize gradient transmission, effectively solving the deep network training problem. In addition, the residual module is used to form a dimension reduction block to efficiently compress the features.

[0040] Specifically, the attention layer receives the deep feature representation from the residual module, which is used to adopt Sigmoid activation and multiplication operation, so that the model can automatically learn and judge the importance of different features, thereby realizing adaptive weighting and focusing on the most critical information.

[0041] Specifically, the output layer receives the weighted feature vector from the attention layer, adopts linear activation of a single node, maps the processed high-dimensional features to a continuous BOD5 prediction value, and completes the final accurate prediction task.

[0042] By using the residual attention network structure in the low-concentration sub-model and the high-concentration sub-model, the input layer actively excavates the deep nonlinear relationship of the data through a third-order polynomial expansion. The design of the residual module solves the problem of gradient transmission in deep network training, making it possible to extract deeper features. The core attention layer gives the model intelligence, enabling it to automatically focus on key input features and ignore noise.

[0043] After step S120 is performed, in step S130, the BP neural network is trained using the preprocessed data samples.

[0044] In an embodiment of the present application, the preprocessed data samples are divided into a training set and a test set according to a set proportion. In each iteration, the data of the training set is input into the BP neural network for forward propagation to obtain a prediction result. Then, the prediction value is compared with the true value to calculate the error. Subsequently, the error signal is transmitted back to the BP neural network layer by layer through the back propagation mechanism, and the weights and thresholds of each layer are fine-tuned according to the size of the error signal. When the training error of the model has been reduced to a threshold value or when the number of iterations of the training has reached a set maximum limit, the training process is terminated.

[0045] In some embodiments of the present application, the aforementioned set proportion is 80%:20%. In other embodiments of the present application, the proportion can also be set according to actual needs and historical experience, which is not limited in the present application.

[0046] In an embodiment of the present application, the error is quantified by setting an evaluation index, and the error is continuously reduced through continuous optimization.

[0047] In the embodiments of the present application, the loss function can be mean square error (MSE), mean absolute error (MAE), coefficient of determination (R 2 ) and the like.

[0048] In some embodiments of the present application, the coefficient of determination (R 2 ) is used as an evaluation index. Specifically, the expression of the coefficient of determination is: , is the sum of squared residuals, is the total sum of squares, is the actual BOD5 value of the i-th sample (unit: mg / L), is the predicted BOD5 value of the i-th sample (unit: mg / L), is the average value of the actual BOD5 values of all samples, is the total number of samples.

[0049] In the embodiments of the present application, the BP neural network adopts a double-model hybrid architecture to define a low-concentration zone, a high-concentration zone and a smooth transition zone.

[0050] Specifically, the double-model hybrid architecture divides the five-day biochemical oxygen demand prediction range to define the low-concentration zone and the high-concentration zone by using a preset five-day biochemical oxygen demand concentration value as a segmentation point.

[0051] In the embodiments of the present application, the preset five-day biochemical oxygen demand concentration value is 250 mg / L, in the low-concentration zone, the five-day biochemical oxygen demand concentration is less than or equal to 250 mg / L, and in the high-concentration zone, the five-day biochemical oxygen demand concentration is greater than 250 mg / L.

[0052] In the embodiments of the present application, a low-concentration sub-model is used to predict the five-day biochemical oxygen demand concentration value in the low-concentration zone, and a high-concentration sub-model is used to predict the five-day biochemical oxygen demand concentration value in the high-concentration zone.

[0053] By training exclusive sub-models for the low-concentration zone and the high-concentration zone respectively, each sub-model can more deeply and more focusedly learn the data features in its responsible range, so as to achieve higher prediction accuracy in its respective professional field. This avoids the learning confusion of a single model and improves the overall accuracy.

[0054] If a simple hard switch from one model to another model is made at the point of 250 mg / L, when the real value fluctuates around 250 mg / L, the predicted value may appear illogical and dramatic jumps, which is unacceptable in practical applications. Therefore, a smooth transition zone is set.

[0055] In the embodiment of the present application, the five-day biochemical oxygen demand concentration value of the five-day biochemical oxygen demand in the smooth transition zone ranges from 230 mg / L to 270 mg / L.

[0056] In the embodiment of the present application, the five-day biochemical oxygen demand concentration value of the smooth transition zone is predicted by using the low-concentration sub-model and the high-concentration sub-model respectively, to obtain the initial prediction value of the low-concentration sub-model and the initial prediction value of the high-concentration sub-model, and a fusion algorithm is used to calculate the final five-day biochemical oxygen demand prediction value based on the initial prediction value of the low-concentration sub-model and the initial prediction value of the high-concentration sub-model.

[0057] In the process of calculating the final five-day biochemical oxygen demand prediction value based on the initial prediction value of the low-concentration sub-model and the initial prediction value of the high-concentration sub-model by using the fusion algorithm, first, the initial prediction value of the low-concentration sub-model and the initial prediction value of the high-concentration sub-model are assigned weights respectively. Then, the initial prediction value of the low-concentration sub-model after assigning weights and the initial prediction value of the high-concentration sub-model after assigning weights are summed to obtain the final five-day biochemical oxygen demand prediction value.

[0058] In the smooth transition zone, it does not rely on any single model, but through a fusion algorithm, the prediction results of the two sub-models are weighted and summed. This weight distribution ensures that the transition from one model to another is gradual and smooth, so that the final prediction curve is continuous and stable.

[0059] In the embodiment of the present application, the trained BP neural network is tested by using the test set, and the test results can be referred to Figure 2 .

[0060] Figure 2 The results of testing the trained BP neural network by using the test set in the embodiment of the present application are shown in the schematic diagram.

[0061] As shown in Figure 2 , the X-axis is the true value of BOD5, and the Y-axis is the predicted value of BOD5. The dotted line is a line of Y=X. On this line, the predicted value is exactly equal to the true value. That is, the closer the data points are to the dotted line, the smaller the error between the predicted result of the BP neural network and the true result, and the more accurate the prediction. Each data point in the chart is divided into two categories, corresponding to the low-range prediction result of the low-concentration sub-model and the high-range prediction result of the high-concentration sub-model respectively. As can be seen from the figure, whether it is a low range or a high range, most of the data points are very closely gathered around the dotted line, indicating that the prediction of the BP neural network in the low-concentration zone and the high-concentration zone is quite accurate. And the determination coefficient (R 2) is 0.987, and the closer the value is to 1, the stronger the interpretability of the BP neural network is. 0.987 is a very high value, indicating that there is a strong correlation between the predicted value and the true value of the BP neural network, and the BP neural network is very reliable. In addition, the reserved points: 9941 / 9985 (99.56%), which means that among the total of 9985 sample points, 9941 points (accounting for 99.56%) are used or meet the BP neural network evaluation this time, indicating that the BP neural network has a wide range of applications and almost covers all data.

[0062] In the embodiment of the present application, the trained low-concentration sub-model is tested by the test set, and the test result can be referred to Figure 2 .

[0063] Figure 3 The five-day biochemical oxygen demand concentration prediction result schematic diagram of the embodiment of the present application is shown.

[0064] As Figure 3 shown, each data point represents a test sample. As can be seen from the figure, most of the data points are closely gathered around the dashed line representing the predicted value exactly equal to the true value, indicating that the predicted value of the five-day biochemical oxygen demand concentration is very close to the true value. And the determination coefficient (R 2 ) corresponding to the BP neural network is as high as 0.9977, indicating that the BP neural network can explain 99.77% of the data, and the prediction accuracy is very high.

[0065] In the embodiment of the present application, the error percentage corresponding to the BP neural network is calculated and compared with the zero error percentage and the average error percentage, which can be referred to Figure 4 .

[0066] Figure 4 The error percentage schematic diagram of the five-day biochemical oxygen demand concentration of the embodiment of the present application is shown.

[0067] As Figure 4 shown, the zero error line, which is a horizontal dashed line located at Y=0, is the reference line, representing the ideal zero error state. The closer the data points are to this line, the smaller the relative error of the prediction. The average error line, which is a horizontal solid line located at Y=1.64%, represents the arithmetic mean of the error percentage of all sample points. It is slightly higher than the zero error line, indicating that the low-concentration sub-model has a very slight overestimation tendency as a whole, but the average error of 1.64% is a very low value in most application scenarios, indicating that the system deviation of the model is very small. For most (medium and high concentration) samples, the BP neural network can provide reliable prediction with very small error, proving its great value in practical application.

[0068] After step S130 is performed, in step S140, the real-time collected chemical oxygen demand and total phosphorus data are input into the trained BP neural network, and a final five-day biochemical oxygen demand prediction value is output according to a preset concentration division rule and a fusion algorithm.

[0069] In the embodiment of the present application, it is judged according to the preset reference table that the five-day biochemical oxygen demand corresponding to the real-time collected chemical oxygen demand and total phosphorus data is in a concentration region. In response to the five-day biochemical oxygen demand being in a low concentration region, a low concentration sub-model in the trained BP neural network is used to predict the concentration value of the five-day biochemical oxygen demand, and the final five-day biochemical oxygen demand prediction value. In response to the five-day biochemical oxygen demand being in a high concentration region, a high concentration sub-model in the trained BP neural network is used to predict the concentration value of the five-day biochemical oxygen demand, and the final five-day biochemical oxygen demand prediction value. In response to the five-day biochemical oxygen demand being in a smooth transition region, the low concentration sub-model in the trained BP neural network and the high concentration sub-model in the trained BP neural network are used to simultaneously predict the concentration value of the five-day biochemical oxygen demand, and the prediction results are weighted and summed to obtain the final five-day biochemical oxygen demand prediction value.

[0070] Specifically, the preset reference table stores the five-day biochemical oxygen demand concentration range corresponding to the chemical oxygen demand range and the total phosphorus data range. In the process of judging the concentration region of the five-day biochemical oxygen demand corresponding to the real-time collected chemical oxygen demand and total phosphorus data, first, the chemical oxygen demand range and the total phosphorus data range are judged, and then the five-day biochemical oxygen demand concentration range is obtained in the preset reference table.

[0071] In the embodiment of the present application, the preset reference table is formed according to multiple historical tests.

[0072] Through step S140, a complex judgment and calculation process is completely automated. Users or system operators do not need manual intervention and do not need to care about which sub-model is working behind the scenes. They only need to provide input, and the system can automatically complete the judgment region and call the model / algorithm, and give the final result. This enables the model to be seamlessly integrated into a real-time monitoring or automatic control system.

[0073] In summary, through the five-day biochemical oxygen demand prediction scheme based on the BP neural network provided above, the embodiment of the application realizes the replacement of the traditional time-consuming five-day BOD5 (five-day biochemical oxygen demand) laboratory culture method by only using two key indicators of chemical oxygen demand (COD) and total phosphorus (TP) which are easy to monitor online. First, it shortens the detection period from several days to seconds, realizes real-time monitoring and early warning of BOD5, and greatly improves the monitoring efficiency. Secondly, by adopting an innovative dual-model hybrid architecture, it respectively performs special prediction for high and low concentration intervals, and uses a fusion algorithm to ensure the smoothness and reliability of the prediction results, thereby significantly improving the accuracy of the prediction.

[0074] Further, in some embodiments, by setting an exact concentration dividing point, a wide prediction problem is ingeniously decomposed into two independent and more targeted prediction tasks. By letting the low concentration and high concentration sub-models focus on learning the data rules in their respective intervals, the precision loss of a single model in fitting complex global relationships is avoided, thereby significantly improving the overall prediction accuracy of the model.

[0075] Further, in some embodiments, by introducing a smooth transition zone and a weighted fusion algorithm, a set of precise and flexible switching mechanism is designed for the previously established high and low concentration dual-model architecture. First, it solves the problem of sudden change or fault of the prediction value at the model switching point by weighted sum of the prediction values of the two sub-models in the transition interval, ensuring the continuity and smoothness of the final output result, making it more consistent with the physical law of real water quality gradual change. Secondly, this fusion strategy effectively hedges the potential deviation of a single model in the uncertain area, thereby improving the robustness and accuracy of the prediction in this key area. Thirdly, not only does it avoid the dramatic jump of system output caused by slight fluctuations in data, but also makes the entire prediction system more stable, reliable and intelligent when facing complex boundary conditions.

[0076] Furthermore, in some embodiments, by employing residual attention network structures for both low-concentration and high-concentration sub-models, the third-order polynomial input layer of the residual attention network structure can actively construct complex nonlinear features, greatly enhancing the model's ability to fit deep relationships between water quality data. The residual modules of the residual attention network structure effectively solve the gradient vanishing and network degradation problems in deep network training by establishing fast connections, allowing the model to be built deeper and learn more efficiently, thereby capturing more abstract features. Finally, the attention layer of the residual attention network structure endows the model with adaptive focusing capabilities, enabling it to intelligently identify and weight the most important input features while ignoring noise interference. This structure, integrating polynomial expansion, residual connections, and attention mechanisms, creates a powerful predictive model that deeply understands the data, is easy to optimize for training, and possesses intelligent judgment capabilities, providing a solid underlying guarantee for the high performance of the entire method.

[0077] This application also provides a five-day biochemical oxygen demand (BOD) prediction system based on a BP neural network. The system can use the aforementioned five-day BOD prediction method 100 based on a BP neural network to predict BOD, or it can use other methods to predict BOD. This application does not impose any restrictions on these methods.

[0078] Figure 5 An exemplary structural block diagram of a five-day biochemical oxygen demand prediction system based on a BP neural network according to an embodiment of this application is shown.

[0079] like Figure 5 As shown, the system 500 includes a data acquisition and preprocessing module 510, a BP neural network construction module 520, a BP neural network training module 530, and a result acquisition module 540. In the embodiments of this application, the data acquisition and preprocessing module 510, the BP neural network construction module 520, the BP neural network training module 530, and the result acquisition module 540 can be separate units or integrated into the same controller; this application does not impose any limitations on this.

[0080] Specifically, the data acquisition and preprocessing module 510 is used to acquire multiple water quality data samples, including chemical oxygen demand, total phosphorus data and corresponding five-day biochemical oxygen demand, and to preprocess the data samples.

[0081] Specifically, the BP neural network building module 520 is used to build a BP neural network with a dual-model hybrid architecture, which includes a low-concentration sub-model for predicting low-concentration five-day biochemical oxygen demand and a high-concentration sub-model for predicting high-concentration five-day biochemical oxygen demand.

[0082] Specifically, the BP neural network training module 530 is used to train the BP neural network using preprocessed data samples.

[0083] Specifically, the result obtaining module 540 is configured to input the real-time collected chemical oxygen demand and total phosphorus data into the trained BP neural network, and output the final five-day biochemical oxygen demand prediction value according to the preset concentration division rule and the fusion algorithm.

[0084] When the system 500 adopts the aforementioned five-day biochemical oxygen demand prediction method 100 based on the BP neural network to predict the five-day biochemical oxygen demand, the aforementioned step S110 is performed by the data acquisition and preprocessing module 510, the aforementioned step S120 is performed by the BP neural network construction module 520, the aforementioned step S130 is performed by the BP neural network training module 530, and the aforementioned step S140 is performed by the result obtaining module 540. The specific execution process can refer to the foregoing, and will not be described here again.

[0085] Although a plurality of embodiments of the present application have been shown and described herein, it will be apparent to those skilled in the art that such embodiments are provided only in an exemplary manner. Those skilled in the art can think of many changes, changes and alternative ways without departing from the idea and spirit of the present application. It should be understood that various alternatives to the embodiments of the present application described herein can be employed in practicing the present application. The appended claims are intended to define the scope of protection of the present application and thus cover equivalent or alternative solutions within the scope of these claims.

Claims

1. A method for predicting five-day biochemical oxygen demand based on BP neural network, characterized in that, The method comprises the following steps: acquiring a plurality of water quality data samples including chemical oxygen demand, total phosphorus data and corresponding five-day biochemical oxygen demand, and preprocessing the data samples; constructing a BP neural network adopting a double-model hybrid architecture, the BP neural network comprising a low-concentration sub-model for predicting low-concentration five-day biochemical oxygen demand and a high-concentration sub-model for predicting high-concentration five-day biochemical oxygen demand; training the BP neural network using the preprocessed data samples; inputting real-time collected chemical oxygen demand and total phosphorus data into the trained BP neural network, and outputting a final five-day biochemical oxygen demand prediction value according to a preset concentration division rule and a fusion algorithm. 2.The BP neural network-based five-day biochemical oxygen demand prediction method of claim 1, wherein, In the preprocessing of the data samples, the acquired chemical oxygen demand and total phosphorus data are normalized, and the normalized chemical oxygen demand and total phosphorus data are logarithmically transformed. 3.The BP neural network-based five-day biochemical oxygen demand prediction method of claim 1, wherein, The double-model hybrid architecture defines a low-concentration zone and a high-concentration zone, wherein the double-model hybrid architecture takes a preset five-day biochemical oxygen demand concentration value as a segmentation point, divides the five-day biochemical oxygen demand prediction range to define the low-concentration zone and the high-concentration zone; the low-concentration sub-model is used to predict the five-day biochemical oxygen demand concentration value in the low-concentration zone; the high-concentration sub-model is used to predict the five-day biochemical oxygen demand concentration value in the high-concentration zone. 4.The BP neural network-based five-day biochemical oxygen demand prediction method of claim 3, wherein, The preset five-day biochemical oxygen demand concentration value is 250 mg / L.

5. The BP neural network-based five-day biochemical oxygen demand prediction method according to claim 3 or 4, characterized in that, The double-model hybrid architecture also defines a smooth transition zone; the low-concentration sub-model and the high-concentration sub-model are respectively used to predict the five-day biochemical oxygen demand concentration value in the smooth transition zone, to obtain an initial prediction value of the low-concentration sub-model and an initial prediction value of the high-concentration sub-model, and a fusion algorithm is used to calculate a final five-day biochemical oxygen demand prediction value based on the initial prediction value of the low-concentration sub-model and the initial prediction value of the high-concentration sub-model. 6.The BP neural network-based five-day biochemical oxygen demand prediction method of claim 5, wherein, In the process of calculating the final five-day biochemical oxygen demand prediction value based on the initial prediction value of the low-concentration sub-model and the initial prediction value of the high-concentration sub-model using the fusion algorithm, the following steps are performed: assigning weights to the initial prediction value of the low-concentration sub-model and the initial prediction value of the high-concentration sub-model, respectively; summing the initial prediction value of the low-concentration sub-model after assigning weights and the initial prediction value of the high-concentration sub-model after assigning weights to obtain the final five-day biochemical oxygen demand prediction value. 7.The BP neural network-based five-day biochemical oxygen demand prediction method of claim 5, wherein, In the smooth transition zone, the five-day biochemical oxygen demand concentration value of the five-day biochemical oxygen demand ranges from 230 mg / L to 270 mg / L. 8.The BP neural network-based five-day biochemical oxygen demand prediction method of claim 1, wherein, Both the low-concentration sub-model and the high-concentration sub-model adopt a residual attention network structure. 9.The BP neural network-based five-day biochemical oxygen demand prediction method of claim 8, wherein, The residual attention network structure comprises: an input layer for constructing a non-linear relationship of input features through a third-order polynomial expansion; at least one residual module for optimizing gradient transmission and feature compression; and an attention layer for realizing feature adaptive weighting through Sigmoid activation and multiplication operation.

10. A five-day biochemical oxygen demand prediction system based on BP neural network, characterized in that, The system for predicting five-day biochemical oxygen demand based on the BP neural network adopts the method according to any one of claims 1-9. The data acquisition and preprocessing module is configured to acquire a plurality of water quality data samples including chemical oxygen demand, total phosphorus data and corresponding five-day biochemical oxygen demand, and preprocess the data samples; The BP neural network construction module is configured to construct a BP neural network adopting a double-model hybrid architecture, the BP neural network including a low-concentration sub-model for predicting low-concentration five-day biochemical oxygen demand and a high-concentration sub-model for predicting high-concentration five-day biochemical oxygen demand; The BP neural network training module is configured to train the BP neural network using the preprocessed data samples; The result acquisition module is configured to input real-time collected chemical oxygen demand and total phosphorus data into the trained BP neural network, and output a final five-day biochemical oxygen demand prediction value according to a preset concentration division rule and a fusion algorithm.