Method and system for predicting effluent quality of air floatation unit of refining and chemical sewage treatment system
By constructing a water quality prediction model for the effluent from the air flotation unit of a refining wastewater treatment system based on SVR, and optimizing parameters using correlation analysis and cross-validation algorithms, the problems of accuracy and timeliness in monitoring the effluent quality of the air flotation unit in the refining wastewater treatment system were solved, and efficient water quality prediction was achieved.
Patent Information
- Application Number
- CN202410577703.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-10
- Publication Date
- 2025-11-11
AI Technical Summary
In the treatment of wastewater from refining and chemical plants, it is difficult to make accurate and timely predictions of the effluent quality from the flotation unit. Traditional chemical methods are time-consuming and easily affected by environmental and human factors. Data-driven prediction models are under-researched in the field of wastewater treatment in refining and chemical plants.
A water quality prediction model for the effluent from the air flotation unit was constructed based on support vector regression (SVR). Parameters were selected using Pearson product-moment correlation coefficient, Spearman correlation coefficient, and average influence value algorithms. The model parameters were optimized using K-CV cross-validation algorithm, and predictions were made using historical water quality parameters from refining and chemical enterprises.
It improves the timeliness and accuracy of water quality data, with model prediction time less than 10 seconds and accuracy far exceeding that of traditional methods, thus ensuring the stable operation of the sewage treatment system.
Smart Images

Figure CN120930840A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of water quality prediction technology for refining and chemical wastewater treatment systems, and in particular to a method and system for predicting the effluent water quality of an air flotation unit in a refining and chemical wastewater treatment system. Background Technology
[0002] Wastewater from refining and chemical enterprises is characterized by high oil content, accompanied by high levels of suspended solids and dissolved salts, exhibiting strong emulsification stability. Emulsified and dispersed oils in refining and chemical wastewater are primarily removed via air flotation (AF). However, the small size of these oil droplets (5–150 μm) and the presence of surfactants added during extraction and transportation make oil droplet separation extremely difficult. Therefore, the removal of emulsified and dispersed oils is a crucial step in the wastewater treatment process for refining and chemical enterprises. The treatment efficiency of the AF unit directly affects the operational efficiency of subsequent biological treatment systems, thus impacting effluent quality. Consequently, monitoring the effluent quality of AF units has become a key focus of research. Currently, monitoring of effluent from AF units in refining and chemical enterprises primarily relies on traditional chemical methods, which are time-consuming, produce highly volatile data, and are susceptible to environmental or human-induced influences. Furthermore, data-driven predictive models for effluent quality from AF units in refining and chemical enterprise wastewater treatment systems are still relatively scarce.
[0003] In recent years, data-driven prediction models have received increasing attention. Support vector regression (SVR) is a method that seeks the optimal balance between complexity and learning ability using limited sample data, thereby achieving the best generalization ability with a small number of statistical samples. SVR has been widely used in industrial fields, such as PM2.5. 2.5 While research has been conducted on predictive models for mass concentration, municipal water quality parameters, and comprehensive groundwater quality assessment, there are currently few reports on predictive models for refining and chemical wastewater treatment. Refining and chemical enterprises have numerous production units and complex processes and equipment, resulting in significant fluctuations in water quality and quantity in wastewater treatment systems, poor system stability, and high prediction difficulty. Furthermore, manually collected data from air flotation units has poor timeliness and is easily manipulated. Therefore, there is an urgent need to develop water quality prediction models suitable for air flotation units in refining and chemical wastewater treatment systems. Summary of the Invention
[0004] The purpose of this invention is to provide a method and system for predicting the effluent water quality of an air flotation unit in a refining wastewater treatment system. Addressing the limitations of traditional chemical monitoring methods in accurately and timely predicting the water quality of the air flotation unit in refining wastewater treatment systems, and the resulting poor data timeliness, this invention utilizes existing historical water quality parameter big data from refining enterprises to construct a predictive model for the effluent water quality parameters of the air flotation unit. This enables the prediction of the effluent water quality, ensuring the timeliness of water quality data and guaranteeing the stable operation of the wastewater treatment system. To achieve the above objective, this invention provides the following technical solution:
[0005] This invention provides a method for predicting the effluent quality of an air flotation unit in a refining wastewater treatment system, the method comprising:
[0006] Step S1: Collect historical water quality parameters from the inlet and outlet of the air flotation unit in the refining wastewater treatment system;
[0007] Step S2: Preprocess the collected historical water quality parameters;
[0008] Step S3: Use correlation analysis of Pearson product-moment correlation coefficients (PCCs) and Spearman correlation coefficients (SCCs) to preliminarily screen the historical water quality parameters after pretreatment;
[0009] Step S4: Construct the SVR_MIV model using the MIV algorithm, and perform a second screening of historical water quality parameters based on the preliminary screening results;
[0010] Step S5: Based on the secondary screening results of the historical water quality parameters, select the kernel function of the SVR prediction model;
[0011] Step S6: Select SVR prediction model parameters based on the selected SVR prediction model kernel function;
[0012] Step S7: Use the trained SVR prediction model to predict water quality indicators and test the model regression effect on the test set.
[0013] Furthermore, in step S1, the historical water quality parameters include: chemical oxygen demand (COD), biochemical oxygen demand (BOD5), suspended solids (SS), ammonia nitrogen (NH3-N), conductivity (Cond), and petroleum hydrocarbons.
[0014] Furthermore, step S2, preprocessing the collected historical water quality parameters, includes:
[0015] Outlier detection algorithms are used to identify and process outliers to improve the robustness of the model. The Hampel linear filtering algorithm is used to remove outliers from the water quality data and replace the outliers with the average of the data before and after the outlier, ensuring the accuracy and reliability of the model training data.
[0016] Furthermore, step S3, which involves using correlation analysis of Pearson product-moment correlation coefficients (PCCs) and Spearman correlation coefficients (SCCs) to preliminarily screen the pretreated historical water quality parameters, includes:
[0017] Pearson product-moment correlation coefficients (PCCs) and Spearman correlation coefficients (SCCs) are used to measure the correlation between variables. Correlation analysis is used to reduce the dimensionality of the feature space to extract key information from the data, remove redundant parameter information, improve the model's computational efficiency, reduce model complexity, and thus improve the model's generalization ability.
[0018] Furthermore, step S4, constructing an SVR_MIV model using the MIV algorithm and combining it with the preliminary screening results, performs a secondary screening of historical water quality parameters, including:
[0019] The mean impact value (MIV) method was used to assess the influence of input variables on output variables. An SVR_MIV model was constructed. Combining the preliminary screening results from step S3, correlation analysis, SVR_MIV model calculation results, and expert experience were used to conduct a second screening of water quality parameters, remove redundant variables, and determine the input water quality parameter indicators for the air flotation unit of the refining wastewater treatment system.
[0020] Further, step S5, selecting the SVR prediction model kernel function based on the secondary screening results of the historical water quality parameters, includes:
[0021] Based on the secondary screening results of historical water quality parameters in step S4, and with other SVR parameters remaining unchanged, prediction experiments were conducted on four common kernel functions: polynomial function, linear function, RBF Gaussian radial basis function, and Sigmoid function. By comparing the prediction results, the optimal kernel function was selected for the water quality prediction model.
[0022] Further, step S6, selecting SVR prediction model parameters based on the selected SVR prediction model kernel function, includes:
[0023] The K-CV and GSA algorithms are used to optimize the SVR model. The SVR model parameters include the penalty coefficient c and the kernel function parameter g. The GSA algorithm exhaustively searches all combinations of c and g parameters by specifying a list of candidate values for hyperparameters, and trains and evaluates the model for each set of parameters. For the c and g given by the GSA algorithm, the K-CV algorithm divides the data into K groups, uses each subset of data as a validation set, and uses the remaining K-1 subsets of data as the training set to obtain K models. The average prediction accuracy of the final validation set of the K models is used as the prediction performance index under this K-CV, and the optimal c and g are obtained.
[0024] The present invention also provides a system for predicting the effluent quality of an air flotation unit in a refining wastewater treatment system, the system comprising:
[0025] The historical water quality parameter collection module is used to collect historical water quality parameters at the inlet and outlet of the air flotation unit in the refining wastewater treatment system.
[0026] The pretreatment module is used to preprocess the collected historical water quality parameters;
[0027] The preliminary screening module is used to perform preliminary screening of pretreated historical water quality parameters using correlation analysis of Pearson product-moment correlation coefficients (PCCs) and Spearman correlation coefficients (SCCs).
[0028] The secondary screening module is used to construct an SVR_MIV model using the MIV algorithm and, in conjunction with the preliminary screening results, to perform secondary screening of historical water quality parameters.
[0029] The kernel function selection module is used to select the kernel function of the SVR prediction model based on the secondary screening results of the historical water quality parameters.
[0030] The parameter selection module is used to select SVR prediction model parameters based on the selected SVR prediction model kernel function.
[0031] The water quality index prediction module is used to predict water quality indicators using the trained SVR prediction model and to test the model's regression performance on the test set.
[0032] The present invention also provides an electronic device, comprising:
[0033] One or more processors;
[0034] Storage device for storing one or more programs;
[0035] When the one or more programs are executed by the one or more processors, the one or more processors implement the above-described method for predicting the effluent quality of the air flotation unit in a refining wastewater treatment system.
[0036] The present invention also provides a storage medium containing computer-executable instructions, which, when executed by a computer processor, are used to perform the above-described method for predicting the effluent quality of the flotation unit in a refining wastewater treatment system.
[0037] The technical effects and advantages of this invention are as follows:
[0038] This invention develops a water quality prediction model for air flotation units based on Support Vector Regression (SVR). The model's input parameters are reduced in dimensionality using Pearson correlation coefficients (PCCs), Spearman correlation coefficients (SCCs), and the Mean Influence Value (MIV) algorithm. Based on this, the SVR prediction model's parameters are optimized using the K-CV cross-validation algorithm. The K-CV-SVR model exhibits high coefficients of determination and correlation, with a mean absolute percentage error (MAPE) of less than 0.05, demonstrating prediction accuracy significantly higher than traditional SVR and BP neural network models. Traditional chemical monitoring methods require approximately 20-30 minutes to acquire data, while this prediction model's response time is less than 10 seconds. This significantly reduces data acquisition time, greatly improving data effectiveness and timeliness, and ensuring accurate control. This invention can provide a reference for water quality prediction and operation in refining wastewater treatment systems and has promising prospects for widespread application.
[0039] Other features and advantages of the invention will be set forth in the following description, and will be apparent in part from the description, or may be learned by practicing the invention. The objects and other advantages of the invention may be realized and obtained by means of the structures pointed out in the description and the drawings. Attached Figure Description
[0040] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0041] Figure 1 This is a flowchart of a method for predicting the effluent quality of an air flotation unit in a refining wastewater treatment system according to the present invention.
[0042] Figure 2 This is a schematic diagram of the SVR model principle of the present invention;
[0043] Figure 3 This is a schematic diagram of an effluent water quality prediction system for an air flotation unit in a refining wastewater treatment system according to the present invention.
[0044] Figure 4 This is a schematic diagram of an electronic device provided by the present invention. Detailed Implementation
[0045] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0046] The flowchart shown in the attached diagram is merely an illustrative example and does not necessarily include all steps. For example, some steps may be broken down, while others may be combined or partially combined; therefore, the actual execution order may change depending on the specific circumstances.
[0047] The terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such use of data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in sequences other than those illustrated or described herein.
[0048] Furthermore, the terms “comprising” and “having”, and any variations thereof, are intended to cover non-exclusive inclusion, such that a process, method, system, product, or device that includes a series of steps or sub-modules is not necessarily limited to those steps or sub-modules that are explicitly listed, but may include other steps or sub-modules that are not explicitly listed or that are inherent to such process, method, product, or device.
[0049] To address the shortcomings of existing technologies, this invention discloses a method for predicting the effluent quality of a refining wastewater flotation unit. Figure 1 This is a flowchart of a method for predicting the effluent quality of an air flotation unit in a refining wastewater treatment system, as described in the present invention. Figure 1 As shown, the method includes the following steps:
[0050] Step S1: Collect historical water quality parameters from online water quality monitoring equipment at the inlet and effluent of the flotation unit in the refining wastewater treatment system. These parameters include chemical oxygen demand (COD), biochemical oxygen demand (BOD5), suspended solids (SS), ammonia nitrogen (NH3-N), conductivity (Cond), and petroleum pollutants. If the refinery is not equipped with online water quality monitoring equipment, the results of manual sampling and monitoring will be used instead.
[0051] To ensure a clear and accurate understanding of the technical solution of this application, some technical terms are explained herein.
[0052] The air flotation unit is a treatment method that introduces air into wastewater and releases it as tiny bubbles to act as carriers. Pollutants such as emulsified oil and tiny suspended particles in the wastewater adhere to the bubbles and float to the surface with them, forming a three-phase mixture of foam, air, water, and particles (oil). By collecting the scum, the impurities are separated and the wastewater is purified.
[0053] COD, or Chemical Oxygen Demand, is a chemically measured amount of reducing substances in a water sample that need to be oxidized.
[0054] BOD5, or Biochemical Oxygen Demand, is the amount of oxygen required for the oxidation and decomposition of organic matter in water by microorganisms. BOD5 is commonly used to measure the amount of organic waste in water bodies and is one of the important indicators for assessing the degree of water pollution.
[0055] SS, or Suspended Solids, also known as suspended particles, includes suspended solids, organic and inorganic particles, microorganisms, colloids, etc., in water. These suspended solids cause water turbidity and cloudiness, affecting water quality, and may also harm aquatic life. Therefore, SS is one of the important indicators for evaluating wastewater treatment effectiveness.
[0056] The NH3-N parameter refers to the total amount of dissolved and free ammonia nitrogen in water. Ammonia nitrogen refers to both NH3 and NH4+. + Nitrogen exists in two forms and is one of the most important pollutants in wastewater. High concentrations of ammonia nitrogen can lead to eutrophication, promote algal growth, and harm aquatic life.
[0057] The conductivity parameter (Cond) is a parameter used in wastewater testing to measure the electrolyte content in water. Conductivity refers to the ability of water to conduct electric current per unit length of water, usually expressed in millisiemens per centimeter (mS / cm) or microsiemens per centimeter (μS / cm). The conductivity of water is mainly affected by dissolved solids (such as salts and minerals), temperature, and pressure. In wastewater treatment, conductivity can be used to monitor changes in water quality, reflect the content of dissolved substances in the water, and help assess water quality and treatment effectiveness.
[0058] Petroleum compounds can exist in dissolved, emulsified, and dispersed forms in wastewater. When petroleum compounds enter the aquatic environment, their concentration exceeding 0.1-0.4 mg / L can form an oil film on the water surface, affecting the reoxygenation process, causing oxygen deficiency, and harming the life of aquatic organisms and the aerobic degradation of organic pollutants.
[0059] Step S2: Preprocess the collected historical water quality parameters to remove outliers and deviations. The wastewater treatment system in a chemical plant differs from municipal wastewater treatment systems; its water quality and quantity fluctuate significantly, and monitoring data is easily affected by water quality fluctuations and human intervention. Outliers in the monitoring data can negatively impact the model's predictive performance. An outlier detection algorithm is used to identify and process outliers to improve the model's robustness. The Hampel linear filtering algorithm is used to remove outliers from the water quality data, and the average of the data before and after the outlier is used to replace the outlier, ensuring the accuracy and reliability of the model training data.
[0060] Step S3: Initial screening of historical water quality parameters for the air flotation unit. Pearson product-moment correlation coefficients (PCCs) and Spearman correlation coefficients (SCCs) are used to measure the correlation between variables. Correlation analysis reduces the dimensionality of the feature space to extract key information from the data, removes redundant parameters, improves model computational efficiency, reduces model complexity, and thus enhances the model's generalization ability.
[0061] Step S4: Use the Mean Impact Value (MIV) method to assess the influence between input variables and output variables, construct the SVR_MIV model, and combine the preliminary screening results from Step S3 with the correlation analysis, SVR_MIV model calculation results, and expert experience to conduct a second screening of water quality parameters, remove redundant variables, and determine the input water quality parameter indicators for the air flotation unit of the refining wastewater treatment system.
[0062] Step S5: Selection of kernel function for SVR prediction model. Based on the secondary screening results of historical water quality parameters in Step S4, and with other SVR parameters remaining unchanged (g value, p value, and penalty factor c all unchanged), prediction experiments were conducted on four common kernel functions: polynomial function, linear function, RBF Gaussian radial basis function, and Sigmoid function. By comparing the prediction results, the optimal kernel function was selected for the water quality prediction model.
[0063] Step S6: SVR Prediction Model Parameter Selection. The SVR model is optimized using the K-CV and GSA algorithms. The SVR model parameters include the penalty coefficient c and the kernel function parameter g. The GSA algorithm exhaustively searches for all combinations of c and g parameters using a specified list of candidate hyperparameter values, and trains and evaluates the model for each set of parameters. For the c and g given by the GSA algorithm, the K-CV algorithm divides the data into K groups (K is 5 in this study, i.e., 5 subsets). Each subset is used as a validation set, and the remaining K-1 subsets are used as the training set, resulting in K models. The average prediction accuracy of the final validation set of the K models is used as the prediction performance index under this K-CV algorithm, yielding the optimal c and g.
[0064] Step S7: Water quality index prediction. The trained SVR model is then tested on the test set to assess its regression performance.
[0065] Furthermore, the specific implementation of step S1 is as follows:
[0066] Collect at least 300 sets of historical water quality parameters during the operation of the air flotation unit in the refining and chemical enterprise, including effluent water quality data and influent water quality data. The authenticity of the data is crucial for model training. Specifically, the COD measurement results must be based on the measurement results of "Determination of Chemical Oxygen Demand in Water - Potassium Dichromate Method" (HJ 828-2017); the petroleum hydrocarbon measurement results must be based on "Determination of Petroleum Hydrocarbons and Animal and Vegetable Oils in Water - Infrared Spectrophotometry" (HJ 637-2018); the BOD5 measurement results must be based on "Determination of Five-Day Oxygen Demand in Water - Dilution and Inoculation Method" (HJ 505-2009); the pH measurement results must be based on "Determination of pH Value in Water - Glass Electrode Method" (GB 6920-1986); the SS measurement must be based on "Determination of Suspended Solids in Water - Gravimetric Method" (GB11901-89); and the NH3-N measurement must be based on "Determination of Ammonia Nitrogen in Water - Nessler's Reagent Spectrophotometry" (HJ 535-2009).
[0067] Furthermore, the specific implementation of step S3 is as follows:
[0068] The Pearson product-moment correlation coefficient (PCC) is used to measure the correlation (linear correlation) between two variables X and Y (as shown in equation (1) below), and its value ranges between -1 and 1. In the natural sciences, this coefficient is widely used to measure the degree of correlation between two variables. The Pearson correlation coefficient is calculated by dividing the covariance of the two variables by the product of their respective standard deviations. Covariance is a statistic that measures the relationship between two variables. When the covariance is positive, it indicates that there is a positive correlation between the two variables; when the covariance is negative, it indicates that there is a negative correlation between the two variables; when the covariance is 0, it indicates that there is no linear relationship between the two variables.
[0069]
[0070] In equation (1), Corr(X,Y) represents the Pearson product-moment correlation coefficient of X and Y; Cov(X,Y) represents the covariance of X and Y; Var(X) represents the variance of X; and Var(Y) represents the variance of Y.
[0071] The Spearman correlation coefficient (SCC) is a statistical method used to measure the degree of correlation between two variables (as shown in equation (2)). Its value ranges from -1 to 1, where -1 indicates a perfect inverse correlation, 0 indicates no correlation, and 1 indicates a perfect positive correlation. The Spearman correlation coefficient is not limited by data type and can be applied to both ordered and unordered variables. In addition, the Spearman correlation coefficient is not affected by outliers and is more suitable for nonlinear systems.
[0072]
[0073] In equation (2), p represents the Spearman correlation coefficient; di represents the rank difference; and n represents the sample size.
[0074] Furthermore, the specific implementation of step S4 is as follows:
[0075] Specifically, the SVR_MIV algorithm works by proportionally scaling the original data feature values and then feeding them back into the trained SVR model. The differences between the training values of each variable are then averaged to represent the influence of different input parameters on the training results. This value reflects the changes in the weights of each parameter and can be used to evaluate the correlation between the variables. Filtering input features based on their influence effectively eliminates variables with low contribution to the algorithm, improving its accuracy and making the model analysis results more precise.
[0076] First, an SVR model is constructed, and the dimensionality of the input feature vector is reduced using the MIV calculation results. A randperm function is constructed, and 70% of the input data is randomly extracted as the training set for training the SVR model, while the remaining 30% is used as the test set to verify the model's accuracy. Furthermore, the Gaussian radial basis function (RBF) is chosen as the kernel function for the SVR_MIV model. The penalty factor c, kernel parameter g, and loss function p of the SVR_MIV model have no predetermined range; only that the model meets certain accuracy requirements (coefficient of determination R0). 2 A value greater than 0.6 is acceptable. The SVR_MIV results will sort the parameters by their correlation to find the input variable.
[0077] Furthermore, the specific implementation of step S5 is as follows:
[0078] Support Vector Regression (SVR) is a machine learning algorithm used to solve regression problems. Its basic principle is as follows:
[0079] Data transformation: SVR first maps the input training data into a high-dimensional feature space, which can be achieved through kernel functions (such as linear kernels, polynomial kernels, radial basis function kernels, etc.).
[0080] Constructing a regression model: In a high-dimensional feature space, SVR seeks a hyperplane that maximizes the margin between the training sample points and the hyperplane, while allowing for a certain degree of error (i.e., margin boundary).
[0081] Identifying support vectors: Similar to Support Vector Machine (SVM), SVR also finds support vectors that influence the model, and focuses on these support vectors during training.
[0082] Optimization Solution: The goal of SVR is to minimize model complexity (by controlling the margin size) and training error to obtain a regression model with strong generalization ability. This involves solving a convex quadratic programming problem.
[0083] Prediction: For new input samples, SVR uses the trained model to make predictions. By calculating the distance between the input sample and the hyperplane, and combining the support vectors and their weights, the final regression prediction is obtained.
[0084] The input and output parameters of the SVR are represented as {xi, yi}, where xi is the i-th input parameter, yi is the i-th output parameter, N is the number of samples, and K(x, xi) is the kernel function of the support vector regression machine (e.g., ...). Figure 2 ).
[0085] By introducing kernel functions to solve the problem of low-dimensional inseparability of input parameters, regression prediction of complex data can be achieved. Commonly used kernel functions include polynomial functions, linear functions, RBF Gaussian radial basis functions, and sigmoid functions. Taking the RBF Gaussian radial basis function as an example (as shown in equation (3) below):
[0086]
[0087] In equation (3), K(xi, xj) represents the kernel function; Represents the nonlinear mapping function related to the kernel function; xi, x j σ represents the sample input data; σ represents the sample variance in the Gaussian kernel function.
[0088] In the support vector regression machine, the decision function is set as follows (as shown in equation (4)):
[0089]
[0090] In equation (4), f(x) i ) represents the model's predicted values (vector), ω represents the weight coefficient vector, and b represents the intercept.
[0091] To ensure that the support vector regression model can adapt to predictions of more complex data, a relaxation factor is introduced. and ξ i And the fitting error ε is used to characterize the degree to which the sample does not meet the constraints, transforming the hard margin of prediction into a soft margin, allowing a certain amount of parameter prediction errors, thereby improving the generalization ability of the model. By applying the principle of minimizing regularization risk, the optimization problem is transformed into (as shown in equation (5)):
[0092]
[0093] The constraints are as follows (6)-(9)):
[0094]
[0095]
[0096]
[0097] c≥0; (9)
[0098] In equations (5)-(9), ω represents the weight coefficient vector; and ξ i c represents the relaxation factor; y represents the penalty factor; i Indicates the label of the sample data; denoted as the nonlinear mapping function; b represents the bias coefficient; ε represents the fitting error.
[0099] In the above formula, the constant c is the penalty factor. The larger c is, the smaller the number of samples that can be wrong, the higher the complexity of the model, and the easier it is to overfit. When c approaches infinity, it becomes a hard-margin classification problem. Appropriately reducing the penalty factor c can alleviate the overfitting problem. The smaller c is, the worse the model fit accuracy. When the prediction accuracy is poor, appropriately reducing the penalty factor c can improve the model prediction accuracy.
[0100] Using the Lagrange multiplier method And the Lagrange dual problem is solved to find the objective function (Equation 4), solving the convex optimization problem, and considering the parameters. By differentiating and calculating the minimum point, the dual function of the Lagrange is finally obtained (as shown in equation (10) below):
[0101]
[0102] In equation (10), Represent the Lagrange dual function; α i , Denotes Lagrange multipliers; x i x j ε represents the sample input data; N represents the fitting error; and N represents the number of samples.
[0103] According to the KKT conditions, the following equation is satisfied at the extreme point:
[0104] α i [ε+ξ i -y i +f(x i )]=0 i=1,2,…,N; (11)
[0105] [ε+ξ i -y i +f(x i )]=0 i=1,2,…,N; (12)
[0106] By using equations (10), (11), and (12), the relationship model between the input and output parameters is obtained. After solving, the regression function is shown in equation (13) below:
[0107]
[0108] In equations (11)-(13), α i , denoted by Lagrange multiplier; ε represents the fitting error; N represents the number of samples; yi represents the sample data label; b is the intercept.
[0109] Furthermore, the specific implementation of step S6 is as follows:
[0110] In the SVR model, the selection of parameters c and g significantly impacts the model's prediction accuracy. This study utilizes the K-CV and GSA algorithms to optimize these parameters. First, the GSA algorithm is used to exhaustively search for all possible combinations of c and g within a given range, training and evaluating the model for each set of parameters. For a given set of c and g, the K-CV algorithm is used to divide the dataset into K subsets (K = 5 in this study). Each subset is used as a validation set, and the remaining K-1 subsets are used as the training set, resulting in K models. The average prediction accuracy of these K models on the validation set is used as the prediction performance index under this K-CV condition. Finally, the c and g parameters that achieve the highest training set validation prediction accuracy (lowest MSE) are selected as the optimal parameters. The K-CV algorithm can better evaluate the model's generalization ability, reduce the risk of overfitting to a specific dataset, and thus select the best model or perform hyperparameter tuning.
[0111] Example:
[0112] The COD of the effluent from the air flotation unit of the wastewater treatment system of a refining and chemical enterprise in Southwest China was predicted. The data came from the actual operating data of the refinery's influent and effluent throughout 2023. After removing missing and invalid data, a total of 338 valid data sets were obtained. The water quality data for January is shown in Table 1 below:
[0113] Table 1. Actual water quality data of influent and effluent from the air flotation unit in January 2023
[0114]
[0115]
[0116] Table 1 shows that the actual influent water quality indicators monitored by the flotation unit of this refining and chemical enterprise include ammonia nitrogen (NH3-N). in ), volatile phenols (VP) in ), Turbidity in ), conductivity (Cond) in ), total nitrogen (TN) in ) and total phosphorus (TP) in The effluent water quality indicators include COD. out Total nitrogen (TN) in ) and total phosphorus (TP) in The data for total nitrogen (TN) is severely lacking and has poor usability; therefore, the total nitrogen (TN) data is... in ) and total phosphorus (TP) in Disregarding the indicators, the water quality data from January shows that the influent and effluent water quality of the air flotation unit in the refining wastewater treatment system fluctuated significantly.
[0117] 1) Outlier removal
[0118] Currently, the monitoring of water quality parameters in refining and chemical enterprises is not yet perfect. On-site monitoring mainly focuses on the concentration of ammonia nitrogen (NH3-Nin) and volatile phenols (VP) in the influent of the air flotation unit. in ), conductivity (Cond) in ), Turbidity in The concentrations of total nitrogen (TN) and total phosphorus (TP) in the influent were monitored, as shown in Table 1. However, data on TN and TP concentrations were severely lacking and therefore could not be considered as effective input variables. Therefore, NH3-N was initially selected as the input variable. in VP in Cond in and Turb in The Hampel filtering algorithm was used to preprocess the input data, removing outliers and using the average value of data points surrounding the outliers to replace them. The preprocessed water quality data for January are shown in Table 2 below.
[0119] Table 2. Water quality data of influent and effluent from the air flotation unit in January 2023
[0120]
[0121]
[0122] As shown in Table 2, the Hampel filtering algorithm can effectively remove outliers in the influent and effluent water quality data of the flotation unit in the refining wastewater treatment system, achieving smooth preprocessing of the data, which is more conducive to model training and prediction, and preprocessing the input data.
[0123] 2) Parameter Correlation Analysis
[0124] Table 3 shows the correlation matrix of PCCs. The PCCs analysis results in Table 3 indicate that COD is the most important parameter among all parameters. out and NH3-N in The strongest correlation was observed between them (PCCs were 0.52), COD out With VP in Turb in and Cond in The PCCs were 0.13, 0.01, and 0.03, respectively, indicating almost no correlation. Table 4 shows the SCC correlation matrix, and the same conclusion is drawn from the SCC correlation analysis results in Table 4: COD out and NH3-N inThe correlation was strongest (SCC was 0.51). It is generally believed that volatile phenols in wastewater contribute to COD, but in reality, due to the low concentration of volatile phenols, their contribution to organic load is not significant. Therefore, the VP in the influent and effluent of the flotation unit of this refining and chemical plant is relatively low. in With COD out No obvious correlation was shown.
[0125] Table 3. PCCs Correlation Matrix
[0126]
[0127] Table 4. SCC Correlation Matrix
[0128]
[0129]
[0130] 2) Analysis of factors influencing MIV
[0131] A total of 338 sets of influent and effluent data for the air flotation unit in 2023 were collected. A randperm function was constructed, and 300 sets were randomly extracted from these 338 sets as the training set for training the SVR model. The remaining 38 sets were used as the test set to verify the model's accuracy. The SVR model parameters included a penalty factor c of 4.5, a Gaussian radial basis function (RBF) kernel with a parameter g of 0.01, and a loss function p of 0.008. The SVR_MIV results showed that the parameter correlation was in the order of NH3-N... in >Cond in >VP in >Turb in NH3-N in COD out The impact is most significant.
[0132] 3) Kernel function of SVR water quality prediction model
[0133] Kernel function type selection. With other parameters unchanged, prediction experiments were conducted on four common kernel functions: polynomial function, linear function, RBF Gaussian radial basis function, and Sigmoid function. The coefficient of determination R0 was used... 2 The correlation coefficient r, root mean square error (RMSE), mean absolute percentage error (MAPE), mean absolute error (MAE), and mean bias error (MBE) are used to measure the predictive accuracy of the model. When the kernel function is RBF, the coefficient of determination R of the SVR model is... 2 The correlation coefficient (r) of RBF is significantly higher than that of the other three kernel functions, while RMSE, MAPE, MAE, and MBE are all lower than those of the other three kernel functions. Therefore, RBF is selected as the kernel function for the SVR model for subsequent model optimization.
[0134] 4) Optimization of SVR model parameters using K-CV and GSA algorithms
[0135] In the SVR model, the selection of parameters c and g significantly impacts the model's prediction accuracy. Using GSA grid search, the search step size is determined, allowing c and g to take values within a certain range. For the chosen c and g, the K-CV algorithm divides the dataset into K parts. Each subset is used as a validation set, and the remaining K-1 subsets are used as the training set. This yields K models. The average prediction accuracy of these K models on the validation set is used as the prediction performance metric under this K-CV approach. Finally, the c and g that achieve the highest training set validation prediction accuracy (lowest MSE) are selected as the optimal parameters. In the K-CV algorithm, K is set to 5, meaning the dataset is divided into 5 parts. The ranges of log2(c) and log2(g) are set to (0, 2) and (10, 15) respectively. The MSE value decreases as log2(c) decreases. When log2(c) approaches 0 (i.e., the value of c approaches 1), the MSE approaches 0. There is no obvious change between MSE and log2(g). When log2(g) approaches 11 (i.e., the value of g approaches 2000), the MSE value is the smallest.
[0136] 5) Evaluation of the prediction performance of the K-CV-SVR water quality prediction model
[0137] The optimal parameters c and g obtained by the K-CV algorithm were used to improve the SVR model. The performance of the improved model is shown in Table 5. The prediction accuracy of both the training set and the test set is significantly improved compared with the original SVR model. The relative prediction error of 38 test data ranges from 0.27% to 8.02%.
[0138] Table 5. Comparison of actual effluent COD from the air flotation unit with the predicted results of the K-CV-SVR model in January 2023.
[0139]
[0140] Based on the above method, the present invention also provides a system for predicting the effluent quality of an air flotation unit in a refining wastewater treatment system. Figure 3 This is a schematic diagram of an effluent water quality prediction system for an air flotation unit in a refining wastewater treatment system according to the present invention. Figure 3 As shown, the system includes:
[0141] The system comprises the following modules: a historical water quality parameter collection module 201, used to collect historical water quality parameters from the influent and effluent of the flotation unit in the refining wastewater treatment system; a pretreatment module 202, used to preprocess the collected historical water quality parameters; a preliminary screening module 203, used to perform preliminary screening of the preprocessed historical water quality parameters using correlation analysis of Pearson product-moment correlation coefficients (PCCs) and Spearman correlation coefficients (SCCs); a secondary screening module 204, used to construct an SVR_MIV model using the MIV algorithm and perform secondary screening of the historical water quality parameters based on the preliminary screening results; a kernel function selection module 205, used to select the SVR prediction model kernel function based on the secondary screening results of the historical water quality parameters; a parameter selection module 206, used to select SVR prediction model parameters based on the selected SVR prediction model kernel function; and a water quality index prediction module 207, used to predict water quality indicators using the trained SVR prediction model and test the model regression effect on the test set.
[0142] Based on the same inventive concept, the present invention also provides an electronic device. Figure 4 A schematic diagram of an electronic device provided by the present invention, such as... Figure 4 As shown, the electronic device includes at least one processor 301, at least one communication interface 302, at least one memory 303, and at least one communication bus 304; wherein the processor 301, communication interface 302, and memory 303 communicate with each other through the communication bus 304.
[0143] Memory 303 stores computer programs;
[0144] The processor 301 is used to execute the program stored in the memory 303 to implement the method for predicting the effluent quality of the air flotation unit in the refining wastewater treatment system.
[0145] Optionally, the communication interface can be an interface of a communication module, such as the interface of a GSM module; the processor may be a CPU, an Application Specific Integrated Circuit (ASIC), or one or more integrated circuits configured to implement embodiments of the present invention. The memory may include high-speed RAM and may also include non-volatile memory, such as at least one disk storage device. The memory stores a program, and the processor calls the program stored in the memory to execute some or all of the above-described method embodiments.
[0146] Based on the same inventive concept, the present invention also provides a computer-readable storage medium storing a computer program, which, when executed, implements some or all of the above-described method embodiments. Optionally, the storage medium may be a non-transitory computer-readable storage medium, such as a ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, and optical data storage device.
[0147] Finally, it should be noted that the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions described in the foregoing embodiments or make equivalent substitutions for some of the technical features. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A method for predicting the effluent quality of an air flotation unit in a refining wastewater treatment system, characterized in that, The method includes: Step S1: Collect historical water quality parameters from the inlet and outlet of the air flotation unit in the refining wastewater treatment system; Step S2: Preprocess the collected historical water quality parameters; Step S3: Use correlation analysis of Pearson product-moment correlation coefficients (PCCs) and Spearman correlation coefficients (SCCs) to preliminarily screen the historical water quality parameters after pretreatment; Step S4: Construct the SVR_MIV model using the MIV algorithm, and perform a second screening of historical water quality parameters based on the preliminary screening results; Step S5: Based on the secondary screening results of the historical water quality parameters, select the kernel function of the SVR prediction model; Step S6: Select SVR prediction model parameters based on the selected SVR prediction model kernel function; Step S7: Use the trained SVR prediction model to predict water quality indicators and test the model regression effect on the test set.
2. The method for predicting the effluent quality of an air flotation unit in a refining wastewater treatment system according to claim 1, characterized in that, In step S1, the historical water quality parameters include: chemical oxygen demand (COD), biochemical oxygen demand (BOD5), suspended solids (SS), ammonia nitrogen (NH3-N), conductivity (Cond), and petroleum hydrocarbons.
3. A method for predicting the effluent quality of an air flotation unit in a refining wastewater treatment system according to claim 1 or 2, characterized in that, Step S2, preprocessing the collected historical water quality parameters, includes: Outlier detection algorithms are used to identify and process outliers to improve the robustness of the model. The Hampel linear filtering algorithm is used to remove outliers from the water quality data and replace the outliers with the average of the data before and after the outlier, ensuring the accuracy and reliability of the model training data.
4. A method for predicting the effluent quality of an air flotation unit in a refining wastewater treatment system according to claim 1 or 2, characterized in that, Step S3, which involves using correlation analysis of Pearson product-moment correlation coefficients (PCCs) and Spearman correlation coefficients (SCCs) to preliminarily screen historical water quality parameters after pretreatment, includes: Pearson product-moment correlation coefficients (PCCs) and Spearman correlation coefficients (SCCs) are used to measure the correlation between variables. Correlation analysis is used to reduce the dimensionality of the feature space to extract key information from the data, remove redundant parameter information, improve the model's computational efficiency, reduce model complexity, and thus improve the model's generalization ability.
5. A method for predicting the effluent quality of an air flotation unit in a refining wastewater treatment system according to claim 1 or 2, characterized in that, Step S4, which involves constructing an SVR_MIV model using the MIV algorithm and combining the preliminary screening results to perform a secondary screening of historical water quality parameters, includes: The mean impact value (MIV) method was used to assess the influence of input variables on output variables. An SVR_MIV model was constructed. Combining the preliminary screening results from step S3, correlation analysis, SVR_MIV model calculation results, and expert experience were used to conduct a second screening of water quality parameters, remove redundant variables, and determine the input water quality parameter indicators for the air flotation unit of the refining wastewater treatment system.
6. The method for predicting the effluent quality of an air flotation unit in a refining wastewater treatment system according to claim 2, characterized in that, Step S5, based on the secondary screening results of the historical water quality parameters, selects the kernel function of the SVR prediction model, including: Based on the secondary screening results of historical water quality parameters in step S4, and with other SVR parameters remaining unchanged, prediction experiments were conducted on four common kernel functions: polynomial function, linear function, RBF Gaussian radial basis function, and Sigmoid function. By comparing the prediction results, the optimal kernel function was selected for the water quality prediction model.
7. The method for predicting the effluent quality of an air flotation unit in a refining wastewater treatment system according to claim 1, characterized in that, Step S6, selecting SVR prediction model parameters based on the selected SVR prediction model kernel function, includes: The K-CV and GSA algorithms are used to optimize the SVR model. The SVR model parameters include the penalty coefficient c and the kernel function parameter g. The GSA algorithm exhaustively searches all combinations of c and g parameters by specifying a list of candidate values for hyperparameters, and trains and evaluates the model for each set of parameters. For the c and g given by the GSA algorithm, the K-CV algorithm divides the data into K groups, uses each subset of data as a validation set, and uses the remaining K-1 subsets of data as the training set to obtain K models. The average prediction accuracy of the final validation set of the K models is used as the prediction performance index under this K-CV, and the optimal c and g are obtained.
8. A water quality prediction system for the effluent from the air flotation unit of a refining wastewater treatment system, characterized in that, The system includes: The historical water quality parameter collection module is used to collect historical water quality parameters at the inlet and outlet of the air flotation unit in the refining wastewater treatment system. The pretreatment module is used to preprocess the collected historical water quality parameters; The preliminary screening module is used to perform preliminary screening of pretreated historical water quality parameters using correlation analysis of Pearson product-moment correlation coefficients (PCCs) and Spearman correlation coefficients (SCCs). The secondary screening module is used to construct an SVR_MIV model using the MIV algorithm and, in conjunction with the preliminary screening results, to perform secondary screening of historical water quality parameters. The kernel function selection module is used to select the kernel function of the SVR prediction model based on the secondary screening results of the historical water quality parameters. The parameter selection module is used to select SVR prediction model parameters based on the selected SVR prediction model kernel function. The water quality index prediction module is used to predict water quality indexes using the trained SVR prediction model and to test the model's regression performance on the test set.
9. An electronic device, characterized in that, include: One or more processors; Storage device for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the method for predicting the effluent quality of the air flotation unit in a refining wastewater treatment system as described in any one of claims 1-7.
10. A storage medium containing computer-executable instructions, characterized in that, The computer-executable instructions, when executed by a computer processor, are used to perform the method for predicting the effluent quality of the flotation unit in a refining wastewater treatment system as described in any one of claims 1-7.