CN111461410B - Air quality prediction method and device based on transfer learning - Google Patents

Air quality prediction method and device based on transfer learning Download PDF

Info

Publication number
CN111461410B
CN111461410B CN202010163503.6A CN202010163503A CN111461410B CN 111461410 B CN111461410 B CN 111461410B CN 202010163503 A CN202010163503 A CN 202010163503A CN 111461410 B CN111461410 B CN 111461410B
Authority
CN
China
Prior art keywords
data
area
region
air quality
model
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.)
Active
Application number
CN202010163503.6A
Other languages
Chinese (zh)
Other versions
CN111461410A (en
Inventor
刘亮
马华东
雷田子
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing University of Posts and Telecommunications
Original Assignee
Beijing University of Posts and Telecommunications
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Beijing University of Posts and Telecommunications filed Critical Beijing University of Posts and Telecommunications
Priority to CN202010163503.6A priority Critical patent/CN111461410B/en
Publication of CN111461410A publication Critical patent/CN111461410A/en
Application granted granted Critical
Publication of CN111461410B publication Critical patent/CN111461410B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION 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/00Administration; Management
    • G06Q10/04Forecasting or optimisation specially adapted for administrative or management purposes, e.g. linear programming or "cutting stock problem"
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/049Temporal neural networks, e.g. delay elements, oscillating neurons or pulsed inputs
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION 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
    • G06Q50/00Information and communication technology [ICT] specially adapted for implementation of business processes of specific business sectors, e.g. utilities or tourism
    • G06Q50/10Services
    • G06Q50/26Government or public services

Landscapes

  • Engineering & Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Health & Medical Sciences (AREA)
  • Strategic Management (AREA)
  • Human Resources & Organizations (AREA)
  • Economics (AREA)
  • Tourism & Hospitality (AREA)
  • General Health & Medical Sciences (AREA)
  • Software Systems (AREA)
  • Biomedical Technology (AREA)
  • General Engineering & Computer Science (AREA)
  • Molecular Biology (AREA)
  • Mathematical Physics (AREA)
  • Evolutionary Computation (AREA)
  • Data Mining & Analysis (AREA)
  • Computational Linguistics (AREA)
  • Development Economics (AREA)
  • General Business, Economics & Management (AREA)
  • Biophysics (AREA)
  • Computing Systems (AREA)
  • Artificial Intelligence (AREA)
  • Marketing (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Primary Health Care (AREA)
  • Educational Administration (AREA)
  • Game Theory and Decision Science (AREA)
  • Entrepreneurship & Innovation (AREA)
  • Operations Research (AREA)
  • Quality & Reliability (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The embodiment of the invention provides a method and a device for predicting air quality based on transfer learning, aiming at a plurality of first areas obtained by dividing a target city, obtaining influence data of the first areas in historical time; for each first area, obtaining air quality data of the first area at a target time based on the influence data of the first area and a prediction model corresponding to the first area in a plurality of pre-trained prediction models, and taking the obtained plurality of air quality data as the air quality data of a target city at the target time; the prediction model corresponding to any first region is obtained by training an initial model corresponding to the first region in a plurality of initial models obtained based on transfer learning by using historical air quality data of the first region and historical influence data corresponding to the historical air quality data of the first region. The invention can improve the prediction accuracy of the air quality.

Description

Air quality prediction method and device based on transfer learning
Technical Field
The invention relates to the technical field of artificial intelligence, in particular to a method and a device for predicting air quality based on transfer learning.
Background
In recent years, it has become indispensable to predict the air quality in the future in order to facilitate application scenarios such as life and production. For the target city of which the air quality at the target time needs to be predicted, historical air quality data of the target city can be used in advance to train to obtain a prediction model; and then obtaining the air quality data of the target city at the target time based on the influence data of the target city at the historical time with the specified time interval and the prediction model, thereby realizing the prediction of the air quality at the target time. Wherein the target time is a future time relative to the current time; the influence data is data capable of influencing air quality, such as weather and people flow of cities and the like.
In the related art, the historical air quality data may be data monitored by an air quality monitoring station. However, the high construction and maintenance costs of air quality monitoring stations make the number of air quality monitoring stations in a portion of a city relatively small. Accordingly, historical air quality data for the city is very limited. In addition, limited historical air quality data easily causes that parameters of a prediction model obtained by training are not accurate enough; which in turn results in an inaccurate prediction of the urban air quality.
Therefore, how to improve the prediction accuracy of the air quality under the condition that the historical air quality data is limited is an urgent problem to be solved.
Disclosure of Invention
The embodiment of the invention aims to provide a method for predicting air quality based on transfer learning, so as to improve the effect of predicting accuracy of the air quality under the condition that historical air quality data are limited.
The specific technical scheme is as follows:
in a first aspect of the embodiments of the present invention, there is provided a method for predicting air quality based on transfer learning, the method including:
aiming at a plurality of first areas obtained by dividing a target city, acquiring influence data of the first areas at historical time with a specified time interval from the target time; wherein the influence data is data capable of influencing air quality;
for each first area, obtaining air quality data of the first area at the target time based on the influence data of the first area and a prediction model corresponding to the first area from a plurality of pre-trained prediction models, and taking the obtained plurality of air quality data as the air quality data of the target city at the target time; the prediction model corresponding to any first region is obtained by training the initial model corresponding to the first region in a plurality of initial models obtained based on transfer learning by utilizing historical air quality data of the first region and influence data corresponding to the historical air quality data of the first region;
wherein the transfer learning comprises: aiming at a plurality of second areas obtained by dividing a source city, training to obtain a prediction model of the second area by using historical air quality data of the second area and historical influence data corresponding to the historical air quality data of the second area, wherein the historical influence data are used as initial models corresponding to a first area matched with the second area; wherein the number of historical air quality data of each second region is greater than the historical air quality data of any first region; the first region matched with the second region is a first region which satisfies a preset similarity condition and has similarity with the space density data of the second region in the plurality of first regions; the spatial density data for any region is used to reflect the density of points of interest in that region with respect to urban services.
Optionally, any of the impact data includes: city service data and city environment data; wherein the city service data is data on resources utilized to implement city services; the city environment data is data about the natural environment of a city;
for any second region, the structure of the prediction model of the second region includes: the first neural network group and the second neural network group are connected in series, and the output obtained by the series connection is connected with the third neural network group;
the first neural network group is used for performing feature extraction on the urban service data by utilizing a plurality of interconnected first neural networks; the second neural network group is used for extracting the characteristics of the urban environment data by utilizing a plurality of interconnected second neural networks and filling networks; the filling network is used for ensuring that the second neural network group and the first neural network group have the same dimensionality of output; and the third neural network group is used for obtaining a prediction result by utilizing the output obtained by the series connection.
Optionally, the first area, which is matched with the second areas, of the plurality of second areas obtained by dividing the source city is determined by the following steps:
dividing the source city into a plurality of grids with specified sizes, and acquiring space density data of each grid and space density data of each first area;
aiming at each grid, respectively based on the space density data of the grid and the space density data of each first region, obtaining a plurality of similarities of the grid by using a preset similarity model, and taking the identifier of the first region corresponding to the maximum similarity in the similarities of the grid as the identifier of the grid;
acquiring and clustering the air quality monitoring stations of the source city based on the position data of the air quality monitoring stations of the source city to obtain a plurality of second areas of the source city;
and respectively counting the number of the identifications of the grids in each second region, and taking the first region corresponding to the identification with the largest number as the first region matched with the second region.
Optionally, the training target of the prediction model corresponding to any one of the first regions includes:
aiming at any first region, carrying out minimization processing on a weighting result between a matching error corresponding to the first region and a prediction error of the trained model;
for any first region, the matching error corresponding to the first region is a difference value of matching degrees between the first region and a corresponding second region calculated based on the spatial density data of the first region and the spatial density data of the corresponding second region;
for any first region, the prediction error of the trained model of the first region is the difference value between the output data of the trained model of the first region and the historical air quality data of the first region.
Optionally, the training process of the prediction model corresponding to any one of the first regions includes:
when a client corresponding to any first area obtains an initial model corresponding to the first area, training the initial model corresponding to the first area by using historical air quality data of the first area and influence data corresponding to the historical air quality data of the first area to obtain an updated model;
the client corresponding to any first area sends the updated model of the first area to a central server, so that the central server fuses the updated models sent by the clients based on the weight corresponding to the client aiming at each client to obtain the fused model corresponding to the client, judges whether the fused model meets a preset training target or not, sends the fused model and a notification about finishing training to the corresponding client if the fused model meets the preset training target, and otherwise sends the fused model to the corresponding client;
when the client corresponding to any first area receives the fused model, training the fused model by using the historical air quality data of the first area and the influence data corresponding to the historical air quality data of the first area to obtain an updated model, executing the client corresponding to any first area, and sending the updated model of the first area to a central server;
and when the client corresponding to any first area receives the fused model and the notification about finishing the training, taking the received fused model as the prediction model corresponding to the first area.
In a second aspect of the present invention, there is also provided an air quality prediction apparatus based on transfer learning, the apparatus including:
the influence data acquisition module is used for acquiring influence data of a plurality of first areas obtained by dividing a target city at historical time of the first areas at a specified time interval with the target city; wherein the influence data is data capable of influencing air quality;
the air quality prediction module is used for obtaining the air quality data of the first area at the target time based on the influence data of the first area and a prediction model corresponding to the first area in a plurality of pre-trained prediction models aiming at each first area, and taking the obtained plurality of air quality data as the air quality data of the target city at the target time; the prediction model corresponding to any first region is obtained by training an initial model corresponding to the first region in a plurality of initial models obtained based on transfer learning by using historical air quality data of the first region;
wherein the transfer learning comprises: aiming at a plurality of second areas obtained by dividing a source city, training to obtain a prediction model of the second area by using historical air quality data of the second area and influence data corresponding to the historical air quality data of the second area, wherein the prediction model is used as an initial model corresponding to a first area matched with the second area; wherein the number of historical air quality data of each second region is greater than the historical air quality data of any first region; the first region matched with the second region is a first region which satisfies a preset similarity condition and has similarity with the space density data of the second region in the plurality of first regions; the spatial density data for any region is used to reflect the density of points of interest in that region with respect to urban services.
Optionally, any impact data includes: city service data and city environment data; wherein the city service data is data about resources utilized to implement city services; the city environment data is data about the natural environment of a city;
for any second region, the structure of the prediction model of the second region includes: the first neural network group and the second neural network group are connected in series, and the output obtained by the series connection is connected with the third neural network group;
the first neural network group is used for performing feature extraction on the city service data by utilizing a plurality of interconnected first neural networks; the second neural network group is used for extracting the characteristics of the urban environment data by utilizing a plurality of interconnected second neural networks and filling networks; the filling network is used for ensuring that the second neural network group and the first neural network group have the same dimensionality of output; and the third neural network group is used for obtaining a prediction result by utilizing the output obtained by the series connection.
Optionally, the first area, which is matched with the second areas, of the plurality of second areas obtained by dividing the source city is determined by the following steps:
dividing the source city into a plurality of grids with specified sizes, and acquiring space density data of each grid and space density data of each first area;
aiming at each grid, respectively based on the space density data of the grid and the space density data of each first region, obtaining a plurality of similarities of the grid by using a preset similarity model, and taking the identifier of the first region corresponding to the maximum similarity in the similarities of the grid as the identifier of the grid;
acquiring position data of the air quality monitoring stations of the source city, and clustering the air quality monitoring stations of the source city to obtain a plurality of second areas of the source city;
and respectively counting the number of the identifications of the grids in each second area, and taking the first area corresponding to the identification with the largest number as the first area matched with the second area.
Optionally, the training target of the prediction model corresponding to any one of the first regions includes:
aiming at any first region, carrying out minimization processing on a weighting result between a matching error corresponding to the first region and a prediction error of the trained model;
for any first region, the matching error corresponding to the first region is a difference value of matching degrees between the first region and a corresponding second region calculated based on the spatial density data of the first region and the spatial density data of the corresponding second region;
for any first region, the prediction error of the trained model of the first region is the difference value between the output data of the trained model of the first region and the historical air quality data of the first region.
Optionally, the training process of the prediction model corresponding to any one of the first regions includes:
when the client corresponding to any first area obtains the initial model corresponding to the first area, training the initial model corresponding to the first area by using the historical air quality data of the first area to obtain an updated model;
the client corresponding to any first area sends the updated model of the first area to a central server, so that the central server fuses the updated models sent by the clients based on the weight corresponding to the client aiming at each client to obtain the fused model corresponding to the client, judges whether the fused model meets a preset training target or not, sends the fused model and a notification about finishing training to the corresponding client if the fused model meets the preset training target, and otherwise sends the fused model to the corresponding client;
when the client corresponding to any first area receives the fused model, training the fused model by using the historical air quality data of the first area to obtain an updated model, executing the client corresponding to any first area, and sending the updated model of the first area to the central server;
and when the client corresponding to any first area receives the fused model and the notification about finishing the training, taking the received fused model as the prediction model corresponding to the first area.
In another aspect of the present invention, there is also provided an electronic device, including a processor, a communication interface, a memory and a communication bus, where the processor, the communication interface and the memory complete communication with each other through the communication bus; a memory for storing a computer program; and a processor, configured to, when executing the program stored in the memory, cause the electronic device to perform the method for predicting air quality based on transfer learning provided by the first aspect.
In yet another aspect of the present invention, there is also provided a computer-readable storage medium having stored therein instructions, which when executed on a computer, cause the computer to execute the prediction method based on transfer learning of air quality provided in the first aspect.
In yet another aspect of the present invention, there is also provided a computer program product containing instructions, which when run on a computer, causes the computer to execute the prediction method for air quality based on transfer learning provided in the first aspect.
In the scheme provided by the embodiment of the invention, the space density data of any region is used for reflecting the density degree of interest points related to urban service in the region; thus, a first region matching the second region determined from the plurality of first regions based on the spatial density data is a similar urban region to the second region, and the two urban regions are likely to have similar air quality. Based on this, the prediction model for predicting the air quality of the second region trained in the transfer learning can predict the air quality of the first region matching the second region, and therefore, can be used as the initial model corresponding to the first region matching the second region. In addition, in a plurality of second areas obtained by dividing the source city, the number of the historical air quality data of each second area is larger than the number of the historical air quality data of any first area in a plurality of first areas obtained by dividing the target city. Therefore, for any first area, compared with the prediction model trained by directly using the limited historical air quality data of the first area, the historical air quality data of the first area is used to train the initial model corresponding to the first area to obtain the prediction model corresponding to the first area, which is equivalent to train the initial model corresponding to the first area by using relatively more sufficient historical air quality data, so that the parameters of the obtained prediction model are more accurate, and the problem that the parameters of the prediction model are not accurate enough and the prediction of the air quality is not accurate enough due to the limited historical air quality data is solved. Therefore, the effect of improving the prediction accuracy of the air quality under the condition that the historical air quality data is limited can be achieved through the scheme.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below.
Fig. 1 is a schematic flow chart of a method for predicting air quality based on transfer learning according to an embodiment of the present invention;
fig. 2 is an exemplary diagram of a structure of a prediction model of any second region in the air quality prediction method based on transfer learning according to an embodiment of the present invention;
fig. 3 is an exemplary diagram of a division result of a plurality of second areas obtained by dividing a target city in the prediction method for air quality based on transfer learning according to an embodiment of the present invention;
fig. 4 is an exemplary diagram of a training process of a prediction model corresponding to any first region in the air quality prediction method based on transfer learning according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of an air quality prediction apparatus based on transfer learning according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be described below with reference to the drawings in the embodiments of the present invention.
In order to increase historical air quality data under the condition that the historical air quality data are limited so as to improve the prediction accuracy of the air quality, a model obtained by training the historical air quality data of a city with more air quality monitoring stations can be directly transferred to the city with less air quality monitoring stations. However, such migration requires that the two cities as a whole must be similar, and in particular that the cities must be equally large in size, resulting in a narrow range of applicability. The method partitions the source city and the target city, determines the matched area to perform model transfer learning, does not need to consider the similarity of the whole cities during transfer, even if the scales of the two cities are different, can use the prediction model of the second area of the source city for training to obtain the prediction model corresponding to the first area of the target city as long as the matched area is determined, and can greatly expand the application range of prediction of air quality.
First, the method for predicting air quality based on transfer learning provided by the present invention is described below.
The air quality prediction method based on transfer learning provided by the embodiment of the invention can be applied to electronic equipment. In a specific application, the electronic device may include a desktop computer, a portable computer, an internet television, an intelligent mobile terminal, a wearable intelligent terminal, a server, and the like, which are not limited herein, and any electronic device that can implement the embodiment of the present invention belongs to the protection scope of the embodiment of the present invention.
As shown in fig. 1, a flow of a method for predicting air quality based on transfer learning according to an embodiment of the present invention may include:
s101, aiming at a plurality of first areas obtained by dividing a target city, acquiring influence data of the first areas in historical time with a specified time interval from the target time. Wherein the influence data is data that can influence air quality.
In a particular application, the impact data that can affect air quality can be varied. Illustratively, the impact data may include at least one of city service data and city environment data. Wherein the city service data is data on resources utilized for implementing city services; the city environment data is data on the natural environment of a city. For example, the city service data may specifically include data such as a passenger flow rate, a vehicle flow rate, and smoke discharge data of a thermal power plant; the urban environment data may specifically include temperature, humidity, and AQI (Air Quality Index), among other data.
Furthermore, the first region may be acquired in various manners in relation to the influence data of the historical time at the time interval from the target time by the specified time period. For example, the influence data may be requested in real time from a data center storing the influence data of the first area at the historical time separated from the target time by the specified time, or the influence data of the first area at the historical time separated from the target time by the specified time may be stored in advance in the execution main body of the embodiment of the present invention and may be directly read from the execution main body.
In addition, the manner of dividing the plurality of first areas obtained by the target city may be various. Illustratively, a plurality of first areas can be obtained by dividing according to the difference of administrative areas of a target city; or, the target city can be divided into a plurality of first areas according to the difference of historical air quality data; or, a plurality of first areas can be obtained by utilizing a Delaunay triangulation algorithm based on the position data of the air quality monitoring station of the target city. For ease of understanding and reasonable layout, the third exemplary illustration is described in detail with the following exemplary illustrations of alternative embodiments.
S102, aiming at each first area, obtaining air quality data of the first area at a target time based on the influence data of the first area and a prediction model corresponding to the first area in a plurality of pre-trained prediction models, and taking the obtained plurality of air quality data as the air quality data of a target city at the target time; the prediction model corresponding to any first region is obtained by training the initial model corresponding to the first region in a plurality of initial models obtained based on transfer learning by utilizing historical air quality data of the first region and historical influence data corresponding to the historical air quality data of the first region;
wherein the transfer learning comprises: aiming at a plurality of second areas obtained by dividing a source city, training to obtain a prediction model of the second area by using historical air quality data of the second area and historical influence data corresponding to the historical air quality data of the second area, wherein the historical influence data is used as an initial model corresponding to a first area matched with the second area; wherein the number of historical air quality data of each second zone is greater than the historical air quality data of any first zone; the first area matched with the second area is a first area which satisfies a preset similar condition according to the similarity between the spatial density data of the first area and the spatial density data of the second area; the spatial density data for any region is used to reflect the density of points of interest in that region with respect to urban services.
In a particular application, migration learning can take advantage of similarities between data, tasks, or models to apply models learned in the old domain to the new domain. Therefore, for the case where the historical air quality data is limited, the initial model corresponding to the first region may be obtained based on the transfer learning. Also, the spatial density data for reflecting the density of the points of interest regarding the urban service in any area, for example, in any first area, or in any second area, may be various in particular. The following detailed description is given by way of example.
Illustratively, a point of interest (POI) for a city service is a place in the city where various types of services are provided, such as schools and shopping malls. The interest points have attribute information such as names, addresses, position coordinates, and categories. The spatial density data reflecting the density of the interest points of the city service in the region may specifically be the number of the interest points in the region, or the density of the interest points in the region, and the like. As shown in Table I, if POI is classified into ten categories of traffic, factory, park, shop and restaurant, the target city or source city is divided into a plurality of grids with specified size, and the space density data of the ith grid is d i ,d i ={r 0 ,…,r 10 Is a vector of 11 x 1 dimensions, r 0 Denotes an identifier of the first or second area to which the ith mesh belongs, r 1 To r 10 Respectively representing the number of interest points of each type in the grid. At this time, the spatial density data of the first region or the second region is a plurality of vectors of 11 × 1 dimensions.
Figure BDA0002406618540000101
In addition, for convenience of understanding and reasonable layout, the structure of the prediction model of the second region and the training mode of the prediction model of the first region in the embodiment of fig. 1 of the present invention are specifically described in the form of alternative embodiments.
In the scheme provided by the embodiment of the invention, the space density data of any region is used for reflecting the density degree of interest points related to urban service in the region; thus, a first region matching a second region determined from a plurality of first regions based on spatial density data is a similar urban region to the second region, and both urban regions are likely to have similar air qualities. Based on this, the prediction model for predicting the air quality of the second region trained in the transfer learning can predict the air quality of the first region matching the second region, and therefore, can be used as the initial model corresponding to the first region matching the second region. In addition, in a plurality of second areas obtained by dividing the source city, the number of the historical air quality data of each second area is larger than the number of the historical air quality data of any first area in a plurality of first areas obtained by dividing the target city. Therefore, for any first area, compared with the prediction model trained by directly using the limited historical air quality data of the first area, the historical air quality data of the first area is used to train the initial model corresponding to the first area to obtain the prediction model corresponding to the first area, which is equivalent to train the initial model corresponding to the first area by using relatively more sufficient historical air quality data, so that the parameters of the obtained prediction model are more accurate, and the problem that the parameters of the prediction model are not accurate enough and the prediction of the air quality is not accurate enough due to the limited historical air quality data is solved. Therefore, the effect of improving the prediction accuracy of the air quality under the condition that the historical air quality data is limited can be achieved through the scheme.
In an alternative embodiment, any of the impact data may include: city service data and city environment data; wherein the city service data is data on resources utilized for implementing city services; the city environment data is data about the natural environment of a city;
correspondingly, for any second region, the structure of the prediction model of the second region includes: the first neural network group and the second neural network group are connected in series, and the output obtained by the series connection is connected with the third neural network group;
the first neural network group is used for extracting characteristics of the urban service data by utilizing a plurality of interconnected first neural networks; the second neural network group is used for extracting the characteristics of the urban environment data by utilizing a plurality of interconnected second neural networks and filling networks; the filling network is used for ensuring that the second neural network group and the first neural network group have the same dimensionality of output; and the third neural network group is used for obtaining a prediction result by utilizing the output obtained by the series connection.
In a specific application, the influence data input into the prediction model of the second area of the source city is divided into two parts in consideration of the diversity of the influence factors of the air quality. Part of the data is urban environmental data about the natural environment of the city, such as weather, temperature, humidity, and AQI in time series; the other part is city service data on resources utilized for realizing city service, for example, data such as pedestrian flow data and traffic flow data in a grid form in the points of interest of the second area. The influence data of the prediction model input to the first area of the target city is similar to that of the second area, and is different from the area to which the influence data belongs. In addition, when training is performed to obtain any prediction model, the history influence data used is similar to the above-described influence data in form, except that the data is history data.
Illustratively, the structure of the predictive model of the second region is shown in fig. 2. Wherein the first neural network group includes: two convolution-long-short-time neural networks (Conv LSTM) and one normalization network (BatchNorm); the second neural network group includes: two gated cyclic units (GRU) neural networks and a padding network (coding); the third neural network group includes: two 2D convolutional neural networks (Conv 2D) 1×1 ). Specifically, for the urban service data in the grid form, the first neural network group can perform feature extraction of space-time dimension on the urban service data to obtain L S Feature data of dimension
Figure BDA0002406618540000111
In (1). And, because the urban environment data is in a time sequence form, in order to improve extraction efficiency and effect, the second neural network group selects a Gated Round Unit (GRU) neural network. Further, since the inventors have studied and found that the influence data in the past 48 hours has the largest influence on the current air quality, the number of gated cycle units (GRU) neural networks is two, and 48-dimensional influence data in the past 48 hours is input. In order to jointly train two parts of influence data, gridding copying and filling are carried out on the output of a gated cyclic unit (GRU) neural network by using a filling network coding to obtain L E Feature data of dimension
Figure BDA0002406618540000121
Then will be
Figure BDA0002406618540000122
It and
Figure BDA0002406618540000123
and (4) performing series connection, and obtaining gridded predicted air quality data through two 2D convolution neural networks. Furthermore, a mean value operation can be performed as predicted air quality data based on the predicted value in each grid
Figure BDA0002406618540000124
The air quality data may specifically be PM 2.5.
In addition, the model used in the training process has the same structure as the prediction model described above, and is different in model parameters. Thus, taking FIG. 2 as an example, predicted air quality data output by the model used in the training process may be used
Figure BDA0002406618540000125
And historical air quality data y at time t t And inputting a loss function to obtain a difference value between the two, and judging whether the model used for training is converged or not by using the difference value. And, in advance, toAir quality data for measuring time t
Figure BDA0002406618540000126
The influence data input is data of a history time at a specified time interval from time T, e.g. history time T-T k +1, … …, impact data at historical time t-1. Wherein the specified duration is plural, e.g. 1, … … and T k Etc., T k The maximum specified time length in the plurality of specified time lengths.
In an optional implementation manner, for the plurality of second regions obtained by dividing the source city, the first region matched with the second region is determined by the following steps:
dividing a source city into a plurality of grids with specified sizes, and acquiring space density data of each grid and space density data of each first area;
aiming at each grid, respectively based on the space density data of the grid and the space density data of each first area, obtaining a plurality of similarities of the grid by using a preset similarity model, and taking the identifier of the first area corresponding to the maximum similarity in the plurality of similarities of the grid as the identifier of the grid;
acquiring and clustering the air quality monitoring stations of the source city based on the position data of the air quality monitoring stations of the source city to obtain a plurality of second areas of the source city;
and respectively counting the number of the identifiers of the grids in each second area, and taking the first area corresponding to the identifier with the largest number as the first area matched with the second area.
Illustratively, as shown in FIG. 3. Since the density of the air quality monitoring sites is probably far lower than the division density of the grid, the target city needs to be divided into regions according to the monitoring sites. Taking the eight monitoring sites in Shanghai city as an example, a Delaunay triangulation algorithm is used to generate a Voronoi diagram in Shanghai city, and the result is shown in FIG. 3. The dots in each area in fig. 3 represent air quality monitoring stations, and the black diagonal lines represent the dividing boundaries of the Voronoi diagram. In a specific application, dividing the target city to obtain a plurality of second areas may specifically include the following steps 1 to 5:
step 1, input GR T Constructing a Delaunay triangulation network, identifying discrete points and formed triangles, and recording which three discrete points each triangle consists of;
step 2, finding out the identifications of all triangles adjacent to each discrete point and recording the identifications;
step 3, sorting triangles adjacent to each discrete point in a clockwise or anticlockwise direction;
step 4, calculating the center of a circumscribed circle of each triangle;
and 5, connecting the centers of circumscribed circles of the adjacent triangles according to the adjacent triangles of each discrete point to obtain the Thiessen polygon of the target city.
Wherein, GR T Location information, such as latitude and longitude, for the air quality monitoring station in the target city.
Moreover, the preset similarity model may be a Pearson coefficient (Pearson coefficient) model, which is used to calculate the similarity between each grid of the source city beijing and the corresponding spatial density data of each region of the target city shanghai, and the Pearson coefficient (Pearson coefficient) model is specifically represented by the following formula one:
Figure BDA0002406618540000131
wherein, X i Spatial density data representing the ith grid of the source city, i.e.
Figure BDA0002406618540000132
Mean of spatial density data representing all grids of the source city; y is i Spatial density data representing the ith grid of the target city, i.e. Y i ={r 1 ,…,r 10 },
Figure BDA0002406618540000133
Mean of spatial density data representing all grids of the target city, n represents sourceNumber of grids of a city.
And acquiring and clustering the air quality monitoring stations of the source city based on the position data of the air quality monitoring stations of the source city to obtain a plurality of second areas of the source city, wherein the method specifically comprises the following steps 6 to 12:
step 7, inputting position data GR of air quality monitoring station in source city S
Step 8, position data GR of air quality monitoring station in source city S Randomly generating K centroids;
step 9, calculating position data GR of each source city S The distance from each centroid;
step 10, position data GR of each source city S Sequentially distributing the clusters with the centroids closest to each other;
step 11, calculating the next mass center of the current cluster;
and step 12, circularly executing the steps 9 to 11 until the partition of the source city is completed.
Wherein, the position data GR of the air quality monitoring station in the source city S Specifically, the longitude and latitude of the air quality monitoring station can be used. In addition, for each second region, a greater number of identifications of the grid in that second region indicates a greater number of grids in that second region that match the first region. Based on this, when the number of identifiers of the grid in the second area is the maximum, it indicates that the second area is more similar to the first area corresponding to the identifier with the maximum number. Therefore, the first area corresponding to the largest number of identifiers can be used as the first area matching the second area.
In an optional implementation manner, the training target of the prediction model corresponding to any one of the first regions may specifically include:
aiming at any first region, carrying out minimization processing on a weighting result between a matching error corresponding to the first region and a prediction error of the trained model;
for any first region, calculating a difference value of matching degrees between the first region and a corresponding second region based on the spatial density data of the first region and the spatial density data of the corresponding second region;
for any first region, the prediction error of the trained model of the first region is the difference value between the output data of the trained model of the first region and the historical air quality data of the first region.
In a specific application, when a prediction model corresponding to any first region is obtained through training, a model with a structure shown in fig. 2 is adopted. Training to obtain a training target of the prediction model corresponding to any first region, which specifically includes two of: the first objective is to minimize the prediction error of the trained model and the second objective is to minimize the matching error for the first region.
For the first objective, a calculation of the square error can be adopted, as shown in the following equation two:
Figure BDA0002406618540000141
wherein, the first and the second end of the pipe are connected with each other,
Figure BDA0002406618540000142
representing the predicted air quality quantity, y, of the target city at time t t Represents historical air quality data for the target city at time T, which is the set of times of historical air quality data used for training.
For the second objective, the square error minimum can be taken using the following equation three:
Figure BDA0002406618540000151
wherein
Figure BDA0002406618540000152
Spatial density data at time t representing a first region of a target city,
Figure BDA0002406618540000153
spatial density data at time t, ρ, of a second region matching the first region, representing a source city r,r* Representing the similarity between a first region and a corresponding second region, which in equation three may be such that the two more similar region pairs have a relatively greater weight, C being the set of identifications of the second regions in the target city.
Based on this, the two targets are combined to minimize the weighted result between the matching error corresponding to the first region and the prediction error of the trained model. Specifically, the minimization process may be performed using the following optimization formula:
Figure BDA0002406618540000154
where w represents a weight to be weighted when weighting the prediction error and the region matching error.
This optional embodiment synthetically weighs the prediction error and the area matching error, and compared with considering only one of them, can improve the accuracy of the training result, and then improve the accuracy of the prediction of the air quality.
In an optional embodiment, the training process of the prediction model corresponding to any one of the first regions may include the following steps:
when the client corresponding to any first area obtains the initial model corresponding to the first area, training the initial model corresponding to the first area by using the historical air quality data of the first area and the historical influence data corresponding to the historical air quality data of the first area to obtain an updated model;
the client corresponding to any first area sends the updated model of the first area to the central server, so that the central server fuses the updated models sent by the clients based on the weight corresponding to the client aiming at each client to obtain the fused model corresponding to the client, judges whether the fused model meets a preset training target or not, if so, sends the fused model and a notification about finishing training to the corresponding client, and otherwise, sends the fused model to the corresponding client;
when the client corresponding to any first area receives the fused model, training the fused model by using the historical air quality data of the first area and the historical influence data corresponding to the historical air quality data of the first area to obtain an updated model, executing the client corresponding to any first area, and sending the updated model of the first area to the central server;
and when the client corresponding to any first area receives the fused model and the notification about the completion of the training, taking the received fused model as the prediction model corresponding to the first area.
In a specific application, the air quality of one area is influenced by the factors indicated by the influence data of the area, and is also influenced by the factors indicated by the influence data from other areas. Thus, the prediction models and the impact data used for training of the respective regions may be taken into account to make the prediction model of each region more robust and comprehensive by these commonalities. In addition, the federal learning and the transfer learning are combined, the individuality and the commonality of different regions can be fully considered, and an effective region characteristic model can be trained even under the condition of data shortage. Moreover, the Federal learning training mode has the characteristic of decentralization, so that the training delay and the expenditure of computing resources can be reduced, and the training efficiency is improved.
In this optional embodiment, the central server and the client in each first region may train the prediction model corresponding to any first region in a federal learning training mode, so that the transfer learning and the federal learning are combined in the training process, and the training efficiency may be improved while the historical air quality data is limited. The following detailed description is to be read in an illustrative manner to facilitate understanding.
Illustratively, as shown in FIG. 4. Clients (clients) can be respectively arranged in the N first areas, and when each Client obtains an initial model corresponding to the first area, the initial model corresponding to the first area is trained by using historical air quality data of the first area and historical influence data corresponding to the historical air quality data of the first area to obtain an updated model, and the updated model is sent to a Central server (Central server); the central server can fuse all the received updated models by using a weighted average algorithm to obtain fused models and send the fused models to each client; and the client continues to train the received model to obtain an updated model and uploads the updated model, so that iterative training is carried out until a training target is reached. And the global hyper-parameter controlling the iterative process is controlled by the server. Therefore, the models trained in different training stages are different, and specifically comprise an initial model and a fused model; data used for training may include: for any first zone, historical air quality data for the first zone, and historical impact data corresponding to the historical air quality data for the first zone.
Corresponding to the method embodiment, the invention also provides a device for predicting the air quality based on the transfer learning.
As shown in fig. 5, an embodiment of the present invention provides a structure of an apparatus for predicting air quality based on transfer learning, where the apparatus may include:
an influence data obtaining module 501, configured to obtain, for multiple first areas obtained by dividing a target city, influence data of the first areas at a historical time that is a specified time interval from the target time; wherein the influence data is data capable of influencing air quality;
an air quality prediction module 502, configured to, for each first area, obtain air quality data of the first area at the target time based on the influence data of the first area and a prediction model corresponding to the first area among a plurality of pre-trained prediction models, and use the obtained plurality of air quality data as the air quality data of the target city at the target time; the prediction model corresponding to any first region is obtained by training the initial model corresponding to the first region in a plurality of initial models obtained based on transfer learning by utilizing historical air quality data of the first region and historical influence data corresponding to the historical air quality data of the first region;
wherein the transfer learning comprises: aiming at a plurality of second areas obtained by dividing a source city, training to obtain a prediction model of the second area by using historical air quality data of the second area and influence data corresponding to the historical air quality data of the second area, wherein the prediction model is used as an initial model corresponding to a first area matched with the second area; wherein the number of historical air quality data of each second region is greater than the historical air quality data of any first region; the first region matched with the second region is a first region which satisfies a preset similarity condition and has similarity with the space density data of the second region in the plurality of first regions; the spatial density data for any region is used to reflect the density of points of interest in that region with respect to urban services.
In the scheme provided by the embodiment of the invention, the spatial density data of any region is used for reflecting the density degree of interest points related to urban service in the region; thus, a first region matching the second region determined from the plurality of first regions based on the spatial density data is a similar urban region to the second region, and the two urban regions are likely to have similar air quality. Based on this, the prediction model for predicting the air quality of the second region trained in the transfer learning can predict the air quality of the first region matching the second region, and therefore, can be used as the initial model corresponding to the first region matching the second region. In addition, in a plurality of second areas obtained by dividing the source city, the number of the historical air quality data of each second area is larger than the number of the historical air quality data of any first area in a plurality of first areas obtained by dividing the target city. Therefore, for any first area, compared with the prediction model obtained by directly training the limited historical air quality data of the first area, the historical air quality data of the first area is used for training the initial model corresponding to the first area to obtain the prediction model corresponding to the first area, which is equivalent to training the initial model corresponding to the first area by using relatively more sufficient historical air quality data, so that the parameters of the obtained prediction model are more accurate, and the problem that the parameters of the prediction model are not accurate enough and the prediction of the air quality is not accurate enough due to the limited historical air quality data is solved. Therefore, the effect of improving the prediction accuracy of the air quality under the condition that the historical air quality data is limited can be achieved through the scheme.
Optionally, any of the impact data includes: city service data and city environment data; wherein the city service data is data about resources utilized to implement city services; the city environment data is data about the natural environment of a city;
for any second region, the structure of the prediction model of the second region includes: the first neural network group and the second neural network group are connected in series, and the output obtained by the series connection is connected with the third neural network group;
the first neural network group is used for performing feature extraction on the urban service data by utilizing a plurality of interconnected first neural networks; the second neural network group is used for extracting the characteristics of the urban environment data by utilizing a plurality of interconnected second neural networks and filling networks; the filling network is used for ensuring that the second neural network group and the first neural network group have the same dimensionality of output; and the third neural network group is used for obtaining a prediction result by utilizing the output obtained by the series connection.
Optionally, the first area, which is matched with the second areas, of the plurality of second areas obtained by dividing the source city is determined by the following steps:
dividing the source city into a plurality of grids with specified sizes, and acquiring space density data of each grid and space density data of each first area;
aiming at each grid, respectively based on the space density data of the grid and the space density data of each first region, obtaining a plurality of similarities of the grid by using a preset similarity model, and taking the identifier of the first region corresponding to the maximum similarity in the similarities of the grid as the identifier of the grid;
acquiring and clustering the air quality monitoring stations of the source city based on the position data of the air quality monitoring stations of the source city to obtain a plurality of second areas of the source city;
and respectively counting the number of the identifications of the grids in each second area, and taking the first area corresponding to the identification with the largest number as the first area matched with the second area.
Optionally, the training target of the prediction model corresponding to any one of the first regions includes:
aiming at any first region, carrying out minimization processing on a weighting result between a matching error corresponding to the first region and a prediction error of the trained model;
for any first region, the matching error corresponding to the first region is a difference value of matching degrees between the first region and a corresponding second region calculated based on the spatial density data of the first region and the spatial density data of the corresponding second region;
for any first area, the prediction error of the trained model of the first area is the difference value between the output data of the trained model of the first area and the historical air quality data of the first area.
Optionally, the training process of the prediction model corresponding to any one of the first regions includes:
when a client corresponding to any first area obtains an initial model corresponding to the first area, training the initial model corresponding to the first area by using historical air quality data of the first area and historical influence data corresponding to the historical air quality data of the first area to obtain an updated model;
the client corresponding to any first area sends the updated model of the first area to a central server, so that the central server fuses the updated models sent by the clients based on the weight corresponding to the client aiming at each client to obtain the fused model corresponding to the client, judges whether the fused model meets a preset training target or not, sends the fused model and a notification about finishing training to the corresponding client if the fused model meets the preset training target, and otherwise sends the fused model to the corresponding client;
when the client corresponding to any first area receives the fused model, training the fused model by using the historical air quality data of the first area and the historical influence data corresponding to the historical air quality data of the first area to obtain an updated model, executing the client corresponding to any first area, and sending the updated model of the first area to a central server;
and when the client corresponding to any first area receives the fused model and the notification about finishing the training, taking the received fused model as the prediction model corresponding to the first area.
An embodiment of the present invention further provides an electronic device, as shown in fig. 6, including a processor 601, a communication interface 602, a memory 603, and a communication bus 604, where the processor 601, the communication interface 602, and the memory 603 complete mutual communication through the communication bus 604,
a memory 603 for storing a computer program;
the processor 601 is configured to implement any of the learning-based methods described above when executing the program stored in the memory 603.
In the scheme provided by the embodiment of the invention, the space density data of any region is used for reflecting the density degree of interest points related to urban service in the region; thus, a first region matching the second region determined from the plurality of first regions based on the spatial density data is a similar urban region to the second region, and the two urban regions are likely to have similar air quality. Based on this, the prediction model for predicting the air quality of the second region trained in the transfer learning can predict the air quality of the first region matching the second region, and therefore, can be used as the initial model corresponding to the first region matching the second region. In addition, in a plurality of second areas obtained by dividing the source city, the number of the historical air quality data of each second area is larger than the number of the historical air quality data of any first area in a plurality of first areas obtained by dividing the target city. Therefore, for any first area, compared with the prediction model trained by directly using the limited historical air quality data of the first area, the historical air quality data of the first area is used to train the initial model corresponding to the first area to obtain the prediction model corresponding to the first area, which is equivalent to train the initial model corresponding to the first area by using relatively more sufficient historical air quality data, so that the parameters of the obtained prediction model are more accurate, and the problem that the parameters of the prediction model are not accurate enough and the prediction of the air quality is not accurate enough due to the limited historical air quality data is solved. Therefore, the effect of improving the prediction accuracy of the air quality under the condition that the historical air quality data is limited can be achieved through the scheme.
The communication bus mentioned in the above terminal may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown, but this is not intended to represent only one bus or type of bus.
The communication interface is used for communication between the terminal and other equipment.
The Memory may include a Random Access Memory (RAM) or a non-volatile Memory (non-volatile Memory), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the processor.
The Processor may be a general-purpose Processor, and includes a Central Processing Unit (CPU), a Network Processor (NP), and the like; the Integrated Circuit may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, a discrete Gate or transistor logic device, or a discrete hardware component.
In yet another embodiment of the present invention, a computer-readable storage medium is further provided, which has instructions stored therein, and when the computer-readable storage medium runs on a computer, the computer is caused to execute the prediction method based on transfer learning in any one of the above embodiments.
In yet another embodiment, a computer program product containing instructions is provided, which when run on a computer causes the computer to perform the method for prediction of air quality based on transfer learning as described in any of the above embodiments.
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, it may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, cause the processes or functions described in accordance with the embodiments of the invention to be performed in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, from one website site, computer, server, or data center to another website site, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that incorporates one or more of the available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., Solid State Disk (SSD)), among others.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
All the embodiments in the present specification are described in a related manner, and the same and similar parts among the embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, as for the apparatus and electronic device embodiments, since they are substantially similar to the method embodiments, the description is relatively simple, and reference may be made to some descriptions of the method embodiments for relevant points.
The above description is only for the preferred embodiment of the present invention, and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention shall fall within the protection scope of the present invention.

Claims (10)

1. A method for predicting air quality based on transfer learning, the method comprising:
aiming at a plurality of first areas obtained by dividing a target city, acquiring influence data of the first areas at historical time with a specified time interval from the target time; wherein the influence data is data capable of influencing air quality;
for each first area, obtaining air quality data of the first area at the target time based on the influence data of the first area and a prediction model corresponding to the first area from a plurality of pre-trained prediction models, and taking the obtained plurality of air quality data as the air quality data of the target city at the target time; the prediction model corresponding to any first region is obtained by training the initial model corresponding to the first region in a plurality of initial models obtained based on transfer learning by utilizing historical air quality data of the first region and historical influence data corresponding to the historical air quality data of the first region;
wherein the transfer learning comprises: aiming at a plurality of second areas obtained by dividing a source city, training to obtain a prediction model of the second area by using historical air quality data of the second area and historical influence data corresponding to the historical air quality data of the second area, wherein the historical influence data is used as an initial model corresponding to a first area matched with the second area; wherein the number of historical air quality data of each second region is greater than the historical air quality data of any first region; the first region matched with the second region is a first region which satisfies a preset similarity condition and has similarity with the space density data of the second region in the plurality of first regions; the spatial density data for any region is used to reflect the density of points of interest in that region with respect to urban services.
2. The method of claim 1, wherein any impact data comprises: city service data and city environment data; wherein the city service data is data on resources utilized to implement city services; the city environment data is data about the natural environment of a city;
for any second region, the structure of the prediction model of the second region includes: the first neural network group and the second neural network group are connected in series, and the output obtained by the series connection is connected with the third neural network group;
the first neural network group is used for performing feature extraction on the urban service data by utilizing a plurality of interconnected first neural networks; the second neural network group is used for extracting the characteristics of the urban environment data by utilizing a plurality of interconnected second neural networks and filling networks; the filling network is used for ensuring that the second neural network group and the first neural network group have the same dimensionality of output; and the third neural network group is used for obtaining a prediction result by utilizing the output obtained by the series connection.
3. The method according to claim 1, wherein the second areas obtained by dividing the source city, and the first area matched with the second area are determined by the following steps:
dividing the source city into a plurality of grids with specified sizes, and acquiring space density data of each grid and space density data of each first area;
aiming at each grid, respectively based on the space density data of the grid and the space density data of each first region, obtaining a plurality of similarities of the grid by using a preset similarity model, and taking the identifier of the first region corresponding to the maximum similarity in the similarities of the grid as the identifier of the grid;
acquiring and clustering the air quality monitoring stations of the source city based on the position data of the air quality monitoring stations of the source city to obtain a plurality of second areas of the source city;
and respectively counting the number of the identifications of the grids in each second area, and taking the first area corresponding to the identification with the largest number as the first area matched with the second area.
4. The method of claim 1, wherein the training targets of the prediction model corresponding to any of the first regions comprise:
aiming at any first region, carrying out minimization processing on a weighting result between a matching error corresponding to the first region and a prediction error of the trained model;
for any first region, the matching error corresponding to the first region is a difference value of matching degrees between the first region and a corresponding second region calculated based on the spatial density data of the first region and the spatial density data of the corresponding second region;
for any first region, the prediction error of the trained model of the first region is the difference value between the output data of the trained model of the first region and the historical air quality data of the first region.
5. The method according to any one of claims 1 to 4, wherein the training process of the prediction model corresponding to any one of the first regions comprises:
when a client corresponding to any first area obtains an initial model corresponding to the first area, training the initial model corresponding to the first area by using historical air quality data of the first area and influence data corresponding to the historical air quality data of the first area to obtain an updated model;
the client corresponding to any first area sends the updated model of the first area to a central server, so that the central server fuses the updated models sent by the clients based on the weight corresponding to the client aiming at each client to obtain the fused model corresponding to the client, judges whether the fused model meets a preset training target or not, sends the fused model and a notification about finishing training to the corresponding client if the fused model meets the preset training target, and otherwise sends the fused model to the corresponding client;
when the client corresponding to any first area receives the fused model, training the fused model by using the historical air quality data of the first area and the influence data corresponding to the historical air quality data of the first area to obtain an updated model, executing the client corresponding to any first area, and sending the updated model of the first area to a central server;
and when the client corresponding to any first area receives the fused model and the notification about finishing the training, taking the received fused model as the prediction model corresponding to the first area.
6. An apparatus for predicting air quality based on transfer learning, the apparatus comprising:
the influence data acquisition module is used for acquiring influence data of a plurality of first areas obtained by dividing a target city at a historical time with a specified time interval from the target city; wherein the influence data is data capable of influencing air quality;
the air quality prediction module is used for obtaining the air quality data of the first area at the target time based on the influence data of the first area and a prediction model corresponding to the first area in a plurality of pre-trained prediction models aiming at each first area, and taking the obtained plurality of air quality data as the air quality data of the target city at the target time; the prediction model corresponding to any first region is obtained by training an initial model corresponding to the first region in a plurality of initial models obtained based on transfer learning by utilizing historical air quality data of the first region and influence data corresponding to the historical air quality data of the first region;
wherein the transfer learning comprises: aiming at a plurality of second areas obtained by dividing a source city, training to obtain a prediction model of the second area by using historical air quality data of the second area and historical influence data corresponding to the historical air quality data of the second area, wherein the historical influence data is used as an initial model corresponding to a first area matched with the second area; wherein the number of historical air quality data of each second region is greater than the historical air quality data of any first region; the first region matched with the second region is a first region which satisfies a preset similarity condition and has similarity with the space density data of the second region in the plurality of first regions; the spatial density data for any region is used to reflect the density of points of interest in that region with respect to urban services.
7. The apparatus of claim 6, wherein any impact data comprises: city service data and city environment data; wherein the city service data is data on resources utilized to implement city services; the city environment data is data about the natural environment of a city;
for any second region, the structure of the prediction model of the second region includes: the first neural network group and the second neural network group are connected in series, and the output obtained by the series connection is connected with the third neural network group;
the first neural network group is used for performing feature extraction on the urban service data by utilizing a plurality of interconnected first neural networks; the second neural network group is used for extracting the characteristics of the urban environment data by utilizing a plurality of interconnected second neural networks and filling networks; the filling network is used for ensuring that the second neural network group and the first neural network group have the same dimensionality of output; and the third neural network group is used for obtaining a prediction result by utilizing the output obtained by the series connection.
8. The apparatus of claim 6, wherein the second areas obtained by dividing the source city, and the first area matched with the second area are determined by:
dividing the source city into a plurality of grids with specified sizes, and acquiring space density data of each grid and space density data of each first area;
aiming at each grid, respectively based on the space density data of the grid and the space density data of each first region, obtaining a plurality of similarities of the grid by using a preset similarity model, and taking the identifier of the first region corresponding to the maximum similarity in the similarities of the grid as the identifier of the grid;
acquiring and clustering the air quality monitoring stations of the source city based on the position data of the air quality monitoring stations of the source city to obtain a plurality of second areas of the source city;
and respectively counting the number of the identifications of the grids in each second area, and taking the first area corresponding to the identification with the largest number as the first area matched with the second area.
9. The apparatus of claim 6, wherein the training targets of the prediction model corresponding to any of the first regions comprise:
aiming at any first region, carrying out minimization processing on a weighting result between a matching error corresponding to the first region and a prediction error of the trained model;
for any first region, the matching error corresponding to the first region is a difference value of matching degrees between the first region and a corresponding second region calculated based on the spatial density data of the first region and the spatial density data of the corresponding second region;
for any first region, the prediction error of the trained model of the first region is the difference value between the output data of the trained model of the first region and the historical air quality data of the first region.
10. The apparatus according to any one of claims 6-9, wherein the training process of the prediction model corresponding to any one of the first regions comprises:
when a client corresponding to any first area obtains an initial model corresponding to the first area, training the initial model corresponding to the first area by using historical air quality data of the first area and influence data corresponding to the historical air quality data of the first area to obtain an updated model;
the client corresponding to any first area sends the updated model of the first area to a central server, so that the central server fuses the updated models sent by the clients based on the weight corresponding to the client aiming at each client to obtain the fused model corresponding to the client, judges whether the fused model meets a preset training target or not, sends the fused model and a notification about finishing training to the corresponding client if the fused model meets the preset training target, and otherwise sends the fused model to the corresponding client;
when the client corresponding to any first area receives the fused model, training the fused model by using the historical air quality data of the first area and the influence data corresponding to the historical air quality data of the first area to obtain an updated model, executing the client corresponding to any first area, and sending the updated model of the first area to a central server;
and when the client corresponding to any first area receives the fused model and the notification about finishing the training, taking the received fused model as the prediction model corresponding to the first area.
CN202010163503.6A 2020-03-10 2020-03-10 Air quality prediction method and device based on transfer learning Active CN111461410B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010163503.6A CN111461410B (en) 2020-03-10 2020-03-10 Air quality prediction method and device based on transfer learning

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010163503.6A CN111461410B (en) 2020-03-10 2020-03-10 Air quality prediction method and device based on transfer learning

Publications (2)

Publication Number Publication Date
CN111461410A CN111461410A (en) 2020-07-28
CN111461410B true CN111461410B (en) 2022-08-26

Family

ID=71678428

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010163503.6A Active CN111461410B (en) 2020-03-10 2020-03-10 Air quality prediction method and device based on transfer learning

Country Status (1)

Country Link
CN (1) CN111461410B (en)

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112465243B (en) * 2020-12-02 2024-01-09 南通大学 Air quality forecasting method and system
CN112561191B (en) * 2020-12-22 2024-02-27 北京百度网讯科技有限公司 Prediction model training method, prediction device, prediction apparatus, prediction program, and program
CN112541302B (en) * 2020-12-23 2024-02-06 北京百度网讯科技有限公司 Air quality prediction model training method, air quality prediction method and device
CN112765229B (en) * 2020-12-25 2022-08-16 哈尔滨工程大学 Air quality inference method based on multilayer attention mechanism
CN112863182B (en) * 2021-01-13 2022-03-18 南京航空航天大学 Cross-modal data prediction method based on transfer learning
CN114201924B (en) * 2022-02-16 2022-06-10 杭州经纬信息技术股份有限公司 Solar irradiance prediction method and system based on transfer learning
CN114624397A (en) * 2022-03-15 2022-06-14 杭州翔毅科技有限公司 Air quality monitoring method and device and computer readable storage medium
CN116029411A (en) * 2022-05-23 2023-04-28 成都秦川物联网科技股份有限公司 Smart city area management method and system based on Internet of things

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108509565B (en) * 2018-03-26 2020-08-18 浙江工业大学 Non-urban area air quality index space estimation method based on migration semi-supervised learning
CN112399819A (en) * 2018-07-02 2021-02-23 3M创新有限公司 Sensing system and method for monitoring a time-dependent process
CN109523013B (en) * 2018-10-15 2021-08-06 西北大学 Air particulate matter pollution degree estimation method based on shallow convolutional neural network
CN110766212B (en) * 2019-10-15 2023-01-03 哈尔滨工程大学 Ultra-short-term photovoltaic power prediction method for historical data missing electric field

Also Published As

Publication number Publication date
CN111461410A (en) 2020-07-28

Similar Documents

Publication Publication Date Title
CN111461410B (en) Air quality prediction method and device based on transfer learning
Tekouabou et al. Improving parking availability prediction in smart cities with IoT and ensemble-based model
Xu et al. Incentive mechanism for multiple cooperative tasks with compatible users in mobile crowd sensing via online communities
CN110414732B (en) Travel future trajectory prediction method and device, storage medium and electronic equipment
CN112561191B (en) Prediction model training method, prediction device, prediction apparatus, prediction program, and program
CN107679558A (en) A kind of user trajectory method for measuring similarity based on metric learning
WO2020215783A1 (en) Locating method and apparatus, and storage medium
CN108882172B (en) Indoor moving trajectory data prediction method based on HMM model
CN111898578B (en) Crowd density acquisition method and device and electronic equipment
CN109116299B (en) Fingerprint positioning method, terminal and computer readable storage medium
CN114501530B (en) Method and device for determining antenna parameters based on deep reinforcement learning
CN109034232B (en) Automatic output system and control method for urban planning condition verification result report
CN112214677B (en) Point of interest recommendation method and device, electronic equipment and storage medium
CN110399365A (en) Determination method, apparatus, storage medium and the electronic equipment of map missing road
CN109991591B (en) Positioning method and device based on deep learning, computer equipment and storage medium
CN110011847B (en) Data source quality evaluation method under sensing cloud environment
Zhuang et al. Integrating a deep forest algorithm with vector‐based cellular automata for urban land change simulation
CN109543922B (en) Time-period borrowing and returning amount prediction method for single-vehicle station group shared by piles
CN115099328A (en) Traffic flow prediction method, system, device and storage medium based on countermeasure network
CN112469116B (en) Positioning method, positioning device, electronic equipment and computer readable storage medium
CN111008730B (en) Crowd concentration prediction model construction method and device based on urban space structure
CN110830939B (en) Positioning method based on improved CPN-WLAN fingerprint positioning database
WO2023051085A1 (en) Object recognition method and apparatus, device, storage medium and program product
Sasaki et al. Road segment interpolation for incomplete road data
CN115426710A (en) Indoor fingerprint positioning-oriented sparse feature completion method

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
GR01 Patent grant
GR01 Patent grant