Flocculant dosage determination method based on double-branch frequency-enhanced legendre memory model

CN118155741BActive Publication Date: 2026-08-18CENT SOUTH UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410360074.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-03-27
Publication Date
2026-08-18
Estimated Expiration
2044-03-27

AI Technical Summary

Technical Problem

[0004]本发明的目的在于解决传统的饮用水制备过程中,絮凝过程受众多环境因素影响,工艺机理复杂且沉淀反应严重滞后,导致实时的絮凝剂剂量确定模型难以建立的问题

Benefits of technology

[0025] The principle and effect of this solution are as follows:

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118155741B_ABST
    Figure CN118155741B_ABST
Patent Text Reader

Abstract

The present application relates to flocculant additive quantity prediction technical field, specifically disclose a kind of flocculant dosing quantity determination method based on double branch frequency enhancement Legendre memory model, comprising the following steps: S1 constructs data set: selecting the input variable of water quantity, water turbidity, PH value, temperature and pre-filter turbidity variable as flocculant additive quantity precision determination prediction model, flocculant dosage as the output variable of model;S2 data preprocessing: through flocculation lag time formula, pre-filter turbidity variable is aligned with other variables on time dimension, and the abnormal value in data is screened;S3 model training, training data is normalized by RevLIN module, and the normalized data is processed by double branch calculation respectively, and the data after double branch calculation is processed is calculated in parallel by FiLM channel and feature compensation channel, and finally the final flocculant dosage prediction result is obtained by the Cat operation of tensor.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of flocculant dosage prediction technology, and specifically discloses a method for determining flocculant dosage based on a bi-branch frequency-enhanced Legendre memory model. Background Technology

[0002] Currently, water scarcity is becoming increasingly severe, and industrial waste is seriously polluting water sources, leading to ever-increasing demands for the quality and safety of drinking water. Affected by frequent severe weather and rapid population growth, drinking water treatment plants (DWTP) face increasingly demanding water purification tasks. Coagulation is a crucial method in DWTP for removing impurities from water. The coagulation process utilizes hydrocolloids to aggregate particulate solids and organic matter in the water, forming larger, settleable particles. Therefore, determining the flocculant dosage is a long-latency problem, requiring the coagulant to fully react and adsorb in the water to achieve optimal water purification. The determination of coagulant dosage exhibits a strongly non-linear relationship, influenced by influent and effluent flow rates, ambient temperature, and water quality characteristics. Furthermore, inappropriate coagulant dosage can result in low impurity removal rates, increased water treatment costs, and failure to meet drinking water safety standards.

[0003] Previous studies have rarely established mathematical models to describe the determination of flocculant dosage. Establishing such models requires extensive human experience, real-time measurement data, accurate mathematical assumptions, and a deep understanding of the dynamic changes in flocculation kinetics. While flocculation kinetic models describe the process of flocculants forming colloidal particles in water, it is difficult to establish an accurate mathematical relationship between the size of the flocculants and the determination of the flocculant dosage. In actual production, operators judge the amount of flocculant added by observing the size of the flocs (the size of the colloidal particles formed by the flocculant dissolving in water). This operation is highly subjective, difficult to describe the nonlinear relationships involved, and requires waiting for the flocculant to fully react, making it impossible to determine the effect of flocculant addition in real time. Furthermore, it is difficult to cope with unexpected situations such as operator absence or sudden changes in water quality. Therefore, establishing an accurate predictive model for determining flocculant dosage is a necessary guarantee for achieving efficient and stable operation of DTWP. In view of this, this application provides a method for determining flocculant dosage based on a dual-branch frequency-enhanced Legendre memory model to solve the above problems. Summary of the Invention

[0004] The purpose of this invention is to solve the problem that in the traditional drinking water preparation process, the flocculation process is affected by many environmental factors, the process mechanism is complex and the precipitation reaction is seriously delayed, making it difficult to establish a model for determining the real-time flocculant dosage.

[0005] To achieve the above objectives, the basic solution of this invention provides a method for determining the flocculant dosage based on a dual-branch frequency-enhanced Legendre memory model, comprising the following steps:

[0006] S1 Dataset Construction: Select influent flow rate, influent turbidity, pH value, temperature and pre-filtration turbidity variables as input variables for accurately determining the flocculant dosage and flocculant dosage as output variable of the model;

[0007] S2 data preprocessing: The pre-filtration turbidity variable is aligned with other variables in the time dimension using the flocculation lag time formula, and outliers in the data are filtered out.

[0008] The S3 model is trained by normalizing the training data using the RevLIN module. The normalized data is then processed by a dual-branch computation, and the data after the dual-branch computation is processed in parallel by the FiLM channel and the feature compensation channel. Finally, the final flocculant dosage prediction result is obtained by performing Cat operations on the tensor.

[0009] Furthermore, in step S2, the expression for the flocculation lag time formula, which aligns the pre-filtration turbidity variable with other variables in the time dimension, is as follows:

[0010] T = 60·WI / Q

[0011] In the formula, T represents the lag time, WI represents the influent flow rate, and Q is the total capacity of the water treatment structure.

[0012] Furthermore, in step S2, the dataset is divided proportionally into a training set, a test set, and a validation set for training the model.

[0013] Furthermore, the ratio of the training set, test set, and validation set is 7:1:2.

[0014] Furthermore, in step S3, the expression for normalizing the training data using the RevLIN module is as follows:

[0015]

[0016]

[0017]

[0018]

[0019] In the formula, T x It is the length of the input sequence. Represents the input sequence, μ τ This represents the calculated mean of the sequence. The variance of the sequence is calculated, where a represents the normalization constant, b represents the contrast constant, ε represents a very small positive value to avoid division by zero, and γ... k and β kThese are two learnable affine parameters used to represent the non-stationary information of the sequence.

[0020] Furthermore, in step S3, the model employs a frequency-enhanced Legendre memory model in one branch to capture global feature information in the historical time series, and introduces a local feature compensation mechanism in another branch to capture detailed information in the historical time series at a lower computational cost. At the end of the model, the feature information learned from the two branches is fused using the Cat operation to obtain the final flocculant addition dosage prediction result.

[0021] Based on the same inventive concept, this invention provides a flocculant dosage determination system based on a dual-branch frequency-enhanced Legendre memory model, used to implement the above-mentioned method for determining flocculant dosage based on a dual-branch frequency-enhanced Legendre memory model.

[0022] Furthermore, the system includes:

[0023] The dataset construction module uses influent flow rate, influent turbidity, pH value, temperature, and pre-filtration turbidity as input variables to accurately determine the flocculant dosage for the prediction model, with the flocculant dosage serving as the model's output variable. The data preprocessing module aligns the pre-filtration turbidity variable with other variables along the time dimension using the flocculation lag time formula and filters out outliers in the data.

[0024] Model training module: The training data is normalized by the RevLIN module. The normalized data is then processed by a dual-branch calculation. The data after the dual-branch calculation is then processed in parallel by the FiLM channel and the feature compensation channel. Finally, the final flocculant dosage prediction result is obtained by the Cat operation of the tensor.

[0025] The principle and effect of this solution are as follows:

[0026] This invention first analyzes the flocculant dosage dataset from water treatment plants and, combined with the mechanism of flocculation in water treatment, selects influent flow rate, influent turbidity, pH value, temperature, and pre-filtration turbidity as input variables for a precise flocculant dosage prediction model. The flocculant dosage is used as the model's output variable. A frequency-modified Legendre memory model is introduced into the coagulant dosage determination task, and DBFiLM, suitable for the characteristics of the coagulation process, is employed to accurately determine the coagulant dosage and provide longer time steps for coagulant dosage decisions in water treatment. Simultaneously, the RevLIN data instantiation module is used to accurately describe the original distribution characteristics of the data and capture details of data spectral bias, achieving better results in longer time series prediction tasks. The DBFiLM model introduces a local feature compensation mechanism in another branch to capture detailed information from historical time series at a lower computational cost. Furthermore, it recombines globally extracted features and locally extracted features to compensate for information loss caused by the FEL module. The method for determining the flocculant dosage proposed in this invention can accurately extract data features over a longer historical time series and overcome the strong nonlinearity and strong hysteresis in the flocculation process, thereby accurately predicting the flocculant dosage. Attached Figure Description

[0027] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0028] Figure 1 A flowchart illustrating a method for determining flocculant dosage based on a dual-branch frequency-enhanced Legendre memory model, as proposed in an embodiment of this application, is shown.

[0029] Figure 2 This paper presents a schematic diagram of a method for determining flocculant dosage based on a dual-branch frequency-enhanced Legendre memory model, as proposed in an embodiment of this application.

[0030] Figure 3 This paper illustrates the principle of the RevLIN module in a method for determining flocculant dosage based on a dual-branch frequency-enhanced Legendre memory model proposed in an embodiment of this application.

[0031] Figure 4 The figure shows a Pearson correlation analysis heatmap of the dataset in a method for determining flocculant dosage based on a dual-branch frequency-enhanced Legendre memory model proposed in an embodiment of this application.

[0032] Figure 5This paper presents a visualization of the predictive performance of FiLM and its improved variant models in a method for determining flocculant dosage based on a dual-branch frequency-enhanced Legendre memory model proposed in an embodiment of this application.

[0033] Figure 6 A visual representation of the performance of three traditional prediction models is shown.

[0034] Figure 7 A scatter plot of predicted and actual values ​​for each prediction model is shown.

[0035] Figure 8 This diagram illustrates a performance comparison of multi-step prediction tasks based on DBFiLM.

[0036] Figure 9 A statistical diagram illustrating performance parameters for tasks with different prediction step sizes is shown. Detailed Implementation

[0037] To further illustrate the technical means and effects of the present invention in achieving its intended purpose, the following detailed description of the specific implementation methods, structures, features, and effects of the present invention, in conjunction with the accompanying drawings and preferred embodiments, is provided below.

[0038] Taking a drinking water treatment plant in Hunan Province, China as an example, this embodiment discloses a method for determining the flocculant dosage based on a dual-branch frequency-enhanced Legendre memory model, implemented as follows: Figure 1 and Figure 2 As shown, it includes the following steps:

[0039] S1. Construct an experimental dataset to analyze the flocculant dosage dataset for water treatment plants. Based on the mechanism of flocculation in drinking water treatment, select influent flow rate, influent turbidity, pH value, temperature, and pre-filtration turbidity as input variables for a precise prediction model of flocculant dosage. The flocculant dosage is used as the model's output variable. The dataset was collected from a drinking water treatment plant in Hunan Province, China.

[0040] Data was collected from June to October 2022, covering the summer and autumn periods of 2022, with a data collection frequency of 3 minutes per session. By analyzing the flocculant dosage dataset from water treatment plants and combining it with the mechanism of flocculation in water treatment, the variables with the highest correlation were selected to construct the dataset. For example... Figure 3 As shown in the figure, the correlation between influent turbidity and flocculant dosage is the highest, reaching 0.77. The level of influent turbidity directly affects the change in flocculant dosage. Influent flow rate is also a relatively important variable, with a correlation of up to 0.59. Pre-filtration turbidity also shows a high correlation with flocculant dosage because it directly reflects the flocculation and sedimentation effect. The thermogram is shown below. Figure 4As shown in the heatmap, the variables in the dataset exhibit high correlation, making it feasible to select these variables to establish a long-term series prediction model. Therefore, the dataset contains six time series: influent flow rate, influent turbidity, influent pH, influent temperature, and pre-filter turbidity are used as external environmental variables, while flocculant dosage is used as the target variable. Since the flocculation-sedimentation process is a long-lag problem, the pre-filter turbidity is first aligned with the other data along the time dimension according to the following formula to establish an accurate mapping relationship:

[0041] T = 60·WI / Q

[0042] In the formula, T represents the lag time, WI represents the influent flow rate, and Q is the total capacity of the water treatment structure.

[0043] Meanwhile, anomaly detection was performed on the data, outliers were removed, and 70,759 sets of data were finally saved, which were divided into training set, validation set and test set in a ratio of 7:1:2.

[0044] S2. Data was collected every 3 minutes. The pre-filtration turbidity variable was calculated using the flocculation lag time formula and aligned in the time dimension. Outliers were filtered out, resulting in 70,759 data sets. The dataset was then divided into training, testing, and validation sets for the training model in a 7:1:2 ratio.

[0045] During data preprocessing, to mitigate the variability of input variables at different scales, the training data is normalized using the RevLIN module, reducing the model's sensitivity to different features. Time series prediction tasks typically predict complex, non-stationary sequences, and the unique data characteristics of time series often significantly impact the accuracy of the prediction model. The mean and variance of time series change over time, leading to data distribution shifts and significant differences in the distribution between the training and test sets of the prediction model. Typically, the training and test sets are allocated from the original data in specific proportions, and they do not overlap. These differences in input data distribution directly affect the model's predictive performance. Therefore, designing an effective normalization module to eliminate the influence of feature dimensions and suppress data distribution shifts is crucial.

[0046] The original RevIN module within the FiLM model is an efficient and low-cost standardized module, but its underlying Instance Normalization method is more suitable for style transfer in images, capturing the differences between different style features. The DBFiLM model focuses more on balancing global and local features to obtain more comprehensive sequence information. Therefore, we introduce the concept of local response based on RevIN, enhancing the contrast between local and global features within a channel, making the information from both input branches more comprehensive. RevLIN retains the reversible computational properties and symmetric structure of the original RevIN, while also conforming to the normal distribution trend of the data. The principle of RevLIN is as follows... Figure 4 As shown, RevLIN uses the mean μ and variance σ to... 2 The learnable affine parameters γ and β describe the non-stationary information of the input sequence data and remove this non-stationary information from the numerical distribution followed by the model prediction. Simultaneously, during data standardization, distributional differences between different instances are reduced, and the correlation between the data before and after standardization is amplified, facilitating the extraction of local features and the accurate establishment of long-term sequence mapping relationships. This invention applies RevLIN to the field of flocculant dosage prediction, enhancing the model's ability to describe the feature information of the original data and further improving prediction accuracy.

[0047] S3. The training data is normalized by the RevLIN module. The normalized data is then processed by two branches. In one branch, the model uses a frequency-enhanced Legendre memory model to capture global feature information in the historical time series. In the other branch, a local feature compensation mechanism is introduced to capture detailed information in the historical time series with lower computational cost. At the end of the model, the feature information learned by the two branches is fused using the Cat operation to obtain the final flocculant dosage prediction result, reducing the model's sensitivity to different features.

[0048] The expression for normalizing the training data using the RevLIN module is as follows:

[0049]

[0050]

[0051]

[0052]

[0053] In the formula, T x It is the length of the input sequence. Represents the input sequence, μ τ This represents the calculated mean of the sequence. The variance of the sequence is calculated, where a represents the normalization constant, b represents the contrast constant, ε represents a very small positive value to avoid division by zero, and γ... k and β k These are two learnable affine parameters used to represent the non-stationary information of the sequence.

[0054] To ensure fairness in the experiment, we maintained consistent hyperparameter settings with those published by FiLM during model training. The optimizer used in the model was ADAM, with a learning rate ranging from [1e-2, 1e-4]. The batch size was also set to 32, the training epochs were set to 15 by default, the prediction step size was set to 96 by default, and no early stopping mechanism was implemented. The average moving window was set to 24. Furthermore, a random seed was added during training, and the optimal model with the minimum loss was permanently saved for final testing. All experiments were repeated five times, and the average of the five results was used as the final report result to avoid random fluctuations in the experimental results.

[0055] Meanwhile, to verify the validity of the experimental results, effective performance evaluation metrics need to be defined before the experiment to objectively and correctly evaluate the effectiveness of the model. This invention selects four evaluation metrics: mean squared error (MSE), mean absolute error (MAE), relative root mean square error (RRMSE), and root mean square logarithmic error (RMSLE). The specific calculation formulas are as follows:

[0056]

[0057]

[0058]

[0059]

[0060] In the formula, y i For the target sequence values, This is for predicting sequence values.

[0061] To verify the effectiveness of the proposed model, we tested the proposed DBFiLM model, FiLM+RevLIN model, and the benchmark FiLM model on real datasets. We also tested three commonly used models: LSTM, CNN-LSTM, and XGBoost prediction models. Figure 5 and Figure 6 The prediction performance on the flocculant dosage dataset is shown. Figure 5We tested the baseline model FiLM and two of our improved variants. It can be seen that the original FiLM model can establish long-sequence mapping relationships relatively well, basically conforming to the data's changing trends. However, in detail, the predicted data exhibits small fluctuations, and the predicted values ​​have a certain error compared to the original test data. After introducing RevLIN, the improved data normalization module can accurately describe the spectral bias of historical data, helping the predicted data better fit the changes in the true values ​​and reducing small-scale data oscillations. DBFiLM further adds a local feature compensation branch, enabling the model to fully learn detailed features, capture the hidden relationships between preceding and following data in the sequence, and obtain more accurate prediction results.

[0062] Figure 6 The prediction results of LSTM, CNN-LSTM, and XGBoost are visualized in the image. Figure 6 As can be seen, all three methods exhibited model failure in the later stages of prediction, resulting in significant deviations between the predicted results and the true values. However, in CNN-LSTM, because the local features extracted by CNN were input into LSTM, the model learned richer data features, and the established prediction model showed reduced bias in the later stages of prediction, further validating the effectiveness of introducing local features into the model.

[0063] To further evaluate the reliability of the proposed model in prediction tasks, Figure 7 The diagram shows a scatter plot of predicted and true values. In the subplot, R represents the correlation index, used to describe the model's fit. A higher R value indicates a better fit between the predicted and true values, suggesting more reliable predictive performance. The DBFiLM model achieved the highest correlation index rating, demonstrating its optimal predictive performance. Notably, CNN-LSTM shows a significant improvement in fit compared to LSTM. The introduction of convolutional layers allows the model to more accurately capture hidden information within the data, better describing the predictive trends. In DBFiLM, the information compensation mechanism based on convolutional layers also effectively improves predictive performance compared to the baseline model.

[0064] To test whether the DBFiLM model remains effective in multi-step prediction tasks, this invention conducted experiments with four different prediction step lengths: pred_len = 96, pred_len = 192, pred_len = 336, and pred_len = 720. Figure 8 As shown. The performance parameters MSE, MAE, RRMSE, and RMSLE for each experiment were recorded, as follows: Figure 9 As shown, as the prediction step size increases, prediction performance decreases while parameter metrics increase. However, as... Figure 8As shown, regardless of the prediction step size, the prediction accuracy remains at a high level, with no significant bias or model failure at the end of the prediction period. Experiments demonstrate that the DBFiLM model can effectively capture long-distance dependencies in the data and establish accurate variable mappings in longer prediction tasks.

[0065] Finally, to verify the effectiveness of the algorithm proposed in this invention for determining coagulant dosage, the algorithm performance metric RRMSE was calculated from previous studies. All metrics collected in this invention were derived from denormalized numerical calculations. Notably, to ensure fair comparison, the single-step prediction performance of DBFiLM was evaluated in experiments based on the experimental settings of previous studies. As shown in Table 1, the DBFiLM algorithm proposed in this invention achieved the best prediction results in the coagulant dosage determination task, confirming the effectiveness of the DBFiLM algorithm.

[0066] Table 1 Comparison of prediction performance of different models

[0067] DBFiLM 4.4% GAMTF 7.1% M5GTO 22.4% ELM_Bat1 7.2% DA_RNN 6.3% AATC_LSTM 4.6%

[0068] Based on the same inventive concept, this invention provides a flocculant dosage determination system based on a dual-branch frequency-enhanced Legendre memory model, used to implement the aforementioned method for determining flocculant dosage based on a dual-branch frequency-enhanced Legendre memory model, comprising:

[0069] The dataset construction module uses influent flow rate, influent turbidity, pH value, temperature, and pre-filtration turbidity as input variables to accurately determine the flocculant dosage for the prediction model, with the flocculant dosage serving as the model's output variable. The data preprocessing module aligns the pre-filtration turbidity variable with other variables along the time dimension using the flocculation lag time formula and filters out outliers in the data.

[0070] Model training module: The training data is normalized by the RevLIN module. The normalized data is then processed by a dual-branch calculation. The data after the dual-branch calculation are then processed in parallel by the FiLM channel and the feature compensation channel. Finally, the final flocculant dosage prediction result is obtained by the Cat operation of the tensor. The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention in any way. Although the present invention has been disclosed above with reference to a preferred embodiment, it is not intended to limit the present invention. Any person skilled in the art can make some modifications or alterations to the above-disclosed technical content to create equivalent embodiments without departing from the scope of the present invention. Any simple modifications, equivalent changes and alterations made to the above embodiments based on the technical essence of the present invention without departing from the scope of the present invention shall still fall within the scope of the present invention.

Claims

1. A method for determining flocculant dosage based on a dual-branch frequency-enhanced Legendre memory model, characterized in that, Includes the following steps: S1 Dataset Construction: Select influent flow rate, influent turbidity, pH value, temperature and pre-filtration turbidity variables as input variables for accurately determining the flocculant dosage and flocculant dosage as output variable of the model; S2 data preprocessing: The pre-filtration turbidity variable is aligned with other variables in the time dimension using the flocculation lag time formula, and outliers in the data are filtered out. The expression for the flocculation lag time formula is as follows: ; In the formula, Indicates the lag time. Indicates the inflow rate. This refers to the total capacity of the water treatment structure. The S3 model is trained by normalizing the training data through the RevLIN module. The normalized data is then processed by a dual-branch calculation. The data after the dual-branch calculation is then processed in parallel by the FiLM channel and the feature compensation channel. Finally, the final flocculant dosage prediction result is obtained by performing Cat operations on the tensor. The expression for the training data after normalization by the RevLIN module is as follows: ; ; ; ; In the formula, It is the length of the input sequence. Represents the input sequence. This represents the calculated mean of the sequence. The variance of the sequence is calculated. Represents the normalization constant. Indicates the comparison constant. To represent a very small positive value, avoid division by zero. and These are two learnable affine parameters used to represent the non-stationary information of the sequence; The model employs a frequency-enhanced Legendre memory model in one branch to capture global feature information from historical time series, and introduces a local feature compensation mechanism in another branch to capture detailed information from historical time series at a lower computational cost. At the end of the model, the feature information learned from the two branches is fused using the Cat operation to obtain the final flocculant dosage prediction result.

2. The method for determining flocculant dosage based on a dual-branch frequency-enhanced Legendre memory model according to claim 1, characterized in that, In step S2, the dataset is divided proportionally into a training set, a test set, and a validation set for training the model.

3. The method for determining flocculant dosage based on a dual-branch frequency-enhanced Legendre memory model according to claim 2, characterized in that, The ratio of the training set, test set, and validation set is 7:1:

2.

4. A flocculant dosage determination system based on a dual-branch frequency-enhanced Legendre memory model, characterized in that, The system is used to implement the method for determining the flocculant dosage based on the bi-branch frequency-enhanced Legendre memory model as described in any one of claims 1-3.

5. The flocculant dosage determination system based on the dual-branch frequency-enhanced Legendre memory model according to claim 4, characterized in that, include: The dataset construction module uses influent flow rate, influent turbidity, pH value, temperature, and pre-filtration turbidity as input variables to accurately determine the flocculant dosage for the prediction model, and the flocculant dosage as the output variable of the model. Data preprocessing module: Aligns the pre-filtration turbidity variable with other variables in the time dimension using the flocculation lag time formula, and filters out outliers in the data; Model training module: The training data is normalized by the RevLIN module. The normalized data is then processed by a dual-branch calculation. The data after the dual-branch calculation is then processed in parallel by the FiLM channel and the feature compensation channel. Finally, the final flocculant dosage prediction result is obtained by the Cat operation of the tensor.