CN111709553B - Subway flow prediction method based on tensor GRU neural network - Google Patents

Subway flow prediction method based on tensor GRU neural network Download PDF

Info

Publication number
CN111709553B
CN111709553B CN202010419486.8A CN202010419486A CN111709553B CN 111709553 B CN111709553 B CN 111709553B CN 202010419486 A CN202010419486 A CN 202010419486A CN 111709553 B CN111709553 B CN 111709553B
Authority
CN
China
Prior art keywords
tensor
order
data
network
output
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
CN202010419486.8A
Other languages
Chinese (zh)
Other versions
CN111709553A (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.)
Hangzhou Dianzi University
Original Assignee
Hangzhou Dianzi University
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 Hangzhou Dianzi University filed Critical Hangzhou Dianzi University
Priority to CN202010419486.8A priority Critical patent/CN111709553B/en
Publication of CN111709553A publication Critical patent/CN111709553A/en
Application granted granted Critical
Publication of CN111709553B publication Critical patent/CN111709553B/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/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

Landscapes

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

Abstract

The invention discloses a subway flow prediction method based on tensor GRU neural network, which comprises the steps of counting original data, filling the data according to an output time period, dividing the data into a training set and a testing set, and inputting the training set and the testing set into the network day by day according to a date sequence; current inputX t Output from the last timeH t‑1 Generating an output at that time via operations of the GRU update gate and the reset gateH t The method comprises the steps of carrying out a first treatment on the surface of the Will last momentH t Performing loss calculation and back propagation with the normalized label, and outputting the back normalized label in the final step of epochH t As the final output of the network. The invention enables the network to process higher order data and obtain higher order results, so that the network can grasp the structural characteristics in the predicted data results.

Description

Subway flow prediction method based on tensor GRU neural network
Technical Field
The invention relates to a subway flow prediction method, in particular to a subway flow prediction method based on a tensor GRU neural network.
Background
The traffic monitoring of each city is hoped to accurately acquire the traffic of each region in real time, and then traffic analysis among regions is carried out according to the existing traffic data, so that the traffic condition of the whole city can be mastered, and the decision making capability of the brains of the city is enriched. The data generated at each moment in the city is various, and the data can be the density of people, the flow rate of the people, and even the sex of individuals. A method for predicting subway traffic using a tensor GRU (evolution of a recurrent neural network RNN) network is proposed herein for a scene of subway monitoring.
Subway traffic is based on a comprehensive assessment of the number of entrances and exits generated in a unit of time at each subway station along each subway line in the city. In order to predict the trend of the subway traffic over a period of time, other data of the subway traffic, such as the position of the subway station, the period of time the subway station is located, and the like, often need to be considered. The information is the data of the structure naturally, the traditional method often needs to split the data of each dimension to perform feature extraction and finally perform feature fusion, and the direct damage is the structural relationship in the data. The method comprises the steps of adopting a tensor operation method to change the neural network matrix operation into full tensor operation, adopting a time sequence network to accept input of different time periods according to the data characteristics of the subway, and finally considering the position relation of each element in the data according to the tensor distance so as to achieve the purpose of directly utilizing the data structure of the data, expanding a high-order thought to an output end, enabling the output end not to be limited to judgment of vector level any more, and achieving the purpose of grasping tensor structural characteristics by calculating subscripts of elements in the tensor according to the tensor distance, so that the output end can realize high-order expansion, and has important significance for predicting different results under different future development trends.
Disclosure of Invention
Aiming at the defects of the prior art, the invention provides a subway flow prediction method based on a tensor GRU neural network.
The invention aims to solve the technical problem of how to apply tensor GRU to solve the problem of predicting the subway traffic under the scene of a high-order data set.
In order to solve the problem, the invention is realized by the following technical scheme:
the subway flow prediction method based on tensor GRU comprises the following steps:
1) The specific data of each time period card swiping of each subway station in a certain time period is taken as a data set, the data set is cleaned and screened, and the subway station, the subway line and the holiday type are respectively found as dimensions of each order of data to form a high-order tensor.
2) Before the GRU neural network is input, normalizing the input of each time according to the order, and simultaneously ensuring that the label data and the input data share the same group of mean variances; performing z-score normalization on input data according to the dimension of network output to obtain a mean tensorMAnd standard deviation tensorSt;K 1 ×K 2 ×…×K N The N-order tensor of the shape is expanded in order.
3) Dividing the data processed in the step 2) into each time stepXInput into the GRU neural network, and in each tensor GRU operationIn the unit, by weightingWAnd (3) withXCarrying out Einstein multiplication to obtain the tensor state of the hidden layer, wherein the specific expression of Einstein product is as follows:
Figure BDA0002496319120000021
wherein the method comprises the steps ofAAndBrepresenting an N-order tensor and an N+M-order tensor, k, respectively N Represents the dimension size of the nth order of the tensor, from k in order of order 1 To k N Sequentially multiplying corresponding index elements and then carrying out summation operation to reduce the N order to 1 order so that the result is M-order tensor; obtaining the final hidden layer state through the operation of the update gate and the reset gate in the tensor GRUHAs an output or as an input to a next time step. After calculation of a defined time step, the resulting tensor is obtainedHThe tensor is the resulting hidden layer stateH
4) The obtained outputHThe loss calculation is performed with the label which is also normalized before input, and tensor distance is used as a loss function for grasping the structural characteristics of the higher-order tensor:
Figure BDA0002496319120000022
wherein l and m represent subscripts of two tensors, x, respectively l ,y l ,x m ,y m The element values of the corresponding subscripts representing the two tensors respectively,
Figure BDA0002496319120000023
euclidean distance representing element value of corresponding subscript, updating each moment by back propagation mechanism i WThe weight tensor, i represents a certain time step of the output,
repeating steps 3) to 4) for different epochs until the epochs are over and then executing the next step.
5) After the end of epoch, the result of step 3) is obtained according toMAndStinverse normalizing the output of the network to obtain inverse normalizationAnd the effective dimension in the post tensor is used as the final predicted result value of the network, so that the final flow predicted value is obtained.
Compared with the prior art, the invention has the following effects:
1. the neural network based on vector and matrix operation can operate based on tensor structure, the dimension of the neural network is improved, high-order information can be input in subway flow application, high-order data fusion is carried out, and the computing capacity is incomparable to vectors.
2. Under the condition that the tensor distance is used as a loss function, the characteristics of the structure can be learned in the network learning process, the output result of the flow is expressed as a scene prediction value capable of predicting multiple modes, and the dimension boundary of network prediction or regression is widened.
Drawings
FIG. 1 is a block diagram of the interior of a GRU network;
fig. 2 is an overall flow chart of the present invention.
Detailed Description
The invention is further described with reference to the drawings and detailed description which follow:
1) Acquiring specific data of card swiping at each time interval of each subway station in the month, counting, taking ten minutes as a time unit, dividing one day into 144 time units, counting the number of outbound and inbound persons in each time unit, acquiring flow data of each subway station in each month from No. 1 to No. 26, and constructing a five-order tensor according to the subway line in which the subway station is located and the holiday condition in which the date is locatedXAnd (2) andX∈R 26×144×80×3×2 where 26 represents 26 days of data, 144 represents 144 time periods in a day, 80 represents the number of subway stations, 3 represents the number of subway lines, and 2 represents both workdays and not workdays.
2) Taking 1-25 days as training data and 26 days as test data, 144 is selected as the batch for training, which is helpful for the network to randomly learn the rules of each time period. When predicting data for a certain time period, the total 100 minutes of flow data of the first 50 minutes and the last 40 minutes of the time period plus the own ten minutes is taken as input, that is, the flow data with the characteristic quantity of 100 minutes, that is, 10 digits, at each time step of the GRU.
3) In a single training, a period of 144 time periods is selected, then the data for a total of 25 days from 1 to 25 days is expanded and transferred into the GRU on a daily basis, so that the tensor order of the input for each GRU time step is R 80×3×2×10
4) Before inputting network operation, normalizing the input and the label, and performing z-score normalization on the input data according to the dimension of the network output, if the dimension of the output is R 80 Then R of the input data will be combined 3×2×10 These three dimensions give R 80 Mean tensor of (f)MAnd standard deviation tensorStAnd the inverse normalization operation is convenient for the output data, meanwhile, the distribution characteristics of the labels are not considered, and the labels are normalized by using the mean standard deviation obtained by input.
5) Training the normalized data according to the time dimension of 25 days as the input of the cells of the GRU in sequence according to the formula:
Z t =σ(U (Z) * N X t +W (Z) * M S t-1 ),
R t =σ(U (R) * N X t +W (R) * M S t-1 )
H t =tanh(U (H) * N X t +W (H) * M (S t-1R t ))
S t =(1-Z t )⊙H t +Z tS t-1
wherein the method comprises the steps ofUAndWrepresenting the weight tensor calculated with the input tensor and the hidden layer tensor at the last moment respectively,Z t representing the tensor of the updated gate obtained after calculation,R t representing the tensor of the reset gate,H t representing the tensor reset for the last time step according to the reset gateS t-1 After-operation, the hidden layer tensor is obtained, and then the tensor of the time stepS t I.e. updated according to the update gate at the previous timeZ tS t-1 And (1) not participating in the updateZ t )⊙H t The addition is carried out, forward propagation is carried out, firstly, einstein product is carried out on 4 th order input tensor and 4+n weight tensor at the moment of t, n is the order of hidden layer tensor when one super parameter represents, and data is subjected to updating gate and resetting gate and partial element effective value elimination of the last state and the current state is determined according to the calculated reserved weight value of each gate.
6) When the network passes forward propagation, obtaining network output resultYThen, using normalized label value and output to make tensor-based loss
Figure BDA0002496319120000041
Mainly for updating weight tensors in various gates in the networkU (Z)W (Z)U (R)W (R)U (H)W (H)
7) Repeating steps 4) to 6) until the network converges, and outputting the final output result according toMAndStand obtaining the final flow prediction after performing inverse normalization.

Claims (1)

1. A subway flow prediction method based on tensor GRU neural network is characterized by comprising the following steps:
1) Taking specific data of each card swiping of each subway station in a certain period as a data set, cleaning and screening the data set, and respectively finding out the dimensions of each data of the subway station, the subway line and the holiday type to form a high-order tensor;
2) Before the GRU neural network is input, normalizing each input according to the order, and simultaneously ensuring the number of labelsSharing the same set of mean variances with the input data; performing z-score normalization on input data according to the dimension of network output to obtain a mean tensorMAnd standard deviation tensorSt;K 1 ×K 2 ×…×K N Expanding the N-order tensors of the shape according to the order;
3) Dividing the data processed in the step 2) into each time stepXInput into GRU neural network, in each tensor GRU operation unit, by weightingWAnd (3) withXCarrying out Einstein multiplication to obtain the tensor state of the hidden layer, wherein the specific expression of Einstein product is as follows:
Figure FDA0002496319110000011
wherein the method comprises the steps ofAAndBrepresenting an N-order tensor and an N+M-order tensor, k, respectively N Represents the dimension size of the nth order of the tensor, from k in order of order 1 To k N Sequentially multiplying corresponding index elements and then carrying out summation operation to reduce the N order to 1 order so that the result is M-order tensor; obtaining the final hidden layer state through the operation of the update gate and the reset gate in the tensor GRUHAs an output or as an input to a next time step; after calculation of a defined time step, the resulting tensor is obtainedHThe tensor is the resulting hidden layer stateH
4) The obtained outputHThe loss calculation is performed with the label which is also normalized before input, and tensor distance is used as a loss function for grasping the structural characteristics of the higher-order tensor:
Figure FDA0002496319110000012
wherein l and m represent subscripts of two tensors, x, respectively l ,y l ,x m ,y m The element values of the corresponding subscripts representing the two tensors respectively,
Figure FDA0002496319110000013
euclidean distance representing element value of corresponding subscript, updating each moment by back propagation mechanism i WThe weight tensor, i represents a certain time step of the output,
repeating steps 3) to 4) for different epochs until the epochs are over and then executing the next step;
5) After the end of epoch, the result of step 3) is obtained according toMAndStand carrying out inverse normalization on the output of the network, and obtaining the effective dimension in the tensor after inverse normalization as the final predicted result value of the network, thus obtaining the final flow predicted value.
CN202010419486.8A 2020-05-18 2020-05-18 Subway flow prediction method based on tensor GRU neural network Active CN111709553B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010419486.8A CN111709553B (en) 2020-05-18 2020-05-18 Subway flow prediction method based on tensor GRU neural network

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010419486.8A CN111709553B (en) 2020-05-18 2020-05-18 Subway flow prediction method based on tensor GRU neural network

Publications (2)

Publication Number Publication Date
CN111709553A CN111709553A (en) 2020-09-25
CN111709553B true CN111709553B (en) 2023-05-23

Family

ID=72538039

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010419486.8A Active CN111709553B (en) 2020-05-18 2020-05-18 Subway flow prediction method based on tensor GRU neural network

Country Status (1)

Country Link
CN (1) CN111709553B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117726183A (en) * 2024-02-07 2024-03-19 天津生联智慧科技发展有限公司 Gas operation data prediction method based on space high-order convolution

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109492814A (en) * 2018-11-15 2019-03-19 中国科学院深圳先进技术研究院 A kind of Forecast of Urban Traffic Flow prediction technique, system and electronic equipment
CN110310479A (en) * 2019-06-20 2019-10-08 云南大学 A kind of Forecast of Urban Traffic Flow forecasting system and method

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2019084254A1 (en) * 2017-10-27 2019-05-02 Wave Computing, Inc. Tensor manipulation within a neural network
CN107798385B (en) * 2017-12-08 2020-03-17 电子科技大学 Sparse connection method of recurrent neural network based on block tensor decomposition
GB2574224B (en) * 2018-05-31 2022-06-29 Vivacity Labs Ltd Traffic management system
CN109325585A (en) * 2018-10-10 2019-02-12 电子科技大学 The shot and long term memory network partially connected method decomposed based on tensor ring
CN111046740B (en) * 2019-11-17 2023-05-19 杭州电子科技大学 Classification method for human action video based on full tensor cyclic neural network

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109492814A (en) * 2018-11-15 2019-03-19 中国科学院深圳先进技术研究院 A kind of Forecast of Urban Traffic Flow prediction technique, system and electronic equipment
CN110310479A (en) * 2019-06-20 2019-10-08 云南大学 A kind of Forecast of Urban Traffic Flow forecasting system and method

Also Published As

Publication number Publication date
CN111709553A (en) 2020-09-25

Similar Documents

Publication Publication Date Title
CN110909926A (en) TCN-LSTM-based solar photovoltaic power generation prediction method
CN109102341B (en) Old man portrait drawing method for old man service
CN111861013B (en) Power load prediction method and device
CN112818764B (en) Low-resolution image facial expression recognition method based on feature reconstruction model
CN108090686B (en) Medical event risk assessment analysis method and system
CN110110372B (en) Automatic segmentation prediction method for user time sequence behavior
CN112116137A (en) Student class dropping prediction method based on mixed deep neural network
CN111709553B (en) Subway flow prediction method based on tensor GRU neural network
CN112101418A (en) Method, system, medium and equipment for identifying breast tumor type
CN112784479B (en) Flood flow prediction method
Leke et al. Proposition of a theoretical model for missing data imputation using deep learning and evolutionary algorithms
Ma et al. Temporal pyramid recurrent neural network
CN108959512B (en) Image description network and technology based on attribute enhanced attention model
CN116739130A (en) Multi-time scale load prediction method of TCN-BiLSTM network
JP2001312712A (en) Non-linear time series prediction method and recording medium with non-linear time series prediction program recorded thereon
CN115936196A (en) Monthly rainfall model prediction method based on time sequence convolution network
CN115908600A (en) Massive image reconstruction method based on prior regularization
CN112488397B (en) Load prediction method under extreme scene based on modal decomposition and transfer learning
CN114444813A (en) Traffic flow prediction method based on deep learning
CN115292295A (en) Road network missing data restoration method based on multi-view space-time confrontation frame
CN114492837A (en) Federal model training method and device
Hu et al. Layered exchange rate prediction model based on LSTM
CN108108475B (en) Time sequence prediction method based on depth-limited Boltzmann machine
CN112561180A (en) Short-term wind speed prediction method and device, computer equipment and storage medium
Lee et al. A Parareal Architecture for Very Deep Convolutional Neural Networks

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