Water outlet index soft measurement method combined with physical information fusion technology
By constructing the PINN-LSTM model, combining the sewage treatment reaction mechanism and time series information, the problem of difficult to quickly detect and measure variables in traditional sewage treatment methods is solved, high-precision and rapid water effluent indicator detection is achieved, and the application scope of soft measurement is expanded.
Patent Information
- Application Number
- CN202510376131.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-27
- Publication Date
- 2025-08-05
AI Technical Summary
Traditional sewage treatment methods are difficult to quickly and accurately detect difficult variables such as COD and BOD5, resulting in the inability to effectively control the sewage treatment process. The existing soft measurement modeling methods predict the results in small samples are not ideal.
The PINN-LSTM model is constructed in combination with physical information neural network (PINN) and long and short-term memory network (LSTM). By constructing physical constraint equations based on the sewage treatment reaction mechanism, a soft measurement model between difficult-to-measure water index and water inlet index is established, and physical information and time series information are fused.
It improves the soft measurement accuracy of water effluent indicators in small samples, reduces detection time, enhances detection accuracy and interpretability, expands the application range of soft measurement, and ensures the stable operation of sewage treatment plants.
Smart Images

Figure CN120430144A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of sewage effluent index detection, and in particular to a effluent index soft measurement method combined with physical information fusion technology. Background Art
[0002] With the continuous acceleration of urbanization, the pressure on urban water resources is also increasing, becoming a key factor affecting the sustainable development of cities and the quality of the ecological environment. In view of the current situation of water scarcity, effective sewage treatment has become the key to improving water resource utilization efficiency and alleviating water shortages.
[0003] In view of the ever-increasing sewage discharge volume and the complex and changeable sewage composition, traditional sewage treatment methods are difficult to dispose of sewage in a timely manner, especially the detection of important effluent indicators of sewage treatment plants. The original detection method mainly uses sensors for detection, but there are some difficult-to-measure variables such as chemical oxygen demand COD, biochemical oxygen demand BOD5, etc., which require a long detection time (COD requires more than 3 hours, BOD5 requires more than 5 days), resulting in the inability to effectively control the next sewage treatment process.
[0004] Soft sensor modeling is a popular area of industrial process control. Its goal is to establish mathematical models between easy-to-measure and difficult-to-measure variables through various computational estimation methods, and to use computer software to measure the variables to be measured. However, due to the wide range of influent sources, complex and diverse composition, and significant fluctuations in water quality in sewage treatment plants, the available effective data sample size is small, making conventional soft sensor modeling methods unsatisfactory in predicting effluent indicators (A Deep Learning-Based Soft Sensor Method for Biochemical Pool Indicators (CN118645179A)). Summary of the Invention
[0005] The purpose of the present invention is to address the problem of insufficient applicability of the existing technology, and to propose a new method for soft measurement modeling of effluent indicators in the sewage treatment process in combination with physical information fusion technology, specifically an intelligent algorithm based on the fusion of PINN (physical information neural network) and LSTM (long short-term memory network). The method of the present invention constructs physical constraint equations based on the sewage treatment reaction mechanism, and proposes a PINN-LSTM model in combination with the LSTM algorithm to establish a soft measurement model between difficult-to-measure effluent indicators and influent indicators. The fused PINN-LSTM model has a wider application range than the general PINN model and has superior performance than the general LSTM model. This method greatly improves the soft measurement accuracy of effluent indicators in the case of small training samples, reduces the detection time of effluent indicators in sewage treatment plants, improves detection accuracy and soft measurement interpretability, and makes the application of sewage soft measurement more extensive, which is conducive to ensuring the smooth operation of sewage treatment plants and helping to protect the ecological environment.
[0006] The purpose of the present invention is achieved through one of the following technical solutions.
[0007] A soft measurement method for water output indicators combined with physical information fusion technology includes the following steps:
[0008] S1. Obtain the measured inlet and outlet water index data of the sewage treatment plant to form an original data set of sewage inlet and outlet water indexes, and set each inlet and outlet water index in the original data set as each feature;
[0009] S2. Preprocess the original data set: filter each feature and remove or interpolate outliers to reduce their impact on the model; after removing outliers, standardize each feature.
[0010] S3. Using dissolved oxygen (DO) as an intermediate variable, a loss function based on the physical information neural network (PINN) is constructed.
[0011] S4. Constructing a soft-sensing model of intermediate variable DO based on physical information neural network PINN;
[0012] S5. Select auxiliary variables of the sewage effluent indicator soft measurement model based on LSTM according to the correlation between the inlet and outlet water indicators;
[0013] S6. Build a sewage effluent indicator soft measurement model based on the long short-term memory network (LSTM), and combine it with the intermediate variable DO soft measurement model based on the physical information neural network (PINN) to form a PINN-LSTM model.
[0014] S7. Train the PINN-LSTM model.
[0015] S8. Use the trained PINN-LSTM model to monitor the sewage effluent indicators online.
[0016] Furthermore, in step S2, the interquartile range method is used to filter the data. The specific steps are as follows:
[0017] S2.1. Arrange all data values in the original dataset from smallest to largest, defining that 25% of the data is less than or equal to the first quartile Q1 value, and 75% of the data is less than or equal to the third quartile Q3 value. For each feature, calculate the Q1 and Q3 values of the data corresponding to the feature.
[0018] S2.2. Calculate the interquartile range (IQR) value of each feature using Q3-Q1.
[0019] S2.3. Define outliers as data points that exceed Q3 + 1.5 IQR or fall below Q1 - 1.5 IQR. Calculate the outlier threshold based on Q1, Q3, and IQR.
[0020] S2.4. For each feature, mark the data points outside the outlier threshold as outliers;
[0021] S2.5. Divide the original data set into multiple intervals. Use cubic spline interpolation to fill in the data gaps after removing outliers to achieve the effect of data filtering. The interpolation function S(x) is:
[0022] S(x)=a i (xx i ) 3 +b i (xx i ) 2 +c i (xx i )+d i x∈[x i ,x i+1 ];
[0023] Among them, a i 、b i 、c i d i represents the cubic polynomial coefficient corresponding to the i-th interval in the original data set, x represents the position of the point to be interpolated, and x i Represents the position of the i-th interval in the original data set.
[0024] Furthermore, in step S3, with dissolved oxygen DO as an intermediate variable, a physical constraint equation and a loss function for the intermediate variable dissolved oxygen DO are constructed using the typical model BSM2 (benchmark simulation model 2) in the activated sludge process, and the constant reference value approximately corresponds to the parameter value at an ambient temperature of 15°C.
[0025] First, according to the biochemical reaction material balance equation [input] - [output] + [production] = [cumulative amount], the differential equation for the change rate of the intermediate variable dissolved oxygen DO is derived as follows:
[0026]
[0027] Among them, S O represents the dissolved oxygen concentration, X B,H represents the active heterotrophic biomass, X B,A represents the active autotrophic biomass, S S represents the concentration of biodegradable organic matter, S NH express Quantity, t represents time;
[0028] After obtaining the differential equation of the change rate of the intermediate variable dissolved oxygen DO, the loss function of the intermediate variable dissolved oxygen DO is constructed using the mean square error method. The loss function includes the data fitting term MSE u and physical constraint MSE f , let t k Represents the kth observation time point, given the kth observation time point t k The observed dissolved oxygen DO concentration at It is the physical information neural network PINN at the kth observation time point t k The predicted DO concentration at , N is the number of observation time points, then the data fitting term MSE u Expressed as:
[0029]
[0030] For solving the differential equation of the change rate of the intermediate variable dissolved oxygen DO, it can be discretized and used as part of the loss function, namely the physical constraint term MSE f , which can be expressed as:
[0031]
[0032] Fit the data to the MSE u and physical constraint MSE f Weighted summation gives the final loss function MSE:
[0033] MSE=MSE u +λMSE f ;
[0034] Among them, λ is a hyperparameter used to adjust the weight of the physical constraint term, Δt represents the step size of each time step, represents the dissolved oxygen concentration at the nth time step, represents the concentration of biodegradable organic matter at the nth time step, Represents the nth time step quantity.
[0035] Furthermore, in step S4, the intermediate variable DO soft-sensing model based on the physical information neural network PINN includes a first input layer, a first hidden layer and a first output layer connected in sequence;
[0036] The first input layer receives Quantity S NH , biodegradable organic matter S S , active heterotrophic biomass X B,H and active autotrophic biomass X B,A , the first output layer outputs the dissolved oxygen concentration S O ;
[0037] A batch normalization layer is added before the input of each first hidden layer to speed up the training process, improve the stability of the model, and help avoid the problem of vanishing or exploding gradients;
[0038] The loss function of the intermediate variable DO soft-sensing model based on the physical information neural network PINN adopts the loss function based on the physical information neural network PINN constructed in step S3.
[0039] Furthermore, in step S5, the variable projection importance analysis method is used to evaluate the importance of variables by measuring the projection contribution of all water inlet indicators in the principal component analysis, and the contribution degree of each water inlet indicator is ranked to identify the features that have a more significant impact on the water outlet indicator to be measured, and the easy-to-measure water inlet features in the top K positions of the ranking are set as auxiliary variables.
[0040] Furthermore, in step S6, the sewage effluent indicator soft measurement model based on the long short-term memory network LSTM includes a second input layer, a second hidden layer and a second output layer;
[0041] The second input layer receives the output of the DO soft measurement model based on the physical information neural network PINN and the auxiliary variables selected in step S5, and the target output of the second output layer is the set water output index to be measured;
[0042] A ReLU activation function is added after the second hidden layer to capture data features;
[0043] When initializing the sewage effluent indicator soft measurement model based on the long short-term memory network (LSTM), random initial values are assigned to the weights connecting the second input layer to the second hidden layer, and to the weights connecting the second hidden layer to the second output layer;
[0044] The loss function of the sewage effluent index soft measurement model based on the long short-term memory network LSTM is the mean square error (MSE);
[0045] The intermediate variable DO soft measurement model based on the physical information neural network PINN and the sewage effluent index soft measurement model based on the long short-term memory network LSTM are synthesized in series to obtain the PINN-LSTM model.
[0046] Furthermore, in step S7, the original data set after preprocessing in step S2 is divided into a training set and a validation set. The learning rate and number of iterations are selected using the Optuna hyperparameter optimization algorithm. The training set data is input into the PINN-LSTM model for training, and the trained PINN-LSTM model is evaluated using the validation set. The MSE value and R-square value are used to evaluate the model's fit and predictive ability, thereby obtaining a trained PINN-LSTM model.
[0047] Compared with the prior art, the present invention has the following advantages and beneficial effects:
[0048] The present invention reduces the demand for training data volume of existing soft measurement models, making the present invention more applicable in the field of sewage treatment, expanding the application scope of effluent index soft measurement in the field of sewage treatment, and having good social benefits. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] Figure 1 This is a flow chart of activated sludge wastewater treatment in an embodiment of the present invention.
[0050] Figure 2 This is a schematic diagram of the activated sludge wastewater treatment process in an embodiment of the present invention.
[0051] Figure 3 This is a general flow chart of soft sensor modeling in an embodiment of the present invention.
[0052] Figure 4 The figure is a flowchart of the steps of a water output indicator soft measurement method combined with physical information fusion technology in an embodiment of the present invention.
[0053] Figure 5 Schematic diagram of the structure of the PINN-LSTM model in an embodiment of the present invention. DETAILED DESCRIPTION
[0054] The technical solution of the present invention is further described in detail below with reference to specific embodiments and drawings, but the implementation manner and protection scope of the present invention are not limited thereto.
[0055] Activated sludge wastewater treatment process flow chart Figure 1 and Figure 2 As shown, the activated sludge process is the most commonly used method in current sewage treatment technology. According to statistics, about 70% of sewage treatment plants adopt this method. The present invention can be applied to sewage treatment plants that adopt the activated sludge process.
[0056] In one embodiment, the parameters of the sewage treatment system are shown in Tables 1 and 2, with effluent COD as the effluent indicator to be measured. The model uses 2000 identical data samples from the BSM2 system as the data set, and divides 80% into a training set and 20% into a test set.
[0057] Table 1: List of symbols for influent and effluent indicators of activated sludge wastewater treatment
[0058]
[0059] Table 2: Stoichiometric and reference kinetic parameters for activated sludge wastewater treatment
[0060]
[0061]
[0062] A soft measurement method for water output indicators combined with physical information fusion technology, such as Figure 4 As shown, the following steps are included:
[0063] S1. Obtain the measured inlet and outlet water index data of the sewage treatment plant to form an original data set of sewage inlet and outlet water indexes, and set each inlet and outlet water index in the original data set as each feature;
[0064] S2. Preprocess the original data set: filter each feature and remove or interpolate outliers to reduce their impact on the model; after removing outliers, standardize each feature.
[0065] In one embodiment, the interquartile range method is used to filter data. The specific steps are as follows:
[0066] S2.1. Arrange all data values in the original dataset from smallest to largest, defining that 25% of the data is less than or equal to the first quartile Q1 value, and 75% of the data is less than or equal to the third quartile Q3 value. For each feature, calculate the Q1 and Q3 values of the data corresponding to the feature.
[0067] S2.2. Calculate the interquartile range (IQR) value of each feature using Q3-Q1.
[0068] S2.3. Define outliers as data points that exceed Q3 + 1.5 IQR or fall below Q1 - 1.5 IQR. Calculate the outlier threshold based on Q1, Q3, and IQR.
[0069] S2.4. For each feature, mark the data points outside the outlier threshold as outliers;
[0070] S2.5. Divide the original data set into multiple intervals. Use cubic spline interpolation to fill in the data gaps after removing outliers to achieve the effect of data filtering. The interpolation function S(x) is:
[0071] S(x)=a i (xx i ) 3 +b i (xx i ) 2 +c i (xx i )+d i x∈[x i ,x i+1 ];
[0072] Among them, ai 、b i 、c i d i represents the cubic polynomial coefficient corresponding to the i-th interval in the original data set, x represents the position of the point to be interpolated, and x i Represents the position of the i-th interval in the original data set.
[0073] S3. Using dissolved oxygen (DO) as an intermediate variable, a loss function based on the physical information neural network (PINN) is constructed.
[0074] Taking dissolved oxygen (DO) as the intermediate variable, the physical constraint equation and loss function for the intermediate variable dissolved oxygen (DO) were constructed using the typical model BSM2 (benchmark simulation model 2) in the activated sludge process. The constant reference value approximately corresponds to the parameter value at an ambient temperature of 15°C (as shown in Table 2).
[0075] First, according to the biochemical reaction material balance equation [input] - [output] + [production] = [cumulative amount], the differential equation for the change rate of the intermediate variable dissolved oxygen DO is derived as follows:
[0076]
[0077] Among them, S O represents the dissolved oxygen concentration, X B,H represents the active heterotrophic biomass, X B,A represents the active autotrophic biomass, S S represents the concentration of biodegradable organic matter, S NH express Quantity, t represents time;
[0078] After obtaining the differential equation of the change rate of the intermediate variable dissolved oxygen DO, the loss function of the intermediate variable dissolved oxygen DO is constructed using the mean square error method. The loss function includes the data fitting term MSE u and physical constraint MSE f , let t k Represents the kth observation time point, given the kth observation time point t k The observed dissolved oxygen DO concentration at It is the physical information neural network PINN at the kth observation time point t k The predicted DO concentration at , N is the number of observation time points, then the data fitting term MSE u Expressed as:
[0079]
[0080] For solving the differential equation of the change rate of the intermediate variable dissolved oxygen DO, it can be discretized and used as part of the loss function, namely the physical constraint term MSE f , which can be expressed as:
[0081]
[0082] Fit the data to the MSE u and physical constraint MSE f Weighted summation gives the final loss function MSE:
[0083] MSE=MSE u +λMSE f ;
[0084] Among them, λ is a hyperparameter used to adjust the weight of the physical constraint term, Δt represents the step size of each time step, represents the dissolved oxygen concentration at the nth time step, represents the concentration of biodegradable organic matter at the nth time step, Represents the nth time step quantity.
[0085] S4, such as Figure 3 As shown, a soft-sensing model of intermediate variable DO based on physical information neural network PINN is constructed;
[0086] like Figure 5 As shown, the intermediate variable DO soft-sensing model based on the physical information neural network PINN includes a first input layer, a first hidden layer and a first output layer connected in sequence;
[0087] The first input layer receives Quantity S NH , biodegradable organic matter S S , active heterotrophic biomass X B,H and active autotrophic biomass X B,A , the first output layer outputs the dissolved oxygen concentration S O ;
[0088] In the first hidden layer, in order to ensure that the network can effectively capture the complex characteristics of the system, the network often adopts a multi-layer hidden layer structure and configures an appropriate number of neurons for each layer. In addition, an activation function, such as ReLU, tanh, or sigmoid, needs to be introduced after each first hidden layer to introduce nonlinear factors and enhance the expressive power of the network. The specific choice of activation function is often based on experimental results and problem characteristics. In one embodiment, after multiple experiments, the number of first hidden layers finally selected is 2, and the ReLU function is selected as the activation function after each first hidden layer. The ReLU function is expressed as follows:
[0089] f(x)=max(0,x)
[0090] In addition, the present invention uses the Optuna hyperparameter optimization tool to search for the optimal learning rate and the optimal number of hidden layer nodes. Based on the Bayesian optimization algorithm, the Optuna optimization tool also adds an adaptive sampling algorithm to dynamically adjust the sampling strategy in the Bayesian optimization algorithm according to the characteristics of the search space and the behavior of the objective function, so as to shorten the optimization time and improve the performance of the model on the test set. In one embodiment, the optimization loop is set to 100 times, and the optimal number of hidden layer nodes of the model is finally obtained to be 95, and the optimal learning rate is approximately 0.000115 with three significant decimal places.
[0091] A batch normalization layer is added before the input of each first hidden layer to speed up the training process, improve the stability of the model, and help avoid the problem of vanishing or exploding gradients;
[0092] The loss function of the intermediate variable DO soft-sensing model based on the physical information neural network PINN adopts the loss function based on the physical information neural network PINN constructed in step S3.
[0093] In one embodiment, an Adam optimizer is selected. This optimizer can adaptively adjust the learning rate to meet the requirements of different parameters, thereby optimizing the training process.
[0094] S5, such as Figure 3 As shown in the figure, the auxiliary variables of the sewage effluent index soft measurement model based on LSTM are selected according to the correlation between the inlet and outlet water indicators;
[0095] The variable projection importance analysis method is used to evaluate the importance of variables by measuring the projection contribution of all influent indicators in the principal component analysis. The contribution of each influent indicator is ranked to identify the features that have a significant impact on the effluent indicator to be measured. The top K easy-to-measure influent features are set as auxiliary variables.
[0096] In one embodiment, the water index to be measured is set to COD, and after sorting the variables by importance, TSS is selected. in (influent suspended solids concentration), X Sin (concentration of slowly biodegradable organic matter in influent), X Iin (influent particulate inert organic matter concentration), X BHin (influent active heterotrophic biomass), S Sin (influent biodegradable organic matter concentration), X NDin (degradable organic nitrogen concentration of influent particles), S NHin (Water Inlet These 7 easily measurable water inflow variables are auxiliary variables; these 7 easily measurable water inflow indicators.
[0097] S6. Build a sewage effluent indicator soft measurement model based on the long short-term memory network (LSTM), and combine it with the intermediate variable DO soft measurement model based on the physical information neural network (PINN) to form a PINN-LSTM model.
[0098] like Figure 5 As shown, the sewage effluent indicator soft measurement model based on the long short-term memory network LSTM includes a second input layer, a second hidden layer and a second output layer;
[0099] The second input layer receives the output of the DO soft measurement model based on the physical information neural network PINN and the auxiliary variables selected in step S5, and the target output of the second output layer is the set water output index to be measured;
[0100] In one embodiment, the target output is COD, the number of input layer nodes is set to 8, and the input variables are the output of the PINN-based DO soft measurement model and 7 auxiliary variables TSS, XS, XI, XBH, SS, XND, and SNH. After experiments, the number of the second hidden layer is set to 5, and the number of nodes in the second hidden layer is determined by the Optuna hyperparameter optimization tool to determine the number of nodes in the five second hidden layers as 114, 128, 116, 124, and 120 respectively.
[0101] A ReLU activation function is added after the second hidden layer to capture data features;
[0102] When initializing the sewage effluent indicator soft measurement model based on the long short-term memory network (LSTM), random initial values are assigned to the weights connecting the second input layer to the second hidden layer, and to the weights connecting the second hidden layer to the second output layer;
[0103] The loss function of the sewage effluent index soft measurement model based on the long short-term memory network LSTM is the mean square error (MSE);
[0104] like Figure 5 As shown in the figure, the intermediate variable DO soft measurement model based on the physical information neural network PINN and the sewage effluent index soft measurement model based on the long short-term memory network LSTM are synthesized in series to obtain the PINN-LSTM model.
[0105] S7. Train the PINN-LSTM model.
[0106] The original data set after preprocessing in step S2 is divided into a training set and a validation set. The learning rate and number of iterations are selected using the Optuna hyperparameter optimization algorithm. The training set data is input into the PINN-LSTM model for training, and the trained PINN-LSTM model is evaluated using the validation set. In one embodiment, the MSE value and the R-square value are used as two indicators to evaluate the degree of fit and predictive ability of the model. The smaller the MSE value, the closer the predicted value of the model is to the true value. The closer the R-square value is to 1, the better the model can explain the data variance, reflecting that the model has a better fitting effect, thereby obtaining a trained PINN-LSTM model.
[0107] S8. Use the trained PINN-LSTM model to monitor the sewage effluent indicators online.
[0108] In one embodiment, to better demonstrate the practicality of the PINN-LSTM model, comparative experiments were conducted using several common soft sensor modeling methods: linear regression, FNN, BP, and LSTM. Table 3 shows a comparison of the actual and predicted values for the training and test data.
[0109] Table 3 - Experimental results: Performance comparison of various models with different data sample sizes
[0110]
[0111]
[0112] As can be seen from Table 3, compared with the existing soft measurement model, when the data sample size is different, the MSE value of the soft measurement model established by the present invention is the lowest, and the R square value is the highest. Compared with the better model (COD soft measurement model based on BP) among the four comparison models, the COD soft measurement model based on the PINN-LSTM model of the present invention has a reduced MSE value of 80.85%, and an R square value of 0.013. The advantage is particularly obvious in the case of small samples (less than 1000 sample sizes), such as: when the sample size is 200, the MSE value of the PINN-LSTM model of the present invention is reduced by 91.81%, and the R square value is increased by 0.014. When the sample size is 500, the MSE value of the PINN-LSTM model of the present invention is reduced by 86.64%, and the R square value is increased by 0.022 compared with the better model (LSTM model) among the four comparison models. When the sample size is small, the four traditional methods used for comparison all have difficulty learning sufficient features from the limited data. Thanks to the powerful nonlinear modeling capabilities and ability to integrate physical laws of the present invention, the learning effect of this model is better than other models when the sample size is small. As can be seen from the above evaluation indicators, the soft measurement method of water effluent indicators based on physical information fusion has excellent predictive capabilities. Therefore, a prominent advantage of the present invention is that it reduces the demand for training data volume of existing soft measurement models, making the present invention more applicable in the field of sewage treatment and expanding the scope of application of soft measurement of water effluent indicators in sewage treatment.
[0113] It is particularly important to note that the present invention adopts a soft measurement model based on PINN and LSTM algorithms. As long as the relevant methods of the present invention are used to predict any water output index, it should fall within the scope of protection of the present invention.
[0114] The above embodiments are only preferred implementation modes of the present invention and are only used to explain the present invention rather than to limit the present invention. Any changes, substitutions, modifications, etc. made by those skilled in the art without departing from the spirit of the present invention should fall within the scope of protection of the present invention.
Claims
1. A soft measurement method for water output indicators combined with physical information fusion technology, characterized in that: The steps include: S1. Obtain the measured inlet and outlet water index data of the sewage treatment plant to form an original data set of sewage inlet and outlet water indexes, and set each inlet and outlet water index in the original data set as each feature; S2. Preprocess the original data set: filter each feature, remove outliers or perform interpolation; after removing outliers, standardize each feature; S3. Using dissolved oxygen (DO) as an intermediate variable, a loss function based on the physical information neural network (PINN) is constructed. S4. Constructing a soft-sensing model of intermediate variable DO based on physical information neural network PINN; S5. Select auxiliary variables of the sewage effluent indicator soft measurement model based on LSTM according to the correlation between the inlet and outlet water indicators; S6. Build a sewage effluent indicator soft measurement model based on the long short-term memory network (LSTM), and combine it with the intermediate variable DO soft measurement model based on the physical information neural network (PINN) to form a PINN-LSTM model. S7. Train the PINN-LSTM model. S8. Use the trained PINN-LSTM model to monitor the sewage effluent indicators online.
2. The water output indicator soft measurement method combined with physical information fusion technology according to claim 1 is characterized in that: In step S2, the interquartile range method is used to filter the data. The specific steps are as follows: S2.
1. Arrange all data values in the original dataset from smallest to largest, defining that 25% of the data is less than or equal to the first quartile Q1 value, and 75% of the data is less than or equal to the third quartile Q3 value. For each feature, calculate the Q1 and Q3 values of the data corresponding to the feature. S2.
2. Calculate the interquartile range (IQR) value of each feature using Q3-Q1. S2.
3. Define outliers as data points that exceed Q3 + 1.5 IQR or fall below Q1 - 1.5 IQR. Calculate the outlier threshold based on Q1, Q3, and IQR. S2.
4. For each feature, mark the data points outside the outlier threshold as outliers; S2.
5. Divide the original data set into multiple intervals. Use cubic spline interpolation to fill in the data gaps after removing outliers to achieve the effect of data filtering. The interpolation function S(x) is: S(x)=a i (x-x i ) 3 +b i (x-x i ) 2 +c i (x-x i )+d i x∈[x i ,x i+1 ]; Among them, a i 、b i 、c i d i represents the cubic polynomial coefficient corresponding to the i-th interval in the original data set, x represents the position of the point to be interpolated, and x i Represents the position of the i-th interval in the original data set.
3. The water output indicator soft measurement method combined with physical information fusion technology according to claim 1 is characterized in that: In step S3, the physical constraint equation and loss function of the intermediate variable dissolved oxygen DO are constructed using the model BSM2 in the activated sludge process with dissolved oxygen DO as the intermediate variable; First, based on the biochemical reaction material balance equation, the differential equation for the change rate of the intermediate variable dissolved oxygen DO is derived as follows: Among them, S O represents the dissolved oxygen concentration, X B,H represents the active heterotrophic biomass, X B,A represents the active autotrophic biomass, S S represents the concentration of biodegradable organic matter, S NH express Quantity, t represents time; After obtaining the differential equation of the change rate of the intermediate variable dissolved oxygen DO, the loss function of the intermediate variable dissolved oxygen DO is constructed using the mean square error method. The loss function includes the data fitting term MSE u and physical constraint MSE f , let t k Represents the kth observation time point. Given the observed dissolved oxygen DO concentration at the kth observation time point, is the predicted DO concentration of the physical information neural network PINN at the kth observation time point, N is the number of observation time points, and the data fitting term MSE is u Expressed as: For solving the differential equation of the change rate of the intermediate variable dissolved oxygen DO, after discretization, it is used as part of the loss function, that is, the physical constraint term MSE f , expressed as: Fit the data to the MSE u and physical constraint MSE f Weighted summation gives the final loss function MSE: MSE=MSE u +λMSE f ; Among them, λ is a hyperparameter used to adjust the weight of the physical constraint term, Δt represents the step size of each time step, represents the dissolved oxygen concentration at the nth time step, represents the concentration of biodegradable organic matter at the nth time step, Represents the nth time step quantity.
4. The water output indicator soft measurement method combined with physical information fusion technology according to claim 1 is characterized in that: In step S4, the intermediate variable DO soft-sensing model based on the physical information neural network PINN includes a first input layer, a first hidden layer and a first output layer connected in sequence; The first input layer receives Quantity S NH , biodegradable organic matter S S , active heterotrophic biomass X B,H and active autotrophic biomass X B,A , the first output layer outputs the dissolved oxygen concentration S O ; A batch normalization layer is added before the input of each first hidden layer.
5. The water output indicator soft measurement method combined with physical information fusion technology according to claim 1 is characterized in that: The loss function of the intermediate variable DO soft-sensing model based on the physical information neural network PINN adopts the loss function based on the physical information neural network PINN constructed in step S3.
6. The water output indicator soft measurement method combined with physical information fusion technology according to claim 1 is characterized in that: In step S5, the variable projection importance analysis method is used to rank the contribution of each water inlet index by measuring the projection contribution of all water inlet indexes in the principal component analysis, and the easy-to-measure water inlet characteristics in the top K positions of the ranking are set as auxiliary variables.
7. The water output indicator soft measurement method combined with physical information fusion technology according to claim 1 is characterized in that: In step S6, the sewage effluent indicator soft measurement model based on the long short-term memory network LSTM includes a second input layer, a second hidden layer and a second output layer; The second input layer receives the output of the DO soft measurement model based on the physical information neural network PINN and the auxiliary variables selected in step S5, and the target output of the second output layer is the set water output index to be measured; The ReLU activation function is added after the second hidden layer; When initializing the sewage effluent indicator soft measurement model based on the long short-term memory network (LSTM), random initial values are assigned to the weights connecting the second input layer to the second hidden layer and the weights connecting the second hidden layer to the second output layer.
8. According to the soft measurement method for water discharge indicators combined with physical information fusion technology described in claim 1, the loss function of the sewage discharge indicator soft measurement model based on the long short-term memory network LSTM is the mean square error.
9. According to the soft measurement method for water discharge indicators combined with physical information fusion technology described in claim 1, the intermediate variable DO soft measurement model based on the physical information neural network PINN and the sewage discharge indicator soft measurement model based on the long short-term memory network LSTM are synthesized in series to obtain a PINN-LSTM model.
10. The water output index soft measurement method combined with physical information fusion technology according to claim 1 is characterized in that: In step S7, the original data set preprocessed in step S2 is divided into a training set and a validation set, the learning rate and number of iterations are selected, the training set data is input into the PINN-LSTM model for training, and the trained PINN-LSTM model is evaluated using the validation set to obtain a trained PINN-LSTM model.
Citation Information
Patent Citations
Biochemical pool index soft measurement method based on deep learning
CN118645179A