Method for predicting water treatment dosing quantity in high-density pool

By collecting influent parameters from high-density clarifiers and using the PCA_LSTM_ELM model for data analysis and prediction, the problems of lag and arbitrariness in chemical dosage control in traditional water treatment were solved. This enabled precise control of chemical dosage and optimization of reagent usage, reducing costs and improving effluent quality.

CN116307107BActive Publication Date: 2026-07-10XIAN QIGONG DATA TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
XIAN QIGONG DATA TECH CO LTD
Filing Date
2023-02-17
Publication Date
2026-07-10

AI Technical Summary

Technical Problem

In traditional water treatment, the control of chemical dosage in high-density clarifiers relies on manual experience, which is lagging and arbitrary, making it difficult to achieve precise control. This can lead to under- or over-dosing, affecting the quality of the effluent and increasing economic costs.

Method used

By collecting parameters such as influent flow rate, turbidity, and pH value of the high-density tank, and combining them with the PCA_LSTM_ELM model for data analysis and prediction, precise control of the dosage can be achieved. After dimensionality reduction, the ELM and LSTM models are used to predict the dosage, reducing the reliance on the operator's experience.

Benefits of technology

It enables precise control of chemical dosage in high-density clarifiers, reduces chemical waste, optimizes chemical usage, lowers costs, and improves effluent quality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116307107B_ABST
    Figure CN116307107B_ABST
Patent Text Reader

Abstract

The application discloses a kind of high density pool water treatment dosing quantity prediction method, in method, the water inflow of high density pool, water inflow turbidity, water inflow pH, water inflow temperature, raw water conductivity, raw water dissolved oxygen, raw water COD (chemical oxygen demand), raw water ammonia nitrogen, pre-coagulation dosing flow are collected and recorded, data are analyzed and pretreated to analyze the correlation of characteristic and target data Test and similarity test, predict via PCA_LSTM_ELM residual, and compare its error range with true value, long short memory neural network LSTM is used to predict extreme learning machine ELM residual value, use the first 50% of ELM residual value as test set, use the last 50% of ELM residual value as validation set, calculate and determine to obtain final prediction value, compare final prediction value with true value in this time interval.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the technical field of chemical dosing in water treatment systems, and in particular, a method for predicting the chemical dosing in high-density water treatment tanks. Background Technology

[0002] In traditional water treatment, the dosing of chemicals in high-density clarifiers is mainly done by operators visually observing the floc characteristics in the flocculation zone and the color of the effluent in the clear water zone, combined with influent temperature, turbidity, and flow rate. The frequency of coagulant and flocculant dosing pumps is manually adjusted based on the operator's experience, which is highly arbitrary and prone to delays. This lack of precision leads to under- or over-dosing. Under-dosing results in substandard effluent turbidity and other water quality conditions, placing a significant burden on downstream water treatment equipment. Over-dosing causes chemicals to enter downstream equipment with the effluent, causing pollution and increasing the burden on downstream equipment, thus raising economic costs. Furthermore, because effluent turbidity meters are typically limited in range to ensure accuracy, they cannot accurately reflect the true effluent turbidity when it exceeds the range, making it difficult for operators to accurately determine how to adjust the dosing pump frequency.

[0003] The dosing system is a complex nonlinear system with large hysteresis, strong time variability, and many uncertainties. Moreover, the sampling response and anti-interference capabilities of various automated devices and instruments in the water treatment system vary. Therefore, it is very difficult to achieve precise dosing control using conventional methods.

[0004] The information disclosed in the background section is only intended to enhance the understanding of the background of the present invention, and therefore may contain information that does not constitute prior art known to those skilled in the art. Summary of the Invention

[0005] To address the problems existing in the prior art, this invention proposes a method for predicting the dosage of coagulants in high-density water treatment tanks. Based on a combined assessment of parameters such as flow rate, turbidity, water temperature, and pH, the accurate dosage of coagulant is calculated. The dosing system can output a signal to the frequency converter of the metering pump based on the model calculation results, thereby adjusting the coagulant dosage. This method enables precise control of the dosage, reducing dosing costs and improving effluent quality.

[0006] The objective of this invention is achieved through the following technical solution: a method for predicting the dosage of chemicals used in water treatment in high-density tanks includes:

[0007] Step 1: Data Acquisition. Collect and record the influent flow rate, turbidity, pH, temperature, conductivity, dissolved oxygen, COD, ammonia nitrogen, and pre-coagulation dosing flow rate of the high-density tank. The pre-coagulation dosing flow rate is used as the target value, and the influent flow rate, turbidity, pH, temperature, conductivity, dissolved oxygen, COD, and ammonia nitrogen are used as characteristic values.

[0008] Step 2: Analyze the data. Perform preprocessing analysis on the data to analyze the correlation and similarity between features and target data.

[0009] Step 2.1: The collected data are converted into dimensionless index evaluation values ​​after dimensionless processing. Among them, the pre-coagulation dosing flow rate is converted into the target data of dimensionless index evaluation values, and the influent flow rate, influent turbidity, influent pH, influent temperature, raw water conductivity, raw water dissolved oxygen, raw water COD and raw water ammonia nitrogen are converted into the characteristic data of dimensionless index evaluation values.

[0010] Step 2.2 involves performing a correlation test on the feature data and target data, and analyzing the target result map.

[0011] Step 2.2.1: Perform similarity analysis between each feature data and the target data to obtain the few sets of feature data with the best similarity to the target data;

[0012] Step 2.2.2: Draw a scatter plot of the feature data through exploratory data analysis to obtain the linear relationship between the feature data and the target data;

[0013] Step 2.2.3: Represent the correlation between variables using the correlation coefficient matrix between feature data and target data;

[0014] Step 3: Predict using the PCA_LSTM_ELM residuals and compare the results with the true values ​​to calculate the error range.

[0015] Step 3.1: According to the heat map, the four features of influent flow rate, influent turbidity, influent pH and influent temperature are highly correlated with the dosage of chemicals. Moreover, the four feature data are directly measured in the high-density tank, while the other feature data belong to the raw water data (i.e. the feature data of the water treatment process before the high-density tank). Therefore, principal component analysis is used to reduce the dimensionality of the four feature data of influent flow rate, influent turbidity, influent pH and influent temperature in the dataset.

[0016] Step 3.2: Use ELM to predict the dimensionality-reduced data to obtain the predicted value. Divide the data into a test set and a prediction set. Use the test set to train the ELM model. Use the feature data in the prediction set to predict the target data value for the current time period. It is necessary to predict the time interval twice as far in advance.

[0017] Step 3.3: Subtract the predicted value from the actual value to obtain the ELM residual value;

[0018] Step 3.4: Use LSTM to predict the ELM residuals, using the first 50% of the ELM residuals as the test set and the last 50% as the validation set;

[0019] Step 3.5: Calculate and determine the final predicted value. The calculation method is as follows: subtract the residual value of the current time interval from 50% of the predicted value after ELM, and add the predicted residual value of the current time to obtain the final predicted value.

[0020] Step 3.6: Compare the final predicted value with the actual value within the time interval, and calculate the mean absolute error (MAE), mean square error (MSE), and root mean square error (RMSE). All three are used to detect the error between the predicted value and the actual value. The smaller the value, the higher the accuracy of the prediction.

[0021] In the method for predicting the dosage of chemicals for water treatment in the high-density pool, step 1 further includes,

[0022] Step 1.1: Collect and record the following data per minute: influent flow rate, influent turbidity, influent pH, influent temperature, raw water conductivity, raw water dissolved oxygen, raw water COD, raw water ammonia nitrogen, and pre-coagulation dosing flow rate of the high-density tank.

[0023] Step 1.2: The collected data is organized into a dataset by time, and a certain time period in the dataset is selected for predictive analysis.

[0024] In the method for predicting the dosage of chemicals for water treatment in the high-density pool, the dataset is an Excel file.

[0025] In the method for predicting the dosage of chemicals for water treatment in the high-density tank, step 2.1 further includes,

[0026] Step 2.1.1: Perform data cleaning on the collected data, detect duplicates and missing items in the data, and remove duplicate, redundant and incomplete data from the dataset;

[0027] Step 2.1.2: Normalization process, converting the collected data into decimals in the range (0, 1).

[0028] In the method for predicting the dosage of chemicals in high-density water treatment tanks, the similarity analysis includes Euclidean distance, Manhattan distance, Gaussian distance, cosine similarity, or Pearson coefficient.

[0029] In the method for predicting the dosage of chemical treatment in the high-density pool, the correlation coefficient matrix includes the Pearson correlation coefficient, which measures the linear relationship between two features. The Pearson correlation coefficient takes values ​​in the range of [-1, 1]. If r = 1, it indicates that the two variables are positively correlated; if r = 0, it indicates that the two variables are unrelated; and if r = -1, it indicates that the two variables are negatively correlated.

[0030] In the method for predicting the dosage of chemicals for water treatment in the high-density pool, the correlation coefficient matrix is ​​a standardized covariance matrix.

[0031] In the method for predicting the dosage of chemicals for water treatment in the high-density tank, ELM is used to predict the data to obtain the predicted value.

[0032] Input a given training sample set Given the hidden layer output function G(a,b,x) and the number of hidden layer nodes L, the hidden layer node parameters (a,b,x) are randomly generated. i ,b i ), i = 1, ..., L, calculate the full-rank matrix H of the hidden layer output, and the optimal weight β of the output network: β = H + T,

[0033] Among them, (x i ,t i Let be any sample, N represent the number of samples, R represent any real number, n represent the sample dimension, m represent the class, a and b are the hidden node parameters, x is any sample, L is the number of hidden nodes, H is the output of the hidden node, β is the output weight, T is the expected output, and H + It is the Moore-Penrose generalized inverse of matrix H.

[0034] In the aforementioned method for predicting the dosage of chemicals used in high-density water treatment tanks, LSTM prediction is used in the following aspects:

[0035] Input Gate:

[0036] i t =σ(W i ·[h t-1 ,x t ]+b i );

[0037] Forgotten Gate:

[0038] f t =σ(W f ·[h t-1 ,x t ]+b f )

[0039] C t =tanh(W c ·[h t-1 ,xt ]+b c );

[0040] Output gate:

[0041] Q t =σ(W o [h t-1 ,x t ]+b o );

[0042] Long memory:

[0043]

[0044] Short memory:

[0045] h t =Q t *tanh(C t );

[0046] Where t and t-1 represent time points, i represents the number of input layer information, c represents a memory cell in a neuron, o represents the output state, f represents the activation function of the gate, and i t This represents the input layer information at time t, where σ is the sigmoid function, and x... t The input at time t is W, and W and b represent the weight matrix and bias parameters, respectively. i and b i Let f represent the input layer weight matrix and bias parameters carrying information i, respectively. t Let W represent the activation function at time t. f and b f Let h represent the weight matrix and bias parameters in the activated state, respectively. t-1 This indicates that at time t-1, x t The output of the corresponding unit, C t and C t-1 The information represents the cells at time t and t-1, where tanh represents the activation function, and W... c and b c These represent the cell's existing weight matrix and bias parameters, respectively. Q represents the cell state information. t The output component that determines the cell state, W o and b o Let h represent the weight matrix and bias parameter of the cell output, respectively. t Indicates x at time t t The output of the corresponding unit.

[0047] Compared with existing technologies, this invention has the following advantages: In the data acquisition stage, data is collected once per minute, resulting in a large and dense dataset; in the data preprocessing stage, normalization is performed to facilitate analysis and calculation; after normalization, similarity analysis between each feature data point and the target data is conducted to determine the influence of each feature variable on the target variable; in the prediction stage, based on previous analysis, PCA is used for dimensionality reduction, and then ELM and LSTM are combined to predict the results, ultimately yielding highly accurate predicted values. To reduce the reliance on operator experience for high-density clarifier dosing adjustments, improve the dosing system's adjustment effect, optimize reagent dosage, and reduce waste, it is essential to establish a suitable dosing model to obtain accurate and reliable dosing amounts for actual operating conditions, thereby achieving optimal dosing control. Attached Figure Description

[0048] Various other advantages and benefits of the present invention will become apparent to those skilled in the art upon reading the detailed description of the preferred embodiments below. The accompanying drawings are for illustrative purposes only and are not intended to limit the invention. It is obvious that the drawings described below are merely some embodiments of the invention, and those skilled in the art can obtain other drawings based on these drawings without any inventive effort. Furthermore, the same reference numerals denote the same parts throughout the drawings.

[0049] In the attached diagram:

[0050] Figure 1 This is a flowchart illustrating a method for predicting the dosage of chemicals in high-density water treatment tanks according to an embodiment of the present invention.

[0051] Figure 2 This is a schematic diagram of the characteristic analysis scatter plot and heat map flow of a method for predicting the dosage of chemical treatment in a high-density tank provided in an embodiment of the present invention;

[0052] Figure 3 This is a flowchart of a method for predicting the dosage of chemicals in a high-density water treatment tank according to an embodiment of the present invention;

[0053] Figure 4 This is a scatter plot of the influent flow rate and concrete dosage of a method for predicting the dosage of chemical treatment in a high-density tank according to an embodiment of the present invention.

[0054] Figure 5 This is a heat map of a method for predicting the dosage of chemicals in a high-density water treatment tank according to an embodiment of the present invention;

[0055] Figure 6 This is a schematic diagram of the actual value of the dosage within a time interval of the method for predicting the dosage of water treatment in a high-density tank provided in an embodiment of the present invention;

[0056] Figure 7 This is a schematic diagram comparing the predicted and actual values ​​of the chemical dosage in a high-density water treatment chemical dosage prediction method provided in an embodiment of the present invention.

[0057] The present invention will be further explained below with reference to the accompanying drawings and embodiments. Detailed Implementation

[0058] The following will refer to the appendix. Figures 1 to 7 Specific embodiments of the invention will be described in more detail below. While specific embodiments of the invention are shown in the accompanying drawings, it should be understood that the invention can be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided to enable a more thorough understanding of the invention and to fully convey the scope of the invention to those skilled in the art.

[0059] It should be noted that certain terms are used in the specification and claims to refer to specific components. Those skilled in the art will understand that different terms may be used to refer to the same component. This specification and claims do not distinguish components based on differences in terminology, but rather on differences in function. The terms "comprising" or "including" used throughout the specification and claims are open-ended and should be interpreted as "comprising but not limited to." The following descriptions are preferred embodiments for carrying out the invention; however, these descriptions are for the purpose of understanding the general principles of the specification and are not intended to limit the scope of the invention. The scope of protection of this invention is determined by the appended claims.

[0060] To facilitate understanding of the embodiments of the present invention, further explanations and descriptions will be provided below with reference to the accompanying drawings and specific embodiments. The accompanying drawings do not constitute a limitation on the embodiments of the present invention.

[0061] To better understand, such as Figures 1 to 7 As shown, the methods for predicting the dosage of chemicals used in high-density water treatment tanks include:

[0062] Step 1: Data Acquisition. Record data such as influent flow rate, turbidity, pH, temperature, conductivity, dissolved oxygen, COD, ammonia nitrogen, and pre-coagulation dosing rate of the high-density tank. This includes the following steps:

[0063] Step 1.1: Record the above data parameters every minute, with the pre-coagulant dosing rate as the target value.

[0064] The influent flow rate, turbidity, pH, temperature, conductivity, dissolved oxygen, COD, and ammonia nitrogen of the high-density tank are used as characteristic values.

[0065] Step 1.2: Due to the large amount of data, the collected data in the Excel file is analyzed, and a certain time period is selected for predictive analysis.

[0066] Step 2: Analyze the data. Perform data analysis and preprocessing, including correlation and similarity tests between the analyzed features and the target data. This specifically includes the following steps:

[0067] Step 2.1: After dimensionless processing, the original data are converted into dimensionless indicator evaluation values, meaning that all indicator values ​​are on the same order of magnitude, allowing for comprehensive evaluation and analysis. This includes the following steps:

[0068] Step 2.1.1: Perform data cleaning operations on the data. The operation method is to detect duplicate and missing items in the data and remove duplicate, redundant and incomplete data from the dataset.

[0069] Step 2.1.2: Normalization process, which converts the data into decimals in the range of (0, 1). This is mainly for the convenience of data processing. Mapping the data to the range of 0 to 1 makes the processing more convenient and faster.

[0070] Step 2.1.3: Normalization can improve accuracy, speed up the gradient descent to find the optimal solution, is essential for calculating the distance between samples, and improves the analyzability of the data;

[0071] Step 2.2: Based on different algorithms, perform correlation tests on the feature data and target data, and analyze the target result image. This specifically includes the following steps:

[0072] Step 2.2.1: After data normalization, analyze the similarity between each feature data and the target data. The analysis includes Euclidean distance, Manhattan distance, Gaussian distance, cosine similarity, Pearson coefficient, etc. Finally, the analysis summarizes the data sets with the best similarity to the target data.

[0073] Step 2.2.2: Exploratory Data Analysis: This is an important step before training a machine learning model. By plotting scatter plots of features, we can discover the relationships between variables. It allows us to visually demonstrate the potential linear relationship between specific features and the target value.

[0074] Step 2.2.3: Discover the relationship between variables through their correlation coefficients. A commonly used correlation coefficient matrix is ​​the Pearson correlation coefficient matrix, which measures the linear relationship between two features. The Pearson correlation coefficient ranges from -1 to 1. If r = 1, it indicates a positive correlation between the two variables; r = 0 indicates no relationship; and r = -1 indicates a negative correlation. In fact, the correlation coefficient matrix is ​​simply a standardized covariance matrix.

[0075] Step 3: Use the PCA_LSTM_ELM residuals to predict the processed data and compare them with the true values ​​to calculate the error range:

[0076] Step 3.1: Based on the previous analysis, PCA is used to reduce the dimensionality of multiple features. These features often exhibit certain correlations. These correlations mean that dimensionality reduction can be performed, replacing some variables with fewer ones. In fact, dimensionality reduction is essential, both for simplifying the problem and for facilitating computer computation: the reduced number of variables after dimensionality reduction significantly reduces the amount of data the computer needs to process, thus shortening processing time. According to the heatmap, the influent flow rate, influent turbidity, influent pH, and influent temperature are highly correlated with the dosage. Furthermore, these four features are directly measured in the high-density tank, while the other features belong to the raw water data, i.e., the features of the water treatment process before the high-density tank. Therefore, Principal Component Analysis is used to reduce the dimensionality of the four features in the dataset: influent flow rate, influent turbidity, influent pH, and influent temperature. Proceed to Step 3.2.

[0077] Step 3.2: Use ELM to predict the data. This requires predicting a time interval twice as far ahead. Once prediction is complete, proceed to Step 3.3. This involves using ELM to predict the dimensionality-reduced data, dividing the data into a test set and a prediction set. The ELM model is trained using the test set. The trained model then uses the feature data from the prediction set to predict the target data value for the current time period.

[0078] Step 3.3: Subtract the predicted value from the actual value to obtain the ELM residual.

[0079] Step 3.4: Use LSTM to predict the residual values, using the first 50% of the residual values ​​as the test set and the last 50% as the validation set. This will give us the predicted residual values ​​for the time period we want to predict.

[0080] Step 3.5: Based on the previous series of calculation results, calculate and determine the final predicted value.

[0081] Step 3.6: Compare the final prediction result with the actual value within the time interval, calculate the mean absolute error (MAE), mean square error (MSE), and root mean square error (RMSE) of both, and compare them with other prediction algorithms. Finally, we conclude that the algorithm we proposed has the best prediction effect and the corresponding three error values ​​are also the lowest.

[0082] This method can effectively predict the dosage for the next 6 hours and 24 hours, providing crucial dosing parameters for water treatment in high-density tanks, thereby maximizing treatment efficiency with minimal cost. First, a neural network is established to determine feature values ​​and target values. Second, existing data is acquired and preprocessed to obtain sample values. This algorithm uses PCA to reduce the dimensionality of the features. Finally, the neural network is trained to complete its learning, and the trained model is used to predict the actual dosage.

[0083] In one implementation, refer to Figure 1 This method is optimized using PCA and LSTM, and the optimized algorithm can obtain more accurate prediction results. The dosage of coagulant directly determines the coagulation and sedimentation effect. Insufficient coagulant dosage cannot effectively remove suspended particulate matter in the water, which will affect the production cost and treatment effect of subsequent treatment processes, and in severe cases, even affect the water quality of the supply water; excessive coagulant dosage leads to waste of chemicals and increases chemical costs. Therefore, accurately controlling the dosage of coagulant and minimizing costs has long been a common concern and an urgent problem to be solved in the water supply industry. The specific implementation steps are as follows:

[0084] Step 1: Refer to Figure 1 Data collection involves recording data such as influent flow rate, turbidity, pH, temperature, conductivity, dissolved oxygen, COD, ammonia nitrogen, and pre-coagulation dosing rate in the high-density tank. This includes the following steps:

[0085] Step 1.1: Record the above data parameters every minute, with the pre-coagulant dosing rate as the target value.

[0086] The influent flow rate, turbidity, pH, temperature, conductivity, dissolved oxygen, COD, and ammonia nitrogen of the high-density tank are used as characteristic values.

[0087] Step 1.2: Due to the large amount of data, the collected data in the Excel file is analyzed, and a certain time period is selected for predictive analysis.

[0088] Step 2.1: Refer to Figure 2 After dimensionless processing, the original data are converted into dimensionless indicator evaluation values, meaning that all indicator values ​​are on the same order of magnitude, allowing for comprehensive evaluation and analysis. The specific steps include:

[0089] Step 2.1.1: Perform data cleaning operations on the data. The operation method is to detect duplicate and missing items in the data and remove duplicate, redundant and incomplete data from the dataset.

[0090] Step 2.1.2: Normalization. This step converts the data into decimals within the range of (0, 1). This is primarily for ease of data processing; mapping the data to the range of 0 to 1 makes processing more convenient and faster. The simple formula used for normalization is as follows:

[0091]

[0092] Where X represents the original data, X max and X min These represent the maximum and minimum values ​​of the data, X. mon This is the normalized data.

[0093] Step 2.1.3: Normalization can improve accuracy, speed up the gradient descent to find the optimal solution, is essential for calculating the distance between samples, and improves the analyzability of the data;

[0094] Step 2.2: Based on different algorithms, perform correlation tests on the feature data and target data, and analyze the target result image. This specifically includes the following steps:

[0095] Step 2.2.1: After data normalization, analyze the similarity between each feature data and the target data. The analysis includes Euclidean distance, Manhattan distance, Gaussian distance, cosine similarity, Pearson coefficient, etc. Finally, the analysis summarizes the data sets with the best similarity to the target data.

[0096] Step 2.2.2: Exploratory Data Analysis: This is an important step before training the machine learning model. By plotting scatter plots of features, we can discover the relationships between variables. The histogram of concrete dosage reveals several outliers. The scatter plot of influent flow rate and concrete dosage shows a linear distribution, as shown... Figure 4 The other variables and the amount of concrete added exhibit a non-linear distribution.

[0097] Step 2.2.3: Discover the relationship between variables through their correlation coefficients. A common correlation coefficient matrix is ​​the Pearson correlation coefficient matrix, which measures the linear relationship between two features. The Pearson correlation coefficient ranges from -1 to 1. If r = 1, it indicates a positive correlation between the two variables; r = 0 indicates no relationship; and r = -1 indicates a negative correlation. The Pearson correlation coefficient is expressed as:

[0098]

[0099] The above formula defines the population correlation coefficient. The Greek lowercase letter ρ is commonly used as the representative symbol to estimate the sample covariance and standard deviation, thus yielding the Pearson correlation coefficient; cov is the covariance, σ is the standard deviation, X and Y are two vectors, and μ is the standard deviation.x and μ Y For parameters. See the algorithm analysis results as follows. Figure 5 The heatmap shown.

[0100] The calculated Pearson correlation coefficient can be understood as follows:

[0101] When the correlation coefficient is 0, the two vectors X and Y are uncorrelated.

[0102] When the value of X increases (decreases), the value of Y decreases (increases), and the two vectors X and Y are negatively correlated, with a correlation coefficient between -1.0 and 0.0.

[0103] When the value of X increases (decreases), the value of Y increases (decreases), and the two vectors X and Y are positively correlated, with a correlation coefficient between 0.0 and +1.0.

[0104] The correlation coefficient matrix reveals that the influent flow rate and concrete dosage have the strongest correlation (0.99), followed by the influent turbidity and concrete dosage. This is also illustrated by the previous scatter plot.

[0105] Step 3: Refer to Figure 3 The PCA_LSTM_ELM residuals are used to predict the processed data, and the error range is calculated by comparing it with the true values.

[0106] Step 3.1: Based on the previous analysis, PCA is used to reduce the dimensionality of multiple features, as these features often exhibit some correlation. This correlation implies that dimensionality reduction can be performed, replacing some variables with fewer ones. This algorithm achieves the best results when the data is reduced to 2 dimensions. PCA is explained as:

[0107] If A is a symmetric positive semidefinite matrix, and the eigenvalues ​​of A are λ1>λ2…>λ p ,

[0108] The corresponding eigenvectors are φ1, φ2, ..., φ p Therefore, φ1 is the optimal solution:

[0109]

[0110] Step 3.2: Use ELM to predict the data. This requires predicting a time interval twice as far ahead. This experiment requires predicting the data for the next day based on one week's worth of data. The algorithm is adjusted to first predict the next two days' data using the data from the previous six days, obtaining the predicted values ​​for those two days. After the prediction is complete, proceed to step 3.3. The ELM algorithm is explained as follows:

[0111] Input: Given a training sample set Given the hidden layer output function G(a,b,x) and the number of hidden layer nodes L, and randomly generate the hidden layer node parameters (a,b,x)... i ,b i ), i = 1, ..., L, calculate the hidden layer output matrix H, where matrix H is full rank, and the optimal weight β of the output network is: β = H + T,

[0112] Step 3.3: Subtract the predicted value from the actual value to obtain the ELM residual.

[0113] Step 3.4: Use LSTM to predict the residual values, using the first 50% as the test set and the last 50% as the validation set. This will give us the predicted residual values ​​for the desired prediction period. LSTM is represented as:

[0114] Input Gate:

[0115] i t =σ(W i ·[h t-1 ,x t ]+b i ),

[0116] Forgotten Gate:

[0117] f t =σ(W f ·[h t-1 ,x t ]+b f )

[0118] C t =tanh(W c ·[h t-1 ,x t ]+b c ),

[0119] Output gate:

[0120] Q t =σ(W o [h t-1 ,x t ]+b o ),

[0121] Two types of memory (including long memory and short memory):

[0122] Long memory:

[0123]

[0124] Short memory:

[0125] h t =Q t *tanh(C t),

[0126] The most important concepts in LSTM are three gates: input, output, and forget gate; and two memories: long memory C and short memory h. Here, t and t-1 represent time points, i represents the number of information points in the input layer, c represents a memory cell in a neuron, o represents the state at output, and f represents the activation function of the gate. t This represents the input layer information at time t, where σ is the sigmoid function, and x... t The input at time t is W, and W and b represent the weight matrix and bias parameters, respectively. i and b i Let f represent the input layer weight matrix and bias parameters carrying information i, respectively. t Let W represent the activation function at time t. f and b f Let h represent the weight matrix and bias parameters in the activated state, respectively. t-1 Indicates x at time t-1 t The output of the corresponding unit. C t and C t-1 The information represents the cells at time t and t-1, where tanh represents the activation function, and W... c and b c These represent the cell's existing weight matrix and bias parameters, respectively. Q represents the cell state information. t The output component that determines the cell state, W o and b o Let h represent the weight matrix and bias parameter of the cell output, respectively. t It means that at time t, x t The output of the corresponding unit.

[0127] Step 3.5: Based on the previous series of calculation results, calculate and determine the final predicted value.

[0128] Step 3.6: Compare the final prediction results with... Figure 6 Compare the actual values ​​within the given time interval, such as... Figure 7 As shown, we calculated the mean absolute error (MAE), mean square error (MSE), and root mean square error (RMSE) of both algorithms and compared them with other prediction algorithms. Finally, we concluded that our proposed algorithm has the best prediction performance and the lowest corresponding three error values.

[0129] Although embodiments of the present invention have been described above in conjunction with the accompanying drawings, the present invention is not limited to the specific embodiments and application fields described above. The specific embodiments described above are merely illustrative and instructive, and not restrictive. Those skilled in the art can make many other forms based on the guidance of this specification and without departing from the scope of protection of the claims of the present invention, and all of these are within the scope of protection of the present invention.

Claims

1. A method for predicting the dosage of chemicals used in water treatment in a high-density tank, characterized in that, It includes the following steps, Step 1: Data Acquisition. Collect and record the influent flow rate, turbidity, pH, temperature, conductivity, dissolved oxygen, COD, ammonia nitrogen, and pre-coagulation dosing flow rate of the high-density tank. The pre-coagulation dosing flow rate is used as the target value, and the influent flow rate, turbidity, pH, temperature, conductivity, dissolved oxygen, COD, and ammonia nitrogen are used as characteristic values. Step 2: Analyze the data. Perform preprocessing analysis on the data to analyze the correlation and similarity between features and target data. Step 2.1: The collected data are converted into dimensionless index evaluation values ​​after dimensionless processing. Among them, the pre-coagulation dosing flow rate is converted into the target data of dimensionless index evaluation values, and the influent flow rate, influent turbidity, influent pH, influent temperature, raw water conductivity, raw water dissolved oxygen, raw water COD and raw water ammonia nitrogen are converted into the characteristic data of dimensionless index evaluation values. Step 2.2 involves performing a correlation test on the feature data and target data, and analyzing the target result map. Step 2.2.1: Perform similarity analysis between each feature data and the target data to obtain the few sets of feature data with the best similarity to the target data; Step 2.2.2: Draw a scatter plot of the feature data through exploratory data analysis to obtain the linear relationship between the feature data and the target data; Step 2.2.3: The correlation between variables is represented by the correlation coefficient matrix between feature data and target data. The correlation between water flow rate and concrete dosage is the strongest. Step 3: Predict using the PCA_LSTM_ELM residuals and compare the results with the true values ​​to calculate the error range. Step 3.1: Principal component analysis (PCA) is used to reduce the dimensionality of the four feature data in the dataset: influent flow rate, influent turbidity, influent pH, and influent temperature. Step 3.2: Use ELM to predict the dimensionality-reduced data to obtain the predicted value. Divide the data into a test set and a prediction set. Use the test set to train the ELM model. Use the feature data in the prediction set to predict the target data value for the current time period. It is necessary to predict the time interval twice as far in advance. Step 3.3: Subtract the predicted value from the actual value to obtain the ELM residual value; Step 3.4: Use LSTM to predict the ELM residuals, using the first 50% of the ELM residuals as the test set and the last 50% as the validation set; in the LSTM prediction: Input Gate: ; Forgotten Gate: ; Output gate: ; Long memory: ; Short memory: ; in, and Indicates time, Indicates the number of input layer information. This refers to a memory cell within a neuron. This indicates the output state. This represents the activation function of the gate. express Input layer information at any given time, It is the sigmoid function. yes Input at any time and These represent the weight matrix and the bias parameters, respectively. and Each represents a message containing information. The input layer weight matrix and bias parameters, express Activation function at time step and These represent the weight matrix and bias parameters in the active state, respectively. Indicates in time The output of the corresponding unit, and for Time and Unit information at any given time This represents the activation function. and These represent the cell's existing weight matrix and bias parameters, respectively. Cell information representing the current cell state. The output component that determines the cell state and Let represent the weight matrix and bias parameters of the cell output, respectively. Indicates in time The output of the corresponding unit, Step 3.5: Calculate and determine the final predicted value. The calculation method is as follows: Subtract the residual value of the current time interval from 50% of the predicted value after ELM, and add the predicted residual value of the current time to obtain the final predicted value. Step 3.6: Compare the final predicted value with the actual value within the time interval, and calculate the mean absolute error (MAE), mean square error (MSE), and root mean square error (RMSE). All three are used to detect the error between the predicted value and the actual value. The smaller the value, the higher the accuracy of the prediction.

2. The method for predicting the dosage of chemicals used in high-density water treatment tanks according to claim 1, wherein, Step 1 also includes, Step 1.1: Collect and record the following data per minute for the high-density tank: influent flow rate, influent turbidity, influent pH, influent temperature, raw water conductivity, raw water dissolved oxygen, raw water COD, raw water ammonia nitrogen, and pre-coagulation dosing flow rate. Step 1.2: The collected data is organized into a dataset by time, and a certain time period in the dataset is selected for predictive analysis.

3. The method for predicting the dosage of chemicals in high-density water treatment tanks according to claim 2, wherein, The dataset is an Excel file.

4. The method for predicting the dosage of chemicals in high-density water treatment tanks according to claim 2, wherein, Step 2.1 also includes, Step 2.1.1: Perform data cleaning on the collected data, detect duplicates and missing items in the data, and remove duplicate, redundant and incomplete data from the dataset; Step 2.1.2: Normalization process, converting the collected data into decimals in the range (0, 1).

5. The method for predicting the dosage of chemicals used in high-density water treatment tanks according to claim 1, wherein, Similarity analysis includes Euclidean distance, Manhattan distance, Gaussian distance, cosine similarity, or Pearson coefficient.

6. The method for predicting the dosage of chemicals in high-density water treatment tanks according to claim 1, wherein, The correlation coefficient matrix includes the Pearson correlation coefficient, which measures the linear relationship between two features. The Pearson correlation coefficient takes values ​​in the range of [-1, 1]. If r=1, it means that the two variables are positively correlated; if r=0, it means that the two variables are not related; and if r=-1, it means that the two variables are negatively correlated.

7. The method for predicting the dosage of chemicals in high-density water treatment tanks according to claim 1, wherein, The correlation coefficient matrix is ​​a standardized covariance matrix.

8. The method for predicting the dosage of chemicals in high-density water treatment tanks according to claim 1, wherein, Using ELM to predict data yields predicted values. Input a given training sample set Hidden layer output function and the number of hidden layer nodes Randomly generate hidden layer node parameters Calculate the hidden layer output matrix ,matrix If it is full rank, output the optimal weight of the network. ; in, It is any sample. Indicates the number of samples. Represent any real number, Indicates the sample dimension. Indicates category, and To hide node parameters, For any sample, To hide the number of nodes, To hide the output of the node, To output weights, For the desired output, It is a matrix Moore-Penrose generalized inverse.