A method for predicting and regulating volatile fatty acids in an anaerobic hydrolysis acidification process
By constructing a CNN-KNN and SA-LSTM model combined with a decision tree, the problem of real-time monitoring and control of VFA types during anaerobic hydrolysis acidification was solved, achieving rapid and accurate VFA prediction and control, and improving wastewater treatment efficiency.
Patent Information
- Application Number
- CN202310363105.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-04-06
- Publication Date
- 2025-11-11
- Estimated Expiration
- 2043-04-06
AI Technical Summary
During the anaerobic hydrolysis acidification process, existing technologies cannot monitor and control the types and dynamic changes of volatile fatty acids (VFAs) in real time, which makes it impossible for operators to make timely adjustments and affects the wastewater treatment effect.
A model based on CNN-KNN and SA-LSTM is constructed and combined with decision trees to achieve prediction and control of VFA type. By real-time monitoring and adjustment of feature variables, a control strategy is established to regulate VFA type.
It enables rapid and accurate prediction and control of VFA types, improves the VFA production efficiency of wastewater treatment plants, enhances nitrogen and phosphorus removal, and saves manpower, material resources, and time.
Smart Images

Figure CN116453631B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of environmental protection technology, specifically relating to a method for predicting and regulating volatile fatty acids during anaerobic hydrolysis acidification. Background Technology
[0002] Industrial wastewater, due to its massive volume and abundance of recalcitrant organic matter, has become a serious environmental and ecosystem problem. Biological treatment, while transforming pollutants into resources, possesses an excellent ability to remove pollutants. Today, the emphasis on sustainable development and a circular bioeconomy has led to significant attention being paid to wastewater reuse in the wastewater treatment field, particularly the utilization of recalcitrant organic matter in industrial wastewater for resource regeneration and carbon emission reduction, which has become a major demand.
[0003] Hydrolysis acidification (HA) is considered an economical and sustainable biological treatment technology that utilizes microbial action to convert recalcitrant organic matter in industrial wastewater into valuable resources, such as volatile fatty acids (VFAs). Various types of VFAs can be applied in processes such as bioplastics synthesis, biodiesel production, nitrogen removal, and biological phosphorus removal. Therefore, properly controlling the HA process to regulate the type of VFA generated is crucial for nitrogen and phosphorus removal in wastewater treatment plant biological treatment units (e.g., AAO, AO processes).
[0004] Due to the complex and variable nature of influent industrial wastewater, operators cannot access real-time information on VFA types and their dynamic changes during operation. Available online VFA measurement equipment is often expensive or has limited accuracy, and waiting for laboratory results can take several days. Therefore, for preemptive responses of specific VFA types in HA effluents within a finite timeframe, prediction through modeling may be more effective than monitoring. In practical applications, modeling the dynamic reaction process of VFA production to find the boundaries of each characteristic variable that alters the VFA type and establishing control strategies to regulate the VFA type in the HA process is a pressing problem to be solved. Summary of the Invention
[0005] To address the aforementioned issues, this invention provides a method for predicting and regulating volatile fatty acids during anaerobic hydrolysis acidification. The constructed model is used to simulate the prediction and changes of volatile fatty acids during anaerobic hydrolysis acidification, enabling real-time monitoring and control of the types of volatile fatty acids in the hydrolysis acidification effluent under different influent water qualities. This helps wastewater treatment plants obtain the desired types of volatile fatty acids through simple characteristic variable control and provides a reference control method for anaerobic biological treatment processes.
[0006] To achieve the above objectives, this invention proposes a method for predicting and regulating volatile fatty acids during anaerobic hydrolysis and acidification, comprising:
[0007] Obtain a dataset of volatile fatty acids;
[0008] Based on the dataset, a CNN-KNN model for predicting volatile fatty acid types was constructed.
[0009] Based on the dataset, an SA-LSTM model was constructed for controlling the production process of volatile fatty acids.
[0010] Based on the SA-LSTM model, a control strategy model is constructed, and based on the control strategy model, the type of volatile fatty acid is adjusted;
[0011] Based on the CNN-KNN model, the performance of the control strategy model is evaluated and predicted.
[0012] Optionally, the dataset includes: influencing factor setpoints, corresponding dye removal rates, and production efficiency and main types of volatile fatty acids; wherein, the influencing factor setpoints include: B / C ratio, COD concentration, temperature, reaction time, initial pH, and sampling pH.
[0013] Optionally, the CNN-KNN model comprises two parts: a CNN model and a KNN model.
[0014] The CNN model is used to extract data features and data correlations from the dataset and output the corresponding observation variables;
[0015] The KNN model is used to classify and predict the observed variables output by the CNN model, and output the type of volatile fatty acids.
[0016] Optionally, the CNN model consists of two identical modules, each module including a first convolutional layer, a second convolutional layer, a third convolutional layer, a pooling layer, and a batch normalization layer connected in sequence. The number of filters in the first convolutional layer, the second convolutional layer, and the third convolutional layer are n, 2n, and n, respectively, and the batch normalization layer of the previous module is connected to the first convolutional layer with n filters in the next module.
[0017] Optionally, building an SA-LSTM model includes:
[0018] The dataset is processed using the shifted subtraction method to obtain an initial dataset, which is then used as the input to the SA-LSTM model.
[0019] Based on the LSTM network, a multi-head self-attention mechanism is introduced to construct an SA-LSTM model. The SA-LSTM model is used to obtain the final volatile fatty acid type, and the final volatile fatty acid type is used as the output of the SA-LSTM model.
[0020] The SA-LSTM model is obtained by modeling the dynamic process in which both input and output are changing.
[0021] Optionally, the initial dataset includes initial parameters, variable parameters, and initial volatile fatty acid types.
[0022] Optionally, constructing the control strategy model includes:
[0023] Construct a decision tree model;
[0024] Based on the decision tree model, the control strategy model is constructed using the GINI index as the basis for type node segmentation.
[0025] Optionally, the GINI index is:
[0026]
[0027] Where, p (i) This indicates the predicted output value.
[0028] The present invention has the following technical effects:
[0029] The VFA type prediction method of this invention constructs a prediction model based on CNN-KNN combination. It uses CNN to extract feature variables from the complex input of anaerobic process, overcoming the difficulty of KNN in the classification and prediction of complex nonlinear systems with state and performance fluctuating over time. The prediction method is fast and accurate, saving a lot of manpower, material resources and time compared with traditional experimental research.
[0030] The VFA control strategy method of this invention uses the SA-LSTM model to predict the dynamic changes of VFA type in the HA process and integrates the DT model to establish a VFA control strategy. This helps wastewater treatment plants obtain the required VFA type through simple characteristic variable control and provides a reference control method for anaerobic biological treatment processes. Attached Figure Description
[0031] The accompanying drawings, which form part of this application, are used to provide a further understanding of this application. The illustrative embodiments and descriptions of this application are used to explain this application and do not constitute an undue limitation of this application. In the drawings:
[0032] Figure 1This is a schematic diagram illustrating the specific operation flow of a method for predicting and regulating volatile fatty acids during anaerobic hydrolysis acidification according to an embodiment of the present invention.
[0033] Figure 2 This is a schematic diagram of the CNN structure according to an embodiment of the present invention;
[0034] Figure 3 This is a schematic diagram of the LSTM network structure according to an embodiment of the present invention;
[0035] Figure 4 This is a schematic diagram of the control QR code according to an embodiment of the present invention. Detailed Implementation
[0036] It should be noted that, unless otherwise specified, the embodiments and features described in this application can be combined with each other. This application will now be described in detail with reference to the accompanying drawings and embodiments.
[0037] It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases the steps shown or described may be executed in a different order than that shown here.
[0038] This invention provides a method for predicting and regulating volatile fatty acids during anaerobic hydrolysis and acidification, the specific operation process of which is as follows: Figure 1 As shown, it includes:
[0039] Obtain a dataset of volatile fatty acids;
[0040] Based on the dataset, a CNN-KNN model for predicting volatile fatty acid types was constructed.
[0041] Based on the dataset, an SA-LSTM model was constructed for controlling strategies in the production process of volatile fatty acids.
[0042] Based on the SA-LSTM model, a control strategy model is constructed, and based on the control strategy model, the type of volatile fatty acids is adjusted.
[0043] Based on the CNN-KNN model, the performance of the control strategy model is evaluated and predicted.
[0044] Furthermore, the dataset includes: influencing factor setpoints, corresponding dye removal rates, and production efficiencies and main types of volatile fatty acids; among which, the influencing factor setpoints include: B / C ratio, COD concentration, temperature, reaction time, initial pH, and sampling pH.
[0045] Furthermore, the CNN-KNN model consists of two parts: a CNN model and a KNN model.
[0046] CNN models are used to extract data features and correlations from a dataset and output the corresponding observed variables.
[0047] The KNN model is used to classify and predict observed variables output by CNN models and output the types of volatile fatty acids.
[0048] Furthermore, the CNN model consists of two identical modules. Each module includes a first convolutional layer, a second convolutional layer, a third convolutional layer, a pooling layer, and a batch normalization layer connected in sequence. The number of filters in the first convolutional layer, the second convolutional layer, and the third convolutional layer are n, 2n, and n, respectively. The batch normalization layer of the previous module is connected to the first convolutional layer with n filters in the next module.
[0049] Furthermore, constructing the SA-LSTM model includes:
[0050] The dataset is processed using the shifted subtraction method to obtain an initial dataset, which is then used as the input to the SA-LSTM model.
[0051] Based on the LSTM network, a multi-head self-attention mechanism is introduced to construct an SA-LSTM model. The SA-LSTM model is used to obtain the final volatile fatty acid type, and the final volatile fatty acid type is used as the output of the SA-LSTM model.
[0052] The SA-LSTM model is obtained by modeling dynamic processes where both input and output are changing.
[0053] Furthermore, the initial dataset includes initial parameters, variable parameters, and initial volatile fatty acid types.
[0054] Furthermore, constructing the control strategy model includes:
[0055] Construct a decision tree model;
[0056] Based on the decision tree model, a control strategy model is constructed using the GINI index as the basis for type node segmentation.
[0057] The specific operation process of this embodiment is as follows: Figure 1 As shown, the implementation steps are as follows:
[0058] Step 1: Conduct batch experiments on anaerobic hydrolysis acidification and construct an orthogonal experimental dataset;
[0059] Through batch experiments simulating the anaerobic acidification process of dyeing and printing wastewater, the indicators of the experimental wastewater samples were measured, and 81 sets of data on VFA generated during the anaerobic hydrolysis acidification process under different influencing factors were collected. The orthogonal experimental dataset includes the set values of influencing factors (B / C, COD concentration, temperature, reaction time, initial pH and sampling pH), the corresponding dye removal rate, the production efficiency of VFA and the main types.
[0060] Specifically, batch experiments were conducted in 250mL serum bottles with a working volume of 200mL. Each bottle contained 30% (v / v) anaerobic granular sludge, and the shaker speed was 120rpm. COD concentration was determined using a COD analyzer (DR1010, HACH, Colorado, USA), and BOD concentration was assessed according to Chinese national environmental protection standards. The concentrations and compositions of VFAs (acetic acid, butyric acid, isobutyric acid, propionic acid, valeric acid, and isovaleric acid) and ethanol in the effluent were determined using an Agilent 7890A gas chromatograph and flame ionization detector. VFA production efficiency (VFA...) was also measured. PE The calculation method is as follows:
[0061]
[0062] VFA types are classified into ethanol type, propionic acid type, butyric acid type, and mixed type, based on the following criteria: the total content of any one of ethanol, propionic acid, or butyric acid with acetic acid is greater than 70%, the proportion of this VFA is more than 10% greater than the ratio of the other two VFAs, and its proportion is 10% greater than the sum of the proportions of the other two; the definition of mixed type is: the content difference between any two VFAs is within 10%; the unavailable type is used to explain outliers with VFA levels below 20 mg / L, which are usually caused by characteristic variables and therefore these values are not subject to review.
[0063] Step 2: Construct a CNN-KNN model for VFA type prediction;
[0064] Construct a CNN-KNN combined prediction model to obtain the initial architecture of the CNN-KNN combined prediction model, in which the combined model contains two parts: CNN and KNN.
[0065] The CNN model performs regression to extract features and correlations from continuous data. 81 sets of data (L81(9,5)) are applied to the 1D-CNN modeling process, where 70% of the original dataset is randomly assigned to the training set and 30% is assigned to the validation subset after normalization, and the corresponding observed variables are output.
[0066] Specifically, such as Figure 2As shown, the CNN structure consists of two identical blocks, each containing three convolutional layers, one pooling layer, and one batch normalization layer. The number of filters in the three convolutional layers are 32, 64, and 32, respectively, and the kernel sizes are 1x1, 2x2, and 1x1, respectively. The kernel size and stride of the max pooling layer are 2x2 and 1, respectively. The rectified linear unit (ReLU) is used as the activation function. The batch normalization layer is used to accelerate the convergence of the model and prevent overfitting.
[0067] The KNN model performs classification prediction on the observed variables after feature extraction. The output of the CNN is directly used as the input of the KNN model, and the Euclidean distance is used to calculate the distance between the point to be classified and the known class points. This distance is used to predict the classification of the point to be classified and output the type of the response variable VFA.
[0068] Specifically, Euclidean distance is used to calculate the distance between a point to be classified and known class points; sort them in ascending order of distance; select the K points (K=5) with the smallest distance to the point to be classified as the neighbor of that sample; determine the frequency of occurrence of the class of these five points; and predict the classification of the point to be classified based on the class with the highest frequency among the five neighboring points. The Euclidean distance calculation method is as follows:
[0069]
[0070] Step 3: Construct the SA-LSTM model of the VFA production process control strategy;
[0071] By subtracting any two sets of data in the current dataset using the staggered subtraction method, the difference between the input and output changes is obtained, and a dataset with 6480 data points is exported, including the initial parameter (X), variable parameter (ΔX), and initial VFA type.
[0072] Based on LSTM networks, a multi-head self-attention mechanism is introduced to construct an SA-LSTM control policy model. The final VFA type is used as the output of the model, and the initial parameters (X), variable parameters (ΔX), and initial VFA type are used as the inputs of the model. The model is used to model the dynamic process in which both input and output are changing.
[0073] The LSTM contains 128 cells, and the information flow is controlled by the input gate, forget gate, and output gate in the model. The overall control flow is as follows: Figure 3 As shown;
[0074] Specifically, the input information first passes through the forget gate (f t The process for deleting useless information is as follows:
[0075] f t =σ(W f [C t-1 ,Xt ]+b f (3)
[0076] Subsequently, the input gate determines the information stored in the memory cell, and a tanh-shaped network layer creates a layer with b c of Vector, the process is as follows:
[0077] f i =σ(W i [C t-1 ,X t ]+b i (4)
[0078]
[0079] Among them, h t-1 Let X be the output vector of the previous cell. t W is the input vector for the current cell. c The weight of the cell;
[0080] Combining the two parts above results in the renewal of memory cells, with new memory cells (C) t From old memory cells (C t-1 ) and X t And multiplied by the weights of the three gates (W) f W i and W o The update process is as follows:
[0081]
[0082] Finally, the output gate determines which parts of the memory cell are used as output. The memory cell passes through a tanh layer, which is integrated to a value between -1 and 1, and then multiplied by the output gate to obtain the cell state (C). t ) and hidden state (h t The process is as follows:
[0083]
[0084] f o =σ(W o [C t-1 ,X t ]+b o (8)
[0085] h t =f o *tanhC t (9)
[0086] The output of the LSTM enters the Self-Awareness (SAM) mechanism, which uses three matrices—query (Q), key (K), and value (V)—to obtain the output.
[0087] Specifically, the input data is linearly projected into the i-th head weight matrix: Q i K i V i These matrices are obtained by assigning different weights to the input at different time steps, as follows:
[0088] Q i =XW i Q ;K i =XW i K V i =XW i V (10)
[0089] Among them, Q i K i V i The linear projection parameters of Q, K, and V, respectively, will be learned during training and used to compute the output matrix attention-i by scaling the dot product attention operations Qi, Ki, and Vi:
[0090]
[0091] Among them, the Softmax activation function can improve the extraction capability of nonlinear features, head i Through attention and V i Matrix multiplication yields:
[0092] head i =Attention i V i (12)
[0093] Subsequently, all feature matrices extracted from the self-attention head are concatenated to obtain the feature results:
[0094] MultiHead(Q,K,V)=Concat(head1,...,head)W O (13)
[0095] The output information of SA is sequentially fed into two dense layers with 128 and 64 units respectively, and finally the prediction result of the control policy is obtained through the SoftMax activation function.
[0096] Step 4: Establishment and visualization of the VFA control strategy model;
[0097] The visualization process of VFA control strategy and boundary conditions is achieved by using the idea of Markov state switching and displaying the prediction process of DT through Boolean logic in a tree structure.
[0098] Specifically, two methods, equal-interval cutting and data permutation and combination, were used to obtain the changes in VFA type results under any conditions, totaling 6,561,000 sets of data (X2). X2 was input into the SA-LSTM model to obtain the transformed VFA type under all conditions (S2).
[0099] A decision tree model (DT) is built using the decision tree interface (tree.decision tree Regsorsor) in the sklearn package. The deepest layer is limited to 12 layers. The GINI index is used as the basis for node splitting. The input is a tuple of ([1], [6]), which consists of a one-dimensional matrix (S1) of length 1 and a one-dimensional matrix (△X2) of length 6. The output is a visualization of the boundary of each corresponding parameter of S2. The GINI index is calculated as follows:
[0100]
[0101] Finally, the idea of Markov state transition is transformed into a matrix, the control interval for each initial state to the target state is extracted, and it is plotted as a QR code, such as... Figure 4 As shown, this demonstrates the control strategy.
[0102] Step 5: Model Performance Evaluation and Validation Application
[0103] The model performance was characterized by the coefficient of determination (R²), accuracy, and mean squared error (MSE).
[0104]
[0105] In the formula, o and p represent the observed output value and the predicted output value, respectively. n represents the number of samples in each comparison group. R 2 It is the square of the correlation coefficient, which represents the relative relationship between the observed and predicted values;
[0106]
[0107] In the formula, TP represents a true positive result; FP represents a false positive result.
[0108]
[0109] In the formula, Y i This is the actual value. This is the predicted value, where n is the number of samples;
[0110] The model was validated and applied using a system consisting of an ASBR reactor and an SBR reactor. Validation was achieved by comparing the ASBR effluent results with the results of the predictive model, and the model was applied by using HA effluent as an additional carbon source for the denitrification process.
[0111] Specifically, according to the above formula, the R2 of the CNN-KNN prediction model for ethanol, propionic acid and butyric acid VFAs are 0.97, 0.9 and 0.87 respectively, and the accuracy of the model prediction is 0.90, which shows that the model has good predictive ability and generalization ability.
[0112] In model applications, using anaerobic acidification effluent as an additional carbon source resulted in an average nitrate removal rate of 8.5% and a phosphorus removal rate of 6.82% compared to using methanol as an additional carbon source.
[0113] The above are merely preferred embodiments of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A method for predicting and regulating volatile fatty acids during anaerobic hydrolysis and acidification, characterized in that, Includes the following steps: Obtain a dataset of volatile fatty acids; Based on the dataset, a CNN-KNN model for predicting volatile fatty acid types was constructed. Based on the dataset, an SA-LSTM model for controlling the production process of volatile fatty acids was constructed. Based on the SA-LSTM model, a control strategy model is constructed, which is used to regulate the type of volatile fatty acids. Based on the CNN-KNN model, the performance of the control strategy model is evaluated and predicted.
2. The method for predicting and regulating volatile fatty acids during anaerobic hydrolysis acidification according to claim 1, characterized in that, The dataset includes: influencing factor setpoints, corresponding dye removal rates, and production efficiency and main types of volatile fatty acids; wherein, the influencing factor setpoints include: B / C ratio, COD concentration, temperature, reaction time, initial pH, and sampling pH.
3. The method for predicting and regulating volatile fatty acids during anaerobic hydrolysis acidification according to claim 1, characterized in that, The CNN-KNN model consists of two parts: a CNN model and a KNN model. The CNN model is used to extract data features and data correlations from the dataset and output the corresponding observation variables; The KNN model is used to classify and predict the observed variables output by the CNN model, and output the type of the volatile fatty acid.
4. The method for predicting and regulating volatile fatty acids during anaerobic hydrolysis acidification according to claim 3, characterized in that, The CNN model consists of two identical modules. Each module includes a first convolutional layer, a second convolutional layer, a third convolutional layer, a pooling layer, and a batch normalization layer connected in sequence. The number of filters in the first convolutional layer, the second convolutional layer, and the third convolutional layer are n, 2n, and n, respectively. The batch normalization layer of the previous module is connected to the first convolutional layer with n filters in the next module.
5. The method for predicting and regulating volatile fatty acids during anaerobic hydrolysis acidification according to claim 1, characterized in that, Building an SA-LSTM model includes: The dataset is processed using the shifted subtraction method to obtain an initial dataset, which is then used as the input to the SA-LSTM model. Based on the LSTM network, a multi-head self-attention mechanism is introduced to construct an SA-LSTM model. The SA-LSTM model is used to obtain the final volatile fatty acid type, and the final volatile fatty acid type is used as the output of the SA-LSTM model. The SA-LSTM model is obtained by modeling a dynamic process in which both the input and the output are changing.
6. The method for predicting and regulating volatile fatty acids during anaerobic hydrolysis acidification according to claim 5, characterized in that, The initial dataset includes initial parameters, variable parameters, and initial volatile fatty acid types.
7. The method for predicting and regulating volatile fatty acids during anaerobic hydrolysis acidification according to claim 1, characterized in that, Constructing the control strategy model includes: Construct a decision tree model; Based on the decision tree model, the control strategy model is constructed using the GINI index as the basis for type node segmentation.
8. The method for predicting and regulating volatile fatty acids during anaerobic hydrolysis acidification according to claim 7, characterized in that, The GINI index is: Where, p (i) This indicates the predicted output value.
Citation Information
Patent Citations
Method and system for measuring volatile fatty acid in wastewater based on LSTM
CN114460255A