Ozone mass concentration prediction method, system and device based on random forest and medium

By constructing a random forest-based ozone mass concentration prediction model and using a variety of environmental and meteorological factors to predict, the problem of inability to accurately predict ozone mass concentration is solved, and the refinement of air pollution warning and prevention and control is improved.

CN119626385APending Publication Date: 2025-03-14HAINAN INSTITUTE OF METEOROLOGICAL SCIENCE
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411699270.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-26
Publication Date
2025-03-14

AI Technical Summary

Technical Problem

The inability to accurately predict ozone mass concentrations makes it difficult to establish an effective air pollution warning mechanism and carry out refined prevention and control.

Method used

The ozone mass concentration prediction method based on random forests is adopted, and a random forest model is constructed for prediction by obtaining ozone detection data from multiple historical moments. This model includes a variety of environmental and meteorological factors such as PM2.5, PM10, NO2, SO2, CO, daily rainfall, average temperature, air pressure, relative humidity, sunshine hours, average wind speed of 10m and total solar radiation.

Benefits of technology

Accurate prediction of ozone mass concentration has been achieved, and the effectiveness of the air pollution warning mechanism and the refinement of prevention and control measures have been improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119626385A_ABST
    Figure CN119626385A_ABST
Patent Text Reader

Abstract

The invention discloses an ozone mass concentration prediction method, system and device based on a random forest and a medium, and relates to the technical field of environment monitoring, and the method comprises the steps: obtaining ozone detection data of a to-be-predicted region at a plurality of historical moments; the ozone detection data comprises PM2.5 mass concentration, PM10 mass concentration, NO2 mass concentration, SO2 mass concentration, CO mass concentration, daily rainfall, average temperature, air pressure, relative humidity, sunshine duration, 10m average wind speed and total solar radiation; inputting the ozone detection data of the to-be-predicted region at the plurality of historical moments into the ozone mass concentration prediction model to obtain a predicted value of the ozone mass concentration of the to-be-predicted region at the to-be-predicted moment; the ozone mass concentration prediction model is constructed based on a random forest model. According to the invention, prediction of the ozone mass concentration is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of environmental monitoring technology, and in particular to a method, system, device and medium for predicting ozone mass concentration based on random forest. Background Art

[0002] Atmospheric environmental issues have long been of concern to the general public and scholars. Studies have shown that increased concentrations of pollutants in the atmosphere can directly or indirectly harm the human immune and respiratory systems, damage plant leaves and thus reduce crop yields, corrode buildings, and even affect the balance of ground-air radiation, causing climate change.

[0003] Tropospheric O3 is mainly composed of nitrogen oxides (NO x ), carbon monoxide (CO) and volatile organic compounds (VOCs) are generated through a series of complex photochemical reactions under the irradiation of solar ultraviolet light. Their concentrations are easily affected by meteorological conditions and regional transmission, and have a nonlinear relationship with the emission of precursors, showing complex and changeable spatiotemporal variation characteristics. Studying the spatiotemporal characteristics of O3 pollution and accurately predicting the pollution status is the basis for establishing an effective air pollution early warning mechanism and carrying out refined prevention and control. Summary of the invention

[0004] The purpose of this application is to provide a method, system, device and medium for predicting ozone mass concentration based on random forest to solve the problem that ozone mass concentration cannot be predicted.

[0005] To achieve the above objectives, this application provides the following solutions:

[0006] In a first aspect, the present application provides a method for predicting ozone mass concentration based on random forest, comprising:

[0007] Obtain ozone detection data at multiple historical moments in the area to be predicted; the ozone detection data includes: PM 2.5 Mass concentration, PM 10 Mass concentration, NO2 mass concentration, SO2 mass concentration, CO mass concentration, daily rainfall, average temperature, air pressure, relative humidity, sunshine hours, 10m average wind speed and total solar radiation;

[0008] The ozone detection data of multiple historical moments in the area to be predicted are input into the ozone mass concentration prediction model to obtain the predicted value of the ozone mass concentration in the area to be predicted at the moment to be predicted; the ozone mass concentration prediction model is constructed based on the random forest model.

[0009] Optionally, the training process of the ozone mass concentration prediction model includes:

[0010] Acquire a training set; the training set includes a plurality of sample data groups; the sample data group includes: sample data of N consecutive training historical moments in the training area, N>1; wherein the sample data of the first N-1 consecutive training historical moments include ozone detection data of the first N-1 consecutive training historical moments, and the sample data of the Nth training historical moment is the measured value of the ozone mass concentration at the Nth training historical moment;

[0011] Build a random forest model;

[0012] The random forest model is trained using the training set to obtain the ozone mass concentration prediction model.

[0013] Optionally, the random forest model is trained using the training set to obtain the ozone mass concentration prediction model, including:

[0014] Normalizing each sample data group in the training set to obtain a corresponding normalized sample data group; the normalized sample data group includes: normalized sample data of N consecutive training historical moments in the training area; wherein the normalized sample data of the first N-1 consecutive training historical moments include the normalized ozone detection data of the first N-1 consecutive training historical moments, and the sample data of the Nth training historical moment is the normalized ozone mass concentration of the Nth training historical moment;

[0015] The normalized ozone detection data of the first N-1 consecutive training historical moments in each normalized sample data group are used as input, and the normalized ozone mass concentration of the Nth training historical moment in the corresponding normalized sample data group is used as output to train the random forest model to obtain the ozone mass concentration prediction model.

[0016] Optionally, after the random forest model is trained using the training set to obtain the ozone mass concentration prediction model, the method further includes:

[0017] Acquire a test set; the test set includes: a plurality of test data groups; the test data group includes: test data of N consecutive test historical moments in the test area; wherein the test data of the first N-1 consecutive test historical moments include ozone detection data of the first N-1 consecutive test historical moments, and the test data of the Nth test historical moment is the measured value of ozone mass concentration at the Nth test historical moment;

[0018] Inputting the ozone detection data of the first N-1 consecutive test historical moments in each test data group into the ozone mass concentration prediction model to obtain the predicted value of the ozone mass concentration at the Nth test historical moment in the corresponding test data group;

[0019] Based on the predicted values ​​and measured values ​​of the ozone mass concentration of each test data group, the performance of the ozone mass concentration prediction model is determined; the performance includes: standard error, mean deviation, normalized deviation and correlation coefficient.

[0020] In a second aspect, the present application provides an ozone mass concentration prediction system based on random forests, which is used to implement any of the above-mentioned ozone mass concentration prediction methods based on random forests, and the ozone mass concentration prediction system based on random forests includes:

[0021] The ozone detection data acquisition module is used to obtain ozone detection data of multiple historical moments in the area to be predicted; the ozone detection data includes: PM 2.5 Mass concentration, PM 10 Mass concentration, NO2 mass concentration, SO2 mass concentration, CO mass concentration, daily rainfall, average temperature, air pressure, relative humidity, sunshine hours, 10m average wind speed and total solar radiation;

[0022] The prediction module is used to input the ozone detection data of multiple historical moments in the area to be predicted into the ozone mass concentration prediction model to obtain the predicted value of the ozone mass concentration in the area to be predicted at the moment to be predicted; the ozone mass concentration prediction model is constructed based on the random forest model.

[0023] Optionally, the training process of the ozone mass concentration prediction model is implemented using a training module, and the training module includes:

[0024] A training set acquisition unit, used to acquire a training set; the training set includes a plurality of sample data groups; the sample data groups include: sample data of N consecutive training historical moments in a training area, N>1; wherein the sample data of the first N-1 consecutive training historical moments include ozone detection data of the first N-1 consecutive training historical moments, and the sample data of the Nth training historical moment is the measured value of ozone mass concentration at the Nth training historical moment;

[0025] Random forest model building unit, used to build a random forest model;

[0026] The ozone mass concentration prediction model training unit is used to train the random forest model using the training set to obtain the ozone mass concentration prediction model.

[0027] Optionally, the ozone mass concentration prediction model training unit includes:

[0028] A normalization subunit, for normalizing each sample data group in the training set to obtain a corresponding normalized sample data group; the normalized sample data group includes: normalized sample data of N consecutive training historical moments in the training area; wherein the normalized sample data of the first N-1 consecutive training historical moments include the normalized ozone detection data of the first N-1 consecutive training historical moments, and the sample data of the Nth training historical moment is the normalized ozone mass concentration of the Nth training historical moment;

[0029] The training subunit is used to train the random forest model with the normalized ozone detection data of the first N-1 consecutive training historical moments in each normalized sample data group as input and the normalized ozone mass concentration of the Nth training historical moment in the corresponding normalized sample data group as output to obtain the ozone mass concentration prediction model.

[0030] Optionally, the training module further includes:

[0031] A test set acquisition unit, used to acquire a test set; the test set includes: a plurality of test data groups; the test data group includes: test data of N consecutive test historical moments in the test area; wherein the test data of the first N-1 consecutive test historical moments include ozone detection data of the first N-1 consecutive test historical moments, and the test data of the Nth test historical moment is the measured value of ozone mass concentration at the Nth test historical moment;

[0032] A prediction value output unit, used to input the ozone detection data of the first N-1 consecutive test historical moments in each test data group into the ozone mass concentration prediction model to obtain a predicted value of the ozone mass concentration at the Nth test historical moment in the corresponding test data group;

[0033] The performance calculation unit is used to determine the performance of the ozone mass concentration prediction model based on the predicted value and the measured value of the ozone mass concentration of each test data group; the performance includes: standard error, mean deviation, normalized deviation and correlation coefficient.

[0034] In a third aspect, the present application provides a computer device comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement any of the above-described random forest-based ozone mass concentration prediction methods.

[0035] In a fourth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements any of the above-mentioned random forest-based ozone mass concentration prediction methods.

[0036] According to the specific embodiments provided in this application, this application discloses the following technical effects:

[0037] The present application discloses a method, system, device and medium for predicting ozone mass concentration based on random forest. First, the ozone detection data of multiple historical moments in the area to be predicted are obtained; the ozone detection data includes: PM 2.5 Mass concentration, PM 10 mass concentration, NO2 mass concentration, SO2 mass concentration, CO mass concentration, daily rainfall, average temperature, air pressure, relative humidity, sunshine hours, 10m average wind speed and total solar radiation; then, the ozone detection data of multiple historical moments in the area to be predicted are input into the ozone mass concentration prediction model to obtain the predicted value of the ozone mass concentration at the time to be predicted in the area to be predicted; wherein, the ozone mass concentration prediction model is constructed based on the random forest model. This application uses the ozone mass concentration prediction model constructed based on the random forest model to realize the prediction of ozone mass concentration. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0039] Figure 1 A schematic diagram of a method for predicting ozone mass concentration based on random forests provided in an embodiment of the present application;

[0040] Figure 2 This is the interannual variation chart of O3-8h mass concentration in Haikou from 2016 to 2022;

[0041] Figure 3 This is the seasonal variation chart of O3-8h mass concentration in Haikou from 2016 to 2022;

[0042] Figure 4 This is the monthly scale change chart of O3-8h mass concentration in Haikou City from 2016 to 2022;

[0043] Figure 5 This is the correlation matrix diagram between the characteristic factors and O3-8h mass concentration in Haikou City;

[0044] Figure 6This is the normalized importance of the feature factors of the random forest model;

[0045] Figure 7 Schematic diagram of the cumulative importance of the feature factors of the random forest model;

[0046] Figure 8 Schematic diagram of the measured values ​​of O3-8h and the corresponding predicted values ​​of the training set;

[0047] Fig. 9 Schematic diagram of the measured values ​​and corresponding predicted values ​​of O3-8h of the test set;

[0048] Fig.10 This is a schematic diagram of the measured and predicted values ​​of O3-8h in 2022;

[0049] Fig.11 This is a schematic diagram of the daily measured curve of O3-8h mass concentration in Haikou City in 2022 and the predicted curve of the ozone mass concentration prediction model;

[0050] Fig.12 A schematic diagram of the structure of a computer device provided in one embodiment of the present application. DETAILED DESCRIPTION

[0051] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0052] The purpose of this application is to provide a method, system, device and medium for predicting ozone mass concentration based on random forest, aiming to achieve the prediction of ozone mass concentration.

[0053] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, the present application is further described in detail below in conjunction with the accompanying drawings and specific implementation methods.

[0054] In an exemplary embodiment, Figure 1 As shown, the random forest-based ozone mass concentration prediction method in this embodiment includes:

[0055] Step 1: Obtain ozone detection data at multiple historical moments in the area to be predicted.

[0056] Among them, ozone detection data includes: PM 2.5 Mass concentration, PM 10Mass concentration, NO2 mass concentration, SO2 mass concentration, CO mass concentration, daily rainfall, average temperature, air pressure, relative humidity, sunshine hours, 10m average wind speed and total solar radiation.

[0057] Step 2: Input the ozone detection data of multiple historical moments in the area to be predicted into the ozone mass concentration prediction model to obtain the predicted value of the ozone mass concentration in the area to be predicted at the moment to be predicted; the ozone mass concentration prediction model is constructed based on the random forest model.

[0058] As an optional implementation, the training process of the ozone mass concentration prediction model includes:

[0059] Step 21: Obtain a training set; the training set includes multiple sample data groups; the sample data group includes: sample data of N consecutive training historical moments in the training area, N>1; wherein, the sample data of the first N-1 consecutive training historical moments include the ozone detection data of the first N-1 consecutive training historical moments, and the sample data of the Nth training historical moment is the measured value of the ozone mass concentration at the Nth training historical moment.

[0060] Step 22: Build a random forest model.

[0061] Step 23: Use the training set to train the random forest model to obtain an ozone mass concentration prediction model.

[0062] As an optional implementation, step 23 includes:

[0063] Step 231: Normalize each sample data group in the training set to obtain a corresponding normalized sample data group; the normalized sample data group includes: normalized sample data of N consecutive training historical moments in the training area, wherein the normalized sample data of the first N-1 consecutive training historical moments include the normalized ozone detection data of the first N-1 consecutive training historical moments, and the sample data of the Nth training historical moment is the normalized ozone mass concentration of the Nth training historical moment.

[0064] Step 232: Using the normalized ozone detection data of the first N-1 consecutive training historical moments in each normalized sample data group as input and the normalized ozone mass concentration of the Nth training historical moment in the corresponding normalized sample data group as output, the random forest model is trained to obtain an ozone mass concentration prediction model.

[0065] As an optional implementation manner, after step 23, the method further includes:

[0066] Step 24: Obtain a test set; the test set includes: multiple test data groups; the test data group includes: test data of N consecutive test historical moments in the test area, among which the test data of the first N-1 consecutive test historical moments include ozone detection data of the first N-1 consecutive test historical moments, and the test data of the Nth test historical moment is the actual measured value of the ozone mass concentration at the Nth test historical moment.

[0067] Step 25: Input the ozone detection data of the first N-1 consecutive test historical moments in each test data group into the ozone mass concentration prediction model to obtain the predicted value of the ozone mass concentration at the Nth test historical moment in the corresponding test data group.

[0068] Step 26: Based on the predicted values ​​and measured values ​​of the ozone mass concentration of each test data group, determine the performance of the ozone mass concentration prediction model; the performance includes: standard error, mean deviation, normalized deviation and correlation coefficient.

[0069] Specifically, in order to further illustrate the method of the present application, the following research was also conducted.

[0070] 1. Data and methods

[0071] 1.1. Data and information.

[0072] The environmental monitoring data and meteorological observation data of Haikou City are mainly used as ozone detection data. Among them, the environmental monitoring data are the daily measured data released by the Haikou Ecological Environment Bureau every day. The environmental monitoring elements include the maximum 8-hour sliding average of O3 (O3-8h), PM 2.5 、PM 10 , NO2, SO2 and CO, from January 1, 2016 to December 31, 2022. The meteorological observation data for the same period are from the Haikou Meteorological Bureau. The meteorological elements include daily rainfall (P), average temperature (T), air pressure (Pr), relative humidity (RH), sunshine hours (SD), 10m average wind speed (W10) and total solar radiation (Tr).

[0073] 1.2. Research methods.

[0074] The Random Forest (RF) model is a machine learning algorithm based on the idea of ​​decision tree proposed by Breiman. The basic principle is to reduce errors and improve accuracy by random sampling, random feature selection and decision tree integration. The generation of decision trees can be divided into feature selection, generation and pruning. It starts from the root node and splits from top to bottom. A certain feature classification is selected at each child node for splitting until the training data set on each child node belongs to the same feature classification. Based on this idea, the disordered training data set can be converted into an ordered decision tree. When making predictions, the prediction samples are input into each decision tree, and all the prediction results are combined to obtain the final prediction results. In addition, the RF model can also evaluate the contribution of each feature factor to the model by calculating the importance of the features, so as to select the feature factors. Compared with machine learning algorithms such as SVM and BPNN, the RF model can achieve more accurate prediction effects by adjusting very few parameters, so it is widely used in processing nonlinear relationships, classification, regression, high-order correlation and evaluating the importance of variables. In addition, this application also uses statistical methods such as linear trend and correlation analysis.

[0075] 1.3. Model construction and performance evaluation.

[0076] Before modeling, in order to eliminate the impact of different dimensions between different variables on model accuracy, the selected environmental monitoring data and meteorological observation data were normalized. 80% of the data from 2016 to 2021 were randomly selected as the training set, and the RF model was constructed using Python language. The remaining 20% ​​of the data was used as the test set. Finally, the data from 2022 was put into the RF model to predict the O3-8h mass concentration and verify the prediction results. This application mainly uses four evaluation indicators to evaluate the performance of the RF model, including: standard error (Root Mean Square Error, RMSE), mean bias (MeanBias, MB), normalized bias (MeanNormalizedBias, MNB) and correlation coefficient R. The RMSE value mainly reflects the difference between the predicted value and the measured value. The size of the MB value indicates that the overall predicted value is larger or smaller than the measured value. The MNB value reflects the degree to which the predicted value is larger or smaller than the measured value, and the correlation coefficient R indicates the closeness of the predicted value to the measured value. Generally, the closer RMSE, MB and MNB are to 0, and the closer R is to 1, the better the forecast effect and accuracy of the RF model.

[0077] 2. Results and discussion.

[0078] 2.1. Temporal and spatial variation characteristics of ozone mass concentration in Haikou City.

[0079] 2.1.1 Interannual variation of ozone mass concentration.

[0080] The interannual variation of O3-8h mass concentration in Haikou from 2016 to 2022 is as follows: Figure 2 From 2016 to 2022, the mass concentration of O3-8h showed an overall upward trend, with an increase rate of 1.24 μg·(m 3 a) -1 The trend coefficient was calculated to be 0.588, passing the 90% confidence test. The highest annual average O3-8h mass concentration in the past 7 years occurred in 2019, which was 82.54 μg·m -3 The lowest value was 69.91 μg·m in 2018. -3 Table 1 further summarizes the number of days and rate of excess concentration of O3-8h in Haikou from 2016 to 2022. In the past seven years, on average, there were 6.7 days per year when the O3-8h concentration exceeded the secondary concentration limit of the national ambient air quality standard (160 μg·m -3 ), reaching the mild pollution level, with an exceeding rate of 1.83%. The year with the most days of O3-8h mass concentration exceeding the standard was 2019, reaching 21 days (5.75%), and the year with the least was 2016, with only 2 days of O3-8h mass concentration exceeding the standard. In recent years, the Hainan Provincial Government has paid great attention to the prevention and control of air pollution, and has successively introduced a series of governance policies and measures. The concentration of particulate matter in Hainan Province has dropped significantly. In 2022, Hainan Province’s PM 2.5 Mass concentration, PM 10 The mass concentration and O3 mass concentration were 12 μg·m -3 , 23 μg·m -3 and 112 μg·m -3 , among which, PM 2.5 and PM 10 The mass concentrations of carbon monoxide and oxygen decreased by 33.3% and 25.8% respectively compared with 2016, while the mass concentration of O3 increased by 6.5%. The mass concentration of O3 in Haikou in 2022 is 125 μg·m -3 , ranking third from the bottom in the province, is one of the cities in Hainan Province with relatively serious O3 pollution.

[0081] Table 1 Statistics of days and rates of excess concentration of O3-8h in Haikou from 2016 to 2022

[0082] years 2016 2017 2018 2019 2020 2021 2022 average Exceeding the limit number of days 2 13 5 21 5 5 10 6.7 Exceeding standard rate / % 0.55 3.56 1.37 5.75 1.37 1.37 2.74 1.83

[0083] 2.1.2 Seasonal variations in ozone mass concentration.

[0084] Tropospheric O3 is mainly generated by photochemical reactions. With the change of meteorological conditions, there will be obvious seasonal changes. This application divides March to May into spring, June to August into summer, September to November into autumn, and December to February of the following year into winter. The O3-8h mass concentration in each season in Haikou City is statistically analyzed. The results are as follows: Figure 3 As shown in Table 2, the O3-8h mass concentration in Haikou City has obvious seasonal variation characteristics. The O3-8h mass concentration is highest in autumn, with an average of 89.58 μg·m -3 , followed by winter and spring, which were 86.35 and 74.36 μg·m -3 The lowest level in summer is only 59.17 μg·m -3 . In autumn and winter, Haikou is controlled by high-intensity continental high pressure, which is dry and rainy. The atmospheric stratification is stable and not conducive to the diffusion of O3 and its precursors. In addition, the northerly airflow transports northern atmospheric pollutants to Haikou. The relatively high temperature is conducive to the increase of photochemical reaction rate, resulting in an increase in the mass concentration of O3-8h in Haikou. After spring, the intensity of cold air affecting Haikou is relatively weak, and the South China Sea monsoon begins to break out. The southerly airflow from the ocean dilutes O3, especially in summer. Although there is sufficient sunshine and high temperature at this time, the abundant precipitation is not conducive to the increase of pollutant concentration, resulting in the lowest mass concentration of O3-8h in summer. It can be seen from the changes in different seasons that the characteristics of changes in different seasons are also different. In the past 7 years, spring has shown a weak downward trend, while summer, autumn and winter have increased to varying degrees, with the growth rate in autumn being 3.08μg·(m 3 a) -1 The trend coefficient was 0.468, passing the 80% confidence test. The O3-8h mass concentration in Haikou City in 2019 was as high as 113.6 μg·m -3 , which is the season with the highest concentration in the past 7 years.

[0085] Table 2 Annual average and seasonal variation trend of O3-8h mass concentration in Haikou City from 2016 to 2022

[0086]

[0087] 2.1.3 Monthly changes in ozone mass concentration.

[0088] Figure 4 The monthly changes of O3-8h mass concentration in Haikou from 2016 to 2022 are given. Figure 4 As shown in the figure, the changes in O3-8h mass concentration from January to December are consistent with the corresponding seasonal changes, and show a bimodal change throughout the year. In general, the O3-8h mass concentration in January is at a relatively high level, with an average mass concentration of 85.3 μg·m-3 The mass concentration decreased steadily from February to March, and then increased slowly. The first small peak appeared in April, with the mass concentration of O3-8h being 78.09 μg·m -3 After May, the mass concentration gradually decreased, and the lowest value appeared in July, with a mass concentration of only 56.47 μg·m -3 After August, it showed a rapid upward trend, and the second peak appeared in October, with a mass concentration of 98.07 μg·m -3 The mass concentration slightly decreased in December. From the perspective of different years, the minimum O3-8h mass concentration basically appeared in July and August. The minimum O3-8h mass concentration in the seven years was 47.91 μg·m -3 , which appeared in August 2020. Haikou is in summer in July and August. Affected by precipitation and southerly airflow, the O3-8h mass concentration in Haikou is low. The maximum O3-8h mass concentration in each year mainly appears in October and November, with a peak of 129.38 μg·m in November 2019. -3 In the autumn of 2019, Hainan Province experienced four consecutive O3 pollution processes. The external transport caused by the northerly airflow was one of the main reasons for the high O3-8h mass concentration.

[0089] 2.2. Construction of ozone mass concentration forecast model in Haikou City.

[0090] 2.2.1 Analysis of influencing factors of modeling dataset.

[0091] When establishing the prediction model for O3-8h mass concentration in Haikou City, the daily environmental monitoring data and meteorological observation data monitored in real time from 2016 to 2022 were mainly used. In order to explore the spatiotemporal relationship between each characteristic factor (i.e., ozone detection data) and O3-8h mass concentration and ensure the prediction accuracy of the model, the Pearson correlation analysis was first performed on each characteristic factor and O3-8h mass concentration. The correlation matrix is ​​shown in the figure below. Figure 5 shown. Figure 5 It is shown that the O3-8h mass concentration is positively correlated with the concentration of each pollutant, among which PM 10 and PM 2.5The correlation coefficients of O3-8h are as high as 0.67 and 0.65, followed by SO2 and CO, with correlation coefficients of 0.49 and 0.33, respectively, while the lowest with NO2 is only 0.03. O3 has an intricate relationship with particulate matter. O3 and secondary particulate matter have common precursors and produce nonlinear responses through photochemical reactions and heterogeneous pathways. SO2 and CO are intermediate products of photochemical reactions and also have a high correlation with O3. In the correlation with meteorological factors, O3-8h is mainly negatively correlated with precipitation, average temperature, relative humidity and total solar radiation, and positively correlated with sunshine hours, air pressure and 10m average wind speed. From the perspective of correlation coefficients, the relative humidity and air pressure have the greatest correlation, and the absolute values ​​of the correlation coefficients are all 0.39; followed by precipitation and average temperature, which are between 0.1 and 0.3; the absolute values ​​of the remaining correlation coefficients are all below 0.1.

[0092] The selected characteristic factors are normalized to eliminate the influence of different variables on the model accuracy. The importance of each characteristic factor is evaluated by the RF model. The results are as follows: Figure 6-Figure 7 The top three feature factors in terms of normalized importance are PM 2.5 (0.273), PM 10 (0.268) and relative humidity (0.103), the normalized importance cumulative value can reach more than 0.60; NO2, average temperature, air pressure, CO, total solar radiation and SO2 have relatively small effects, with normalized importance between 0.03 and 0.1; sunshine hours, 10m average wind speed and precipitation are below 0.03. From the perspective of factor cumulative importance, the cumulative importance of the first 8 characteristic factors reaches 90%, which has a greater impact on the O3-8h mass concentration.

[0093] 2.2.2 Model performance test.

[0094] Based on the normalized characteristic factor dataset, a total of 2192 samples from 2016 to 2021 were selected for modeling. 80% of the samples were selected as training sets and 20% of the samples were selected as test sets to construct the RF model. The O3-8h mass concentration in 2022 was estimated and verified using evaluation methods including RMSE, MB, MNB and R. The model test set, training set and 2022 estimated concentration verification results are shown in Figure 8-Figure 10 As shown in Table 3. Figure 8 It can be seen that the predicted value of O3-8h in the training set is basically consistent with the measured value, with RMSE, MB and MNB being 6.36 μg·m -3 , 0.08 μg·m -3and 2.37%, with a correlation coefficient R as high as 0.984, passing the 99.9% reliability test. This shows that in the training set, the RF model constructed by this application based on environmental factors and meteorological factors has a high reliability. Fig. 9 and Fig.10 In the period of small O3-8h concentration (<100 μg·m -3 ) predicted values ​​were generally higher, while the measured values ​​of O3-8h mass concentration were higher (≥100 μg·m -3 ) predicted value was significantly lower, which is consistent with the results of previous studies. The RMSE, MB and MNB of the test set were 16.09 μg·m -3 , 0.90 μg·m -3 and 6.63%, and the RMSE, MB, and MNB of the estimated results in 2022 were 19.01 μg·m -3 , 4.01 μg·m -3 and 12.60%, and R was as high as 0.838 (test set) and 0.824 (2022 estimation result), both of which passed the 99.9% confidence test, indicating that the RF model has good predictive ability.

[0095] Table 3 RF model training set, test set and estimation result evaluation index table

[0096] <![CDATA[RMSE / (μg·m -3 )]]> <![CDATA[MB / (μg·m -3 )]]> MNB / % R Training set 6.36 0.08 2.37 0.984 Test Set 16.09 0.90 6.63 0.838 Prediction result verification 19.01 4.01 12.60 0.824

[0097] Fig.11 The measured values ​​of O3-8h mass concentration in 2022 and the predicted values ​​based on the RF model are further given. Fig.11 It can be seen that the RF model can predict the changing trend of the O3-8h mass concentration in Haikou City, that is, the change characteristics of significantly higher in the winter half of the year and significantly lower in the summer half of the year, which is basically consistent with the measured values. In the spring and autumn periods when the measured values ​​of the O3-8h mass concentration in Haikou City are significantly higher, the RF model can basically predict them, but the predicted results of the maximum values ​​are significantly lower than the measured values; on the contrary, in the summer period when the measured values ​​of the O3-8h mass concentration are low, the predicted values ​​of the RF model are higher than the measured values, which is consistent with the previous analysis results. The RF model can basically estimate the changing trend of the O3-8h mass concentration in Haikou City in 2022, but there are still certain deviations in the prediction results for the periods when the measured values ​​are abnormally high and low. The explanation of the variance of the measured values ​​by the RF model prediction results in 2022 reached 0.68, that is, the daily changes in the RF model prediction results can explain 68% of the daily changes in the measured values.

[0098] 3. Conclusion

[0099] (1) From 2016 to 2022, the mass concentration of O3-8h in Haikou City was 1.24 μg·(m 3a) -1 The trend coefficient was 0.588, passing the 90% confidence test. The highest annual average value occurred in 2019, reaching 82.54 μg·m -3 The O3-8h mass concentration in Haikou City reached the light pollution level for an average of 6.7 days each year, with an excess rate of 1.83%. In 2019, it reached 5.75% (21 days), and O3 pollution was relatively serious.

[0100] (2) Seasonal variation analysis shows that the O3-8h concentration in Haikou City is highest in autumn, followed by winter and spring, and lowest in summer. The O3-8h concentration in spring showed a weak downward trend over the past 7 years, while the other seasons showed varying degrees of increase, with the fastest increase in autumn, reaching 3.08 μg·(m 3 a) -1 The trend coefficient was 0.468, passing the 80% reliability test. The monthly variation of O3-8h mass concentration in Haikou City showed a bimodal characteristic, with two peaks appearing in April and October, respectively. The O3-8h mass concentration was 85.3 μg·m -3 and 98.07 μg·m -3 The peak months in different years are also different.

[0101] (3) The O3-8h mass concentration in Haikou City was positively correlated with the concentrations of various pollutants, among which PM 10 and PM 2.5 The correlation coefficients were as high as 0.67 and 0.65 respectively. Among the meteorological factors, O3 was negatively correlated with precipitation, average temperature, relative humidity and total solar radiation, and positively correlated with sunshine hours, air pressure and 10m average wind speed. The relative humidity and air pressure had the greatest correlation, and the absolute value of the correlation coefficient was 0.39. The importance evaluation results of the characteristic factors were consistent with the correlation analysis, among which PM 2.5 、PM 10 and relative humidity are the top three characteristic factors in terms of normalized importance.

[0102] (4) The RF evaluation model was constructed using normalized environmental and meteorological factors. The RMSE, MB, and MNB in ​​the training set were 6.36 μg·m -3 , 0.08 μg·m -3 The RMSE, MB and MNB of the test set were 16.09 μg·m -3 , 0.90 μg·m -3 and 6.63%, and the estimated results in 2022 are 19.01 μg·m-3 , 4.01 μg·m -3 and 12.60%, with correlation coefficients R as high as 0.838 (test set) and 0.824 (2022 estimation results), both of which passed the 99.9% confidence test. The RF estimation model can basically estimate the trend of the change in the O3-8h mass concentration in Haikou in 2022, but there is still a certain deviation in the prediction of extreme values, among which the explained variance of the prediction results for the measured values ​​is 0.68.

[0103] In an exemplary embodiment, a random forest-based ozone mass concentration prediction system is provided, which is used to implement any of the above-mentioned random forest-based ozone mass concentration prediction methods. The random forest-based ozone mass concentration prediction system includes:

[0104] The ozone detection data acquisition module is used to obtain ozone detection data at multiple historical moments in the area to be predicted; the ozone detection data includes: PM 2.5 Mass concentration, PM 10 Mass concentration, NO2 mass concentration, SO2 mass concentration, CO mass concentration, daily rainfall, average temperature, air pressure, relative humidity, sunshine hours, 10m average wind speed and total solar radiation.

[0105] The prediction module is used to input the ozone detection data of multiple historical moments in the area to be predicted into the ozone mass concentration prediction model to obtain the predicted value of the ozone mass concentration in the area to be predicted at the moment to be predicted; the ozone mass concentration prediction model is constructed based on the random forest model.

[0106] As an optional implementation, the training process of the ozone mass concentration prediction model is implemented using a training module, and the training module includes:

[0107] A training set acquisition unit is used to acquire a training set; the training set includes multiple sample data groups; the sample data groups include: sample data of N consecutive training historical moments in the training area, N>1; wherein, the sample data of the first N-1 consecutive training historical moments include the ozone detection data of the first N-1 consecutive training historical moments, and the sample data of the Nth training historical moment is the actual measured value of the ozone mass concentration at the Nth training historical moment.

[0108] Random forest model building unit, used to build random forest models.

[0109] The ozone mass concentration prediction model training unit is used to train the random forest model using the training set to obtain the ozone mass concentration prediction model.

[0110] As an optional implementation, the ozone mass concentration prediction model training unit includes:

[0111] The normalization subunit is used to normalize each sample data group in the training set to obtain a corresponding normalized sample data group; the normalized sample data group includes: normalized sample data of N consecutive training historical moments in the training area; wherein, the normalized sample data of the first N-1 consecutive training historical moments include the normalized ozone detection data of the first N-1 consecutive training historical moments, and the sample data of the Nth training historical moment is the normalized ozone mass concentration of the Nth training historical moment.

[0112] The training subunit is used to train the random forest model with the normalized ozone detection data of the first N-1 consecutive training historical moments in each normalized sample data group as input and the normalized ozone mass concentration of the Nth training historical moment in the corresponding normalized sample data group as output to obtain an ozone mass concentration prediction model.

[0113] As an optional implementation, the training module further includes:

[0114] A test set acquisition unit is used to acquire a test set; the test set includes: multiple test data groups; the test data group includes: test data of N consecutive test historical moments in the test area; among them, the test data of the first N-1 consecutive test historical moments include ozone detection data of the first N-1 consecutive test historical moments, and the test data of the Nth test historical moment is the actual measured value of the ozone mass concentration at the Nth test historical moment.

[0115] The prediction value output unit is used to input the ozone detection data of the first N-1 consecutive test historical moments in each test data group into the ozone mass concentration prediction model to obtain the predicted value of the ozone mass concentration at the Nth test historical moment in the corresponding test data group.

[0116] The performance calculation unit is used to determine the performance of the ozone mass concentration prediction model based on the predicted value and the measured value of the ozone mass concentration of each test data group. The performance includes: standard error, mean deviation, normalized deviation and correlation coefficient.

[0117] In an exemplary embodiment, a computer device is provided, including: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement an ozone mass concentration prediction method based on random forests.

[0118] In an exemplary embodiment, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, a method for predicting ozone mass concentration based on random forest is implemented.

[0119] In an exemplary embodiment, a computer program product is provided, including a computer program, which implements an ozone mass concentration prediction method based on random forest when executed by a processor.

[0120] In an exemplary embodiment, a computer device is provided. The computer device may be a server or a terminal. The internal structure diagram thereof may be as follows: Fig.12 As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a method for predicting ozone mass concentration based on random forests is implemented.

[0121] Those skilled in the art will understand that Fig.12 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0122] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.

[0123] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM may be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM).

[0124] The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. The non-relational database may include a distributed database based on blockchain, etc., but is not limited thereto. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but is not limited thereto.

[0125] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0126] This article uses specific examples to illustrate the principles and implementation methods of this application. The description of the above embodiments is only used to help understand the method and core ideas of this application. At the same time, for those skilled in the art, according to the ideas of this application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as limiting this application.

Claims

1. A method for predicting ozone mass concentration based on random forest, characterized in that: The random forest-based ozone mass concentration prediction method includes: Obtain ozone detection data at multiple historical moments in the area to be predicted; the ozone detection data includes: PM 2.5 Mass concentration, PM 10 Mass concentration, NO2 mass concentration, SO2 mass concentration, CO mass concentration, daily rainfall, average temperature, air pressure, relative humidity, sunshine hours, 10m average wind speed and total solar radiation; The ozone detection data of multiple historical moments in the area to be predicted are input into the ozone mass concentration prediction model to obtain the predicted value of the ozone mass concentration in the area to be predicted at the moment to be predicted; the ozone mass concentration prediction model is constructed based on the random forest model.

2. The method for predicting ozone mass concentration based on random forest according to claim 1, characterized in that: The training process of the ozone mass concentration prediction model includes: Acquire a training set; the training set includes a plurality of sample data groups; the sample data group includes: sample data of N consecutive training historical moments in the training area, N>1; wherein the sample data of the first N-1 consecutive training historical moments include ozone detection data of the first N-1 consecutive training historical moments, and the sample data of the Nth training historical moment is the measured value of the ozone mass concentration at the Nth training historical moment; Build a random forest model; The random forest model is trained using the training set to obtain the ozone mass concentration prediction model.

3. The method for predicting ozone mass concentration based on random forest according to claim 2, characterized in that: The random forest model is trained using the training set to obtain the ozone mass concentration prediction model, including: Normalizing each sample data group in the training set to obtain a corresponding normalized sample data group; the normalized sample data group includes: normalized sample data of N consecutive training historical moments in the training area; wherein the normalized sample data of the first N-1 consecutive training historical moments include the normalized ozone detection data of the first N-1 consecutive training historical moments, and the sample data of the Nth training historical moment is the normalized ozone mass concentration of the Nth training historical moment; The normalized ozone detection data of the first N-1 consecutive training historical moments in each normalized sample data group are used as input, and the normalized ozone mass concentration of the Nth training historical moment in the corresponding normalized sample data group is used as output to train the random forest model to obtain the ozone mass concentration prediction model.

4. The method for predicting ozone mass concentration based on random forest according to claim 2, characterized in that: After the random forest model is trained using the training set to obtain the ozone mass concentration prediction model, the method further includes: Acquire a test set; the test set includes: a plurality of test data groups; the test data group includes: test data of N consecutive test historical moments in the test area; wherein the test data of the first N-1 consecutive test historical moments include ozone detection data of the first N-1 consecutive test historical moments, and the test data of the Nth test historical moment is the measured value of ozone mass concentration at the Nth test historical moment; Inputting the ozone detection data of the first N-1 consecutive test historical moments in each test data group into the ozone mass concentration prediction model to obtain the predicted value of the ozone mass concentration at the Nth test historical moment in the corresponding test data group; Based on the predicted values ​​and measured values ​​of the ozone mass concentration of each test data group, the performance of the ozone mass concentration prediction model is determined; the performance includes: standard error, mean deviation, normalized deviation and correlation coefficient.

5. A random forest-based ozone mass concentration prediction system, used to implement the random forest-based ozone mass concentration prediction method according to any one of claims 1 to 4, characterized in that: The random forest-based ozone mass concentration prediction system includes: The ozone detection data acquisition module is used to obtain ozone detection data of multiple historical moments in the area to be predicted; the ozone detection data includes: PM 2.5 Mass concentration, PM 10 Mass concentration, NO2 mass concentration, SO2 mass concentration, CO mass concentration, daily rainfall, average temperature, air pressure, relative humidity, sunshine hours, 10m average wind speed and total solar radiation; The prediction module is used to input the ozone detection data of multiple historical moments in the area to be predicted into the ozone mass concentration prediction model to obtain the predicted value of the ozone mass concentration in the area to be predicted at the moment to be predicted; the ozone mass concentration prediction model is constructed based on the random forest model.

6. The random forest-based ozone mass concentration prediction system according to claim 5, characterized in that: The training process of the ozone mass concentration prediction model is implemented using a training module, and the training module includes: A training set acquisition unit, used to acquire a training set; the training set includes a plurality of sample data groups; the sample data groups include: sample data of N consecutive training historical moments in a training area, N>1; wherein the sample data of the first N-1 consecutive training historical moments include ozone detection data of the first N-1 consecutive training historical moments, and the sample data of the Nth training historical moment is the measured value of ozone mass concentration at the Nth training historical moment; Random forest model building unit, used to build a random forest model; The ozone mass concentration prediction model training unit is used to train the random forest model using the training set to obtain the ozone mass concentration prediction model.

7. The random forest-based ozone mass concentration prediction system according to claim 6, characterized in that: The ozone mass concentration prediction model training unit comprises: A normalization subunit, for normalizing each sample data group in the training set to obtain a corresponding normalized sample data group; the normalized sample data group includes: normalized sample data of N consecutive training historical moments in the training area; wherein the normalized sample data of the first N-1 consecutive training historical moments include the normalized ozone detection data of the first N-1 consecutive training historical moments, and the sample data of the Nth training historical moment is the normalized ozone mass concentration of the Nth training historical moment; The training subunit is used to train the random forest model with the normalized ozone detection data of the first N-1 consecutive training historical moments in each normalized sample data group as input and the normalized ozone mass concentration of the Nth training historical moment in the corresponding normalized sample data group as output to obtain the ozone mass concentration prediction model.

8. The ozone mass concentration prediction system based on random forest according to claim 6, characterized in that: The training module further includes: A test set acquisition unit, used to acquire a test set; the test set includes: a plurality of test data groups; the test data group includes: test data of N consecutive test historical moments in the test area; wherein the test data of the first N-1 consecutive test historical moments include ozone detection data of the first N-1 consecutive test historical moments, and the test data of the Nth test historical moment is the measured value of ozone mass concentration at the Nth test historical moment; A prediction value output unit, used to input the ozone detection data of the first N-1 consecutive test historical moments in each test data group into the ozone mass concentration prediction model to obtain a predicted value of the ozone mass concentration at the Nth test historical moment in the corresponding test data group; The performance calculation unit is used to determine the performance of the ozone mass concentration prediction model based on the predicted value and the measured value of the ozone mass concentration of each test data group; the performance includes: standard error, mean deviation, normalized deviation and correlation coefficient.

9. A computer device comprising: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the random forest-based ozone mass concentration prediction method according to any one of claims 1 to 4.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the random forest-based ozone mass concentration prediction method described in any one of claims 1 to 4 is implemented.