Station short-time passenger flow prediction method based on deep learning

By constructing a deep learning-based method for predicting short-term passenger flow at stations, and utilizing multi-scale temporal feature mapping, periodic gating fusion, and multi-source feature interaction, the method addresses the shortcomings of adaptability and robustness in existing technologies, and achieves high-precision prediction in complex scenarios.

CN121959516APending Publication Date: 2026-05-01NINGBO RAIL TRANSIT GRP CO LTD LINE NETWORK DISPATCHING BRANCH
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
NINGBO RAIL TRANSIT GRP CO LTD LINE NETWORK DISPATCHING BRANCH
Filing Date
2026-04-02
Publication Date
2026-05-01

AI Technical Summary

Technical Problem

Existing methods for predicting short-term passenger flow at stations have poor adaptability and robustness in real-world, complex scenarios. They cannot effectively handle the impact of changes across multiple time scales and sudden changes in the external environment, resulting in limited prediction accuracy.

Method used

We construct a deep learning-based method for predicting short-term passenger flow at railway stations. This method combines multi-scale temporal feature mapping, periodic gating fusion, and multi-source feature interaction with a prediction model that integrates context-aware attention and bilinear interaction. We also optimize the loss function to improve prediction accuracy and robustness.

Benefits of technology

It achieves high-precision short-term passenger flow prediction for stations in real and complex scenarios, and can adaptively adjust feature representation and external factors, thereby improving the adaptability and robustness of the prediction model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121959516A_ABST
    Figure CN121959516A_ABST
Patent Text Reader

Abstract

The invention relates to the field of passenger flow prediction, in particular to a station short-time passenger flow prediction method based on deep learning, and the method comprises the steps: constructing a data set; calculating a multi-scale time sequence feature vector of each sample; constructing a prediction model for predicting the short-time passenger flow of the station, and training the prediction model to obtain a trained prediction model; and acquiring new time data, new historical pull-in passenger flow data and new external influence factor data prediction data, calculating a multi-scale time sequence feature vector of each sample, and inputting the multi-scale time sequence feature vector into the trained prediction model to obtain a pull-in passenger flow prediction value at a plurality of continuous time points in the future. The problem that an existing station short-time passenger flow prediction method is poor in adaptability and robustness in a real and complex scene is solved. The station short-time passenger flow prediction method based on deep learning provided by the invention is good in adaptability and robustness in the real and complex scene.
Need to check novelty before this filing date? Find Prior Art

Description

A Deep Learning-Based Short-Term Passenger Flow Prediction Method for Railway Stations Technical Field

[0001] This invention relates to the field of passenger flow prediction, and specifically to a method for predicting short-term passenger flow at stations based on deep learning. Background Technology

[0002] Urban rail transit, represented by subway and light rail systems, has become an extremely important mode of transportation in cities. As the scale of urban rail transit networks expands, the passenger flow at stations of various systems is also increasing. In order to better carry out transportation operations and ensure residents' daily travel, it is necessary to conduct short-term passenger flow forecasting at stations.

[0003] Station short-term passenger flow forecasting refers to the accurate prediction of station passenger flow within a short period of time (e.g., a few hours or days). Station short-term passenger flow forecasting helps to achieve digital governance, operational organization optimization, capacity allocation optimization, emergency management optimization, and passenger service optimization.

[0004] Existing methods for predicting short-term passenger flow at stations include conventional ARIMA (Autoregressive Integrated Moving Average) models, support vector machine regression, LSTM (Long Short-Term Memory) neural networks, and Transformer models (based on self-attention mechanisms). However, these methods face significant bottlenecks in actual operational scenarios.

[0005] This is because passenger flow changes are influenced by a combination of factors. Passenger flow data not only exhibits multi-timescale variation characteristics (including minute-level random fluctuations, hourly commuting peak and off-peak trends, and daily and weekly cyclical patterns), but is also highly susceptible to sudden changes in the external environment (sudden weather changes, holiday arrangements, large-scale events, and real-time traffic conditions, etc.). Existing methods are basically based on statistical models or shallow machine learning models of historical passenger flow data. These methods are applicable under stable passenger flow patterns, but when passenger flow increases and passenger flow data becomes more complex, the prediction accuracy of these methods is significantly limited.

[0006] Therefore, existing methods for predicting short-term passenger flow at stations have poor adaptability and robustness in real-world, complex scenarios. Summary of the Invention

[0007] The technical problem to be solved by the present invention is to overcome the shortcomings of the prior art and provide a deep learning-based method for predicting short-term passenger flow in stations with good adaptability and robustness in real complex scenarios.

[0008] To address the aforementioned technical problems, this invention provides a deep learning-based method for predicting short-term passenger flow at train stations, comprising:

[0009] S1. Construct a dataset, which includes multiple samples; divide all samples into training set, validation set, and test set in chronological order.

[0010] S2. Calculate the multi-scale temporal feature vector of each sample based on the weight of each sample relative to each time segment;

[0011] S3. Construct a prediction model for predicting short-term passenger flow at the station, train the prediction model, and obtain the trained prediction model;

[0012] S301. Calculate the fusion feature vector of each sample based on the periodic embedding vector of each sample;

[0013] S302. Construct a predictive model for forecasting short-term passenger flow at stations;

[0014] S303. Train the prediction model to obtain the trained prediction model;

[0015] S4. Collect new time data, new historical passenger flow data, and new external influencing factor data for prediction. After executing S2, input the data into the trained prediction model to obtain the predicted passenger flow values ​​for multiple consecutive time points in the future.

[0016] As a further improvement of the present invention: the sample mentioned in S1 includes time data, historical passenger flow data, future actual passenger flow label data, and data on various external influencing factors.

[0017] As a further improvement of the present invention: the time data is timestamp information;

[0018] Historical passenger flow data is the original time-series vector of passenger volume.

[0019] The future real passenger flow label data refers to the actual passenger flow at multiple consecutive time points after a historical time point as the starting point for each sample.

[0020] The types of external influencing factors data include weather conditions, temperature, precipitation, wind speed, special event markers, and traffic congestion index.

[0021] As a further improvement of the present invention: step S2 includes:

[0022] S201. The time feature vectors of all samples are divided into multiple typical time segments by a clustering algorithm, and the cluster center vectors of multiple time segments are obtained. The belonging weight of each sample relative to each time segment is calculated based on the time feature vector of each sample and the cluster center vector of each time segment.

[0023] S202. Calculate the multi-scale temporal feature vector of each sample based on the weight of each sample relative to each time segment.

[0024] Preferably, the formula for calculating the multi-scale temporal feature vector of each sample in S202 is as follows:

[0025] ,

[0026] In the formula, For the first Multi-scale temporal feature vectors of each sample; For sample index; This is the vector concatenation operator; Time-segmented index; The total number of time segments; For the first For the nth sample The weighting of each time segment; For the first The time feature vector of each sample; This is element-wise multiplication; For application to the Wavelet basis functions for time segments; For the first The original time-series vector of the inbound volume of each sample; For the first The mean vector of the number of samples entering the station within each time segment; For the first The standard deviation vector of the number of samples entering the station within each time segment.

[0027] As a further improvement of the present invention: step S301 includes:

[0028] S3011. Calculate the periodic embedding vector of each sample based on the weekly time unit and holiday status of each sample;

[0029] S3012. Generate the gating vector for each sample based on the multi-scale temporal feature vector and the periodic embedding vector of each sample;

[0030] S3013. Calculate the fusion feature vector of each sample based on the gating vector of each sample.

[0031] Preferably, the formula for calculating the fusion feature vector of each sample in S3013 is as follows:

[0032] ,

[0033] In the formula, For the first Each sample fusion feature vector; For the first The gating vector of each sample; This is element-wise multiplication; For the first Multi-scale temporal feature vectors of each sample; For sample index; For dimension and the first A vector of all 1s with the same gating vector for each sample; For the first The periodic embedding linear mapping vector of each sample;

[0034] As a further improvement of the present invention: step S302 includes:

[0035] S3021. Based on the data of various external influencing factors of each sample and the fusion feature vector of each sample, the external factor feature vector of each sample that is sensitive to external factors is calculated;

[0036] S3022. Calculate the multi-source fusion feature vector of each sample based on the external factor feature vector of each sample and the fusion feature vector of each sample;

[0037] S3023. Calculate the enhanced feature vector of each sample based on the multi-source fusion feature vector of each sample;

[0038] S3024. Calculate the future passenger flow prediction vector for each sample based on the enhanced feature vector of each sample;

[0039] S3025. Calculate the total loss function based on the future passenger flow prediction vector of each sample.

[0040] Preferably, the formula for calculating the enhanced feature vector of each sample in S3023 is as follows:

[0041] ,

[0042] In the formula, For the first Enhanced feature vectors of each sample; This is the first gated linear weight matrix; For the first Multi-source fusion feature vector of each sample; This is the first gated linear bias vector; This is element-wise multiplication; Use the Sigmoid activation function; This is the second gated linear weight matrix; This is the second gated linear bias vector.

[0043] The beneficial effects of the present invention are as follows: The short-term passenger flow prediction method for stations based on deep learning provided by the present invention has good adaptability and robustness in real complex scenarios.

[0044] First, existing methods for predicting short-term passenger flow at stations typically use traditional time-series standardization to linearly adjust the data distribution, which fails to detect differences in data distribution within different local time windows (such as weekdays and holidays), is insensitive to abrupt changes such as holidays, and is prone to feature representation distortion. S2 adopts a feature mapping method based on time segmentation and wavelet transform. By adaptively segmenting time-series data and extracting local frequency domain features, and finally performing weighted fusion, the data is mapped to a multi-scale feature space that can simultaneously enhance the perception of local fluctuations and global trends.

[0045] Secondly, passenger flow data is significantly affected by weekly time units (week type) and holidays, exhibiting different time series patterns. However, existing short-term passenger flow prediction methods for stations generally treat periodic features as independent input features, directly concatenating or simply encoding them. This results in a disconnect between periodic features and time series features in the prediction model, lacking a dynamic interaction mechanism with deep time series features. Consequently, the contribution of periodic features cannot be flexibly adjusted according to the current time context, and the feature fusion capability is limited. S301 adopts a periodic gating fusion mechanism, embedding discrete periodic information into a continuous vector representation. It also dynamically modulates the fusion process of time series features and periodic features through gating units, enabling the prediction model to adaptively decide whether to emphasize time series fluctuations or periodic patterns in the final feature representation.

[0046] Furthermore, short-term passenger flow forecasting for railway stations requires integrating time-series periodic features with diverse external influencing factors. However, existing methods for short-term passenger flow forecasting often employ end-to-end forecasting models. These models typically treat external factors as static inputs, simply concatenating or linearly adding them, neglecting the time-varying characteristics of different factors' impact on passenger flow and the complex nonlinear interactions between multi-source features. This may result in insufficient forecasting capabilities for sudden scenarios such as holidays and severe weather. Moreover, most forecasting models use a single mean squared error as the loss function, optimizing only the overall forecast error without constraining the trend smoothness of the forecast sequence or performing differentiated weighted optimization for different important time periods. This may lead to large fluctuations in forecast results or insufficient accuracy during critical periods. S302 constructs a forecasting model integrating context-aware attention and bilinear interaction, optimized through a multi-objective composite loss function, achieving high-precision passenger flow forecasting that is sensitive to external factors and can capture high-order dependencies between features. Attached Figure Description

[0047] Figure 1 is a schematic diagram of the present invention;

[0048] Figure 2 shows a comparison of experiments using different prediction methods under different external environmental conditions. Detailed Implementation

[0049] The specific embodiments of the present invention will be described in further detail below with reference to the accompanying drawings.

[0050] Definitions of relevant terms used in this invention:

[0051] (1) Morlet wavelet: a complex-valued wavelet formed by combining Gaussian envelope and complex exponential function;

[0052] As shown in Figure 1, the short-term passenger flow prediction method for railway stations based on deep learning provided by this invention includes:

[0053] S1. Construct a dataset for supervised learning. The dataset includes multiple samples (prediction data). Each sample includes time data, historical passenger flow data, future actual passenger flow label data, and data on multiple external influencing factors. The time data, historical passenger flow data, future actual passenger flow label data, and data on multiple external influencing factors for each sample must all correspond to the same time dimension to align the data. Divide all samples into training set, validation set, and test set in chronological order to ensure temporal causality and avoid future information leakage.

[0054] (1) The time data is timestamp information, which is extracted from the system log and further processed into a time feature vector including daily time units, weekly time units, monthly time units, and holiday status;

[0055] The temporal feature vector is a feature vector extracted from the timestamp information of a sample. Its dimension is determined by the extracted temporal features, representing the temporal context information of the sample. It is in the format of a numerical vector, where the first dimensionality is determined by the extracted temporal features. Time feature vector of each sample Represented as:

[0056] ,

[0057] In the formula, The sample index is used to iterate through all samples in the training set, and its value is an integer from 1 to N. This represents the number of samples in the current training batch; the daily time unit refers to 00:00 to 23:00; the weekly time unit refers to Monday to Sunday; the monthly time unit refers to the months, from January to December; the holiday status includes both public holidays and non-public holidays;

[0058] For example, it can be set 14 means 2 PM; 3 means Wednesday; Indicates May; This indicates that it is not a public holiday.

[0059] (2) Historical passenger flow data is the original time-series vector of passenger flow. It is collected by summarizing and recording the number of passengers entering the station at fixed time intervals (such as every hour) through the AFC system (Automatic Fare Collection System, Urban Rail Transit Automatic Fare Collection System) or video surveillance counting system.

[0060] (3) Future real passenger flow label data refers to the actual passenger flow at multiple consecutive time points (such as the next 12 hours) after the starting point of each sample, which is based on a historical time. It is collected through the AFC system.

[0061] (4) Data on various external influencing factors include weather conditions, temperature, precipitation, wind speed, special event markers, traffic congestion index and other types of external influencing factors;

[0062] in,

[0063] Weather conditions, temperature, precipitation, wind speed, and other meteorological information are obtained from meteorological departments;

[0064] Real-time traffic congestion index and other traffic index information are obtained from traffic management departments or third-party platforms;

[0065] Special event information, such as special event markers, is obtained from public government platforms or third-party platforms.

[0066] Weather conditions include sunny, rainy, snowy, and extreme weather, while special event markers include large-scale events and sporting events. Categorical data such as weather conditions and special events are represented by one-hot encoding or embedding.

[0067] Continuous data such as temperature, precipitation, wind speed, and traffic congestion index need to be standardized to eliminate the influence of dimensions.

[0068] S2. Calculate the multi-scale temporal feature vector of each sample based on the weight of each sample relative to each time segment, so as to realize multi-scale temporal feature mapping;

[0069] S201. The time feature vectors of all samples are divided into multiple typical time segments by a clustering algorithm. The time segments are the clusters obtained by clustering. The cluster center vectors of multiple time segments are obtained. The belonging weight of each sample relative to each time segment is calculated based on the time feature vector of each sample and the cluster center vector of each time segment.

[0070] The assignment weight of each sample relative to each time segment is a scalar, used to measure the contribution of that time segment to the final feature mapping. The assignment weight of each sample relative to each time segment can adaptively adjust the contribution of features from different segments to the final result based on the similarity of time patterns; For the nth sample The weight of each time segment The calculation formula is:

[0071] ,

[0072] In the formula, The function for calculating the attribution weights; For time-segmented indexes, the value is... arrive ,in, The total number of time segments, i.e. the number of clusters obtained by clustering, is used to determine the dimension of multi-scale feature fusion; In the first The Softmax normalization function applied to each time segment (dimension) is used to transform the input object into a probability distribution, ensuring that the sum of all weights is 1; is the weight decay coefficient, a positive adjustable hyperparameter used to control the sensitivity of weights to time distance. The larger the value, the more concentrated the weight distribution is in the time segment most similar to the current sample. The value can be 0.5. This is the Euclidean distance function, used to calculate the straight-line distance between two vectors. Here, it measures the similarity between the temporal feature vector of each sample and the cluster center vector of each time segment. The first cluster obtained by the clustering algorithm The cluster center vector for each time segment, its dimension is... The same pattern represents the typical time pattern of this time segment.

[0073] S202. Calculate the multi-scale temporal feature vector of each sample based on the assignment weight of each sample relative to each time segment, so as to realize the feature extraction of wavelet basis function and the definition of mapping function;

[0074] Based on the original time-series vector of passenger flow for each sample, the mean vector of passenger flow for all samples within each time segment, and the standard deviation vector of passenger flow for all samples within each time segment, the statistics of passenger flow data within each time segment are calculated to obtain standardized time-series data. This standardized time-series data is used to standardize the original time-series vector of passenger flow for each sample to eliminate scale differences. Wavelet basis functions are used to transform the standardized time-series data to extract its frequency domain features within the local time window. The frequency domain features extracted from each time segment are modulated and concatenated with the corresponding weights of each sample relative to each time segment to obtain the multi-scale time-series feature vector of each sample. By fusing frequency domain features at different time scales through time segmentation and wavelet transform, the perception of local fluctuations and global trends can be enhanced simultaneously.

[0075] No. Multi-scale temporal feature vectors of each sample The calculation formula is:

[0076] ,

[0077] In the formula, This is a vector concatenation operator used to concatenate vectors... The feature vectors generated by each time segment are sequentially concatenated into a higher-dimensional feature vector; This is element-wise multiplication; For application to the The wavelet basis functions for each time segment can be Morlet wavelets; For the first The original time-series vector of the inbound volume for each sample, with dimension [dimensionality]. Its element is the first Inbound volume at each time point ,in, This is the length of the time window, which can be 168 (the number of hours in a week). For the first The mean vector of the number of samples entering the station within each time segment, with dimension [missing information]. It is calculated through a clustering process and is used to centralize the time segment data. For the first The standard deviation vector of the number of samples entering the station within each time segment, with dimension . It is calculated through a clustering process and is used to scale the time segment data.

[0078] The dimension of the multi-scale temporal feature vector of each sample is , The dimension of the multi-scale temporal feature vector;

[0079] The value is the total number of time segments multiplied by the length of the wavelet eigenvector, and can be 128.

[0080] S3. Construct a prediction model for predicting short-term passenger flow at the station, train the prediction model, and obtain the trained prediction model;

[0081] S301. Calculate the fusion feature vector of each sample based on the periodic embedding vector of each sample, so as to complete the construction of the feature enhancement and periodic gating fusion module;

[0082] S3011. Calculate the periodic embedding vector of each sample based on the weekly time unit and holiday status of each sample, so as to realize the discrete periodic identifier embedding conversion;

[0083] Since the weekly time unit and holiday status are discrete periodic identifiers, it is now necessary to transform the discrete periodic information into a continuous feature representation through an embedding layer so as to deeply integrate with the time series features. This means converting the weekly time unit and holiday status into a continuous vector representation. Specifically, the weekly time unit is one-hot encoded and then mapped through an embedding matrix, while the holiday status is directly mapped through an embedding vector. Then, the two mapped values ​​are added together.

[0084] The dimension of the periodic embedding vector of each sample is ;No. Periodic embedding vector of each sample The calculation formula is:

[0085] ,

[0086] In the formula, An embedding matrix for weekly time units, with dimension 1. is a trainable parameter matrix used to map the 7-dimensional weekday one-hot encoding to Embedded space of dimensions; For the first The 7-dimensional vector obtained by one-hot encoding of the weekly time unit of each sample; For the first The weekly time unit for each sample Representing Monday, Representing Tuesday, Represents Wednesday, Representing Thursday, Represents Friday. Representing Saturday, Represents Sunday; The embedding vector for the holiday status has a dimension of . , is a trainable parameter vector used to map scalar holiday states to dimensional vector; The dimension of the periodic embedding vector is a positive integer hyperparameter used to control the size of the embedding space, and its value can be 16. For the first The holiday status of each sample, with a value of 0 or 1, indicates whether the sample belongs to a holiday. This indicates that the time corresponding to this sample is not a holiday. This indicates that the time corresponding to this sample is a holiday.

[0087] S3012. Based on the multi-scale temporal feature vector of each sample and the periodic embedding vector of each sample, a gating vector for each sample is generated to achieve dynamic generation of the gating vector;

[0088] The multi-scale temporal feature vectors of each sample are concatenated with the periodic embedding vectors of each sample and then input into the gating unit. The gating unit calculates the gating vector of each sample through a fully connected layer and a Sigmoid activation function. The gating vector of each sample is used to dynamically adjust the weights of temporal and periodic features in each feature dimension during fusion, that is, to adjust the contribution ratio of temporal and periodic features in fusion dimension by dimension.

[0089] The dimension of the gating vector for each sample is The value of each element is in the range within; No. The gating vector of each sample The calculation formula is:

[0090] ,

[0091] In the formula, This is the Sigmoid activation function, used to map the output of the linear transformation to the (0,1) interval; Here is the weight matrix of the gated unit, with dimension 1. , is a trainable parameter matrix; To be and Perform vector concatenation; the concatenated dimension is... ; Let be the bias vector of the gated unit, with dimension . , are trainable parameters.

[0092] S3013. Calculate the fusion feature vector of each sample based on the gating vector of each sample to achieve feature fusion;

[0093] By using the gating vector and its complementary weight vector of each sample, the multi-scale temporal feature vector of each sample and the periodic embedding vector of each sample are weighted and summed in each dimension to achieve adaptive mixing of the two.

[0094] The dimension of the fused feature vector of each sample is It simultaneously contains multi-scale temporal and periodic information and achieves adaptive mixing of the two; Sample fusion feature vector The calculation formula is:

[0095] ,

[0096] In the formula, For dimension and the first A vector of all 1s with the same gating vector for each sample. The term is a complementary weight vector to the gating vector, with dimension . This is used to adjust the contribution of cyclical characteristics; For the first The periodic embedding of each sample into a linear mapping vector is processed through a linear layer. Mapping to Dimensions To ensure consistency in dimensions during the fusion process;

[0097] The calculation formula is:

[0098] ,

[0099] In the formula, The linear mapping weight matrix is ​​of dimension 1. Trainable parameters; Let be a linear mapping bias vector, which is of dimension . Trainable parameters.

[0100] S302. Construct a predictive model for forecasting short-term passenger flow at stations;

[0101] S3021. The intensity of the impact of various external factors on station passenger flow is not fixed, but depends on specific timestamp information. For example, due to commuting reasons, the impact of rainfall on station passenger flow is most significant during the morning and evening peak hours on weekdays. To model this dynamic dependence, the external factor feature vectors of each sample sensitive to external factors are calculated based on the data of various external influencing factors of each sample and the fused feature vectors of each sample, so as to realize external factor feature mapping and attention weighting.

[0102] The dimension of the external factor feature vector for each sample is: By integrating information from multiple external factors, the value of each dimension is obtained by dynamically weighting and summing attention weights, representing the comprehensive influence of external factors after context modulation; External factor feature vector of each sample The calculation formula is:

[0103] ,

[0104] In the formula, An index for the external factor type, used to iterate through all external factors, with values ​​ranging from 1 to J. The total number of types of external factors, whose value defines the number of external factor categories that the prediction model needs to consider; The natural exponential function is used to convert the score after LeakyReLU activation into a positive number for subsequent Softmax normalization. The LeakyReLU activation function is used to introduce non-linearity into the attention score calculation, preventing gradient vanishing. for transpose, Here is the weight vector for the attention mechanism, with dimension . , which are trainable parameters, are multiplied by the concatenated feature vector to calculate the unnormalized attention score, which is used to measure the importance of an external factor in the current context; For the first The embedding weight matrix of the class of external factors is a trainable parameter used to embed the th external factor into the th class of external factors. The first sample External influencing factor data linearly mapped to dimension 1 Continuous feature space; For the first The first sample External influencing factor data, when When it is a scalar, For dimension is Vectors are mapped using vector multiplication, when When it is a vector, For matrices of the corresponding dimensions;

[0105] The item is to and Perform vector concatenation to form the "keys" of key-value pairs in the attention mechanism. The concatenated vector has a dimension of [missing value]. ; The dimension of the external factor feature vector is a positive integer hyperparameter, which can take a value of 32.

[0106] S3022. Time-series periodic features and external factor features characterize passenger flow change patterns from different dimensions. In order to fully explore the complex synergistic and antagonistic relationship between the two, the multi-source fusion feature vector of each sample is calculated based on the external factor feature vector and the fusion feature vector of each sample to achieve bilinear pooling multi-source feature fusion. Specifically, the outer product of the feature vectors is calculated to capture all possible second-order combination information between time-series periodic features and external factor features, so as to model the complex dependence between multi-source features in more detail and describe the passenger flow status more comprehensively.

[0107] The dimension of the multi-source fusion feature vector of each sample is ;No. Multi-source fusion feature vector of each sample The calculation formula is:

[0108] ,

[0109] In the formula, The bilinear pooling weight matrix has dimensions of . This is used to compress and map high-dimensional outer product flattened vectors to a dimension of 1. The fused feature space consists of trainable parameters; is the dimension of the multi-source fusion feature vector, which is a positive integer hyperparameter used to control the dimension of the fused features. Its size affects the ability of the prediction model to express feature interaction information, and its value can be 64. This is a vectorization operation used to convert the input... Flatten the matrix in row-major order as follows A column vector of dimensions for subsequent linear transformations; for The transpose of converts a column vector into a row vector so that it can be used with . Perform outer product operation. The outer product operation of vectors yields a A matrix, where each element is a certain dimension and The product of two features along a certain dimension represents the strength of the second-order interaction between the two features. Let be the bilinear pooling bias vector, with dimension . Its function is to add a bias term after linear mapping, thereby enhancing the representational ability of the prediction model. It is a trainable parameter.

[0110] S3023. To further extract more discriminative nonlinear representations from the multi-source fusion feature vectors of each sample and filter redundant information, the enhanced feature vectors of each sample are calculated based on the multi-source fusion feature vectors of each sample to achieve feature enhancement of the gated linear unit. Specifically, the result of the linear transformation is modulated element-wise by the gate signal, and the features are nonlinearly filtered and enhanced through the gate mechanism, which can effectively retain important information, filter redundancy, and effectively improve the robustness and discriminativeness of the feature representation.

[0111] The dimension of the enhanced feature vector for each sample is It is a feature representation that has been filtered and enhanced by a nonlinear gating mechanism; the first Enhanced feature vectors of each sample The calculation formula is:

[0112] ,

[0113] In the formula, The first gated linear weight matrix has a dimension of . This is used to perform a linear transformation on the enhanced feature vector to generate candidate feature vectors; Let be the first gated linear bias vector, with dimension . , used to add bias terms; This is the second gated linear weight matrix, with dimension . , used to generate gating signals; Let be the second gated linear bias vector, with dimension . , used to add bias terms.

[0114] S3024. Short-term passenger flow prediction needs to output passenger flow at multiple consecutive time points in the future. Therefore, the future passenger flow prediction vector of each sample is calculated based on the enhanced feature vector of each sample in order to realize the construction of a multi-step prediction output layer.

[0115] The dimension of the future passenger flow prediction vector for each sample is , The prediction time step is a positive integer hyperparameter representing the number of consecutive future time points the prediction model needs to predict. For example, a value of 12 represents predicting passenger flow for the next 12 hours. Future passenger flow prediction vector for each sample The calculation formula is:

[0116] ,

[0117] In the formula, This is the Softplus activation function, with an output range of [value missing]. This is used to ensure that the final output of the prediction model (i.e., the predicted passenger flow) is always positive, in order to conform to the non-negative characteristics of passenger flow data; To predict the output layer weight matrix, the dimension is... , used to convert dimensions to The enhanced feature vector is linearly mapped to a dimension of The prediction space is a trainable parameter; To predict the output layer bias vector, the dimension is... After the prediction mapping, a bias is added for each time point, which is a trainable parameter.

[0118] S3025. In order to simultaneously optimize the accuracy and smoothness of the predicted values ​​and control the complexity of the prediction model, the total loss function is calculated based on the future passenger flow prediction vector of each sample. The composite loss function of weighted mean square error, first-order gradient matching loss and L2 regularization is combined to guide the training of the prediction model so as to obtain prediction results with high accuracy and consistent trend.

[0119] The total loss function is a scalar that guides the update direction of all trainable parameters during the training of the prediction model through the backpropagation algorithm. A smaller value indicates a better fit of the prediction model. The calculation formula is:

[0120] ,

[0121] In the formula, Indexed by time point; For the first The weighting coefficients for each time point are predefined hyperparameters used to adjust the importance of errors at different prediction time points. Higher weights are assigned to critical periods (such as peak periods) to improve prediction accuracy, thus satisfying [the desired outcome]. For example, 1.5 is used during peak hours and 0.5 is used during off-peak hours; For the first The future passenger flow prediction vector of the nth sample There are 1 element, and all predicted values ​​are positive. For the first The sample at the th The actual passenger flow at each time point was obtained from the dataset. The sample at the th The actual passenger flow at each point in time is used as the training target label; The weighting coefficient for the trend consistency loss term is a positive, adjustable hyperparameter used to assess the accuracy of equilibrium point prediction and to fit the sequence trend. Its value can be 0.1. For the first The future passenger flow prediction vector of the nth sample One element; For the first The sample at the th The actual passenger flow at a specific point in time; The weight coefficient of the L2 regularization term is a positive adjustable hyperparameter used to control the penalty strength of the prediction model complexity and prevent overfitting caused by excessive parameter values. The value can be 0.001. The set of all trainable parameters for the prediction model The squared L2 norm, which serves as a regularization term, penalizes large parameter values ​​and encourages the prediction model to obtain simpler and more generalized solutions.

[0122] In the above formula, The term is used to minimize the deviation between the predicted value and the actual value; This term is used to ensure that the trend (change between adjacent points) of the predicted sequence is consistent with the actual sequence, thereby improving the smoothness of the sequence; The term is used as an L2 regularization term to penalize excessively large prediction model parameters and prevent overfitting.

[0123] S303. Train the prediction model to obtain the trained prediction model; during training, use the dataset to optimize all trainable parameters in the prediction model, with minimizing the total loss function as the training objective;

[0124] S3031. Input multiple samples from the training set into the prediction model in batches;

[0125] S3032. During the forward propagation process, multiple sample data from each batch are processed sequentially using S2, S301, S3021, S3022, S3023, and S3024 to obtain the future passenger flow prediction vector for each sample.

[0126] S3033. Calculate the total loss function value between the prediction results of this batch and the true labels. This value comprehensively measures the accuracy of the prediction points, the consistency of the sequence trend, and the complexity of the prediction model.

[0127] S3034. During backpropagation, the gradient descent algorithm is used to update the prediction model parameters based on the gradient calculated by the loss function;

[0128] The gradient descent algorithm is the Adam (Adaptive Moment Estimation) algorithm.

[0129] S3035. During training, use an independent validation set to periodically evaluate the performance of the prediction model and monitor changes in the validation set loss.

[0130] S3036. Repeat S3031~S3035 until the stopping iteration condition is met, save the parameters of the prediction model with the best performance on the validation set, complete the prediction model training, and obtain the trained prediction model.

[0131] The stopping iteration condition is when the preset maximum number of training rounds is reached or the validation set loss no longer decreases significantly within multiple consecutive evaluation periods (i.e., the early stopping condition is met).

[0132] To verify the predictive performance of this technique under different external environmental conditions and to evaluate its robustness and adaptability, experiments were conducted to compare the root mean square error (RMSE) of the conventional ARIMA model, support vector machine regression, LSTM neural network, Transformer model, and this technique under different external environmental conditions. Figure 2 shows the results. The horizontal axis of Figure 2 represents the external environmental conditions, including sunny workdays, rainy workdays, snowy workdays, sunny weekends, rainy weekends, days with large events, holidays, and extreme weather, involving combinations of different weather conditions, different weektime units, and special scenarios. The vertical axis represents the root mean square error (RMSE), which comprehensively considers the magnitude and dispersion of the prediction error, with units of person-times per hour. As shown in Figure 2, the green bar representing this technique is the lowest under all external environmental conditions. This demonstrates the effectiveness of the external factor feature mapping and attention weighting mechanism in this technique. This technique converts external factors into feature vectors through a trainable embedding layer and uses the fused feature vectors as queries to dynamically calculate the weights of each external factor, enabling the prediction model to flexibly adjust the influence intensity of different external factors according to the specific time context.

[0133] S4. Collect new time data, new historical passenger flow data, and new external influencing factor data for prediction. After executing S2, input the data into the trained prediction model to obtain the predicted passenger flow values ​​for multiple consecutive time points in the future. This predicted value is the quantitative estimate of the station's future short-term passenger flow trend by the prediction model, which can be used to assist in passenger transport organization, capacity allocation and other decision-making.

[0134] The new time data consists of the current moment and the timestamp information corresponding to the future predicted time period, which have been encoded as time feature vectors.

[0135] The new historical passenger flow data is the sequence of passenger flow within a historical time window prior to the current moment.

[0136] The new external influencing factors data includes currently known external influencing factors and those that can be predicted in the future forecast period.

Claims

1. A method for predicting short-term passenger flow at railway stations based on deep learning, characterized in that, include: S1. Construct a dataset, which includes multiple samples; divide all samples into training set, validation set, and test set in chronological order. S2. Calculate the multi-scale temporal feature vector of each sample based on the weight of each sample relative to each time segment; S3. Construct a prediction model for predicting short-term passenger flow at the station, train the prediction model, and obtain a trained prediction model; S301. Calculate the fusion feature vector of each sample based on the periodic embedding vector of each sample; S302. Construct a prediction model for predicting short-term passenger flow at the station; S303. Train the prediction model to obtain a trained prediction model; S4. Collect new time data, new historical passenger flow data, and new external influencing factor data for prediction, and input them into the trained prediction model after executing S2 to obtain predicted passenger flow values ​​for multiple consecutive time points in the future.

2. The method for predicting short-term passenger flow at a station based on deep learning according to claim 1, characterized in that, The sample in S1 includes time data, historical passenger flow data, future actual passenger flow label data, and data on various external influencing factors.

3. The method for predicting short-term passenger flow at a station based on deep learning according to claim 2, characterized in that, The time data refers to timestamp information; historical passenger flow data refers to the original time-series vector of passenger flow; future real passenger flow label data refers to the actual passenger flow at multiple consecutive time points after a historical time point as the starting point for each sample; the types of external influencing factor data include weather conditions, temperature, precipitation, wind speed, special event markers, and traffic congestion index.

4. The method for predicting short-term passenger flow at a station based on deep learning according to claim 1, characterized in that, The steps of S2 include: S201. Dividing the time feature vectors of all samples into multiple typical time segments using a clustering algorithm to obtain the cluster center vectors of multiple time segments, and calculating the belonging weight of each sample relative to each time segment based on the time feature vector of each sample and the cluster center vector of each time segment; S202. Calculating the multi-scale time series feature vector of each sample based on the belonging weight of each sample relative to each time segment.

5. The method for predicting short-term passenger flow at a station based on deep learning according to claim 4, characterized in that, The formula for calculating the multi-scale temporal feature vector of each sample in S202 is as follows: In the formula, For the first Multi-scale temporal feature vectors of each sample; For sample index; This is the vector concatenation operator; Time-segmented index; The total number of time segments; For the first For the nth sample The weighting of each time segment; For the first The time feature vector of each sample; This is element-wise multiplication; For application to the Wavelet basis functions for time segments; For the first The original time-series vector of the inbound volume of each sample; For the first The mean vector of the number of samples entering the station within each time segment; For the first The standard deviation vector of the number of samples entering the station within each time segment.

6. The method for predicting short-term passenger flow at a station based on deep learning according to claim 1, characterized in that, The steps in S301 include: S3011. Calculating the periodic embedding vector of each sample based on the weekly time unit and holiday status of each sample; S3012. Generating the gating vector of each sample based on the multi-scale temporal feature vector of each sample and the periodic embedding vector of each sample; S3013. Calculating the fusion feature vector of each sample based on the gating vector of each sample.

7. The method for predicting short-term passenger flow at a station based on deep learning according to claim 6, characterized in that, The formula for calculating the fusion feature vector of each sample in S3013 is as follows: In the formula, For the first Each sample fusion feature vector; For the first The gating vector of each sample; This is element-wise multiplication; For the first Multi-scale temporal feature vectors of each sample; For sample index; For dimension and the first A vector of all 1s with the same gating vector for each sample; For the first A periodic embedding linear mapping vector for each sample.

8. The method for predicting short-term passenger flow at a station based on deep learning according to claim 1, characterized in that, Step S302 includes: S3021. Calculating the external factor feature vector of each sample that is sensitive to external factors based on the data of various external influencing factors of each sample and the fusion feature vector of each sample; S3022. Calculating the multi-source fusion feature vector of each sample based on the external factor feature vector of each sample and the fusion feature vector of each sample; S3023. Calculating the enhanced feature vector of each sample based on the multi-source fusion feature vector of each sample; S3024. Calculating the future passenger flow prediction vector of each sample based on the enhanced feature vector of each sample; S3025. Calculating the total loss function based on the future passenger flow prediction vector of each sample.

9. A method for predicting short-term passenger flow at a station based on deep learning according to claim 8, characterized in that, The formula for calculating the enhanced feature vector of each sample in S3023 is as follows: In the formula, For the first Enhanced feature vectors of each sample; This is the first gated linear weight matrix; For the first Multi-source fusion feature vector of each sample; This is the first gated linear bias vector; This is element-wise multiplication; Use the Sigmoid activation function; This is the second gated linear weight matrix; This is the second gated linear bias vector.