A deep neural network online ensemble method for real-time pedestrian flow prediction
Through deep neural networks with multi-resolution updates and online integration strategies, the accuracy and response speed issues of pedestrian flow prediction under environmental changes are solved, and high-precision real-time prediction is achieved, which is suitable for transportation hubs and public safety management.
Patent Information
- Application Number
- CN202510087483.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-20
- Publication Date
- 2025-09-26
- Estimated Expiration
- 2045-01-20
AI Technical Summary
Existing pedestrian flow prediction methods are difficult to adapt to environmental changes in real time, especially emergencies and dynamic changes in data distribution, resulting in a decrease in prediction accuracy. In addition, traditional models lack online learning and adaptive updating capabilities.
By adopting a multi-resolution update strategy and an online integration strategy, the deep neural network is divided into multiple sub-modules, the sub-modules are trained using historical data of different resolutions, and the sub-modules that best suit the current scenario are dynamically selected and combined according to the changes in real-time data distribution, thus achieving real-time prediction of pedestrian flow.
The accuracy and response speed of pedestrian flow prediction have been improved, and it can quickly adapt to data changes in complex scenarios, provide more accurate prediction results, and support decision-making for traffic management and public safety.
Smart Images

Figure CN120031189B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to an innovative method for real-time analysis and prediction of pedestrian flow data, specifically a deep neural network online integration method for real-time prediction of pedestrian flow, in the field of intelligent prediction and data analysis technology. Background Art
[0002] In modern society, real-time pedestrian flow prediction plays a critical role in numerous fields. At transportation hubs like airports, train stations, and subway stations, accurate pedestrian flow predictions help optimize operational scheduling, rationally arrange security checkpoints, allocate transportation resources, enhance the passenger experience, and ensure safe and efficient operations. Commercial venues like shopping malls, supermarkets, and scenic spots can adjust business hours, staff numbers, and merchandise display layouts based on pedestrian flow predictions, thereby improving service quality and operational efficiency. In terms of public safety management, real-time monitoring and prediction of pedestrian flow in public places like plazas, parks, and large-scale event venues can help relevant departments formulate safety precautions in advance and prevent accidents such as stampedes.
[0003] Traditional pedestrian flow forecasting methods primarily rely on historical averaging, time series analysis (such as ARIMA models), and simple machine learning models (such as linear regression and decision trees). Historical averaging and simple time series analysis methods can only capture linear patterns and struggle to address the complex nonlinear relationships in pedestrian flow data caused by special events, holidays, weather changes, and other factors. Traditional machine learning models have limited expressive power when processing large-scale, high-dimensional pedestrian flow data, failing to mine deep features. They also lack online learning and adaptive updating capabilities, making them unable to adapt to real-world environmental changes caused by the opening of new lines at transportation hubs, promotional events at commercial venues, and temporary events in public spaces. This results in a decrease in forecast accuracy over time.
[0004] While deep learning technology has achieved remarkable results in data analysis and prediction, with deep neural networks capable of automatically extracting complex nonlinear features, existing deep learning-based pedestrian flow prediction methods are mostly based on offline training models and are unable to adapt to changes in data distribution in real time. When the statistical patterns of pedestrian flow data change due to external factors (such as public emergencies, traffic control, and seasonal changes), the performance of offline trained models degrades significantly. Retraining and re-deployment are time-consuming and labor-intensive, making them incapable of meeting the demands of real-time scenarios. Therefore, a pedestrian flow prediction method that can adapt to environmental changes in real time and update models online is urgently needed to improve the accuracy and timeliness of predictions. Summary of the Invention
[0005] Purpose of the Invention: To address the problems and shortcomings of existing technologies, this invention provides an online deep neural network integration method for real-time pedestrian flow prediction. This method enables the prediction system to quickly adapt to complex and changing real-world scenarios, achieving high-precision and high-responsiveness real-time pedestrian flow prediction. By designing a multi-resolution update strategy and online integration strategy, this method addresses the difficulty traditional methods have in coping with dynamic changes in data distribution, improves the model's generalization and prediction performance in diverse environments, and provides reliable decision support for pedestrian flow management and related fields.
[0006] Technical Solution: A deep neural network online ensemble method for real-time pedestrian flow prediction, comprising a multi-resolution update strategy and an online ensemble strategy. First, a deep neural network-based pedestrian flow prediction model is initialized using offline data. The model is then deployed to predict pedestrian flow while simultaneously collecting online data to update the model.
[0007] The multi-resolution update strategy is to divide the deep neural network into multiple sub-modules and use historical data of different resolutions to train different sub-modules, so that the pedestrian flow prediction capabilities of the sub-modules are diverse.
[0008] The online integration strategy is to dynamically select and combine the sub-modules that are most suitable for the current scenario according to the changes in the real-time data distribution to generate real-time prediction results.
[0009] A computer device includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the steps of the above-mentioned deep neural network online integration method for real-time pedestrian flow prediction are implemented.
[0010] A computer-readable storage medium stores a computer program for executing the deep neural network online integration method for real-time pedestrian flow prediction as described above.
[0011] Beneficial effects: The real-time pedestrian flow prediction method of the present invention has significant advantages in terms of accuracy and response speed. Through the collaboration of online integration strategy and multi-resolution update strategy, the model can quickly adapt to the dynamic changes of pedestrian flow data in complex scenarios, effectively capture nonlinear characteristics and long-term trends, provide more accurate prediction results, and reduce the computational complexity of model updates. In traffic monitoring scenarios, it can timely predict the peak and trough of passenger flow at transportation hubs, help traffic management departments to reasonably arrange transportation capacity, optimize diversion plans, reduce passenger congestion waiting time, and improve traffic operation efficiency; in the field of public safety management, it can provide early warning of crowded public places, help relevant departments formulate emergency plans, strengthen safety precautions, and reduce accident risks. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] Figure 1 This is a diagram of the overall workflow for real-time prediction of pedestrian flow data according to an embodiment of the present invention;
[0013] Figure 2 A detailed workflow diagram of offline initialization for real-time prediction of pedestrian flow data according to an embodiment of the present invention;
[0014] Figure 3 Detailed workflow diagram for online updating of real-time prediction of pedestrian flow data according to an embodiment of the present invention. DETAILED DESCRIPTION
[0015] The present invention is further illustrated below with reference to specific examples. It should be understood that these examples are only used to illustrate the present invention and are not used to limit the scope of the present invention. After reading the present invention, modifications of various equivalent forms of the present invention made by those skilled in the art all fall within the scope defined by the claims attached to this application.
[0016] This method uses an online deep neural network integration approach for real-time pedestrian flow prediction. It includes a multi-resolution update strategy and an online integration strategy. First, a deep neural network-based pedestrian flow prediction model is initialized using offline data. The model is then deployed to predict pedestrian flow while simultaneously collecting online data to update the model. Available deep neural network architectures include MLP, ResNet, UNet, LSTM, Transformer, and RWKV, or a multimodal architecture combining multiple architectures.
[0017] The multi-resolution update strategy refers to dividing the deep neural network into multiple sub-modules and using historical data of different resolutions to train different sub-modules, so that the pedestrian flow prediction capabilities of the sub-modules are diverse.
[0018] The online integration strategy refers to dynamically selecting and combining the sub-modules that best adapt to the current scenario based on changes in real-time data distribution to generate real-time prediction results.
[0019] Use offline data to initialize a pedestrian flow prediction model based on a deep neural network. The specific steps are as follows:
[0020] Step 101: Collect offline dataset for pedestrian flow prediction. in, is a d-dimensional real space, is x i The set of all possible values of x i It is a feature used to predict pedestrian flow, with a total of d dimensions, each dimension is a real value, and there are m0 data in total; i ∈{1,…,K},y i is x iThere are K types of corresponding real pedestrian flows.
[0021] Step 102: Initialize the pedestrian flow prediction model h0(x)=h(x;Φ0,W0)= using the offline dataset S0
[0022] w(φ(x;φ0);W0); model Map the d-dimensional real number features to the K-dimensional real number confidence. The category predicted by the pedestrian flow prediction model is the category corresponding to the dimension with the highest confidence. If there are multiple dimensions with the highest confidence, one of them is selected. Each model consists of two parts. It is a deep neural network model that maps the features of d-dimensional real numbers to the Hilbert space representation of d′-dimensional real numbers, where is the deep neural network parameter, with a total of n real number parameters; It is a linear classification model that maps the Hilbert space representation of d′-dimensional real numbers to the confidence of K-dimensional real numbers, where It is the linear classification model parameter, which is a d′×K real number matrix.
[0023] Step 103: Use gradient descent technology to ensure that the pedestrian flow prediction model h0 initialized in step 102 converges to the offline dataset S0 and the loss function e; where the loss function Used to measure the output h0(x i ) and the actual pedestrian flow y i The difference between them is then used to train and update Φ and W; Convergence means that for this training process Φ0, This means that for this training process, Φ0 and W0 cannot significantly reduce the average loss of the initialized prediction model h0 on the offline dataset S0. Gradient descent techniques include SGD and Adam. Available loss functions l include Logistic Loss, Sigmoid Loss, Negative Log-Likelihood, and KL Divergence.
[0024] Multi-resolution update strategy, the specific steps are:
[0025] Step 201: Divide the deep neural network into N submodules, and use mask M for the jth submodule j Indicates; mask M j ∈
[0026] {0,1} n is an n-dimensional array consisting only of 0 and 1. If M j The i-th M j [i] is 1, indicating that the j-th submodule contains the i-th real parameter of the deep neural network, otherwise it does not contain it; for each i∈{1,…,n}, ∑ j∈{1,…,N} Mj [i] = 1, which means that the L submodules should be mutually exclusive and cover all parameters of the deep neural network; appropriate division of submodules It is necessary to properly select the value of N, take N∈{4,5,6}, and appropriately allocate each submodule M j The number of parameters covered, for each j∈{1,…,N}, This means that the number of parameters covered by each submodule is roughly the same.
[0027] Step 202: Use historical data of different resolutions to train different submodules, which refers to using continuous interval I j =
[0028] [s j ,t-1] historical data training submodule j, interval I j The starting endpoint is s j , interval I j The termination endpoint is (t-1), where t is the number of times the model predicts and collects online data after the pedestrian flow prediction model is deployed online; s j The larger the value, the shorter the interval of historical data used by the jth submodule and the higher the resolution; appropriately distribute historical data The resolution refers to the resolution of the historical data used by different submodules to differentiate as much as possible. When t≥N, for each j∈{1,…,N}, or It means that the length of the interval to which the historical data used by the j-th sub-module belongs is an exponential function of j or a linear function of j.
[0029] Step 203: Diversify the pedestrian flow prediction capabilities of the submodules, which means appropriately dividing the submodules in step 201. and the appropriate allocation of historical data resolution in step 202
[0030] The online integration strategy includes the following specific steps:
[0031] Step 301: For t = {1, ..., ∞}, at the tth online deployment, according to the existing deep neural network parameters Φ t-1 and the linear classification model parameters W t-1 , deploy model h t-1 (x) = h(x; φ t-1 ,W t-1 ) is used to predict the pedestrian flow in the future, recorded as The corresponding pedestrian flow, and then collect real pedestrian flow data to form an online dataset Based on S t By updating the existing Φ t-1 and W t-1 To obtain a Φ that is more suitable for the current scene t and W t , and used for the next online deployment.
[0032] Step 302: During the t-th online deployment, according to S t Constructing deep neural network optimization objectives that do not rely on linear classification models Refers to L t It can measure whether the deep neural network is suitable for the scenario of the tth online deployment based on the change of real-time data distribution without relying on the linear classification model, and the sampling disturbance coefficient r t ~U([0,1]) refers to uniformly sampling a real number r from the interval [0,1] t , solve the gradient of the deep neural network after perturbation Among them, λ is a real parameter used to eliminate the dependence on the linear classification model; Δ t-1 is the update amount of the deep neural network generated by the online integration strategy during the t-1th online deployment. When t=1, Δ t-1 Each element of zero, t>1, Δ t-1 The specific calculation method of is as described in step 305.
[0033] Step 303: During the t-th online deployment, for each j∈{1,…,N}, calculate the submodule M j Update amount Refers to the interval I j =[s j ,t-1] and the historical gradient of the deep neural network on the submodule are used to calculate the update amount of the submodule when it is deployed online for the tth time; where Δ τ,j is the jth submodule M j The update amount during the τth online deployment, τ = s j When Δ τ,j Every element of is zero, τ>s j When Δ τ,j Calculate recursively according to step 303.
[0034] Step 304: During the t-th online deployment, for each j∈{1,…,N}, calculate the j-th submodule M j The weight of the adaptability of the scenario for the tth online deployment p t,j The larger the value, the jth submodule M j The more suitable it is for the scenario of the tth online deployment; t,j In the calculation formula, The function ω(R,C) is defined as follows,
[0035] The function ψ(R,C) is defined as follows: when R and C are both zero, ψ(R,C) = 1; when R and C are not both zero,
[0036] Step 305: Calculate the update amount of the deep neural network during the t-th online deployment And used to update the deep neural network Φ t =Φ t-1 +Δ t , refers to the dynamic selection and combination of submodules that best adapt to the current scenario, and the integration of the deep neural network parameters Φ that adapt to the scenario of the tth online deployment t ; Among them, Δ t,j ⊙M j Indicates Δ t,j and M j Multiply each element at the same position of ;
[0037] Step 306: When the tth online deployment is performed, the linear classification model W is updated. t , refers to the use of gradient descent technology to ensure W t For the online dataset S t And the loss function l and the updated deep neural network Φ t Convergence; Convergence refers to the training process Gradient descent techniques include SGD and Adam.
[0038] Take the real-time prediction of pedestrian flow in popular scenic spots as an example. Traditional pedestrian flow prediction methods, such as historical averaging method, time series analysis method and simple machine learning models, are difficult to cope with complex nonlinear relationships and environmental changes, and are difficult to predict changes in pedestrian flow caused by emergencies, and lack online learning and adaptive update capabilities. Existing pedestrian flow prediction methods based on deep learning are mostly based on offline training models, and their prediction accuracy decreases over time, and updating the model requires a lot of computing power. The present invention collaborates with multi-resolution update strategies and online integration strategies to enable the model to quickly adapt to the dynamic changes of pedestrian flow data in complex scenarios with less computing power, thereby improving prediction accuracy and response speed.
[0039] This embodiment requires using offline data to initialize a pedestrian flow prediction model based on a deep neural network. The steps are as follows: Figure 2As shown. The offline pedestrian flow data set S0 is collected. The data sources are remote sensing information, monitoring information, navigation software information, social media hot spot information and other table type, visual type, and natural language type data. According to the feature space Select a model architecture, for example, a 4-layer MLP deep neural network, a Hilbert representation space dimension d′ of 1024, and a KL Divergence loss function l. Use a gradient descent technique, such as Adam, to initialize the model h0 and ensure convergence of the model parameters Φ0 and W0.
[0040] This embodiment also requires the deep neural network to be divided into blocks and the resolution of each block to be assigned before entering the online stage, such as Figure 1 For example, the 4-layer MLP is divided into N = 4 blocks, and each layer of the 4-layer MLP becomes a submodule. When the t-th online deployment is completed, the j-th submodule M j Use the interval I to which the historical data belongs j =[s j ,t-1], where That is, the length of the interval is roughly a linear function of j.
[0041] This embodiment uses the online integration strategy to update the deep neural network model during the tth online deployment. The steps are as follows: Figure 3 As shown. At this point, the t-1th online deployment has been completed, and the model h t-1 and its parameter Φ t-1 and W t-1 Model h t-1 Give D t The prediction on the current pedestrian flow is the prediction of the current pedestrian flow. Collect the online pedestrian flow dataset S t , that is, wait until the current real pedestrian flow is observed. Based on the current online pedestrian flow dataset S t Construct a deep neural network optimization target L that does not rely on linear classification models t (Φ;λ), the historical update amount Δ of the deep neural network generated by loading the online integration strategy t-1 , sampling disturbance coefficient r t , calculate the current gradient g of the deep neural network after disturbance t For each submodule j∈{1,…,N}, load the jth submodule M j Use the historical gradient of the deep neural network after the perturbation in the interval to which the historical data belongs and the jth submodule M j Historical update volume Calculate the j-th submodule M j The current update amount Δ t,j and its weight pt,j The current update amount of the deep neural network is obtained by integration t , update the current parameters of the deep neural network Φ t . Use gradient descent technology, such as SGD, to update the linear classification model to ensure that its parameters W t Convergence. In this way, the model h is obtained t and its parameter φ t and W t , the tth online deployment can be ended and the t+1th online deployment can be started.
[0042] Obviously, those skilled in the art should understand that the various steps of the real-time prediction of pedestrian flow in popular scenic spots in the above-mentioned embodiment of the present invention can be implemented using a general-purpose computing device. They can be concentrated on a single computing device or distributed on a network composed of multiple computing devices. Alternatively, they can be implemented using program codes executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be performed in an order different from that shown here, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. In this way, the embodiments of the present invention are not limited to any specific combination of hardware and software.
Claims
1. A deep neural network online integration method for real-time pedestrian flow prediction, characterized in that: The method includes a multi-resolution update strategy and an online integration strategy. First, a pedestrian flow prediction model based on a deep neural network is initialized using offline data. Then, the model is deployed to predict pedestrian flow while collecting online data to update the model. The multi-resolution update strategy is to divide the deep neural network into multiple sub-modules and use historical data of different resolutions to train different sub-modules; The online integration strategy mentioned above refers to dynamically selecting and combining the submodules that best adapt to the current scenario based on changes in real-time data distribution to generate real-time prediction results. The offline data is used to initialize a pedestrian flow prediction model based on a deep neural network. The specific steps are as follows: Step 101: Collect offline dataset for pedestrian flow prediction. ;in, , yes dimensional real space, yes The set of all possible values of , It is a feature used to predict pedestrian flow. It has dimensions, each dimension is a real value, and the data has strip; ,yes The corresponding real pedestrian flow is kind; Step 102: Utilize offline dataset Initialize the pedestrian flow prediction model ;Model Bundle The characteristic map of the dimensional real number is The confidence of the dimension is a real number. The category predicted by the pedestrian flow prediction model is the category corresponding to the dimension with the highest confidence. If there are multiple dimensions with the highest confidence, one of them is selected. Each model consists of two parts. It is a deep neural network model. The characteristic map of the dimensional real number is dimensional real number Hilbert space representation, where is the deep neural network parameter, with a total of real number parameters; It is a linear classification model. The Hilbert space representation mapping of dimensional real numbers is dimensional real number, where is the linear classification model parameter, which is a A real matrix of ; Step 103: Use gradient descent technology to ensure that the pedestrian flow prediction model initialized in step 102 is For offline datasets and loss function Convergence; the loss function , used to measure the output of the pedestrian flow prediction model and real pedestrian traffic The difference between them is then used for training and updating and ; The multi-resolution update strategy includes the following specific steps: Step 201: Divide the deep neural network into submodules, Submodules use masks Representation; mask is an n-dimensional array consisting only of 0s and 1s. If No. Bit If it is 1, it means that the j-th submodule contains the real number parameter of the deep neural network, otherwise it does not contain it; for each , , refers to The submodules should be disjoint and cover all parameters of the deep neural network; divide the submodules Need to select The value of , and assign each submodule The number of parameters covered, for each , ; Step 202: Use historical data of different resolutions to train different submodules, which means using continuous intervals Historical data training submodules, intervals The starting endpoint is , interval The termination endpoint is ,in It is the number of times the model predicts and collects online data after the pedestrian flow prediction model is deployed online; The bigger, The shorter the interval of historical data used by each submodule, the higher the resolution; appropriately allocate historical data The resolution refers to the resolution of the historical data used by different submodules as much as possible. When, for each , or , refers to the The length of the interval to which the historical data used by each submodule belongs is about The exponential function or the A linear function of Step 203: Diversify the pedestrian flow prediction capabilities of the submodules, which means appropriately dividing the submodules in step 201. and the appropriate allocation of historical data resolution in step 202 .
2. The deep neural network online integration method for real-time pedestrian flow prediction according to claim 1 is characterized in that: The online integration strategy includes the following specific steps: Step 301: For , t is the number of times the model predicts and collects online data after the pedestrian flow prediction model is deployed online, When deployed online for the first time, according to the existing deep neural network parameters and the linear classification model parameters , deploy the model Used to predict pedestrian flow in the future, denoted as The corresponding pedestrian flow, and then collect real pedestrian flow data to form an online dataset ,based on By updating the existing and To get a more suitable one for the current scene and , and used for the next online deployment; Step 302: When deploying online for the first time, according to Constructing deep neural network optimization objectives that do not rely on linear classification models , refers to It can measure whether the deep neural network is adaptable to the changes in real-time data distribution without relying on linear classification models. Sampling disturbance coefficient in the scenario of online deployment , refers to the interval uniformly sample a real number from , solve the gradient of the deep neural network after perturbation ;in, is a real parameter used to eliminate the dependence on the linear classification model; It is The amount of updates to the deep neural network generated by the online integration strategy during the first online deployment, hour, Every element of is zero, hour, The specific calculation method of is as described in step 305; Step 303: When deploying online, for each Computing submodule Update amount , refers to the interval The historical gradient of the deep neural network on the submodule and the historical update of the submodule are calculated The amount of updates during online deployment; It is Submodules No. The amount of updates during online deployment, hour, Every element of is zero, hour, Recursively calculate according to step 303; Step 304: When deploying online, for each Calculate the Submodules For the The weight of the adaptability of the scenario during the second online deployment ; The larger the value, the Submodules The more you adapt to the The scenario of the first online deployment; In the calculation formula, , ;function The definition is as follows, ;function The definition is as follows, when and At zero time, ,when and When it is not zero at the same time, ; Step 305: Calculate the update amount of the deep neural network when deploying it online , and used to update the deep neural network , refers to the dynamic selection and combination of sub-modules that best adapt to the current scenario, and the integration is adapted to the Deep neural network parameters for the scenario of online deployment ;in, express and Multiply each element at the same position of ; Step 306: Update the linear classification model when deploying online , refers to the use of gradient descent technology to ensure For online datasets and loss function and updated deep neural network Convergence; Convergence refers to the training process .
3. The deep neural network online integration method for real-time pedestrian flow prediction according to claim 1 is characterized in that: The structures of the deep neural network models that can be selected in step 102 include MLP, ResNet, UNet, LSTM, Transformer and RWKV, or a multimodal structure composed of a combination of multiple structures.
4. The deep neural network online integration method for real-time pedestrian flow prediction according to claim 1, characterized in that: The loss function that can be selected in step 103 is Including Logistic loss function, Sigmoid loss function, negative log likelihood and KL Divergence.
5. The deep neural network online integration method for real-time pedestrian flow prediction according to claim 1 is characterized in that: The gradient descent techniques in step 103 include SGD and Adam.
6. The deep neural network online integration method for real-time pedestrian flow prediction according to claim 2 is characterized in that: The gradient descent techniques in step 306 include SGD and Adam.
7. A computer device, characterized in that: The computer device includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the steps of the deep neural network online integration method for real-time pedestrian flow prediction according to any one of claims 1 to 6 are implemented.
8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program for executing the deep neural network online integration method for real-time pedestrian flow prediction according to any one of claims 1 to 6.
Citation Information
Patent Citations
Online network flow prediction method and system based on newly increased flow number characteristics
CN113992542A
Deploying and updating machine learning models over a communication network
US20230198855A1