CN116629460B - Subway passenger flow prediction method based on ST-RANet model - Google Patents

Subway passenger flow prediction method based on ST-RANet model Download PDF

Info

Publication number
CN116629460B
CN116629460B CN202310908667.0A CN202310908667A CN116629460B CN 116629460 B CN116629460 B CN 116629460B CN 202310908667 A CN202310908667 A CN 202310908667A CN 116629460 B CN116629460 B CN 116629460B
Authority
CN
China
Prior art keywords
time
passenger flow
space
subway
module
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
CN202310908667.0A
Other languages
Chinese (zh)
Other versions
CN116629460A (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.)
China University of Mining and Technology Beijing CUMTB
Original Assignee
China University of Mining and Technology Beijing CUMTB
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 China University of Mining and Technology Beijing CUMTB filed Critical China University of Mining and Technology Beijing CUMTB
Priority to CN202310908667.0A priority Critical patent/CN116629460B/en
Publication of CN116629460A publication Critical patent/CN116629460A/en
Application granted granted Critical
Publication of CN116629460B publication Critical patent/CN116629460B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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/0464Convolutional networks [CNN, ConvNet]
    • 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
    • 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/40Business processes related to the transportation industry
    • 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
    • Y02A90/00Technologies having an indirect contribution to adaptation to climate change
    • Y02A90/10Information and communication technologies [ICT] supporting adaptation to climate change, e.g. for weather forecasting or climate simulation

Landscapes

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

Abstract

The embodiment of the invention discloses a subway passenger flow prediction method based on an ST-RANet model, which comprises the following steps: acquiring historical passenger flow data of subway in and out stations and external factor data corresponding to time and space, and fusing the passenger flow data with the corresponding external factor data to form a subway data set of a region to be predicted; modeling passenger flow data in the subway data set of the region to be predicted according to three time scales of adjacency, periodicity and trend respectively, constructing three space-time modules of adjacency, periodicity and trend, and taking input tensors of historical passenger flow data corresponding to each time segment as inputs of the three space-time modules; fusing the output results of the three space-time modules to obtain a space-time module output model; and constructing an external factor module, and fusing an external factor module output model with a space-time module output model to obtain a passenger flow predictive value model ST-RANet. The passenger flow prediction method and the passenger flow prediction system can solve the problem that passenger flow prediction is inaccurate due to influence factors such as periodicity, trend, volatility and randomness.

Description

Subway passenger flow prediction method based on ST-RANet model
Technical Field
The invention relates to the technical field of urban rail transit, in particular to a subway passenger flow prediction method based on an ST-RANet model.
Background
The rapid development of economy and the continuous improvement of the level of urbanization lead to the continuous expansion of the urban scale, thereby bringing about the ever-increasing travel demands. Urban rail transit is a novel green and efficient public transportation mode, makes reasonable use of underground space, can solve daily travel demands of people, and becomes an important component of transportation.
Passenger flow prediction is one of key technologies for ensuring normal operation and optimizing planning of a rail transit system. The high-precision short-term passenger flow prediction not only can help operators optimize resource utilization, such as passenger flow control and train operation time adjustment in advance, but also can predict station crowding degree in advance, and ensure people life and property safety. In a word, the urban rail transit short-term passenger flow prediction has important significance in the fields of daily operation, fine management, planning, public safety and the like of rail transit.
When subway passenger flow prediction is carried out, because passenger flow has the characteristics of periodicity, trend, volatility and randomness, future passenger flow is difficult to accurately predict only by means of historical data, so that the passenger flow prediction is usually carried out by adopting a deep learning-based method by modern technology, and the high-precision subway passenger flow prediction becomes a challenging problem in the field of deep learning.
Disclosure of Invention
Therefore, an objective of the embodiments of the present invention is to provide a subway passenger flow prediction method based on an ST-RANet model, which can solve the problem of inaccurate passenger flow prediction caused by factors such as periodicity, trend, volatility, randomness, and the like.
Embodiments of the present invention are implemented as follows:
a subway passenger flow prediction method based on an ST-RANet model comprises the following steps:
acquiring historical passenger flow data of subway in and out stations and external factor data corresponding to time and space, constructing a feature map according to a distribution network of subway stations in a region to be predicted, and fusing the passenger flow data with the corresponding external factor data to form a subway data set in the region to be predicted;
classifying the time segments of the passenger flow data in the subway data set of the region to be predicted according to three time scales of the adjacency, the periodicity and the trend respectively, modeling the passenger flow data in the subway data set of the region to be predicted, building three space-time modules of the adjacency, the periodicity and the trend, and taking input tensors of the historical passenger flow data corresponding to each time segment as the inputs of the three space-time modules;
fusing the output results of the three space-time modules to obtain a space-time module output model;
constructing an external factor module according to the acquired external factor data, and fusing an external factor module output model with a space-time module output model to obtain a passenger flow predicted value model ST-RANet;
and acquiring real-time passenger flow data of subway station in-out and out-of-station and external factor data corresponding to time and space, inputting the real-time passenger flow data and the external factor data corresponding to the passenger flow prediction value model ST-RANet, and performing passenger flow prediction.
In a preferred embodiment of the present invention, in the above method for predicting subway passenger flow based on ST-RANet model, the historical passenger flow data is obtained by statistics of subway automatic fare collection system data;
the external factor data includes holiday date and meteorological data, wherein the meteorological data includes weather, temperature and wind speed indicators.
In a preferred embodiment of the present invention, in the above method for predicting subway passenger flow based on ST-RANet model, after obtaining historical passenger flow data of subway in and out stations and external factor data corresponding to time and space, scaling operation is performed to obtain unified passenger flow data;
and constructing a feature map according to a distribution network of subway stations of the region to be predicted, and forming a subway data set of the region to be predicted from the unified passenger flow data.
In a preferred embodiment of the present invention, in the above subway passenger flow prediction method based on the ST-RANet model, the classifying the passenger flow data in the subway data set of the region to be predicted according to three time scales of proximity, periodicity and trend, modeling the passenger flow data in the subway data set of the region to be predicted, building three space-time modules of proximity, periodicity and trend, and taking input tensors of the historical passenger flow data corresponding to each time segment as inputs of the three space-time modules, including:
classifying passenger flow data in subway data sets of a region to be predicted according to adjacent time periods, same time periods adjacent to a plurality of days and same time periods adjacent to a plurality of weeks in sequence, and extracting characteristics of three time scales of adjacency, periodicity and trending of historical passenger flow data;
dividing the total daily time length into T time steps at equal intervals, and intercepting adjacent time segments P along a time axis in an adjacent time scale for the time step T to be predicted closeness The same time slices P adjacent to several days are intercepted along the time axis in a periodic time scale period Intercepting adjacent identical time segments P of several weeks along a time axis on a trending time scale trend
Building a proximity space-time module, and representing a proximity time segment P by a variable c closeness The number of time slices involved is chosen to be the number of time slices,representing adjacent time segments P closeness The corresponding historical passenger flow data input tensor is used as the input of the proximity space-time module;
constructing a periodic space-time module, and representing the same time segment P adjacent to a plurality of days by using a variable d period The number of time slices involved is chosen to be the number of time slices,representing the same time segment P of several days in the neighborhood period The corresponding historical passenger flow data input tensor is used as the input of the periodic space-time module;
building a trend space-time module, and representing adjacent time segments P with the same weeks by using a variable w trend The number of time slices involved is chosen to be the number of time slices,representing adjacent several weeks identical time segments P trend The corresponding historical passenger flow data input tensor is used as the input of the trend space-time module.
In a preferred embodiment of the present invention, in the above method for predicting subway passenger flow based on ST-RANet model, the historical passenger flow data input tensor of the proximity space-time module isWherein the method comprises the steps ofR is a domain, and I×J represents the size of a spatial region;
the proximity spatiotemporal module employs a two-channel traffic matrix of the nearest c time slices.
In a preferred embodiment of the present invention, in the above method for predicting subway passenger flow based on ST-RANet model, the input tensor of the historical passenger flow data of the periodic space-time module isWherein the method comprises the steps ofR is a domain, and I×J represents the size of a spatial region;
the periodic space-time module adopts a two-channel passenger flow matrix of the same time slice of the previous d days adjacent to the t time slice.
In a preferred embodiment of the present invention, in the above method for predicting subway passenger flow based on ST-RANet model, the historical passenger flow data input tensor of the trend spatio-temporal module isWherein the method comprises the steps ofR is a domain, and I×J represents the size of a spatial region;
the trending spatiotemporal module employs a two-channel passenger flow matrix adjacent to a number of weeks of the same time slice.
In a preferred embodiment of the present invention, in the above method for predicting subway passenger flow based on ST-RANet model, after three space-time modules of adjacency, periodicity and trend are built, two-layer convolution operations are performed respectively, including:
input tensor X for historical passenger flow data (0) Performing a first layer convolution operation to obtain a first input tensor X (1) =f(W (1) *X (0) +b (1) ) Wherein tensor X is input (0) Is thatAny one of X (0) ∈R 2L×I×J L represents the length of the input tensor, the length value of the input tensor is one of c, d and W, the convolution operation, f is the activation function, W (1) And b (1) Is a parameter in the first layer convolution operation;
for the first input tensor X (1) Weighting the channel attention module to obtain a channel weighted tensorWherein M is c Representing the channel attention module versus the first input tensor X (1) The operations performed->Representing the corresponding position elements of the matrix to perform product;
spatial attention module weighting is performed to obtain an attention weighted input tensorWherein M is s Representing the operation of the spatial attention module on the channel weighting tensor F, +.>Representing the corresponding position elements of the matrix to perform product;
adding k layers of residual units to the attention weighted input tensor to obtain residual weighted input tensorWherein X is (k+1) And X (k+2) Respectively representing the input and output of the kth residual unit,/->As residual unit function, θ (k) All the parameters that are learned including the kth residual unit;
for the residual errorThe weighted input tensor carries out second-layer convolution operation, channel attention module weighting and space attention module weighting to obtain a second input tensor X (k+4) The output result of the proximity module isThe output result of the periodicity module is +.>The output result of the trend module is +.>
In a preferred embodiment of the present invention, in the above method for predicting subway passenger flow based on ST-RANet model, the step of fusing output results of three space-time modules to obtain a space-time module output model includes:
the output results of the three space-time modules are fused by adopting a fusion mode based on a parameter matrix, and a space-time module output model is obtainedWherein W is c 、W p 、W q Respectively are weight parameters, W c Indicating the extent of influence of proximity, W p Indicating the degree of influence of periodicity, W q Indicating the extent of influence of trending ++>Representing the Hadamard product.
In a preferred embodiment of the present invention, in the above subway passenger flow prediction method based on ST-RANet model, the constructing an external factor module, fusing an output model of the external factor module with an output model of the space-time module, to obtain a passenger flow prediction value model ST-RANet includes:
by E t Characteristic of external factors representing the time step t to be predicted, using X t Representing the passenger flow tensor at the time step t to be predicted, at E t Two layers of full-connecting layers are overlapped, and the first layer is an outer layerAn embedding layer of the partial factor data, a second layer is used for mapping the low-dimensional characteristic matrix of the external factor data to X t Respectively adding an activation function into two full-connection layers of the high-dimensional matrix with the same dimension to obtain an external factor module output model X Ext
Wherein the connection layer is used for mapping input data from a low-dimensional space to a high-dimensional space, the low-dimensional feature matrix refers to one-dimensional external factor data, and the high-dimensional matrix changes the shape of the low-dimensional feature matrix to be X-shaped t The same homography matrix;
fusing the external factor module output model and the space-time module output model to obtain a passenger flow predicted value Y representing the t-th time period t Passenger flow predictive value model Y of (2) t =Tanh(X Res +X Ext ) Where Tanh () is a hyperbolic tangent function for ensuring that the output range of data is between (-1, 1).
The embodiment of the invention has the beneficial effects that:
the invention provides a subway scene prediction model ST-RANet based on deep learning, develops a passenger flow prediction method and system construction for urban rail transit stations, introduces a convolution attention mechanism module (CBAM), extracts time characteristics and space characteristics of passenger flow in multiple time scales, distributes different weights for different time-space areas, more deeply excavates the characteristics of space-time data, comprehensively considers passenger flow external influence factors such as holiday information, weather conditions and wind power, and comprehensively considers the influence brought by periodicity, trend, volatility and randomness of passenger flow presentation through extracting the time characteristics, the space characteristics and the external characteristics, realizes simultaneous passenger flow prediction for all stations of the rail transit network, obtains comprehensive and real-time high-precision prediction results, and has good accuracy, openness, ductility and self-adaptability. The excellent performance of the method in the subway scene proves that the method can meet the requirements of regional passenger flow prediction tasks of the subway station in real time.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings that are needed in the embodiments will be briefly described below, it being understood that the following drawings only illustrate some embodiments of the present invention and therefore should not be considered as limiting the scope, and other related drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow chart of a subway passenger flow prediction method based on an ST-RANet model;
FIG. 2 is a schematic diagram of an ST-RANet (Spatial-temporal attention residual network) model structure for subway passenger flow prediction;
FIG. 3a is a schematic diagram of a data distribution structure of a proximity spatiotemporal module in the ST-RANet model of the present invention;
FIG. 3b is a schematic diagram of a data distribution structure of a periodic space-time module in the ST-RANet model according to the invention;
FIG. 3c is a schematic diagram of a data distribution structure of a trend spatiotemporal module in the ST-RANet model of the present invention;
fig. 4 is a schematic diagram of a residual learning unit in the ST-rant model of the present invention.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present invention more apparent, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention, and it is apparent that the described embodiments are some embodiments of the present invention, but not all embodiments of the present invention. The components of the embodiments of the present invention generally described and illustrated in the figures herein can be arranged and designed in a wide variety of different configurations.
The subway passenger flow prediction method based on the ST-RANet (Spatial-temporal attention residual network) model, provided by the first embodiment of the invention, is mainly applied to complex scenes of underground spaces such as subways.
The complete ST-RANet network model structure diagram in the invention is shown in figure 2.
As shown in fig. 1, the subway passenger flow prediction method based on the ST-RANet model of the invention comprises the following steps:
acquiring historical passenger flow data of subway in and out stations and external factor data corresponding to time and space, constructing a feature map according to a distribution network of subway stations in a region to be predicted, and fusing the passenger flow data with the corresponding external factor data to form a subway submayBJ data set in the region to be predicted;
classifying the time segments of the passenger flow data in the subway data set of the region to be predicted according to three time scales of the adjacency, the periodicity and the trend respectively, modeling the passenger flow data in the subway data set of the region to be predicted, building three space-time modules of the adjacency, the periodicity and the trend, and taking input tensors of the historical passenger flow data corresponding to each time segment as the inputs of the three space-time modules;
fusing the output results of the three space-time modules to obtain a space-time module output model;
constructing an external factor module according to the acquired external factor data, and fusing an external factor module output model with a space-time module output model to obtain a passenger flow predicted value model ST-RANet;
and acquiring real-time passenger flow data of subway station in-out and out-of-station and external factor data corresponding to time and space, inputting the real-time passenger flow data and the external factor data corresponding to the passenger flow prediction value model ST-RANet, and performing passenger flow prediction.
In a preferred embodiment of the present invention, in the above method for predicting subway passenger flow based on ST-RANet model, the historical passenger flow data is obtained by statistics of subway automatic fare collection system data;
the external factor data includes holiday date and meteorological data, wherein the meteorological data includes weather, temperature and wind speed indicators.
In a preferred embodiment of the present invention, in the above method for predicting subway passenger flow based on ST-RANet model, after obtaining historical passenger flow data of subway in and out stations and external factor data corresponding to time and space, scaling operation is performed to obtain unified passenger flow data;
and constructing a feature map according to a distribution network of subway stations in the region to be predicted, and forming a subswayBJ data set from the unified passenger flow data.
Taking Beijing subway scenes as an example when creating a subway data set, aiming at considering periodicity, trend, volatility and randomness affecting passenger flow as much as possible, the subway data set constructed by the invention comprises real subway entrance and exit passenger flow data and external factor data, wherein the subway entrance and exit passenger flow data are obtained by statistics of subway automatic fare collection system data, the fused external factor data comprise holiday date and meteorological data, the meteorological data comprise indexes such as weather, temperature, wind speed and the like, scaling the data into data in a uniform range, and constructing a feature map according to a distribution network of subway stations to form the subway BJ data set;
in this embodiment, the inbound and outbound passenger flow data of 16 stations in the 13 # line of Beijing subway are selected, the time granularity is 30min, the available time segments are 30816, the available time segments comprise holidays and daily weather information in the corresponding time period, shape is 30816,2,4,4, 2 in the second position represents inbound and outbound, and the two last positions represent 4×4 station distribution network, so as to manufacture a subsway BJ data set. Traversing the time slices of the original data, removing the time slices which lack adjacent, periodic and trend time periods, and finally obtaining 25296 time slices. Data from 28 days post-selection were used as test sets, with the remaining data used for model training, thus yielding test set sizes (1344,2,4,4) and training set sizes (23952,2,4,4).
In a preferred embodiment of the present invention, in the above subway passenger flow prediction method based on the ST-RANet model, the classifying the passenger flow data in the subway data set of the region to be predicted according to three time scales of proximity, periodicity and trend, modeling the passenger flow data in the subway data set of the region to be predicted, building three space-time modules of proximity, periodicity and trend, and taking input tensors of the historical passenger flow data corresponding to each time segment as inputs of the three space-time modules, including:
classifying the passenger flow data in the subshayBJ data set according to the adjacent time period, the same time period adjacent to a plurality of days and the same time period adjacent to a plurality of weeks in sequence, and extracting the characteristics of three time scales of the adjacency, the periodicity and the trend of the historical passenger flow data;
dividing the total daily time length into T time steps at equal intervals, and intercepting adjacent time segments P along a time axis in an adjacent time scale for the time step T to be predicted closeness The same time slices P adjacent to several days are intercepted along the time axis in a periodic time scale period Intercepting adjacent identical time segments P of several weeks along a time axis on a trending time scale trend
Building a proximity space-time module, and representing a proximity time segment P by a variable c closeness The number of time slices involved is chosen to be the number of time slices,representing adjacent time segments P closeness The corresponding historical passenger flow data input tensor is used as the input of the proximity space-time module;
constructing a periodic space-time module, and representing the same time segment P adjacent to a plurality of days by using a variable d period The number of time slices involved is chosen to be the number of time slices,representing the same time segment P of several days in the neighborhood period The corresponding historical passenger flow data input tensor is used as the input of the periodic space-time module;
building a trend space-time module, and representing adjacent time segments P with the same weeks by using a variable w trend The number of time slices involved is chosen to be the number of time slices,representing adjacent several weeks identical time segments P trend The corresponding historical passenger flow data input tensor is used as the input of the trend space-time module.
As shown in fig. 3a, in the preferred embodiment of the present invention, in the above subway passenger flow prediction method based on the ST-RANet model, the historical passenger flow data input tensor of the proximity space-time module isWherein->R is a domain, and I×J represents the size of a spatial region;
the proximity spatiotemporal module employs a two-channel traffic matrix of the nearest c time slices.
As shown in fig. 3b, in the above-mentioned subway passenger flow prediction method based on ST-RANet model according to the preferred embodiment of the present invention, the historical passenger flow data input tensor of the periodic space-time module isWherein->R is a domain, and I×J represents the size of a spatial region;
the periodic space-time module adopts a two-channel passenger flow matrix of the same time slice of the previous d days adjacent to the t time slice.
As shown in fig. 3c, in the preferred embodiment of the present invention, in the above subway passenger flow prediction method based on the ST-RANet model, the historical passenger flow data input tensor of the trend spatio-temporal module isWherein->R is a domain, and I×J represents the size of a spatial region;
the trending spatiotemporal module employs a two-channel passenger flow matrix adjacent to a number of weeks of the same time slice.
As shown in fig. 3a, 3b and 3c, the ST-RANet passenger flow prediction model of the present invention includes three space-time feature modules, namely a proximity module close, a periodicity module period and a trend module trend. The three space-time feature modules share the same network structure to extract space-time features, and each space-time feature module consists of convolution operation, a CBAM attention mechanism and a residual error learning unit.
The convolution operation Conv1 is performed first, and the dependence of the spatially close-distance site is captured.
In a preferred embodiment of the present invention, in the above method for predicting subway passenger flow based on ST-RANet model, after three space-time modules of adjacency, periodicity and trend are built, two-layer convolution operations are performed respectively, including:
input tensor X for historical passenger flow data (0) Performing a first layer convolution operation to obtain a first input tensor X (1) =f(W (1) *X (0) +b (1) ) Wherein tensor X is input (0) Is thatAny one of X (0) ∈R 2L×I×J L represents the length of the input tensor, the length value of the input tensor is one of c, d and W, the convolution operation, f is the activation function, W (1) And b (1) Is a parameter in the first layer convolution operation;
after the first convolution operation, performing CBAM1 operation, namely adding a CBAM attention mechanism, and enhancing the expression capacity of the network so as to improve the accuracy of the model. The CBAM attention mechanism is composed of a channel attention mechanism module and a spatial attention mechanism module.
For the first input tensor X (1) Weighting the channel attention module to obtain a channel weighted tensorWherein M is c Representing the channel attention module versus the first input tensor X (1) The operations performed->Representing the corresponding position elements of the matrix to perform product;
spatial attention module weighting is performed to obtain an attention weighted input tensorWherein M is s Representing the manipulation of the channel weighted tensor F by the spatial attention moduleDo nothing>Representing the corresponding position elements of the matrix to perform product;
after CBAM1 operation, adding a k-layer residual unit to the attention weighted input tensor, where the structure is as shown in fig. 4, to obtain a residual weighted input tensorWherein X is (k+1) And X (k+2) Respectively representing the input and output of the kth residual unit,/->As residual unit function, θ (k) All the parameters that are learned including the kth residual unit;
in fig. 4, relu represents an activation function layer in the convolutional neural network, conv represents a convolutional layer in the convolutional neural network, and output represents an output;
performing CBAM2 operation and a convolution layer Conv2 on the k residual units to obtain a second input tensor X (k+4) The output result of the proximity module isThe output result of the periodicity module is +.>The output result of the trend module is
In a preferred embodiment of the present invention, in the above method for predicting subway passenger flow based on ST-RANet model, the step of fusing output results of three space-time modules to obtain a space-time module output model includes:
building a space-time module, wherein three space-time modules are adopted by adopting a fusion mode based on a parameter matrix due to different influence degrees of adjacency, periodicity and trend on different sitesFusion of output results of the blocks to obtain a space-time module output modelWherein W is c 、W p 、W q Respectively are weight parameters, W c Indicating the extent of influence of proximity, W p Indicating the degree of influence of periodicity, W q Indicating the extent of influence of trending ++>Representing the Hadamard product.
The external factor module comprises important factors affecting the passenger flow of the rail transit, such as holidays, weather, and the like. As shown in fig. 2, the external factor data obtained in the first step is input into the module. In a preferred embodiment of the present invention, in the above subway passenger flow prediction method based on ST-RANet model, the constructing an external factor module, fusing an output model of the external factor module with an output model of the space-time module, to obtain a passenger flow prediction value model ST-RANet includes:
the holiday information of the time slice t can be directly obtained, and the weather information of the prediction time is unknown in actual conditions, so that the weather information of the time slice t-1 is adopted to replace the weather information approximately.
By E t Characteristic of external factors representing the time step t to be predicted, using X t Representing the tensor of passenger flow at the time step t to be predicted for 16 stations (4*4), at E t Two layers of full-connection layers are overlapped, wherein the first layer is an embedded layer of external factor data, and the second layer is a low-dimensional feature matrix mapping of the external factor data to X t Respectively adding an activation function into two full-connection layers of the high-dimensional matrix with the same dimension to obtain an external factor module output model X Ext
Wherein the connection layer is used for mapping input data from a low-dimensional space to a high-dimensional space, wherein the low-dimensional feature matrix refers to one-dimensional external factor data, and the high-dimensional matrix changes the shape of the input data to X t The same 4*4;
the external factor module output model and the space-time module output modelFusion is carried out to obtain a passenger flow predicted value Y representing the t time period t Passenger flow predictive value model Y of (2) t =Tanh(X Res +X Ext ) Where Tanh () is a hyperbolic tangent function for ensuring that the output range of data is between (-1, 1).
In a preferred embodiment of the present invention, in the above subway passenger flow prediction method based on the ST-RANet model, the ST-RANet model is formed through training the model;
and inputting real historical in-out passenger flow data of the subway station and external factor data of corresponding time to the ST-RANet model for passenger flow prediction. The invention tests the predictive effect of the ST-RANet model on the test set of the subswaybj dataset. Using Mean Absolute Percentage Error (MAPE) as a measure of accuracy, the ST-RANet model prediction error was found to be only 0.78%.
A second embodiment of the present invention provides a subway passenger flow prediction system based on an ST-RANet model, including:
the data acquisition module is used for acquiring passenger flow data of subway in and out stations and external factor data, constructing a feature map according to a distribution network of subway stations in a region to be predicted, and forming the passenger flow data into a subway BJ data set;
the passenger flow model building module is used for modeling the passenger flow data in the subway data set of the region to be predicted according to three time scales of adjacency, periodicity and trend respectively to obtain an input tensor of historical passenger flow as the input of the three space-time modules;
the space-time model construction module is used for constructing three space-time modules of adjacency, periodicity and trend, and fusing the output results of the three space-time modules to obtain a space-time module output model;
the fusion module is used for constructing an external factor module, and fusing the external factor module output model with the space-time module output model to obtain a passenger flow predicted value model ST-RANet;
the passenger flow prediction module is used for inputting real historical in-out passenger flow data of the subway station and external factor data of corresponding time to the passenger flow prediction value model ST-RANet to conduct passenger flow prediction.
The embodiment of the invention aims to protect a subway passenger flow prediction method based on an ST-RANet model, which has the following effects:
1. the invention develops a passenger flow prediction method and system construction for urban rail transit stations, introduces a convolution attention mechanism module (CBAM), extracts time characteristics and space characteristics of passenger flow in multiple time scales, distributes different weights for different time-space areas, more deeply excavates the characteristics of space-time data, comprehensively considers passenger flow external influence factors such as holiday information, weather conditions, wind power and the like, comprehensively considers the influence of periodicity, trend, volatility and randomness of passenger flow presentation through extracting the time characteristics, the space characteristics and the external characteristics, and realizes the simultaneous passenger flow prediction for all stations of a rail transit network.
2. The invention can automatically learn and pay attention to important space-time characteristics related to the current prediction task by introducing an attention mechanism, and improves the capturing capability of the model on key information. The attention mechanism can effectively process complex correlations and nonlinear relations in subway passenger flow data, so that accuracy and stability of passenger flow prediction are improved.
3. The ST-RANet model has high real-time performance, is light in structure and efficient, and can be used for fast prediction calculation in a real-time environment, so that the ST-RANet model is suitable for a real-time passenger flow prediction task of a subway station. By timely acquiring the latest data and combining the historical data for modeling and prediction, an accurate passenger flow prediction result can be provided for subway operation departments.
4. The subway passenger flow prediction method based on the ST-RANet model shows excellent performance in a subway scene, can meet the requirements of regional passenger flow prediction tasks of real-time subway stations, has wide application potential, can provide powerful support for operation and management of urban subway systems, and further improves the efficiency and convenience of urban transportation.
The computer program product of the subway passenger flow prediction method and device based on the ST-RANet model provided by the embodiment of the invention comprises a computer readable storage medium storing program codes, wherein the instructions included in the program codes can be used for executing the method in the previous method embodiment, and specific implementation can be seen in the method embodiment and will not be repeated here.
Specifically, the storage medium can be a general storage medium, such as a mobile disk, a hard disk, and the like, and when a computer program on the storage medium is run, the subway passenger flow prediction method based on the ST-RANet model can be executed, so that the problem of inaccurate passenger flow prediction caused by influence factors such as periodicity, trend, volatility, randomness, and the like can be solved.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a non-volatile computer readable storage medium executable by a processor. Based on this understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art or in a part of the technical solution, in the form of a software product stored in a storage medium, comprising several instructions for causing a computer device (which may be a personal computer, a server, a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
Finally, it should be noted that: the above examples are only specific embodiments of the present invention, and are not intended to limit the scope of the present invention, but it should be understood by those skilled in the art that the present invention is not limited thereto, and that the present invention is described in detail with reference to the foregoing examples: any person skilled in the art may modify or easily conceive of the technical solution described in the foregoing embodiments, or perform equivalent substitution of some of the technical features, while remaining within the technical scope of the present disclosure; such modifications, changes or substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present invention, and are intended to be included in the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (10)

1. The subway passenger flow prediction method based on the ST-RANet model is characterized by comprising the following steps of:
acquiring historical passenger flow data of subway in and out stations and external factor data corresponding to time and space, constructing a feature map according to a distribution network of subway stations in a region to be predicted, and fusing the passenger flow data with the corresponding external factor data to form a subway data set in the region to be predicted;
classifying the time segments of the passenger flow data in the subway data set of the region to be predicted according to three time scales of the adjacency, the periodicity and the trend respectively, modeling the passenger flow data in the subway data set of the region to be predicted, building three space-time modules of the adjacency, the periodicity and the trend, and taking input tensors of the historical passenger flow data corresponding to each time segment as the inputs of the three space-time modules;
fusing the output results of the three space-time modules to obtain a space-time module output model;
constructing an external factor module according to the acquired external factor data, and fusing an external factor module output model with a space-time module output model to obtain a passenger flow predicted value model ST-RANet;
and acquiring real-time passenger flow data of subway station in-out and out-of-station and external factor data corresponding to time and space, inputting the real-time passenger flow data and the external factor data corresponding to the passenger flow prediction value model ST-RANet, and performing passenger flow prediction.
2. The subway passenger flow prediction method based on the ST-RANet model according to claim 1, wherein,
the historical passenger flow data is obtained by statistics of subway automatic fare collection system data;
the external factor data includes holiday date and meteorological data, wherein the meteorological data includes weather, temperature and wind speed indicators.
3. The subway passenger flow prediction method based on the ST-RANet model according to claim 1, wherein,
after the historical passenger flow data of subway in and out stations and the external factor data corresponding to time and space are obtained, preprocessing of scaling operation is carried out, and unified passenger flow data is obtained;
and constructing a feature map according to a distribution network of subway stations of the region to be predicted, and forming a subway data set of the region to be predicted from the unified passenger flow data.
4. The method for predicting subway passenger flow based on ST-RANet model according to claim 1, wherein the classifying the passenger flow data in the subway data set of the region to be predicted according to three time scales of proximity, periodicity and trend respectively, modeling the passenger flow data in the subway data set of the region to be predicted, constructing three space-time modules of proximity, periodicity and trend, and taking input tensors of the historical passenger flow data corresponding to each time segment as inputs of the three space-time modules, comprises:
classifying passenger flow data in subway data sets of a region to be predicted according to adjacent time periods, same time periods adjacent to a plurality of days and same time periods adjacent to a plurality of weeks in sequence, and extracting characteristics of three time scales of adjacency, periodicity and trending of historical passenger flow data;
dividing the total daily time length into T time steps at equal intervals, and intercepting adjacent time segments P along a time axis in an adjacent time scale for the time step T to be predicted closeness The same time slices P adjacent to several days are intercepted along the time axis in a periodic time scale period Intercepting adjacent identical time segments P of several weeks along a time axis on a trending time scale trend
Building a proximity space-time module, and representing a proximity time segment P by a variable c closeness The number of time slices involved is chosen to be the number of time slices,representing adjacent time segments P closeness The corresponding historical passenger flow data input tensor is used as the input of the proximity space-time module;
constructing a periodic space-time module, and representing the same time segment P adjacent to a plurality of days by using a variable d period The number of time slices involved is chosen to be the number of time slices,representing the same time segment P of several days in the neighborhood period The corresponding historical passenger flow data input tensor is used as the input of the periodic space-time module;
building a trend space-time module, and representing adjacent time segments P with the same weeks by using a variable w trend The number of time slices involved is chosen to be the number of time slices,representing adjacent several weeks identical time segments P trend The corresponding historical passenger flow data input tensor is used as the input of the trend space-time module.
5. The ST-RANet model based subway passenger flow prediction method of claim 4, wherein the historical passenger flow data input tensor of the proximity spatiotemporal module isWherein the method comprises the steps ofR is a domain, and I×J represents the size of a spatial region;
the proximity spatiotemporal module employs a two-channel traffic matrix of the nearest c time slices.
6. The ST-RANet model based subway passenger flow prediction method of claim 4, wherein the historical passenger flow data input tensor of the periodic space-time module isWherein the method comprises the steps ofR is a domain, and I×J represents the size of a spatial region;
the periodic space-time module adopts a two-channel passenger flow matrix of the same time slice of the previous d days adjacent to the t time slice.
7. The ST-RANet model based subway passenger flow prediction method of claim 4, wherein the historical passenger flow data input tensor of the trend spatiotemporal module isWherein the method comprises the steps ofR is a domain, and I×J represents the size of a spatial region;
the trending spatiotemporal module employs a two-channel passenger flow matrix adjacent to a number of weeks of the same time slice.
8. The ST-RANet model-based subway passenger flow prediction method of claim 4, wherein after three space-time modules of adjacency, periodicity and trend are built, two-layer convolution operations are performed respectively, comprising:
input tensor X for historical passenger flow data (0) Performing a first layer convolution operation to obtain a first input tensor X (1) =f(W (1) *X (0) +b (1) ) Wherein tensor X is input (0) Is thatAny one of X (0) ∈R 2L×I×J L represents the length of the input tensor, is a convolution operation, f is an activation function, W (1) And b (1) Is a parameter in the first layer convolution operation;
for the first input tensor X (1) Weighting the channel attention module to obtain a channel weighted tensorWherein M is c Representing the channel attention module versus the first input tensor X (1) The operations performed->Representing the corresponding position elements of the matrix to perform product;
spatial attention module weighting is performed to obtain an attention weighted input tensorWherein M is s Representing the operation of the spatial attention module on the channel weighting tensor F, +.>Representing the corresponding position elements of the matrix to perform product;
adding k layers of residual units to the attention weighted input tensor to obtain residual weighted input tensorWherein X is (k+1) And X (k+2) Respectively representing the input and output of the kth residual unit,/->As residual unit function, θ (k) All the parameters that are learned including the kth residual unit;
performing a second-layer convolution operation, channel attention module weighting and space attention module weighting on the residual weighted input tensor to obtain a second input tensor X (k+4) The output result of the proximity module isThe output result of the periodicity module is +.>The output result of the trend module is +.>
9. The method for predicting subway passenger flow based on the ST-RANet model of claim 8, wherein the merging the output results of the three space-time modules to obtain the space-time module output model comprises:
fusing the output results of the three space-time modules to obtain a space-time module output modelWherein W is c 、W p 、W q Respectively are weight parameters, W c Indicating the extent of influence of proximity, W p Indicating the degree of influence of periodicity, W q Indicating the extent of influence of trending ++>Representing the Hadamard product.
10. The method for predicting subway passenger flow based on ST-RANet model of claim 9, wherein the constructing the external factor module, fusing the external factor module output model with the space-time module output model, and obtaining the passenger flow predicted value model ST-RANet comprises:
by E t Characteristic of external factors representing the time step t to be predicted, using X t Representing the passenger flow tensor at the time step t to be predicted, at E t Two layers of full-connection layers are overlapped, wherein the first layer is an embedded layer of external factor data, and the second layer is a low-dimensional feature matrix mapping of the external factor data to X t High-dimensional matrix with same dimension and fully connected with two layersRespectively adding the activation functions into the layers to obtain an external factor module output model X Ext
Fusing the external factor module output model and the space-time module output model to obtain a passenger flow predicted value Y representing the t-th time period t Passenger flow predictive value model Y of (2) t =Tanh(X Res +X Ext ) Where Tanh () is a hyperbolic tangent function for ensuring that the output range of data is between (-1, 1).
CN202310908667.0A 2023-07-24 2023-07-24 Subway passenger flow prediction method based on ST-RANet model Active CN116629460B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310908667.0A CN116629460B (en) 2023-07-24 2023-07-24 Subway passenger flow prediction method based on ST-RANet model

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310908667.0A CN116629460B (en) 2023-07-24 2023-07-24 Subway passenger flow prediction method based on ST-RANet model

Publications (2)

Publication Number Publication Date
CN116629460A CN116629460A (en) 2023-08-22
CN116629460B true CN116629460B (en) 2023-09-12

Family

ID=87602982

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310908667.0A Active CN116629460B (en) 2023-07-24 2023-07-24 Subway passenger flow prediction method based on ST-RANet model

Country Status (1)

Country Link
CN (1) CN116629460B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117273287B (en) * 2023-11-23 2024-03-08 山东科技大学 Tensor-matrix coupling-based subway passenger flow prediction method

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113077090A (en) * 2021-04-09 2021-07-06 上海大学 Passenger flow prediction method, system and computer readable storage medium
CN113240179A (en) * 2021-05-18 2021-08-10 重庆邮电大学 Method and system for predicting orbital pedestrian flow by fusing spatio-temporal information
KR102388806B1 (en) * 2021-04-30 2022-05-02 (주)에이아이매틱스 System for deciding driving situation of vehicle
CN116128122A (en) * 2023-01-03 2023-05-16 北京交通大学 Urban rail transit short-time passenger flow prediction method considering burst factors

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113077090A (en) * 2021-04-09 2021-07-06 上海大学 Passenger flow prediction method, system and computer readable storage medium
KR102388806B1 (en) * 2021-04-30 2022-05-02 (주)에이아이매틱스 System for deciding driving situation of vehicle
CN113240179A (en) * 2021-05-18 2021-08-10 重庆邮电大学 Method and system for predicting orbital pedestrian flow by fusing spatio-temporal information
CN116128122A (en) * 2023-01-03 2023-05-16 北京交通大学 Urban rail transit short-time passenger flow prediction method considering burst factors

Also Published As

Publication number Publication date
CN116629460A (en) 2023-08-22

Similar Documents

Publication Publication Date Title
Bao et al. A spatiotemporal deep learning approach for citywide short-term crash risk prediction with multi-source data
CN116629460B (en) Subway passenger flow prediction method based on ST-RANet model
US20170011299A1 (en) Proactive spatiotemporal resource allocation and predictive visual analytics system
CN113077090A (en) Passenger flow prediction method, system and computer readable storage medium
Feng et al. Towards big data analytics and mining for UK traffic accident analysis, visualization & prediction
CN113570867B (en) Urban traffic state prediction method, device, equipment and readable storage medium
CN111815098A (en) Traffic information processing method and device based on extreme weather, storage medium and electronic equipment
Chettry et al. Delineating urban growth boundary using remote sensing, ANN-MLP and CA model: a case study of Thiruvananthapuram urban agglomeration, India
Ma et al. Public transportation big data mining and analysis
CN110989043A (en) Air quality index grade probability forecasting method and device and storage medium
Cerqueira et al. On how to incorporate public sources of situational context in descriptive and predictive models of traffic data
CN111985731B (en) Method and system for predicting number of people at urban public transport station
Guzmán et al. A cyberphysical system for data-driven real-time traffic prediction on the Las Vegas I-15 freeway
CN116401601A (en) Power failure sensitive user preferential treatment method based on logistic regression model
CN116523104A (en) Abnormal group flow prediction method and device based on context awareness and deep learning
Fan et al. A deep reinforcement learning model for resilient road network recovery under earthquake or flooding hazards
Tikka et al. Convolutional neural networks in estimating the spatial distribution of electric vehicles to support electricity grid planning
Sathyan Traffic Flow Prediction using Machine Learning Techniques-A Systematic Literature Review
JP7163105B2 (en) Demand forecasting system and method
CN113344290A (en) Correcting method for sub-season rainfall weather forecast based on U-Net network
Hu et al. A simplified deep residual network for citywide crowd flows prediction
Ranjan et al. Large-Scale Road Network Congestion Pattern Analysis and Prediction Using Deep Convolutional Autoencoder. Sustainability 2021, 13, 5108
Dao et al. Fostering Innovation in Urban Transportation Risk Management: A Multi-Sector Collaborative Benchmarking Platform
CN113077053B (en) Multi-group activity mode characterization method and target geographic activity area identification method
CN116634453B (en) Network performance determining method, device, server and storage medium

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