Multivariable passenger flow long-time prediction method, system and device and storage medium

By using isolated forest algorithm and double-sampled Transformer model in multivariate passenger flow long-term prediction, the problem of difficulty in extracting global, local information and variable correlation in the prior art is solved, and the accuracy of passenger flow prediction and the ability to capture long-term trends are improved.

CN119849688APending Publication Date: 2025-04-18SHANGHAI ELECTRIC SMART CITY INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411918730.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-25
Publication Date
2025-04-18

Smart Images

  • Figure CN119849688A_ABST
    Figure CN119849688A_ABST
Patent Text Reader

Abstract

The invention discloses a multivariable passenger flow long-time prediction method, system and device and a storage medium, and relates to the technical field of multivariable time sequence prediction. The method comprises the following steps: acquiring a data set of a target area in a set time period; the data set comprises passenger flow data and corresponding multivariable data; the multivariable data comprises date, air temperature, illumination and precipitation; cleaning the data set by using an isolated forest algorithm to obtain a preprocessed data set; training a pre-training network constructed on the basis of a double-sampling Transform by using the pre-processed data set, determining model parameters and weights of the trained network, and obtaining a multivariable passenger flow long-time prediction model; and inputting multivariable data to be predicted into the multivariable passenger flow long-time prediction model for prediction to obtain a passenger flow prediction result. According to the method, the global information, the local information and the correlation information among the variables of the data can be extracted simultaneously, and the prediction accuracy of the passenger flow data is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of multivariate time series prediction, and in particular to a multivariate passenger flow long-term prediction method, system, device and storage medium. Background Art

[0002] With the acceleration of urbanization and the increase in population mobility, passenger flow prediction has become an important technical requirement in modern society. Passenger flow prediction in crowded areas such as public places, transportation hubs, and commercial areas plays an extremely important role in urban planning, traffic management, and commercial operations. Accurate passenger flow prediction can help governments and enterprises make more reasonable decisions in resource allocation, service optimization, and cost control. For example, in the public transportation system, accurate passenger flow prediction can effectively adjust vehicle operation plans, optimize line layout, improve transportation efficiency, and reduce passenger waiting time, thereby improving the overall public transportation service level. In the commercial field, passenger flow prediction provides merchants with valuable market dynamic information, enabling them to formulate more scientific marketing strategies based on passenger flow trends, reasonably arrange commodity inventory and employee scheduling, and thus improve business profits and customer satisfaction. In addition, passenger flow prediction also plays an irreplaceable role in tourism, security monitoring, and large-scale event organization. Therefore, researching and developing efficient passenger flow prediction methods has important practical significance and application value.

[0003] In the existing passenger flow forecasting technology, although the deep learning-based methods, especially the Transformer model, have made some progress in the long-term prediction of multivariate passenger flow, there are still some technical bottlenecks. When processing multivariate time series data, the traditional Transformer model can only extract global dependencies, while ignoring the local features in the data and the fine-grained correlations between variables. The extraction of this global information is helpful for capturing long-term trends, but in multivariate passenger flow forecasting, the local information of the data and the interaction between variables are also crucial. Summary of the invention

[0004] The purpose of the present invention is to provide a multivariate passenger flow long-term prediction method, system, device and storage medium, which can simultaneously extract global information, local information and correlation information between variables of the data, and improve the prediction accuracy of passenger flow data.

[0005] To achieve the above object, the present invention provides the following solutions:

[0006] A multivariate long-term passenger flow prediction method, comprising:

[0007] Acquire a data set of a target area within a set time period; the data set includes passenger flow data and corresponding multivariate data; the multivariate data includes date, temperature, sunlight and precipitation;

[0008] Using an isolation forest algorithm to clean the data set to obtain a preprocessed data set;

[0009] Using the preprocessed data set to train a pretrained network built based on a double-sampling Transformer, determining the trained network model parameters and weights, and obtaining a multivariate passenger flow long-term prediction model;

[0010] The multivariate data to be predicted is input into the multivariate passenger flow long-term prediction model for prediction to obtain a passenger flow prediction result.

[0011] Optionally, before cleaning the data set, the method further includes: aligning the passenger flow data and the multivariate data according to timestamps.

[0012] Optionally, the using of the isolation forest algorithm to clean the data set to obtain a preprocessed data set specifically includes:

[0013] Randomly selecting features and split points for each variable in the data set, dividing each subset, and constructing multiple isolation trees until each data is individually isolated to obtain multiple data points;

[0014] The abnormality score of each data point is calculated using the path length of the tree to obtain the abnormality score of the data point; the path length of the tree is the number of splits that the data point goes through from the root node to the leaf node;

[0015] Judging according to a set threshold and the abnormal score of each data point, marking the data point corresponding to the abnormal score exceeding the set threshold as an abnormal point;

[0016] The marked outliers are removed, and linear interpolation is used to fill the data at the removed positions to obtain the preprocessed data set.

[0017] Optionally, the training process of the multivariate long-term passenger flow prediction model includes:

[0018] Build the corresponding pre-trained network based on the double sampling Transformer;

[0019] The preprocessed data set is input into the pretrained network, and training is performed according to the set output step size and optimization target, and the trained network is determined as a multivariate long-term passenger flow prediction model; the optimization target is to minimize the loss between the network output and the corresponding passenger flow data.

[0020] Optionally, the step of inputting the multivariate data to be predicted into the multivariate passenger flow long-term prediction model for prediction to obtain the passenger flow prediction result specifically includes:

[0021] The multivariate data to be predicted is represented by a two-dimensional time series, wherein the two dimensions are the number of variables and the length of the series;

[0022] The time series is converted into two three-dimensional feature vectors through a downsampling block and a segmented sampling block respectively; the two three-dimensional feature vectors are used to focus on global information and local information respectively;

[0023] The two three-dimensional feature vectors are respectively input into the time variable attention block to extract the dependency relationship of the time dimension and the correlation between different variables;

[0024] The result output from the time variable attention block is integrated by a parallel structure operation, so that the global and local information are fused with the correlation of the variable to obtain a fused feature;

[0025] The fused features are input into a multi-layer perceptron decoder to generate a final passenger flow prediction result with a time series.

[0026] The present invention provides a multivariate passenger flow long-term prediction system, comprising:

[0027] A data collection unit, used to obtain a data set of a target area within a set time period; the data set includes passenger flow data and corresponding multivariate data; the multivariate data includes date, temperature, sunlight and precipitation;

[0028] A data cleaning unit, used to clean the data set using an isolation forest algorithm to obtain a preprocessed data set;

[0029] A model training unit, used to train a pre-trained network constructed based on a double-sampling Transformer using the pre-processed data set, determine the trained network model parameters and weights, and obtain a multivariate passenger flow long-term prediction model;

[0030] The passenger flow prediction unit is used to input the multivariate data to be predicted into the multivariate passenger flow long-term prediction model for prediction to obtain the passenger flow prediction result.

[0031] The present invention provides an electronic device, including a memory and a processor, wherein the memory is used to store a computer program, and the processor runs the computer program to enable the electronic device to execute the multivariate long-term passenger flow prediction method mentioned above.

[0032] The present invention provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the multivariate long-term passenger flow prediction method as described above.

[0033] According to the specific embodiments provided by the present invention, the present invention discloses the following technical effects:

[0034] The present invention discloses a multivariate passenger flow long-term prediction method, system, device and storage medium, the method comprising obtaining a data set of a target area within a set time period; the data set comprises passenger flow data and corresponding multivariate data; the multivariate data comprises date, temperature, light and precipitation; the data set is cleaned by using an isolation forest algorithm to obtain a pre-processed data set; the pre-processed data set is used to train a pre-trained network constructed based on a double sampling Transformer, the trained network model parameters and weights are determined, and a multivariate passenger flow long-term prediction model is obtained; the multivariate data to be predicted is input into the multivariate passenger flow long-term prediction model for prediction, and a passenger flow prediction result is obtained. The present invention can simultaneously extract global information, local information and correlation information between variables of the data, and improve the prediction accuracy of passenger flow data. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0036] Figure 1 It is a flow chart of the multivariate long-term passenger flow prediction method of the present invention. DETAILED DESCRIPTION

[0037] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0038] The purpose of the present invention is to provide a multivariate passenger flow long-term prediction method, system, device and storage medium, which can simultaneously extract global information, local information and correlation information between variables of the data, and improve the prediction accuracy of passenger flow data.

[0039] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.

[0040] like Figure 1 As shown, the present invention provides a multivariate passenger flow long-term prediction method, comprising:

[0041] S1: Obtain a data set of a target area within a set time period; the data set includes passenger flow data and corresponding multivariate data; the multivariate data includes date, temperature, sunlight and precipitation.

[0042] S2: Using the isolation forest algorithm to clean the data set to obtain a preprocessed data set.

[0043] S3: Use the preprocessed data set to train the pre-trained network built based on the double-sampling Transformer, determine the parameters and weights of the trained network model, and obtain a multivariate long-term passenger flow prediction model.

[0044] S4: Input the multivariate data to be predicted into the multivariate passenger flow long-term prediction model for prediction to obtain a passenger flow prediction result.

[0045] Based on the above technical solution, the following embodiments are provided.

[0046] This embodiment provides a multivariate long-term passenger flow prediction method based on a double-sampling Transformer, including the following steps:

[0047] (1) Collect passenger flow data in a certain area over a period of time, and collect data such as the date, temperature, light, and precipitation at the corresponding location. Align all data by timestamp to form a multivariate passenger flow dataset for subsequent input into the model.

[0048] (2) Use the Isolation Forest Algorithm to identify outliers in the data set and clean the data set, which specifically includes the following steps:

[0049] 21) Randomly select features and split points from the established data set according to each variable;

[0050] 22) Repeat step 21) to divide each subset and build multiple isolation trees until each data set is isolated;

[0051] 23) For each data point, calculate its anomaly score by the path length of each tree (i.e., the number of splits that the data point goes through from the root node to the leaf node);

[0052] 24) Set a threshold, and the points exceeding the threshold are marked as abnormal points;

[0053] 25) Remove the marked outliers and use linear interpolation to fill in the outliers.

[0054] (3) The cleaned data set is divided into a training set and a test set, and input into the double sampling Transformer for training. The corresponding output step size is set, and the parameters and weights of the corresponding model are obtained and saved. Specifically, the following steps are included:

[0055] 31) The divided multivariate passenger flow data is represented by a two-dimensional time series, where the two dimensions are the number of variables and the length of the series;

[0056] 32) The time series is converted into two three-dimensional feature vectors through a downsampling block and a segmented sampling block, respectively focusing on global information and local information;

[0057] 33) Input the two three-dimensional feature vectors into the time variable attention block to extract the dependency of the time dimension and the correlation between different variables respectively;

[0058] 34) The outputs from the time variable attention block are integrated through a parallel structure to fuse global and local information with variable correlations;

[0059] 35) The integrated features are input into the multi-layer perceptron decoder to generate the final time series prediction results.

[0060] Compared with the prior art, the present invention has the following advantages:

[0061] 1. Based on the passenger flow data, date, temperature, sunlight, precipitation and other data are introduced to assist in predicting passenger flow through other variables, thus improving the accuracy of prediction;

[0062] 2. Use downsampling and segmented sampling to process multivariate time series, effectively capturing the global and local information in the time series, which is conducive to long-term prediction;

[0063] 3. A time variable attention block is proposed through the attention mechanism in Transformer, which integrates the time dependency of multivariate time series and the correlation between passenger flow and other variables, which is conducive to making full use of other variables in the prediction process.

[0064] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.

[0065] This article uses specific examples to illustrate the principles and implementation methods of the present invention. The above examples are only used to help understand the core idea of ​​the present invention. At the same time, for those skilled in the art, according to the idea of ​​the present invention, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as limiting the present invention.

Claims

1. A multivariate long-term passenger flow prediction method, characterized in that: include: Obtain the data set of the target area within the set time period; The data set includes passenger flow data and corresponding multivariate data; the multivariate data includes date, temperature, sunlight and precipitation; Using an isolation forest algorithm to clean the data set to obtain a preprocessed data set; Using the preprocessed data set to train a pretrained network built based on a double-sampling Transformer, determining the trained network model parameters and weights, and obtaining a multivariate passenger flow long-term prediction model; The multivariate data to be predicted is input into the multivariate passenger flow long-term prediction model for prediction to obtain a passenger flow prediction result.

2. The multivariate long-term passenger flow prediction method according to claim 1, characterized in that: Before cleaning the data set, the method further includes: aligning the passenger flow data and the multivariate data according to the timestamp.

3. The multivariate long-term passenger flow prediction method according to claim 1, characterized in that: The data set is cleaned by using the isolation forest algorithm to obtain a preprocessed data set, specifically including: Randomly selecting features and split points for each variable in the data set, dividing each subset, and constructing multiple isolation trees until each data is individually isolated to obtain multiple data points; The abnormality score of each data point is calculated using the path length of the tree to obtain the abnormality score of the data point; the path length of the tree is the number of splits that the data point goes through from the root node to the leaf node; Judging according to a set threshold and the abnormal score of each data point, marking the data point corresponding to the abnormal score exceeding the set threshold as an abnormal point; The marked outliers are removed, and linear interpolation is used to fill the data at the removed positions to obtain the preprocessed data set.

4. The multivariate long-term passenger flow prediction method according to claim 1, characterized in that: The training process of the multivariate passenger flow long-term prediction model includes: Build the corresponding pre-trained network based on the double sampling Transformer; The preprocessed data set is input into the pretrained network, and training is performed according to the set output step size and optimization target, and the trained network is determined as a multivariate long-term passenger flow prediction model; the optimization target is to minimize the loss between the network output and the corresponding passenger flow data.

5. The multivariate long-term passenger flow prediction method according to claim 1, characterized in that: The step of inputting the multivariate data to be predicted into the multivariate passenger flow long-term prediction model for prediction to obtain the passenger flow prediction result specifically includes: The multivariate data to be predicted is represented by a two-dimensional time series, wherein the two dimensions are the number of variables and the length of the series; The time series is converted into two three-dimensional feature vectors through a downsampling block and a segmented sampling block respectively; the two three-dimensional feature vectors are used to focus on global information and local information respectively; The two three-dimensional feature vectors are respectively input into the time variable attention block to extract the dependency relationship of the time dimension and the correlation between different variables; The result output from the time variable attention block is integrated by a parallel structure operation, so that the global and local information are fused with the correlation of the variable to obtain a fused feature; The fused features are input into a multi-layer perceptron decoder to generate a final passenger flow prediction result with a time series.

6. A multivariate passenger flow long-term prediction system, characterized in that: include: A data collection unit, used to obtain a data set of a target area within a set time period; The data set includes passenger flow data and corresponding multivariate data; the multivariate data includes date, temperature, sunlight and precipitation; A data cleaning unit, used to clean the data set using an isolation forest algorithm to obtain a preprocessed data set; A model training unit, used to train a pre-trained network constructed based on a double-sampling Transformer using the pre-processed data set, determine the trained network model parameters and weights, and obtain a multivariate passenger flow long-term prediction model; The passenger flow prediction unit is used to input the multivariate data to be predicted into the multivariate passenger flow long-term prediction model for prediction to obtain the passenger flow prediction result.

7. An electronic device, characterized in that: It includes a memory and a processor, the memory is used to store a computer program, and the processor runs the computer program to enable the electronic device to execute the multivariate long-term passenger flow prediction method according to any one of claims 1-5.

8. A computer-readable storage medium, characterized in that: It stores a computer program, which, when executed by a processor, implements the multivariate long-term passenger flow prediction method as described in any one of claims 1-5.