Metro station traffic flow prediction method based on transfer learning

CN122947966APending Publication Date: 2026-10-20CHINA RAILWAY FIRST SURVEY & DESIGN INST GRP
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202611001649.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-07
Publication Date
2026-10-20

AI Technical Summary

Technical Problem

[0008]本发明的目的是提供一种基于迁移学习的新地铁站流量预测方法,以解决现有方法存在的因新地铁站运营初期数据稀缺、跨站点流量特征迁移困难,导致预测精度较低、泛化能力不足、适应能力受到限制的问题

Benefits of technology

[0078]本发明提供了一种基于迁移学习的新地铁站流量预测方法,引入迁移学习机制,能够充分利用既有线路或相似站点的历史客流特征,将源域中的有效知识迁移到新地铁站客流预测任务中,从而缓解新地铁站历史数据不足带来的建模困难,提高预测结果的准确性与稳定性。另外,针对新地铁站投运初期样本数量少、数据积累不足的问题,本发明通过领域特征对齐与知识迁移,实现了对小样本场景下目标站点客流规律的有效学习,降低了模型对大量标注数据的依赖,增强了模型对数据稀缺场景的适应能力。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure FT_1
    Figure FT_1
  • Figure FT_2
    Figure FT_2
  • Figure QLYQS_2
    Figure QLYQS_2
Patent Text Reader

Abstract

This invention relates to a new subway station traffic prediction method based on transfer learning. It establishes a sequence containing passenger flow data from both new and established subway stations, and clusters the established subway stations. An attention-LSTM model is constructed to train the passenger flow prediction source model, obtaining the best-performing source model among different categories. The cosine similarity between the new subway station and the cluster center station is calculated, and the optimal source model corresponding to the cluster center station with the highest similarity is selected as the adapted source model for the new subway station. Using historical passenger flow prediction for various established subway stations as the source task and passenger flow prediction for the new subway station as the target task, knowledge transfer is performed to complete the passenger flow prediction for the new subway station. This invention introduces a transfer learning mechanism, fully utilizing the historical passenger flow characteristics of existing lines or similar stations, transferring effective knowledge from the source domain to the passenger flow prediction task for the new subway station, thereby alleviating the modeling difficulties caused by insufficient historical data for the new subway station.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of urban rail transit passenger flow prediction technology, specifically to a new subway station traffic prediction method based on transfer learning. Background Technology

[0002] In urban subway transit systems, accurate passenger flow forecasting can simultaneously benefit urban planning, subway operations, and passenger travel. Firstly, accurate passenger flow forecasting provides urban planners with a reliable reference for developing urban development plans and optimizing urban spatial layout. Secondly, for subway operators, effective passenger flow forecasting allows for more efficient train management and scheduling. Finally, for passengers, obtaining passenger flow data for a future period helps them plan their travel time, routes, and modes of transportation, avoiding surges in passenger flow at any given time and improving passenger comfort and experience. Therefore, some existing technologies are beginning to conduct in-depth modeling research on the temporal characteristics of subway passenger flow, aiming to further improve the accuracy of flow forecasting in complex scenarios.

[0003] For example, patent CN115146843B discloses a method for short-term passenger flow prediction of newly opened subway stations based on meta-learning. This method constructs a meta-learning framework consisting of a local learner, a global learner, and a base network. It learns the spatiotemporal characteristics of passenger flow from multiple data-rich source stations and forms general initialization parameters that can be transferred to target stations. These parameters are then pre-trained using a small amount of historical passenger flow data from the target station to achieve short-term passenger flow prediction for newly opened stations with scarce data. In its implementation, this method also uses LSTM (Long-Short Term Memory) as the base network. By constructing a Meta-LSTM model, it learns passenger flow feature knowledge from multiple data-rich source stations and transfers the learned knowledge to newly opened subway stations or other target stations with limited data, thereby improving the stability of knowledge transfer and the accuracy of passenger flow prediction for newly opened stations.

[0004] However, while this method alleviates the prediction difficulties caused by insufficient passenger flow data at newly opened stations to some extent, it still has the following two shortcomings when applied to newly built stations: First, although the method introduces a meta-learning mechanism to address the problem of scarce data at newly opened stations, it mainly relies on parameter initialization to complete knowledge transfer. It still requires the target station to provide a certain scale of historical passenger flow data for pre-training. Therefore, for newly built stations with very little or no historical passenger flow, there are still problems such as insufficient training samples, difficulty in fully learning the model, and limited prediction accuracy. Second, its meta-learning task is mainly based on the spatial location of the station and the spatiotemporal information of passenger flow. It does not combine the functional characteristics of the station's surroundings to select source tasks or source models, and does not explicitly consider the negative transfer risk that may be caused by the difference in distribution between the source domain and the target domain. Therefore, the transfer process still has shortcomings in terms of targeting, stability, and fine-grained adaptation capabilities.

[0005] For example, patent CN114154695B discloses a method for predicting short-term passenger flow in urban rail transit based on transfer learning. This method constructs an evaluation index system for station passenger flow characteristics, classifies stations using a clustering algorithm, selects cluster center stations to establish passenger flow prediction models, and then uses transfer learning to transfer the optimal prediction model from the cluster center stations to other stations of the same category, thereby improving the efficiency and accuracy of short-term passenger flow prediction for urban rail transit. In its implementation, this method uses various models, including ARIMA (Auto Regression Moving Average), LSTM, Transformer, CNN (Convolutional Neural Network), and graph convolution, to mine passenger flow patterns based on the temporal characteristics of different stations. Model transfer is achieved by freezing the main parameters and fine-tuning some parameters, thus enabling the prediction of passenger flow for different categories of stations.

[0006] However, while this method improves the efficiency of passenger flow prediction for different types of stations to some extent, it still has the following shortcomings when combined with the scenario of passenger flow prediction for newly built subway stations: First, this method is mainly aimed at short-term passenger flow prediction for general urban rail transit stations. Its migration process mainly focuses on model reuse between existing operating stations and is not specifically designed for the cold start scenario where there is very little historical data in the early stages of operation of newly built subway stations. Therefore, under small sample conditions, there are still problems with insufficient model generalization ability and limited prediction accuracy. Second, although this method uses clustering results to classify stations, the model migration process is only based on the category and does not further combine the functional similarity between the newly built station and the cluster center station for dynamic source model matching, making it difficult to achieve more refined model adaptation. Third, this method mainly uses the method of freezing the main parameters and fine-tuning some parameters to complete knowledge transfer. It lacks a constraint mechanism for the difference in feature distribution between the source domain and the target domain and does not explicitly consider the negative transfer problem that may occur during cross-site migration, thus limiting the stability and adaptability of the model when migrating between different stations.

[0007] Therefore, it is necessary to propose new measures to overcome the above-mentioned shortcomings. Summary of the Invention

[0008] The purpose of this invention is to provide a new subway station traffic prediction method based on transfer learning, in order to solve the problems of low prediction accuracy, insufficient generalization ability and limited adaptability of existing methods due to the scarcity of data in the early stage of operation of new subway stations and the difficulty of transferring traffic features across stations.

[0009] To achieve the above objectives, the technical solution adopted by the present invention is as follows:

[0010] A novel subway station traffic prediction method based on transfer learning is provided, the method comprising:

[0011] Establish sequences containing passenger flow data from new subway stations and sequences containing passenger flow data from mature subway stations, and cluster the mature subway stations to obtain a set of cluster center stations;

[0012] We constructed an attention-LSTM model consisting of an input layer, an LSTM layer, an attention layer, and a fully connected layer. Based on the attention-LSTM model, we trained the source model for passenger flow prediction to obtain the source model with the best performance in different categories.

[0013] Calculate the cosine similarity between the new subway station and the cluster center station respectively, and select the optimal source model corresponding to the cluster center station with the highest similarity as the adaptation source model for the new subway station.

[0014] Using historical passenger flow forecasts of various established subway stations as the source task and passenger flow forecasts of new subway stations as the target task, knowledge transfer was carried out to complete the passenger flow forecasts for new subway stations.

[0015] Furthermore, clustering mature subway stations yields a set of cluster center stations, including:

[0016] The optimal number of clusters for mature subway stations was determined using the K-means clustering algorithm.

[0017] With the optimal number of clusters as the prior objective, mature subway stations are divided into different categories using the AP clustering algorithm;

[0018] make If a set represents different categories, then Indicate different categories The cluster center of the station set.

[0019] Furthermore, the input layer of the attention-LSTM model is used to input the data required for prediction, including the number of samples in each batch, the time step of each sample, and the feature dimension of each time step.

[0020] Using historical passenger flow prediction for different categories as the source task, the set of source tasks is as follows:

[0021] ;

[0022] For the source task Its source domain dataset Represented as:

[0023] ;

[0024] in:

[0025] Indicates the source task The number of samples in;

[0026] Indicates the source task The One sample;

[0027] Indicates the source task The first in The label of each sample corresponds to the actual passenger flow value of that sample.

[0028] Furthermore, the LSTM layer of the attention-LSTM model is used to perform sequence modeling on the input data and capture long-term dependencies;

[0029] LSTM layer processing samples Then, output the hidden state sequence for all time steps. ,in, The dimension of the hidden state;

[0030] ,in, Indicates the first The hidden state at each time step;

[0031] Cut Hidden state at the last time step This hidden state, as a global encoding of the entire sequence, contains the sequence's long-term dependencies and global features.

[0032] Furthermore, the attention layer in the attention-LSTM model is used to receive the output of the LSTM layer and weight important information.

[0033] The attention layer will receive As a query vector in the attention mechanism , as a key vector Sum value vector Context vectors are generated through an attention mechanism. :

[0034] ;

[0035] in:

[0036] This represents the dot product of the query vector and the key vector;

[0037] Indicates the scaling factor;

[0038] This represents the attention weight matrix after processing by the softmax function.

[0039] Furthermore, the fully connected layers of the attention-LSTM model are used to integrate attention features and output prediction results;

[0040] Fully connected layer receiving Through the weight matrix and bias vector Perform a linear transformation operation on it, turning it from The 1-dimensional feature space is mapped to a 1-dimensional prediction space;

[0041] For the source task Source Model In the source domain dataset Go to training, The parameters of the source model are for the source task. The Sample The output is:

[0042] .

[0043] Furthermore, the source model for passenger flow prediction is trained based on the attention-LSTM model, including:

[0044] A Bayesian optimization algorithm is introduced, with mean squared error as the optimization objective, to iteratively search for the optimal combination of hyperparameters;

[0045] After selecting the optimal hyperparameters, the model parameters are trained.

[0046] During training, the backpropagation mechanism and Adam optimizer are combined to iteratively update the model parameters, enabling the model to accurately fit the source domain data.

[0047] Finally, through parameter optimization and iteration, the source model with optimal performance is obtained.

[0048] Furthermore, the cosine similarity between the new subway station and the cluster center station is calculated, including:

[0049] The new subway station collection is The task of predicting passenger flow for the new subway station is considered the objective task, and the set of objective tasks is as follows: For each target task, select and match the source model with the best performance;

[0050] For category New subway station and cluster center station The cosine similarity of the number of POIs between them is:

[0051] ;

[0052] in: and They represent the new subway stations. and cluster center station The Number of POIs;

[0053] For the target task Newer subway stations The model with the highest cosine similarity to the number of POIs between each cluster center station is selected as the source model. , represented as:

[0054] .

[0055] Furthermore, using historical passenger flow forecasting of various established subway stations as the source task and passenger flow forecasting of new subway stations as the target task, knowledge transfer is carried out, including:

[0056] target model In Initialize to , represented as , These represent the initialization parameters of the target model;

[0057] Collect target tasks Corresponding target domain dataset , represented as:

[0058] ;

[0059] in:

[0060] Indicate the target task The number of samples;

[0061] Indicate the target task The One sample;

[0062] Indicate the target task The first in The label for each sample is the actual passenger flow value for that sample;

[0063] Target Model In the target domain dataset Go to training, From initialization parameters Starting from there, we make minor adjustments in a more optimal direction, which can be represented as:

[0064] ;

[0065] in:

[0066] The loss function;

[0067] This is a penalty item for domain differences;

[0068] This is the penalty coefficient;

[0069] The difference between the features of the source domain and the target domain is calculated and represented as:

[0070] ;

[0071] in:

[0072] For the source task The number of samples;

[0073] For the source task The source domain dataset;

[0074] It is determined by the parameters of the source model. Nonlinear mapping function for control.

[0075] Furthermore, complete the passenger flow forecast for the new subway station, including:

[0076] Application target model and target domain dataset The passenger flow of the new subway station was predicted, and the final prediction results were obtained. Each element The predicted passenger flow value for a single sample.

[0077] Compared with the prior art, the beneficial effects of the present invention are as follows:

[0078] This invention provides a new subway station traffic prediction method based on transfer learning. By introducing a transfer learning mechanism, it can fully utilize the historical passenger flow characteristics of existing lines or similar stations, transferring effective knowledge from the source domain to the passenger flow prediction task of new subway stations. This alleviates the modeling difficulties caused by insufficient historical data for new subway stations and improves the accuracy and stability of prediction results. Furthermore, addressing the problem of limited sample size and insufficient data accumulation in the early stages of new subway station operation, this invention achieves effective learning of passenger flow patterns at target stations in small-sample scenarios through domain feature alignment and knowledge transfer. This reduces the model's dependence on large amounts of labeled data and enhances the model's adaptability to data-scarce scenarios. Attached Figure Description

[0079] To more clearly illustrate the technical solutions in the embodiments of the present invention 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 the present invention. For those skilled in the art, other embodiments can be obtained from these drawings without creative effort.

[0080] Figure 1 This is a flowchart of a new subway station traffic prediction method based on transfer learning provided in an embodiment of the present invention.

[0081] Figure 2This is a comparison chart of the passenger flow prediction results for the newly built station in the present invention and the comparative scheme. Among them, (1) is a comparison of prediction results with low data volume (10%), (2) is a comparison of prediction results with medium data volume (30%), and (3) is a comparison of prediction results with ample data volume (60%). Detailed Implementation

[0082] The present invention will now be described in further detail with reference to specific embodiments and accompanying drawings. Similar elements in different embodiments are referred to by associated similar element reference numerals. In the following embodiments, many details are described to facilitate a better understanding of this application. However, those skilled in the art will readily recognize that some features may be omitted in different situations, or may be replaced by other elements, materials, or methods. In some cases, certain operations related to this application are not shown or described in the specification. This is to avoid obscuring the core parts of this application with excessive description. For those skilled in the art, detailed description of these related operations is not necessary; they can fully understand the related operations based on the description in the specification and general technical knowledge in the art.

[0083] Furthermore, the features, operations, or characteristics described in the specification can be combined in any suitable manner to form various embodiments. At the same time, the steps or actions in the method description can be rearranged or adjusted in a manner obvious to those skilled in the art. Therefore, the various orders in the specification and drawings are only for the clear description of a particular embodiment and do not imply a necessary order, unless otherwise stated that a particular order must be followed.

[0084] This invention provides a new subway station traffic prediction method based on transfer learning, which can be applied to short-term passenger flow prediction and traffic analysis tasks in scenarios such as urban rail transit passenger flow monitoring, subway network operation scheduling, passenger flow early warning, public transportation planning and smart subway. It is used to solve the technical problems in the existing technology, such as low prediction accuracy and insufficient generalization ability due to the scarcity of data in the early stage of operation of new subway stations and the difficulty of cross-station traffic feature transfer. It realizes accurate and efficient prediction of traffic at new subway stations and provides reliable data support for subway operation scheduling.

[0085] Specifically, such as Figure 1 The method includes the following steps:

[0086] S1: Establish a sequence containing passenger flow data of new subway stations and a sequence containing passenger flow data of mature subway stations, and cluster the mature subway stations to obtain a set of cluster center stations.

[0087] First, multi-source passenger flow data was collected and preprocessed. Short-term passenger flow data from new subway stations, historical passenger flow data from established subway stations, and data on related factors influencing passenger flow (such as weather, holidays, time of day, and surrounding POI data) were collected and preprocessed to obtain data containing… A sequence of new subway station passenger flow data and A sequence of passenger flow data from a mature subway station.

[0088] Then, the mature subway stations are clustered to obtain a set of cluster center stations, specifically including:

[0089] S101: To achieve efficient site clustering, this invention first determines the optimal number of clusters for mature subway stations based on the K-means clustering algorithm;

[0090] With the optimal number of clusters as the prior objective, mature subway stations are divided into different categories using the AP clustering algorithm to showcase the unique passenger flow patterns of each type of station.

[0091] S102: Order If a set represents different categories, then Indicate different categories The cluster center of the station set.

[0092] S2: Construct an attention-LSTM model that includes an input layer, an LSTM layer, an attention layer, and a fully connected layer. Train the passenger flow prediction source model based on the attention-LSTM model. Through parameter optimization and iteration, obtain the source model with the best performance in different categories.

[0093] This invention integrates the gating mechanism of LSTM with the adaptive weighting capability of the attention mechanism to construct a model with attention-LSTM as its core, achieving high-quality prediction of subway passenger flow. The architecture comprises the following components:

[0094] (1) Input layer:

[0095] The input layer of the attention-LSTM model is used to input the data required for prediction, specifically including three dimensions: (1) batch_size: the number of samples in each batch; (2) seq_length: the time step L of each sample; (3) input_size: the feature dimension of each time step. To eliminate the influence of units, the source domain dataset is normalized using the Min-Max normalization method before the data is input into the model.

[0096] Using historical passenger flow prediction for different categories as the source task, the set of source tasks is as follows:

[0097] ;

[0098] For the source task Its source domain dataset Represented as:

[0099] ;

[0100] in:

[0101] Indicates the source task The number of samples in;

[0102] Indicates the source task The The samples, together with all the samples, constitute the overall input feature matrix of the source model. ;

[0103] Indicates the source task The first in The label of each sample corresponds to the actual passenger flow value of that sample.

[0104] (2) LSTM layer:

[0105] The LSTM layer in the attention-LSTM model is used to model the sequence of the input data and capture long-term dependencies. For passenger flow prediction tasks, the main parameters of interest in the LSTM layer include those controlling the number of LSTM units in each layer. And the method used to control the number of LSTM layers stacked. .

[0106] LSTM layer processing samples Then, output the hidden state sequence for all time steps. ,in, The dimension of the hidden state;

[0107] ,in, Indicates the first The hidden state at each time step;

[0108] Cut Hidden state at the last time step This hidden state, as a global encoding of the entire sequence, contains the sequence's long-term dependencies and global features.

[0109] To prevent overfitting, a dropout layer is added after the output of the LSTM layer, thereby improving generalization ability.

[0110] (3) Attention layer:

[0111] The attention layer in the attention-LSTM model receives the output of the LSTM layer and weights important information.

[0112] The attention layer will receive As a query vector in the attention mechanism , as a key vector Sum value vector Context vectors are generated through an attention mechanism. :

[0113] ;

[0114] in:

[0115] This represents the dot product of the query vector and the key vector;

[0116] Indicates the scaling factor;

[0117] Indicates the process Attention weight matrix for function processing.

[0118] (4) Fully connected layer:

[0119] The fully connected layers of the attention-LSTM model are used to integrate attention features and output prediction results.

[0120] Fully connected layer receiving Through the weight matrix and bias vector Perform a linear transformation operation on it, turning it from The 1-dimensional feature space is mapped to a 1-dimensional prediction space;

[0121] For the source task Source Model In the source domain dataset Go to training, The parameters of the source model are for the source task. The Sample The output (i.e., the model's predicted value) is:

[0122] .

[0123] The attention-LSTM model with the above four-layer architecture is used to train the passenger flow prediction source model, including:

[0124] S201: During the training phase, model performance depends on hyperparameter configuration. Considering the high dimensionality of the hyperparameter space, this invention first introduces a Bayesian optimization algorithm, using mean squared error as the optimization objective, to iteratively search for the optimal combination of hyperparameters.

[0125] S202: After selecting the optimal hyperparameters, train the model parameters.

[0126] This invention uses mean squared error as the loss function, and the formula for minimizing the loss function can be expressed as:

[0127] ;

[0128] in: This is the loss function.

[0129] S203: During training, the model parameters are iteratively updated by combining the backpropagation mechanism and the Adam optimizer. This enables the model to accurately fit the source domain data;

[0130] S204: Finally, through parameter optimization and iteration, the source model with optimal performance is obtained. .

[0131] Finally, after step S2, this invention uses the attention-LSTM model to train on passenger flow source domain datasets for various stations, and finally obtains... Attention-LSTM model for similar sites This is to provide a suitable source model for newly established sites.

[0132] S3: Calculate the cosine similarity between the new subway station and the cluster center station, and select the optimal source model corresponding to the cluster center station with the highest similarity as the adapted source model for the new subway station. This includes:

[0133] S301: The collection of new subway stations is The task of predicting passenger flow for the new subway station is considered the objective task, and the set of objective tasks is as follows: For each target task, select and match the source model with the best performance;

[0134] For category New subway station and cluster center station The cosine similarity of the number of POIs between them is:

[0135] ;

[0136] in:

[0137] and They represent the new subway stations. and cluster center station The Number of POIs;

[0138] S302: Regarding the target task Newer subway stations The model with the highest cosine similarity to the number of POIs between each cluster center station is selected as the source model. , represented as:

[0139] .

[0140] S4: Using historical passenger flow predictions for various established subway stations as the source task and passenger flow predictions for new subway stations as the target task, knowledge transfer is achieved through parameter sharing and domain adaptation to complete passenger flow predictions for the new subway stations. This includes:

[0141] S401: Source model loading, completing model loading based on source model weights.

[0142] Based on the selection of the source model, it is assumed that a new site will be established. The corresponding optimal source model is Using this source model as a starting point and loading its architecture and parameters, we obtain the target model. In Initialize to , represented as , This represents the initialization parameters of the target model.

[0143] S402: Dataset preparation, collecting the target domain dataset for transfer learning.

[0144] Collect target tasks Corresponding target domain dataset , represented as:

[0145] ;

[0146] in:

[0147] Indicate the target task The number of samples;

[0148] Indicate the target task The One sample;

[0149] Indicate the target task The first in The label for each sample is the actual passenger flow value for that sample.

[0150] Next, fine-tune the parameters and update the model parameters. Remove the parameter fixing mechanism, allowing the input layer and fully connected layers to dynamically adjust according to the new task. Through fine-tuning the overall weights, the pre-trained model is made thoroughly adapted to the passenger flow patterns of the target domain.

[0151] S403: Model Modification:

[0152] Target Model In the target domain dataset During training, the model will be trained from scratch. From initialization parameters Starting from there, we make minor adjustments in a more optimal direction, which can be represented as:

[0153] ;

[0154] in:

[0155] This is the loss function.

[0156] To reduce the difference in feature distribution between the source and target domains and ensure that knowledge from the source domain is not forgotten while adapting to the target domain, we set... For domain difference penalty items, This is the penalty coefficient. Measured by the maximum mean discrepancy (MMD).

[0157] S404: The difference between the features of the source and target domains is calculated using MMD and expressed as:

[0158] ;

[0159] in:

[0160] For the source task The number of samples;

[0161] For the source task The source domain dataset;

[0162] It is determined by the parameters of the source model. The nonlinear mapping function of the control maps the data to the regenerated Hilbert space to extract complex features, quantifies the differences in domain distribution, and provides a basis for domain adaptation.

[0163] Considering the scarcity of historical data for new sites, resulting in limited training samples, the model is prone to overfitting. To improve the model's generalization ability with small sample sizes, similar to the training of the source model, this invention employs a Bayesian optimization algorithm to search for the optimal hyperparameter combination before training. The obtained optimal hyperparameter combination is then used to train the target model, and backpropagation is used to calculate gradients and the Adam optimizer is used to update parameters, ultimately yielding the results for the newly established site. Passenger flow prediction model .

[0164] S405: Output Results

[0165] Application target model and target domain dataset The passenger flow of the new subway station was predicted, and the final prediction results were obtained. Each element The predicted passenger flow value for a single sample.

[0166] The technical effects of the present invention will be further explained below in conjunction with experimental results:

[0167] (1) Experimental conditions and contents:

[0168] This embodiment uses the PyTorch framework as the foundation for deep learning implementation, completing model building, forward propagation, loss calculation, and parameter optimization.

[0169] The experiment compared the performance of the passenger flow prediction results for newly built stations using the present invention, and the results are as follows: Figure 2 As shown.

[0170] (2) Analysis of experimental results:

[0171] Figure 2The predicted passenger flow curves of the proposed solution and the fitted curves of the directly trained attention-LSTM model (the comparison solution) were compared with the actual passenger flow values. As can be seen from the figures, the proposed solution outperforms the comparison solution under different data scales. In low-data-volume (10%) scenarios, the directly trained attention-LSTM model, lacking prior features, exhibits significant lag and severe residuals in capturing fluctuating nodes such as morning and evening peak hours. In contrast, the proposed solution, guided by source domain knowledge, can initially outline the daily trend of passenger flow changes. As the data increases to a medium scale (30%), the comparison solution shows improvement but still suffers from insufficient prediction at extreme peaks. In contrast, the proposed solution significantly improves the overlap between the predicted curve and the actual value, not only smoothly fitting regular time periods but also responding more sensitively to sudden small peaks. When data is abundant (60%), although both solutions tend to converge, the proposed solution demonstrates superior fitting precision and temporal follow-up, fully validating the continuous gain effect of transfer learning in cross-domain knowledge adaptation.

[0172] Therefore, this invention can make full use of the historical passenger flow characteristics of existing lines or similar stations, and transfer effective knowledge from the source domain to the passenger flow prediction task of new subway stations, thereby alleviating the modeling difficulties caused by insufficient historical data of new subway stations and improving the accuracy and stability of prediction results.

[0173] Those skilled in the art will understand that all or part of the functions of the embodiments of the present invention can be implemented by hardware or by computer programs. When all or part of the functions in the above embodiments are implemented by computer programs, the program can be stored in a computer-readable storage medium, which may include: read-only memory, random access memory, disk, optical disk, hard disk, etc., and the program is executed by a computer to achieve the above functions. For example, the program can be stored in the memory of a device, and when the program in the memory is executed by the processor, all or part of the above functions can be achieved. In addition, when all or part of the functions in the above embodiments are implemented by computer programs, the program can also be stored in a storage medium such as a server, another computer, disk, optical disk, flash drive, or portable hard drive, and can be downloaded or copied to the memory of a local device, or the system of the local device can be updated. When the program in the memory is executed by the processor, all or part of the functions in the above embodiments can be achieved.

[0174] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., refer to specific features, structures, materials, or characteristics described in connection with that embodiment or example, which are included in at least one embodiment or example of the embodiments of this application. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of different embodiments or examples.

[0175] The above examples illustrate the present invention only to aid in understanding it and are not intended to limit the scope of the invention. Those skilled in the art can make various simple deductions, modifications, or substitutions based on the principles of this invention.

Claims

1. A novel subway station traffic prediction method based on transfer learning, characterized by: The method includes: Establish sequences containing passenger flow data from new subway stations and sequences containing passenger flow data from mature subway stations, and cluster the mature subway stations to obtain a set of cluster center stations; We constructed an attention-LSTM model consisting of an input layer, an LSTM layer, an attention layer, and a fully connected layer. Based on the attention-LSTM model, we trained the source model for passenger flow prediction to obtain the source model with the best performance in different categories. Calculate the cosine similarity between the new subway station and the cluster center station respectively, and select the optimal source model corresponding to the cluster center station with the highest similarity as the adaptation source model for the new subway station. Using historical passenger flow forecasts of various established subway stations as the source task and passenger flow forecasts of new subway stations as the target task, knowledge transfer was carried out to complete the passenger flow forecasts for new subway stations.

2. The new subway station traffic prediction method based on transfer learning according to claim 1, characterized in that: Clustering mature subway stations yields a set of cluster center stations, including: The optimal number of clusters for mature subway stations was determined using the K-means clustering algorithm. With the optimal number of clusters as the prior objective, mature subway stations are divided into different categories using the AP clustering algorithm; make If a set represents different categories, then Indicate different categories The cluster center of the station set.

3. The new subway station traffic prediction method based on transfer learning according to claim 2, characterized in that: The input layer of the attention-LSTM model is used to input the data required for prediction, including the number of samples in each batch, the time step of each sample, and the feature dimension of each time step. Using historical passenger flow prediction for different categories as the source task, the set of source tasks is as follows: ; For the source task Its source domain dataset Represented as: ; in: Indicates the source task The number of samples in; Indicates the source task The One sample; Indicates the source task The first in The label of each sample corresponds to the actual passenger flow value of that sample.

4. The new subway station traffic prediction method based on transfer learning according to claim 3, characterized in that: The LSTM layer of the attention-LSTM model is used to model the sequence of the input data and capture long-term dependencies; LSTM layer processing samples Then, output the hidden state sequence for all time steps. ,in, The dimension of the hidden state; ,in, Indicates the first The hidden state at each time step; Cut Hidden state at the last time step The hidden state, as a global encoding of the entire sequence, contains the sequence's long-term dependencies and global features.

5. The new subway station traffic prediction method based on transfer learning according to claim 4, characterized in that: The attention layer in the attention-LSTM model is used to receive the output of the LSTM layer and weight important information. The attention layer will receive As a query vector in the attention mechanism , as a key vector Sum value vector Context vectors are generated through an attention mechanism. : ; in: This represents the dot product of the query vector and the key vector; Indicates the scaling factor; Indicates the process Attention weight matrix for function processing.

6. The new subway station traffic prediction method based on transfer learning according to claim 5, characterized in that: The fully connected layers of the attention-LSTM model are used to integrate attention features and output prediction results; Fully connected layer receiving Through the weight matrix and bias vector Perform a linear transformation operation on it, turning it from The 1-dimensional feature space is mapped to a 1-dimensional prediction space; For the source task Source Model In the source domain dataset Go to training, The parameters of the source model are for the source task. The Sample The output is: 。 7. The new subway station traffic prediction method based on transfer learning according to claim 6, characterized in that: The source model for passenger flow prediction is trained based on the attention-LSTM model, including: A Bayesian optimization algorithm is introduced, with mean squared error as the optimization objective, to iteratively search for the optimal combination of hyperparameters; After selecting the optimal hyperparameters, the model parameters are trained. During training, the backpropagation mechanism and Adam optimizer are combined to iteratively update the model parameters, enabling the model to accurately fit the source domain data. Finally, through parameter optimization and iteration, the source model with optimal performance is obtained.

8. The new subway station traffic prediction method based on transfer learning according to claim 7, characterized in that: Calculate the cosine similarity between the new subway station and the cluster center station, including: The new subway station collection is The task of predicting passenger flow for the new subway station is considered the objective task, and the set of objective tasks is as follows: For each target task, select and match the source model with the best performance; For category New subway station and cluster center station The cosine similarity of the number of POIs between them is: ; in: and They represent the new subway stations. and cluster center station The Number of POIs; For the target task Newer subway stations The model with the highest cosine similarity to the number of POIs between each cluster center station is selected as the source model. , represented as: 。 9. The new subway station traffic prediction method based on transfer learning according to claim 8, characterized in that: Using historical passenger flow forecasting data from various established subway stations as the source task and passenger flow forecasting data from new subway stations as the target task, knowledge transfer is performed, including: target model In Initialize to , represented as , These represent the initialization parameters of the target model; Collect target tasks Corresponding target domain dataset , represented as: ; in: Indicate the target task The number of samples; Indicate the target task The One sample; Indicate the target task The first in The label for each sample is the actual passenger flow value for that sample; Target Model In the target domain dataset Go to training, From initialization parameters Starting from there, we make minor adjustments in a more optimal direction, which can be represented as: ; in: The loss function; This is a penalty item for domain differences; This is the penalty coefficient; The difference between the features of the source domain and the target domain is calculated and represented as: ; in: For the source task The number of samples; For the source task The source domain dataset; It is determined by the parameters of the source model. Nonlinear mapping function for control.

10. The new subway station traffic prediction method based on transfer learning according to claim 9, characterized in that: Complete passenger flow forecasting for the new subway station, including: Application target model and target domain dataset The passenger flow of the new subway station was predicted, and the final prediction results were obtained. Each element The predicted passenger flow value for a single sample.

Citation Information

Patent Citations

  • A Meta-Learning-Based Method for Predicting Short-Term Passenger Flow in Newly Opened Subway Stations

    CN115146843B