Crowd motion modeling method and system based on large language model

By constructing a crowd movement modeling method based on a large language model, the problem of complex social interaction and cognitive decision-making within small groups in traditional models is solved. This enables refined simulation of the movement behavior of small groups of pedestrians in transportation hubs, improves the realism and generalization ability of the simulation, and is applicable to the refined management and emergency response of transportation hubs.

CN122290052APending Publication Date: 2026-06-26BEIJING UNIV OF CIVIL ENG & ARCHITECTURE
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
BEIJING UNIV OF CIVIL ENG & ARCHITECTURE
Filing Date
2026-04-21
Publication Date
2026-06-26

Smart Images

  • Figure CN122290052A_ABST
    Figure CN122290052A_ABST
Patent Text Reader

Abstract

This invention relates to the field of traffic simulation and pedestrian flow modeling technology, and particularly to a method and system for crowd movement modeling based on a large language model. The method includes: constructing a multi-dimensional interactive feature system of pedestrians, small groups, and the environment; extracting micro-behavioral features of small pedestrian groups through micro-unit segmentation and dynamic group partitioning methods; proposing a pedestrian movement decision-making framework based on a large language model and thought chain; designing a hybrid update decision-making strategy to balance high-level semantic decision-making and local obstacle avoidance; and training and testing pedestrian evacuation at traffic hubs. Instance verification of pedestrian small group movement decision-making at traffic hubs is also conducted. The proposed model is applied to hub scenarios and its empirical dataset for training and testing. Results show that it achieves better motion realism, traffic efficiency, and group structure stability than baseline models.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of traffic simulation and pedestrian flow modeling technology, and in particular to a method and system for modeling crowd movement based on a large language model. Background Technology

[0002] Precise modeling of pedestrian detection and movement behavior is a crucial foundation for intelligent traffic scheduling, public safety early warning, and large-scale event management. In high-density areas such as transportation hubs and commercial centers, small groups of pedestrians formed by social relationships such as family and friends are common. The close interactions within these groups, including following, aggregating, and waiting, often become key factors triggering and exacerbating congestion in localized bottleneck areas, reducing overall traffic efficiency, and impacting evacuation safety. Therefore, developing simulation models capable of accurately depicting and simulating the social collaborative movements of small groups is of significant theoretical value and practical urgency for formulating scientific passenger flow organization and management strategies.

[0003] To reveal and simulate pedestrian movement patterns, the academic community has proposed various microscopic simulation models. Classic models include social force models, cellular automata models, and lattice gas models. Although these models have achieved success in simulating standardized scenarios such as unidirectional flow, cross flow, and bottleneck flow, their modeling paradigms have inherent limitations. They struggle to accurately depict the courtesy and compromise based on social relationships within small groups, and they fail to fully express the complex cognitive decision-making processes of small groups in dynamic, high-density environments, such as global path planning, continuous attention to the state of group members, and waiting.

[0004] In recent years, deep reinforcement learning methods have been introduced into the fields of pedestrian motion and traffic control, learning optimal motion strategies through continuous interaction and trial and error between the agent and the environment. However, most existing deep reinforcement learning methods applied to pedestrian modeling treat pedestrians as homogeneous and independent decision-making units. Their policy networks typically rely on low-dimensional physical state features and lack the understanding and deep reasoning ability of the rich high-level semantic information that natural language can describe. As a result, when modeling the social collaborative behaviors unique to small groups in high-density, high-dynamic hub environments, the models suffer from limitations in behavioral realism, policy generalization ability, and adaptability to different social relationship patterns. Summary of the Invention

[0005] This invention provides a method and system for modeling crowd movement based on a large language model, addressing the shortcomings of traditional models in accurately depicting the complex social interactions and cognitive decision-making processes within small groups. This application's solution constructs a large language model and embeds a thought chain reasoning mechanism to collaboratively model the movement of small pedestrian groups at transportation hubs, improving the realism of small group movement and the stability of group structure.

[0006] This invention provides a crowd movement modeling method based on a large language model, comprising: Construct a multi-dimensional interaction feature system of pedestrians, small groups, and environment, and extract the behavioral features of small groups at key facilities in transportation hubs; Based on the behavioral characteristics of the small groups, a pedestrian movement decision-making framework based on a large language model and thought chain is constructed, a hybrid update decision-making strategy is designed, and training and testing of pedestrian evacuation at transportation hubs are conducted. For case verification, typical facility scenarios of transportation hubs and real station videos were selected to construct a pedestrian small group motion modeling framework based on the enhanced large language model of thought chain, so as to realize the refined simulation of the small group motion behavior of pedestrians in the hub. The effective modeling performance was verified through experiments with different pedestrian sizes, different small group proportions, multi-baseline model comparison experiments and thought chain ablation experiments.

[0007] According to the crowd movement modeling method based on a large language model provided by the present invention, the construction of a multi-dimensional interaction feature system of pedestrians-small groups-environment, and the extraction of small group behavioral features of key facilities in transportation hubs, includes: Based on video acquisition and computer vision technology, the spatiotemporal trajectory and behavioral characteristics of pedestrians are extracted; We employ micro-unit segmentation and dynamic group partitioning methods to identify and quantify the micro-behavioral characteristics of small groups.

[0008] According to the crowd movement modeling method based on a large language model provided by the present invention, the extraction of spatiotemporal trajectories and behavioral features of pedestrians based on video acquisition and computer vision technology includes: To capture dynamic contextual information in video clips, a pre-trained dilated 3D convolutional network is used as the backbone network. The classic 2D convolutional kernel is dilated into 3D, enabling it to learn spatial appearance and temporal motion information simultaneously. The 3D feature map output by the last convolutional layer of the network is extracted as a global spatiotemporal semantic representation of the entire video clip, encoding the dynamic patterns of the scene. To obtain the detailed features of each pedestrian, object detection and feature alignment techniques are combined. The detector is used to locate the pedestrian bounding box frame by frame. Interest region alignment is used to accurately map each bounding box onto the feature map generated by the I3D network. A fixed-size feature vector is then pooled. Each pedestrian is represented as an individual feature vector that integrates appearance and short-term motion.

[0009] According to the crowd movement modeling method based on a large language model provided by the present invention, the method of using micro-unit segmentation and dynamic group partitioning to identify and quantify the micro-behavioral characteristics of small groups includes: For scene space micro-unit segmentation that takes into account the difference in the strength of relationships, the scene space is first divided into several micro-units, and a graph attention network is used to directly learn the potential interactions and seamlessly capture the global activity context. The distance between pedestrians can be calculated using the following formula (1). (1) In the formula: and pedestrians and pedestrians time step , where This represents the distance between pedestrians; the smaller the value, the closer the pedestrians are. When two pedestrians are moving in opposite directions, they will not be considered as the same group even if they are close to each other. Therefore, the similarity of their walking directions can be calculated using the following formula (2). (2) In the formula: This represents the similarity in the direction pedestrians are walking; a larger value indicates a higher degree of similarity in their walking directions. For pedestrians time step The velocity vector, with the symbol "·" representing the dot product of vectors; The pedestrian's speed value is calculated using the following formula (3). (3) In the formula, The smaller the value, the more similar the pedestrians' speed values ​​are. Let L be the L2 norm of the vector; Since pedestrians in a group have similar distances, similar walking directions and speed values, the similarity of pedestrians is calculated as shown in equation (4) by integrating equations (1), (2) and (3) based on the group characteristics. (4) In the formula: For pedestrian similarity, and Each parameter has a different weight; Pedestrian similarity The higher the height, the more pedestrians there are. and pedestrians time step The greater the likelihood that two pedestrians belong to the same group, the higher their similarity exceeds a threshold. At that time, the two pedestrians were classified into the same group, threshold Fine-tuning is performed based on different scenarios; through iterative calculations, all pedestrians are eventually assigned to a group. Then, the maximum similarity value between each pair of pedestrians within each group is calculated, and the coordinates of the pedestrian with the maximum similarity value are selected as the center coordinates of that group. ; The spectral graph clustering algorithm is used to aggregate several micro-units into small groups. The clustering mainly considers the similarity within units and the conflict between units. The system selects supervised self-organizing networks and self-organizing behaviors to classify pedestrians into individuals and small groups, achieves grouping of the entire scene, treats small groups as entities, calculates the movement trajectory of the center point, and finally achieves feature extraction of small groups. Among them, intra-unit similarity represents the consistency level of cooperation among pedestrians in the group. The closer the distance between pedestrians in the group, the more similar their speed values ​​and the more similar their walking directions, the stronger the intra-unit consistency. An intra-unit similarity function is proposed to quantify the consistency level of pedestrians in the group based on distance, speed value and walking direction, as shown in equation (5). (5) In the formula, Indicates intra-unit similarity, and pedestrians and pedestrians time step The direction vector; and pedestrians and pedestrians time step The velocity vector; For pedestrians and pedestrians Euclidean distance between them; Inter-unit conflict refers to the interaction or friction between groups when they approach each other. When pedestrians walk, it is inevitable that they will overtake and meet. Two groups walking in opposite directions will influence each other and may collide. As the distance decreases and the speed difference increases, the level of conflict between groups increases. When the group behind tries to overtake the group in front from one side, the obstruction of the group in front will cause a one-way influence from the group in front to the group behind, as shown in the following formula (6). (6).

[0010] In the formula, For the group with the group At time step The inter-unit conflict level; the larger the value, the more intense the inter-group conflict. For the group The L2 norm of the velocity vector; For the group The L2 norm of the velocity vector; For the group The angle between the direction of motion and the direction of the line connecting the centers of the two groups; For the group The angle between the direction of motion and the direction of the line connecting the centers of the two groups; for The cosine value is used to determine the group. Should we move towards the other person or move away from them? for The cosine value is used to determine the group. Should we move towards the other person or move away from them? In time step group with the group The Euclidean distance between the centers.

[0011] According to the crowd movement modeling method based on a large language model provided by the present invention, the construction of a pedestrian movement decision-making framework based on a large language model and thought chain includes: In a large language model, an agent perceives the local environment, including spatial state, social state, and group state information, and encodes the state information. Spatial state refers to the acquisition of the occupancy of its own grid and its Moore neighborhood, as well as the distance gradient to the target exit, based on the idea of ​​cellular automata. Social state refers to the identification of the identities of neighboring agents and their relative speed and direction of movement. Group state refers to the position and state of other members in the group. Status information is encoded into cue words, which include task, role definition, environment and thought chain, and the thought chain is used to guide path adjustment and group behavior coordination decisions in continuous movement; A conflict resolution mechanism based on random priority is used to simulate nondeterministic yielding behavior between pedestrians; Design a hybrid update decision-making strategy to guide the agent to embed walking preferences, correct walking direction, and coordinate the motion constraints of group walking; Conduct training and testing on pedestrian evacuation at transportation hubs.

[0012] According to the crowd movement modeling method based on a large language model provided by the present invention, the step of simulating nondeterministic yielding behavior between pedestrians by employing a conflict resolution mechanism based on random priority includes: At the beginning of the decision cycle, each agent is assigned a randomly generated priority value P_i ~ U(0,1); When a conflict occurs, the system compares the priorities of all agents competing for the same grid, and the agent with the lowest P_i value gains the right to occupy the grid. Agents that fail to move will remain in place at the current time step.

[0013] According to the crowd movement modeling method based on a large language model provided by the present invention, the design of a hybrid update decision strategy to guide the agent to embed walking preferences, correct walking direction, and coordinate the movement constraints of the group walking includes: Every N basic time steps, an LLM high-level decision instruction is triggered to guide the agent to embed walking preferences, correct walking direction, coordinate the motion constraints of group walking, and dynamically perceive the surrounding environment. Within the time steps between adjacent LLM decision points, the policy guides the agent to perform local obstacle avoidance through cellular automata local rules. LLM provides policy guidance based on semantic understanding, while local rules ensure the feasibility of the agent's physical movements and real-time obstacle avoidance. For agent i at time t, its local rule velocity term... and LLM boot speed item Through time-varying weighting coefficients Organic integration is achieved, as shown in formula (7) below. (7) Local rule velocity term The agent i is guided to safely avoid obstacles in the local environment at time t, which conforms to the following formula (8). (8) In the formula: Repulsive potential for pedestrians / obstacles; The wall's repulsive force; Let be the unit vector of attraction pointing towards the exit; , as well as These are the weighting coefficients; LLM-guided global speed item Provide high-level strategic decisions for agent i at time t, which conforms to the following formula (9). (9) In the formula: The LLM cue words output by the strategy are parsed into a continuously effective guidance velocity vector; The direction points to the sub-target point defined by LLM; For comfortable speed; This is the guiding force intensity coefficient.

[0014] Time-varying weighting coefficients It is the key to dynamically adjusting the global guidance speed term and the local rule speed term of LLM, which can effectively adjust the "discourse power" of LLM decision-making, and conforms to the following formula (10). (10) In the formula: The basic weights are maximized at the initial time after the LLM decision; The term is an exponential decay term, simulating the time-varying decay of the influence of LLM decisions. It tends to zero before the next LLM decision cycle, thus avoiding interference from outdated instructions. For the conflict detection function, when a severe conflict is detected between the LLM guidance direction and the local environment, the function value drops sharply or even to zero, and the strategy automatically degenerates into pure local rule dominance. .

[0015] According to the crowd movement modeling method based on a large language model provided by the present invention, the effective dispersal performance of the crowd movement modeling method based on a large language model is verified through experiments with different pedestrian sizes, experiments with different small group proportions, multi-baseline model comparison experiments, and thought chain ablation experiments, including: The performance of a given model is evaluated using five metrics: evacuation time, average waiting time, average movement speed, change in spacing between group members, and group breakage rate. Evacuation time, average waiting time, and average movement speed are used to measure the model's macroscopic evacuation efficiency for small groups of pedestrians. The shorter the evacuation time and average waiting time, and the higher the average movement speed, the higher the pedestrian evacuation efficiency. Change in spacing between group members and group breakage rate are used to evaluate the model's stability in maintaining the internal structure of the group. The smaller the change in spacing between group members and the lower the group breakage rate, the more stable the small group structure. Change in distance between group members It is used to measure the degree of change in the internal spatial structure of a small group during movement, and conforms to the following formula (11). (11) In the formula: , They are time points , small groups Internal members and distance ( ); The total number of small groups; This represents the total simulation time.

[0016] Group fracture rate The proportion of "members leaving the group" during a small group movement is measured by the following formula (12). (12) In the formula: The maximum distance between any two members; This is the distance threshold.

[0017] This invention also provides a crowd motion modeling system based on a large language model, applying a crowd motion modeling method based on a large language model, characterized by comprising: The multi-dimensional interaction feature extraction module is used to construct a multi-dimensional interaction feature system of pedestrians, small groups, and environment. It adopts a dilated 3D convolutional network to extract spatiotemporal scene and individual pedestrian features, uses scene space micro-unit segmentation to compare the strength of the relationship between pedestrians, and adopts a dynamic group segmentation method of micro-unit aggregation to identify and quantify the micro-behavioral features of small groups. The perception and encoding module uses a large language model to guide the agent to perceive its local environment, including spatial state, social state, group state, and other information, and to encode state information. The task description module encodes status information into prompts, including task, role definition, environment, and thought chain. It uses the thought chain to guide path adjustment and group behavior coordination decisions in continuous movement. The conflict resolution action execution module adopts a conflict resolution mechanism based on random priority to simulate nondeterministic yielding behavior between pedestrians; The hybrid update decision module triggers a high-level LLM decision instruction every N basic time steps through prompt words, guiding the agent to embed walking preferences, correct walking direction, coordinate group walking and other motion constraints, and dynamically perceive the surrounding environment. The training and testing module is used for training and testing pedestrian evacuation at transportation hubs. The instance verification module is applied to three key facility scenario datasets: corners, turnstiles, and station halls. Through experiments with different pedestrian scales, different small group proportions, multi-baseline model comparison experiments, and mind chain ablation experiments, the performance of the crowd movement modeling method based on the large language model is verified.

[0018] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, it implements any of the crowd motion modeling methods based on large language models described above.

[0019] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements any of the crowd motion modeling methods based on large language models described above.

[0020] The present invention also provides a computer program product, including a computer program that, when executed by a processor, implements any of the crowd motion modeling methods based on a large language model as described above.

[0021] The crowd movement modeling method based on a large language model provided by this invention can rely on a multi-dimensional interactive feature system to obtain multi-level representations of macro-scene layout, meso-level group structure, and micro-level individual states, achieving joint modeling of global and local features. Based on this, the natural language understanding capability of the large language model is used to further optimize decision-making quality, maintain social geometric constraints, and extract deeper group intentions and collaborative information. Finally, a global semantic association is established through a step-by-step reasoning mechanism of thought chains, using explicit reasoning processes to characterize the potential interaction relationships between different small groups, and integrating the decision results of each group to achieve accurate simulation of pedestrian small group movement behavior in transportation hubs. This method can fully leverage the advantages of combining cross-scale, cross-regional feature modeling with cognitive reasoning, which is conducive to improving the realism and generalization ability of pedestrian movement simulation, providing technical support for refined crowd management and emergency response in transportation hubs. Attached Figure Description

[0022] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0023] Figure 1 This is a flowchart illustrating the crowd motion modeling method based on a large language model provided in an embodiment of the present invention. Figure 2 This is a framework diagram of the small group identification method provided in the embodiments of the present invention; Figure 3 This is a pedestrian movement decision-making framework diagram provided in an embodiment of the present invention; Figure 4 This is a schematic diagram of the structure of the crowd motion modeling system based on a large language model provided in an embodiment of the present invention; Figure 5 This is a schematic diagram of the physical structure of the electronic device provided in an embodiment of the present invention. Detailed Implementation

[0024] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.

[0025] Figure 1This is a flowchart illustrating the crowd motion modeling method based on a large language model provided in an embodiment of the present invention.

[0026] like Figure 1 As shown, this embodiment provides a crowd motion modeling method based on a large language model, including: Step 1: Construct a multi-dimensional interaction feature system of pedestrians, small groups, and environment, and extract the behavioral features of small groups at key facilities in transportation hubs; Step 2: Based on the behavioral characteristics of the small groups, construct a pedestrian movement decision-making framework based on a large language model and thought chain, design a hybrid update decision-making strategy, and conduct training and testing on pedestrian evacuation at transportation hubs. The decision framework based on the enhanced large language model using thought chains in step 2 is a deep modeling method that mines global and local relationships under multi-dimensional interactive features, aiming to achieve high-precision prediction of the movement behavior of small groups of pedestrians in transportation hubs. Its core idea is to effectively represent the spatial semantics and potential social connections of small group movements in different scenarios by fusing and enhancing multi-granularity features and combining the explicit reasoning ability of thought chains.

[0027] Step 3, Instance Verification: Select typical facility scenarios of transportation hubs and real station videos to construct a pedestrian small group motion modeling framework based on the enhanced large language model of thought chain, so as to realize the refined simulation of the small group motion behavior of pedestrians in the hub; verify the effective modeling performance through experiments with different pedestrian scales, experiments with different small group proportions, multi-baseline model comparison experiments and thought chain ablation experiments.

[0028] In this embodiment, pedestrian small-group movement modeling can be performed based on the above steps. During implementation, the collected pedestrian trajectory data and corresponding small-group behavior annotation information can be used to learn the mapping relationship from environmental conditions to small-group collaborative movement decisions, achieving refined simulation of pedestrian movement behavior in complex hub scenarios. Accurate modeling of small-group movement behavior can facilitate subsequent dynamic passenger flow analysis, congestion prediction, and public safety management, and provide data support for the operation scheduling and emergency evacuation of transportation hubs.

[0029] In the construction of the pedestrian-small group-environment multidimensional interaction feature system in step 1, small group identification plays a crucial role. Since the social relationships among members within a small group (such as family and friends) are the core factor influencing their coordinated movement, group-based decision-making units can effectively avoid the bias caused by neglecting social interactions due to individual independent modeling. By treating each small group as a cohesive decision-making entity and combining it with the semantic understanding capabilities of a large language model, a coordinated movement strategy that conforms to social norms while preserving spatial constraints can be formed.

[0030] The crowd movement modeling method based on a large language model provided in this embodiment can rely on a multi-dimensional interactive feature system to obtain multi-level representations of macro-scene layout, meso-level group structure, and micro-level individual states, achieving joint modeling of global and local features. Based on this, the natural language understanding capability of the large language model is used to further optimize decision-making quality, maintain social geometric constraints, and extract deeper group intentions and collaborative information. Finally, a global semantic association is established through a step-by-step reasoning mechanism of thought chains, using explicit reasoning processes to characterize the potential interaction relationships between different small groups, and integrating the decision-making results of each group to achieve accurate simulation of pedestrian small group movement behavior in transportation hubs. This method can fully leverage the advantages of combining cross-scale, cross-regional feature modeling with cognitive reasoning, which is conducive to improving the realism and generalization ability of pedestrian movement simulation, providing technical support for refined crowd management and emergency response in transportation hubs.

[0031] In the exemplary embodiment, the construction of a multi-dimensional interaction feature system of pedestrians, small groups, and environment, and the extraction of behavioral features of small groups at key facilities in transportation hubs, includes: Based on video acquisition and computer vision technology, the spatiotemporal trajectory and behavioral characteristics of pedestrians are extracted; We employ micro-unit segmentation and dynamic group partitioning methods to identify and quantify the micro-behavioral characteristics of small groups.

[0032] Figure 2 This is a framework diagram of the small group identification method provided in the embodiments of the present invention.

[0033] like Figure 2 As shown in the exemplary embodiment, the step of extracting the spatiotemporal trajectory and behavioral features of pedestrians based on video acquisition and computer vision technology includes: A deep learning-based approach is employed to extract rich representations at both the global scene and individual pedestrian levels. The first step is spatiotemporal scene feature extraction. To capture dynamic contextual information in video clips (such as overall pedestrian flow and periodic congestion), an inflated 3D network (I3D) pre-trained on a large video dataset is used as the backbone. I3D inflates classic 2D convolutional kernels (such as ImageNet pre-trained weights) into 3D, enabling it to simultaneously learn spatial appearance and temporal motion information. The 3D feature map output from the final convolutional layer is extracted as a global spatiotemporal semantic representation of the entire video clip; this feature encodes the dynamic patterns of the scene.

[0034] The second step is pedestrian individual feature extraction. To obtain the fine features of each pedestrian, object detection and feature alignment techniques are combined. The detector is used to locate pedestrian bounding boxes frame by frame. Region of interest alignment (ROI Align) is used to accurately map each bounding box onto the feature map generated by the I3D network, and pooling produces a fixed-size feature vector. Each pedestrian is represented as an individual feature vector that integrates their appearance (clothing, posture) and short-term temporal motion (inter-frame displacement pattern).

[0035] In an exemplary embodiment, the method of employing micro-unit segmentation and dynamic group partitioning to identify and quantify the micro-behavioral characteristics of small groups includes: For scene space micro-unit segmentation that considers the difference in the strength of relationships, the scene space is first divided into several micro-units, and graph attention networks (GATs) are used to directly learn the potential interactions and seamlessly capture the global activity context. The distance between pedestrians can be calculated using the following formula (1). (1) In the formula: and pedestrians and pedestrians time step , where This represents the distance between pedestrians; the smaller the value, the closer the pedestrians are. When two pedestrians are moving in opposite directions, they will not be considered as the same group even if they are close to each other. Therefore, the similarity of their walking directions can be calculated using the following formula (2). (2) In the formula: This represents the similarity in the direction pedestrians are walking; a larger value indicates a higher degree of similarity in their walking directions. For pedestrians time step The velocity vector, with the symbol "·" representing the dot product of vectors; The pedestrian's speed value is calculated using the following formula (3). (3) In the formula, The smaller the value, the more similar the pedestrians' speed values ​​are. Let L be the L2 norm of the vector; Since pedestrians in a group have similar distances, similar walking directions and speed values, the similarity of pedestrians is calculated as shown in equation (4) by integrating equations (1), (2) and (3) based on the group characteristics. (4) In the formula: For pedestrian similarity, and Each parameter has a different weight; Pedestrian similarity The higher the height, the more pedestrians there are. and pedestrians time step The greater the likelihood that two pedestrians belong to the same group, the higher their similarity exceeds a threshold. At that time, the two pedestrians were classified into the same group, threshold Fine-tuning is performed based on different scenarios; through iterative calculations, all pedestrians are eventually assigned to a group. Then, the maximum similarity value between each pair of pedestrians within each group is calculated, and the coordinates of the pedestrian with the maximum similarity value are selected as the center coordinates of that group. .

[0036] The spectral graph clustering algorithm is used to aggregate several micro-units into small groups. The clustering mainly considers the similarity within units and the conflict between units. The system selects supervised self-organizing networks and self-organizing behaviors to classify pedestrians into individuals and small groups, achieves grouping of the entire scene, treats small groups as entities, calculates the movement trajectory of the center point, and finally achieves feature extraction of small groups. Among them, intra-unit similarity represents the consistency level of cooperation among pedestrians in the group. The closer the distance between pedestrians in the group, the more similar their speed values ​​and the more similar their walking directions, the stronger the intra-unit consistency. An intra-unit similarity function is proposed to quantify the consistency level of pedestrians in the group based on distance, speed value and walking direction, as shown in equation (5). (5) In the formula, Indicates intra-unit similarity, and pedestrians and pedestrians time step The direction vector; and pedestrians and pedestrians time step The velocity vector; For pedestrians and pedestrians Euclidean distance between them; Inter-unit conflict refers to the interaction or friction between groups when they approach each other. When pedestrians walk, it is inevitable that they will overtake and meet. Two groups walking in opposite directions will influence each other and may collide. As the distance decreases and the speed difference increases, the level of conflict between groups increases. When the group behind tries to overtake the group in front from one side, the obstruction of the group in front will cause a one-way influence from the group in front to the group behind, as shown in the following formula (6). (6) In the formula, For the group with the group At time step The inter-unit conflict level; the larger the value, the more intense the inter-group conflict. For the group The L2 norm of the velocity vector; For the group The L2 norm of the velocity vector; For the group The angle between the direction of motion and the direction of the line connecting the centers of the two groups; For the group The angle between the direction of motion and the direction of the line connecting the centers of the two groups; for The cosine value is used to determine the group. Should we move towards the other person or move away from them? for The cosine value is used to determine the group. Should we move towards the other person or move away from them? In time step group with the group The Euclidean distance between the centers.

[0037] In an exemplary embodiment, the construction of a pedestrian movement decision-making framework based on a large language model and thought chain includes: In a large language model, an agent perceives the local environment, including spatial state, social state, and group state information, and encodes the state information. Spatial state refers to the acquisition of the occupancy of its own grid and its Moore neighborhood, as well as the distance gradient to the target exit, based on the idea of ​​cellular automata. Social state refers to the identification of the identities of neighboring agents and their relative speed and direction of movement. Group state refers to the position and state of other members in the group. Status information is encoded into cue words, which include task, role definition, environment and thought chain, and the thought chain is used to guide path adjustment and group behavior coordination decisions in continuous movement; A conflict resolution mechanism based on random priority is used to simulate nondeterministic yielding behavior between pedestrians; Design a hybrid update decision-making strategy to guide the agent to embed walking preferences, correct walking direction, and coordinate the motion constraints of group walking; Conduct training and testing on pedestrian evacuation at transportation hubs.

[0038] The conflict refers to the decision-making conflict that occurs when multiple agents compete for the same free grid at the same time step. This application provides a conflict resolution mechanism based on random priority. Each agent is assigned a randomly generated priority value P_i ~ U(0,1) at the beginning of the decision cycle. When a conflict occurs, the system compares the priorities of all agents competing for the same grid, and the agent with the lowest P_i value gains the right to occupy that grid. Agents that fail to move remain in place at that time step. This mechanism simulates the nondeterministic micro-yielding behavior between pedestrians in reality, avoiding deadlock and ensuring the smoothness of the simulation.

[0039] In this framework, each agent (representing an individual or a small group of units) operates according to the following process within a discrete time step. At each decision time t, agent i perceives its local environment, including spatial state, social state, and group state. Spatial state refers to acquiring information based on cellular automata, such as the occupancy status (free, occupied, obstacles) of its own grid and its Moore neighborhood (8 surrounding grids), and the distance gradient to the target exit. Social state refers to identifying the identities of neighboring agents (whether they belong to the same small group), their relative speed, and direction of movement. Group state refers to the position and state of other members within the group (e.g., whether they have fallen behind).

[0040] This low-level perception data is encoded into a structured natural language description as part of the input prompt. For example: "You are a pedestrian in front of a subway station turnstile. The grid directly in front of you is occupied, and the grid to your left is free. Two of your family members are 1 meter behind you to your left and are following you. Your goal is to pass through the turnstile." In an exemplary embodiment, the state information is encoded into prompt words, including task, role definition, environment, and thought chain. The thought chain guides path adjustment and group behavior coordination decisions during continuous movement, including: The encoded state description is fed into a cue word template designed to stimulate LLM's thought process reasoning ability. The core cue design is as follows: Role definition: "You are the decision-making core of a pedestrian / small group walking in a subway station, and you need to reach your destination safely and efficiently." Task and Context: Provides the environment state after the above encoding.

[0041] Guided thought process: "Please reason step by step: 1. Analyze the main obstacles and opportunities at present; 2. Evaluate the consequences of different action options (such as going straight, moving left, or waiting) on ​​yourself and your companions; 3. Consider the group coordination needs (such as whether it is necessary to slow down and wait); 4. Make the final action decision." In an exemplary embodiment, the use of a conflict resolution mechanism based on random priority to simulate nondeterministic yielding behavior between pedestrians includes: At the beginning of the decision cycle, each agent is assigned a randomly generated priority value P_i ~ U(0,1); When a conflict occurs, the system compares the priorities of all agents competing for the same grid, and the agent with the lowest P_i value gains the right to occupy the grid. Agents that fail to move will remain in place at the current time step.

[0042] Figure 3 This is a pedestrian movement decision-making framework diagram provided in an embodiment of the present invention.

[0043] like Figure 3 As shown in the exemplary embodiment, the design of the hybrid update decision strategy, which guides the agent to embed walking preferences, correct walking direction, and coordinate the motion constraints of group walking, includes: Every N basic time steps, an LLM high-level decision instruction is triggered to guide the agent to embed walking preferences, correct walking direction, coordinate the motion constraints of group walking, and dynamically perceive the surrounding environment. Within the time steps between adjacent LLM decision points, the policy guides the agent to perform local obstacle avoidance through cellular automata local rules. LLM provides policy guidance based on semantic understanding, while local rules ensure the feasibility of the agent's physical movements and real-time obstacle avoidance. For agent i at time t, its local rule velocity term... and LLM boot speed item Through time-varying weighting coefficients Organic integration is achieved, as shown in formula (7) below. (7) Local rule velocity term The agent i is guided to safely avoid obstacles in the local environment at time t, which conforms to the following formula (8). (8) In the formula: Repulsive potential for pedestrians / obstacles; The wall's repulsive force; Let be the unit vector of attraction pointing towards the exit; , as well as These are the weighting coefficients; LLM-guided global speed item Provide high-level strategic decisions for agent i at time t, which conforms to the following formula (9). (9) In the formula: The LLM cue words output by the strategy are parsed into a continuously effective guidance velocity vector; The direction points to the sub-target point defined by LLM; For comfortable speed; This is the guiding force intensity coefficient.

[0044] Time-varying weighting coefficients It is the key to dynamically adjusting the global guidance speed term and the local rule speed term of LLM, which can effectively adjust the "discourse power" of LLM decision-making, and conforms to the following formula (10). (10) In the formula: The basic weights are maximized at the initial time after the LLM decision; The term is an exponential decay term, simulating the time-varying decay of the influence of LLM decisions. It tends to zero before the next LLM decision cycle, thus avoiding interference from outdated instructions. For the conflict detection function, when a severe conflict is detected between the LLM guidance direction and the local environment, the function value drops sharply or even to zero, and the strategy automatically degenerates into pure local rule dominance. .

[0045] In the exemplary embodiment, the verification of the effective evacuation performance of the crowd movement modeling method based on a large language model through experiments with different pedestrian sizes, different small group proportions, multi-baseline model comparison experiments, and thought chain ablation experiments includes: The performance of a given model is evaluated using five metrics: evacuation time, average waiting time, average movement speed, change in spacing between group members, and group breakage rate. Evacuation time, average waiting time, and average movement speed are used to measure the model's macroscopic evacuation efficiency for small groups of pedestrians. The shorter the evacuation time and average waiting time, and the higher the average movement speed, the higher the pedestrian evacuation efficiency. Change in spacing between group members and group breakage rate are used to evaluate the model's stability in maintaining the internal structure of the group. The smaller the change in spacing between group members and the lower the group breakage rate, the more stable the small group structure. Change in distance between group members It is used to measure the degree of change in the internal spatial structure of a small group during movement, and conforms to the following formula (11). (11) In the formula: , They are time points , small groups Internal members and distance ( ); The total number of small groups; This represents the total simulation time.

[0046] Group fracture rate The proportion of "members leaving the group" during a small group movement is measured by the following formula (12). (12) In the formula: The maximum distance between any two members; This is the distance threshold.

[0047] This invention also provides a method for verifying the crowd motion modeling method based on a large language model through examples, including the following steps: (1) Work environment All experiments were coded on the PyTorch 2.1.1 deep learning framework; the pedestrian simulation loop was built on the Gymnasium interface. The hardware environment for all experiments consisted of a 13th generation Intel® Core™ i7-13700F @3.10GHz processor, an NVIDIA GeForce RTX4090 graphics card, and 32GB of RAM.

[0048] (2) Introduction to the experimental dataset To systematically verify the performance of the proposed model in pedestrian motion modeling within a complex transportation hub environment, this embodiment takes the concourse level of a subway station as the research object and collects pedestrian motion video data from key areas. A total of 60 sets of pedestrian motion video data were acquired, covering key facility areas such as corners and turnstiles in the concourse level. The dataset includes both low-density, loosely arranged scenes and high-density, crowded scenes to facilitate a thorough comparison and verification of the superiority of the proposed model.

[0049] (3) Selection of benchmark model In experiments with different pedestrian scales, different small group proportions, multiple baseline model comparison experiments, and mind chain ablation experiments, five baseline models were selected and compared with the proposed CoT-LLM-SGM model on a given dataset to evaluate their methodological characteristics.

[0050] ① Social force model (SFM): Based on physical forces and heuristic rules, it controls the direction and speed of pedestrian movement by calculating the social forces between individuals and between individuals and the environment, thereby simulating the movement behavior of small groups.

[0051] ② Cellular automata model (CA): Based on the random discrete walk rules of agents, it discretizes the spatial road network into cellular grids, prompting pedestrians to update their positions according to local motion rules, so as to simulate the movement behavior of small groups.

[0052] ③ Deep deterministic policy gradient (DDPG): Based on deep reinforcement learning theory, it simulates the movement behavior of small groups of pedestrians by iteratively inducing pedestrian agents to interact with the environment.

[0053] ④ Large Language Model (LLM): Based on semantic encoding and rule learning, it autonomously learns and effectively models the movement patterns of small groups of pedestrians.

[0054] (4) Experimental parameter settings To ensure the stability and comparability of the simulation results, the hyperparameter settings for each comparative model and the model proposed in this paper are as follows.

[0055] For SFM, the pedestrian's expected speed is set to 0.8 m / s, the relaxation time to 0.5 s, the social force intensity coefficient to 2000, and the distance decay coefficient to 0.08. For CA, the mesh size is set to 0.4 m × 0.4 m, allowing cells to move 0 to 3 meshes in a single step, and the friction / conflict probability is set to 0.3. For DDPG, the learning rate of its Actor network is set to 0.0001, the learning rate of its Critic network to 0.001, the discount factor to 0.99, and the update coefficient to 0.001. For LLM, GPT-3.5-turbo is used as the core decision engine, and its prompt word template and decision output format are consistent with the model proposed in this paper, but it does not include thought chain guidance. For the model in this paper, the basic LLM part also uses the GPT-3.5-turbo engine. Cellular automata are used for local rule guidance, with the small group attraction strength set to 10. A time-scheduling hybrid update strategy is employed, triggering a high-level LLM decision every 10 basic steps (basic time step size 0.5s). Local obstacle avoidance between adjacent decision points is achieved through cellular automata rules. The prompt word template is set to the role of "subway station pedestrian / small group decision core," with the action candidate set being {go straight, move left, move right, wait}, guiding the model to execute a four-step inference chain: obstacle analysis → action evaluation → group coordination → final decision. The group breakpoint detection distance threshold is set to 3m.

[0056] (5) Selection of evaluation indicators The performance of a given model is evaluated using five metrics: evacuation time, average waiting time, average movement speed, change in spacing between group members, and group breakup rate. The first three metrics measure the model's macroscopic evacuation efficiency for small pedestrian groups. Shorter evacuation time and average waiting time, and higher average movement speed, indicate higher pedestrian evacuation efficiency. The latter two metrics assess the model's stability in maintaining the internal structure of the group. Smaller change in spacing between group members and lower group breakup rate indicate a more stable small group structure.

[0057] Change in distance between group members It is used to measure the degree of change in the internal spatial structure of a small group during movement, and is expressed by formula (11).

[0058] (11) In the formula: , They are time points , small groups Internal members and distance ( ); The total number of small groups; This represents the total simulation time.

[0059] Group fracture rate The proportion of "members leaving the group" during a small group movement can be expressed by formula (12).

[0060] (12) In the formula: The maximum distance between any two members; This is the distance threshold.

[0061] (6) Experimental results and analysis Experiments with different pedestrian sizes selected three key facility scenarios: corners, turnstiles, and station halls. Pedestrian sizes were increased in sequence from 50 to 150 people to evaluate the model's performance in assessing evacuation efficiency and group stability. Results showed that as the pedestrian size increased, the evacuation time in the three scenarios rose from 22.51s, 90.32s, and 83.74s to 27.48s, 135.40s, and 107.70s, respectively. The average waiting time increased accordingly, while the average movement speed decreased gradually, consistent with the physical laws governing limited passage resources. This demonstrates that the model can reasonably reflect the impact of size on efficiency. Regarding group stability, the variation in the distance between group members remained above 0.82 (maximum 0.95) in all three scenarios, and the group breakage rate was below 0.11, indicating that the model can effectively maintain the spatial cohesion and social stickiness within small groups. Especially in scenarios with a high load of 150 people, the model still keeps the breakage rate below 0.11 and the spacing change value above 0.82, verifying its robust modeling ability for pedestrian movement behavior under conditions of high passenger load and high challenge.

[0062] Table 1. Modeling performance analysis of critical facilities under different pedestrian scales.

[0063] Experiments were conducted with different small group proportions in a high-load scenario of 150 people, increasing the small group proportion from 0.0 to 1.0 (step size 0.1) to evaluate the modeling performance of the proposed CoT-LLM-SGM model on pedestrian movement patterns. The results show that as the small group proportion increases, the three scenarios exhibit a common three-stage evolution: at low proportions (<0.3), pedestrians are highly efficient and independent, with a gradual deterioration in evacuation indicators; at medium proportions (0.3~0.5), efficiency and coordination are traded off, with indicators deteriorating more rapidly but the group breakage rate ≤0.12; at high proportions (>0.5), strong coordination leads to low efficiency, and group cohesion reaches its peak (breakage rate ≤0.13). The model accurately depicts the cross-scenario pattern of "social interaction intensity sacrificing traffic efficiency for group cohesion."

[0064] Meanwhile, different physical constraints of facilities create differentiated patterns: turnstiles, as a severe bottleneck, amplify the series delay caused by group movement, resulting in the greatest efficiency degradation (movement time 108.90s→173.80s), but the group breakage rate only slightly increases (0.10→0.13), verifying the model's robustness in maintaining group non-dispersion under extreme constraints; the open space of the station hall has strong buffering capacity, with extremely slow growth in waiting time at medium to low proportions (1.24s→8.53s), and the most gradual change in group spacing (0.78→0.92), demonstrating the advantages of multi-path parallel coordination; corners have limited visibility, with indicators falling between the two, and the model uses thought chain prediction to assist local coordination and avoid severe congestion. Experiments verify that the proposed model can adaptively adjust the modeling strategy according to the physical characteristics of the facilities, profoundly and flexibly simulating complex social movement behaviors.

[0065] Table 2. Modeling performance analysis of the model at different small group proportions at key facilities.

[0066] To verify the comprehensive performance of CoT-LLM-SGM under realistic high-load conditions, this section uses a pedestrian scale of 150 and a small group ratio of 0.35~0.50 as a benchmark, comparing it with SFM, CA, DDPG, and pure LLM baselines in three scenarios: corner, turnstile, and station hall. The results show that the proposed model performs best on all evaluation indicators, and its superiority stems from the systematic overcoming of the inherent limitations of different modeling paradigms. Compared to traditional physical-driven models (SFM, CA), CoT-LLM-SGM enables agents to recognize social situations such as "companions" and "courtesy" through semantic understanding embedded in LLM. It can predict detours at corners, negotiate alternating passage at turnstiles, and coordinate path selection in station halls, thus achieving forward-looking group planning. This results in a comprehensive improvement in traffic efficiency and group stability: evacuation time is reduced by 17.4%~22.2% compared to SFM and by 13.7%~19.4% compared to CA; average waiting time is reduced by 18.6%~49.7% (compared to SFM) and 14.2%~40.0% (compared to CA); and the group breakage rate is only 0.09~0.11, significantly lower than SFM (0.19~0.20) and CA (0.12~0.14). Compared to the data-driven DDPG model, CoT-LLM-SGM overcomes the limitations of black-box decision-making and generalization through explicit semantic reasoning, reducing evacuation time by 8.8%–17.7% and average waiting time by 7.9%–38.0%, with the most significant efficiency improvement (17.7%) in station hall scenarios. Compared to the pure LLM baseline without CoT, the performance is further improved after embedding the thought chain mechanism: evacuation time is reduced by 4.5%–13.5%, average waiting time is reduced by 5.1%–17.6%, and the group breakage rate is further optimized in complex scenarios, proving that CoT guides agents to rationally balance individual efficiency and group collaboration through explicit multi-step reasoning, resulting in a more stable and collaborative movement strategy. In summary, CoT-LLM-SGM, which integrates large language model semantic understanding and explicit thought chain reasoning, comprehensively surpasses existing paradigms in terms of passage efficiency and group stability, providing an effective method for refined social cognitive simulation.

[0067] Table 3 Comparative Analysis of Modeling Performance of Selected Models for Key Facilities

[0068] A subway station was selected as the global scenario prototype to test the performance of the proposed model CoT-LLM-SGM in a complex hub environment. The results show that, for all small group proportions (0.35–0.50), the proposed model achieves simultaneous improvement in both passage efficiency and group stability compared to the LLM baseline without a thought chain. Taking a proportion of 0.45 as an example, the movement time decreased from 378.6s to 361.4s (a reduction of 4.5%), the average waiting time decreased from 25.6s to 20.4s (a reduction of 20.3%), and the group breakage rate was optimized from 0.14 to 0.11. Thanks to the global path prediction and proactive coordination guided by the thought chain, the model effectively alleviates the interweaving and conflict of multiple passenger flows in passageways and turnstile groups.

[0069] The superiority of the proposed model in the global scenario lies in the organic integration of its modeling capabilities in the aforementioned local scenarios. Taking turnstiles as an example, the model achieves social collaborative decision-making beyond physical obstacle avoidance through semantic reasoning of "slowing down and yielding, and following closely after small groups have passed." When these local optimization capabilities are integrated and applied to a subway station complex system containing multiple corners, multiple turnstile groups, and multiple paths, the benefits are superimposed and manifested on a global scale. This successfully realizes a research closed loop from "local facility verification" to "overall hub evaluation," demonstrating that CoT-LLM-SGM has good scalability and practical application potential.

[0070] Table 4. Modeling performance analysis under different small group proportions

[0071] The crowd motion modeling system based on a large language model provided by this invention will be described below. The crowd motion modeling system based on a large language model described below can be referred to in correspondence with the crowd motion modeling method based on a large language model described above.

[0072] Figure 4 This is a schematic diagram of the structure of the crowd motion modeling system based on a large language model provided in an embodiment of the present invention.

[0073] like Figure 4 As shown, the crowd motion modeling system based on a large language model provided in this embodiment includes: The multi-dimensional interaction feature extraction module 401 is used to construct a multi-dimensional interaction feature system of pedestrian-small group-environment. It adopts a dilated three-dimensional convolutional network to extract spatiotemporal scene and individual pedestrian features, uses scene space micro-unit segmentation to compare the strength of the relationship between pedestrians, and adopts a dynamic group segmentation method of micro-unit aggregation to identify and quantify the micro-behavioral features of small groups. The perception and encoding module 402 uses a large language model to guide the agent to perceive its local environment, including spatial state, social state, group state, and other information, and encodes the state information. The task description module 403 encodes status information into prompts, including task, role definition, environment, and thought chain, and uses the thought chain to guide path adjustment and group behavior coordination decisions in continuous movement. The conflict resolution action execution module 404 adopts a conflict resolution mechanism based on random priority to simulate nondeterministic yielding behavior between pedestrians; The hybrid update decision module 405 triggers an LLM high-level decision instruction every N basic time steps through prompt words, guiding the agent to embed walking preferences, correct walking direction, coordinate group walking and other motion constraints, and dynamically perceive the surrounding environment. Training and testing module 406 is used for training and testing pedestrian evacuation at transportation hubs; The instance verification module 407 is applied to three key facility scenario datasets: corners, turnstiles, and station halls. Through experiments with different pedestrian scales, different small group proportions, multi-baseline model comparison experiments, and mind chain ablation experiments, the performance of the crowd movement modeling method based on the large language model is verified.

[0074] The specific implementation method of the crowd motion modeling system based on a large language model provided in this embodiment can be implemented with reference to the above embodiment, and will not be repeated here.

[0075] Figure 5 An example is a schematic diagram of the physical structure of an electronic device, such as... Figure 5 As shown, the electronic device may include a processor 510, a communications interface 520, a memory 530, and a communication bus 540. The processor 510, communications interface 520, and memory 530 communicate with each other via the communication bus 540. The processor 510 can call logical instructions from the memory 530 to execute a crowd movement modeling method based on a large language model.

[0076] Furthermore, the logical instructions in the aforementioned memory 530 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0077] On the other hand, the present invention also provides a computer program product, which includes a computer program that can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer is able to execute the crowd movement modeling method based on the large language model provided by the above methods.

[0078] In another aspect, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to perform the crowd motion modeling method based on a large language model provided by the above methods.

[0079] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.

[0080] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., including several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods of various embodiments or some parts of embodiments.

[0081] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A crowd movement modeling method based on a large language model, characterized in that, include: Construct a multi-dimensional interaction feature system of pedestrians, small groups, and environment, and extract the behavioral features of small groups at key facilities in transportation hubs; Based on the behavioral characteristics of the small groups, a pedestrian movement decision-making framework based on a large language model and thought chain is constructed, a hybrid update decision-making strategy is designed, and training and testing of pedestrian evacuation at transportation hubs are conducted. For case verification, typical facility scenarios of transportation hubs and real station videos were selected to construct a pedestrian small group motion modeling framework based on the enhanced large language model of thought chain, so as to realize the refined simulation of the small group motion behavior of pedestrians in the hub. The effective modeling performance was verified through experiments with different pedestrian sizes, different small group proportions, multi-baseline model comparison experiments and thought chain ablation experiments.

2. The crowd motion modeling method based on a large language model according to claim 1, characterized in that, The construction of a multi-dimensional interaction feature system for pedestrians, small groups, and the environment, and the extraction of behavioral features of small groups at key facilities in transportation hubs, include: Based on video acquisition and computer vision technology, the spatiotemporal trajectory and behavioral characteristics of pedestrians are extracted; We employ micro-unit segmentation and dynamic group partitioning methods to identify and quantify the micro-behavioral characteristics of small groups.

3. The crowd motion modeling method based on a large language model according to claim 2, characterized in that, The extraction of pedestrians' spatiotemporal trajectories and behavioral features based on video acquisition and computer vision technology includes: To capture dynamic contextual information in video clips, a pre-trained dilated 3D convolutional network is used as the backbone network. The classic 2D convolutional kernel is dilated into 3D, enabling it to learn spatial appearance and temporal motion information simultaneously. The 3D feature map output by the last convolutional layer of the network is extracted as a global spatiotemporal semantic representation of the entire video clip, encoding the dynamic patterns of the scene. To obtain the detailed features of each pedestrian, object detection and feature alignment techniques are combined. The detector is used to locate the pedestrian bounding box frame by frame. Interest region alignment is used to accurately map each bounding box onto the feature map generated by the I3D network. A fixed-size feature vector is then pooled. Each pedestrian is represented as an individual feature vector that integrates appearance and short-term motion.

4. The crowd motion modeling method based on a large language model according to claim 2, characterized in that, The method employs micro-unit segmentation and dynamic group partitioning to identify and quantify the micro-behavioral characteristics of small groups, including: For scene space micro-unit segmentation that takes into account the difference in the strength of relationships, the scene space is first divided into several micro-units, and a graph attention network is used to directly learn the potential interactions and seamlessly capture the global activity context. The distance between pedestrians can be calculated using the following formula (1). (1) In the formula: and pedestrians and pedestrians time step , where This represents the distance between pedestrians; the smaller the value, the closer the pedestrians are. When two pedestrians are moving in opposite directions, they will not be considered as the same group even if they are close to each other. Therefore, the similarity of their walking directions can be calculated using the following formula (2). (2) In the formula: This represents the similarity in the direction pedestrians are walking; a larger value indicates a higher degree of similarity in their walking directions. For pedestrians time step The velocity vector, with the symbol "·" representing the dot product of vectors; The pedestrian's speed value is calculated using the following formula (3). (3) In the formula, The smaller the value, the more similar the pedestrians' speed values ​​are. Let L be the L2 norm of the vector; Since pedestrians in a group have similar distances, similar walking directions and speed values, the similarity of pedestrians is calculated as shown in equation (4) by integrating equations (1), (2) and (3) based on the group characteristics. (4) In the formula: For pedestrian similarity, and Each parameter has a different weight; Pedestrian similarity The higher the height, the more pedestrians there are. and pedestrians time step The greater the likelihood that two pedestrians belong to the same group, the higher their similarity exceeds a threshold. At that time, the two pedestrians were classified into the same group, threshold Fine-tuning is performed based on different scenarios; through iterative calculations, all pedestrians are eventually assigned to a group. Then, the maximum similarity value between each pair of pedestrians within each group is calculated, and the coordinates of the pedestrian with the maximum similarity value are selected as the center coordinates of that group. ; The spectral graph clustering algorithm is used to aggregate several micro-units into small groups. The clustering mainly considers the similarity within units and the conflict between units. The system selects supervised self-organizing networks and self-organizing behaviors to classify pedestrians into individuals and small groups, achieves grouping of the entire scene, treats small groups as entities, calculates the movement trajectory of the center point, and finally achieves feature extraction of small groups. Among them, intra-unit similarity represents the consistency level of cooperation among pedestrians in the group. The closer the distance between pedestrians in the group, the more similar their speed values ​​and the more similar their walking directions, the stronger the intra-unit consistency. An intra-unit similarity function is proposed to quantify the consistency level of pedestrians in the group based on distance, speed value and walking direction, as shown in equation (5). (5) In the formula, Indicates intra-unit similarity, and pedestrians and pedestrians time step The direction vector; and pedestrians and pedestrians time step The velocity vector; For pedestrians and pedestrians Euclidean distance between them; Inter-unit conflict refers to the interaction or friction between groups when they approach each other. When pedestrians walk, it is inevitable that they will overtake and meet. Two groups walking in opposite directions will influence each other and may collide. As the distance decreases and the speed difference increases, the level of conflict between groups increases. When the group behind tries to overtake the group in front from one side, the obstruction of the group in front will cause a one-way influence from the group in front to the group behind, as shown in the following formula (6). (6) In the formula, For the group with the group At time step The inter-unit conflict level; the larger the value, the more intense the inter-group conflict. For the group The L2 norm of the velocity vector; For the group The L2 norm of the velocity vector; For the group The angle between the direction of motion and the direction of the line connecting the centers of the two groups; For the group The angle between the direction of motion and the direction of the line connecting the centers of the two groups; for The cosine value is used to determine the group. Should we move towards or away from the other person? for The cosine value is used to determine the group. Should we move towards the other person or move away from them? In time step group with the group The Euclidean distance between the centers.

5. The crowd motion modeling method based on a large language model according to claim 1, characterized in that, The construction of the pedestrian movement decision-making framework based on a large language model and thought chain includes: In a large language model, an agent perceives the local environment, including spatial state, social state, and group state information, and encodes the state information. Spatial state refers to the acquisition of the occupancy of its own grid and its Moore neighborhood, as well as the distance gradient to the target exit, based on the idea of ​​cellular automata. Social state refers to the identification of the identities of neighboring agents and their relative speed and direction of movement. Group state refers to the position and state of other members in the group. Status information is encoded into cue words, which include task, role definition, environment and thought chain, and the thought chain is used to guide path adjustment and group behavior coordination decisions in continuous movement; A conflict resolution mechanism based on random priority is used to simulate nondeterministic yielding behavior between pedestrians; Design a hybrid update decision-making strategy to guide the agent to embed walking preferences, correct walking direction, and coordinate the motion constraints of group walking; Conduct training and testing on pedestrian evacuation at transportation hubs.

6. The crowd motion modeling method based on a large language model according to claim 5, characterized in that, The aforementioned conflict resolution mechanism, based on random priority, simulates nondeterministic yielding behavior between pedestrians, including: At the beginning of the decision cycle, each agent is assigned a randomly generated priority value P_i ~ U(0,1); When a conflict occurs, the system compares the priorities of all agents competing for the same grid, and the agent with the lowest P_i value gains the right to occupy the grid. Agents that fail to move will remain in place at the current time step.

7. The crowd motion modeling method based on a large language model according to claim 5, characterized in that, The design incorporates a hybrid update decision strategy, guiding the agent to embed walking preferences, correct walking direction, and coordinate the motion constraints of group walking, including: Every N basic time steps, an LLM high-level decision instruction is triggered to guide the agent to embed walking preferences, correct walking direction, coordinate the motion constraints of group walking, and dynamically perceive the surrounding environment. Within the time steps between adjacent LLM decision points, the policy guides the agent to perform local obstacle avoidance through cellular automata local rules. LLM provides policy guidance based on semantic understanding, while local rules ensure the feasibility of the agent's physical movements and real-time obstacle avoidance. For agent i at time t, its local rule velocity term... and LLM boot speed item Through time-varying weighting coefficients Organic integration is achieved, as shown in formula (7) below. (7) Local rule velocity term The agent i is guided to safely avoid obstacles in the local environment at time t, which conforms to the following formula (8). (8) In the formula: Repulsive potential for pedestrians / obstacles; The wall's repulsive force; Let be the unit vector of attraction pointing towards the exit; , as well as These are the weighting coefficients; LLM-guided global speed item Provide high-level strategic decisions for agent i at time t, which conforms to the following formula (9). (9) In the formula: The LLM cue words output by the strategy are parsed into a continuously effective guidance velocity vector; The direction points to the sub-target point defined by LLM; For comfortable speed; The guiding force intensity coefficient; Time-varying weighting coefficients It is the key to dynamically adjusting the global guidance speed term and the local rule speed term of LLM, which can effectively adjust the "discourse power" of LLM decision-making, and conforms to the following formula (10). (10) In the formula: The basic weights are maximized at the initial time after the LLM decision; The term is an exponential decay term, simulating the time-varying decay of the influence of LLM decisions. It tends to zero before the next LLM decision cycle, thus avoiding interference from outdated instructions. For the conflict detection function, when a severe conflict is detected between the LLM guidance direction and the local environment, the function value drops sharply or even to zero, and the strategy automatically degenerates into pure local rule dominance. .

8. The crowd motion modeling method based on a large language model according to claim 5, characterized in that, The effective dispersal performance of the crowd movement modeling method based on a large language model was verified through experiments with different pedestrian sizes, different small group proportions, multi-baseline model comparison experiments, and thought chain ablation experiments. The performance of a given model is evaluated using five metrics: evacuation time, average waiting time, average movement speed, change in spacing between group members, and group breakage rate. Evacuation time, average waiting time, and average movement speed are used to measure the model's macroscopic evacuation efficiency for small groups of pedestrians. The shorter the evacuation time and average waiting time, and the higher the average movement speed, the higher the pedestrian evacuation efficiency. Change in spacing between group members and group breakage rate are used to evaluate the model's stability in maintaining the internal structure of the group. The smaller the change in spacing between group members and the lower the group breakage rate, the more stable the small group structure. Change in distance between group members It is used to measure the degree of change in the internal spatial structure of a small group during movement, and conforms to the following formula (11). (11) In the formula: , They are time points , small groups Internal members and distance ( ); The total number of small groups; This represents the total simulation time. Group fracture rate The proportion of "members leaving the group" during a small group movement is measured by the following formula (12). (12) In the formula: The maximum distance between any two members; This is the distance threshold.

9. A crowd motion modeling system based on a large language model, employing the crowd motion modeling method based on a large language model as described in any one of claims 1-8, characterized in that, include: The multi-dimensional interaction feature extraction module is used to construct a multi-dimensional interaction feature system of pedestrians, small groups, and environment. It adopts a dilated 3D convolutional network to extract spatiotemporal scene and individual pedestrian features, uses scene space micro-unit segmentation to compare the strength of the relationship between pedestrians, and adopts a dynamic group segmentation method of micro-unit aggregation to identify and quantify the micro-behavioral features of small groups. The perception and encoding module uses a large language model to guide the agent to perceive its local environment, including spatial state, social state, group state, and other information, and to encode state information. The task description module encodes status information into prompts, including task, role definition, environment, and thought chain. It uses the thought chain to guide path adjustment and group behavior coordination decisions in continuous movement. The conflict resolution action execution module adopts a conflict resolution mechanism based on random priority to simulate nondeterministic yielding behavior between pedestrians; The hybrid update decision module triggers a high-level LLM decision instruction every N basic time steps through prompt words, guiding the agent to embed walking preferences, correct walking direction, coordinate group walking and other motion constraints, and dynamically perceive the surrounding environment. The training and testing module is used for training and testing pedestrian evacuation at transportation hubs. The instance verification module is applied to three key facility scenario datasets: corners, turnstiles, and station halls. Through experiments with different pedestrian scales, different small group proportions, multi-baseline model comparison experiments, and mind chain ablation experiments, the performance of the crowd movement modeling method based on the large language model is verified.