Air quality condition prediction and pollution early warning method

Through the improved TFT model, combined with a variety of factors and characteristics that affect air quality, the problem of ignoring external factors and poor processing of non-stationary time series in the prior art is solved, and more efficient and accurate air quality prediction is achieved.

CN119721328APending Publication Date: 2025-03-28HOHAI UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411664462.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-20
Publication Date
2025-03-28

AI Technical Summary

Technical Problem

Existing air quality prediction methods ignore the influence of external factors, and traditional models do not work well when dealing with non-stationary time series, resulting in limited prediction accuracy.

Method used

The improved TFT model is used to combine variables such as regional location, meteorological data and pollution source distribution to automatically analyze and extract characteristics of the impact on air pollutant concentration to conduct air quality time series prediction. The model is stationary to extract time correlations and destabilizes before output to maintain the non-stationary properties of the air quality time series.

Benefits of technology

It improves the accuracy of air quality prediction, can capture the trend of air quality changes more accurately, and provides more reliable early warning information.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119721328A_ABST
    Figure CN119721328A_ABST
Patent Text Reader

Abstract

The invention discloses an air quality condition prediction and pollution early warning method, and particularly relates to an air quality index AQI prediction and air pollution degree early warning method, which comprises the following steps: establishing an air quality monitoring database, obtaining monitoring data of a station in a preset time period, and preprocessing the collected monitoring data to obtain an air quality monitoring result; and storing in a database. And adding variable data of an additional source, and establishing a multivariable air quality prediction data set. An air quality health degree index system is constructed, an air quality health index prediction model is constructed, and an air quality comprehensive health condition calculation and trend prediction model is constructed. And training an air quality data set, optimizing hyper-parameters by using a verification set through minimizing quantile loss, and evaluating the prediction capability of the model by using a test set. Future air quality data are predicted through the trained model, so that the omen of air quality deterioration or pollution can be found, and a decision maker can take measures in advance conveniently.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention discloses an air quality situation prediction and pollution early warning method, and specifically relates to a method for predicting an air quality index AQI and early warning of air pollution degree. Background Art

[0002] With the acceleration of my country's modernization and urbanization, air pollution is becoming increasingly severe, and air quality is facing multiple challenges. Therefore, to further improve air quality scientifically and effectively, it is necessary to make full use of the new generation of information technology to monitor and predict the atmospheric environment, analyze and solve challenging ecological and environmental problems. In this way, air quality decision-making and governance can be more intelligent. Air quality prediction is a basic work of environmental management and pollution prevention and control, and provides an important reference for the dynamic regulation of air quality and emergency response to sudden pollution incidents. In recent years, with the rapid development of Internet of Things technology and artificial intelligence, air quality detection sensors with excellent performance, good stability and fast response have gradually emerged. By collecting data from a variety of air quality sensors, various air quality indicators can be obtained in real time, providing a scientific basis for real-time monitoring and management of the atmospheric environment.

[0003] Air quality prediction is actually also a time series prediction problem. Usually, a prediction model is established based on historical air quality data to estimate the trend of air quality changes in the future. At present, the methods of time series prediction are mainly divided into traditional statistical methods and deep learning methods. The most commonly used traditional method is ARIMA (autoregressive integrated moving average model), which can capture the linear relationship between features, but is only applicable to stationary time series prediction. It only considers the change law within the time series and ignores external factors that have a significant impact on air quality, such as weather conditions and human activities. Therefore, its application in complex air quality prediction is limited. In deep learning methods, RNN (recurrent neural network) can capture the long-term dependency of time series, and LSTM (long short-term memory network) effectively solves the gradient explosion or disappearance problem in RNN. However, the selection and optimization of hyperparameters in these methods rely on subjective experience and repeated trials. In addition, these methods usually make predictions by stabilizing non-stationary time series, ignoring the non-stationary characteristics of air quality data itself and the dynamic influence of external factors. Summary of the invention

[0004] Purpose of the invention: In view of the shortcomings of the above technologies, the present invention proposes a method for predicting air quality time series based on an improved TFT model. This method comprehensively considers additional variables that may affect air composition, such as regional location, meteorological data, and distribution of pollution sources, and overcomes the limitations of single variables in traditional prediction models. The model can automatically analyze and extract features that have an important impact on the concentration of air pollutants, thereby avoiding the feature selection process based on human subjective experience. The main prediction variables include the concentration changes of six major pollutants: PM2.5, PM10, SO2, NO2, CO, and O3. The non-stationary air quality time series is processed by stabilization, and the time correlation between the concentrations of each pollutant is obtained through the destabilization attention mechanism. Finally, it is restored to the original non-stationarity through destabilization to maintain the non-stationary characteristics of the air quality time series, thereby improving the accuracy of the prediction.

[0005] Technical solution: To achieve the above purpose, the present invention proposes a method for predicting air quality time series based on an improved TFT model, comprising the following steps:

[0006] S1: Establish an air quality monitoring database, by placing air quality monitoring sensors at preset monitoring sites, obtain monitoring data of the sites within a preset time period, such as PM2.5, PM10, ozone, sulfur dioxide, nitrogen dioxide, carbon monoxide concentration, etc., pre-process the collected monitoring data, perform data cleaning and other operations on the monitored data, handle data missing, abnormal values ​​or noise caused by collection failures, data transmission anomalies, etc., and store them in the air quality monitoring database;

[0007] S2: Establish a multivariate air quality prediction dataset, manually expand the air quality prediction dataset variables, and add variable data from additional sources;

[0008] S3: partitioning the multivariate air quality prediction dataset;

[0009] S4: Construct an air quality health indicator system;

[0010] S5: Based on the improved time fusion Transformer model, we built an air quality comprehensive health status calculation and trend prediction model, trained the air quality dataset, and optimized the hyperparameters by minimizing the quantile loss.

[0011] S6: Use the trained air quality prediction model to predict future air quality data and provide future air quality prediction information to management decision makers.

[0012] Furthermore, the method for establishing an air quality monitoring database in S1 is:

[0013] Air quality monitoring sensors are placed at preset monitoring sites with a monitoring frequency of once every hour. Monitoring data includes concentrations of major pollutants such as PM2.5, PM10, SO2, NO2, CO, O3, etc. The collected monitoring data are pre-processed and data cleaning operations are performed to improve data quality.

[0014] The error values, missing values ​​and outliers in the collected data were processed: the error values ​​were deleted, the missing values ​​were filled using linear interpolation, and based on the box plot, the third quartile was used to replace the high outliers, and the first quartile was used to replace the low outliers. After the processing was completed, the data was stored in the air quality monitoring database.

[0015] Furthermore, the method for establishing a multivariate air quality prediction data set in step S2 is:

[0016] A1: Create a data storage file as the air quality prediction dataset file.

[0017] A2: Obtain the geographic location of the monitoring site sensor, and obtain meteorological data for each time step in the historical and future preset time period from the Meteorological Bureau, including temperature, air pressure, humidity, wind speed, precipitation, etc., as characteristic variables that may affect air quality.

[0018] A3: Expand the data variables monitored by the sensors, add the geographical location of the monitoring site, historical meteorological data, year, month, day, season, future meteorological data, etc.

[0019] A4: Store these variables into data files in chronological order to form an air quality prediction data set file.

[0020] Furthermore, the specific method of dividing the variables in step S3 is:

[0021] The input multivariate data is divided into three different types of inputs, namely static variables, historical observation variables, and future known variables. The geographical location of the monitoring site is used as the static variable input, the historical monitored air quality data, historical meteorological data, year, month, day, and season are used as historical observation variables, and the future year, month, day, season, and meteorological data are used as future known inputs.

[0022] Furthermore, the method for constructing the air quality health index system in step S4 is:

[0023] Build an equipment health status indicator system, and build a tree-like hierarchical structure diagram of each indicator for different air quality levels by consulting materials and professional evaluation;

[0024] Design a questionnaire, invite professionals to evaluate the indicators, and compare the importance of each pollutant indicator;

[0025] The index weights are calculated using the interval analytic hierarchy process, the importance matrix is ​​constructed, the matrix eigenvalues ​​are calculated using the power method, and the combined weights of the indicators are calculated.

[0026] Furthermore, the method for constructing the improved time fusion Transformer model in step S5 is:

[0027] B1: Improve the processing method of non-stationary time series in the TFT model. When selecting variables, the selected time series variables are stabilized:

[0028]

[0029] Where S is the length of the time series, μ x is the mean of a single variable, is the variance of a single variable, x' i It is a variable that has undergone a stabilization operation. After the stabilization process, the distribution differences between the time series of each input are reduced, making the input distribution more stable.

[0030] B2: Add an embedding layer with linear characteristics after the static enhancement layer in the TFT model. This linear characteristic refers to: f(ax+by)=af(x)+bf(y).

[0031] B3: Improve the attention mechanism algorithm in the TFT model and replace it with a de-stationary attention mechanism. The improved attention solution method is:

[0032]

[0033] To approximate the attention without stationary processing, specific time correlations can be found from the original unstationary data. Where τ and Δ are the de-stationary factors for scaling and shifting, which are used to approximate and Kμ Q Using a multilayer perceptron as a mapper, we can get the statistic μ x , σ x and non-stationary sequence x to learn the stationary factors τ and Δ.

[0034] B4: Improve the output method in the TFT model and perform destabilization before output.

[0035]

[0036] where y' i is the predicted result, μ x is the mean, σ xThis design allows the model to make changes such as translation and scaling disturbances to the time series, which is beneficial for the prediction of non-stationary time series such as air quality data.

[0037] The prediction data set is divided into three parts according to the ratio of 7:2:1, namely training set, validation set and test set. After training, the model is trained and the predicted values ​​are compared with the known results. The hyperparameters are tuned by jointly minimizing the quantile loss.

[0038] The quantile loss calculation method in step S5 is:

[0039]

[0040] The sum of the losses for all samples is calculated as:

[0041]

[0042] Minimize the loss, find the optimal hyperparameters, and establish an air quality prediction model.

[0043] Furthermore, the specific method of evaluating the indicators in step S6 is: using the trained model to predict the air quality indicators for the next week, comparing the predicted results with the specified air pollution threshold, if an indicator exceeds the threshold, it means that the air pollution level has been reached, and an early warning is issued.

[0044] Beneficial effects: Compared with the prior art, the present invention has the following advantages:

[0045] 1. It can realize multivariate prediction of complex time series such as air quality, solve the problems of long prediction time and inability to parallel processing in single variable prediction models, and effectively improve the prediction efficiency.

[0046] 2. It can comprehensively consider various external factors that affect air quality and combine multivariate data characteristics to make the prediction results more accurate.

[0047] 3. It can process non-stationary data such as air quality, so that the attention mechanism can focus on the correlation between the non-stationary data features of air quality itself, thereby better revealing the dynamic relationship between pollutants. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] Figure 1 It is a schematic diagram of the process of the present invention.

[0049] Figure 2 Structural diagram of the improved TFT model. DETAILED DESCRIPTION

[0050] The present invention is further explained below in conjunction with the drawings and specific embodiments of the present invention. The specific embodiments described are only used to illustrate the present invention and are not used to limit the scope of the present invention. Based on the embodiments of the present invention, all other implementation methods obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.

[0051] The technical solution of the present invention is described in detail below.

[0052] The present invention proposes a prediction method for non-stationary time series of air quality based on an improved TFT model. Figure 1 As shown, it includes the following steps:

[0053] S1: Obtain air quality data from multiple monitoring sites within a preset time period and establish an air quality monitoring database.

[0054] S2: Establish a multivariate air quality prediction dataset.

[0055] S3: Partitioning the multivariate air quality prediction dataset.

[0056] S4: Establish an air quality health indicator system.

[0057] S5: Build an improved temporal fusion Transformer model, train it on the air quality dataset, and tune the hyperparameters by minimizing the quantile loss.

[0058] S6: Use the trained model to predict the test set, output multiple predicted values ​​of the main pollutant indicators in multiple future time steps, and evaluate whether the indicators reach the pollution threshold.

[0059] The method for establishing an air quality monitoring database in step S1 of this embodiment is as follows: a specific urban area is selected for air quality prediction, and air quality monitoring sensors are placed at preset monitoring sites in the area. The monitoring frequency is once per hour, and the monitoring data includes but is not limited to the concentrations of major pollutants such as PM2.5, PM10, SO2, NO2, CO, and O3. The collected monitoring data is preprocessed and cleaned.

[0060] The error values, missing values ​​and outliers in the collected data were processed: the error values ​​were deleted, the missing values ​​were filled by linear interpolation, and the high outliers in the data were replaced by the third quartile and the low outliers in the data were replaced by the first quartile based on the box plot. After processing, the data were stored in the air quality monitoring database.

[0061] The method of filling missing values ​​using linear interpolation is to determine the location of the missing value, use the two adjacent values ​​before and after the missing value, and calculate the missing value based on the interval between known values.

[0062] The method for establishing a multivariate air quality prediction data set in step S2 of this embodiment is:

[0063] A1: Create a data storage file, which is an air quality prediction dataset file.

[0064] A2: Obtain the geographic location of the sensor at the monitoring site, and obtain meteorological data for each time step in the historical and future preset time period from the Meteorological Bureau, including but not limited to temperature, air pressure, humidity, wind speed, rainfall, etc., as characteristic variables that may affect air quality.

[0065] A3: Expand the data variables monitored by the sensors, add the geographical location of the monitoring site, historical meteorological data, year, month, day, season, future meteorological data, etc.

[0066] A4: Store these variables in the data file in the order of time and monitoring site location to form an air quality prediction data set file.

[0067] The specific method of dividing variables in step S3 of this embodiment is: dividing the input multivariate data into three different types of inputs, namely static variables, historical observation variables and future known variables. The acquired geographical location of the monitoring site is input as a static variable, the historically monitored air quality data, historical meteorological data, year, month, day, season are used as historical observation variables, and the future year, month, day, season and meteorological data are used as future known inputs.

[0068] The method for constructing the improved time fusion Transformer model in step S4 of this embodiment is: Figure 2 This is the internal structure design diagram of the improved TFT model used in the present invention. After the static variables pass through the feature selection module, they are enhanced in the static enhancement layer. The historical observation value variables and future known variables enter the encoder and decoder after feature selection, are processed by the Gate and GRN modules, and then enter the destabilization attention mechanism after linear transformation. Finally, the result of the attention mechanism passes through a simple feedforward layer, and then the result is destabilized and output to restore the non-stationary characteristics of the original air quality time series. The specific internal improvement implementation details are as follows:

[0069] B1: Improve the processing method of non-stationary time series in the TFT model. When selecting variables, the selected time series variables are stabilized:

[0070]

[0071] Where S is the length of the time series, μ x is the mean of a single variable, is the variance of a single variable, x' i It is a variable that has undergone a stabilization operation. After the stabilization process, the distribution differences between the time series of each input are reduced, making the input distribution more stable.

[0072] B2: Add an embedding layer with linear characteristics after the static enhancement layer in the TFT model. This linear characteristic refers to: f(ax+by)=af(x)+bf(y).

[0073] B3: Improve the attention mechanism algorithm in the TFT model and replace it with a de-stationary attention mechanism. The improved attention solution method is:

[0074]

[0075] To approximate the attention without stationary processing, specific time correlations can be found from the original unstationary data. Where τ and Δ are the de-stationary factors for scaling and shifting, which are used to approximate and Kμ Q Using a multilayer perceptron as a mapper, we can get the statistic μ x , σ x and non-stationary sequence x to learn the stationary factors τ and Δ.

[0076] B4: Improve the output method in the TFT model and perform destabilization before output.

[0077]

[0078] where y' i is the predicted result, μ x is the mean, σ x This design allows the model to make changes such as translation and scaling disturbances to the time series, which is beneficial for the prediction of non-stationary time series such as air quality data.

[0079] The prediction data set is divided into three parts according to the ratio of 7:2:1, namely training set, validation set and test set. After training, the model is trained. After the training, the predicted value is compared with the known result, and the hyperparameters are tuned by jointly minimizing the quantile loss.

[0080] The quantile loss calculation method in step S4 of this embodiment is:

[0081]

[0082] The sum of the losses for all samples is calculated as:

[0083]

[0084] Minimize the loss, find the optimal hyperparameters, and build a predictive model.

Claims

1. A method for air quality data prediction and pollution warning based on an improved TFT model, characterized in that: It includes the following steps: S1: Establish an air quality monitoring database, by placing air quality monitoring sensors at preset monitoring sites, obtain monitoring data of the sites within a preset time period, such as PM2.5, PM10, ozone, sulfur dioxide, nitrogen dioxide, carbon monoxide concentration, etc., pre-process the collected monitoring data, perform data cleaning and other operations on the monitored data, handle data missing, abnormal values ​​or noise caused by collection failures, data transmission anomalies, etc., and store them in the air quality monitoring database; S2: Establish a multivariate air quality prediction dataset, manually expand the air quality prediction dataset variables, and add variable data from additional sources; S3: partitioning the multivariate air quality prediction dataset; S4: Construct an air quality health indicator system; S5: Based on the improved time fusion Transformer model, we built an air quality comprehensive health status calculation and trend prediction model, trained the air quality dataset, and optimized the hyperparameters by minimizing the quantile loss. S6: Predict future air quality data through the trained air quality prediction model to provide future air quality prediction information for management decision makers.

2. The method for predicting air quality time series based on the improved TFT model according to claim 1, characterized in that: The method for processing the phenomenon such as data missing, abnormal value or noise caused by acquisition failure, abnormal data transmission, etc. in step S1 is: A1: Process the erroneous values, missing values ​​and outliers in the historical air quality observation data; A2: Delete the error value; A3: Use linear interpolation to fill missing values; A4: Based on the box plot, the third quartile is used to replace the high outliers in the data, and the first quartile is used to replace the low outliers in the data.

3. The method for predicting air quality time series based on the improved TFT model according to claim 1, characterized in that: The method for manually expanding the air quality prediction data set variables in step S2 is: B1: Create a storage data file, which is an air quality prediction data set file. B2: Obtain the geographic location of the sensors at the monitoring sites, and obtain data on air pollutants and other data at each time step within the preset time period through the Meteorological Bureau, as well as data on several time steps predicted in the future. B3: Expand the data variables monitored by sensors, add sensor locations of monitoring sites, historically observed air quality conditions, year, month, day, season, and future air quality forecast items. B4: Store these variables in a data file in chronological order to form an air quality prediction data set file.

4. The method for predicting air quality time series based on the improved TFT model according to claim 1, characterized in that: The step S3 of dividing the multivariate air quality prediction data set into different types of input steps is as follows: The input multivariate data is divided into three different types of inputs, namely static variables, historical observation variables, and future known variables. The sensor locations of the monitoring sites are input as static variables, the historical monitored air quality data, historical conditions, years, months, days, and seasons are input as historical observation variables, and the future years, months, days, seasons, and forecasts are input as future known variables.

5. The method for predicting air quality time series based on the improved TFT model according to claim 1, characterized in that: The method for constructing the air quality health index system in step S4 is: Build an equipment health status indicator system, and build a tree-like hierarchical structure diagram of each indicator for different air quality levels by consulting materials and professional evaluation; Design a questionnaire, invite professionals to evaluate the indicators, and compare the importance of each pollutant indicator; The index weights are calculated using the interval analytic hierarchy process, the importance matrix is ​​constructed, the matrix eigenvalues ​​are calculated using the power method, and the combined weights of the indicators are calculated.

6. The method for predicting air quality time series based on the improved TFT model according to claim 1, characterized in that: The steps of constructing and training the improved time fusion Transformer model in step S5 are as follows: C1: Improve the time series processing method in the TFT model to stabilize the time series variables during and after variable selection. Among them, S is the length of the time series, is the mean of a single variable, is the variance of a single variable, and is the variable after the stabilization operation. After the stabilization process, the distribution differences between the time series of each input are reduced, making the input distribution more stable. C2: Improve the attention mechanism algorithm in the TFT model and replace it with a destabilized attention mechanism to approximate the unstabilized attention, so that specific temporal correlations can be discovered from the original unstabilized data. C3: Improve the output method in the TFT model and perform destabilization before output. Where is the predicted result, is the mean, and is the standard deviation. This design allows the model to change the time series such as translation and scaling disturbances, which is beneficial to the prediction of time series such as air quality. C4: The air quality prediction dataset is divided into three parts according to the ratio of 7:2:1, namely the training set, the validation set and the test set. C5: Train the model. After training, compare the predicted value with the known result and tune the hyperparameters by jointly minimizing the quantile loss. The specific calculation steps for the quantile regression loss function are as follows: C51: Calculate the loss of each variable in the air quality data C52: The quantile loss formula is: C53: Formula for summing the losses of all samples:

7. The method for predicting air quality time series based on the improved TFT model according to claim 1, characterized in that: In step S6, prediction is performed using the validation set and compared with the results in the validation set to evaluate the prediction ability of the model, and then the future air quality data is predicted through the trained air quality prediction model to provide future air quality prediction information for management decision makers. The trained model is used to predict the air pollutant indicators for the next week, and the prediction results are compared with the specified air pollution threshold. If an indicator exceeds the threshold, it means that the air quality has reached a specific pollution level, and an early warning is issued.