A dioxin emission prediction method based on RF-PSO integrated algorithm
By using the RF-PSO ensemble algorithm for data dimensionality reduction and virtual sample generation, the problems of data scarcity and high dimensionality in dioxin emission prediction models have been solved, enabling high-precision and low-cost real-time monitoring of dioxin emissions.
Patent Information
- Application Number
- CN202510975466.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-15
- Publication Date
- 2026-02-27
- Estimated Expiration
- 2045-07-15
AI Technical Summary
Existing dioxin emission prediction models suffer from data scarcity and high dimensionality, making it difficult to establish models with high generalization ability and robustness. Furthermore, conventional detection methods are costly and time-consuming, failing to meet the needs of real-time monitoring.
A method based on the RF-PSO ensemble algorithm is adopted to generate a large number of reliable virtual samples through data dimensionality reduction and virtual sample generation techniques, thereby optimizing the random forest model and improving prediction accuracy.
In cases where the initial prediction model has weak performance, generating reliable virtual samples improves the generalization ability and prediction accuracy of the dioxin emission prediction model, while reducing detection costs and time.
Smart Images

Figure CN120821990B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of dioxin emission prediction, and particularly relates to a dioxin emission prediction method based on an RF-PSO integrated algorithm. BACKGROUND
[0002] Dioxins have strong biological toxicity, persistence and bioaccumulation, and are difficult to degrade and dispose. The conventional measurement method for the dioxin emission level in incineration flue gas is offline detection, including laboratory pretreatment steps such as Soxhlet extraction, purification, concentration, and high-resolution gas chromatography / high-resolution mass spectrometry analysis, which has high detection cost and requires a long period. This method cannot reflect the running status of the waste incineration plant in time, and cannot meet the public demand for real-time acquisition of the dioxin emission level. With the increasing proportion of household waste incineration and the increasingly stringent dioxin emission control standards, it is necessary to establish a high-precision dioxin emission prediction model, develop an accurate online measurement method, and provide rapid feedback to monitor and control the dioxin emission level.
[0003] At present, machine learning has been applied to establish an online measurement model of dioxin emission, which can realize prediction of the concentration of dioxin in solid waste incineration flue gas through variables such as conventional pollutant concentration, incinerator operation parameters and flue gas purification system parameters. However, this method requires sufficient data in the training and verification process to avoid overfitting problems. The collection cost of dioxin samples is high, the number is limited, and there are many easily collected variables, so the dioxin emission prediction modeling belongs to a typical small sample and high dimension problem, and it is difficult to obtain sufficient data to establish a dioxin emission prediction model with strong generalization ability and high robustness.
[0004] Virtual sample generation technology can extract data features based on a small amount of original sample set, and then synthesize a large number of new virtual samples, effectively improving the generalization ability and prediction accuracy of the machine learning model. In the regression task, the generation of virtual output data generally depends on the initial prediction model trained based on the original small-scale training set. In order to obtain more real and reliable virtual samples, it is usually required that the mean absolute percentage error (MAPE) of the initial prediction model is ≤10%. However, in actual application, due to the high-dimensional sparse characteristics of data and noise interference and other problems, there may be a case of MAPE>10%. Therefore, it is necessary to consider how to generate reliable virtual samples based on the initial prediction model with poor performance. SUMMARY
[0005] The present application provides a dioxin emission prediction method based on an RF-PSO integrated algorithm to at least solve the above technical problems in the prior art.
[0006] According to a first aspect of the present application, a dioxin emission prediction method based on an RF-PSO integrated algorithm is provided, comprising the following steps:
[0007] S1, constructing a data set, taking dioxin toxicity equivalent as an output variable in the data set, and taking incinerator operation parameters and 124-TrCBz concentration as input features in the data set;
[0008] S2, data set preprocessing, standardizing and dimensionality reduction processing of input features in the data set, and dividing the data set into a training set and a test set;
[0009] S3, random forest model training and testing, taking the trained random forest model as an initial prediction model of dioxin emission;
[0010] S4, generating virtual sample input; expanding the range of input features through multi-distribution overall trend diffusion, generating virtual input in the expanded area and the actual observation area of the data set respectively, and constructing a virtual input data set;
[0011] S5, optimizing the generated virtual sample through an RF-PSO integrated algorithm.
[0012] In some embodiments of the first aspect of the application, the specific method of S1 is as follows:
[0013] S11: detecting the dioxin emission data at the end of the solid waste incineration system by using the EPA23a method, and taking the dioxin toxicity equivalent as the output variable in the data set;
[0014] S12: synchronously detecting the 124-TrCBz concentration and the concentration of other conventional pollutants at the end of the solid waste incineration system, and collecting the incinerator operation parameters through the DCS system, taking the above parameters as input features in the original data set.
[0015] In some embodiments of the first aspect of the application, the other conventional pollutants include carbon monoxide, nitrogen oxides, sulfur dioxide, ammonia, hydrogen chloride and carbon dioxide.
[0016] In some embodiments of the first aspect of the application, in S2, the method of dimensionality reduction processing of input features in the data set is as follows:
[0017] The dimensionality of the data set after standardization is reduced by using the Boruta algorithm;
[0018] Randomly arranging each input feature to generate a corresponding shadow feature; splicing the input features and the shadow features to obtain an expanded feature matrix;
[0019] Training a random forest model on the expanded feature matrix, and calculating the Z score of each feature, including the input features and the shadow features;
[0020] record the maximum Z-score of all shadow features, mark the input features greater than the maximum Z-score as important features and keep them, and mark the input features less than the maximum Z-score as unimportant features and permanently delete them from the feature set;
[0021] remove all shadow features.
[0022] In some embodiments of the first aspect of the application, in the S3, the method of training and testing the random forest model is as follows:
[0023] S31: Based on the training set, select the random forest model to build a dioxin emission prediction model, and use the grid search method and the five-fold random cross-validation method to optimize the hyperparameters;
[0024] S32, test the generalization ability of the random forest model based on the test set, and use the coefficient of determination, root mean square error and mean absolute percentage error as evaluation indexes.
[0025] In some embodiments of the first aspect of the application, in the S31, the method of using the grid search method and the five-fold random cross-validation method to optimize the hyperparameters is as follows:
[0026] Use the grid search method to traverse the predefined hyperparameter combination of the random forest model: the number of decision trees in the random forest and the maximum depth of the decision tree, and set all other parameters to default values; At the same time, the optimal hyperparameters are selected by combining the five-fold random cross-validation method; The method of five-fold random cross-validation is as follows:
[0027] Randomly divide the entire training set into 5 disjoint subsets, each with 20% of the data;
[0028] Each time, use 4 of them as the training set to train the random forest model, and use the remaining 1 as the validation set, for a total of 5 cycles;
[0029] For each cycle, set the parameter optimization target to negative mean square error; Calculate the negative mean square error based on the validation set;
[0030] Calculate the average of the negative mean square errors of the 5 cycles as the final score of this hyperparameter combination, and select the hyperparameter combination with the highest average negative mean square error.
[0031] In some embodiments of the first aspect of the application, in the S4, the method of generating virtual sample input is as follows:
[0032] S41, calculate the data center point CL;
[0033]
[0034] Where n is the number of samples, CL is the data center point, X (.)For the order statistics;
[0035] S42, calculate the left skewness and variance of the center point CL;
[0036]
[0037]
[0038]
[0039] In the formula, S KL is the left skewness, S KR is the right skewness, N L , N R is the number of samples less than or greater than the center point CL, is the variance of the input feature X;
[0040] S43, calculate the upper and lower boundaries of the acceptable range;
[0041]
[0042]
[0043] In the formula, LB is the lower boundary of the acceptable range, and RB is the lower boundary of the acceptable range;
[0044] S44, calculate the number of virtual samples to be generated in each range;
[0045]
[0046]
[0047]
[0048]
[0049] In the formula, are the number of virtual samples to be generated in the ranges (LB, min), (min, max), and (max, RB), respectively, is the total number of virtual samples to be generated;
[0050] S45, generate virtual input;
[0051] Generate virtual sample input in the extended range using uniform distribution:
[0052] In the range (LB, min):
[0053] In the range (max, RB):
[0054] Generate virtual sample input in the range of direct observation (min, max) with a triangular distribution:
[0055]
[0056] where s is a random number subject to uniform distribution in (0, 1);
[0057] For each input feature , extend it to generate a virtual input dataset .
[0058] In some embodiments of the first aspect of the application, in S5, the method of optimizing the generated virtual sample by RF-PSO integrated algorithm is as follows:
[0059] S51: generate virtual output corresponding to the virtual input dataset based on the random forest model;
[0060] S52: dynamically adjust the input features of the virtual sample based on the PSO algorithm;
[0061] S53, mix the virtual sample dataset with the original training set, re-establish the random forest model, and use the grid search method and the five-fold random cross-validation method to optimize the hyperparameters; if the model performance improves, go back to step S4, generate virtual sample input again, and execute S51, S52 in turn; otherwise, go to S54;
[0062] S54, keep the current virtual sample as a qualified virtual sample dataset, mix it with the original training set, and re-establish the random forest model, and use the grid search method and the five-fold random cross-validation method to optimize the hyperparameters.
[0063] In some embodiments of the first aspect of the application, in S52, the method of dynamically adjusting the input features of the virtual sample based on the PSO algorithm is as follows:
[0064] S521, particle swarm initialization:
[0065] Use the pre-generated virtual sample input feature matrix as the initial particle swarm position, and each particle represents an input feature vector of a virtual sample;
[0066] Randomly generate a particle initial velocity matrix in the interval [-1, 1] with the same dimension as the number of input features;
[0067] Limit the particle position within the lower and upper bounds (LB, RB) of the features of the original dataset;
[0068] S522, fitness function calculation:
[0069] The particle input features are mapped to output features by a pre-trained initial prediction model to form a complete virtual sample;
[0070] The single virtual sample is merged with the original training data to construct an enhanced dataset, and the random forest model is retrained based on the enhanced dataset;
[0071] The MAPE of the trained random forest model on the original training set is calculated as the fitness value of the particle;
[0072] S523, dynamic update of particle swarm:
[0073] The inertia weight decreases linearly from to to balance global exploration and local exploitation capabilities:
[0074]
[0075] where, is the updated inertia weight, is the current iteration number, is the maximum iteration number;
[0076] Update the particle velocity:
[0077]
[0078] where, is a random vector, are the individual and group learning factors, and are the individual and population optimal positions, is the particle velocity, is the particle position;
[0079] Adjust the particle position according to the updated velocity and apply boundary constraints again to ensure effectiveness;
[0080] S524, optimal solution iteration:
[0081] Compare the current fitness with the historical optimal value, and retain the individual optimal position to achieve individual optimal update;
[0082] Select the particle with the best fitness from the entire particle swarm after each iteration to achieve global optimal update;
[0083] S525, output optimization results:
[0084] Output the complete virtual sample corresponding to the global optimal particle and its fitness value to obtain a set of virtual samples;
[0085] A set of virtual samples is obtained by performing PSO optimization once, and the above process is repeated times to obtain a virtual sample dataset.
[0086] Compared with the prior art, the application has the following beneficial effects:
[0087] The dioxin emission prediction method based on the data dimension reduction, virtual sample generation (VSG) and random forest-particle swarm optimization (RF-PSO) integrated algorithm provided by the application can generate a large number of virtual samples from a small number of real samples, alleviate the data scarcity problem and avoid overfitting. Even in the case that the initial prediction model has poor performance (such as MAPE>10% due to noise interference or high-dimensional sparsity of data), reliable virtual samples can still be generated to ensure high generalization ability and prediction accuracy of the final dioxin emission prediction model.
[0088] It should be understood that the content described in this part is not intended to identify key or important features of the embodiments of the application, nor is it used to limit the scope of the application. Other features of the application will become apparent from the following description. BRIEF DESCRIPTION OF DRAWINGS
[0089] The above and other objects, features and advantages of the exemplary embodiments of the present application will be more apparent from the following detailed description read in conjunction with the accompanying drawings, in which several embodiments of the present application are shown by way of example, not limitation. In the drawings:
[0090] In the drawings, identical or corresponding reference signs refer to identical or corresponding parts.
[0091] Figure 1 is a schematic diagram of the overall design idea architecture of the application.
[0092] Figure 2 is a schematic diagram of the MD-MTD principle.
[0093] Figure 3 is a prediction performance diagram of the final random forest model on the training set.
[0094] Figure 4 is a prediction performance diagram of the final random forest model on the test set.
[0095] Figure 5 is a comparison diagram of the RMSE and MAPE of the random forest model on the test set in the initial and 4 iteration processes.
[0096] Figure 6 is a comparison diagram of the predicted values and true values of the random forest model on the test set in the initial and 4 iteration processes. DETAILED DESCRIPTION
[0097] In order to make the purposes, characteristics and advantages of the present application more obvious and easy to understand, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor fall within the scope of protection of the present application.
[0098] Embodiment one:
[0099] The present embodiment one provides a dioxin emission prediction method based on an RF-PSO integrated algorithm, please refer to Figure 1 , comprising the following steps:
[0100] S1: Constructing a data set; collecting and analyzing the dioxin emissions at the end of the solid waste incineration system, synchronously collecting the incinerator operating parameters, 124-trichlorobenzene (124-TrCBz) concentration and other conventional pollutant concentrations.
[0101] The specific method is as follows:
[0102] S11: Detecting the dioxin emission data at the end of the solid waste incineration system by using the EPA23a method, and taking the dioxin toxicity equivalent as the output variable in the data set;
[0103] S12: Synchronously detecting the 124-TrCBz concentration and other conventional pollutant (such as carbon monoxide, nitrogen oxides, sulfur dioxide, ammonia, hydrogen chloride and carbon dioxide) concentrations at the end of the solid waste incineration system, and collecting the incinerator operating parameters through the DCS system, and taking the above parameters as the input features in the original data set.
[0104] Taking a test in a large-scale household waste incinerator in Ningbo, Zhejiang as an example. A long-period dioxin emission data set is constructed, and samples are collected from the end chimney of the flue gas purification system. The EPA23a method is used to detect the dioxin emission data. At the same time, the concentration of 124-TrCBz is measured online at the same sampling point by using the thermal desorption-gas chromatography-tunable laser ionization coupled with time-of-flight mass spectrometry technology, the concentrations of conventional pollutants are collected on the chimney through the continuous emission monitoring system, and the incineration parameters are collected through the DCS system. Finally, the long-period dioxin emission data set has a total of 36 samples and 27 input features. The prediction target is the dioxin emission level of the household waste incineration process, which is expressed in international toxicity equivalent (I-TEQ). The input features include incinerator operating parameters, 124-TrCBz concentration and other conventional pollutant concentrations.
[0105] S2: data set preprocessing; standardize the input features in the data set, then perform dimensionality reduction processing on the standardized data set through the Boruta algorithm, and finally randomly divide the dimensionally reduced data set into a training set and a test set according to a specified proportion.
[0106] S21: the method for standardizing the input features of the data set is as follows:
[0107] The input features are standardized by removing the mean and scaling to unit variance, and the following calculation is performed separately for each input feature:
[0108]
[0109] wherein and represent the standardized input features and the original input features, respectively, and represent the mean and the standard deviation of the original input features, respectively.
[0110] S22: perform dimensionality reduction processing on the standardized data set through the Boruta algorithm:
[0111] Randomly arrange each input feature to generate the corresponding shadow feature It is worth mentioning that the input features here refer to the input features standardized by S21. Concatenate the input features and the shadow features to obtain an expanded feature matrix:
[0112]
[0113] wherein, and have the same distribution, and there are a total of 2p features after expansion;
[0114] Train a random forest model on the expanded feature matrix, and calculate the Z score of each feature (including input features and shadow features);
[0115] Record the maximum Z_score of all shadow features as Z_score max Mark the features in the input features that are greater than Z_score max as important features and retain them, and mark the input features that are less than the maximum Z score as unimportant features and permanently delete them from the feature set;
[0116] Remove all shadow features.
[0117] The embodiment also provides another method for performing dimensionality reduction processing on the standardized data set through the Boruta algorithm:
[0118] Randomly permute each input feature to generate corresponding shadow features; concatenate the input features and shadow features to obtain an expanded feature matrix;
[0119] Train a random forest model on the expanded feature matrix, train the random forest model N times (N=1000 in the embodiment), and calculate N Z-scores for each feature;
[0120] Record the maximum Z-score of all shadow features each time the random forest model is run. Mark the input features with a Z-score higher than the maximum Z-score once;
[0121] After running the random forest model N times, calculate the number of times each input feature is marked, denoted as Hits, which follows a Bernoulli distribution:
[0122]
[0123] When the Hits value of an input feature is significantly greater than the expected value, mark the feature as an important feature; when it is significantly less than the expected value, delete the feature.
[0124] S23: Randomly divide the dimensionality-reduced dataset into training and test sets according to the ratio of training set group number: test set group number = 7:3.
[0125] S3: Random forest model training and testing, use the trained random forest model as the initial prediction model.
[0126] The specific method of S3 is as follows:
[0127] S31: Based on the training set, select a random forest model to build a dioxin emission prediction model, and use grid search and five-fold random cross-validation to optimize hyperparameters.
[0128] Random forest is an ensemble learning method that improves generalization ability by building multiple decision trees and combining their prediction results. For regression problems, the prediction value of random forest is the average of all decision tree prediction values:
[0129]
[0130] where K is the number of trees, is the prediction value of the kth tree.
[0131] Each tree uses the Bootstrap method to randomly sample from the training set multiple times with replacement. The root of the decision tree is the randomly sampled training sample. When splitting a node, randomly select m features ( , p is the total number of features) for optimal splitting. For each feature, try different split points (thresholds). Suppose the feature Split point t, the data is divided into left child node and right child node, and the weighted mean square error (MSE) when splitting with feature and split point t:
[0132]
[0133]
[0134]
[0135] where, and are the number of samples in the left child node and right child node, is the total number of samples in the current node, and are the mean of the target value in the left child node and right child node. Select the feature and split point that minimizes the MSE after splitting. If the MSE of the current node decreases less than the set minimum split threshold, or the number of samples is less than the minimum split sample number, stop splitting and become a leaf node. Repeat the above process for the left and right child nodes until the stopping conditions are met (such as reaching the maximum depth of the tree, the minimum number of samples in the node, etc.). Repeat the above steps K times to obtain K decision trees, which constitute the random forest model.
[0136] The method uses the random forest model (RandomForestRegressor) in the sklearn library in python, and sets the random value random_state=42. The grid search method is used to traverse the predefined combination of hyperparameters of the random forest model: n_estimators (the number of decision trees in the random forest) and max_depth (the maximum depth of the decision tree), and other parameters are set to default values. At the same time, the optimal hyperparameters are selected by combining the five-fold random cross-validation method. The method of five-fold random cross-validation is as follows:
[0137] 1. Randomly divide the entire training set into 5 disjoint subsets, each with 20% of the data;
[0138] 2. Train the random forest model using 4 of the subsets as the training set and the remaining 1 subset as the validation set, for a total of 5 cycles;
[0139] 3. For each cycle, set the parameter optimization target to negative mean square error neg_mean_squared_error (neg-MSE); calculate the negative mean square error neg-MSE based on the validation set;
[0140] 4. Calculate the average of the negative mean square error (neg-MSE) of 5 cycles as the final score of the hyperparameter combination, and select the hyperparameter combination with the highest average neg-MSE (i.e. the combination with the smallest actual MSE).
[0141] S32: Test the generalization ability of the random forest model based on the test set, using the coefficient of determination (R 2 ), root mean square error (RMSE) and mean absolute percentage error (MAPE) as evaluation indexes:
[0142]
[0143]
[0144]
[0145] where N is the number of samples, and represent the predicted value and the actual value of the target, respectively, represents the average value of .
[0146] In this embodiment, the n_estimators of the established initial random forest model is 100, and the max_depth is 9. The performance on the original dioxin emission dataset is shown in Table 1 as follows:
[0147] Table 1: Performance of the original dioxin emission dataset
[0148]
[0149] S4: Generate virtual sample inputs; expand the range of input features by the multi-distribution overall trend diffusion (MD-MTD) technique, and generate virtual inputs in the expanded area and the actual observation area of the dataset, respectively.
[0150] The specific method of S4 is as follows:
[0151] Each input feature is expanded by the MD-MTD technique, and the principle of the MD-MTD technique is shown in Figure 2 . Through MD-MTD, the acceptable range of the sample set is expanded from (min, max) to (LB, RB), where (min, max) is the actual observation area of the sample set, and (LB, min) and (max, RB) are the expanded areas. In the expanded area, since the expanded data information is unknown, uniform distribution is used to generate virtual samples; in the actual observation area, triangular distribution is used to generate virtual samples, that is, the closer to the data center, the more virtual samples are generated, and the farther away from the data center, the fewer virtual samples are generated.
[0152] characteristics For example:
[0153] (1) Calculate the data center point CL
[0154]
[0155] Where n is the number of samples, CL is the data center point, X (.) is the order statistics.
[0156] (2) Calculate the left and right skewness and variance of the center point CL
[0157]
[0158]
[0159]
[0160] In the formula, S KL is the left skewness, S KR is the right skewness, N L , N R is the number of samples whose sample value is less than or greater than the center point CL, is the variance of the input feature X.
[0161] (3) Calculate the upper and lower bounds of the acceptable range
[0162]
[0163]
[0164] In the formula, LB is the lower bound of the acceptable range, and RB is the lower bound of the acceptable range.
[0165] (4) Calculate the number of virtual samples to be generated in each range
[0166]
[0167]
[0168]
[0169]
[0170] In the formula, are the number of virtual samples to be generated in the (LB, min), (min, max), and (max, RB) ranges, respectively, is the total number of virtual samples to be generated.
[0171] (5) Generate virtual input
[0172] Generate virtual sample input in the extended range with uniform distribution:
[0173] in the range of (LB, min):
[0174] in the range of (max, RB):
[0175] Generate virtual sample input in the direct observation range (min, max) with triangular distribution:
[0176]
[0177] where s is a random number subject to uniform distribution in (0, 1).
[0178] For each input feature , extend it to generate a virtual input dataset .
[0179] S5: Optimize the generated virtual samples by RF-PSO integrated algorithm, repeat this step until the generated virtual samples can obtain satisfactory model performance (R 2 ≥ 0.9, RMSE ≤ 0.0350, MAPE ≤ 25%) after mixing with the original training set and modeling.
[0180] Please refer to Figure 1 , S5 includes the following contents:
[0181] S51: Generate virtual output corresponding to the virtual input dataset based on the random forest model established in S3;
[0182] S52: Dynamically adjust the input features of virtual samples based on PSO algorithm to improve data enhancement effect, the specific steps are as follows:
[0183] S521, particle swarm initialization:
[0184] Take the pre-generated virtual sample input feature matrix as the initial particle swarm position, and each particle represents an input feature vector of a virtual sample;
[0185] Randomly generate particle initial speed matrix in [-1, 1] interval, the dimension matches the number of input features;
[0186] Limit the particle position within the feature upper and lower bounds (LB, RB) of the original dataset to ensure that the virtual sample conforms to the physical meaning.
[0187] S522, fitness function calculation:
[0188] The particle input features are mapped to output features using the pre-trained initial prediction model to form a complete virtual sample.
[0189] The single virtual sample is merged with the original training data to construct an enhanced dataset, and the random forest model is retrained based on the enhanced dataset.
[0190] The MAPE of the predicted values on the original training set is calculated using the trained random forest model as the fitness value of the particle. The smaller the MAPE, the higher the quality of the particle.
[0191] S523, dynamic update of particle swarm:
[0192] The inertia weight decreases linearly from to to balance global exploration and local exploitation capabilities:
[0193]
[0194] where is the updated inertia weight, is the current iteration number, is the maximum iteration number.
[0195] Update the particle velocity:
[0196]
[0197] where is a random vector, are the individual and group learning factors, and are the individual and population optimal positions, is the particle velocity, is the particle position.
[0198] Adjust the particle position according to the updated velocity and apply boundary constraints again to ensure effectiveness.
[0199] S524, optimal solution iteration:
[0200] Compare the current fitness with the historical optimal value, and retain the individual optimal position to achieve individual optimal update;
[0201] Select the particle with the best fitness from the entire particle swarm after each iteration to achieve global optimal update.
[0202] S525, output optimization results:
[0203] Output the complete virtual sample corresponding to the global optimal particle and its fitness value (minimum MAPE), and obtain a set of virtual samples;
[0204] Performing PSO optimization once obtains a set of virtual samples, repeating the above process , obtains the virtual sample dataset.
[0205] S53: Mix the virtual sample dataset with the number of samples of 120 with the original training set, re-establish the random forest model, and perform hyperparameter optimization using the grid search method and the five-fold random cross-validation method. Calculate the MAPE based on the same test set to evaluate the performance of the random forest model. If the model performance improves, go back to S4, generate virtual samples again, and perform S51 and S52 in turn (need to update the model in step 2 of S52, and use the random forest model with better performance to calculate the particle fitness function). Otherwise, go to S54.
[0206] S54: Keep the current virtual sample as the qualified virtual sample dataset, mix it with the original training set, and re-establish the random forest model. Perform hyperparameter optimization using the grid search method and the five-fold random cross-validation method. Calculate the MAPE based on the same test set to evaluate the performance of the model.
[0207] In this embodiment, after 4 iterations of RF-PSO integrated algorithm and adding 120 virtual samples to the original training set, the random forest model is re-established. The performance of the final established random forest model on the mixed training set and test set is shown in Table 2, and the prediction performance graphs on the mixed training set and test set are Figure 3 and Figure 4 .
[0208] Table 2: Performance of the final established random forest model on the mixed training set and test set
[0209]
[0210] The RMSE and MAPE of the random forest model on the test set are reduced by 42.98% and 36.95% respectively, and the performance is significantly improved. More than 80% of the predicted error percentage of dioxin concentration is within [-40%, 40%], and the predicted error of dioxin emission concentration is within [-0.071, 0.058] ng I-TEQ / Nm 3 , which indicates that the established RF-PSO integrated algorithm and modeling framework can be well applied to the small sample of living garbage incineration process dioxin emission prediction problem. At the same time, the comparison of RMSE and MAPE of the initial random forest model and the random forest model in the 4 iteration process on the test set is shown in Figure 5 , and the comparison of test set prediction value and true value isFigure 6 It can be seen from the figure that the performance of the model gradually improves in the iteration process, which also proves that the method can reduce the influence of the weak performance of the initial prediction model and generate reliable virtual samples in the iteration process.
[0211] It should be understood that various forms of the flow shown above can be used to reorder, add or delete steps. For example, each step described in the present application can be executed in parallel, sequentially or in a different order, as long as the desired results of the technical solutions of the present application can be achieved, which is not limited herein.
[0212] In addition, the terms "first", "second" are only for descriptive purposes, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined with "first", "second" can explicitly or implicitly include at least one of the features. In the description of the present application, the meaning of "a plurality of" is two or more, unless otherwise specifically limited.
[0213] The above is only a specific embodiment of the present application, but the protection scope of the present application is not limited thereto, and any person skilled in the art can easily think of changes or replacements within the technical scope disclosed in the present application, which should be covered within the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.
Claims
1. A method for predicting dioxin emissions based on an RF-PSO ensemble algorithm, characterized in that, Includes the following steps: S1. Construct a dataset with dioxin toxicity equivalent as the output variable and incinerator operating parameters and 124-TrCBz concentration as input features. S2, Dataset Preprocessing, involves standardizing and reducing the dimensionality of the input features in the dataset, and dividing the dataset into training and testing sets; S3, Random Forest Model Training and Testing: The trained random forest model is used as the initial prediction model for dioxin emissions. S4, generate virtual sample input; The range of input features is expanded by multi-distribution overall trend diffusion, and virtual inputs are generated in the expanded region of the dataset and the actual observation region respectively, and a virtual input dataset is constructed. S5 optimizes the generated virtual samples using the RF-PSO ensemble algorithm; In S2, the method for dimensionality reduction of the input features in the dataset is as follows: The Boruta algorithm is used to reduce the dimensionality of the standardized dataset. Each input feature is randomly arranged to generate a corresponding shadow feature; the input features and shadow features are concatenated to obtain the expanded feature matrix. A random forest model is trained on the expanded feature matrix, and the Z score of each feature, including input features and shadow features, is calculated. Record the maximum Z-score of all shadow features, mark input features with a Z-score greater than the maximum Z-score as important features and retain them, and mark input features with a Z-score less than the maximum Z-score as unimportant features and permanently delete them from the feature set; Remove all shadow features; In S3, the methods for training and testing the random forest model are as follows: S31: Based on the training set, a random forest model was selected to construct a dioxin emission prediction model, and hyperparameters were optimized using grid search and five-fold random cross-validation. S32 tests the generalization ability of the random forest model based on the test set, using the coefficient of determination, root mean square error, and mean absolute percentage error as evaluation metrics. In step S5, the method for optimizing the generated virtual samples using the RF-PSO ensemble algorithm is as follows: S51: Generate a virtual output corresponding to the virtual input dataset based on the random forest model; S52: Dynamically adjust the input features of virtual samples based on the PSO algorithm; S53: Mix the virtual sample dataset with the original training set, rebuild the random forest model, and optimize the hyperparameters using grid search and five-fold random cross-validation. If the model performance is improved, return to step S4, generate virtual sample input again, and execute S51 and S52 in sequence; otherwise, proceed to S54. S54: Retain the current virtual samples as a qualified virtual sample dataset, mix them with the original training set, rebuild the random forest model, and use grid search and five-fold random cross-validation to optimize the hyperparameters.
2. The dioxin emission prediction method based on the RF-PSO ensemble algorithm according to claim 1, characterized in that, The specific method of S1 is as follows: S11: The EPA23a method was used to detect the dioxin emissions at the end of the solid waste incineration system, and the dioxin toxicity equivalent was used as the output variable in the dataset. S12: Simultaneously detect the concentration of 124-TrCBz and other conventional pollutants at the end of the solid waste incineration system, and collect the incinerator operating parameters through the DCS system, using the above parameters as input features in the raw dataset.
3. The dioxin emission prediction method based on the RF-PSO ensemble algorithm according to claim 2, characterized in that, Other conventional pollutants include carbon monoxide, nitrogen oxides, sulfur dioxide, ammonia, hydrogen chloride, and carbon dioxide.
4. The dioxin emission prediction method based on the RF-PSO ensemble algorithm according to claim 1, characterized in that, In step S31, the hyperparameter optimization method using grid search and five-fold random cross-validation is as follows: A grid search method is used to traverse the predefined hyperparameter combinations of the random forest model: the number of decision trees and the maximum depth of the decision trees in the random forest, while other parameters are set to default values. Simultaneously, a five-fold random cross-validation method is used to select the optimal hyperparameters. The method of the five-fold random cross-validation method is as follows: The entire training set is randomly divided into 5 disjoint subsets, each containing 20% of the data. Each time, four subsets are used as the training set to train the random forest model, and the remaining one subset is used as the validation set, for a total of five iterations; For each iteration, the parameter optimization objective is set to negative mean squared error; the negative mean squared error is calculated based on the validation set. Calculate the average of the negative mean square error over 5 cycles and use it as the final score for the hyperparameter combination. Select the hyperparameter combination with the highest average negative mean square error.
5. The dioxin emission prediction method based on the RF-PSO ensemble algorithm according to claim 1, characterized in that, In step S4, the method for generating virtual sample input is as follows: S41, calculate the data center point CL; Where n is the number of samples, CL is the number of data centers, and X (.) These are ordinal statistics; S42, calculate the left and right skewness and variance of the center point CL; In the formula, S KL S represents the left skewness. KR For right skewness, N L N R The number of samples whose values are less than or greater than the center point CL. The variance of the input feature X; S43, calculate the upper and lower bounds of the acceptable range; In the formula, LB is the lower bound of the acceptable range, and RB is the lower bound of the acceptable range. S44, calculate the number of virtual samples to be generated in each range; In the formula, Let (LB, min), (min, max), and (max, RB) represent the number of virtual samples to be generated within the ranges (LB, min), (min, max), and (max, RB), respectively. The required total number of virtual samples to be generated; S45, generate virtual input; Virtual sample inputs are generated using a uniform distribution method across an extended range: Within the range of (LB, min): Within the range of (max, RB): Virtual sample inputs are generated using a triangular distribution within the direct observation range (min, max): In the formula, s is a random number that follows a uniform distribution within (0,1); For each input feature This process is expanded to ultimately generate a virtual input dataset. .
6. The dioxin emission prediction method based on the RF-PSO ensemble algorithm according to claim 1, characterized in that, In S52, the method for dynamically adjusting the input features of virtual samples based on the PSO algorithm is as follows: S521, Particle Swarm Initialization: Input the feature matrix with pre-generated virtual samples As the initial particle swarm position, each particle represents the input feature vector of a virtual sample; The initial velocity matrix of particles is randomly generated in the interval [-1,1], and its dimension matches the number of input features; The particle positions are restricted to the upper and lower bounds (LB, RB) of the features in the original dataset; S522, Fitness Function Calculation: A pre-trained initial prediction model is used to map particle input features to output features, forming a complete virtual sample; A single virtual sample is merged with the original training data to construct an augmented dataset, and the random forest model is retrained based on the augmented dataset; The trained random forest model is used to compute the MAPE on the original training set, which is then used as the fitness value for the particle. S523, Particle Swarm Dynamic Update: Inertia weights are adjusted according to the number of iterations from linearly reduced to Balancing global exploration with local development capabilities: in, For the updated inertia weights, This represents the current iteration number. This represents the maximum number of iterations. Update particle velocity: in, For random vectors, These are individual and group learning factors, respectively. and These are the optimal positions for individuals and the population, respectively. For particle velocity, The particle position; Adjust the particle positions based on the updated velocity and reapply boundary constraints to ensure effectiveness; S524, Optimal Solution Iteration: Compare the current fitness with the historical best value and retain the optimal position of each particle. To achieve optimal individual updates; After each iteration, the particle with the best fitness among all particles is selected as... To achieve globally optimal updates; S525, output optimization results: Output the complete virtual sample corresponding to the globally optimal particle and its fitness value to obtain a set of virtual samples; Performing PSO optimization once yields a set of virtual samples; repeat the above process. Next, get A virtual sample dataset.
Citation Information
Patent Citations
Dioxin emission concentration transfer learning prediction method based on random forest
CN111461355A
MSWI process dioxin emission concentration soft measurement method based on multi-target particle swarm optimization semi-supervised random forest
CN116384041A