CN114626567A - A Prediction Method of Air Quality Index - Google Patents
A Prediction Method of Air Quality Index Download PDFInfo
- Publication number
- CN114626567A CN114626567A CN202011433625.9A CN202011433625A CN114626567A CN 114626567 A CN114626567 A CN 114626567A CN 202011433625 A CN202011433625 A CN 202011433625A CN 114626567 A CN114626567 A CN 114626567A
- Authority
- CN
- China
- Prior art keywords
- quality index
- air quality
- data
- prediction model
- air
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q10/00—Administration; Management
- G06Q10/04—Forecasting or optimisation specially adapted for administrative or management purposes, e.g. linear programming or "cutting stock problem"
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/04—Architecture, e.g. interconnection topology
- G06N3/044—Recurrent networks, e.g. Hopfield networks
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/04—Architecture, e.g. interconnection topology
- G06N3/045—Combinations of networks
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q10/00—Administration; Management
- G06Q10/06—Resources, workflows, human or project management; Enterprise or organisation planning; Enterprise or organisation modelling
- G06Q10/067—Enterprise or organisation modelling
Landscapes
- Engineering & Computer Science (AREA)
- Business, Economics & Management (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- Strategic Management (AREA)
- Human Resources & Organizations (AREA)
- General Physics & Mathematics (AREA)
- Economics (AREA)
- Entrepreneurship & Innovation (AREA)
- Data Mining & Analysis (AREA)
- Artificial Intelligence (AREA)
- Molecular Biology (AREA)
- Computing Systems (AREA)
- General Engineering & Computer Science (AREA)
- Evolutionary Computation (AREA)
- Mathematical Physics (AREA)
- Software Systems (AREA)
- Computational Linguistics (AREA)
- Biophysics (AREA)
- Biomedical Technology (AREA)
- General Health & Medical Sciences (AREA)
- Development Economics (AREA)
- Life Sciences & Earth Sciences (AREA)
- General Business, Economics & Management (AREA)
- Health & Medical Sciences (AREA)
- Game Theory and Decision Science (AREA)
- Marketing (AREA)
- Operations Research (AREA)
- Quality & Reliability (AREA)
- Tourism & Hospitality (AREA)
- Educational Administration (AREA)
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
Abstract
Description
技术领域technical field
本发明涉及空气污染预测技术领域,尤其涉及一种空气质量指数的预测方法。The invention relates to the technical field of air pollution prediction, in particular to a prediction method of air quality index.
背景技术Background technique
空气质量指数(Air Quality Index,简称AQI),是一个用来定量描述空气质量水平的数值。大气污染能够通过空气质量指数很直接的表现出来,大气污染有地域性和时间性两方面的因素影响,通常来讲就是具有时空性质。The Air Quality Index (AQI) is a numerical value used to quantitatively describe the level of air quality. Air pollution can be directly expressed through the air quality index. Air pollution is affected by both regional and temporal factors, and generally speaking, it has a temporal and spatial nature.
现有的大气污染物的预测技术只针对时间特征和空间特征,没有同时考虑两方面的影响。使用时间特征是一种传统的、利用空气质量指数这种对时间敏感数据的特性,预测空气质量指数,但是现有的模型对时间序列的处理已经到达了瓶颈阶段,无法进一步提升预测准确率。Existing forecasting techniques for atmospheric pollutants only focus on temporal and spatial characteristics, and do not consider the effects of both. The use of time features is a traditional method that uses the time-sensitive data characteristics of air quality index to predict air quality index. However, the processing of time series by existing models has reached the bottleneck stage, and the prediction accuracy cannot be further improved.
只使用空间特征,是考虑当前站点和其他站点的相互影响,而忽略了大气数据的时序性,而且现阶段的空间特征的使用往往只局限于邻居节点的学习,而没有像人学习思维一样,有学习注意力的特性,让模型学得邻居节点的权值。Only using spatial features is to consider the interaction between the current site and other sites, while ignoring the time series of atmospheric data, and the use of spatial features at this stage is often limited to the learning of neighbor nodes, rather than learning thinking like humans. It has the feature of learning attention, allowing the model to learn the weights of neighbor nodes.
发明内容SUMMARY OF THE INVENTION
本发明提出一种空气质量指数的预测方法,以解决现有的预测方法的准确率不高的问题。The invention proposes a prediction method of air quality index to solve the problem of low accuracy of the existing prediction method.
本发明解决上述问题的技术方案是:一种空气质量指数的预测方法,包括以下步骤:The technical scheme of the present invention to solve the above problem is: a prediction method of air quality index, comprising the following steps:
构造网络数据,其中,所述网络数据包括空气监测站点之间的邻接矩阵和各个空气监测站点的特征矩阵;Construct network data, wherein the network data includes an adjacency matrix between air monitoring sites and a feature matrix of each air monitoring site;
构建空气质量指数预测模型,所述空气质量指数预测模型包括基于注意力的图卷积网络和长短期记忆神经网络;constructing an air quality index prediction model, the air quality index prediction model including an attention-based graph convolutional network and a long short-term memory neural network;
训练空气质量指数预测模型Training an Air Quality Index Prediction Model
将所述网络数据输入至空气质量指数预测模型,基于损失函数对所述空气质量指数预测模型中进行训练,直至所述空气质量指数预测模型收敛;inputting the network data into the air quality index prediction model, and training the air quality index prediction model based on the loss function until the air quality index prediction model converges;
利用训练好的空气质量指数预测模型对空气质量指数进行预测。The air quality index is predicted using the trained air quality index prediction model.
优选的是,所述构造网络数据的步骤具体包括:Preferably, the step of constructing network data specifically includes:
获取多个空气监测站点的大气历史数据以及各个空气监测站点之间的距离,其中所述大气历史数据包括各项污染物空气质量分指数的历史数据和气象历史数据;Obtain atmospheric historical data of multiple air monitoring sites and the distance between each air monitoring site, wherein the atmospheric historical data includes historical data of air quality sub-indexes of various pollutants and historical meteorological data;
根据各个空气监测站点之间的距离构造空气监测站点之间的邻接矩阵;Construct an adjacency matrix between air monitoring stations according to the distance between each air monitoring station;
对大气历史数据进行预处理得到各个空气监测站点的特征矩阵;The characteristic matrix of each air monitoring station is obtained by preprocessing the atmospheric historical data;
将所述大气历史数据划分为训练集、验证集和测试集。The atmospheric historical data is divided into training set, validation set and test set.
优选的是,预处理方法包括均值填充空值,去除异常数据,平滑数据。Preferably, the preprocessing method includes mean filling null values, removing abnormal data, and smoothing data.
优选的是,所述训练集、验证集和测试集的占比分别为70%、15%和15%。Preferably, the proportions of the training set, validation set and test set are 70%, 15% and 15% respectively.
优选的是,所述根据各个空气监测站点之间的距离构造空气监测站点之间的邻接矩阵的步骤包括:设置阈值k=1500km,大于k的为0,小于k的设置为1来构造邻接矩阵。Preferably, the step of constructing an adjacency matrix between the air monitoring stations according to the distances between the air monitoring stations includes: setting a threshold value k=1500km, setting a threshold value greater than k to 0, and setting a value less than k to 1 to construct an adjacency matrix .
优选的是,所述训练训练空气质量指数预测模型具体包括:Preferably, the training training air quality index prediction model specifically includes:
将空气监测站点之间的邻接矩阵和训练集的特征矩阵输入至基于注意力的图卷积网络中,得到大气特征矩阵;Input the adjacency matrix between air monitoring stations and the feature matrix of the training set into the attention-based graph convolution network to obtain the atmospheric feature matrix;
采用多步多变量法重构大气特征矩阵,得到构造后的大气特征数据;The atmospheric characteristic matrix is reconstructed by the multi-step multivariate method, and the constructed atmospheric characteristic data is obtained;
将构造后的大气特征数据输入至长短期记忆神经网络层进行训练;Input the constructed atmospheric feature data into the long short-term memory neural network layer for training;
设计损失函数;Design loss function;
基于损失函数对所述空气质量指数预测模型中进行训练,直至模型收敛。The air quality index prediction model is trained based on the loss function until the model converges.
优选的是,所述损失函数表示为Preferably, the loss function is expressed as
其中,Oi为第i条大气特征数据的真实值,Pi为第i条大气特征数据的预测值,N为总的数据个数。Among them, O i is the actual value of the i-th atmospheric characteristic data, P i is the predicted value of the i-th atmospheric characteristic data, and N is the total number of data.
优选的是,所述利用训练好的空气质量指数预测模型对空气质量指数进行预测的步骤具体包括将测试集输入至训练好的空气质量指数预测模型得到空气质量指数。Preferably, the step of using the trained air quality index prediction model to predict the air quality index specifically includes inputting the test set into the trained air quality index prediction model to obtain the air quality index.
相比于现有技术,本发明的有益效果在于:本发明的预测模型包括基于注意力机制的图卷积网络和长短期记忆网络,使用图注意力卷积网络层用于各个监测站点空间特征的提取,使用长短期记忆网络层对各个站点的时间特征进行处理,构建融合两种网络层的端到端的网络模型,将两种数据特征融合训练,不仅能够为模型预测提供更加丰富的特征信息,能够提高模型的泛化能力,最终使得当前站点的预测准确率大大提高。本发明为了将两个神经网络层数据流通,设计了中间层数据组合方式,使各个模型层可以梯度传播。Compared with the prior art, the beneficial effects of the present invention are: the prediction model of the present invention includes a graph convolution network and a long short-term memory network based on an attention mechanism, and a graph attention convolution network layer is used for the spatial characteristics of each monitoring site. It uses the long short-term memory network layer to process the temporal features of each site, builds an end-to-end network model that integrates the two network layers, and integrates the two data features for training, which can not only provide more abundant feature information for model prediction , which can improve the generalization ability of the model, and ultimately greatly improve the prediction accuracy of the current site. In order to circulate the data of the two neural network layers, the present invention designs a data combination mode of the middle layer, so that each model layer can be propagated by gradient.
附图说明Description of drawings
图1为本发明预测方法的流程示意图。FIG. 1 is a schematic flowchart of the prediction method of the present invention.
图2为空气质量指数预测模型的结构示意图。Figure 2 is a schematic diagram of the structure of the air quality index prediction model.
具体实施方式Detailed ways
为使本发明实施方式的目的、技术方案和优点更加清楚,下面将结合本发明实施方式中的附图,对本发明实施方式中的技术方案进行清楚、完整地描述,显然,所描述的实施方式是本发明一部分实施方式,而不是全部的实施方式。基于本发明中的实施方式,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施方式,都属于本发明保护的范围。因此,以下对在附图中提供的本发明的实施方式的详细描述并非旨在限制要求保护的本发明的范围,而是仅仅表示本发明的选定实施方式。In order to make the purposes, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments These are some embodiments of the present invention, but not all of them. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention. Accordingly, the following detailed description of the embodiments of the invention provided in the accompanying drawings is not intended to limit the scope of the invention as claimed, but is merely representative of selected embodiments of the invention.
实施例1:如图1所示的一种空气质量指数的预测方法,具体步骤包括:Embodiment 1: a prediction method of air quality index as shown in Figure 1, the specific steps include:
S1:构造网络数据S1: Construct network data
根据站点(空气监测站点)的经纬度计算各个站点的欧式距离,设置阈值k=1500km,构造站点之间的邻接矩阵A,大于k的为0,小于k的设置为1。Calculate the Euclidean distance of each station according to the longitude and latitude of the station (air monitoring station), set the threshold k=1500km, and construct the adjacency matrix A between the stations.
对每个站点的大气历史数据进行预处理,包括使用均值填充空值,去除异常数据,平滑数据等,得到各个站点的特征矩阵X。The atmospheric historical data of each station is preprocessed, including filling empty values with the mean, removing abnormal data, smoothing data, etc., to obtain the characteristic matrix X of each station.
将站点大气历史数据划分为训练集、验证集和测试集。Divide the site atmospheric historical data into training set, validation set and test set.
S2:构建空气质量指数预测模型(GA-LSTM),输入S1提供的数据,经过网络模型训练,得到训练好的模型。S2: Build an air quality index prediction model (GA-LSTM), input the data provided by S1, and get the trained model after network model training.
S21:分别将站点邻接矩阵A和训练集的大气特征矩阵X放入注意力的图卷积网络中进行前向传播,通过站点邻接矩阵关系,学习相邻站点的特性,修正特征数据,得到大气特征矩阵相当于利用站点的空间信息。计算公式如下S21: Put the site adjacency matrix A and the atmospheric feature matrix X of the training set into the attention graph convolution network for forward propagation, learn the characteristics of the neighboring sites through the site adjacency matrix relationship, correct the feature data, and obtain the atmosphere The feature matrix is equivalent to utilizing the spatial information of the site. Calculated as follows
其中:i为当前节点,j为当前计算的相邻的节点,αij k为k个注意力机制计算后的线性化注意力相关值,Wk为权重矩阵,K为多个头的图注意力层,σ为非线性层。Where: i is the current node, j is the currently calculated adjacent node, α ij k is the linearized attention correlation value calculated by k attention mechanisms, W k is the weight matrix, and K is the graph attention of multiple heads layer, σ is the nonlinear layer.
S22:将大气特征矩阵,根据长短期记忆神经网络层的特性,使用多步多变量的方法,按照利用多天多元特征预测未来几天的形式,重新构造数据矩阵得到构造后的大气特征数据,由此构成长短期记忆网络特性的数据格式。S22: According to the characteristics of the long-term and short-term memory neural network layer, the atmospheric characteristic matrix is reconstructed according to the multi-step multi-variable method, and the data matrix is reconstructed to obtain the constructed atmospheric characteristic data in the form of using multi-day multi-characteristics to predict the next few days. This constitutes the data format of the long short-term memory network characteristics.
多步多变量的方法:利用前n天的大气数据的空气质量指数构成一条训练数据的特征,n+t天的空气质量指标值构成当前训练数据的标记。例如:用1月1日-14日的大气数据和空气质量指数作为特征,预测1月15日-21日的空气质量指数,即利用前14天数据预测未来7天目标数据。Multi-step multi-variable method: The air quality index of the previous n days of atmospheric data is used to form the characteristics of a training data, and the air quality index value of n+t days constitutes the current training data mark. For example, using the air data and air quality index from January 1st to 14th as features to predict the air quality index from January 15th to 21st, that is, using the data of the previous 14 days to predict the target data of the next 7 days.
S23:将构造后的大气特征数据放入长短期记忆网络中进行训练,学习数据的时间特性,使用长短期记忆神经网络的基本结构。S23: Put the constructed atmospheric characteristic data into the long-term and short-term memory network for training, learn the time characteristics of the data, and use the basic structure of the long-term and short-term memory neural network.
S24:根据预测的值与真实值之间的差距,使用均方损失方法计算损失loss。S24: Calculate the loss using the mean square loss method according to the difference between the predicted value and the real value.
其中:Oi为第i条大气特征数据的真实值,Pi为第i条大气特征数据的预测值,N为总的数据个数。Among them: O i is the actual value of the i-th atmospheric characteristic data, P i is the predicted value of the i-th atmospheric characteristic data, and N is the total number of data.
S3:根据前向传播的结果进行反向传播。S3: Backpropagation is performed according to the result of forward propagation.
根据Loss进行网络的反向传播,计算梯度更新模型中所有可学习的模型参数;Perform backpropagation of the network according to Loss, and calculate all learnable model parameters in the gradient update model;
S2和S3过程不断迭代交替进行,直到模型收敛,即得到了训练好的空气质量指数预测模型。The S2 and S3 processes are iteratively and alternately performed until the model converges, that is, the trained air quality index prediction model is obtained.
S4:使用训练好的模型对未标记节点进行空气质量指数预测。S4: Use the trained model to predict the air quality index for unlabeled nodes.
以上所述仅为本发明的实施例,并非以此限制本发明的保护范围,凡是利用本发明说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其他相关的系统领域,均同理包括在本发明的保护范围内。The above descriptions are only the embodiments of the present invention, and are not intended to limit the protection scope of the present invention. Any equivalent structure or equivalent process transformation made by using the contents of the description and drawings of the present invention, or directly or indirectly applied to other related The system field is similarly included in the protection scope of the present invention.
Claims (8)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202011433625.9A CN114626567A (en) | 2020-12-10 | 2020-12-10 | A Prediction Method of Air Quality Index |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202011433625.9A CN114626567A (en) | 2020-12-10 | 2020-12-10 | A Prediction Method of Air Quality Index |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| CN114626567A true CN114626567A (en) | 2022-06-14 |
Family
ID=81895493
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202011433625.9A Pending CN114626567A (en) | 2020-12-10 | 2020-12-10 | A Prediction Method of Air Quality Index |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN114626567A (en) |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN120105216A (en) * | 2025-05-12 | 2025-06-06 | 中电信数字城市科技有限公司 | Air quality prediction model training method, air quality prediction method and system |
-
2020
- 2020-12-10 CN CN202011433625.9A patent/CN114626567A/en active Pending
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN120105216A (en) * | 2025-05-12 | 2025-06-06 | 中电信数字城市科技有限公司 | Air quality prediction model training method, air quality prediction method and system |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN115376317B (en) | A Traffic Flow Prediction Method Based on Dynamic Graph Convolution and Temporal Convolutional Network | |
| CN118132964B (en) | Soil space temperature and humidity prediction method, device, equipment, medium and program product | |
| CN108009674A (en) | Air PM2.5 concentration prediction methods based on CNN and LSTM fused neural networks | |
| CN112418547A (en) | A bus stop passenger flow prediction method based on GCN-LSTM combined model | |
| CN112651665A (en) | Surface water quality index prediction method and device based on graph neural network | |
| CN107909206B (en) | PM2.5 prediction method based on deep structure recurrent neural network | |
| CN115860286B (en) | Air quality prediction method and system based on time sequence gate mechanism | |
| CN107688871A (en) | A kind of water quality prediction method and device | |
| CN107766995A (en) | Power-system short-term load forecasting method based on depth recurrent neural network | |
| CN113516304B (en) | Regional pollutant space-time joint prediction method and device based on space-time diagram network | |
| CN118072873B (en) | A method for predicting air quality | |
| CN114266384B (en) | A method and device for quickly predicting typhoon paths based on fusion model | |
| CN114694767B (en) | PM2.5 concentration prediction method based on space-time diagram ordinary differential equation network | |
| CN111047078B (en) | Traffic characteristic prediction method, system and storage medium | |
| CN119830139B (en) | Global and local Koopman PM2.5 prediction method and system | |
| Li et al. | Residual neural network with spatiotemporal attention integrated with temporal self-attention based on long short-term memory network for air pollutant concentration prediction | |
| CN113743594A (en) | Network flow prediction model establishing method and device, electronic equipment and storage medium | |
| CN119765252A (en) | New energy photovoltaic power station power generation prediction method and system | |
| CN114565136A (en) | A Generative Adversarial Network-Based Optimization Method for Air Quality Prediction | |
| Chen et al. | A spatial transfer-based hybrid model for wind speed forecasting | |
| CN116960962A (en) | A mid- and long-term regional load forecasting method based on cross-regional data fusion | |
| CN114626567A (en) | A Prediction Method of Air Quality Index | |
| CN114997506B (en) | Atmospheric pollution propagation path prediction method based on link prediction | |
| CN113469331B (en) | Vehicle exhaust gas prediction method and system based on global and local spatiotemporal graph convolution | |
| CN120105884A (en) | A photovoltaic theoretical power generation prediction method, system and terminal |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination |