A passenger flow prediction method, system, storage medium and device

CN123014287APending Publication Date: 2026-10-30GUANGZHOU HOLLEY COLLEGE
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611094441.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-22
Publication Date
2026-10-30

AI Technical Summary

Technical Problem

现有模型难以量化各特征的贡献度,从而限制了基于模型输出的精细化、智能化调度策略的制定与优化空间

Benefits of technology

本申请可以自动、动态地从高维特征中筛选出与预测目标最相关的关键特征,同时有效抑制冗余特征的干扰,具有较强的预测精度和泛化能力;并且能够输出全局特征重要性排名,直观量化每个输入特征对最终预测结果的贡献度,具备高可解释性。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123014287A_ABST
    Figure CN123014287A_ABST
Patent Text Reader

Abstract

The application provides a passenger flow prediction method, system, storage medium and equipment; the passenger flow prediction method comprises the following steps: acquiring multi-source historical data of a target city, and constructing a space-time feature matrix based on the multi-source historical data; constructing an initial passenger flow prediction model, training and verifying the initial passenger flow prediction model according to the space-time feature matrix, so as to obtain a target passenger flow prediction model; and based on target input data, outputting a passenger flow prediction value of a set time period through the target passenger flow prediction model, and simultaneously outputting a global feature importance ranking. The application realizes dynamic and adaptive screening and fusion of multi-source space-time features, generates a global feature importance ranking while outputting a prediction result, and realizes model interpretability.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to a prediction method, and more particularly to a passenger flow prediction method, system, storage medium, and device, belonging to the field of intelligent transportation technology. Background Technology

[0002] Traffic flow prediction is a key technology in intelligent transportation systems for optimizing operational scheduling, alleviating peak-hour congestion, and improving passenger travel experience. Currently, there are two main technical bottlenecks: Traffic flow is not only influenced by its own historical patterns, but also strongly correlated with various external factors such as weather (such as rainfall and temperature), holidays, and activities around stations. Existing models, such as LSTM, are inefficient when fusing such high-dimensional and heterogeneous external features. They usually require manually constructing complex feature lag terms, which not only increases the model complexity, but also easily introduces redundant feature interference, resulting in large fluctuations in prediction error.

[0003] Deep learning models (such as LSTM) are often considered "black boxes" because their internal decision-making logic is difficult to understand. Operations management departments not only need accurate predictions, but also want to understand which factors (such as heavy rain or holidays) cause changes in passenger flow, and the weight of each factor. Existing models struggle to quantify the contribution of each feature, thus limiting the development and optimization of refined and intelligent scheduling strategies based on model outputs. Summary of the Invention

[0004] In view of this, this application provides a passenger flow prediction method, system, storage medium and device to solve or alleviate the technical problems existing in the prior art, and at least provides a beneficial alternative.

[0005] The technical solution of this application embodiment is implemented as follows: This application provides a passenger flow prediction method, comprising the following steps: acquiring multi-source historical data of a target city and constructing a spatiotemporal feature matrix based on the multi-source historical data; constructing an initial passenger flow prediction model, training and validating the initial passenger flow prediction model according to the spatiotemporal feature matrix to obtain a target passenger flow prediction model; and, based on target input data, outputting passenger flow prediction values ​​for a set time period through the target passenger flow prediction model, while simultaneously outputting a global feature importance ranking.

[0006] A further preferred embodiment: after obtaining the multi-source historical data, the method further includes: preprocessing the multi-source historical data; wherein the preprocessing includes at least data cleaning and data alignment.

[0007] Further preferred: The multi-source historical data includes passenger flow data, meteorological data, calendar information, and event information.

[0008] A further preferred embodiment: constructing a spatiotemporal feature matrix based on the multi-source historical data includes: constructing time lag features based on preprocessed passenger flow data to obtain passenger flow features; encoding preprocessed meteorological data and activity information to obtain scene features; standardizing preprocessed calendar information to obtain calendar features; and constructing a spatiotemporal feature matrix based on the passenger flow features, scene features, and calendar features.

[0009] A further preferred embodiment involves training and validating the initial passenger flow prediction model based on the spatiotemporal feature matrix to obtain a target passenger flow prediction model. This includes: dividing the spatiotemporal feature matrix into a training set, a validation set, and a test set; iteratively training the initial passenger flow prediction model using the training set, while simultaneously monitoring the model performance of the initial passenger flow prediction model using the validation set, terminating training when the validation set loss does not decrease for a preset number of consecutive training rounds; and testing the currently trained initial passenger flow prediction model using the test set, obtaining the target passenger flow prediction model upon successful testing.

[0010] A further preferred embodiment: the initial passenger flow prediction model includes a feature transformer and an attention transformer; the spatiotemporal feature matrix is ​​input into the feature transformer to generate a feature embedding vector; and key features are dynamically selected through a multi-step iterative mechanism using the attention transformer.

[0011] A further preferred embodiment of the multi-step iterative mechanism includes: setting an iteration number; in the k-th step, calculating the sparse feature importance weights based on the feature embedding vector using an attention transformer, selecting key features based on the sparse feature importance weights, and suppressing the key features using a masking factor; where k>1; performing a nonlinear transformation on the key features using a feature transformer before proceeding to the next iteration, and finally weighting and summing the outputs of each step to obtain the predicted value.

[0012] Based on the same concept, this application also provides a passenger flow prediction system, including: a data acquisition and processing module, used to acquire multi-source historical data of a target city and construct a spatiotemporal feature matrix based on the multi-source historical data; a model construction and training module, which has an initial passenger flow prediction model built in, used to train and verify the initial passenger flow prediction model according to the spatiotemporal feature matrix to obtain a target passenger flow prediction model; and a prediction and output module, used to output passenger flow prediction values ​​for a set time period based on target input data and through the target passenger flow prediction model, while also outputting a global feature importance ranking.

[0013] Based on the same concept, this application also provides a storage medium storing a computer program, wherein the computer program is configured to execute the passenger flow prediction method at runtime.

[0014] Based on the same concept, this application also provides an apparatus comprising a processor and a memory, wherein the memory stores at least one instruction, at least one program, a code set, or an instruction set, wherein the at least one instruction, the at least one program, the code set, or the instruction set is loaded and executed by the processor to implement the passenger flow prediction method.

[0015] The embodiments of this application, due to the adoption of the above technical solutions, have the following advantages: This application can automatically and dynamically select the key features most relevant to the prediction target from high-dimensional features, while effectively suppressing the interference of redundant features, and has strong prediction accuracy and generalization ability; it can also output a global feature importance ranking, intuitively quantify the contribution of each input feature to the final prediction result, and has high interpretability.

[0016] The above overview is for illustrative purposes only and is not intended to be limiting in any way. In addition to the illustrative aspects, embodiments, and features described above, further aspects, embodiments, and features of this application will become readily apparent from the accompanying drawings and the following detailed description. Attached Figure Description

[0017] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0018] Figure 1 This is a flowchart of the passenger flow prediction method described in this application.

[0019] Figure 2 This is a schematic diagram showing the ranking of the importance of the features described in this application.

[0020] Figure 3 This is a diagram showing the comparison between actual and predicted passenger flow as described in this application.

[0021] Figure 4 This is a schematic diagram comparing the models described in this application.

[0022] Figure 5 This is a block diagram of the passenger flow prediction system described in this application. Detailed Implementation

[0023] In the following description, only certain exemplary embodiments are briefly described. As those skilled in the art will recognize, the described embodiments can be modified in various ways without departing from the spirit or scope of this application. Therefore, the drawings and description are considered to be exemplary in nature and not restrictive.

[0024] The embodiments of this application will now be described in detail with reference to the accompanying drawings.

[0025] like Figure 1 As shown in the figure, this application provides a passenger flow prediction method, including the following steps: acquiring multi-source historical data of a target city and constructing a spatiotemporal feature matrix based on the multi-source historical data; constructing an initial passenger flow prediction model, training and validating the initial passenger flow prediction model according to the spatiotemporal feature matrix to obtain a target passenger flow prediction model; and, based on the target input data, outputting the passenger flow prediction value for a set time period through the target passenger flow prediction model, while simultaneously outputting a global feature importance ranking.

[0026] Further preferred: The multi-source historical data includes passenger flow data, meteorological data, calendar information, and event information.

[0027] In some embodiments, taking passenger flow prediction of the target city's subway system as an example, the passenger flow data is the historical passenger flow in and out of the station at the daily or hourly level. The daily data comes from the subway database and the relevant data open platform of the target city, while the hourly data comes from multiple anonymous stations. The meteorological data, corresponding to the highest temperature, lowest temperature, rainfall, and weather type (sunny / rainy / snowy, etc.) at the corresponding time point, comes from historical weather networks and weather big data platforms. The calendar information, i.e., whether it is a weekday, weekend, statutory holiday, traditional festival, etc., comes from Timor.tech's holiday service. The event information, such as the holding of large-scale concerts, sports events, exhibitions, and other gatherings, comes from the relevant data open platform of the target city.

[0028] A further preferred embodiment: after obtaining the multi-source historical data, the method further includes: preprocessing the multi-source historical data; wherein the preprocessing includes at least data cleaning and data alignment.

[0029] In some embodiments, multi-source historical data is cleaned and missing values ​​are removed. In this embodiment, a direct deletion method is used to process samples containing missing values. Compared with the median imputation method, this strategy reduces the model's MSE by 57% and improves R² by 60%. All data are aligned by timestamp to construct a unified spatiotemporal feature matrix, reducing spatiotemporal feature mismatch error by 20% to 30%.

[0030] A further preferred embodiment: constructing a spatiotemporal feature matrix based on the multi-source historical data includes: constructing time lag features based on preprocessed passenger flow data to obtain passenger flow features; encoding preprocessed meteorological data and activity information to obtain scene features; standardizing preprocessed calendar information to obtain calendar features; and constructing a spatiotemporal feature matrix based on the passenger flow features, scene features, and calendar features.

[0031] In some embodiments, time-lag features are constructed for passenger flow data, including passenger flow for days t-1, t-2, ..., t-7, and sliding window statistical features such as 7-day moving averages. One-Hot encoding is used for categorical features such as weather and holidays. Z-score standardization is applied to numerical features to eliminate the influence of dimensions. The final constructed daily feature matrix contains 18 dimensions, and the hourly feature matrix contains 24 dimensions.

[0032] It should be noted that the spatiotemporal feature matrix includes a daily feature matrix and an hourly feature matrix.

[0033] A further preferred embodiment involves training and validating the initial passenger flow prediction model based on the spatiotemporal feature matrix to obtain a target passenger flow prediction model. This includes: dividing the spatiotemporal feature matrix into a training set, a validation set, and a test set; iteratively training the initial passenger flow prediction model using the training set, while simultaneously monitoring the model performance of the initial passenger flow prediction model using the validation set, terminating training when the validation set loss does not decrease for a preset number of consecutive training rounds; and testing the currently trained initial passenger flow prediction model using the test set, obtaining the target passenger flow prediction model upon successful testing.

[0034] In some embodiments, the preprocessed data is divided into a training set (80%), a validation set (10%), and a test set (10%) in chronological order to strictly prevent future data leakage. Using the Adam optimizer, for example, setting the feature embedding dimension n_d=n_a=64, the number of feature selection iterations n_steps=5, the sparse regularization coefficient lambda_sparse=0.01, the batch size=256, the inhibition factor gamma=1.8, and the early stopping patience value patience=20.

[0035] The model is iteratively trained using the training set data to minimize the loss function. The model performance is monitored using the validation set; training is terminated when the validation loss does not decrease for 20 consecutive epochs to prevent overfitting.

[0036] In addition, the model trained on the target city's data will be directly transferred to the daily passenger flow data of another city for testing to evaluate the model's generalization ability.

[0037] A further preferred embodiment: the initial passenger flow prediction model includes a feature transformer and an attention transformer; the spatiotemporal feature matrix is ​​input into the feature transformer to generate a feature embedding vector; and key features are dynamically selected through a multi-step iterative mechanism using the attention transformer.

[0038] In some embodiments, a TabNet model (i.e., the initial passenger flow prediction model) is constructed. The TabNet model is an end-to-end deep learning architecture whose core structure includes a Feature Transformer and an Attentive Transformer.

[0039] Specifically: Let the historical time window be T, and the feature dimension be D. Then the input feature matrix (i.e., the spatiotemporal feature matrix) is X ∈ R^(T×D). This matrix integrates all preprocessed features. For daily prediction, T=7, D=18; for hourly prediction, T=24, D=24; the model outputs the passenger flow prediction value ŷ for the next K steps, where K=1 for daily prediction and K=24 for hourly prediction.

[0040] It should be noted that the input feature matrix can be flexibly configured with dimensions according to actual business needs (such as 18 dimensions for daily level or 24 dimensions for hourly level), and the output prediction step size (K=1 or K=24) can also be adjusted.

[0041] The input feature matrix X is first processed by a feature transformer to generate a high-dimensional feature embedding vector H^(0) = ReLU(XW_e + b_e), where W_e ∈ R^(D×d), and d=64 is the embedding dimension.

[0042] A further preferred embodiment of the multi-step iterative mechanism includes: setting an iteration number; in the k-th step, calculating the sparse feature importance weights based on the feature embedding vector using an attention transformer, selecting key features based on the sparse feature importance weights, and suppressing the key features using a masking factor; where k>1; performing a nonlinear transformation on the key features using a feature transformer before proceeding to the next iteration, and finally weighting and summing the outputs of each step to obtain the predicted value.

[0043] In some embodiments, the model performs feature selection over n_steps = 5 steps; at step k (k = 1, 2, ..., 5), the attention transformer uses the Sparsemax activation function to calculate the feature importance weights for the current step: A^(k) = Sparsemax(H^(k-1)W_a^(k) + b_a^(k)). The Sparsemax function ensures the sparsity of the output weights (most weights are zero) by solving the least-squares projection problem. Selected important features are suppressed in subsequent steps through a masking mechanism M^(k) = (1 - γ·A^(k)) (γ = 1.8 is the suppression factor), encouraging the model to explore other features.

[0044] The selected features are then fed into a feature transformer for a nonlinear transformation: H^(k) = ReLU((M^(k)⊙H^(k-1))W_p^(k) + b_p^(k)). Finally, the outputs from multiple steps are weighted and summed, and the result is passed through a fully connected layer to obtain the final predicted value. = ΣH^(k)W_o^(k) + b_o.

[0045] The model's loss function consists of two parts: L = (1 / N)Σ(y_i - _i)² + λ·Σ||A^(k)||1. The first term is the mean squared error (MSE), which measures the difference between the predicted and the true values; the second term is the sparsity regularization term (λ=0.01), which encourages the model to use fewer features at each step, enhancing the sparsity of the selection.

[0046] Furthermore, after the model training is complete, the global feature importance ranking can be extracted from the TabNet model (e.g., Figure 2 (As shown). This ranking is based on the cumulative value of the attention weights assigned to each feature by the model at each step; the model can intuitively output the percentage contribution of each input feature to the prediction result, for example: the weight of 7-day delayed passenger flow is 18.0%, the weight of holiday markers is 12.0%, and the weight of the highest temperature is 9.5%, etc.; enabling the operations management department to use this interpretable report to quantitatively analyze the degree of influence of key factors, thereby formulating targeted scheduling strategies, such as increasing the frequency of services in advance during holidays, or dynamically adjusting the station diversion plan during rainstorm warnings.

[0047] It should also be noted that, through experimental verification, such as Figure 3 As shown, a diagram illustrating the comparison between actual and predicted passenger flow is presented; Figure 4 As shown, the MSE (mean squared error) of this application is 2023.09, which is 63.1% lower than that of the traditional LSTM model (MSE=5475.20), and the R² (coefficient of determination) reaches 0.934.

[0048] Based on the same concept, such as Figure 5 As shown, this application also provides a passenger flow prediction system, including: a data acquisition and processing module, used to acquire multi-source historical data of a target city and construct a spatiotemporal feature matrix based on the multi-source historical data; a model construction and training module, which has an initial passenger flow prediction model built in, used to train and verify the initial passenger flow prediction model according to the spatiotemporal feature matrix to obtain a target passenger flow prediction model; and a prediction and output module, used to output passenger flow prediction values ​​for a set time period based on target input data and through the target passenger flow prediction model, while also outputting a global feature importance ranking.

[0049] It should be noted that the passenger flow prediction system and the above-mentioned passenger flow prediction method are based on the same concept. For the specific implementation of the system, please refer to the prediction method, which will not be repeated here.

[0050] Based on the same concept, this application also provides a storage medium storing a computer program, wherein the computer program is configured to execute the passenger flow prediction method at runtime.

[0051] In some embodiments, the storage medium stores a plurality of computer programs to cause a device to perform all or part of the steps of the methods described in the various embodiments of this application. The medium may include various media capable of storing program code, such as a USB flash drive, a portable hard drive, a read-only memory, a random access memory, a magnetic disk, or an optical disk.

[0052] Based on the same concept, this application also provides an apparatus comprising a processor and a memory, wherein the memory stores at least one instruction, at least one program, a code set, or an instruction set, wherein the at least one instruction, the at least one program, the code set, or the instruction set is loaded and executed by the processor to implement the passenger flow prediction method.

[0053] In some embodiments, the memory and the processor are interconnected; the processor may be one or more CPUs. If the processor is a single CPU, it may be a single-core CPU or a multi-core CPU. The processor is used to control various functional modules of the device and process signals. The memory includes, but is not limited to, RAM (Random Access Memory), ROM (Read-Only Memory), EPROM (Erasable Programmable Read-Only Memory), and CD-ROM (Compact Disc Read-Only Memory). This memory is used to store computer programs, operating systems, various applications, and data, such as storing computer programs used to implement the passenger flow prediction method.

[0054] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any person skilled in the art can easily conceive of various variations or substitutions within the technical scope disclosed in this application, and these should all be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A method for predicting passenger flow, characterized in that, Includes the following steps: Acquire multi-source historical data of the target city, and construct a spatiotemporal feature matrix based on the multi-source historical data; An initial passenger flow prediction model is constructed, and the initial passenger flow prediction model is trained and validated based on the spatiotemporal feature matrix to obtain a target passenger flow prediction model. Furthermore, based on the target input data, the target passenger flow prediction model outputs the passenger flow prediction value for a set time period, and also outputs the global feature importance ranking.

2. The passenger flow prediction method according to claim 1, characterized in that, After obtaining the multi-source historical data, the following is also included: The multi-source historical data is preprocessed; wherein the preprocessing includes at least data cleaning and data alignment.

3. The passenger flow prediction method according to claim 2, characterized in that, The multi-source historical data includes passenger flow data, meteorological data, calendar information, and event information.

4. The passenger flow prediction method according to claim 3, characterized in that, Based on the aforementioned multi-source historical data, a spatiotemporal feature matrix is ​​constructed, including: Time lag features are constructed based on preprocessed passenger flow data to obtain passenger flow characteristics; Encoding is performed based on preprocessed meteorological data and activity information to obtain scene characteristics; Standardize the preprocessed calendar information to obtain calendar features; Furthermore, a spatiotemporal feature matrix is ​​constructed based on the aforementioned passenger flow characteristics, scene characteristics, and calendar characteristics.

5. The passenger flow prediction method according to claim 4, characterized in that, The initial passenger flow prediction model is trained and validated based on the spatiotemporal feature matrix to obtain the target passenger flow prediction model, including: The spatiotemporal feature matrix is ​​divided into a training set, a validation set, and a test set; The initial passenger flow prediction model is iteratively trained using the training set, while the model performance of the initial passenger flow model is monitored using the validation set. Training is terminated when the validation set loss does not decrease for a preset number of consecutive training rounds. The initial passenger flow prediction model obtained through the current training is tested using the test set, and the target passenger flow prediction model is obtained when the test passes.

6. The passenger flow prediction method according to claim 5, characterized in that, The initial passenger flow prediction model includes a feature transformer and an attention transformer; The spatiotemporal feature matrix is ​​input into the feature transformer to generate a feature embedding vector; The attention transformer employs a multi-step iterative mechanism to dynamically filter key features.

7. The passenger flow prediction method according to claim 6, characterized in that, The multi-step iterative mechanism includes: Set the number of iteration steps. In the k-th step, the attention transformer calculates the sparse feature importance weights based on the feature embedding vector, and selects key features based on the sparse feature importance weights, and suppresses the key features through a masking factor; where k>1. After the key features are nonlinearly transformed by the feature transformer, the next iteration begins, and the outputs of each step are weighted and summed to obtain the predicted value.

8. A system employing the passenger flow prediction method as described in any one of claims 1-7, characterized in that, include: The data acquisition and processing module is used to acquire multi-source historical data of the target city and construct a spatiotemporal feature matrix based on the multi-source historical data; The model building and training module has a built-in initial passenger flow prediction model, which is used to train and validate the initial passenger flow prediction model based on the spatiotemporal feature matrix to obtain the target passenger flow prediction model. The prediction and output module is used to output the predicted passenger flow value for a set time period based on the target input data and the target passenger flow prediction model, while also outputting the global feature importance ranking.

9. A storage medium, characterized in that, The storage medium stores a computer program, wherein the computer program is configured to execute the passenger flow prediction method as described in any one of claims 1-7 when it is run.

10. A device, characterized in that, The device includes a processor and a memory, the memory storing at least one instruction, at least one program, code set, or instruction set, the at least one instruction, the at least one program, the code set, or the instruction set being loaded and executed by the processor to implement the passenger flow prediction method as described in any one of claims 1-7.