Dynamic prediction method for passenger flow volume
By constructing a multi-factor weight analysis system and a real-time feedback mechanism, the problems of low accuracy in passenger flow prediction and low efficiency in cross-scenario model transfer in existing technologies have been solved, achieving high-precision and high-efficiency passenger flow prediction, which is suitable for operation and management in scenarios such as business districts, transportation hubs, and scenic spots.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- 江苏中车机电科技有限公司
- Filing Date
- 2025-12-26
- Publication Date
- 2026-05-19
AI Technical Summary
Existing passenger flow prediction technologies struggle to accurately capture personalized passenger flow characteristics across different scenarios. In particular, they suffer from low prediction accuracy under short-term passenger flow mutations and the influence of multiple factors, and their cross-scenario model transfer efficiency is low and maintenance costs are high.
By acquiring core data sources, performing standardized and preprocessing, extracting high-quality feature sets, constructing a multi-factor weight analysis system, generating a dynamic weight matrix, training the model in conjunction with changes in passenger flow, introducing a real-time feedback mechanism to optimize model parameters, and building a weight template library to achieve cross-scenario adaptation.
It improves the accuracy of passenger flow prediction in multiple scenarios, achieves efficient cross-scenario model adaptation, reduces deployment and maintenance costs, enhances the dynamic adjustment capability of the prediction model, and ensures the continuous effectiveness of prediction results.
Smart Images

Figure CN122065062A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of information processing technology, and specifically to a method for dynamic prediction of passenger flow. Background Technology
[0002] With the increasing demand for refined operation and management in urban commercial districts, transportation hubs, scenic spots, and residential areas, passenger flow forecasting has become a core support for ensuring efficient operation and optimizing resource allocation. Passenger flow characteristics vary significantly across different scenarios. For example, commercial districts are heavily influenced by commercial activities, transportation hubs rely on traffic scheduling, scenic spots are constrained by seasonality and visitor restrictions, and residential areas exhibit clear commuting peak patterns. Existing forecasting technologies struggle to accurately capture the personalized passenger flow characteristics of different scenarios. They exhibit significant forecasting biases when faced with sudden changes in short-term passenger flow or the interaction of multiple factors, failing to meet the high requirements of various scenarios for forecasting accuracy, real-time performance, and cross-scenario adaptability.
[0003] Current mainstream technologies in passenger flow prediction are mostly based on single time-series models (such as SARIMA) or simple data fusion models. The core idea is to mine time-series patterns from historical passenger flow data to complete predictions. Existing technologies generally use fixed model parameters to adapt to different scenarios, and their fusion depth for multi-source heterogeneous data (such as traffic schedules, weather, and commercial activity data) is insufficient. They rely heavily on manual experience to adjust model parameters and lack dynamic adaptive mechanisms. At the same time, cross-scenario prediction often involves retraining the model, failing to form a reusable scenario adaptation system, resulting in low model deployment efficiency and high maintenance costs.
[0004] The existing technology suffers from two main problems. First, it struggles to deeply integrate multi-dimensional heterogeneous data, failing to capture sufficient personalized passenger flow influencing factors (such as commercial activities, transportation schedules, and seasonal flow restrictions) across different scenarios. This results in low passenger flow prediction accuracy across multiple scenarios, particularly significant errors in scenarios with short-term passenger flow fluctuations and multi-factor interactions. Second, existing cross-scenario passenger flow prediction technologies lack efficient adaptation mechanisms. Model migration to new scenarios requires retraining and relies heavily on manual parameter adjustments, leading to low deployment efficiency, high maintenance costs, and an inability to quickly respond to prediction needs across different scenarios. Summary of the Invention
[0005] The present invention aims to provide a method for dynamic prediction of passenger flow, which can effectively improve the accuracy of passenger flow prediction in multiple scenarios.
[0006] To solve the above-mentioned technical problems, the present invention provides the following technical solution: The present invention provides a method for dynamic prediction of passenger flow, comprising the following steps: S1: Obtain the core data source and unify the time series and format to obtain a standardized dataset; S2: Preprocess the standardized dataset, simultaneously extract cross-regional passenger flow correlation features and time-dimensional passenger flow change features, and remove redundant features to obtain a high-quality feature set; S3: Based on time attributes, traffic control information, meteorological conditions, and image passenger flow characteristics, a multi-factor weight analysis system is constructed, a weight calculation model is designed to complete the differentiated weighting of historical data, and a dynamic weight matrix is generated; S4: Use the dynamic weight matrix and high-quality feature set as input, combine them with passenger flow change values to train the passenger flow prediction model, and output the passenger flow prediction results. S5: Correct the passenger flow forecast results, introduce real-time passenger flow data to build a feedback mechanism, and iteratively optimize the model parameters and dynamic weight matrix; S6: Extract common features from different scenarios to build a weight template library. Based on the weight template library, deploy the trained model to the target scenario and fine-tune the parameters to adapt to the new scenario's passenger flow prediction needs.
[0007] By employing the above technical solution, when predicting passenger flow, the core data sources for each scenario are first acquired and processed to obtain a standardized dataset. This standardized dataset is then preprocessed to extract features relevant to passenger flow and remove irrelevant features, resulting in a high-quality feature set for training. Next, a multi-factor weight analysis system is constructed based on the correlation factors related to passenger flow, and a weight calculation model is designed to calculate each correlation factor, thereby generating a dynamic weight matrix. The dynamic weight matrix and the high-quality feature set are then used as input, and combined with changes in passenger flow, the initialized iterative optimization model is trained to output passenger flow prediction results. Simultaneously, the model parameters and the dynamic weight matrix are iteratively optimized based on actual conditions. Finally, the trained passenger flow prediction model is deployed at the target site to accurately predict passenger flow in each scenario.
[0008] Optionally, S2 includes: S21: Preprocess the standardized dataset by spatiotemporal alignment of heterogeneous data and dynamic noise filtering; S22: Calculate and obtain cross-regional passenger flow transmission relationships, and remove redundant features using a feature selector; S23: Perform data augmentation and sample balancing in extreme scenarios. Generative adversarial networks are used to generate extreme scenario samples, and sample balancing is performed on the standardized dataset.
[0009] Optionally, the heterogeneous data spatiotemporal alignment and dynamic noise filtering in S21 include: A dynamic time window adaptive matching method based on attention mechanism is adopted to achieve spatiotemporal alignment of multi-source data with different granularities, and a multi-threshold joint noise detection algorithm is used to distinguish between accidental data anomalies and real passenger flow mutations.
[0010] Optionally, S22 includes: adaptive extraction and dimensional reduction of passenger flow association features, using a regional passenger flow association feature mining method based on graph neural networks to capture cross-regional passenger flow transmission relationships, and using a hybrid regularized feature selector to remove redundant features.
[0011] Optionally, S3 includes: S31: An initial weight assignment method that combines the analytic hierarchy process (AHP) and the entropy weight method is adopted to balance the influence of subjective experience and objective data. At the same time, the importance of factors is ranked by the attention weight mechanism to generate an initial weight matrix. S32: Dynamically update the weights and adaptively adjust them according to the scenario.
[0012] Optionally, S32 includes: A weight iterative optimization method based on prediction error feedback is adopted, combined with a weight fast adaptation algorithm triggered by scene switching, to achieve dynamic adjustment of weights.
[0013] Optionally, the passenger flow prediction model in S5 is a weighted fusion correction model of the seasonal differential autoregressive moving average model SARIMA and the long short-term memory artificial neural network LSTM.
[0014] Optionally, the real-time passenger flow data construction feedback mechanism in S5 adopts a sliding window real-time data incremental learning method to incrementally update the passenger flow prediction model and the correction model, and presets a prediction deviation threshold. When the prediction deviation exceeds the threshold, the model parameters are fine-tuned.
[0015] Optionally, the step S6 of extracting common features of different scenarios to construct a weight template library includes: performing cluster analysis on the historical weight features and scenario features of different scenarios using a clustering algorithm, extracting common weight templates and individual weight deviation values for various scenarios, and then constructing a weight template library.
[0016] Optionally, the deployment of the trained model to the target scene based on the weight template library in S6 includes: initial cross-scene model migration, obtaining the initial weight template of the target scene, including the selection of the feature matching algorithm and the fusion of any item obtained from the scene weight template library, completing the initial migration while keeping the underlying parameters of the basic model unchanged, and then adapting to the individual features of the target scene through phased parameter fine-tuning.
[0017] In summary, the present invention has at least the following beneficial technical effects: 1. This invention improves the accuracy of passenger flow prediction in multiple scenarios, and can accurately capture the personalized passenger flow change characteristics of different scenarios such as business districts, transportation hubs, scenic spots, and residential areas. It can effectively adapt to complex scenarios such as short-term passenger flow changes and multi-factor interaction effects, and provide accurate data support for scenario operation and management.
[0018] 2. This invention achieves efficient cross-scene model adaptation. By constructing a scene weight template library and a hierarchical fine-tuning strategy, the model can be migrated across scenes without retraining, significantly reducing the cost of model deployment and maintenance, and improving the reusability and deployment efficiency of the prediction model.
[0019] 3. This invention enhances the dynamic adjustment capability of the prediction model. Through dynamic weight updates and real-time feedback optimization mechanisms, the model can adapt to changes in passenger flow patterns and scene characteristics in real time, ensuring the continuous effectiveness of prediction results and further improving the rationality and efficiency of scene operation resource allocation. Attached Figure Description
[0020] Figure 1 This is a schematic diagram of the steps in the dynamic prediction method for passenger flow of the present invention. Detailed Implementation
[0021] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention.
[0022] This invention provides a method for dynamically predicting passenger flow.
[0023] refer to Figure 1 A method for dynamic prediction of passenger flow includes the following steps: S1: Multi-source data acquisition and multi-modal data fusion: Collect three core data sources: traffic data, meteorological data, and image data. Traffic data includes urban public transport operation data, taxi passenger data, and subway passenger flow data. Through multi-modal data fusion technology, the format and spatiotemporal benchmark of various types of data are unified to form a standardized dataset. S2: Multi-source data preprocessing and passenger flow association feature engineering: Cleaning, spatiotemporal alignment, and noise filtering are performed on the standardized dataset. Cross-regional passenger flow association features and time-dimensional passenger flow change features are extracted simultaneously. Redundant features are removed through dimensionality reduction techniques to obtain a high-quality feature set. S3: Construction of Multi-Dimensional Dynamic Weight Analysis Module: Based on time attributes, traffic control information, meteorological conditions, and image passenger flow characteristics, a multi-factor weight analysis system is constructed, a weight calculation model is designed to complete the differentiated weighting of historical data, and a dynamic weight matrix is generated; S4: Training and Inference of SARIMA-based Enhanced Passenger Flow Prediction Model: Using the dynamic weight matrix and high-quality feature set as input, the SARIMA-enhanced model is trained by combining minute-level passenger flow change values, and the preliminary minute-level passenger flow prediction results are output through model inference. S5: Dynamic correction and real-time feedback optimization of prediction results: A multi-model fusion strategy is adopted to correct the preliminary prediction results, real-time passenger flow data is introduced to build a feedback mechanism, and the model parameters and dynamic weight matrix are iteratively optimized. S6: Cross-Scenario Adaptive Model Transfer and Parameter Fine-tuning: Extract common features from different scenarios to build a weight template library. Based on the template library, transfer the trained model to the target scenario and adapt the new scenario's passenger flow prediction needs through parameter fine-tuning.
[0024] Furthermore, step S2 also includes S21 heterogeneous data spatiotemporal alignment and dynamic noise filtering, specifically: using an attention-based dynamic time window adaptive matching method to achieve spatiotemporal alignment of multi-source data with different granularities; wherein, the core parameter calculation formula for dynamic time window matching is: In the formula, Let t be the width of the time window at time t. It is a smoothing coefficient with a value range of [0.6, 0.8]. Data at the current moment Compared with the data of the previous moment Attention similarity value, This is the time decay coefficient, and its value ranges from [0.01, 0.03]. This is the time interval between the current moment and the previous moment (in minutes).
[0025] Simultaneously, a multi-threshold joint noise detection algorithm is used to distinguish between occasional data anomalies and genuine passenger flow mutations. The detection threshold is calculated as follows: In the formula, The mean of the data. The standard deviation of the data. This is a threshold adjustment coefficient, dynamically set to [2.0, 3.0] based on the stability of the data source. This represents the skewness of the data distribution.
[0026] Furthermore, step S2 also includes S22 adaptive extraction and dimensionality reduction of passenger flow association features, specifically: using a regional passenger flow association feature mining method based on graph neural networks to capture cross-regional passenger flow transmission relationships; and simultaneously using an L1L2 hybrid regularization feature selector to remove redundant features, with the hybrid regularization loss function being: In the formula, , , These are the L1 regularization coefficient, L2 regularization coefficient, and feature cross-regulation coefficient, respectively, all ranging from [0.01, 0.1]. , These are the weight coefficients for the i-th and j-th features, respectively.
[0027] Furthermore, step S2 also includes S23 extreme scene data augmentation and sample equalization, specifically: generating extreme scene samples using a generative adversarial network (GAN), where the generator loss function of the GAN is: The discriminator loss function is: In the formula, For noise distribution, For the true data distribution, Output samples for the generator. Let be the probability that the discriminator classifies a real sample. Let be the probability that the discriminator classifies the generated sample. , are the gradient penalty coefficients for the generator and discriminator, respectively, and their values range from [1.0, 10.0]. The generator outputs the gradient with respect to the input noise. This outputs the gradient of the discriminator with respect to the real samples.
[0028] Furthermore, step S3 also includes S31, constructing a multi-factor collaborative weight calculation model, specifically: using an initial weight assignment method that integrates the analytic hierarchy process (AHP) and the entropy weight method. The weight calculation of the AHP involves constructing a judgment matrix. Calculate eigenvalues With feature vectors Obtain subjective weights The entropy weight method calculates the entropy value of each factor. Obtain objective weights : The fusion weights are: In the formula, The fusion coefficient has a value range of [0.4, 0.6]. For the sample size, Let be the normalized value of the i-th factor for the j-th sample. The weight coefficient of the j-th sample is dynamically set to [0.8, 1.2] based on the timeliness of the sample.
[0029] Simultaneously, an attention weighting mechanism is embedded to rank the importance of factors. The attention weighting formula is as follows: In the formula, For the importance score of the i-th factor, The total number of factors, It is a temperature coefficient with a value range of [0.1, 1.0]. Let be the correlation coefficient between the i-th factor and the k-th factor.
[0030] Furthermore, step S3 also includes S32 dynamic weight update and real-time adaptive adjustment, specifically: adopting a weight iterative optimization method based on prediction error feedback, with the weight update formula as follows: In the formula, For the updated weights, As the current weight, The weights are for the first two time points. The learning rate is defined as [0.001, 0.01]. For prediction error, This is the weight decay coefficient, and its value ranges from [0.0001, 0.001]. The momentum coefficient has a value range of [0.5, 0.9]. A scene-switching triggered weighted fast adaptation algorithm is also employed. When the detected change in scene features exceeds a preset threshold, a preset scene weight template is invoked for initial adaptation, followed by iterative optimization to achieve precise adaptation.
[0031] Furthermore, step S5 also includes S51 correction of the prediction results of multi-model fusion, specifically: using a weighted fusion correction model of SARIMA and LSTM, the fusion prediction result is as follows: In the formula, The fusion weights are set to a value range of [0.5, 0.7]. The results are predictions from the SARIMA model. The prediction results of the LSTM model. This represents the prediction confidence level of the SARIMA model. This represents the prediction confidence of the LSTM model. Simultaneously, an adaptive correction strategy with dynamic error interval division is employed, dividing the model into different intervals based on the magnitude of the prediction error, and using differentiated correction coefficients for error correction in each interval.
[0032] Furthermore, step S5 also includes a feedback adjustment mechanism driven by real-time passenger flow data, specifically: using a sliding window-based real-time incremental learning method, a fixed length of the latest real-time passenger flow data is selected as incremental samples to incrementally update the enhanced passenger flow prediction model and the correction model. Simultaneously, a prediction deviation threshold is set. When the prediction deviation exceeds the threshold, model parameter fine-tuning is triggered. Parameter fine-tuning employs a mini-batch gradient descent method, with the batch size dynamically determined based on the real-time data update frequency.
[0033] Furthermore, steps S2 and S3 interact collaboratively. The feature contribution analysis results obtained from the adaptive extraction of passenger flow association features in step S2 are directly input into the multi-factor collaborative weight calculation model in step S3 as an auxiliary basis for initial weight allocation. The factor importance information output by the weight module in step S3 guides the feature selection priority of the feature selector in step S2. The data integrity index after spatiotemporal alignment in step S2 dynamically adjusts the confidence weight of each data source in step S3.
[0034] Furthermore, there is a dynamic interaction between steps S3 and S4. The dynamic weight result output by step S3 is used as the input weight term of the enhanced passenger flow prediction model in step S4 to optimize the attention allocation of the model's time-series prediction. The gradient descent information in the model training process in step S4 is used to fine-tune the factor synergy coefficient of the multi-factor synergy weight calculation model in step S3.
[0035] Furthermore, there is interactive feedback between steps S4 and S5. In step S5, the predicted and corrected error value is input into the weight iterative optimization formula in step S3 for iterative updating of the weight coefficients. The real-time feedback of actual passenger flow data in step S5 updates the training sample set of the enhanced passenger flow prediction model in step S4 and the correction model in step S5. The corrected and accurate prediction results in step S5 feed back into the threshold adjustment of feature engineering in step S2.
[0036] Furthermore, steps S1 and S2 are linked and interactive. The data source stability index output by the acquisition module in step S1 dynamically adjusts the threshold adjustment coefficient of the multi-threshold joint noise detection algorithm in step S2. The abnormal data ratio statistics in step S2 provide feedback to adjust the data source priority of the acquisition module in step S1, prioritizing the acquisition of data sources with a low abnormal data ratio.
[0037] Furthermore, there is an adaptation interaction between steps S5 and S6. The feedback optimization parameters of mature scenarios in step S5 serve as the initial parameter template for cross-scenario migration in step S6. The accuracy deviation during the cross-scenario migration process in step S6 triggers the correction module in step S5 to generate a scenario-specific correction strategy.
[0038] Furthermore, steps S3 and S6 interact collaboratively, extracting the weight features of step S3 under different scenarios, constructing a scenario weight template library, and supporting the rapid cross-scenario migration of step S6; the weight adaptation effect after scenario migration in step S6 is used to reversely optimize the scenario discrimination parameters of the multi-factor collaborative weight calculation model in step S3.
[0039] In this embodiment, the detailed technical implementation process is as follows: First, the dynamic passenger flow prediction system is started. After the system initialization is completed, it sequentially executes the following steps according to the preset process: multi-source data acquisition and multi-modal data fusion, multi-source data preprocessing and passenger flow association feature engineering, construction of multi-dimensional dynamic weight analysis module, training and inference of enhanced passenger flow prediction model based on SARIMA, dynamic correction and real-time feedback optimization of prediction results, cross-scenario adaptive model migration and parameter fine-tuning. Each step is coordinated and linked through data interface and control signal to ensure the continuity and accuracy of the prediction process.
[0040] I. Multi-source data acquisition and multi-modal data fusion The core objective of step S1 is to collect three core data sources: traffic data, meteorological data, and image data, and to unify the format and spatiotemporal reference of various types of data through multimodal data fusion technology to form a standardized dataset.
[0041] In practical implementation, a multi-source data acquisition terminal cluster is first constructed. This cluster includes a traffic data acquisition unit, a meteorological data acquisition unit, and an image data acquisition unit. Each unit establishes a communication connection with the system's main controller via an industrial Ethernet network, and data transmission uses the TCP / IP protocol to ensure transmission stability. Specifically, the traffic data acquisition unit collects urban bus operation data, taxi passenger data, and subway passenger flow data by calling the open API interface of the urban traffic management platform. Urban bus operation data includes, but is not limited to, real-time GPS location data, arrival time data, and passenger count data for each bus route, with a data acquisition frequency set to once per minute. Taxi passenger data includes, but is not limited to, real-time location data, passenger status data, and order start and end location data for taxis, with a acquisition frequency set to once per minute. Subway passenger flow data includes, but is not limited to, entrance gate passage data, exit gate passage data, and platform passenger density data for each subway station, with a acquisition frequency set to once per minute.
[0042] The meteorological data acquisition unit collects real-time meteorological data and weather warning information by connecting to the meteorological data service interface of the meteorological department. The real-time meteorological data includes, but is not limited to, temperature data, humidity data, precipitation data, wind speed data, and visibility data, and the acquisition frequency is set to once every 5 minutes. The weather warning information includes, but is not limited to, rainstorm warnings, gale warnings, and high temperature warnings. It adopts an event-triggered acquisition method, that is, when the meteorological department issues a warning information, the data acquisition is immediately triggered and transmitted to the system.
[0043] The image data acquisition unit consists of high-definition network cameras deployed within the prediction area. These cameras are located at locations including, but not limited to, bus stops, subway station entrances / exits, main thoroughfares in commercial areas, and transportation hub transfer areas. Each camera covers an area of at least 50 square meters, with a frame rate of 15 frames per second and an image resolution of 1920×1080 pixels in JPEG format. The image data acquired by the cameras undergoes preliminary frame extraction processing via edge computing nodes, extracting one valid image frame every 10 frames to reduce data transmission volume. The extracted image data, carrying the acquisition timestamp and geographic location information, is transmitted to the system's main controller.
[0044] After collecting data from various sources, the multimodal data fusion stage begins. First, the collected data undergoes format standardization: GPS location data from traffic data is converted to latitude and longitude format in the WGS-84 coordinate system; time data is uniformly converted to UTC timestamp format (accurate to milliseconds); numerical data such as temperature and humidity from meteorological data are converted to floating-point format; and warning information is converted to structured text data; JPEG image data is converted to the system's unified BMP format, while retaining the collection timestamp and geographic location information.
[0045] Subsequently, a unified spatiotemporal reference process is performed: using the clock of the system's main controller as a reference, the timestamps of all data are calibrated, with the calibration error controlled within ±10 milliseconds; for the spatial reference, the geographical location information of traffic data and image data is uniformly mapped to a preset regional grid coordinate system, which divides the prediction area into 10m × 10m grid units, with each grid unit assigned a unique grid number, to achieve spatial alignment of various types of data.
[0046] Finally, a multimodal data fusion algorithm is used to fuse the standardized data to generate a standardized dataset. During the fusion process, traffic data, meteorological data, and image data from the same time and within the same grid cell are linked and combined to form a complete fused data record, using timestamps and grid numbers as indexes. For missing data items, neighborhood interpolation is used to complete them, ensuring the integrity of each data record. The standardized dataset is stored in a distributed database using a MySQL cluster architecture, supporting high-concurrency read / write and backup / recovery of data.
[0047] II. Multi-source data preprocessing and passenger flow correlation feature engineering After completing the multi-source data collection and multi-modal data fusion, the next stage is multi-source data preprocessing and passenger flow association feature engineering. The core objective of this stage is to perform cleaning, spatiotemporal alignment, and noise filtering operations on the standardized dataset, simultaneously extract cross-regional passenger flow association features and time-dimensional passenger flow change features, and eliminate redundant features through dimensional reduction techniques to obtain a high-quality feature set.
[0048] (I) Spatiotemporal alignment and dynamic noise filtering of heterogeneous data First, a spatiotemporal alignment operation for heterogeneous data is performed, employing a dynamic time window adaptive matching method based on an attention mechanism to achieve spatiotemporal alignment of multi-source data at different granularities. Since different data sources have different collection frequencies—for example, traffic data is collected once per minute, while meteorological data is collected once every 5 minutes—dynamic time window matching is needed to achieve time synchronization of the data.
[0049] In the actual implementation, first initialize the width of the time window. Based on the statistical results of historical data collection cycles, Set to 5 minutes. Then, calculate the width of the time window at time t according to the core parameter calculation formula for dynamic time window matching described above. Among them, the smoothing coefficient The value is 0.7, which is the time decay coefficient. The value is 0.02. The time interval (in minutes) between the current moment and the previous moment is automatically obtained from the data collection records; Data at the current moment Compared with the data of the previous moment The attention similarity value is calculated using an attention mechanism model.
[0050] The input to the attention mechanism model is the data at the current time step. Compared with the data of the previous moment The feature vectors, including but not limited to numerical features such as passenger flow density, traffic flow, temperature, and humidity, are mapped to a vector space of the same dimension through a fully connected layer, and then the attention similarity value is calculated through dot product operation. in, This represents the dimension of the feature vector. Based on the calculated... Adjust the time window for the current moment, sort the multi-source data within the window according to the timestamp, and take the value at the center of the window as the representative value of the window to achieve time alignment of data at different granularities.
[0051] After time alignment, dynamic noise filtering is performed, using a multi-threshold joint noise detection algorithm to distinguish between accidental data anomalies and genuine passenger flow surges. First, the statistical characteristics of the data are calculated, including the data mean. Data standard deviation Data distribution skewness The calculation formulas are as follows: in, The number of data samples within the window. Let be the value of the i-th sample. (Data standard deviation) Through calculation.
[0052] Then, the noise detection threshold is calculated according to the detection thresholds mentioned above. The threshold adjustment coefficient Dynamically selectable values based on data source stability: For subway passenger flow data with high stability... The value is 2.0; for taxi passenger data with low stability, The value is 3.0; for meteorological data, The value is set to 2.5. Each data sample within the window is compared to the threshold. Comparison, when the data sample is larger or less If the data is identified as noise, it is corrected using a moving average method. The correction value is the average of the three valid data points before and after the data. If the data is identified as a real change in passenger flow, such as a surge in passenger flow caused by the end of a large event, the data is retained and marked as a change in flow for subsequent feature extraction.
[0053] (II) Adaptive Extraction and Dimension Reduction of Passenger Flow Related Features After completing the spatiotemporal alignment and dynamic noise filtering of heterogeneous data, adaptive extraction and dimensional reduction of passenger flow association features are performed. A regional passenger flow association feature mining method based on graph neural network is adopted to capture cross-regional passenger flow transmission relationship. At the same time, a feature selector with L1 and L2 hybrid regularization is used to remove redundant features.
[0054] First, a regional passenger flow map structure is constructed, with each grid cell within the predicted area as a node in the graph. Node features include passenger flow density, traffic flow, time attributes, and weather conditions for that grid cell. Passenger flow transmission paths between adjacent grid cells are used as edges in the graph, and the weight of each edge is determined based on the passenger flow migration amount between adjacent grid cells. The passenger flow migration amount is calculated using GPS trajectory data from traffic data and passenger flow movement direction data from image data.
[0055] The constructed regional passenger flow map structure is input into a graph neural network model. The graph neural network model employs a graph convolutional network architecture (GCN). Local neighborhood features of nodes are extracted through graph convolutional layers, dimensionality reduction of these features is achieved through pooling layers, and cross-regional passenger flow correlation features are output through fully connected layers. The calculation formula for the graph convolutional layer is: in, The normalized adjacency matrix, The node feature matrix, For convolution kernel weights, This is the bias term. Through this calculation formula, the features of each node are integrated with the feature information of its neighboring nodes, thereby realizing the capture of cross-regional passenger flow transmission relationships.
[0056] After extracting the cross-regional passenger flow correlation features, time-dimensional passenger flow change features are simultaneously extracted, including but not limited to minute-level passenger flow change rate, hourly passenger flow change trend, daily passenger flow peak occurrence time, and weekly passenger flow change pattern. The minute-level passenger flow change rate is: in, Let be the passenger flow density at minute t. Let be the passenger flow density at minute t-1.
[0057] The hourly passenger flow trend was obtained by fitting a linear regression model, which is as follows: in, For passenger flow density, For hours This is the trend coefficient. This is the intercept term.
[0058] The extracted cross-regional passenger flow correlation features are combined with time-dimensional passenger flow change features to form an initial feature set. Since there may be redundant features in the initial feature set, a feature selector with L1 and L2 hybrid regularization is used to remove redundant features.
[0059] The initial feature set is input into the feature selector, and the mixed regularization loss function is minimized using the gradient descent algorithm. When the loss function converges, the convergence condition is that the change in the loss value over 10 consecutive iterations is less than 1 / 3. Filter out the weight coefficients Features exceeding a preset threshold, in one feasible embodiment, have a threshold set of 0.01, forming a preliminary high-quality feature set.
[0060] (III) Data Augmentation and Sample Balancing in Extreme Scenarios Considering the scarcity of passenger flow data samples in extreme scenarios, such as heavy rain, blizzards, major events, and holiday peaks, which can lead to biases in subsequent model training, it is necessary to perform extreme scenario data augmentation and sample balancing operations. Generative adversarial networks are used to generate extreme scenario samples.
[0061] Generative Adversarial Networks (GANs) consist of a generator and a discriminator. The generator uses a Deep Convolutional Generative Adversarial Network (DCGAN) architecture, which includes four deconvolutional layers and four batch normalization layers. The input is a 100-dimensional random noise vector. It follows a normal distribution. The output is a generated sample with the same dimensions as the data in the real extreme scenario. The discriminator also uses the DCGAN architecture, consisting of four convolutional layers and four batch normalization layers, with input being real-world extreme scenario data. Follows the true data distribution or generate samples The output is the discrimination probability, where 0 represents a generated sample and 1 represents a real sample.
[0062] The training process of a Generative Adversarial Network (GAN) consists of two alternating phases: generator training and discriminator training. First, the discriminator is trained using real-world extreme scenario data. Samples generated by the generator Input the discriminator and calculate the discriminator loss function. Wherein, The value is 5.0. Minimize using the stochastic gradient descent algorithm. Update the parameters of the discriminator.
[0063] The generator is then trained to process the random noise vector. Input generator to obtain generated samples The generated samples are input into the discriminator to obtain the discrimination probability. Calculate the generator loss function, where The value is 5.0. The generator outputs the gradient with respect to the input noise. This gradient is minimized using the stochastic gradient descent algorithm. Update the generator's parameters.
[0064] The two stages are repeated until the generator and discriminator reach a Nash equilibrium. The equilibrium condition is that the probability of the sample generated by the generator being misclassified as a real sample by the discriminator stabilizes at around 0.5.
[0065] After training, the generator can generate a large number of samples that conform to the passenger flow pattern in extreme scenarios. These generated samples are added to the initial high-quality feature set. The SMOTE algorithm is used to balance the feature set so that the ratio of extreme scenario samples to normal scenario samples reaches 1:4, and finally a high-quality feature set is obtained.
[0066] During the execution of step S2, there is a linkage and interaction with step S1: the data source stability index output by the acquisition module in step S1 is obtained by calculating the proportion of abnormal data from each data source, where the proportion of abnormal data = the amount of abnormal data / the total amount of data. This dynamically adjusts the threshold adjustment coefficient of the multi-threshold joint noise detection algorithm in step S2. When the data source stability index is low, i.e., the proportion of abnormal data is greater than 20%, increase... The value can be adjusted, for example, from 2.5 to 3.0, to increase the stringency of noise detection; when the data source stability index is high, such as when the proportion of abnormal data is less than 5%, the value can be reduced. The value can be adjusted, for example, from 2.5 to 2.0, to reduce the stringency of noise detection.
[0067] Meanwhile, the statistical results of the abnormal data ratio in step S2 are fed back to the acquisition module in step S1 through the data interface, adjusting the data source priority of the acquisition module, prioritizing the acquisition of data sources with a low abnormal data ratio, and pausing the acquisition and triggering the fault detection process for data sources with an abnormal data ratio exceeding 30%.
[0068] III. Construction of Multi-Dimensional Dynamic Weight Analysis Module After completing the preprocessing of multi-source data and the engineering of passenger flow association features, the next stage is to build a multi-dimensional dynamic weight analysis module. The core objective of this stage is to construct a multi-factor weight analysis system based on time attributes, traffic control information, meteorological conditions, and image passenger flow characteristics, design a weight calculation model to complete the differentiated weighting of historical data, and generate a dynamic weight matrix.
[0069] (I) Construction of Multi-Factor Collaborative Weight Calculation Model First, the influencing factors of the multi-factor weighted analysis system are determined, including time attribute factors, traffic control factors, meteorological factors, and image passenger flow characteristic factors. Time attribute factors include weekday / holiday factors and peak / off-peak factors. The weekday / holiday factor is determined by the date judgment module, with 1 indicating a weekday and 0 indicating a holiday. The peak / off-peak factor is determined by time interval judgment: 7:00-9:00 and 17:00-19:00 are peak times, with a value of 1; other times are off-peak times, with a value of 0. The traffic control factor is determined by real-time control information from the traffic management department, with 1 indicating control in effect and 0 indicating no control. Control information is obtained in real-time through an API interface. Meteorological factors include precipitation factors and wind speed factors. The visibility factor and precipitation factor are calculated as follows: 1 indicates precipitation, 0 indicates no precipitation; wind speed factor: 1 for wind speed greater than 5 m / s, 0 otherwise; visibility factor: 1 for visibility less than 200 meters, 0 otherwise; image passenger flow characteristic factors include passenger flow density factor and passenger flow direction consistency factor. The passenger flow density factor is calculated using an image recognition algorithm: 1 for density greater than 5 people / square meter, 0 otherwise. The passenger flow direction consistency factor is calculated using the variance of the passenger flow vector in the image: 1 for variance less than 0.5, 0 otherwise.
[0070] An initial weighting method combining the analytic hierarchy process (AHP) and entropy weighting is used to calculate the initial weights of each influencing factor. First, the subjective weights are calculated using the AHP. Constructing a judgment matrix Determine the elements of a matrix This represents the importance of the i-th factor relative to the j-th factor, with importance levels ranging from 1 to 9, where 1 indicates equal importance and 9 indicates extreme importance. The judgment matrix is determined based on the experience of domain experts. The element values. For example, the importance of the time attribute factor relative to the traffic control factor is 3, and the importance of the traffic control factor relative to the weather factor is 2. A complete judgment matrix is constructed based on this. .
[0071] Calculate the judgment matrix eigenvalues With feature vectors Eigenvalues are obtained by solving equations get, The identity matrix and eigenvectors are obtained by solving the equations. Obtained. For the eigenvectors Normalization is performed to obtain the subjective weights. To ensure the consistency of the judgment matrix, a consistency check is required, using consistency indicators. , The total number of factors, the random consistency index according to The value is obtained from the standard RI table, and the consistency ratio is... .when If the condition is met, the judgment matrix satisfies the consistency requirement; otherwise, the element values of the judgment matrix need to be adjusted and recalculated until the consistency requirement is met.
[0072] Then, the objective weights were calculated using the entropy weight method. First, the sample data for each factor are normalized to obtain... ,in For the original data of the j-th sample of the i-th factor, These are normalized values. Calculate the entropy value of each factor. Samples from the past 30 days Value 1.2, samples taken within 30-90 days. A value of 1.0 is used for samples older than 90 days. The value is set to 0.8. Calculate the difference coefficients for each factor. The larger the difference coefficient, the greater the information content of the factor, and the greater its weight. Normalizing the difference coefficient yields the objective weights. , The total number of factors.
[0073] The fusion weights are calculated using a cube root nonlinear fusion method, where The value is set to 0.5 to balance the influence of subjective and objective weights.
[0074] Simultaneously, an attention weighting mechanism is embedded to rank the importance of factors and calculate the importance score of each factor. Importance scores are obtained through correlation analysis between factors and passenger flow forecast results; the higher the correlation coefficient, the higher the importance score. The larger the value, the greater the value in the attention weight calculation formula. The value is 0.5. Calculated using the Pearson correlation coefficient formula. (Based on attention weights) For fusion weights Adjustments are made to obtain the initial weight matrix for each factor.
[0075] (ii) Dynamic weight updates and real-time adaptive adjustments After obtaining the initial weight matrix, an iterative weight optimization method based on prediction error feedback is adopted to achieve dynamic updating and real-time adaptive adjustment of the weights. First, the weight update period is set to 1 minute, meaning the weights are updated every minute based on the latest prediction error.
[0076] Prediction error Calculated using the mean square error formula: in, Based on actual passenger flow data, To predict passenger flow data, To predict the sample size, calculate the updated weights according to the weight update formula. The value is 0.005. The value is 0.0005. The value is 0.7.
[0077] When calculating the gradient for weight updates, the backpropagation algorithm is used to solve for the prediction error. The gradient is then passed back to the weight calculation module to obtain the partial derivative of each weight coefficient with respect to the error. The gradient values are then substituted into the weight update formula to complete the iterative optimization of the weights.
[0078] Simultaneously, a weighted fast adaptation algorithm triggered by scene switching is adopted to monitor the changes in scene features in real time. The changes in scene features are calculated by the Euclidean distance between the current scene feature vector and the scene feature vector at the previous moment. in, Let be the value of the i-th scene feature at time t. Let be the value of the i-th scene feature at time t-1. The preset scene switching threshold is 0.8. When the scene feature changes... When the value exceeds 0.8, it is determined to be a scene switch, such as switching from weekday off-peak to weekday peak, or from no precipitation to precipitation. At this time, the corresponding scene weight template in the preset scene weight template library is called as the initial adaptation value of the current weight. Then, fine adjustment is made through the above-mentioned weight iterative optimization method to achieve rapid weight adaptation.
[0079] During the execution of step S3, there is a collaborative interaction with step S2: the feature contribution analysis results obtained from the adaptive extraction of passenger flow association features in step S2 are used to score the feature importance. This means that the multi-factor collaborative weight calculation model directly input in step S3 serves as an auxiliary basis for the initial weight allocation; the higher the feature contribution of a factor, the larger its initial base weight value. The factor importance information output by the weight module in step S3, i.e., the attention weight, is... The data is transmitted back to the feature selector in step S2 via the data interface to guide the feature selection priority. Features with higher factor importance have lower selection thresholds and are retained first. The spatiotemporally aligned data integrity index in step S2, where data integrity = complete data volume / total data volume, dynamically adjusts the confidence weight of each data source in step S3. Data sources with higher data integrity have greater corresponding factor weights.
[0080] IV. Training and Inference of an Enhanced Passenger Flow Forecasting Model Based on SARIMA After completing the construction of the multi-dimensional dynamic weight analysis module, the training and inference phase of the enhanced passenger flow prediction model based on SARIMA is entered. The core objective of this phase is to use the dynamic weight matrix and high-quality feature set as input, combine them with minute-level passenger flow change values to train the SARIMA enhanced model, and output preliminary minute-level passenger flow prediction results through model inference.
[0081] First, an enhanced SARIMA model is constructed. This model is based on the traditional SARIMA model, introducing a dynamic weight matrix as the input weight term to optimize the attention allocation for time series prediction. The core formula of the SARIMA model is: in, Let the order be the autoregressive order. It is the difference order. The moving average order is... For seasonal autoregression order, For seasonal difference order, The order of the seasonal moving average. Based on the periodic analysis of minute-level passenger flow data, this is a seasonal cycle. Set it to 1440, which is the number of minutes in a day.
[0082] The input to the SARIMA augmentation model is a feature vector with fused dynamic weights. The fusion process is as follows: in, The enhanced feature vector after fusion It is a dynamic weight matrix. The feature vector is a high-quality feature set. The enhanced feature vector and the minute-level passenger flow change value are used as the input to the model, where the minute-level passenger flow change value is extracted from the high-quality feature set, and the output of the model is the minute-level passenger flow prediction value for the next 10 minutes.
[0083] The model training process is divided into two stages: parameter optimization and model fitting. First, parameter optimization is performed by using a grid search method to traverse all possible parameter combinations. The value range is 0-3. The value range is 0-1. The value range is 0-3. The value range is 0-2. The value range is 0-1. The value ranges from 0 to 2. The Akaike Information Criterion (AIC) is used as the evaluation index for parameter selection. The smaller the AIC value, the better the fitting effect of the parameter combination.
[0084] The formula for calculating AIC is: in, The number of model parameters. This represents the likelihood function value of the model. After obtaining the optimal parameter combination through grid search, the model parameters are fixed.
[0085] Subsequently, model fitting was performed. Historical enhanced feature vectors and historical minute-level passenger flow data were used as training samples and input into the SARIMA enhanced model. The least squares method was used to minimize the model's prediction error and optimize the model's coefficients. The time span of the training samples was set to minute-level data for the past 90 days. A rolling training method was adopted, that is, for every additional day of real-time data, the model was incrementally trained and the model coefficients were updated to ensure the model's timeliness.
[0086] After the model training is completed, the inference phase begins. The enhanced feature vector at the current moment is input into the trained SARIMA enhancement model. The enhanced feature vector is obtained by fusing the current dynamic weight matrix with the current high-quality feature set. The model captures the long-term dependencies of passenger flow data through the autoregressive module, smooths random fluctuations through the moving average module, and captures the intraday periodic changes of passenger flow data through the seasonality module. Finally, it outputs the preliminary minute-level passenger flow prediction results for the next 10 minutes.
[0087] During the execution of step S4, there is a dynamic interaction with step S3: the dynamic weight matrix output by step S3 serves as the input weight term for the enhanced passenger flow prediction model in step S4, through... The fusion process optimizes the attention allocation of the model's time-series prediction, making the model focus more on the features corresponding to factors with higher weights. In step S4, the gradient descent information during model training, i.e., the gradient changes in the model coefficients, is fed back to the multi-factor collaborative weight calculation model in step S3 via the backpropagation algorithm, fine-tuning the model's factor collaborative coefficients. This makes the dynamic weight matrix more suitable for the training needs of the enhanced passenger flow prediction model.
[0088] V. Dynamic Correction and Real-time Feedback Optimization of Prediction Results After completing the training and inference of the SARIMA-based enhanced passenger flow prediction model, the next stage is dynamic correction and real-time feedback optimization of the prediction results. The core objective of this stage is to use a multi-model fusion strategy to correct the preliminary prediction results, introduce real-time passenger flow data to build a feedback mechanism, and iteratively optimize the model parameters and dynamic weight matrix.
[0089] (a) Correction of prediction results from multi-model fusion A weighted fusion correction model combining SARIMA and LSTM was used to correct the initial minute-level passenger flow prediction results. First, an LSTM correction model was constructed, consisting of three hidden layers with 64 neurons in each layer. The input was the same augmentation feature vector as the SARIMA augmentation model, and the output was the minute-level passenger flow prediction values for the next 10 minutes. The training process of the LSTM model was similar to that of the SARIMA augmentation model, employing a rolling training method with mean squared error as the loss function, and the model parameters were optimized using the Adam optimizer.
[0090] The prediction confidence scores of the SARIMA-enhanced model and the LSTM model are calculated. The prediction confidence score is obtained by calculating the variance of the prediction error of the model. The smaller the variance, the higher the confidence score.
[0091] The prediction confidence level of the SARIMA model is: in, This represents the variance of the prediction error of the SARIMA model. The maximum error variance is preset to 100 based on historical data statistics.
[0092] The prediction confidence of the LSTM model is: in, This represents the variance of the prediction error of the LSTM model.
[0093] The corrected prediction results are calculated based on the fusion prediction results. ,in The value is set to 0.6 to balance the temporal stability of the SARIMA model with the complex fitting ability of the LSTM model.
[0094] At the same time, an adaptive correction strategy with dynamic division of error intervals is adopted, which divides the prediction error into three error intervals: the first interval (absolute error less than 5 people / square meter), the second interval (absolute error between 5 and 10 people / square meter), and the third interval (absolute error greater than 10 people / square meter).
[0095] For the prediction results in the first interval, a small correction factor (0.95-1.05) is used; for the prediction results in the second interval, a medium correction factor (0.9-1.1) is used; and for the prediction results in the third interval, a large correction factor (0.8-1.2) is used. The correction factors are obtained through regression analysis of historical prediction errors and actual passenger flow data to ensure that the corrected prediction results are closer to the true values.
[0096] (ii) Feedback adjustment mechanism driven by real-time passenger flow data After correcting the prediction results, a feedback adjustment mechanism is constructed using real-time passenger flow data. A sliding window-based real-time data incremental learning method is employed to incrementally update both the enhanced passenger flow prediction model and the correction model. The sliding window length is set to 120 minutes, meaning that the latest 120 minutes of real-time passenger flow data is selected as the incremental sample. The incremental sample contains the real-time enhanced feature vector and the corresponding actual passenger flow data.
[0097] Incremental samples are input into the enhanced passenger flow prediction model and the calibration model, and incremental training is performed using the mini-batch gradient descent method. The batch size is set to 32, dynamically determined based on the real-time data update frequency: 32 for an update frequency of once per minute, and 64 for an update frequency of once every 30 seconds. During training, only some parameters of the model are updated, such as the weight coefficients of fully connected layers, without changing the overall structure of the model, ensuring training efficiency.
[0098] Simultaneously, a prediction deviation threshold is set, and the prediction deviation is calculated by the absolute error between the corrected prediction result and the real-time passenger flow data. in, This is real-time passenger flow data.
[0099] The preset prediction deviation threshold is 8 people / square meter. When the prediction deviation... When the threshold is exceeded, model parameter fine-tuning is triggered. The fine-tuning range is ±5% of the model parameters. The parameters are optimized using mini-batch gradient descent until the prediction deviation is less than the threshold.
[0100] During the execution of step S5, there is interactive feedback with step S4: the predicted and corrected error value in step S5 is: in, For the corrected prediction results, the weight iteration optimization formula in step S3 is input for iterative updating of the weight coefficients, making the dynamic weight matrix more suitable for the current passenger flow characteristics. The real-time feedback of actual passenger flow data in step S5 is used to synchronously update the training sample set of the enhanced passenger flow prediction model in step S4 and the corrected model in step S5 through the data interface to ensure the real-time performance of the sample set. The corrected accurate prediction results in step S5 feed back into the threshold adjustment of feature engineering in step S2, such as adjusting the screening threshold of the L1 and L2 hybrid regularized feature selector, so that feature extraction is more in line with the current passenger flow prediction needs.
[0101] VI. Cross-Scene Adaptive Model Transfer and Parameter Fine-Tuning After completing the dynamic correction and real-time feedback optimization of the prediction results, the model enters the cross-scenario adaptive model migration and parameter fine-tuning stage. The core objective of this stage is to extract common features of different scenarios to build a weight template library, and then transfer the trained model to the target scenario based on the template library. The model is then adapted to the new scenario's passenger flow prediction requirements through parameter fine-tuning.
[0102] First, a scene weight template library is constructed to extract common and unique weight features of different scenes, including but not limited to commercial districts, transportation hubs, scenic spots, and residential areas. Historical scene data is then clustered using a K-means algorithm with four clusters corresponding to four core scene categories. Clustering features include time attribute factor weights, meteorological factor weights, passenger flow density factor weights, and traffic flow factor weights.
[0103] In practice, the historical dynamic weight matrix and scene feature data for each scene are first collected. Scene feature data includes scene type labels, area, core functional facility types, and average daily passenger flow. The mean vector of the historical dynamic weight matrix is used as the weight feature vector for that scene, and combined with the scene feature data to form a scene sample set. The scene sample set is then input into the K-means algorithm to calculate the Euclidean distance between samples as a similarity measure. Cluster centers are iteratively optimized until they stabilize, and the change in cluster centers over five consecutive iterations is less than [a certain value]. .
[0104] After clustering, each cluster corresponds to a scenario class. The mean of the weight feature vector of each cluster is extracted as the common weight template for that scenario class. At the same time, the individual weight deviation values of different samples within each cluster are recorded to form a scenario weight template library. The scenario weight template library is stored using a distributed file system, with a storage structure of "scenario type - common weight template - individual deviation threshold", supporting fast retrieval and retrieval by scenario type.
[0105] After completing the construction of the scene weight template library, the cross-scene adaptive model migration stage begins. First, feature extraction is performed on the target scene. The same feature extraction method as for historical scenes is used to obtain the feature vector of the target scene, which includes the target scene type label, area, core functional facility type, real-time scene features, etc. The real-time scene features include time attributes, weather conditions, and traffic control information.
[0106] The similarity between the target scene feature vector and the common feature vectors of various scenes in the scene weight template library is calculated using a feature matching algorithm. The feature matching algorithm uses the cosine similarity algorithm, and the similarity calculation formula is as follows: in, For the target scene feature vector, This represents the common feature vectors of a certain type of scene in the template library. Let L2 norm represent the vector. The common weight template with the highest similarity and greater than 0.8 is selected as the initial weight template for the target scene. If the similarity of all templates is less than 0.8, the initial weight template is generated by weighted fusion of neighboring templates, and the weight of the weighted fusion is the similarity value of each template.
[0107] The trained enhanced passenger flow prediction model and calibration model are used as the base model and transferred to the target scenario. The underlying parameters of the base model remain unchanged, such as the autoregressive order of the SARIMA model and the hidden layer weights of the LSTM model. Only the initial weight template is used as the initial value of the dynamic weight matrix of the target scenario to complete the initial transfer of the model.
[0108] After the initial transfer learning is complete, parameter fine-tuning is performed to adapt to the unique characteristics of the target scenario. Parameter fine-tuning employs a fine-tuning strategy from transfer learning, divided into two stages: The first stage freezes the underlying network parameters of the base model, such as the seasonal periodic parameters of the SARIMA model and the parameters of the first two hidden layers of the LSTM model, and only fine-tunes the top-level parameters, such as the dynamic weight fusion coefficients. Multi-model fusion weights Regularization coefficient , , The second stage involves unfreezing some layers of the underlying network parameters, such as the third hidden layer of the LSTM model, to fine-tune the entire network.
[0109] During fine-tuning, small sample data from the target scene was used, collecting minute-level data from the target scene for 7 consecutive days as fine-tuning samples. The corrected prediction error was used as the loss function, and the Adam optimizer was used for parameter optimization. The learning rate was set to 0.0005, lower than the learning rate used for training the base model, to avoid parameter oscillation. The number of fine-tuning iterations was set to 50. The model was considered fine-tuned when the loss function value did not decrease or decreased by less than a certain amount after 10 consecutive iterations. When the time is right, stop fine-tuning to obtain the final prediction model adapted to the target scenario.
[0110] During the execution of step S6, there is a collaborative and adaptive interaction with steps S3 and S5: the weight features of different scenarios in step S3 are transmitted to step S6 through the data interface to build a scenario weight template library, supporting the rapid cross-scenario migration of step S6; the weight adaptation effect after scenario migration in step S6 is evaluated by the prediction error after migration. The evaluation index of the adaptation effect is the error reduction rate after migration = (error before migration - error after migration) / error before migration. The scenario discrimination parameter of the multi-factor collaborative weight calculation model in step S3 is optimized in reverse. The scenario discrimination parameter is achieved by adjusting the cluster center distance threshold of the clustering algorithm, so that the weight calculation model can more accurately capture the weight differences of different scenarios.
[0111] Meanwhile, the feedback optimization parameters of the mature scenario in step S5, including the regularization coefficient, fusion weight, and prediction deviation threshold after model fine-tuning, are stored in the system parameter library in the form of parameter templates as the initial parameter templates for cross-scenario migration in step S6. The accuracy deviation during the cross-scenario migration process in step S6, and the difference between the prediction error of the migrated model and the error of the mature scenario, trigger the correction module in step S5 to generate a scenario-specific correction strategy through feedback signals. The scenario-specific correction strategy includes adjusting the error interval division threshold and optimizing the value range of the correction coefficient, so that the correction model is more adapted to the passenger flow fluctuation characteristics of the target scenario.
[0112] VII. End-to-end Collaboration and Data Flow The above six steps constitute the entire process of dynamic passenger flow prediction. Each step achieves real-time data and control signal flow through the system bus and data middleware, ensuring coordinated operation throughout the entire process. The data middleware uses a Kafka message queue to achieve asynchronous transmission of high-concurrency data. The output data of each step is published as a message to the corresponding topic, and subsequent steps subscribe to this topic to obtain data. Data transmission latency is controlled within 500 milliseconds.
[0113] The specific data transfer process is as follows: The standardized dataset from step S1 is published to the "Multi-source Fusion Data" topic; Step S2: Subscribe to the topic to obtain data and perform preprocessing and feature engineering, and publish the high-quality feature set to the "High-Quality Feature Set" topic; Step S3: Subscribe to the "High-Quality Feature Set" topic and the "Data Source Stability Indicator" topic published in Step S1, construct a dynamic weight matrix, and then publish it to the "Dynamic Weight Matrix" topic. Step S4: Subscribe to the "High-Quality Feature Set" topic and the "Dynamic Weight Matrix" topic, train and infer to obtain preliminary prediction results, and publish them to the "Preliminary Prediction Results" topic; Step S5: Subscribe to the "Preliminary Prediction Results" topic and the "Real-time Passenger Flow Data" topic published in Step S1, perform correction and feedback optimization, publish the accurate prediction results to the "Accurate Prediction Results" topic, and publish the feedback optimization parameters to the "Feedback Parameters" topic. Return to step S3 and subscribe to the "Feedback Parameters" topic for weight iterative optimization; Step S6: Subscribe to the "Dynamic Weight Matrix" topic, the "Feedback Parameters" topic, and the "Scene Feature Data" topic, perform cross-scene migration and fine-tuning, and publish the adapted model parameters to the "Scene Adaptation Parameters" topic. Steps S4 and S5: Subscribe to this topic to update the model parameters.
[0114] The control signal flow process is as follows: The system main controller collects the execution status of each step in real time through the status monitoring module, such as the data acquisition completion status, model training completion status, and prediction completion status. When a certain step is completed, the status monitoring module generates a completion signal and sends it to the main controller. The main controller generates a control signal to trigger the execution of the next step. If an abnormality occurs in a certain step, such as data acquisition failure or model training non-convergence, the status monitoring module generates an abnormal signal, and the main controller triggers the abnormal handling process, including re-executing the step, calling the backup data source, and loading historical model parameters, to ensure the stable operation of the entire process.
[0115] The above description of the embodiments is only used to provide a detailed introduction to the technical solution of the present invention. However, the description of the above embodiments is only for the purpose of helping to understand the method and core idea of the present invention, and should not be construed as a limitation of the present invention. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in the present invention should be covered within the protection scope of the present invention.
Claims
1. A method for dynamic prediction of passenger flow, characterized in that, Includes the following steps: S1: Obtain the core data source and unify the time series and format to obtain a standardized dataset; S2: Preprocess the standardized dataset, simultaneously extract cross-regional passenger flow correlation features and time-dimensional passenger flow change features, and remove redundant features to obtain a high-quality feature set; S3: Based on time attributes, traffic control information, meteorological conditions, and image passenger flow characteristics, a multi-factor weight analysis system is constructed, a weight calculation model is designed to complete the differentiated weighting of historical data, and a dynamic weight matrix is generated; S4: Use the dynamic weight matrix and high-quality feature set as input, combine them with passenger flow change values to train the passenger flow prediction model, and output the passenger flow prediction results. S5: Correct the passenger flow forecast results, introduce real-time passenger flow data to build a feedback mechanism, and iteratively optimize the model parameters and dynamic weight matrix; S6: Extract common features from different scenarios to build a weight template library. Based on the weight template library, deploy the trained model to the target scenario and fine-tune the parameters to adapt to the new scenario's passenger flow prediction needs.
2. The method for dynamic prediction of passenger flow as described in claim 1, characterized in that, S2 includes: S21: Preprocess the standardized dataset by spatiotemporal alignment of heterogeneous data and dynamic noise filtering; S22: Calculate and obtain cross-regional passenger flow transmission relationships, and remove redundant features using a feature selector; S23: Perform data augmentation and sample balancing in extreme scenarios. Generative adversarial networks are used to generate extreme scenario samples, and sample balancing is performed on the standardized dataset.
3. The method for dynamic prediction of passenger flow as described in claim 2, characterized in that, The heterogeneous data spatiotemporal alignment and dynamic noise filtering in S21 include: A dynamic time window adaptive matching method based on attention mechanism is adopted to achieve spatiotemporal alignment of multi-source data with different granularities, and a multi-threshold joint noise detection algorithm is used to distinguish between accidental data anomalies and real passenger flow mutations.
4. The method for dynamic prediction of passenger flow as described in claim 2, characterized in that, S22 includes: adaptive extraction and dimensional reduction of passenger flow association features, using a regional passenger flow association feature mining method based on graph neural network to capture cross-regional passenger flow transmission relationship, and using a hybrid regularized feature selector to remove redundant features.
5. The method for dynamic prediction of passenger flow as described in claim 1, characterized in that, S3 includes: S31: An initial weight assignment method that combines the analytic hierarchy process (AHP) and the entropy weight method is adopted to balance the influence of subjective experience and objective data. At the same time, the importance of factors is ranked by the attention weight mechanism to generate an initial weight matrix. S32: Dynamically update the weights and adaptively adjust them according to the scenario.
6. The method for dynamic prediction of passenger flow as described in claim 5, characterized in that, S32 includes: A weight iterative optimization method based on prediction error feedback is adopted, combined with a weight fast adaptation algorithm triggered by scene switching, to achieve dynamic adjustment of weights.
7. The method for dynamic prediction of passenger flow as described in claim 1, characterized in that, The passenger flow prediction model in S5 is a weighted fusion correction model of the seasonal differential autoregressive moving average model SARIMA and the long short-term memory artificial neural network LSTM.
8. The method for dynamic prediction of passenger flow as described in claim 1, characterized in that, The real-time passenger flow data construction feedback mechanism in S5 adopts a sliding window real-time data incremental learning method to incrementally update the passenger flow prediction model and the correction model, and presets a prediction deviation threshold. When the prediction deviation exceeds the threshold, the model parameters are fine-tuned.
9. The method for dynamic prediction of passenger flow as described in claim 1, characterized in that, The step S6 involves extracting common features from different scenarios to construct a weight template library, which includes: performing cluster analysis on historical weight features and scenario features of different scenarios using a clustering algorithm, extracting common weight templates and individual weight deviation values for various scenarios, and then constructing a weight template library.
10. The method for dynamic prediction of passenger flow as described in claim 1, characterized in that, The deployment of the trained model to the target scene based on the weight template library in S6 includes: initial cross-scene model migration, obtaining the initial weight template of the target scene, including the selection of feature matching algorithm and the fusion of any item obtained from the scene weight template library, completing the initial migration while keeping the underlying parameters of the basic model unchanged, and then adapting to the individual features of the target scene through phased parameter fine-tuning.