CN112766600A - Urban area crowd flow prediction method and system - Google Patents

Urban area crowd flow prediction method and system Download PDF

Info

Publication number
CN112766600A
CN112766600A CN202110126835.1A CN202110126835A CN112766600A CN 112766600 A CN112766600 A CN 112766600A CN 202110126835 A CN202110126835 A CN 202110126835A CN 112766600 A CN112766600 A CN 112766600A
Authority
CN
China
Prior art keywords
crowd flow
network
lstm
resnet
data set
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.)
Granted
Application number
CN202110126835.1A
Other languages
Chinese (zh)
Other versions
CN112766600B (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.)
Wuhan University WHU
Original Assignee
Wuhan University WHU
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 Wuhan University WHU filed Critical Wuhan University WHU
Priority to CN202110126835.1A priority Critical patent/CN112766600B/en
Publication of CN112766600A publication Critical patent/CN112766600A/en
Application granted granted Critical
Publication of CN112766600B publication Critical patent/CN112766600B/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
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • G06N3/084Backpropagation, e.g. using gradient descent
    • 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
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02ATECHNOLOGIES FOR ADAPTATION TO CLIMATE CHANGE
    • Y02A30/00Adapting or protecting infrastructure or their operation
    • Y02A30/60Planning or developing urban green infrastructure

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • General Physics & Mathematics (AREA)
  • Health & Medical Sciences (AREA)
  • General Health & Medical Sciences (AREA)
  • Computing Systems (AREA)
  • Computational Linguistics (AREA)
  • Software Systems (AREA)
  • Strategic Management (AREA)
  • Human Resources & Organizations (AREA)
  • Mathematical Physics (AREA)
  • Economics (AREA)
  • Tourism & Hospitality (AREA)
  • General Engineering & Computer Science (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Biomedical Technology (AREA)
  • Biophysics (AREA)
  • Molecular Biology (AREA)
  • Data Mining & Analysis (AREA)
  • Evolutionary Computation (AREA)
  • Marketing (AREA)
  • Development Economics (AREA)
  • General Business, Economics & Management (AREA)
  • Educational Administration (AREA)
  • Primary Health Care (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 invention provides a method and a system for predicting urban regional crowd flow, which comprises the steps of downloading a data set, wherein the data set comprises track data and external influence factor data; preprocessing all data, including crowd flow calculation, external influence factor data one-hot coding and normalization processing; constructing a network structure based on ResNet and LSTM, which comprises a ResNet sub-network for simulating urban area crowd flow space characteristics, an LSTM sub-network for simulating urban area crowd flow time characteristics, an external factor neural network for simulating the influence of external factors on crowd flow, and a fusion module; constructing a training data set and a testing data set, taking a network structure based on ResNet and LSTM after network training and testing as a model for predicting urban regional crowd flow, inputting the flow state of each regional crowd and external influence factors of a preprocessed target city into the network structure, and finally obtaining the prediction result of the crowd flow of each region of the city in a certain period of time in the future.

Description

Urban area crowd flow prediction method and system
Technical Field
The invention belongs to the technical field of mobile positioning information, and particularly relates to a method and a system for predicting urban area crowd flow.
Background
In recent years, due to the development of mobile positioning technology, trajectory data of a large number of moving objects is quantifiably collected. The space-time trajectory data contains rich space-time characteristic information of moving objects, so that a large number of researchers are attracted to extract various valuable information from the space-time trajectory data and apply the information. In particular, city-wide crowd flow prediction based on space-time trajectory data is particularly concerned by researchers, because the crowd flow prediction has important research value and practical significance for network optimization, traffic management, public safety, control of spread diseases and the like. For example, if the flow condition of urban crowds can be predicted in advance, the deployment and allocation of network resources can be optimized, and the network burden is reduced; the method can also be used as an important means for effectively guiding and controlling the traffic flow to relieve traffic pressure.
In the urban population flow prediction problem, the method can be mainly divided into two types of prediction methods, one type is a traditional prediction method based on a statistical theory or a mathematical theory, the expansibility of the method is poor, and the dynamic change among all areas is often ignored, so that the prediction result hardly reflects the nonlinear time-space correlation of the population flow change complexity; and the other is traffic prediction using a deep learning framework that has recently become popular. The deep learning can process complex nonlinear problems, and achieves great achievement in the fields of computer vision and natural language processing, so that the deep learning can be applied to the flow prediction problem. However, the crowd flow prediction problem is influenced by various factors, such as time factor, space factor, external factor, etc., how to construct a suitable deep learning framework in the prediction process, and meanwhile, the influence of the several factors is considered, so that more accurate prediction is performed, which is still a great challenge for researchers.
Therefore, the invention provides an urban area crowd flow prediction model based on a Deep Residual Network (ResNet) and a Long Short-Term Memory-cycle neural Network (LSTM). In the model, the spatial dependence of the crowd flow is captured by ResNet, the temporal dependence of the crowd flow is captured by LSTM, and external factors are taken into account.
Disclosure of Invention
The invention fully utilizes the space-time characteristics of urban crowd flow, provides an urban regional crowd flow prediction scheme based on ResNet and LSTM, captures the time dependence and the space dependence of urban regional crowd flow change at the same time in a network training phase, can well reflect the nonlinear space-time correlation of the crowd flow change complexity, considers external conditions such as holidays and weather at the same time, and uses a two-layer fully-connected network to simulate the external influence factor characteristics, thereby making more accurate prediction on the urban regional crowd flow.
The invention provides a method for predicting urban area crowd flow, which comprises the following steps,
step S1, downloading a data set, wherein the data set comprises track data and external influence factor data;
step S2, preprocessing all data in the training data set obtained in the step S1, including crowd flow calculation, one-hot coding and normalization processing of external influence factor data;
step S3, constructing a network structure based on ResNet and LSTM, wherein the network structure comprises a ResNet sub-network for simulating urban area crowd flow space characteristics, an LSTM sub-network for simulating urban area crowd flow time characteristics, an external factor neural network for simulating the influence of external factors on crowd flow, and a fusion module;
step S4, constructing a training data set and a testing data set of the network structure based on ResNet and LSTM according to the preprocessed data obtained in the step S2;
step S5, sending the training data set obtained in the step S4 into the network structure based on ResNet and LSTM obtained in the step S3 for network training, and then adjusting the hyper-parameters in the trained network structure by adopting the test data set obtained in the step S4 to gradually improve the prediction accuracy;
and step S6, taking the network structure based on ResNet and LSTM after the network training and testing in the step S5 as a model for predicting urban regional crowd flow, inputting the preprocessed regional crowd flow state and external influence factors of the target city into the network structure, and finally obtaining the prediction result of the urban regional crowd flow in a certain period of time in the future.
Also, the trajectory data used in step S1 are taxi trajectory data and public bicycle riding data.
Also, the external influence factor data includes time, holidays, air temperatures, wind speeds, and weather.
The ResNet sub-networks have s identical structures, and the input is
Figure BDA0002924292720000021
Each structure has L +2 layers, the layer 1 is convolutional layer Conv1 and contains 64 convolution kernels of 3 × 3, the layers 2 to L +1 are residual units ResUnit1 to ResUnitL, each residual unit contains 64 convolution kernels of 3 × 3, the layer L +2 is convolutional layer Conv2 and contains 2 convolution kernels of 3 × 3; the output of the ResNet subnetwork is
Figure BDA0002924292720000022
Furthermore, the sequence length of the LSTM subnetwork is s, s outputs of the ResNet subnetwork
Figure BDA0002924292720000023
The time sequential inputs that make up the LSTM sub-network, the output of the LSTM sub-network is { hi|i=1,2,...,s}。
Also, the output of the fusion module to the LSTM subnetwork { hiObtaining an output I by a parameter-based matrix fusion methodResThe formula is as follows:
Figure BDA0002924292720000024
wherein ,WiThe representation of the learnable parameter is,
Figure BDA0002924292720000031
representing a Hadamard product operation.
Moreover, the input of the external factor neural network is the corresponding vector E of the external influencing factortThe external factor neural network is composed of two full connection layers, wherein the first full connection layer FC1 is an embedded layer of each sub-factor; the second layer full connection layer FC2 carries out dimension conversion to output IExtAnd IResHave the same dimension;
then, the fused output IResOutput I from neural network of external factorsExtPerforming direct addition and fusion, and obtaining the output of the total network, namely the predicted value of the t time period, through the tanh activation function
Figure BDA0002924292720000032
On the other hand, the invention also provides a system for predicting urban area crowd flow, which is used for realizing the method for predicting the urban area crowd flow.
And, including the following modules,
a first module for downloading a data set, the data set including trajectory data and external influencing factor data;
the second module is used for preprocessing all data in the training data set obtained by the first module, and comprises crowd flow calculation, single-hot coding and normalization processing of external influence factor data;
the third module is used for constructing a network structure based on ResNet and LSTM, and the network structure comprises a ResNet sub-network for simulating urban area crowd flow space characteristics, an LSTM sub-network for simulating urban area crowd flow time characteristics, an external factor neural network for simulating the influence of external factors on crowd flow, and a fusion module;
a fourth module, configured to construct a training data set and a testing data set of a network structure based on ResNet and LSTM according to the preprocessed data obtained by the second module;
the fifth module is used for sending the training data set obtained by the fourth module into a network structure based on ResNet and LSTM obtained by the third module for network training, and then adjusting the hyper-parameters in the trained network structure by adopting the test data set obtained by the fourth module to gradually improve the prediction precision;
and the sixth module is used for taking the network structure based on ResNet and LSTM after network training and testing in the fifth module as a model for predicting the urban regional crowd flow, inputting the preprocessed regional crowd flow state and external influence factors of the target city into the network structure, and finally obtaining the prediction result of the urban regional crowd flow in a certain period of time in the future.
Alternatively, the urban area crowd flow prediction method comprises a processor and a memory, wherein the memory is used for storing program instructions, and the processor is used for calling the stored instructions in the memory to execute the urban area crowd flow prediction method.
The invention has the beneficial effects that:
1. the invention adopts a deep learning theory, trains the network model built by the invention by using a large amount of track data sets, and has better learning and generalization capability.
2. The invention provides a prediction scheme of urban regional crowd flow based on ResNet and LSTM, wherein ResNet can deepen the number of network layers and avoid the problem of gradient disappearance, thereby fully extracting the spatial characteristics of the crowd flow in each region of an urban area; the LSTM is modeled based on the time sequence, so that the time characteristics of the crowd flow in each time period of the city can be fully extracted; the time dependence and the space dependence of the crowd flow in the urban area are captured simultaneously through the combination of the two methods. Meanwhile, external influence factors such as holidays and weather are considered, so that the prediction result is more accurate.
3. The new method is used for constructing the test data set and the training data set, so that the data set can reflect the space-time law of the crowd flow change in the urban area more truly, the network can extract space-time characteristics more fully, and the prediction result is further improved.
Drawings
FIG. 1 is a flow chart of a method according to an embodiment of the present invention.
Fig. 2 is a schematic diagram of a network structure based on ResNet and LSTM according to an embodiment of the present invention.
Fig. 3 is a schematic diagram of a residual unit result in a ResNet according to an embodiment of the present invention.
FIG. 4 is a schematic diagram of nerve cells in an LSTM according to an embodiment of the present invention.
Detailed Description
In order to make the technical problems solved, technical solutions adopted and technical effects achieved by the present invention clearer, the present invention is further described in detail below with reference to the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention. It should be further noted that, for the convenience of description, only some but not all of the relevant aspects of the present invention are shown in the drawings. The present invention will be described in further detail with reference to the accompanying drawings.
As shown in fig. 1, an embodiment of the present invention provides a method for predicting urban area crowd flow based on ResNet and LSTM, including the following steps:
step S1: downloading a training data set, wherein the training data set comprises track data and external influence factor data;
the data set used in the examples was: (1) TaxiBJ: the Beijing taxi track data set comprises track data recorded by a taxi GPS for eighteen months in four periods of 2013-2016 years and weather data at corresponding time. (2) BikenYC: a new york public bicycle riding data set containing riding data recorded by a new york bicycle system for six consecutive months in new york 2014.
Step S2: preprocessing all data in the data set obtained in the step S1;
the data preprocessing comprises three aspects of crowd flow calculation, One-hot coding (One-hot) and normalization processing.
Calculating the crowd flow: the crowd flow is divided into crowd inflow and crowd outflow. First, the city is divided into I × J grid maps according to longitude and latitude, each grid represents a city area, and the areas in the grid maps can be defined as an ordered pair (I, J), where I and J represent the ith row and jth column of the area in the grid map.
Order to
Figure BDA0002924292720000041
Set of all traces for the T-th time segment, Tr:g1→g2→…→g|TrIs a set
Figure BDA0002924292720000042
One track, | TrI represents the track TrThe number of trace points of { g }k|k=1,2,...,|TrAnd | is a geospatial coordinate. Then for the ith row and jth column area (i, j) in the grid map, the urban area crowd inflow of the t time period
Figure BDA0002924292720000051
And the outflow of the crowd
Figure BDA0002924292720000052
Are respectively defined as follows:
Figure BDA0002924292720000053
Figure BDA0002924292720000054
wherein ,gkE (i, j) represents a point gkWithin region (i, j) and vice versa. Further, the urban area crowd flow of the t time period is represented as Xt,XtIncluding the inflow of the crowd
Figure BDA0002924292720000055
And the outflow of the crowd
Figure BDA0002924292720000056
One-hot encoding (One-hot): the external influence factor data used in the present embodiment includes time, holidays, air temperature, wind speed, weather. Wherein the time and weather features are generated using one-hot encoding: the time information is represented by a vector with the length of 8, the first 7 bits are represented by one-hot coding to show which day of the week the current day is, and the 8 th bit is used for showing whether the current day is weekend or not; the weather information comprises 17 weathers with different states, and the 17 weathers are subjected to one-hot coding by using a vector with the length of 17 to represent the weather states.
Normalization treatment: and normalizing the calculated urban area crowd flow data and the coded external factor data to ensure that the input data in different ranges exert the same effect. The treatment method comprises the following steps:
Figure BDA0002924292720000057
where x is the original data, xnormIs normalized data, xmax and xminRespectively, the maximum and minimum values in the raw data.
Step S3: constructing a novel network structure based on ResNet and LSTM;
as shown in FIG. 2, the network structure based on ResNet and LSTM includes ResNet sub-network simulating urban area crowd flow space characteristics, LSTM sub-network simulating urban area crowd flow time characteristics, external factor neural network simulating external factor influence on crowd flow, and fusion module.
Wherein the ResNet sub-networks have s same structures, and the inputs are respectively
Figure BDA0002924292720000058
Each structure of the ResNet sub-network shares L +2 layers, the 1 st layer and the L +2 th layer are convolutional layers and are marked as Conv1 and Conv 2; layers 2 through L +1 are residual units, denoted as restitu 1.. restitu L. The structure of the residual unit is shown in fig. 3, using two convolutional layers, and using the activation function ReLU before each convolutional layer, and finally adding its output to the input of the unit to obtain the final output of the unit
The layer 1 convolutional layer Conv1 contains 64 convolution kernels of 3 × 3, and its input-output relationship satisfies the following equation:
Figure BDA0002924292720000061
wherein ,f1() Is an activation function, representing a convolution operation, Wi (1)
Figure BDA0002924292720000062
Is the weight parameter matrix and offset for the first layer,
Figure BDA0002924292720000063
respectively input and output of the first layer.
The 2 nd layer to the L +1 th layer are residual error units, and the input-output relation of the residual error units satisfies the following formula:
Figure BDA0002924292720000064
wherein ,
Figure BDA0002924292720000065
is a function of the residual error and,
Figure BDA0002924292720000066
all learnable parameters of the l-th layer residual unit are included,
Figure BDA0002924292720000067
respectively input and output of the l-th layer.
The L +2 th layer is convolutional layer Conv2, and contains 2 convolution kernels of 3 × 3. The input-output relation satisfies the following formula:
Figure BDA0002924292720000068
wherein ,f2() Is an activation function, representing a convolution operation, Wi (L+2)
Figure BDA0002924292720000069
Is the weight parameter matrix and offset for layer L +2,
Figure BDA00029242927200000610
respectively, the input and output of the L +2 th layer.
The output of the ResNet subnetwork is then
Figure BDA00029242927200000611
Wherein the LSTM sub-network uses a single layer of LSTM, the sequence length being s. S outputs of ResNet sub-network
Figure BDA00029242927200000612
The structure of the neural cell structure of LSTM, which constitutes the time-sequential inputs of the sub-network of LSTM, is shown in FIG. 4, ft、it、gt and otRespectively a forgetting gate, an input gate, a current state and an output gate. c. CtCell status at time t, htHidden state at time t
For each of the s time-sequential inputs, the forward conduction process of LSTM neural cells can be expressed as:
Figure BDA00029242927200000613
Figure BDA00029242927200000614
Figure BDA00029242927200000615
Figure BDA00029242927200000616
ct=ft*ct-1+it*gt
ht=ot*tanh(ct)
wherein ,
Figure BDA00029242927200000617
constituting the input at time t, ft,it,gt and otRespectively a forgetting gate, an input gate, a current state and an output gate. c. CtCell status at time t, htIs hidden state at time t, simultaneously with
Figure BDA0002924292720000071
Constituting the input for the next stage. σ denotes a sigmoid function, tanh denotes a tanh function, and W and b denote all learnable parameters.
The output of the LSTM subnetwork is then hi|i=1,2,...,s}。
Wherein, the fusion module outputs { h) to the LSTM sub-networkiObtaining an output I by a parameter-based matrix fusion methodResThe formula is as follows:
Figure BDA0002924292720000072
wherein ,WiThe representation of the learnable parameter is,
Figure BDA0002924292720000073
representing a Hadamard product operation, i.e. the multiplication of corresponding elements in two matrices.
Wherein the input of the external factor neural network is a corresponding vector E of the external factor with the length of 28t,EtThe first 8 values in (a) represent a time factor, the 9 th value is a holiday, the 10 th value is an air temperature, the 11 th value is a wind speed, and the last 17 values represent 17 different weather conditions. The external factor neural network is composed of two full connection layers, wherein the first full connection layer FC1 is an embedded layer of each sub-factor; the second layer full connection layer FC2 carries out dimension conversion to output IExtAnd IResHave the same dimension.
Then, the fused output IResOutput I from neural network of external factorsExtPerforming direct addition and fusion, and obtaining the output of the total network, namely the predicted value of the t time period, through the tanh activation function
Figure BDA0002924292720000074
Figure BDA0002924292720000075
Wherein, tanh is an activation function, and the output result is in the range of [ -1, 1 ].
Step S4: constructing a training data set and a testing data set of the network structure based on ResNet and LSTM according to the preprocessed data in the step S2 and the network structure based on ResNet and LSTM constructed in the step S3;
the invention constructs a training data set and a testing data set according to the following modes:
for each eligible time period t, the present invention will
Figure BDA0002924292720000076
As an example in a data set. Wherein,
Figure BDA0002924292720000077
p and q are set to week and day, respectively, s is the sequence length, EtVectors formed for external factors, XtThe urban area crowd flow of the target time period is predicted.
For the taxi bj data set, dividing the beijing city into 32 × 32 areas according to the longitude and latitude, setting the time interval to be 30 minutes, taking the data of the last four weeks as test data, and taking other data as training data; for the BikenYC data set, dividing the New York city into 16 x 8 areas according to the longitude and latitude, setting the time interval to be 1 hour, taking the data of the last ten days as test data, and taking other data as training data.
Step S5: and (4) sending the training data set constructed in the step (S4) into the network structure based on ResNet and LSTM constructed in the step (S3) for network training, and then adjusting the hyper-parameters in the trained network structure by adopting the test data set constructed in the step (S4) to gradually improve the prediction accuracy.
When network training is carried out, the predicted value of the crowd flow in the t-th time period is
Figure BDA0002924292720000081
The real value of the crowd flow in the t time period is XtThe loss function is defined as the mean square error of the two, as shown in the following equation, and the goal of network training is to minimize the mean square error.
Figure BDA0002924292720000082
When network training is carried out, a back propagation method and an Adam algorithm are used, wherein the Adam algorithm stores the exponential decay average value of the previous square gradient and maintains the exponential decay average value of the previous gradient. The learning rate was set to 0.0001, the sequence length to 3, the batch size to 32, and the number of iterations to 500.
After the network training is finished, the network is input by using a test data set for testing, and parameters in a network structure are adjusted according to the comparison between a predicted value and a true value obtained by the network, so that the prediction precision is gradually improved. Finally, the effect of the model is measured by adopting the root mean square error:
Figure BDA0002924292720000083
wherein ,xiAnd
Figure BDA0002924292720000084
the real value and the predicted value of the crowd flow in each area of the city are respectively, and z is the total area number.
And (3) actual effect verification: we compared the model of the present invention with several other mainstream flow prediction models, and the test results are shown in the following table:
model (model) RMSEon TaxiBJ RMSE on BikeNYC
ARIMA 22.78 10.07
ConvLSTM 19.63 8.03
ST-ResNet 16.69 6.99
STDN 16.60 6.24
Ours 16.29 4.98
As can be seen from the table, the inventive model of the present invention is significantly superior to the comparative model.
Step S6: and (4) taking the network structure based on ResNet and LSTM after the network training and testing in the step S5 as a model for predicting the urban regional crowd flow, inputting the preprocessed regional crowd flow state and external influence factors of the target city into the network structure, and finally obtaining the prediction result of the urban regional crowd flow in a certain period of time in the future.
In specific implementation, a person skilled in the art can implement the automatic operation process by using a computer software technology, and a system device for implementing the method, such as a computer-readable storage medium storing a corresponding computer program according to the technical solution of the present invention and a computer device including a corresponding computer program for operating the computer program, should also be within the scope of the present invention.
In some possible embodiments, a system for urban area crowd flow prediction is provided, comprising the following modules,
a first module for downloading a data set, the data set including trajectory data and external influencing factor data;
the second module is used for preprocessing all data in the training data set obtained by the first module, and comprises crowd flow calculation, single-hot coding and normalization processing of external influence factor data;
the third module is used for constructing a network structure based on ResNet and LSTM, and the network structure comprises a ResNet sub-network for simulating urban area crowd flow space characteristics, an LSTM sub-network for simulating urban area crowd flow time characteristics, an external factor neural network for simulating the influence of external factors on crowd flow, and a fusion module;
a fourth module, configured to construct a training data set and a testing data set of a network structure based on ResNet and LSTM according to the preprocessed data obtained by the second module;
the fifth module is used for sending the training data set obtained by the fourth module into a network structure based on ResNet and LSTM obtained by the third module for network training, and then adjusting the hyper-parameters in the trained network structure by adopting the test data set obtained by the fourth module to gradually improve the prediction precision;
and the sixth module is used for taking the network structure based on ResNet and LSTM after network training and testing in the fifth module as a model for predicting the urban regional crowd flow, inputting the preprocessed regional crowd flow state and external influence factors of the target city into the network structure, and finally obtaining the prediction result of the urban regional crowd flow in a certain period of time in the future.
In some possible embodiments, an urban area crowd flow prediction system is provided, which includes a processor and a memory, the memory is used for storing program instructions, and the processor is used for calling the stored instructions in the memory to execute an urban area crowd flow prediction method as described above.
In some possible embodiments, an urban area crowd flow prediction system is provided, which includes a readable storage medium, on which a computer program is stored, and when the computer program is executed, the urban area crowd flow prediction method is implemented as described above.
All features disclosed in this specification may be combined in any combination, except features that are mutually exclusive.
Any feature disclosed in this specification (including any accompanying claims, abstract and drawings), may be replaced by alternative features serving equivalent or similar purposes, unless expressly stated otherwise. That is, unless expressly stated otherwise, each feature is only an example of a generic series of equivalent or similar features.
The specific embodiments described herein are merely illustrative of the spirit of the invention. Various modifications or additions may be made to the described embodiments or alternatives may be employed by those skilled in the art without departing from the spirit or ambit of the invention as defined in the appended claims.

Claims (10)

1. A urban area crowd flow prediction method is characterized by comprising the following steps: comprises the following steps of (a) carrying out,
step S1, downloading a data set, wherein the data set comprises track data and external influence factor data;
step S2, preprocessing all data in the training data set obtained in the step S1, including crowd flow calculation, one-hot coding and normalization processing of external influence factor data;
step S3, constructing a network structure based on ResNet and LSTM, wherein the network structure comprises a ResNet sub-network for simulating urban area crowd flow space characteristics, an LSTM sub-network for simulating urban area crowd flow time characteristics, an external factor neural network for simulating the influence of external factors on crowd flow, and a fusion module;
step S4, constructing a training data set and a testing data set of the network structure based on ResNet and LSTM according to the preprocessed data obtained in the step S2;
step S5, sending the training data set obtained in the step S4 into the network structure based on ResNet and LSTM obtained in the step S3 for network training, and then adjusting the hyper-parameters in the trained network structure by adopting the test data set obtained in the step S4 to gradually improve the prediction accuracy;
and step S6, taking the network structure based on ResNet and LSTM after the network training and testing in the step S5 as a model for predicting urban regional crowd flow, inputting the preprocessed regional crowd flow state and external influence factors of the target city into the network structure, and finally obtaining the prediction result of the urban regional crowd flow in a certain period of time in the future.
2. The urban area crowd flow prediction method according to claim 1, characterized in that: the trajectory data used in step S1 are taxi trajectory data and public bicycle riding data.
3. The urban area crowd flow prediction method according to claim 1, characterized in that: the external influence factor data includes time, holidays, air temperature, wind speed, and weather.
4. The urban area crowd flow prediction method according to claim 1, 2 or 3, characterized in that: the ResNet sub-networks have s identical structures with inputs of
Figure FDA0002924292710000011
Each knotL +2 layers are constructed, the 1 st layer is convolutional layer Conv1 and contains 64 convolution kernels of 3 × 3, the 2 nd to the L +1 st layers are residual units ResUnit1 to ResUnitL, each residual unit contains 64 convolution kernels of 3 × 3, and the L +2 nd layer is convolutional layer Conv2 and contains 2 convolution kernels of 3 × 3; the output of the ResNet subnetwork is
Figure FDA0002924292710000012
5. The urban area crowd flow prediction method according to claim 4, characterized in that: sequence length of LSTM sub-network is s, s outputs of ResNet sub-network
Figure FDA0002924292710000013
The time sequential inputs that make up the LSTM sub-network, the output of the LSTM sub-network is { hi|i=1,2,...,s}。
6. The urban area crowd flow prediction method according to claim 5, characterized in that: output of fusion module to LSTM subnetwork { hiObtaining an output I by a parameter-based matrix fusion methodResThe formula is as follows:
Figure FDA0002924292710000021
wherein ,WiThe representation of the learnable parameter is,
Figure FDA0002924292710000023
representing a Hadamard product operation.
7. The urban area crowd flow prediction method according to claim 6, characterized in that: the input of the external factor neural network is a corresponding vector E of the external influencing factortThe external factor neural network is composed of two full connection layers, wherein the first full connection layer FC1 is an embedded layer of each sub-factor; second oneThe layer full connection layer FC2 performs dimension conversion to output IExtAnd IResHave the same dimension;
then, the fused output IResOutput I from neural network of external factorsExtPerforming direct addition and fusion, and obtaining the output of the total network, namely the predicted value of the t time period, through the tanh activation function
Figure FDA0002924292710000022
8. A urban area crowd flow prediction system is characterized in that: the method for realizing urban area crowd flow prediction according to any one of claims 1-7.
9. The urban area crowd flow prediction system of claim 8, wherein: comprises the following modules which are used for realizing the functions of the system,
a first module for downloading a data set, the data set including trajectory data and external influencing factor data;
the second module is used for preprocessing all data in the training data set obtained by the first module, and comprises crowd flow calculation, single-hot coding and normalization processing of external influence factor data;
the third module is used for constructing a network structure based on ResNet and LSTM, and the network structure comprises a ResNet sub-network for simulating urban area crowd flow space characteristics, an LSTM sub-network for simulating urban area crowd flow time characteristics, an external factor neural network for simulating the influence of external factors on crowd flow, and a fusion module;
a fourth module, configured to construct a training data set and a testing data set of a network structure based on ResNet and LSTM according to the preprocessed data obtained by the second module;
the fifth module is used for sending the training data set obtained by the fourth module into a network structure based on ResNet and LSTM obtained by the third module for network training, and then adjusting the hyper-parameters in the trained network structure by adopting the test data set obtained by the fourth module to gradually improve the prediction precision;
and the sixth module is used for taking the network structure based on ResNet and LSTM after network training and testing in the fifth module as a model for predicting the urban regional crowd flow, inputting the preprocessed regional crowd flow state and external influence factors of the target city into the network structure, and finally obtaining the prediction result of the urban regional crowd flow in a certain period of time in the future.
10. The urban area crowd flow prediction system of claim 8, wherein: comprising a processor and a memory, the memory being adapted to store program instructions, the processor being adapted to invoke the stored instructions in the memory to perform a method of urban area crowd flow prediction according to any of claims 1 to 7.
CN202110126835.1A 2021-01-29 2021-01-29 Urban area crowd flow prediction method and system Active CN112766600B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110126835.1A CN112766600B (en) 2021-01-29 2021-01-29 Urban area crowd flow prediction method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110126835.1A CN112766600B (en) 2021-01-29 2021-01-29 Urban area crowd flow prediction method and system

Publications (2)

Publication Number Publication Date
CN112766600A true CN112766600A (en) 2021-05-07
CN112766600B CN112766600B (en) 2023-05-26

Family

ID=75703750

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110126835.1A Active CN112766600B (en) 2021-01-29 2021-01-29 Urban area crowd flow prediction method and system

Country Status (1)

Country Link
CN (1) CN112766600B (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113570867A (en) * 2021-09-26 2021-10-29 西南交通大学 Urban traffic state prediction method, device, equipment and readable storage medium
CN113935510A (en) * 2021-08-24 2022-01-14 深圳大学 Crowd distribution prediction method, device, equipment and storage medium
CN113947250A (en) * 2021-10-22 2022-01-18 山东大学 Urban fine-grained flow prediction method and system based on limited data resources
CN117649028A (en) * 2024-01-26 2024-03-05 南京航空航天大学 Urban function area matching-based inter-urban crowd flow trend prediction method

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109299401A (en) * 2018-07-12 2019-02-01 中国海洋大学 Metropolitan area space-time stream Predicting Technique based on deep learning model LSTM-ResNet
CN109492822A (en) * 2018-11-24 2019-03-19 上海师范大学 Air pollutant concentration time-space domain interaction prediction method
CN109902880A (en) * 2019-03-13 2019-06-18 南京航空航天大学 A kind of city stream of people's prediction technique generating confrontation network based on Seq2Seq
US20200034436A1 (en) * 2018-07-26 2020-01-30 Google Llc Machine translation using neural network models
CN111861027A (en) * 2020-07-29 2020-10-30 北京工商大学 Urban traffic flow prediction method based on deep learning fusion model
CN112183824A (en) * 2020-09-11 2021-01-05 武汉大学 Online and offline associated urban passenger flow prediction method
CN112257934A (en) * 2020-10-26 2021-01-22 辽宁工程技术大学 Urban people flow prediction method based on space-time dynamic neural network

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109299401A (en) * 2018-07-12 2019-02-01 中国海洋大学 Metropolitan area space-time stream Predicting Technique based on deep learning model LSTM-ResNet
US20200034436A1 (en) * 2018-07-26 2020-01-30 Google Llc Machine translation using neural network models
CN109492822A (en) * 2018-11-24 2019-03-19 上海师范大学 Air pollutant concentration time-space domain interaction prediction method
CN109902880A (en) * 2019-03-13 2019-06-18 南京航空航天大学 A kind of city stream of people's prediction technique generating confrontation network based on Seq2Seq
CN111861027A (en) * 2020-07-29 2020-10-30 北京工商大学 Urban traffic flow prediction method based on deep learning fusion model
CN112183824A (en) * 2020-09-11 2021-01-05 武汉大学 Online and offline associated urban passenger flow prediction method
CN112257934A (en) * 2020-10-26 2021-01-22 辽宁工程技术大学 Urban people flow prediction method based on space-time dynamic neural network

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
段宗涛: "基于深度CNN-LSTM-ResNet组合模型的出租车需求预测", 《交通运输系统工程与信息》 *
蒲悦逸: "基于CNN-ResNet-LSTM模型的城市短时交通流量预测算法", 《北京邮电大学学报》 *

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113935510A (en) * 2021-08-24 2022-01-14 深圳大学 Crowd distribution prediction method, device, equipment and storage medium
CN113935510B (en) * 2021-08-24 2022-05-31 深圳大学 Crowd distribution prediction method, device, equipment and storage medium
CN113570867A (en) * 2021-09-26 2021-10-29 西南交通大学 Urban traffic state prediction method, device, equipment and readable storage medium
CN113570867B (en) * 2021-09-26 2021-12-07 西南交通大学 Urban traffic state prediction method, device, equipment and readable storage medium
CN113947250A (en) * 2021-10-22 2022-01-18 山东大学 Urban fine-grained flow prediction method and system based on limited data resources
CN117649028A (en) * 2024-01-26 2024-03-05 南京航空航天大学 Urban function area matching-based inter-urban crowd flow trend prediction method
CN117649028B (en) * 2024-01-26 2024-04-02 南京航空航天大学 Urban function area matching-based inter-urban crowd flow trend prediction method

Also Published As

Publication number Publication date
CN112766600B (en) 2023-05-26

Similar Documents

Publication Publication Date Title
CN112766600B (en) Urban area crowd flow prediction method and system
Liu et al. Dynamic spatial-temporal representation learning for traffic flow prediction
CN109492814B (en) Urban traffic flow prediction method, system and electronic equipment
CN112085163A (en) Air quality prediction method based on attention enhancement graph convolutional neural network AGC and gated cyclic unit GRU
CN102622418B (en) Prediction device and equipment based on BP (Back Propagation) nerve network
CN112910711B (en) Wireless service flow prediction method, device and medium based on self-attention convolutional network
CN102622515B (en) A kind of weather prediction method
CN113194493B (en) Wireless network data missing attribute recovery method and device based on graph neural network
CN111967679A (en) Ionized layer total electron content forecasting method based on TCN model
CN106875004A (en) Composite mode neuronal messages processing method and system
CN114330935B (en) New energy power prediction method and system based on multiple combination strategies integrated learning
CN117634554A (en) Space-time deep learning runoff prediction method and system based on spatial information fusion
CN116523001A (en) Method, device and computer equipment for constructing weak line identification model of power grid
CN114572229B (en) Vehicle speed prediction method, device, medium and equipment based on graph neural network
CN115600498A (en) A Wind Speed Forecast Correction Method Based on Artificial Neural Network
CN118114057B (en) Model training method, runoff prediction method, electronic device, and storage medium
CN112862084B (en) Traffic flow prediction method based on deep migration fusion learning
CN114462572A (en) Air quality prediction method and device based on space-time fusion diagram
CN117034780B (en) Multi-scale sub-season precipitation prediction method based on deep learning
CN111783688B (en) Remote sensing image scene classification method based on convolutional neural network
CN116227738B (en) Method and system for predicting traffic interval of power grid customer service
Nejković et al. Ultramarathon result and injury prediction using PyTorch
CN116843069A (en) Commuting flow estimation method and system based on crowd activity intensity characteristics
CN116699731A (en) Tropical cyclone path short-term forecasting method, system and storage medium
CN116612633A (en) Self-adaptive dynamic path planning method based on vehicle-road cooperative sensing

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