Random forest algorithm-based correlation prediction model for concentration of VOCs in water-soil-gas

By constructing a VOCs concentration correlation prediction model based on the random forest algorithm, the problem of the existing technology that is difficult to efficiently monitor and predict VOCs concentrations in mining environments is solved, higher prediction accuracy and precision are achieved, and effective monitoring and control of VOCs in mines are supported.

CN120636617APending Publication Date: 2025-09-12ANHUI UNIV OF SCI & TECH +2
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510735741.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-04
Publication Date
2025-09-12

AI Technical Summary

Technical Problem

Existing technologies make it difficult to efficiently and accurately monitor and predict the concentrations of volatile organic compounds (VOCs) in water, soil, and air in mining environments, leading to degradation of ecological functions and environmental pollution in mining areas.

Method used

A VOCs concentration association prediction model based on the random forest algorithm was adopted. By removing outliers and standardizing the original benzene concentration data set, the benzene gas concentration voltage value measured by the PID acquisition device was used as the model input feature to construct a random forest prediction model. The optimal number of decision trees and leaf nodes were determined through training and debugging.

Benefits of technology

It improves the accuracy and precision of VOCs gas concentration prediction, reduces the risk of model overfitting, enhances the ability to explain changes in VOCs gas concentration, and supports the effective monitoring and control of VOCs in mines.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure SMS_1
    Figure SMS_1
  • Figure SMS_2
    Figure SMS_2
  • Figure SMS_4
    Figure SMS_4
Patent Text Reader

Abstract

The invention discloses a water-soil-gas VOCs concentration correlation prediction model based on a random forest algorithm, and the method comprises the steps: a data preprocessing stage: carrying out the abnormal value elimination and standardization processing of a benzene concentration original data set; in the feature selection link, the voltage value corresponding to the benzene gas concentration measured by the PID acquisition device is used as a model input feature; constructing a prediction model by adopting a random forest algorithm, and determining the optimal number of decision trees and leaf nodes through training and debugging; using the optimized parameter configuration to train a final prediction model; evaluating the performance of the model by using the model evaluation index, and performing comparative analysis with other typical prediction models; according to the method, the multiple decision trees are combined to reduce over-fitting and improve the prediction accuracy, the fitting effect is better, and the prediction accuracy of the VOCs gas concentration is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of VOCs detection, and in particular to a VOCs concentration correlation prediction model in water, soil and air based on a random forest algorithm. Background Art

[0002] Volatile organic compounds (VOCs) are a class of organic chemicals that are easily volatile at room temperature and pressure. They are widely present in various fields such as industrial production, transportation, and daily life. Traditional VOCs detection methods such as gas chromatography-mass spectrometry (GC-MS) are highly accurate, but have limitations such as high cost, long analysis cycle, and difficulty in achieving large-scale real-time monitoring. Therefore, the development of an efficient and accurate VOCs concentration prediction model is of great practical significance.

[0003] VOCs in mining engineering exist throughout the entire life cycle of mining, ore processing and tailings disposal. VOCs emissions are multi-source and complex. They are produced through diesel equipment exhaust, blasting reactions, chemical volatilization and natural release of ores during mining, transportation, mineral processing and smelting. For example, diesel-powered equipment (such as mining machines and transport trucks) releases benzene series (BTEX), polycyclic aromatic hydrocarbons (PAHs) and aldehydes (such as formaldehyde and acrolein) during high-temperature combustion; organic solvents (such as kerosene and pine oil) volatilize in mineral processing processes such as flotation and leaching, and the secondary release of VOCs adsorbed by dust during ore crushing; the oxidative decomposition of sulfide minerals and the anaerobic degradation of organic matter in tailings ponds produce characteristic VOCs such as mercaptans and sulfides; chlorinated hydrocarbons and ester compounds volatilized from equipment lubricants, hydraulic oil leakage and anti-corrosion coatings. The types and concentrations of VOCs are significantly affected by the type of ore, mining method (open-pit / underground), and environmental conditions (temperature, humidity), and are present in multiple media including water, soil, and air. VOCs, as precursors of ozone (O3) and secondary organic aerosols (SOA), are important contributors to haze and photochemical smog. VOCs can also enter soil and water bodies through dry and wet deposition, inhibiting microbial activity and concentrating along the food chain, leading to the degradation of ecological functions in mining areas. Therefore, it is crucial to strengthen the monitoring of VOCs in mines, clarify their sources, and take timely measures to control them. This has important theoretical value and practical significance for achieving green mine construction and sustainable development goals. Summary of the Invention

[0004] In response to the problems existing in the above-mentioned prior art, the present invention provides a VOCs concentration correlation prediction model in water, soil and air based on the random forest algorithm, which is applied to the prediction of VOCs gas concentration. The random forest algorithm can effectively improve the prediction accuracy of the model by performing weighted fitting on each prediction result. By combining multiple decision trees, overfitting is reduced and prediction accuracy is improved. The better the fitting effect, the higher the accuracy of the prediction of VOCs gas concentration.

[0005] To achieve the above objectives, the present invention adopts a technical solution: a water-soil-air VOCs concentration correlation prediction model based on a random forest algorithm, including the following contents:

[0006] In the data preprocessing stage, the original benzene concentration data set was subjected to outlier removal and standardization;

[0007] In the feature selection phase, the voltage value corresponding to the benzene gas concentration measured by the PID acquisition device is used as the model input feature;

[0008] Use the random forest algorithm to build a prediction model, and determine the optimal number of decision trees and leaf nodes through training and debugging;

[0009] The final prediction model is trained using the optimized parameter configuration;

[0010] Model evaluation indicators are used to evaluate the model performance and compared with other typical prediction models.

[0011] Furthermore, the voltage value corresponding to the benzene gas concentration measured by the PID acquisition device is used as the model input feature, and the cvpartition function of MATLAB is used to divide the data set. To ensure the randomness of the data distribution, the randperm function is used to shuffle the data set in advance to eliminate potential sorting bias.

[0012] Furthermore, in order to prevent the prediction model from overfitting, the data set needs to be divided reasonably. For small sample data, the data is divided into a training set (model construction) and a test set (performance evaluation) in a ratio of 8:2. When a validation set is required, it is divided according to the standard of 60% training set, 20% validation set and 20% test set.

[0013] Furthermore, concentration tests were conducted on benzene gases with different concentrations to obtain multiple PID voltage data, and some invalid, repeated or erroneous data were removed.

[0014] Furthermore, in order to improve the convergence speed of the model, improve the accuracy of prediction, and reduce the sensitivity of noise to data, it is necessary to remove the influence of data dimension differences. To this end, it is necessary to normalize the data first, uniformly map the sample data to [0,1], and achieve uniform data parameter scale. The calculation formula is shown in (1). After the model training process is completed, denormalization is performed using formula (2).

[0015]

[0016] X=X1(X max -X min )+X min (2)

[0017] Where X max is the maximum value of the sample data; X min is the minimum value of the sample data.

[0018] Furthermore, the random forest algorithm includes:

[0019] Step 1: Sample selection, by resampling the original data set, a sample set is selected from the entire data set;

[0020] Step 2: Build a decision tree. Use the sub-training set obtained in the first step to split each node one by one. This recursive process can build a complete decision tree.

[0021] Step 3: Deepen the tree structure. To optimize the choice of each decision node, calculate the information gain to determine the best choice at the current node, which helps to further deepen the tree structure.

[0022] Step 4: Repeat the construction process. The above tree deepening process will be repeatedly executed until a complete decision tree is completed.

[0023] Furthermore, in the parameter optimization process of the random forest model, the number of decision trees (n_estimators) is used as a key parameter, with the number of decision trees ranging from 78 to 95 and the number of leaf nodes ranging from 6 to 7.

[0024] Furthermore, the model evaluation indicators are: mean square error (MSE), mean absolute error (MAE), root mean square error (RMSE), coefficient of determination (R 2 ) Four indicators are used for evaluation:

[0025] 1) Mean Squared Error (MSE)

[0026] The mean square error calculates the mean of the sum of the squares of the differences between the predicted values ​​and the true values ​​of all samples. The MSE value ranges from 0 to positive infinity. The smaller the value, the better the model fit and the higher the prediction accuracy. The formula for the mean square error is as follows:

[0027]

[0028] Where n is the number of sample data in the prediction model; y i is the true value of the sample data; Predicted values ​​for sample data;

[0029] Root mean square error (RMSE)

[0030] The root mean square error calculates the square root of the mean of the sum of the squares of the differences between the predicted values ​​of all samples and the true values, that is, the arithmetic square root of the mean square error. The RMSE has a similar function to the mean square error. The smaller the value, the better the fitting effect of the prediction model and the higher the accuracy. The formula of the root mean square error is as follows:

[0031]

[0032] Where n is the number of sample data in the prediction model; y i is the true value of the sample data; Predicted values ​​for sample data;

[0033] 3) Mean Absolute Error (MAE)

[0034] The mean absolute error calculates the average of the absolute differences between the predicted values ​​and the actual values ​​of all samples. MAE provides an intuitive and easy-to-understand error measurement method that reflects the average level of model error. The smaller the value, the more accurate the model prediction.

[0035]

[0036] Where n is the number of sample data in the prediction model; y i is the true value of the sample data; Predicted values ​​for sample data;

[0037] 4) Coefficient of determination (R 2 )

[0038] The coefficient of determination is a measure of the goodness of fit of a model. It provides a measure of the model's ability to explain data fluctuations. Its value ranges from 0 to 1. The closer the value is to 1, the better the fit of the prediction model. It provides an intuitive assessment of model performance.

[0039]

[0040] Where n is the number of sample data in the prediction model; y i is the true value of the sample data; Predicted values ​​for sample data; is the mean of the true value of the sample data.

[0041] The beneficial effects of the present invention are: by performing weighted fitting on each prediction result, the prediction accuracy of the model can be effectively improved, and by combining multiple decision trees, overfitting can be reduced and prediction accuracy can be improved. The better the fitting effect, the higher the accuracy of the prediction of VOCs gas concentration. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] Figure 1 This is a flow chart of VOCs gas concentration prediction based on the random forest algorithm of the present invention;

[0043] Figure 2 This is the initial adjustment diagram for the number of random forest decision trees;

[0044] Figure 3 This is the quadratic adjustment graph for the number of random forest decision trees;

[0045] Figure 4 The effect diagram of the VOCs concentration quantitative analysis model established by random forest regression;

[0046] Figure 5 The effect diagram of the VOCs concentration quantitative analysis model established by BP neural network;

[0047] Figure 6 The effect diagram of the VOCs concentration quantitative analysis model established for the long short-term memory network;

[0048] Figure 7 The effect diagram of the VOCs concentration quantitative analysis model established by radial basis function neural network;

[0049] Figure 8 The effect diagram of the VOCs concentration quantitative analysis model established by the extreme learning machine;

[0050] Figure 9 A comparison chart of evaluation indicators of different models. DETAILED DESCRIPTION

[0051] In order to make the purpose, technical solutions and advantages of the present invention more clear, the present invention is further described in detail below with reference to the accompanying drawings and embodiments. However, it should be understood that the specific embodiments described herein are only used to illustrate the present invention and are not intended to limit the scope of the present invention.

[0052] Unless otherwise defined, all technical and scientific terms used herein have the same meanings as those commonly understood by those skilled in the art to which the present invention pertains. The terms used in the specification of the present invention herein are only for the purpose of describing specific embodiments and are not intended to limit the present invention.

[0053] Construction of random forest VOCs gas concentration prediction model

[0054] The Random Forest (RF) algorithm is a highly efficient bagging algorithm for solving classification and regression problems. Its principle is based on constructing multiple decision trees, each of which is trained on a random subset. Bootstrap sampling is used to extract training samples. Features are randomly selected when nodes are split to increase model diversity. Finally, their prediction results are integrated by voting (classification) or averaging (regression). Through the bagging ensemble method, random forest can reduce the risk of overfitting and improve the generalization ability of the model. This method is highly robust to outliers and is therefore widely used in practical applications. The random forest algorithm generally includes the following steps:

[0055] (1) Randomly select a certain number of samples from all samples with replacement, repeat the sampling k times, and obtain a set of k samples;

[0056] (2) train k trees with k sample sets, and use randomly selected features as partition nodes during the training process;

[0057] (3) Integrate the prediction results of each tree and use voting (classification) or taking the average (regression) to determine the final category.

[0058] The RF model has shown significant advantages in the field of feature vector prediction due to its advantages such as few adjustable parameters, high integrated training efficiency, and fast convergence speed. Compared with a single decision tree, the random forest algorithm can effectively improve the prediction accuracy of the model by performing weighted fitting on each prediction result.

[0059] Based on the known benzene gas concentration data, a water-soil-air VOCs concentration correlation prediction model based on the random forest algorithm is constructed. Figure 1 As shown, it mainly includes the following steps:

[0060] (1) In the data preprocessing stage, the original benzene concentration data set was subjected to outlier removal and standardization;

[0061] (2) Feature selection: the voltage value corresponding to the benzene gas concentration measured by the PID acquisition device is used as the model input feature;

[0062] (3) Use the random forest algorithm to build a prediction model and determine the optimal number of decision trees and leaf nodes through training and debugging;

[0063] (4) Using the optimized parameter configuration to train the final prediction model;

[0064] (5) Use model evaluation indicators to evaluate the model performance and conduct comparative analysis with other typical prediction models.

[0065] In the process of constructing a random forest model for VOCs gas concentration prediction, data preprocessing is the first step; the voltage value corresponding to the benzene gas concentration measured by the PID acquisition device is used as the model input feature; the data set is partitioned using MATLAB's cvpartition function, and 80% of the samples are randomly assigned to the training set for model training, and the remaining 20% ​​is used as the test set for performance verification; to ensure the randomness of the data distribution, the randperm function is used in advance to shuffle the data set to eliminate potential sorting bias.

[0066] The VOCs gas concentration prediction flow chart of the random forest algorithm is as follows Figure 1 As shown:

[0067] Step 1: Sample selection, by resampling the original data set, a sample set is selected from the entire data set;

[0068] Step 2: Build a decision tree. Use the sub-training set obtained in the first step to split each node one by one. This recursive process can build a complete decision tree.

[0069] Step 3: Deepen the tree structure. To optimize the choice of each decision node, calculate the information gain to determine the best choice at the current node, which helps to further deepen the tree structure.

[0070] Step 4: Repeat the construction process. The above tree deepening process will be repeatedly executed until a complete decision tree is completed.

[0071] Determination of the number of decision trees:

[0072] In the parameter optimization process of the random forest model, the number of decision trees (n_estimators) is a key parameter, and its value directly affects the performance of the model. In this study, while keeping other parameters at the default settings, a grid search is performed on the number of decision trees, with the test range set to 1 to 200 and a step size of 1. Figure 2 As shown in the figure, by drawing the relationship curve between the number of decision trees and the model root mean square error (RMSE), the changing trend of model error as the number of decision trees increases is intuitively demonstrated.

[0073] Depend on Figure 2It can be seen that as the number of decision trees increases, the root mean square error of the model gradually decreases. When the number of trees increases to about 10, the error of the model fluctuates, but there is no obvious change. This error trend shows that the fitting effect of the random forest model is better and the prediction accuracy is higher as the number of decision trees increases. It also shows that when the number of decision trees reaches a certain level, the improvement effect of continuing to increase the number of decision trees on the model performance presents a marginal decreasing trend, and the model error gradually tends to be stable. Under the initial parameter configuration conditions, the number of decision trees is set to 10 to 100, and the step size is 1. Figure 3 The learning curves shown systematically demonstrate the evolution of model performance as the number of decision trees increases.

[0074] from Figure 3 It can be observed that the root mean square error of the model is 0.000436919 when the number of decision trees is 90. Taking into account the requirements of running time and prediction accuracy, this prediction model finally determines the number of decision trees to be 90.

[0075] Data preprocessing:

[0076] To prevent the prediction model from overfitting, the data set needs to be divided reasonably. For small sample data, the data is usually divided into a training set (model building) and a test set (performance evaluation) in a ratio of 8:2. When a validation set is required, it is divided according to the standard of 60% training set, 20% validation set and 20% test set.

[79] .

[0077] A concentration test was conducted on benzene gas with different known concentrations, and a total of 103 sets of PID voltage data were obtained. After removing some invalid, repeated or erroneous data, 96 sets of valid samples were obtained. Due to the small sample size, the original data set was randomly divided into 80% training set and 20% test set.

[0078] In order to improve the convergence speed of the model, improve the accuracy of prediction, and reduce the sensitivity of noise to data, it is necessary to remove the influence of data dimension differences. To this end, it is necessary to normalize the data first, uniformly map the sample data to [0,1], and achieve a unified data parameter scale. The calculation formula is shown in (1). After the model training process is completed, the denormalization is performed using formula (2);

[0079]

[0080] X=X1(X max -X min )+X min (2)

[0081] Where X max is the maximum value of the sample data; X minis the minimum value of the sample data.

[0082] Model evaluation metrics:

[0083] To evaluate the effectiveness and accuracy of the prediction model, the mean square error (MSE), mean absolute error (MAE), root mean square error (RMSE), coefficient of determination (R 2 ) Four indicators are used for evaluation;

[0084] 1) Mean Squared Error (MSE)

[0085] The mean square error calculates the mean of the sum of the squares of the differences between the predicted values ​​and the true values ​​of all samples. The MSE value ranges from 0 to positive infinity. The smaller the value, the better the model fit and the higher the prediction accuracy. The formula for the mean square error is as follows:

[0086]

[0087] Where n is the number of sample data in the prediction model; y i is the true value of the sample data; Predicted values ​​for sample data.

[0088] 2) Root Mean Square Error (RMSE)

[0089] The root mean square error calculates the square root of the mean of the sum of the squares of the differences between the predicted values ​​and the true values ​​of all samples, that is, the arithmetic square root of the mean square error; RMSE has a similar function to the mean square error. The smaller the value, the better the fitting effect of the prediction model and the higher the accuracy. The formula for the root mean square error is as follows:

[0090]

[0091] Where n is the number of sample data in the prediction model; y i is the true value of the sample data; Predicted values ​​for sample data.

[0092] 3) Mean Absolute Error (MAE)

[0093] The mean absolute error calculates the average of the absolute differences between the predicted values ​​and the actual values ​​of all samples. MAE provides an intuitive and easy-to-understand error measurement method that reflects the average level of model error. The smaller the value, the more accurate the model prediction.

[0094]

[0095] Where n is the number of sample data in the prediction model; y i is the true value of the sample data; Predicted values ​​for sample data.

[0096] 4) Coefficient of determination (R2 )

[0097] The coefficient of determination is a measure of the goodness of fit of a model. It provides a measure of the model's ability to explain data fluctuations. Its value ranges from 0 to 1. The closer the value is to 1, the better the fit of the prediction model. It provides an intuitive assessment of model performance.

[0098]

[0099] Where n is the number of sample data in the prediction model; y i is the true value of the sample data; Predicted values ​​for sample data; is the mean of the true value of the sample data.

[0100] Simulation experiment and result analysis

[0101] To systematically evaluate the performance of gas concentration prediction models, this study selected BP neural networks, random forests (RF), support vector regression (SVR), long short-term memory (LSTM), radial basis function (RBF), and extreme learning machines (ELM) as comparison models for simulation experiments. All comparative experiments were conducted using the same dataset and evaluation system to ensure comparability and fairness of the results.

[0102] Analysis of experimental results based on random forest regression prediction model

[0103] Random forest regression (RF) is used for prediction. A random forest regression model is trained using the TreeBagger function. As shown in Section 6.2.2, setting the number of decision trees in the random forest model to 90 has a small deviation. Therefore, the number of decision trees is set to 90 (trees = 90), and the minimum number of leaf nodes in each tree is 5 (leaf = 5); the VOCs gas concentration voltage value measured by the PID acquisition device is used as the input variable, and the actual VOCs gas concentration value is the output variable; the test set results of this model are as follows Figure 4 As shown,

[0104] In the evaluation of VOCs gas concentration prediction by random forest model, several key indicators were used, including MSE of 2150.1018, RMSE of 46.3692, R 2 is 0.98824, MAE is 38.1817; Figure 4 The fitting curve results show that the random forest VOCs gas concentration model performs well in prediction.

[0105] The determination coefficient is as high as 0.98824, indicating that the model is very effective in prediction and demonstrates its excellent data fitting ability; overall, these evaluation indicators reflect the accuracy and reliability of the random forest prediction model in predicting gas concentrations.

[0106] Analysis of experimental results based on BP neural network regression prediction model

[0107] The BP neural network was used for prediction and the training parameters were set, including the maximum number of iterations of 1000 and the training target error threshold of 1×10 -6 , learning rate 0.01; the constructed neural network model consists of three main layers: an input layer, a hidden layer with 5 neurons and an output layer; the VOCs gas concentration voltage value measured by the PID acquisition device is used as the input variable, and the actual VOCs gas concentration value is the output variable; detailed training is carried out in the MATLAB environment, and the prediction results are obtained as follows Figure 5 As shown:

[0108] The BP neural network model was evaluated using the same evaluation indicators and the results showed that: MSE was 27999.2277, RMSE was 167.3297, MAE was 119.8138, R 2 When comparing these indicators with the corresponding performance of the RF model, it was found that the BP neural network performed poorly in terms of error indicators, indicating that its accuracy and reliability in predicting VOCs gas concentration in this experiment were not as good as those of the RF model. 2 This shows that the model lacks the ability to explain data changes; therefore, based on the comparative analysis of these indicators, it can be concluded that the RF proposed in this paper is superior to the traditional BP neural network model.

[0109] Analysis of experimental results based on long short-term memory network regression prediction model

[0110] A long short-term memory network (LSTM) was used for prediction, with 1 iteration per round and 1500 iterations. A neural network structure consisting of a 120-dimensional input layer, a 4-unit LSTM layer, a ReLU activation layer, a fully connected layer, and a regression output layer was constructed. The Adam optimizer was used, with a maximum training round of 1500 and an initial learning rate of 0.01. A learning rate decay strategy was introduced (decaying to 10% of the original value every 1200 rounds), data shuffling, and training process visualization were enabled. The voltage value of the VOCs gas concentration measured by the PID acquisition device was used as the input variable, and the actual value of the VOCs gas concentration was used as the output variable. Detailed training was carried out in the MATLAB environment, and the prediction results were obtained as follows: Figure 6 As shown:

[0111] In the evaluation of VOCs gas concentration prediction by long short-term memory network model, several key indicators were used, including MSE of 6608.8223, RMSE of 81.2947, R 2 The error rate of the RF model is 0.9696, and the MAE is 70.8576. When these indicators are compared with the corresponding indicators of RF, it is found that RF has better performance in all these error indicators. This shows that the RF model has a better fitting effect and higher prediction accuracy than the LSTM model in predicting VOCs gas concentration in this experiment. 2 This indicates that the RF model has a stronger ability to explain data fluctuations.

[0112] Analysis of experimental results based on radial basis function neural network regression prediction model

[0113] A radial basis function (RBF) neural network is used for prediction. The newrbe function is used to create the network, and rbf_spread (radial basis function expansion speed) is set to 100. The newrbe function creates a hidden layer of neurons for each training sample. That is, the neural network model constructed this time contains three main layers: an input layer, a hidden layer with 75 neurons, and an output layer.

[0114] The voltage value of the VOCs gas concentration measured by the PID acquisition device is used as the input variable, and the actual value of the VOCs gas concentration is used as the output variable. Detailed training is carried out in the MATLAB environment to obtain the prediction results as follows Figure 7 As shown:

[0115] By carefully analyzing and comparing the prediction results of the radial basis function neural network model and the RF prediction model, the MSE of the radial basis function neural network model is 23531.7812, MAE is 114.7546, RMSE is 153.4007, and R 2 is 0.9252; when comparing these indicators with the corresponding performance of the RF model, it is found that the error value of the radial basis function neural network model is larger, indicating that its prediction accuracy and fitting effect are not as good as those of the RF model in predicting VOCs gas concentration in this experiment; and the smaller R 2 This shows that the model lacks the ability to explain data fluctuations; therefore, based on the comparative analysis of these indicators, it can be concluded that the RF proposed in this paper is superior to the traditional radial basis function neural network model.

[0116] Analysis of experimental results based on extreme learning machine regression prediction model

[0117] The extreme learning machine (ELM) is used for prediction. 50 hidden layer nodes and Sigmoid are set as the activation function. The elmtrain function is used to randomly initialize the input weight (IW) and bias (B). The output weight (LW) is directly calculated by analytical method without iterative optimization, thus quickly completing the model training. The VOCs gas concentration voltage value measured by the PID acquisition device is used as the input variable, and the actual VOCs gas concentration value is used as the output variable. Detailed training was carried out in the MATLAB environment, and the prediction results were obtained as follows: Figure 8 As shown:

[0118] In the evaluation of VOCs gas concentration prediction by extreme learning machine, several key indicators were used, including MSE of 19029.6183, RMSE of 137.9479, R 2 The error coefficient of the RF model is 0.9244, and the MAE is 112.1774. When comparing these indicators with the corresponding indicators of RF, it is found that RF has better performance in all these error indicators; this shows that the RF model has a better fitting effect and higher prediction accuracy than the ELM model in predicting VOCs gas concentration in this experiment. 2 This indicates that the RF model has a stronger ability to explain data fluctuations.

[0119] Comparison of evaluation indicators of different models

[0120] Six representative prediction models were selected for VOCs gas concentration prediction analysis, including random forest regression (RF), support vector regression (SVR), BP neural network, long short-term memory network (LSTM), radial basis function neural network (RBF) and extreme learning machine (ELM). These models are based on different algorithm principles and data structure characteristics, and can comprehensively predict and deeply analyze the trend of gas concentration changes from multiple perspectives. The unified evaluation indicators MSE, RMSE, MAE and R are used. 2 For comparative analysis, the evaluation index results of the six prediction models, RF, SVR, BP, RBF, LSTM, and ELM, are shown in Table 1:

[0121] Table 1 Comparison of error values ​​of different models

[0122]

[0123] The difference between the model prediction value and the true value is measured by the three indicators of mean square error (MSE), root mean square error (RMSE) and mean absolute error (MAE). The smaller the value, the better the model fitting effect and the higher the prediction accuracy. 2 ) measures the model's ability to explain data fluctuations. Its value ranges from 0 to 1. The closer the value is to 1, the better the fitting effect of the prediction model.

[0124] As can be seen from the table above, in this experiment, the ranking of error indicators MSE, RMSE, and MAE is RF>LSTM>SVR>ELM>RBF>BP; that is, the RF model performs best, with an MSE of 2150.1018, an RMSE of 46.3692, and a MAE of 38.1817; the BP neural network model performs worst, with an MSE of 27999.2277, an RMSE of 167.3297, and a MAE of 119.8138; this shows that in this experiment, the random forest model can provide very accurate predictions and also performs well in data fitting; the coefficient of determination R 2 The ranking results are RF>LSTM>SVR>RBF>ELM>BP; that is, the RF model performs best, and its R 2 is 0.98824; the BP neural network model performs the worst, with its R 2 The value is 0.9157, which shows that the random forest model performs well in explaining data fluctuations in this experiment.

[0125] The comparison results of the evaluation indicators of the six prediction models, RF, SVR, BP, RBF, LSTM and ELM, are as follows: Figure 9 As shown:

[0126] As can be seen from the figure, in this experiment, compared with other prediction models, the error indicators MSE, RMSE, and MAE of the RF model are the lowest, and the determination coefficient R 2 The best performance of random forest is attributed to its ensemble learning approach, which reduces overfitting and improves prediction accuracy by combining multiple decision trees. The experimental results show that RF performs best in both prediction accuracy and data fitting, making it the most suitable model for VOCs gas concentration prediction in this experiment.

[0127] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions or improvements made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.

Claims

1. A water-soil-air VOCs concentration correlation prediction model based on random forest algorithm, characterized by: Includes the following: In the data preprocessing stage, the original benzene concentration data set was subjected to outlier removal and standardization; In the feature selection phase, the voltage value corresponding to the benzene gas concentration measured by the PID acquisition device is used as the model input feature; Use the random forest algorithm to build a prediction model, and determine the optimal number of decision trees and leaf nodes through training and debugging; The final prediction model is trained using the optimized parameter configuration; Model evaluation indicators are used to evaluate the model performance and compared with other typical prediction models.

2. The VOCs concentration correlation prediction model in water, soil and air based on random forest algorithm according to claim 1 is characterized in that: The voltage value corresponding to the benzene gas concentration measured by the PID acquisition device is used as the model input feature. The cvpartition function of MATLAB is used to partition the data set. To ensure the randomness of the data distribution, the randperm function is used to shuffle the data set in advance to eliminate potential sorting bias.

3. The VOCs concentration correlation prediction model in water, soil and air based on random forest algorithm according to claim 1 is characterized in that: To prevent the prediction model from overfitting, the data set needs to be divided reasonably. For small sample data, the data is divided into a training set (model construction) and a test set (performance evaluation) in a ratio of 8:

2. When a validation set is required, it is divided according to the standard of 60% training set, 20% validation set and 20% test set.

4. The water-soil-air VOCs concentration correlation prediction model based on random forest algorithm according to claim 3 is characterized in that: Conduct concentration tests on benzene gas with different concentrations to obtain multiple PID voltage data and remove some invalid, repeated or erroneous data.

5. The water-soil-air VOCs concentration correlation prediction model based on random forest algorithm according to claim 4 is characterized in that: To improve the convergence speed of the model, increase the accuracy of predictions, and reduce the sensitivity of noise to data, it is necessary to remove the impact of data dimensionality differences; To this end, it is necessary to normalize the data first, uniformly map the sample data to [0,1], and achieve uniform data parameter scale. The calculation formula is shown in (1); After the model training process is completed, the denormalization is performed using formula (2); X=X1(X max -X min )+X min (2) Where X max is the maximum value of the sample data; X min is the minimum value of the sample data.

6. The water-soil-air VOCs concentration correlation prediction model based on random forest algorithm according to claim 1 is characterized in that: The random forest algorithm includes: Step 1: Sample selection, by resampling the original data set, a sample set is selected from the entire data set; Step 2: Build a decision tree. Use the sub-training set obtained in the first step to split each node one by one. This recursive process can build a complete decision tree. Step 3: Deepen the tree structure. To optimize the choice of each decision node, calculate the information gain to determine the best choice at the current node, which helps to further deepen the tree structure. Step 4: Repeat the construction process. The above tree deepening process will be repeatedly executed until a complete decision tree is completed.

7. The water-soil-air VOCs concentration correlation prediction model based on random forest algorithm according to claim 6 is characterized in that: In the parameter optimization process of the random forest model, the number of decision trees (n_estimators) is used as a key parameter, with a range of 78-95 decision trees and 6-7 leaf nodes.

8. The VOCs concentration correlation prediction model in water, soil and air based on random forest algorithm according to claim 1 is characterized in that: Model evaluation indicators: mean square error (MSE), mean absolute error (MAE), root mean square error (RMSE), coefficient of determination (R 2 ) Four indicators are used for evaluation: 1) Mean Squared Error (MSE) The mean square error calculates the mean of the sum of the squares of the differences between the predicted values ​​and the true values ​​of all samples. The MSE value ranges from 0 to positive infinity. The smaller the value, the better the model fit and the higher the prediction accuracy. The formula for the mean square error is as follows: Where n is the number of sample data in the prediction model; y i is the true value of the sample data; is the predicted value of the sample data; root mean square error (RMSE) The root mean square error calculates the square root of the mean of the sum of the squares of the differences between the predicted values ​​of all samples and the true values, that is, the arithmetic square root of the mean square error. The RMSE has a similar function to the mean square error. The smaller the value, the better the fitting effect of the prediction model and the higher the accuracy. The formula of the root mean square error is as follows: Where n is the number of sample data in the prediction model; y i is the true value of the sample data; Predicted values ​​for sample data; 3) Mean Absolute Error (MAE) The mean absolute error calculates the average of the absolute differences between the predicted values ​​and the actual values ​​of all samples. MAE provides an intuitive and easy-to-understand error measurement method that reflects the average level of model error. The smaller the value, the more accurate the model prediction. Where n is the number of sample data in the prediction model; y i is the true value of the sample data; Predicted values ​​for sample data; 4) Coefficient of determination (R 2 ) The coefficient of determination is a measure of the goodness of fit of a model. It provides a measure of the model's ability to explain data fluctuations. Its value ranges from 0 to 1. The closer the value is to 1, the better the fit of the prediction model. It provides an intuitive assessment of model performance. Where n is the number of sample data in the prediction model; y i is the true value of the sample data; Predicted values ​​for sample data; is the mean of the true value of the sample data.