An air quality inference method based on unsupervised learning
Through an air quality inference method based on unsupervised learning, combining multiple data sources and multi-module models, the problem of obtaining fine-grained air quality information in the prior art is solved, and the prediction accuracy and interpretability of the model are improved.
Patent Information
- Application Number
- CN202410799433.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-20
- Publication Date
- 2025-02-28
- Estimated Expiration
- 2044-06-20
AI Technical Summary
The prior art is difficult to effectively obtain fine-grained air quality information. Standard station data is accurate but costly, micro station data is not accurate and susceptible to local disturbances, and cannot handle category-type characteristics.
Using an air quality inference method based on unsupervised learning, fine-grained air quality data is obtained through regional rasterization, combined with standard stations, micro stations, meteorological, transportation and geographical data, a multi-module model is designed for feature extraction and inference, including category feature encoding, location encoding, spatial interpolation, feature encoding and decoding modules, and the feature importance is calculated through gradients.
The prediction accuracy of the air quality model is improved, the importance of micro-site trend data is explored, and it is suitable for the selection and importance calculation of category characteristics, which enhances the model's inference ability and interpretability.
Smart Images

Figure 00000000_0000_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to environmental engineering, and in particular relates to an air quality inference method based on unsupervised learning. Background Art
[0002] As the harm of air pollution to human health is gradually revealed, the public's requirements for air quality have increased significantly. This change has stimulated unprecedented attention from academia and industry around the world to fine-grained air quality information. However, although standard stations can provide accurate air quality data, the high construction and maintenance costs limit their widespread deployment, posing challenges to obtaining fine-grained air quality information. Although low-cost micro-stations can be deployed in multiple locations in the city to improve monitoring coverage, their data accuracy is not high and is easily affected by local disturbances. In addition, it is crucial for environmental departments to accurately identify key features that are closely related to air quality and take preventive measures accordingly. Although existing feature selection and importance calculation techniques perform well in processing continuous features, they cannot process categorical features. Summary of the invention
[0003] In view of the above problems, the present invention provides an air quality inference method based on unsupervised learning.
[0004] An air quality inference method based on unsupervised learning of the present invention comprises the following steps:
[0005] Step 1: Acquisition and preprocessing of research data.
[0006] (1) Regional gridding: In order to obtain fine-grained air quality data, the study area is divided into square grids of 500m*500m.
[0007] (2) Air quality data: Hourly pollutant concentration data are obtained through sensors at standard stations and micro stations, with standard station data used as labels. For micro station data, local weighted regression and seasonal trend decomposition (STL) are used for analysis.
[0008] STL decomposes the time series data into three components: trend, seasonality, and residual, and selects the trend data of microstations as features of the prediction model.
[0009] (3) Meteorological data: Seven types of key meteorological data are collected from sensors at meteorological stations as characteristic variables for analyzing pollutant concentrations. These meteorological data include boundary layer height, temperature, relative humidity, air pressure, wind speed, wind direction, and solar radiation intensity.
[0010] (4) Traffic data: Based on the data collected by the slag truck sensors and the Amap congestion index, three traffic-related features are designed for air quality inference: the adjacency matrix A derived from the slag truck operation mode OD , grid congestion index X based on road congestion data CI And the earthwork volume of the slag truck X VO .
[0011] Adjacency Matrix A OD = A(i, j) is defined as: if the continuous trajectory points of the same slag truck are from a certain grid r i Transfer to its neighbor grid r j , then the two grids are considered to be adjacent, A(i, j) = 1, otherwise, A(i, j) = 0.
[0012] Grid Congestion Index X CI is defined as:
[0013]
[0014] in, The grid r at timestamp t i The congestion index, c t,j is the congestion index of road section j at the same time, l j,i For the grid r i The length of inner segment j.
[0015] Earthwork volume of slag truck X VO is defined as: the number of slag trucks in a grid within a specified time window.
[0016] (5) Geographic data: Based on the geographic data obtained from Openstreetmap and Amap, two related features are designed: regional usage and functional feature X. GE and the semantic adjacency matrix A SE .
[0017] Regional use and functional characteristicsX GE : By the interest point feature X POI , Land use characteristics X LU and road length characteristic X RL It consists of three parts.
[0018] Semantic adjacency matrix A SE : Based on X GE , use K-maens to cluster the grid, so A SE is defined as:
[0019]
[0020] Step 2: Build an air quality inference model.
[0021] The air quality inference task is divided into two subtasks: supervised learning and unsupervised learning tasks. In this framework, the unsupervised learning task is dedicated to feature extraction, while the supervised learning task is responsible for performing the core inference process. The model contains 5 core modules.
[0022] (1) Categorical feature encoding: Unlike continuous features, the numerical value of categorical features does not represent a specific value, so it must be mapped before it is formally entered into the model.
[0023] (2) Position encoding module: Considering the correlation between pollutant concentration and spatial location, position encoding is used to enhance the spatial perception ability of the model; position encoding consists of two parts, namely row encoding RE and column encoding CE.
[0024]
[0025] Where pos is the position, d p For dimension.
[0026] (3) Spatial interpolation module: The self-supervised learning task is constructed as a regression inference task that corresponds to the supervised learning task. Specifically, the inverse distance weighted (IDW) is used to spatially interpolate the pollutant concentration, and the interpolation result is used as the label of the self-supervised learning task. The calculation formula of IDW is:
[0027]
[0028] Among them, X g , X c The grid r g 、r c The interpolation result, d gc For the grid r g With r c The great circle distance between them, k is a constant; φ g and λ g Represents the grid r g The longitude and latitude of c and λ c Represents the grid r c longitude and latitude.
[0029] (4) Feature encoding module: It consists of a temporal block based on a bidirectional long short-term memory neural network and two spatial blocks based on a graph attention neural network. In the feature encoding module, the supervised learning task and the self-supervised learning task share parameters.
[0030] (5) Feature decoding module: For supervised learning tasks, a spatial block based on the graph attention mechanism is used, while for self-supervised learning tasks, a fully connected neural network layer is used.
[0031] Step 3: Design the loss function.
[0032] In order to achieve continuous and categorical feature selection, gradient-based regularization is incorporated into the loss function; the loss function is:
[0033]
[0034] Among them, θ * , Θ * , is the parameter learned by the model; α sup and α ss is the loss weight for supervised learning and self-supervised learning tasks, which affects their effects in the training process; β and γ are regularization coefficients for feature selection; U and V are the number of continuous and categorical features, respectively; k j is the embedding dimension corresponding to the jth categorical feature; is the quantized training dataset Y train The true value y n and inferred values function of the difference between .
[0035] Step 4: Calculate feature importance based on gradients to complete air quality inference.
[0036] Gradients guide the update of weights in neural networks. The larger the gradient value of a feature, the more important it is. Considering that categorical features need to be encoded before entering the feature encoding module, different methods are designed to determine the importance of continuous features and categorical features. The formula is as follows:
[0037]
[0038] Among them, p num,i and p cat,j are the importance of the i-th continuous feature and the j-th categorical feature, respectively.
[0039] The beneficial technical effects of the present invention are:
[0040] (1) The present invention cleverly utilizes unlabeled data through an unsupervised learning framework, thereby improving the prediction accuracy of the model.
[0041] (2) The present invention mines the trend data of microstations and proves that the trend data of microstations is a very critical feature, illustrating the practical value of ubiquitous sensing technology with low data quality in high-precision air quality inference.
[0042] (3) Based on the continuous feature selection and importance calculation methods, the present invention proposes a method suitable for categorical features, which further improves the inference ability and interpretability of the model. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] Figure 1 Schematic diagram of the air quality inference model structure of the present invention. DETAILED DESCRIPTION
[0044] The present invention is further described in detail below in conjunction with the accompanying drawings and specific implementation methods.
[0045] An air quality inference method based on unsupervised learning of the present invention comprises the following steps:
[0046] Step 1: Acquisition and preprocessing of research data.
[0047] (1) Regional gridding: In order to obtain fine-grained air quality data, the study area is divided into square grids of 500m*500m.
[0048] (2) Air quality data: Hourly pollutant concentration data are obtained through sensors at standard stations and micro stations. Given the high reliability of standard station data, standard station data are used as labels. For micro station data, local weighted regression and seasonal trend decomposition (STL) are used for analysis.
[0049] STL decomposes time series data into three components: trend, seasonality, and residual. Through comparative analysis, it is found that the trend data of micro-stations and standard stations are highly similar, which verifies the reliability of micro-station trend data. Therefore, the trend data of micro-stations is selected as the feature of the prediction model.
[0050] In addition, considering the interactions between different pollutants, such as the mutual conversion between nitrogen dioxide (NO2) and ozone (O3) under specific atmospheric conditions, we also include other pollutants with a high correlation with it into the characteristics when inferring the concentration of a specific pollutant.
[0051] (3) Meteorological data: In view of the significant impact of meteorological conditions on pollutant concentrations, seven types of key meteorological data are collected from sensors at meteorological stations as characteristic variables for analyzing pollutant concentrations. These meteorological data include boundary layer height, temperature, relative humidity, air pressure, wind speed, wind direction, and solar radiation intensity.
[0052] (4) Traffic data: Traffic has been identified as an important source of air pollutants. Therefore, based on the data collected by the slag truck sensors and the Amap congestion index, three traffic-related features are designed for air quality inference: the adjacency matrix A derived from the slag truck operation mode OD, grid congestion index X based on road congestion data CI And the earthwork volume of the slag truck X VO .
[0053] Adjacency Matrix A OD = A(i, j) is defined as: if the continuous trajectory points of the same slag truck are from a certain grid r i Transfer to its neighbor grid r j , then the two grids are considered to be adjacent, A(i, j) = 1, otherwise, A(i, j) = 0.
[0054] Grid Congestion Index X a is defined as:
[0055]
[0056] in, The grid r at timestamp t i The congestion index, c t,j is the congestion index of road section j at the same time, l j,i For the grid r i The length of inner segment j.
[0057] Earthwork volume of slag truck X VO is defined as: the number of slag trucks in a grid within a specified time window.
[0058] (5) Geographic data: Based on the geographic data obtained from Openstreetmap and Amap, two related features are designed: regional usage and functional feature X. GE and the semantic adjacency matrix A SE .
[0059] Regional use and functional characteristicsX GE : By the interest point feature X POI , Land use characteristics X LU and road length characteristic X RL It consists of three parts.
[0060] Semantic adjacency matrix A SE : Grids with similar geographical features tend to show comparable pollutant concentrations. For example, grids with a similar number of factories may have comparable nitrogen dioxide concentrations. Considering this problem, a semantic adjacency matrix A is designed. SE Specifically, based on X GE , use K-maens to cluster the grid, so A SE is defined as:
[0061]
[0062] Step 2: Build an air quality inference model.
[0063] Due to the limited label data, the present invention divides the air quality inference task into two subtasks: supervised learning and unsupervised learning tasks. In this framework, the unsupervised learning task is dedicated to feature extraction, while the supervised learning task is responsible for performing the core inference process. The model contains 5 core modules, such as Figure 1 shown.
[0064] (1) Categorical feature encoding: Unlike continuous features, the numerical value of categorical features does not represent a specific value, so it must be mapped before it is formally entered into the model.
[0065] (2) Position encoding module: Considering the correlation between pollutant concentration and spatial location, position encoding is used to enhance the spatial perception ability of the model; position encoding consists of two parts, namely row encoding RE and column encoding CE.
[0066]
[0067] Where pos is the position, d p For dimension.
[0068] (3) Spatial interpolation module: The self-supervised learning task should be carefully designed. A self-supervised learning task related to a supervised learning task may have a strong feature extraction capability, so the self-supervised learning task is constructed as a regression inference task corresponding to the supervised learning task; specifically, the inverse distance weighted IDW is used to spatially interpolate the pollutant concentration, and the interpolation result is used as the label of the self-supervised learning task. The calculation formula of IDW is:
[0069]
[0070] Among them, X g , X c The grid r g 、r c The interpolation result, d gc For the grid r g With r c The great circle distance between them, k is a constant; φ g and λ g Represents the grid r g The longitude and latitude of c and λ c Represents the grid r c longitude and latitude.
[0071] (4) Feature encoding module: A spatiotemporal encoder module is designed as a feature encoder module to capture the complex and dynamic spatiotemporal dependencies of pollutant concentrations. This module consists of a temporal block based on a bidirectional long short-term memory neural network and two spatial blocks based on a graph attention neural network. In the feature encoding module, the supervised learning task and the self-supervised learning task share parameters, which promotes information sharing between tasks and effectively improves the accuracy of air quality inference.
[0072] (5) Feature decoding module: Different feature decoding modules are customized for different subtasks. For supervised learning tasks, spatial blocks based on graph attention mechanism are used, while for self-supervised learning tasks, fully connected neural network layers are used.
[0073] Step 3: Design the loss function.
[0074] In order to achieve continuous and categorical feature selection, gradient-based regularization is incorporated into the loss function; the loss function is:
[0075]
[0076] Among them, θ * , Θ * , is the parameter learned by the model; α sup and α ss is the loss weight for supervised learning and self-supervised learning tasks, which affects their effects in the training process; β and γ are regularization coefficients for feature selection; U and V are the number of continuous and categorical features, respectively; k j is the embedding dimension corresponding to the jth categorical feature; is the quantized training dataset Y train The true value y n and inferred values function of the difference between .
[0077] Step 4: Calculate feature importance based on gradients to complete air quality inference.
[0078] In order to find the key features, the feature importance is calculated based on the gradient. The gradient guides the weight update in the neural network. The larger the gradient value of a feature, the higher its importance. Considering that categorical features need to be encoded before entering the feature encoding module, different methods are designed to determine the importance of continuous features and categorical features. The formula is as follows:
[0079]
[0080] Among them, p num,i and p cat,j are the importance of the i-th continuous feature and the j-th categorical feature, respectively.
Claims
1. An air quality inference method based on unsupervised learning, characterized in that: The following steps are involved: Step 1: Acquisition and preprocessing of research data; (1) Regional gridding: In order to obtain fine-grained air quality data, the study area is divided into square grids of 500m*500m; (2) Air quality data: Hourly pollutant concentration data are obtained through sensors at standard stations and micro stations, with standard station data used as labels; for micro station data, local weighted regression and seasonal trend decomposition (STL) are used for analysis; STL decomposes the time series data into three components: trend, seasonality, and residual, and selects the trend data of micro-stations as features of the prediction model; (3) Meteorological data: Seven types of key meteorological data are collected from sensors at meteorological stations as characteristic variables for analyzing pollutant concentrations. These meteorological data include boundary layer height, temperature, relative humidity, air pressure, wind speed, wind direction, and solar radiation intensity; (4) Traffic data: Based on the data collected by the slag truck sensors and the Amap congestion index, three traffic-related features are designed for air quality inference: the adjacency matrix A derived from the slag truck operation mode OD , grid congestion index X based on road congestion data CI And the earthwork volume of the slag truck X VO ; Adjacency Matrix A OD =A(i,j) is defined as: if the continuous trajectory points of the same slag truck are from a certain grid r i Transfer to its neighbor grid r j , then the two grids are considered adjacent, A(i, j) = 1, otherwise, A(i, j) = 0; Grid Congestion Index X CI is defined as: in, The grid r at timestamp t i The congestion index, c t,j is the congestion index of road section j at the same time, l j,i For the grid r i The length of inner segment j; Earthwork volume of slag truck X VO is defined as: the number of slag trucks in a grid within a specified time window; (5) Geographic data: Based on the geographic data obtained from Openstreetmap and Amap, two related features are designed: regional usage and functional feature X. GE and the semantic adjacency matrix A SE ; Area use and functional characteristicsX GE : By the interest point feature X POI , Land use characteristics X LU and road length characteristic X RL It consists of three parts; Semantic adjacency matrix A SE : Based on X GE , use K-maens to cluster the grid, so A SE is defined as: Step 2: Establish an air quality inference model; The air quality inference task is divided into two subtasks: supervised learning and unsupervised learning tasks. In this framework, the unsupervised learning task is dedicated to feature extraction, while the supervised learning task is responsible for performing the core inference process. The model contains 5 core modules: (1) Categorical feature encoding: Unlike continuous features, the numerical representation of categorical features is not a specific value, so they must be mapped before they are formally input into the model; (2) Position encoding module: Considering the correlation between pollutant concentration and spatial location, position encoding is used to enhance the spatial perception ability of the model; position encoding consists of two parts, namely row encoding RE and column encoding CE; Where pos is the position, d p for dimension; (3) Spatial interpolation module: The self-supervised learning task is constructed as a regression inference task that corresponds to the supervised learning task. Specifically, the inverse distance weighted (IDW) is used to spatially interpolate the pollutant concentration, and the interpolation result is used as the label of the self-supervised learning task. The calculation formula of IDW is: Among them, X g , X c The grid r g 、r c The interpolation result, d gc For the grid r g With r c The great circle distance between them, k is a constant; φ g and λ g Represents the grid r g The longitude and latitude of c and λ c Represents the grid r c longitude and latitude; (4) Feature encoding module: It consists of a temporal block based on a bidirectional long short-term memory neural network and two spatial blocks based on a graph attention neural network. In the feature encoding module, the supervised learning task and the self-supervised learning task share parameters. (5) Feature decoding module: For supervised learning tasks, a spatial block based on the graph attention mechanism is used, while for self-supervised learning tasks, a fully connected neural network layer is used; Step 3: Design loss function; In order to achieve continuous and categorical feature selection, gradient-based regularization is incorporated into the loss function; the loss function is: Among them, θ * , Θ * , is the parameter learned by the model; α sup and α ss is the loss weight for supervised learning and self-supervised learning tasks, which affects their effects in the training process; β and γ are regularization coefficients for feature selection; U and V are the number of continuous and categorical features, respectively; k j is the embedding dimension corresponding to the jth categorical feature; is the quantized training dataset Y train The true value y n and inferred values A function of the difference between Step 4: Calculate feature importance based on gradient to complete air quality inference; Gradients guide the update of weights in neural networks. The larger the gradient value of a feature, the more important it is. Considering that categorical features need to be encoded before entering the feature encoding module, different methods are designed to determine the importance of continuous features and categorical features. The formula is as follows: Among them, p num,i and p cat,j are the importance of the i-th continuous feature and the j-th categorical feature, respectively.
Citation Information
Patent Citations
Fine-grained air quality prediction method and system
CN114638417A
Urban particulate matter concentration space-time prediction method under semi-supervised learning
CN114997499A