Macroscopic crowd simulation method, device and equipment

By constructing particles and applying smooth particle fluid dynamics physical formulas and combining with multi-export neural network model, the problems of population simulation accuracy and physical consistency are solved, and high accuracy and robustness are achieved under long-term simulation.

CN119475938AActive Publication Date: 2025-02-18CHINA UNIV OF GEOSCIENCES (WUHAN)
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202411277423.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-12
Publication Date
2025-02-18
Estimated Expiration
2044-09-12

AI Technical Summary

Technical Problem

In the long-term simulation state, the population simulation accuracy is insufficient, the neural network model is poor generalization and the physical consistency is poor.

Method used

By constructing the crowd trajectory data into particles, first motion trajectory information is calculated based on the smooth particle fluid dynamics physical formula, and a target initial multi-export neural network model including the optimal initial weight and the optimal initial deviation are constructed, and physical information is injected to enhance Physical consistency and generalization of the model.

Benefits of technology

The physical consistency, generalization and robustness of the crowd simulation model are enhanced, and the prediction loss of the model in a long-term simulation state is reduced, ensuring the accuracy of crowd simulation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119475938A_ABST
    Figure CN119475938A_ABST
Patent Text Reader

Abstract

The invention discloses a macroscopic crowd simulation method, device and equipment, relates to the technical field of crowd simulation, and can solve the technical problems of insufficient crowd simulation accuracy, poor generalization of a neural network model and poor physical consistency in a current long-time simulation state. Comprising the following steps: constructing crowd trajectory data into particles, obtaining initial crowd data of the particles at a preset initial moment and real motion trajectory information after the preset initial moment, and calculating first motion trajectory information of the particles according to the initial crowd data based on a smoothed particle fluid dynamic physical formula; and constructing a target initial multi-outlet neural network model by using a coding processing decoding architecture, and training the target initial multi-outlet neural network model by using a teacher-student collaborative distillation algorithm based on meta learning to obtain a trained multi-outlet neural network model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of crowd simulation, and in particular to a macro crowd simulation method, device and equipment. Background Art

[0002] When a large number of people gather, once an emergency occurs, it is very easy to cause crowd blocking, pushing and even trampling. In this regard, researchers have proposed a macro crowd simulation method to simulate the spatiotemporal changes of crowd states, starting from the overall situation, weakening the interaction between individuals and focusing on the overall movement of the crowd.

[0003] At present, macro-crowd simulation methods are mainly divided into two categories: numerical simulation-based methods and data-driven methods. The macro-crowd simulation method based on numerical simulation is based on physical formulas, has a strong theoretical basis and interpretability, and is closer to real pedestrian motion in terms of macro statistical indicators (such as speed-density relationship, etc.). However, due to the complexity and heterogeneity of human behavior, the generated pedestrian motion trajectory is quite different from the real pedestrian motion trajectory. The data-driven macro-crowd simulation method uses various machine learning techniques to analyze and predict crowd behavior. It is based on real-world data and can generate motion trajectories that are highly similar to real pedestrian motion by learning and reusing the features of real pedestrian motion data, with high fidelity. However, it also faces the problems of poor interpretability of black box problems, strong data dependence, and poor generalization. As the simulation time becomes longer, the prediction loss grows superlinearly. Summary of the invention

[0004] In view of this, the present invention provides a macro crowd simulation method, device and equipment, which can solve the current technical problems of insufficient crowd simulation accuracy, poor generalization of neural network models and poor physical consistency under long-term simulation conditions.

[0005] According to a first aspect of the present invention, a macro crowd simulation method is provided, the method comprising:

[0006] Constructing crowd trajectory data into particles, obtaining initial crowd data of the particles at a preset initial moment and real motion trajectory information after the preset initial moment, and calculating first motion trajectory information of the particles after the preset initial moment according to the initial crowd data based on a smooth particle fluid dynamics physics formula;

[0007] Constructing a target initial multi-outlet neural network model including an optimal initial weight and an optimal initial deviation according to the initial crowd data, the first motion trajectory information, and the real motion trajectory information, and training the target initial multi-outlet neural network model according to the initial crowd data, the real motion trajectory information, and the first motion trajectory information to obtain a trained multi-outlet neural network model;

[0008] The crowd data to be position predicted is obtained, and the multi-export neural network model is used to perform multi-export prediction on the crowd data to obtain the movement trajectory information after the moment of the crowd data.

[0009] According to a second aspect of the present invention, a macro crowd simulation device is provided, the device comprising:

[0010] An acquisition module is used to construct crowd trajectory data into particles, acquire initial crowd data of the particles at a preset initial moment and real motion trajectory information after the preset initial moment, and calculate the first motion trajectory information of the particles after the preset initial moment according to the initial crowd data based on the smooth particle fluid dynamics physics formula;

[0011] A training module, used to construct a target initial multi-outlet neural network model including an optimal initial weight and an optimal initial deviation according to the initial crowd data, the first motion trajectory information and the real motion trajectory information, and train the target initial multi-outlet neural network model according to the initial crowd data, the real motion trajectory information and the first motion trajectory information to obtain a trained multi-outlet neural network model;

[0012] The prediction module is used to obtain the crowd data to be predicted, and use the multi-export neural network model to perform multi-export prediction on the crowd data to obtain the movement trajectory information after the moment when the crowd data is located.

[0013] According to a third aspect of the present application, a storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the above-mentioned macro-crowd simulation method is implemented.

[0014] According to a fourth aspect of the present application, a computer device is provided, comprising a storage medium, a processor, and a computer program stored on the storage medium and executable on the processor, wherein the processor implements the above-mentioned macroscopic population simulation method when executing the program.

[0015] By means of the above technical scheme, the present invention provides a macro crowd simulation method, device and equipment. First, crowd trajectory data is constructed into particles, and the initial crowd data of the particles at a preset initial moment and the real motion trajectory information after the preset initial moment are obtained. Based on the smooth particle fluid dynamics physics formula, the first motion trajectory information of the particles after the preset initial moment is calculated according to the initial crowd data; then, a target initial multi-outlet neural network model including an optimal initial weight and an optimal initial deviation is constructed according to the initial crowd data, the first motion trajectory information and the real motion trajectory information, and the target initial multi-outlet neural network model is trained according to the initial crowd data, the real motion trajectory information and the first motion trajectory information to obtain a trained multi-outlet neural network model; finally, crowd data to be predicted for position is obtained, and the multi-outlet neural network model is used to perform multi-outlet prediction on the crowd data to obtain the motion trajectory information after the moment when the crowd data is located. Through the technical solution of the present invention, the first motion trajectory information calculated based on the smooth particle fluid dynamics physical formula is physical information, and the physical information is injected into the target initial multi-outlet neural network model, so that the model follows the laws of physics, enhances the physical consistency, generalization and robustness of the crowd simulation model, reduces the prediction loss of the model under long-term simulation conditions, ensures the accuracy of crowd simulation under long-term and high-density crowd simulation conditions, and the initial parameters of the target initial multi-outlet neural network model are the optimal initial weights and the optimal initial deviations, which can accelerate the loss convergence of the model.

[0016] The above description is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention, it can be implemented according to the contents of the specification. In order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are listed below. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation on the local application. In the drawings:

[0018] Figure 1 A schematic diagram of a process flow of a macro crowd simulation method provided by an embodiment of the present invention is shown;

[0019] Figure 2 A schematic flow chart of another macro crowd simulation method provided by an embodiment of the present invention is shown;

[0020] Figure 3 A schematic structural diagram of a macro crowd simulation device provided by an embodiment of the present invention is shown;

[0021] Figure 4 A schematic structural diagram of another macro crowd simulation device provided by an embodiment of the present invention is shown. DETAILED DESCRIPTION

[0022] The present invention will be described in detail below with reference to the accompanying drawings and in combination with embodiments. It should be noted that the embodiments and features in the embodiments of the present invention can be combined with each other without conflict.

[0023] This embodiment provides a macro crowd simulation method, such as Figure 1 As shown, the method includes:

[0024] 101. Construct crowd trajectory data into particles, obtain initial crowd data of the particles at a preset initial moment and real motion trajectory information after the preset initial moment, and calculate the first motion trajectory information of the particles after the preset initial moment based on the smooth particle fluid dynamics physics formula and the initial crowd data.

[0025] Among them, each point of the crowd trajectory data is regarded as a particle. Both the initial crowd data at the preset initial moment and the real motion trajectory information after the preset initial moment are historical data and can be directly obtained. The first motion trajectory information is calculated according to the initial crowd data based on the physical formula of smooth particle fluid dynamics. The initial crowd data at the preset initial moment is data at one moment, the real motion trajectory information after the preset initial moment is data at multiple moments, and the first motion trajectory information after the preset moment is also data at multiple moments.

[0026] The smoothed particle fluid dynamics physics formulation discretizes pedestrian flow into a finite number of non-connected discrete elements (particles), and is a simulation method in which particles move according to the forces caused by differences in density and velocity.

[0027] The initial crowd data includes the coordinates, velocity, acceleration, etc. of each particle at a preset initial moment, the real motion trajectory information includes the coordinates, velocity, acceleration, etc. of each particle at each moment after the preset initial moment, and the first motion trajectory information includes the coordinates, velocity, acceleration, etc. of each particle at each moment after the preset initial moment, wherein each moment corresponding to the real motion trajectory information is equal to each moment corresponding to the first motion trajectory information.

[0028] It should be noted that the real motion trajectory information is real information, and the first motion trajectory information is physical information calculated by the physical formula of smooth particle fluid dynamics. The real information and the physical information are used together as constraints for the initial population data training model to make the trained model close to reality while conforming to the laws of physics, thereby improving the prediction accuracy of the model.

[0029] 102. Construct a target initial multi-outlet neural network model including optimal initial weights and optimal initial deviations according to the initial crowd data, the first motion trajectory information, and the actual motion trajectory information; train the target initial multi-outlet neural network model according to the initial crowd data, the actual motion trajectory information, and the first motion trajectory information to obtain a trained multi-outlet neural network model.

[0030] It should be noted that the model to be trained is the target initial multi-outlet neural network model. Before training it, its structure is first constructed to obtain its optimal initial parameters (the optimal initial parameters do not include the optimal initial weights and the optimal initial deviations), thereby constructing the target initial multi-outlet neural network model, and then training it.

[0031] For this embodiment, as an implementation method, the real motion trajectory information is used as a constraint, and the first motion trajectory information is also used as another constraint to jointly train the target initial multi-export neural network model.

[0032] 103. Acquire crowd data for which position prediction is to be performed, perform multi-export prediction on the crowd data using the multi-export neural network model, and obtain movement trajectory information after the time when the crowd data is located.

[0033] After the trained multi-export neural network model is obtained in step 102 of the embodiment, the multi-export neural network model can be directly applied. Specifically, crowd data to be predicted for position at the time when the crowd data is located is obtained.

[0034] The multi-export neural network model is used to predict the crowd data, and the coordinates of each target particle at each target moment after the crowd data are obtained, thereby simulating the movement trajectory information of the crowd.

[0035] The present invention provides a macro crowd simulation method, device and equipment. First, crowd trajectory data is constructed into particles, and the initial crowd data of the particles at a preset initial moment and the real motion trajectory information after the preset initial moment are obtained. Based on the smooth particle fluid dynamics physics formula, the first motion trajectory information of the particles after the preset initial moment is calculated according to the initial crowd data; then, a target initial multi-outlet neural network model including an optimal initial weight and an optimal initial deviation is constructed according to the initial crowd data, the first motion trajectory information and the real motion trajectory information, and the target initial multi-outlet neural network model is trained according to the initial crowd data, the real motion trajectory information and the first motion trajectory information to obtain a trained multi-outlet neural network model; finally, crowd data to be predicted for position is obtained, and the multi-outlet neural network model is used to perform multi-outlet prediction on the crowd data to obtain the motion trajectory information after the moment when the crowd data is located. Through the technical solution of the present invention, the first motion trajectory information calculated based on the smooth particle fluid dynamics physical formula is physical information, and the physical information is injected into the target initial multi-outlet neural network model, so that the model follows the laws of physics, enhances the physical consistency, generalization and robustness of the crowd simulation model, reduces the prediction loss of the model under long-term simulation conditions, ensures the accuracy of crowd simulation under long-term and high-density crowd simulation conditions, and the initial parameters of the target initial multi-outlet neural network model are the optimal initial weights and the optimal initial deviations, which can accelerate the loss convergence of the model.

[0036] Further, as a refinement and extension of the specific implementation of the above embodiment, in order to fully illustrate the specific implementation process of this embodiment, another macro crowd simulation method is provided, such as Figure 2 As shown, the method includes:

[0037] 201. Construct crowd trajectory data into particles, and obtain initial crowd data of the particles at a preset initial moment and real motion trajectory information after the preset initial moment.

[0038] For this embodiment, the specific implementation is the same as step 101 of the embodiment, and will not be repeated here.

[0039] 202. For each of the particles, obtain, according to the initial population data, a first coordinate of the particle, a first other particle within a smooth core radius of the particle, a second coordinate of the first other particle, and a mass of the first other particle.

[0040] Where i represents a particle, j represents the first other particle of particle i within the smooth core radius h, and the first coordinate x of particle i is obtained. i , get the second coordinate x of the first other particle j j, get the mass m of the first other particle j j .

[0041] 203. Based on a smooth particle fluid dynamics physics formula, calculate a first density of the particle according to the smooth core radius, the first coordinate, the second coordinate, and the mass.

[0042] For the embodiment steps 202-205, based on the smoothed particle hydrodynamics (SPH) physical formula, the smoothed particle hydrodynamics physical formula is improved with the dynamic individual static density, and the first motion trajectory information calculated by it is used as the physical information, wherein the smoothed particle hydrodynamics (SPH) physical formula is: the pedestrian flow is discretized into a finite number of non-connected discrete elements (particles), which is a simulation method for particles to move according to the force caused by density and speed differences.

[0043] Calculate the first density ρ of the particle i The formula is as follows:

[0044]

[0045] Where N is the total number of the first other particles j, W is the smooth kernel function, which is a weight function that usually decreases with the length of its parameter r, which ensures that particles farther away have less impact on the amount of calculation. h is the support radius of W, if r ≥ h, then W(r,h) = 0.

[0046] 204. Calculate a first dynamic personal static density of the particle according to the first density, and determine a second dynamic personal static density of the first other particle according to the first dynamic personal static density.

[0047] It should be noted that the dynamic individual static density refers to a dynamic threshold of the surrounding crowd density that each particle can accept in the crowd simulation. This density threshold is not fixed, but can be adjusted according to environmental conditions and particle behavior.

[0048] For this embodiment, since what is simulated is not a fluid with fixed physical properties, but a crowd of conscious individuals, the crowd will be affected by changes in the surrounding environment. Therefore, each particle is given a dynamic personal static density that changes with time instead of the density calculated based on step 203 of the embodiment that will not adapt to environmental changes, and the pressure and permeability of step 205 of the embodiment are both calculated based on the dynamic personal static density, making the improved smooth particle fluid dynamics physics formula more suitable for the crowd.

[0049] This dynamic individual static density is calculated based on the surrounding density perceived by the agent within a certain time window. The first dynamic individual static density is calculated using the following formula:

[0050]

[0051] Calculate the second dynamic individual static density, the formula is as follows:

[0052]

[0053] is the first dynamic individual static density, is the second dynamic individual static density, T ρ is a large period of time, and Δt is the time interval within the large period of time.

[0054] 205. Calculate first motion trajectory information of the particle after the preset initial moment according to the first dynamic individual static density and the second dynamic individual static density.

[0055] For this embodiment, the first motion trajectory information of the particle after the preset initial moment is calculated according to the first dynamic personal static density and the second dynamic personal static density, including: calculating the first pressure of the particle according to the first dynamic personal static density, calculating the penetration force of the particle according to the first dynamic personal static density, the second dynamic personal static density, the mass, the first coordinate, the second coordinate and the smooth core radius; calculating the second pressure of the first other particle according to the second dynamic personal static density;

[0056] The formula for calculating the first pressure is:

[0057] The formula for calculating the second pressure is:

[0058] where k is a constant (traditionally a physical gas constant that depends on temperature), and ρ 0 is the static density that the simulated material attempts to achieve, is the first dynamic individual static density, It is the second dynamic personal static density.

[0059] The formula for calculating penetration is:

[0060] Among them, ξ is the permeability factor, μ i represents the penetration force vector, and N is the total number of the first other particles j.

[0061] Calculating the acceleration of the particle according to the navigation item of the particle, the artificial viscosity item, the boundary force generated by the obstacle corresponding to the particle, the mass, the first pressure, the first dynamic personal static density, the second pressure, the second dynamic personal static density, the penetration force, the first coordinate, the second coordinate and the smooth core radius;

[0062] The particle's navigation item ∈ i , artificial viscosity term Π ij , the boundary force B generated by the obstacle corresponding to the particle i The calculations of are all existing technologies, and all three are irrelevant to dynamic personal static density, so they will not be elaborated here.

[0063] Calculate the particle's acceleration a i The formula is as follows:

[0064]

[0065] in, Represents the gradient.

[0066] A first predicted coordinate of the particle at a first predicted time is obtained according to the acceleration, and a second predicted coordinate of the particle at a second predicted time is continuously calculated according to the first predicted coordinate until an end point is reached, thereby obtaining first motion trajectory information of the particle after the preset initial time.

[0067] Among them, the first motion trajectory information after the preset initial moment includes the first predicted coordinates, the first velocity, and the first acceleration at the first to-be-predicted moment after the preset initial moment; the second predicted coordinates, the second velocity, and the second acceleration at the second to-be-predicted moment; ... the last predicted coordinates, the last velocity, and the last acceleration at the last to-be-predicted moment; mathematically integrating the acceleration (i.e., the first acceleration) over time can obtain the first predicted coordinates of the particle at the first to-be-predicted moment, and repeating the process of steps 202-205 of the embodiment according to the first predicted coordinates to obtain the second predicted coordinates at the second to-be-predicted moment, until reaching the end point to obtain the last predicted coordinates at the last to-be-predicted moment, and the predicted coordinates, velocity, and acceleration at each to-be-predicted moment together constitute the first motion trajectory information of the particle after the preset initial moment.

[0068] 206. Construct a target initial multi-exit neural network model including an optimal initial weight and an optimal initial deviation according to the initial crowd data, the first motion trajectory information, and the actual motion trajectory information.

[0069] For this embodiment, the target initial multi-outlet neural network model including optimal initial weights and optimal initial deviations is constructed according to the initial crowd data, the first motion trajectory information and the real motion trajectory information, including: constructing the initial multi-outlet neural network model using an encoder, a processor and a decoder; creating a solution space including initial weights and initial deviations using the Harris Hawk algorithm, training the initial multi-outlet neural network model using the initial crowd data by simulating the hunting process of the Harris Hawk to obtain a first prediction result, calculating a first loss according to the first prediction result and the real motion trajectory information, and calculating a second loss according to the first prediction result and the first motion trajectory information, iterating the training until a preset stop condition is reached, and obtaining the optimal initial weights and the optimal initial deviations in the solution space; determining the initial multi-outlet neural network model including the optimal initial weights and the optimal initial deviations as the target initial multi-outlet neural network model.

[0070] Among them, the encoder is a multi-layer perceptron, the processor is a multi-layer perceptron with residual, and the decoder is a multi-layer perceptron, thereby forming an initial multi-output neural network model.

[0071] Among them, the Harris Hawk algorithm is an improved Harris Hawks optimization algorithm (HHO) based on the concept of external archive, which is used to optimize the weights and biases of multilayer perceptron (MLP) neural networks. The algorithm enhances the search process of HHO by retaining the archive of the best solution in each iteration, so that these best solutions can be used in future iterations. According to the Harris Hawk algorithm, a solution space of size HIS×N is randomly generated, and each solution represents a set of initial weights and initial biases. Then, the K value (K=HIS*archive rate) is calculated according to the archive rate and HIS, and an external archive of size K×N is constructed. The first run is all randomly generated. Except for the first run, other runs select K solutions from the external archive to fill the solution space, and the remaining solutions are randomly generated. Two techniques are used to search for prey in the solution space: one is to use the help of family members, and the other is to observe from a high tree and judge whether to attack and capture the prey according to the energy value of the prey. If |E|≥1, continue searching, otherwise capture, attack and capture the prey found in the search stage. The predation process selects different strategies according to the energy of the prey, including four strategies: soft encirclement, hard encirclement, soft encirclement accompanied by rapid dive, and hard encirclement accompanied by rapid dive. The iterative operation is performed a preset number of times, and the Harris Eagle algorithm is used to cyclically optimize all solutions in the solution space. Then, each group of solutions (a group of initial weights and initial deviations) is substituted into the model for prediction to obtain a first prediction result. Then, if the optimal weight and optimal deviation of the student model in step 207 of the embodiment are to be found, the first loss is calculated according to the first prediction result and the actual motion trajectory information, and the solutions are sorted according to the first loss, and the k solutions with the smallest loss are selected and released into the archive for the next operation; if the optimal weight and optimal deviation of the teacher model in step 207 of the embodiment are to be found, the second loss is calculated according to the first prediction result and the first motion trajectory information, and the solutions are sorted according to the second loss, and the k solutions with the smallest loss are selected and released into the archive for the next operation.

[0072] The method of using the initial crowd data to train the initial multi-export neural network model to obtain a first prediction result includes: constructing the initial crowd data into a grid, and using the encoder to encode the grid into an initial graph structure; for each particle, filtering the initial graph structure according to a neighbor list to obtain a target graph structure corresponding to the particle, wherein the target graph structure includes a target edge set and a target node set; using the processor to pass messages along the target edge set to obtain updated node features and updated edge features in each round, using each N rounds of message passing as a message block MessageBlock, and using the decoder to predict the position of the message block to obtain a second prediction result, until a preset number of rounds are completed, and weighted summing the second prediction results to obtain a first prediction result.

[0073] The initial crowd data is constructed into a grid, and the encoder is used to encode the grid into an initial graph structure to facilitate subsequent message transmission. Specifically, each particle is {P1, P2, P3...P n}, the corresponding first coordinate is {(x1,y1), (x2,y2), (x3,y3)...(x n ,y n )}, use the encoder to encode into the initial graph structure: mesh =<V,E> ,in:

[0074] (1) V is a set of nodes, each of which represents a two-dimensional coordinate point in space.

[0075] (2) E is the edge set, which is the line segment connecting two nodes and defines the adjacency relationship between the nodes.

[0076] Among them, since for each particle, if all other particles are used to predict its position, the amount of calculation is large, therefore, for this embodiment, all second other particles within a preset distance from the particle are included in the neighbor list, and particles that do not belong to the neighbor list are ignored when predicting the position of the particle, thereby reducing the amount of calculation and improving efficiency, wherein the preset distance can be greater than or equal to the smooth kernel radius.

[0077] The initial graph structure is screened using the neighbor list, and the nodes and edges of the particle outside the neighbor list are ignored, thereby obtaining the target graph structure corresponding to the particle. When predicting the position of the particle, only the target node set and target edge set in the target graph structure are considered. Using the neighbor list to decouple the particle set can effectively reduce the number and complexity of input parameters of the neural network in large-scale crowd simulation.

[0078] In the processing-decoding stage, multiple outlets {E1, E2, E3...En} are constructed. After each N rounds of message passing, a second prediction result is obtained through the decoder and used as the output of one outlet until the preset number of rounds is completed and all outlets have completed the output. The second prediction results of all outlets are weighted summed to obtain the first prediction result. Multiple rounds of message passing are performed to gradually integrate local messages so that each particle can fully grasp the information of all other second particles in its neighbor list, thereby enhancing the robustness of the model.

[0079] G E (e is , v i ,v s )→e′ is

[0080] G V (v i ,∑e′ is )→v′ i

[0081] Among them, G E , G V are multilayer perceptrons with residuals, used for edge embedding and node updating, respectively, e ij ∈E represents the target edge connecting the target node, v i ∈V represents the target node, the subscript s represents the second other particle in the neighbor list of particle i, and e′ is represents the updated edge obtained by N rounds of message passing, v′ i Represents the updated node obtained by N rounds of message passing.

[0082] Among them, the second prediction result corresponding to the exit {E1, E2, E3...En} is {P1, P2, P3...Pn}, and the first prediction result is:

[0083]

[0084] w i is the weight corresponding to the export.

[0085] 207. Train the target initial multi-outlet neural network model according to the initial crowd data, the real motion trajectory information, and the first motion trajectory information to obtain a trained multi-outlet neural network model.

[0086] The step of training the target initial multi-export neural network model according to the initial crowd data, the real motion trajectory information and the first motion trajectory information to obtain a trained multi-export neural network model includes: (1) constructing a teacher model and a student model corresponding to the target initial multi-export neural network model, wherein the optimal initial weights and the optimal initial deviations of the teacher model and the student model are different, the number of layers of the teacher model is deeper than the number of layers of the student model, and the dimension of the teacher model is wider than the dimension of the student model;

[0087] It should be noted that both the teacher model and the student model are target initial multi-export neural network models. The teacher model has a deeper network layer and a wider dimension, while the student model has a shallower network layer and a narrower dimension. By training a lightweight student model through knowledge distillation, the model complexity can be reduced, the crowd simulation accuracy under long-term simulation and high-density crowd scenes can be improved, and the control pressure of high-density crowd areas can be alleviated when disasters occur.

[0088] (2) Constructing a replica model of the student model; that is, the replica model is exactly the same as the student model.

[0089] (3) performing knowledge distillation on the replica model according to the initial crowd data, the real motion trajectory information, the first motion trajectory information, and the teacher model to obtain an updated replica model;

[0090] Wherein, performing knowledge distillation on the copy model according to the initial crowd data, the real motion trajectory information, the first motion trajectory information and the teacher model to obtain the updated copy model includes: predicting the initial crowd data according to the teacher model and the copy model respectively, correspondingly obtaining the third prediction result and the fourth prediction result of each exit, calculating the first teacher distillation loss according to the third prediction result and the fourth prediction result, calculating the first prediction loss according to the fourth prediction result and the real motion trajectory information, and calculating the second prediction loss according to the fourth prediction result and the first motion trajectory information;

[0091] Since both the teacher model and the copy model are target multi-export neural network models, the initial population data is predicted according to the teacher model to obtain the third prediction results of each exit, and the initial population data is predicted according to the copy model to obtain the fourth prediction results of each exit. The prediction process is the same as the above-mentioned second prediction result and will not be repeated here.

[0092] The formula for calculating the first teacher distillation loss according to the third prediction result and the fourth prediction result is:

[0093]

[0094] Among them, y t1 is the third prediction result of the teacher model for the i-th exit, y s1 is the fourth prediction result of the i-th outlet obtained by the replication model, n is the number of outlets, and w i is the weight corresponding to the export.

[0095] The formula for calculating the first prediction loss according to the fourth prediction result and the real motion trajectory information is:

[0096]

[0097] Among them, y i真 is the real position of the particle in the real motion trajectory information, y i1 is the fourth prediction result of the i-th export of the replication model, n is the number of exports, and w i is the weight corresponding to the export.

[0098] The formula for calculating the second prediction loss according to the fourth prediction result and the first motion trajectory information is:

[0099]

[0100] Among them, y i物 is the position of the particle calculated by the smooth particle fluid dynamics physics formula in the first motion trajectory information, y s1 is the fourth prediction result of the i-th export of the replication model, n is the number of exports, and w i is the weight corresponding to the export.

[0101] For updating the weights and biases of the replication model according to the first teacher distillation loss, the first prediction loss, and the second prediction loss, an updated replication model is obtained:

[0102] The first teacher distillation loss, the first prediction loss, and the second prediction loss are weighted and summed to obtain a loss value. The weights and biases are modified using back propagation to reduce the loss value, and the weights and biases at this time are obtained, thereby obtaining the updated copy model.

[0103] (4) providing feedback to the teacher model according to the initial crowd data, the real motion trajectory information, the first motion trajectory information, and the updated replication model to obtain an updated teacher model to improve the teaching ability of the teacher model;

[0104] The step of performing knowledge distillation on the teacher model according to the initial crowd data, the real motion trajectory information, the first motion trajectory information and the updated copy model to obtain the updated teacher model comprises: selecting samples from the initial crowd data, predicting the samples according to the updated copy model to obtain fifth prediction results of each exit, calculating a third prediction loss according to the fifth prediction result and the first motion trajectory information, and updating the weight and bias of the teacher model according to the third prediction loss to obtain the updated teacher model;

[0105] The sample is part of the data selected from the initial population data. The sample is predicted according to the updated replication model to obtain the fifth prediction result of each exit. The prediction process is the same as the above-mentioned second prediction result, which will not be repeated here.

[0106] The formula for calculating the third prediction loss according to the fifth prediction result and the first motion trajectory information is as follows:

[0107]

[0108] Among them, y i物 is the position of the particle calculated by the smooth particle fluid dynamics physics formula in the first motion trajectory information, y s2 is the fifth prediction result of the updated replication model for the ith exit, n is the number of exits, and wi is the weight corresponding to the export.

[0109] The weights and biases of the teacher model are updated according to the third prediction loss to obtain an updated teacher model.

[0110] Back propagation is used to modify the weights and biases to reduce the third prediction loss, and the weights and biases at this time are obtained, thereby obtaining the updated teacher model.

[0111] (5) Performing knowledge distillation on the student model according to the initial crowd data, the real motion trajectory information, the first motion trajectory information, and the updated teacher model to obtain a trained multi-export neural network model.

[0112] Among them, the knowledge distillation of the student model according to the initial crowd data, the real motion trajectory information, the first motion trajectory information and the updated teacher model to obtain a trained multi-export neural network model includes: predicting the initial crowd data according to the updated teacher model and the student model respectively, and obtaining the sixth prediction result and the seventh prediction result of each exit accordingly, calculating the second teacher distillation loss according to the sixth prediction result and the seventh prediction result, calculating the fourth prediction loss according to the seventh prediction result and the real motion trajectory information, calculating the fifth prediction loss according to the seventh prediction result and the first motion trajectory information, calculating the total self-distillation loss according to the seventh prediction result, calculating the total loss according to the second teacher distillation loss, the fourth prediction loss, the fifth prediction loss and the total self-distillation loss, updating the weights and bias of the student model according to the total loss, and obtaining a trained multi-export neural network model.

[0113] The initial population data is predicted according to the updated teacher model to obtain the sixth prediction result of each exit. The initial population data is predicted according to the student model to obtain the seventh prediction result of each exit. The prediction process is the same as the above-mentioned second prediction result, which will not be repeated here.

[0114] The formula for calculating the second teacher distillation loss according to the sixth prediction result and the seventh prediction result is as follows:

[0115]

[0116] Among them, y t3 is the sixth prediction result of the updated teacher model for the i-th exit, y s3 is the seventh prediction result of the student model for the i-th outlet, n is the number of outlets, and w i is the weight corresponding to the export.

[0117] The formula for calculating the fourth prediction loss according to the seventh prediction result and the real motion trajectory information is as follows:

[0118]

[0119] Among them, y i真 is the real position of the particle in the real motion trajectory information, y s3 is the seventh prediction result of the student model for the i-th exit, n is the number of exits, and w i is the weight corresponding to the export.

[0120] The formula for calculating the fifth prediction loss according to the seventh prediction result and the first motion trajectory information is as follows:

[0121]

[0122] Among them, y i物 is the position of the particle calculated by the smooth particle fluid dynamics physics formula in the first motion trajectory information, y s3 is the seventh prediction result of the student model for the i-th exit, n is the number of exits, and w i is the weight corresponding to the export.

[0123] The formula for calculating the total self-distillation loss according to the seventh prediction result is as follows:

[0124]

[0125] Among them, y i is the seventh prediction result of the i-th level exit of the student model, y L is the seventh prediction result of the L-th layer exit of the student model, where L is the previous layer of layer i, SELoss i is the self-distillation loss at the L-th layer outlet, n is the number of outlets, and w i is the weight corresponding to the export.

[0126] The total self-distillation loss function is as follows:

[0127]

[0128] The formula for calculating the total loss according to the second teacher distillation loss TSLoss2, the fourth prediction loss TPLoss4, the fifth prediction loss TPLoss5 and the total self-distillation loss SELoss is as follows:

[0129] Among them, the fourth prediction loss and the fifth prediction loss are weighted and summed to obtain TPLoss.

[0130] TotalLoss=α*TSLoss3+β*SELoss+γ*TPLoss

[0131] α, β, γ∈(0,1), and α+β+γ=1.

[0132] The weights and biases of the student model are updated according to the total loss to obtain a trained multi-export neural network model.

[0133] Back propagation is used to modify the weights and biases to reduce the total loss value, and the weights and biases at this time are obtained, thereby obtaining the updated student model, that is, the trained multi-export neural network model.

[0134] In summary, when calculating the prediction loss, both the real position of the particles in the real motion trajectory information is used as a constraint to calculate the prediction loss, and the position calculated by the smooth particle fluid dynamics physics formula of the particles in the first motion trajectory information is used as a constraint to calculate the prediction loss. This not only makes the model train in the direction of real data, but also makes the model train in the direction of physical data, obeys the laws of physics, can efficiently and accurately solve high-dimensional and complex scientific computing problems, enhance the physical consistency, robustness and generalization of macro crowd simulation, and ensure the accuracy of crowd simulation under long-term simulation state.

[0135] 208. Acquire crowd data for which position prediction is to be performed, perform multi-export prediction on the crowd data using the multi-export neural network model, and obtain movement trajectory information after the time when the crowd data is located.

[0136] This embodiment is the same as step 103 in the embodiment, and will not be described again.

[0137] In summary, firstly, the smooth particle fluid dynamics physics formula is used to construct the crowd trajectory data into particles, and the first motion trajectory information is generated by combining the dynamic individual static density and the smooth particle fluid dynamics physics formula. Then, an initial multi-export neural network model based on the mesh graph structure is constructed using the encoding-processing-decoding architecture, and the initial multi-export neural network model is iteratively trained using the Harris Eagle algorithm to find the optimal initial weights and the optimal initial deviations, and the target initial multi-export neural network model is obtained. Then, the first motion trajectory information is divided into batches using the neighbor list, and it is injected into the target initial multi-export neural network model as physical information for model training. After each N rounds of message transmission, a message block MessageBlock is obtained, and the decoder is used to predict the position of the message block as the output of an outlet, thereby obtaining the output of multiple outlets. Local messages are gradually integrated through multiple message blocks MessageBlock, so that each node can fully grasp the information of all nodes in its neighbor list. Finally, based on meta-learning multi-objective teacher-student collaborative distillation, the teacher model and the student model are constructed. The two models have the same structure, but the teacher model has a deeper network layer and a wider dimension, while the student model has a shallower network layer and a narrower dimension. During the distillation process, a teacher distillation loss function is designed to help the student model learn from the teacher model. At the same time, a self-distillation loss function is designed, using a deep MessageBlock to distill a shallow MessageBlock to help the student model learn by itself. The node messages are gradually integrated from the local to the entire neighbor list. A prediction loss function is also designed to help the student model's predictions be closer to the actual situation and make the simulation more realistic. This has strong robustness, generalization, and physical consistency, and can be combined with knowledge distillation to train a relatively lightweight model, which reduces the complexity of the model to a certain extent, while ensuring the accuracy of the crowd simulation model under long-term simulation.

[0138] The present invention provides a macro crowd simulation method, device and equipment. First, crowd trajectory data is constructed into particles, and the initial crowd data of the particles at a preset initial moment and the real motion trajectory information after the preset initial moment are obtained. Based on the smooth particle fluid dynamics physics formula, the first motion trajectory information of the particles after the preset initial moment is calculated according to the initial crowd data; then, a target initial multi-outlet neural network model including an optimal initial weight and an optimal initial deviation is constructed according to the initial crowd data, the first motion trajectory information and the real motion trajectory information, and the target initial multi-outlet neural network model is trained according to the initial crowd data, the real motion trajectory information and the first motion trajectory information to obtain a trained multi-outlet neural network model; finally, crowd data to be predicted for position is obtained, and the multi-outlet neural network model is used to perform multi-outlet prediction on the crowd data to obtain the motion trajectory information after the moment when the crowd data is located. Through the technical solution of the present invention, the first motion trajectory information calculated based on the smooth particle fluid dynamics physical formula is physical information, and the physical information is injected into the target initial multi-outlet neural network model, so that the model follows the laws of physics, enhances the physical consistency, generalization and robustness of the crowd simulation model, reduces the prediction loss of the model under long-term simulation conditions, ensures the accuracy of crowd simulation under long-term and high-density crowd simulation conditions, and the initial parameters of the target initial multi-outlet neural network model are the optimal initial weights and the optimal initial deviations, which can accelerate the loss convergence of the model.

[0139] Further, as Figure 1 and Figure 2 The specific implementation of the method shown in the figure, the embodiment of the present invention provides a macro crowd simulation device, such as Figure 3 As shown, the device includes: an acquisition module 31, a training module 32, and a prediction module 33;

[0140] An acquisition module 31 is used to construct crowd trajectory data into particles, acquire initial crowd data of the particles at a preset initial moment and real motion trajectory information after the preset initial moment, and calculate the first motion trajectory information of the particles after the preset initial moment according to the initial crowd data based on the smooth particle fluid dynamics physics formula;

[0141] A training module 32 is used to construct a target initial multi-outlet neural network model including an optimal initial weight and an optimal initial deviation according to the initial crowd data, the first motion trajectory information and the real motion trajectory information, and train the target initial multi-outlet neural network model according to the initial crowd data, the real motion trajectory information and the first motion trajectory information to obtain a trained multi-outlet neural network model;

[0142] The prediction module 33 is used to obtain crowd data for which position prediction is to be performed, and to perform multi-export prediction on the crowd data using the multi-export neural network model to obtain movement trajectory information after the time when the crowd data is located.

[0143] Accordingly, in order to calculate the first motion trajectory information of the particle after the preset initial moment according to the initial crowd data based on the smooth particle fluid dynamics physical formula, the acquisition module 31 may specifically include: a first calculation unit 311 and a second calculation unit 312;

[0144] The first calculation unit 311 can be specifically used to obtain, for each particle, the first coordinate of the particle, the first other particle of the particle within the smooth core radius, the second coordinate of the first other particle, and the mass of the first other particle according to the initial population data; calculate the first density of the particle according to the smooth core radius, the first coordinate, the second coordinate, and the mass based on the smooth particle fluid dynamics physics formula; calculate the first dynamic personal static density of the particle according to the first density; determine the second dynamic personal static density of the first other particle according to the first dynamic personal static density;

[0145] The second calculation unit 312 may be specifically configured to calculate first motion trajectory information of the particle after the preset initial moment according to the first dynamic individual static density and the second dynamic individual static density.

[0146] Correspondingly, in order to calculate the first motion trajectory information of the particle after the preset initial moment according to the first dynamic personal static density and the second dynamic personal static density, the second calculation unit 312 can also be used to calculate the first pressure of the particle according to the first dynamic personal static density, calculate the penetration force of the particle according to the first dynamic personal static density, the second dynamic personal static density, the mass, the first coordinate, the second coordinate and the smooth core radius; calculate the second pressure of the first other particle according to the second dynamic personal static density; calculate the acceleration of the particle according to the navigation item of the particle, the artificial viscosity item, the boundary force generated by the obstacle corresponding to the particle, the mass, the first pressure, the first dynamic personal static density, the second pressure, the second dynamic personal static density, the penetration force, the first coordinate, the second coordinate and the smooth core radius; obtain the first predicted coordinate of the particle at the first moment to be predicted according to the acceleration, and continue to calculate the second predicted coordinate of the particle at the second moment to be predicted according to the first predicted coordinate until the end point is reached, so as to obtain the first motion trajectory information of the particle after the preset initial moment.

[0147] Accordingly, in order to construct a target initial multi-outlet neural network model including optimal initial weights and optimal initial deviations according to the initial crowd data, the first motion trajectory information and the actual motion trajectory information, the training module 32 can be specifically used to construct an initial multi-outlet neural network model using an encoder, a processor and a decoder; use the Harris Hawk algorithm to create a solution space including initial weights and initial deviations, and train the initial multi-outlet neural network model using the initial crowd data by simulating the hunting process of the Harris Hawk to obtain a first prediction result, calculate a first loss based on the first prediction result and the actual motion trajectory information, and calculate a second loss based on the first prediction result and the first motion trajectory information, iterate the training until a preset stop condition is reached, and obtain the optimal initial weights and optimal initial deviations in the solution space; determine the initial multi-outlet neural network model including the optimal initial weights and the optimal initial deviations as the target initial multi-outlet neural network model.

[0148] Accordingly, in order to use the initial population data to train the initial multi-export neural network model to obtain a first prediction result, the training module 32 can be specifically used to construct the initial population data into a grid, and use the encoder to encode the grid into an initial graph structure; for each particle, the initial graph structure is filtered according to the neighbor list to obtain a target graph structure corresponding to the particle, wherein the target graph structure includes a target edge set and a target node set; the processor is used to pass messages along the target edge set to obtain updated node features and updated edge features in each round, and every N rounds of message passing is used as a message block, and the decoder is used to predict the position of the message block to obtain a second prediction result, until the preset number of rounds is completed, and the second prediction result is weighted summed to obtain the first prediction result.

[0149] Correspondingly, in order to train the target initial multi-outlet neural network model according to the initial crowd data, the real motion trajectory information and the first motion trajectory information to obtain a trained multi-outlet neural network model, the training module 32 can also be used to construct a teacher model and a student model corresponding to the target initial multi-outlet neural network model, wherein the optimal initial weights and the optimal initial deviations of the teacher model and the student model are different, the number of layers of the teacher model is deeper than the number of layers of the student model, and the dimension of the teacher model is wider than the dimension of the student model; construct a copy model of the student model; perform knowledge distillation on the copy model according to the initial crowd data, the real motion trajectory information, the first motion trajectory information and the teacher model to obtain an updated copy model; perform feedback on the teacher model according to the initial crowd data, the real motion trajectory information, the first motion trajectory information and the updated copy model to obtain an updated teacher model; perform knowledge distillation on the student model according to the initial crowd data, the real motion trajectory information, the first motion trajectory information and the updated teacher model to obtain a trained multi-outlet neural network model.

[0150] Correspondingly, in order to perform knowledge distillation on the replica model according to the initial crowd data, the real motion trajectory information, the first motion trajectory information and the teacher model to obtain an updated replica model, the training module 32 can also be used to predict the initial crowd data according to the teacher model and the replica model respectively, and obtain the third prediction result and the fourth prediction result of each exit accordingly, calculate the first teacher distillation loss according to the third prediction result and the fourth prediction result, calculate the first prediction loss according to the fourth prediction result and the real motion trajectory information, calculate the second prediction loss according to the fourth prediction result and the first motion trajectory information, update the weight and bias of the replica model according to the first teacher distillation loss, the first prediction loss and the second prediction loss, and obtain the updated replica model.

[0151] Correspondingly, in order to provide feedback to the teacher model based on the initial crowd data, the real motion trajectory information, the first motion trajectory information and the updated copy model to obtain an updated teacher model, the training module 32 can also be used to select samples from the initial crowd data, predict the samples according to the updated copy model to obtain a fifth prediction result of each exit, calculate a third prediction loss according to the fifth prediction result and the first motion trajectory information, update the weight and bias of the teacher model according to the third prediction loss, and obtain an updated teacher model.

[0152] Correspondingly, in order to perform knowledge distillation on the student model according to the initial crowd data, the real motion trajectory information, the first motion trajectory information and the updated teacher model, and obtain a trained multi-export neural network model, the training module 32 can also be used to predict the initial crowd data according to the updated teacher model and the student model, and obtain the sixth prediction result and the seventh prediction result of each exit respectively, calculate the second teacher distillation loss according to the sixth prediction result and the seventh prediction result, calculate the fourth prediction loss according to the seventh prediction result and the real motion trajectory information, calculate the fifth prediction loss according to the seventh prediction result and the first motion trajectory information, calculate the total self-distillation loss according to the seventh prediction result, calculate the total loss according to the second teacher distillation loss, the fourth prediction loss, the fifth prediction loss and the total self-distillation loss, update the weights and bias of the student model according to the total loss, and obtain a trained multi-export neural network model.

[0153] It should be noted that for other corresponding descriptions of the functional units involved in the macro crowd simulation device provided in this embodiment, reference can be made to Figure 1 to Figure 2 The corresponding description will not be repeated here.

[0154] Based on the above Figure 1 to Figure 2 The method shown in the embodiment, accordingly, also provides a storage medium, which can be volatile or non-volatile, and stores a computer program, which is executed by a processor to implement the above-mentioned Figure 1 to Figure 2 The macro crowd simulation method shown.

[0155] Based on this understanding, the technical solution of the present invention can be embodied in the form of a software product, which can be stored in a storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.), and includes a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods of various implementation scenarios of the present invention.

[0156] Based on the above Figure 1 to Figure 2 The method shown and Figure 3 , Figure 4 In order to achieve the above-mentioned purpose, the present embodiment further provides a computer device, which includes a storage medium and a processor; the storage medium is used to store a computer program; the processor is used to execute the computer program to achieve the above-mentioned Figure 1 to Figure 2 The macro crowd simulation method shown.

[0157] Optionally, the computer device may further include a user interface, a network interface, a camera, a radio frequency (RF) circuit, a sensor, an audio circuit, a WI-FI module, etc. The user interface may include a display, an input unit such as a keyboard, etc., and the optional user interface may also include a USB interface, a card reader interface, etc. The network interface may optionally include a standard wired interface, a wireless interface (such as a WI-FI interface), etc.

[0158] Those skilled in the art will appreciate that the computer device structure provided in this embodiment does not constitute a limitation on the physical device, and may include more or fewer components, or a combination of certain components, or different component arrangements.

[0159] The storage medium may also include an operating network communication module. The operating is a program that manages the hardware and software resources of the above-mentioned computer device, supporting the operation of the information processing program and other software and / or programs. The network communication module is used to communicate between the components inside the storage medium, and to communicate with other hardware and software in the information processing entity device.

[0160] Through the description of the above implementation modes, those skilled in the art can clearly understand that the present invention can be implemented by means of software plus a necessary general hardware platform, or by hardware.

[0161] The present invention provides a macro crowd simulation method, device and equipment. First, crowd trajectory data is constructed into particles, and the initial crowd data of the particles at a preset initial moment and the real motion trajectory information after the preset initial moment are obtained. Based on the smooth particle fluid dynamics physics formula, the first motion trajectory information of the particles after the preset initial moment is calculated according to the initial crowd data; then, a target initial multi-outlet neural network model including an optimal initial weight and an optimal initial deviation is constructed according to the initial crowd data, the first motion trajectory information and the real motion trajectory information, and the target initial multi-outlet neural network model is trained according to the initial crowd data, the real motion trajectory information and the first motion trajectory information to obtain a trained multi-outlet neural network model; finally, crowd data to be predicted for position is obtained, and the multi-outlet neural network model is used to perform multi-outlet prediction on the crowd data to obtain the motion trajectory information after the moment when the crowd data is located. Through the technical solution of the present invention, the first motion trajectory information calculated based on the smooth particle fluid dynamics physical formula is physical information, and the physical information is injected into the target initial multi-outlet neural network model, so that the model follows the laws of physics, enhances the physical consistency, generalization and robustness of the crowd simulation model, reduces the prediction loss of the model under long-term simulation conditions, ensures the accuracy of crowd simulation under long-term and high-density crowd simulation conditions, and the initial parameters of the target initial multi-outlet neural network model are the optimal initial weights and the optimal initial deviations, which can accelerate the loss convergence of the model.

[0162] Those skilled in the art will appreciate that the accompanying drawings are only schematic diagrams of a preferred implementation scenario, and the modules or processes in the accompanying drawings are not necessarily necessary for implementing the present invention. Those skilled in the art will appreciate that the modules in the devices in the implementation scenario can be distributed in the devices of the implementation scenario according to the description of the implementation scenario, or can be changed accordingly and located in one or more devices different from the present implementation scenario. The modules of the above-mentioned implementation scenario can be combined into one module, or can be further split into multiple submodules.

[0163] The above serial numbers of the present invention are only for description and do not represent the advantages and disadvantages of the implementation scenarios. The above disclosure is only a few specific implementation scenarios of the present invention, but the present invention is not limited thereto, and any changes that can be thought of by those skilled in the art should fall within the protection scope of the present invention.

Claims

1. A macro crowd simulation method, characterized in that: The method comprises: Constructing crowd trajectory data into particles, obtaining initial crowd data of the particles at a preset initial moment and real motion trajectory information after the preset initial moment, and calculating first motion trajectory information of the particles after the preset initial moment according to the initial crowd data based on a smooth particle fluid dynamics physics formula; Constructing a target initial multi-outlet neural network model including an optimal initial weight and an optimal initial deviation according to the initial crowd data, the first motion trajectory information, and the real motion trajectory information, and training the target initial multi-outlet neural network model according to the initial crowd data, the real motion trajectory information, and the first motion trajectory information to obtain a trained multi-outlet neural network model; The crowd data to be position predicted is obtained, and the multi-export neural network model is used to perform multi-export prediction on the crowd data to obtain the movement trajectory information after the moment of the crowd data.

2. The method according to claim 1, characterized in that The calculating the first motion trajectory information of the particle after the preset initial moment based on the smooth particle fluid dynamics physical formula according to the initial crowd data includes: For each of the particles, obtaining, according to the initial population data, a first coordinate of the particle, a first other particle of the particle within a smooth core radius, a second coordinate of the first other particle, and a mass of the first other particle; Based on a smooth particle fluid dynamics physics formula, calculating a first density of the particle according to the smooth core radius, the first coordinate, the second coordinate, and the mass; Calculate a first dynamic personal static density of the particle according to the first density; determining a second dynamic personal static density of the first other particle according to the first dynamic personal static density; The first motion trajectory information of the particle after the preset initial moment is calculated according to the first dynamic individual static density and the second dynamic individual static density.

3. The method according to claim 2, characterized in that The calculating the first motion trajectory information of the particle after the preset initial moment according to the first dynamic individual static density and the second dynamic individual static density includes: calculating a first pressure of the particle according to the first dynamic personal static density, and calculating a penetration force of the particle according to the first dynamic personal static density, the second dynamic personal static density, the mass, the first coordinate, the second coordinate, and the smooth core radius; calculating a second pressure of the first other particle according to the second dynamic individual static density; Calculating the acceleration of the particle according to the navigation item of the particle, the artificial viscosity item, the boundary force generated by the obstacle corresponding to the particle, the mass, the first pressure, the first dynamic personal static density, the second pressure, the second dynamic personal static density, the penetration force, the first coordinate, the second coordinate and the smooth core radius; A first predicted coordinate of the particle at a first predicted time is obtained according to the acceleration, and a second predicted coordinate of the particle at a second predicted time is continuously calculated according to the first predicted coordinate until an end point is reached, thereby obtaining first motion trajectory information of the particle after the preset initial time.

4. The method according to claim 1, characterized in that: The constructing of a target initial multi-export neural network model including an optimal initial weight and an optimal initial deviation according to the initial crowd data, the first motion trajectory information, and the real motion trajectory information comprises: Construct an initial multi-export neural network model using an encoder, a processor, and a decoder; A solution space including initial weights and initial deviations is created using a Harris Hawk algorithm, and the initial multi-export neural network model is trained using the initial population data to obtain a first prediction result by simulating a Harris Hawk hunting process, and a first loss is calculated based on the first prediction result and the real motion trajectory information, and a second loss is calculated based on the first prediction result and the first motion trajectory information, and the training is iterated until a preset stop condition is reached, and an optimal initial weight and an optimal initial deviation are obtained in the solution space; The initial multi-outlet neural network model including the optimal initial weights and the optimal initial deviations is determined as a target initial multi-outlet neural network model.

5. The method according to claim 4, characterized in that The using the initial population data to train the initial multi-export neural network model to obtain a first prediction result includes: constructing the initial crowd data into a grid, and encoding the grid into an initial graph structure using the encoder; For each particle, the initial graph structure is filtered according to the neighbor list to obtain a target graph structure corresponding to the particle, wherein the target graph structure includes a target edge set and a target node set; The processor is used to obtain updated node features and updated edge features in each round of message passing along the target edge set, and each N rounds of message passing is used as a message block. The decoder is used to predict the position of the message block to obtain a second prediction result, until a preset number of rounds are completed, and the second prediction results are weighted summed to obtain a first prediction result.

6. The method according to claim 1, characterized in that The step of training the target initial multi-export neural network model according to the initial crowd data, the real motion trajectory information and the first motion trajectory information to obtain a trained multi-export neural network model includes: Constructing a teacher model and a student model corresponding to the target initial multi-export neural network model, wherein the optimal initial weights and the optimal initial deviations of the teacher model and the student model are different, the number of layers of the teacher model is deeper than the number of layers of the student model, and the dimension of the teacher model is wider than the dimension of the student model; constructing a replica model of the student model; performing knowledge distillation on the replica model according to the initial crowd data, the real motion trajectory information, the first motion trajectory information, and the teacher model to obtain an updated replica model; Providing feedback to the teacher model according to the initial crowd data, the real motion trajectory information, the first motion trajectory information and the updated replication model to obtain an updated teacher model; The student model is subjected to knowledge distillation according to the initial crowd data, the real motion trajectory information, the first motion trajectory information and the updated teacher model to obtain a trained multi-export neural network model.

7. The method according to claim 6, characterized in that The performing knowledge distillation on the replication model according to the initial crowd data, the real motion trajectory information, the first motion trajectory information and the teacher model to obtain an updated replication model includes: Predict the initial crowd data according to the teacher model and the replica model respectively, obtain a third prediction result and a fourth prediction result of each exit accordingly, calculate a first teacher distillation loss according to the third prediction result and the fourth prediction result, calculate a first prediction loss according to the fourth prediction result and the real motion trajectory information, calculate a second prediction loss according to the fourth prediction result and the first motion trajectory information, update the weight and bias of the replica model according to the first teacher distillation loss, the first prediction loss and the second prediction loss, and obtain an updated replica model; The step of providing feedback to the teacher model according to the initial crowd data, the real motion trajectory information, the first motion trajectory information and the updated replication model to obtain the updated teacher model includes: Selecting samples from the initial crowd data, predicting the samples according to the updated replication model to obtain fifth prediction results of each exit, calculating a third prediction loss according to the fifth prediction result and the first motion trajectory information, and updating the weight and bias of the teacher model according to the third prediction loss to obtain an updated teacher model; The performing knowledge distillation on the student model according to the initial crowd data, the real motion trajectory information, the first motion trajectory information and the updated teacher model to obtain a trained multi-export neural network model includes: The initial crowd data is predicted respectively according to the updated teacher model and the student model, and the sixth prediction result and the seventh prediction result of each exit are obtained accordingly. The second teacher distillation loss is calculated according to the sixth prediction result and the seventh prediction result, the fourth prediction loss is calculated according to the seventh prediction result and the real motion trajectory information, the fifth prediction loss is calculated according to the seventh prediction result and the first motion trajectory information, the total self-distillation loss is calculated according to the seventh prediction result, the total loss is calculated according to the second teacher distillation loss, the fourth prediction loss, the fifth prediction loss and the total self-distillation loss, the weight and bias of the student model are updated according to the total loss, and the trained multi-export neural network model is obtained.

8. A macro crowd simulation device, characterized in that: The device comprises: An acquisition module is used to construct crowd trajectory data into particles, acquire initial crowd data of the particles at a preset initial moment and real motion trajectory information after the preset initial moment, and calculate the first motion trajectory information of the particles after the preset initial moment according to the initial crowd data based on the smooth particle fluid dynamics physics formula; A training module, used to construct a target initial multi-outlet neural network model including an optimal initial weight and an optimal initial deviation according to the initial crowd data, the first motion trajectory information and the real motion trajectory information, and train the target initial multi-outlet neural network model according to the initial crowd data, the real motion trajectory information and the first motion trajectory information to obtain a trained multi-outlet neural network model; The prediction module is used to obtain the crowd data to be predicted, and use the multi-export neural network model to perform multi-export prediction on the crowd data to obtain the movement trajectory information after the moment when the crowd data is located.

9. A storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the macro population simulation method according to any one of claims 1 to 7 is implemented.

10. A computer device comprising a storage medium, a processor, and a computer program stored in the storage medium and executable on the processor, characterized in that: When the processor executes the computer program, the macro population simulation method according to any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Crowd motion behavior recognition method based on subgroup division and momentum feature fusion

    CN109064484A

  • Crowd behavior simulation model training method, crowd simulation method, device and equipment

    CN115713030A

  • Unmanned aerial vehicle city inspection system and method

    CN115713174A

  • Method for predicting evacuation efficiency of passengers in vehicle-mounted vehicle in flood scene

    CN117455073A

  • System and method for efficient machine learning

    US20230419170A1