Method for generating group trajectory coordination based on space-time relationship modeling under dynamic environment
By integrating graph attention networks, deformable Transformers, and generalized Markov game mechanisms, the instability problem of multi-pedestrian trajectory generation in complex and dynamic crowd environments is solved, achieving efficient and orderly collaborative generation of group trajectories and autonomous navigation of intelligent agents.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CHANGCHUN UNIV OF TECH
- Filing Date
- 2026-07-01
- Publication Date
- 2026-07-31
AI Technical Summary
Existing intelligent agent navigation methods struggle to accurately describe the long-term spatiotemporal interaction relationships and collaborative behavior characteristics among multiple pedestrians in complex and dynamic crowd environments. This results in poor stability of path planning and obstacle avoidance decisions, especially in high-density multi-agent interaction scenarios where problems such as trajectory oscillation, local congestion, and trajectory overlap are prone to occur.
A spatiotemporal feature extraction model combining a fused graph attention network and a deformable Transformer is adopted. By combining bipartite graph optimal matching and generalized Markov game mechanism, the orderly generation and dynamic collaborative control of multi-subject trajector trajectories are achieved through adaptive sparse sampling and trajectory alignment. Policy entropy gain and long-term value evaluation algorithms are introduced to optimize the group trajectory generation process.
It improves the realism, continuity, and stability of group trajectory generation, reduces future trajectory conflicts and local congestion, and enhances the autonomous navigation capability of intelligent agents in complex dynamic environments.
Smart Images

Figure CN122491079A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of pedestrian behavior modeling and group trajectory generation, specifically a method for collaborative generation of group trajectories based on spatiotemporal relationship modeling in dynamic environments. Background Technology
[0002] Existing intelligent agent navigation methods generally suffer from insufficient modeling of the evolutionary patterns of group movement in complex and dynamic crowd environments. A group refers to a hybrid interactive set consisting of an intelligent agent and multiple pedestrians, making it difficult to accurately describe the long-term spatiotemporal interaction relationships and collaborative behavioral characteristics among multiple pedestrians. This results in poor stability of the agent's path planning and obstacle avoidance decisions in dynamic environments. Especially in high-density, multi-agent interaction scenarios, pedestrian movement exhibits significant group coupling characteristics. Individual trajectories are influenced by the movement trends of neighboring pedestrians, the degree of local congestion, and the overall group flow direction. Methods relying solely on independent modeling of a single agent are insufficient to accurately depict the real-world group movement process.
[0003] Methods for generating crowd trajectories mainly fall into two categories: rule-based models and deep learning-based methods. Rule-based models typically employ social force models, velocity obstacle methods, artificial potential field methods, or cellular automata models, using manually defined repulsive, attractive, or obstacle avoidance rules to describe the interactions between pedestrians. While these methods offer some interpretability, their reliance on human experience in designing interaction rules makes it difficult to accurately reflect the behavioral evolution of real-world crowds in complex dynamic environments. When environmental density is high or group interactions are complex, problems such as trajectory oscillations, localized congestion, trajectory overlap, and abrupt changes in movement trends can easily occur, making it difficult to generate continuous and stable crowd trajectories.
[0004] Deep learning-based methods typically utilize recurrent neural networks, graph neural networks, and Transformer models for data-driven modeling of pedestrian historical trajectories. Graph neural networks can model spatial interactions between pedestrians, while Transformers can learn long-term dependencies in trajectory sequences, improving trajectory prediction accuracy to some extent. However, traditional Transformer models generally employ globally dense self-attention mechanisms when processing long-term trajectories, leading to a quadratic increase in computational cost with sequence length, resulting in enormous computational overhead in high-density multi-agent scenarios. Furthermore, global attention mechanisms lack temporal focusing capabilities, failing to effectively capture the spatiotemporal features of pedestrians at key turning points in their movement trends. In addition, most existing methods still treat individual pedestrians as independent prediction objects, often resulting in disordered future trajectories and a lack of exclusive subject alignment mechanisms. When the future trajectories of multiple pedestrians intertwine within the same spatiotemporal region, irrational and uncoordinated problems such as predicted trajectory overlap, identity confusion, and inconsistent group movement directions easily arise.
[0005] To address the aforementioned problems, this invention proposes a collaborative generation method for group trajectories that integrates spatiotemporal alignment feature modeling with multi-agent dynamic game decision-making. This invention constructs a spatiotemporal feature extraction model based on graph attention networks and deformable Transformers. It utilizes an adaptive sparse sampling mechanism to reduce the computational complexity of long-term feature extraction while accurately capturing key spatiotemporal dependencies in trajectory transitions. Furthermore, it introduces a trajectory alignment mechanism based on bipartite graph optimal matching to eliminate the interweaving and conflict in multi-pedestrian trajectory generation from the ground up. Building upon this, the invention injects the aligned initial reference trajectory into a generalized Markov game mechanism. By dynamically controlling and resolving conflicts in the joint action space, it improves the authenticity, continuity, and exclusivity of the generated group trajectory, and enhances the autonomous navigation capability and decision-making reliability of the agents in crowd environments. Summary of the Invention
[0006] This invention aims to address the challenges in complex, dynamic crowd environments where the lack of a joint optimization mechanism for the interrelationships between multiple stakeholders makes it difficult to characterize group collaborative behavior, leading to frequent trajectory conflicts and insufficient long-term spatiotemporal dependency modeling. To this end, this invention proposes a group trajectory generation method that integrates spatiotemporal topological alignment and multi-agent dynamic game theory. First, a graph attention network is used to extract high-order spatial interaction feature vectors. Then, a deformable Transformer prediction model is constructed, and a bipartite graph optimal matching mechanism based on the Hungarian algorithm is introduced. A multi-task matching cost matrix integrating trajectory shape span and absolute displacement of spatiotemporal points is designed to achieve exclusive spatiotemporal topological alignment between the generated trajectory and specific pedestrians. The exclusive future reference trajectory is integrated as a nonlinear structured geometric constraint into a generalized Markov game model. Finally, a logistic stochastic optimal response equilibrium deduction mechanism and a long-term value recursive evaluation algorithm incorporating policy entropy gain are used to transform the traditional discrete trajectory generation process into a distributed dynamic collaborative deduction process under a joint state space and action space.
[0007] The specific implementation steps are as follows:
[0008] Step 1: Establish a simulation environment. The algorithm in this invention needs to be trained and tested in a crowded and dynamic human-machine collaborative environment. Webots simulation software is used to customize the environment and add elements such as intelligent agents and pedestrians.
[0009] Step 2: Collect pedestrian historical trajectories. In order to accurately depict the spatial interaction relationship between pedestrians in a complex dynamic environment, this invention constructs a spatial interaction modeling module based on Graph Attention Network (GAT). By establishing a dynamic pedestrian interaction graph, the social influence relationship between neighboring pedestrians is modeled, and spatial interaction features containing social semantics are extracted and used as input for the subsequent time-series trajectory generation module.
[0010] Each pedestrian in the group is regarded as an independent graph node. A dynamic undirected graph structure is constructed based on the spatial distance and movement direction of the pedestrians. The node features are the spatiotemporal information such as the historical trajectory coordinates, speed, acceleration, and movement direction of the agent and the pedestrian. The edges represent the potential interaction relationships between the pedestrians.
[0011] Define the graph structure:
[0012] ,
[0013] ,
[0014] ,
[0015] ,
[0016] in Represents the pedestrian interaction topology graph. Representing pedestrian node features, For the number of pedestrians, For the original feature dimension, This represents the set of interaction edges between pedestrians. It is the set of real numbers; The weight matrix is linearly transformed, and the model continuously adjusts it based on the objective of trajectory prediction accuracy. The numerical values are processed until the original features are transformed into higher-dimensional features that are easier to process and more suitable for subsequent calculations. After linear transformation, the pedestrian node features are output. ,here This represents the dimension after linear transformation, for each pedestrian node. Corresponding new feature vector .
[0017] Step 3: Extract GAT spatial interaction features. Traditional methods typically establish adjacency relationships based solely on Euclidean distance between pedestrians, which is insufficient to describe the influence of motion trends in complex dynamic environments. Therefore, this invention considers the distance between pedestrians, motion direction, and speed differences simultaneously during the adjacency relationship construction process, constructing a dynamic interaction relationship matrix:
[0018] ,
[0019] in For pedestrians with pedestrians The strength of interaction between them To measure the Euclidean distance between pedestrians, a minimum threshold is set for the distance term to prevent the reciprocal of the Euclidean distance from diverging when two pedestrians are too close. ,when season , Indicates the angle between the directions of movement of the two pedestrians and , represents the minimum angle between the directions of movement of the two pedestrians. The velocity difference term is used to calculate the interaction intensity only when the two pedestrians are within the neighborhood. These are the weighting coefficients. This is the interaction threshold.
[0020] When the interaction strength satisfies the neighborhood constraint, interaction edges are established between nodes:
[0021] ,
[0022] in Let the edges represent the potential interaction relationships between people. This represents the set of interaction edges between pedestrians.
[0023] Compared with the traditional static adjacency method, this paper introduces motion trend relationships to achieve adaptive modeling of the impact of pedestrian spatial interaction in dynamic environments.
[0024] Perform a linear transformation on the features of each pedestrian node to obtain higher-dimensional feature information, and calculate the attention score:
[0025] ,
[0026] in For pedestrians The original feature vector, For the first The original feature vector of each pedestrian The weight matrix is a linear transformation matrix. The attention mechanism function and It can receive the feature vectors of two nodes.
[0027] Furthermore, masked self-attention is employed, focusing only on nodes. Nodes with interactive edge relationships Calculate attention scores and define the set of interactive neighbors:
[0028] ,
[0029] To dynamically measure the interaction influence of neighboring pedestrians on the target pedestrian, linear transformation and concatenation are performed on the features of the target node and neighboring nodes. The correlation score between nodes is calculated using an attention function, and a LeakyReLU non-linear activation function is introduced. To avoid the impact of differences in attention score scales between different nodes on model stability, a softmax function is used to process the attention scores, resulting in attention weights.
[0030] ,
[0031] in This is the attention weight, and its value range is... The larger the weight, the more pedestrians... right The stronger the influence of motion decisions, the more... This indicates a feature concatenation operation. This is the attention weight vector, used to calculate the interaction relevance score between nodes. Neighboring pedestrians The original feature vector, Indicates the target pedestrian The set of neighboring nodes, It is an exponential function. for The neighborhood set, For a single element in the set, This is a global traversal variable for the collection.
[0032] We perform weighted aggregation of neighborhood features to generate spatial interaction features that include social semantics:
[0033] ,
[0034] in This represents the spatial interaction characteristics after aggregation. It is a non-linear activation function.
[0035] To enhance the expressive power of spatiotemporal interaction features, this invention employs a multi-head graph attention mechanism. By setting multiple sets of independent linear transformation weight matrices, it calculates the attention weights between pedestrian nodes in parallel from multiple different perspectives, fully capturing multidimensional interaction information. The features output by each attention head are then concatenated and fused to obtain the final spatial interaction feature vector.
[0036] ,
[0037] in Indicates the number of attention heads. Indicates the first Attention weights corresponding to each attention head Indicates the first The linear transformation weight matrix corresponding to each attention head Indicates to The output features of each attention head are concatenated.
[0038] Step 4: Input the spatial interaction features into the deformable Transformer network, introduce the bipartite graph alignment mechanism, extract long-term dependencies by predicting the features of sparse sampling points in the time series, and use the Hungarian algorithm to complete the optimal alignment and allocation of the trajectory and the subject by minimizing the joint matching cost.
[0039] Step 4.1: Arrange the spatial interaction features output by the graph attention network in chronological order to construct a pedestrian historical trajectory feature sequence:
[0040] ,
[0041] in pedestrian Historical trajectory feature sequence, Indicates time The corresponding spatial interaction feature vector, This is the time step index, representing the historical trajectory time step corresponding to the current feature.
[0042] The Transformer model itself lacks temporal sequence awareness, so a positional encoding mechanism is introduced. To enhance the model's ability to model the topological relationships of group interactions, a structural encoding mechanism is further introduced on top of the positional encoding, resulting in a feature representation that integrates temporal and spatial structural information.
[0043] ,
[0044] in This is a temporal feature sequence after embedding location information, which integrates the interaction features of the trajectory and temporal order information. For position encoding vectors, For structural encoding weight coefficients, For structural encoding.
[0045] Step 4.2: In the encoder layer, the traditional Transformer uses a global dense self-attention mechanism, which causes the computational cost to increase quadratically with the sequence length. Therefore, a deformable self-attention mechanism is introduced to adaptively predict the sparse sampling point offset for each query feature, thereby achieving efficient long-term dependency modeling.
[0046] For a given query feature Let its two-dimensional reference point coordinates on the time series feature map be... Define deformable attention:
[0047] ,
[0048] in Indicates the index of the attention head. This represents the total number of heads. Indicates the index of the sampling point. The total number of sparse sampling points pre-defined in the spatiotemporal neighborhood of each query feature and , and The weight matrix is a learnable linear transformation. This represents the offset of the sampling point location predicted from the query features through a linear mapping. Since the offset coordinates are usually continuous values... From the feature sequence using bilinear interpolation Extract features from them, The adaptive attention weights are obtained by linear prediction of query features.
[0049] Step 4.3: To address the issues of disordered, overlapping, and non-exclusivity in the future trajectories of multiple pedestrians in traditional independent prediction methods, a bipartite graph optimal alignment mechanism is introduced. Given a set of true values generated collaboratively by a group of trajectories, the first step is to calculate the _th_ ... The node and the in the real set The cost of joint matching for individual pedestrians:
[0050] ,
[0051] in, This represents the set of invalid padding indices for pedestrians who are not moving. For indicator functions, and To balance the hyperparameters.
[0052] Furthermore, the joint matching cost consists of two parts:
[0053] The cost of matching trajectory shape and span is used to constrain the macroscopic consistency of movement trends:
[0054] ,
[0055] in Indicates the first The total span of the actual trajectory displacement of a pedestrian. Indicates the first The total span of the predicted trajectory.
[0056] Spatiotemporal alignment cost, used to precisely constrain the spatial proximity of each time step:
[0057] ,
[0058] in For the first The real trajectory of individual pedestrians in the future Two-dimensional coordinates of time, For the corresponding predicted coordinates, This represents the total number of future time steps predicted.
[0059] Step 4.4: Use the Hungarian algorithm to dynamically solve for the optimal assignment mapping of the bipartite graph, minimizing the total matching cost:
[0060] ,
[0061] in Let be a fully injective mapping function. To query the number of trajectories, For the first The trajectory is assigned to the first The matching cost for each target and the optimal allocation mapping result ensure that the trajectory output of each person in a high-density population is orderly and there will be no identity confusion or trajectory overlap.
[0062] Through this optimal allocation mapping, the generated unordered future reference trajectories are exclusively aligned with specific pedestrians, ultimately determining the future reference trajectory sequence for each pedestrian:
[0063] ,
[0064] in For the first The number of the predicted trajectory assigned to each pedestrian. The total number of time steps for future predictions. It is numbered The predicted trajectory in the first Predicted location values at each time step.
[0065] By extracting sparse features from a set of deformable Transformers and aligning them with Hungarian trajectories, efficient and ordered initialization of group trajectories in complex dynamic environments is achieved, avoiding the intermingling and conflict of generated trajectories from the bottom layer.
[0066] Step 5: Design a generalized Markov game mechanism. Traditional trajectory prediction methods usually only predict the future movement state of a single pedestrian independently, lacking a joint optimization mechanism for the mutual influence between groups, which can easily lead to problems such as conflict, overlap and incoordination of group behavior between future trajectories.
[0067] This invention uses a deformable Transformer temporal prediction network and a bipartite graph alignment mechanism to generate initial reference prediction trajectories for each pedestrian, thus initially resolving the problem of disordered trajectory interleaving at the underlying level. However, considering the rapidly changing and deeply coupled characteristics of social intentions and motion states among multiple agents in complex dynamic environments, a generalized Markov game coordination mechanism is further introduced to dynamically and collaboratively correct the aforementioned reference trajectories. By deeply fusing the extracted long-term spatiotemporal dependency features with the state transition probabilities of the Markov game, the dynamic deduction of the logically stochastic optimal response of the agents and pedestrians in the joint dynamic space is realized. This resolves trajectory conflicts and improves the realism and social rationality of group collaborative generation while satisfying kinematic feasibility.
[0068] Step 5.1: Within the framework of the generalized Markov game, the agent and surrounding pedestrians constitute a multi-agent interaction set. The agent and pedestrians share a unified state space and action space description, and their movements are coupled in the dynamic environment, jointly influencing the environmental state transition process. Specifically, the agent outputs autonomous navigation actions through a policy network, while pedestrians participate in joint state evolution based on trajectory prediction results and local interaction rules, thus forming a multi-agent game relationship in a complex dynamic environment.
[0069] The generalized Markov game is defined as follows:
[0070] ,
[0071] in Represents a set of multiple subjects. Represents the generalized state space. Represents the action space set, Represents the state transition function. Let be the initial state distribution function. Represents the reward function and trajectory constraints. This is used to constrain the safety, kinematic feasibility, and social rationality of the trajectory generation process, ensuring the generation of continuous, smooth, and collision-avoidance-compliant executable trajectories in dynamic environments. Represents the discount factor and It is used to weigh immediate and future benefits.
[0072] In the aforementioned multi-agent set, intelligent agents and pedestrians assume different roles within the game framework. Intelligent agents, as active decision-makers, autonomously output actions based on the current joint state through the policy network, possessing complete perception, decision-making, and execution capabilities. Pedestrians, as passive participants, do not have their actions generated by an independent policy network; instead, they are determined by a prediction module based on historical trajectory predictions, injected into the joint state evolution process as reference trajectories. Both types of agents share a unified state and action space description, but their action generation mechanisms differ fundamentally. Intelligent agent actions are constrained by policy optimization objectives, while pedestrian actions are constrained by trajectory prediction models. This design allows pedestrian movement to participate in the joint state transitions of multi-agent games in a structured manner, while avoiding unnecessary assumptions about active decision-making on pedestrians. Thus, while ensuring the theoretical integrity of the game framework, it more accurately reflects the interaction characteristics in real-world human-machine collaborative scenarios.
[0073] The generalized state space is jointly constructed by the agent and the reference trajectories of each pedestrian:
[0074] ,
[0075] exist At any given moment, the state is determined by the agent's current position. Current location of each pedestrian constitute.
[0076] Step 5.2: To ensure a continuous and smooth trajectory, avoid abrupt changes in actions, and improve the fine-grained control capability of trajectory coordination in complex dynamic environments, curvature constraints can be introduced to limit the steering angular velocity. The main action is defined as a joint action vector that includes speed adjustment, direction offset, trajectory curvature adjustment, and neighborhood collision avoidance control.
[0077] Define multi-agent actions:
[0078] ,
[0079] To adjust the speed increment, This represents the offset in the direction of motion. This represents the amount of trajectory curvature adjustment.
[0080] The above definition of action vectors applies to all agents, but the sources of action generation for each agent differ fundamentally. Agent actions are output in real time by the policy network, while pedestrian actions are obtained from known reference trajectories and participate in the calculation as known conditions rather than optimization variables during joint decision-making. Both types of agents share the same action description form to ensure that the joint action vector has a unified mathematical expression foundation within the game framework.
[0081] Step 5.3: Under the combined action, the motion state of the subject evolves dynamically over time, and the state transition process is simultaneously affected by motion speed, direction change, trajectory curvature and neighborhood interaction intensity.
[0082] Define multi-agent states:
[0083] ,
[0084] Indicates spatial location, Indicates the current speed of motion. Indicates the direction angle of motion. Represents the curvature of the trajectory. This represents the local neighborhood density.
[0085] Location update:
[0086] ,
[0087] ,
[0088] The time interval for state updates. This represents the spatial location at the next moment.
[0089] Speed updates:
[0090] ,
[0091] Indicates the velocity at the next moment. This represents the neighborhood density inhibition coefficient, which measures the influence weight of local crowding on the agent's velocity change. The higher the local neighborhood density, the more obvious the inhibition effect on the agent's motion.
[0092] Curvature update:
[0093] ,
[0094] This represents the curvature of the trajectory at the next moment. Indicates the coefficient for suppressing changes in direction. This represents the absolute value of the directional offset, used to measure the magnitude of change in the direction of motion. By dynamically constraining the trajectory curvature, abrupt trajectory changes and path oscillations can be effectively reduced, improving trajectory continuity.
[0095] Step 6: Traditional agent decision-making methods typically employ deterministic action selection mechanisms. While these mechanisms can improve the efficiency of utilizing locally optimal actions, they are prone to problems such as policy simplification, local congestion, or long-term revenue degradation in complex dynamic environments. Especially in human-computer interaction scenarios, there is a clear behavioral coupling and dynamic game relationship between the agent and the pedestrian. Simply relying on deterministic strategies is insufficient to effectively describe the random interactive behaviors between the agents.
[0096] Step 6.1: To enable the agent to not only focus on the immediate gains at the current moment in a complex dynamic environment, but also to comprehensively consider the long-term impact of future continuous decisions, this invention introduces a long-term gain evaluation mechanism based on discounted cumulative rewards. By weighting and accumulating the rewards at each future moment, the agent can achieve a more reasonable global trade-off between path efficiency, motion safety, and human-computer interaction stability, thereby avoiding short-sighted decision-making problems caused by relying on instantaneous rewards. At the same time, in human-computer interaction scenarios, this long-term gain modeling method can more effectively characterize the dynamic game relationship between the agent and the pedestrian that evolves over time.
[0097] Long-term returns are defined as the expected sum of discount rewards at future moments:
[0098] ,
[0099] in, The current time step is the starting point for calculating the expected return. For any future time step and , This is a power term of the discount factor, used to reduce the weight of future rewards. The larger, The smaller the value, the less impact it has on current decisions. From time until the end time The state sequence, From time until the end time The sequence of actions, A joint strategy for intelligent agents and pedestrians. For the agent's strategy, For pedestrians' strategy set, The immediate reward obtained by the intelligent agent. For any future moment The global state, For a moment The joint action of intelligent agents and pedestrians For a moment The global state, For intelligent agents at any time The actions taken.
[0100] Step 6.2: The agent's decision-making is modeled using Logistic Stochastic Best Response Equilibrium (LSBRE). Unlike the absolute rationality assumption in traditional game theory, this mechanism maps payoffs to probabilities. Actions with higher payoffs have a greater probability of being selected. However, the characteristics of the exponential function determine that even if a certain action has the highest payoff, it will not completely eliminate the probability of selecting other actions. Instead, it retains the possibility of selecting the second-best action, thus more accurately simulating the non-absolutely rational interactive behavior caused by perceptual bias or risk-taking motivation during decision-making.
[0101] LSBRE's random policy:
[0102] ,
[0103] The random policy is represented in the global state. Trajectory constraints Select action below The probability, A collection of pedestrian actions. These are alternative actions for the agent.
[0104] Step 6.3: Since the LSBRE decision-making mechanism needs to recursively evaluate the long-term interaction benefits between the agent and the pedestrian in a dynamic environment, its value estimation process is not constructed independently. Instead, it is based on the state space, action space, and state transition probabilities defined by the generalized Markov game model. By recursively calculating the long-term benefits of the state transition process, environmental evolution information, agent interaction relationships, and trajectory constraint mechanisms are integrated into the strategy value evaluation process, thereby achieving more stable joint decision optimization in a dynamic environment.
[0105] To balance immediate rewards with long-term decision-making benefits, a policy entropy term is further introduced into the value assessment process to quantify the uncertainty of actions. Through entropy gain constraints, the agent maintains necessary exploration capabilities while obtaining high rewards, thereby reducing the risk of policy oscillations in complex interactive environments.
[0106] Incorporating policy entropy into decision-making:
[0107] ,
[0108] Policy Entropy It quantifies the randomness of the strategy; a higher entropy value indicates more dispersed decision-making and a stronger exploratory nature. Indicating in strategy The expectation operator.
[0109] An agent value evaluation mechanism based on fusion entropy gain is used to measure the immediate feedback of action combinations to changes in environmental state, and policy entropy is introduced to quantify the uncertainty of the agent's future decisions.
[0110] ,
[0111] Q-value function in instant reward Based on this, the entropy gain of the future state is recursively added to the expected Q value of the subsequent state. Through the state transition and the expectation of the joint policy, the long-term return is estimated. As trajectory constraints, for the next state Take the expected value, state transition probability This indicates the transition from the current state to the next state under trajectory constraints. The transfer process, for the joint action in the next moment. Take the expected value. Obey the joint strategy of the agent and the pedestrian , This indicates that the agent relies on immediate rewards. Global state at time 1 Intelligent agent actions Combined motion vectors with pedestrians .
[0112] Step 6.4: The goal of the LSBRE method is to maximize both reward and entropy. To this end, Markov chains provide transition probabilities representing the sequential equilibrium in the action space, iteratively updating the agent's policy:
[0113] ,
[0114] For intelligent agents at any time The conditional transition probability, Indicates the first In the next iteration, the pedestrian's action sampling vector Indicates the first intelligent agent The action sampling variable for the next iteration.
[0115] With the number of iterations The Markov chain converges to a stationary distribution, ultimately yielding the joint policy distribution of the agent and the pedestrian:
[0116] ,
[0117] in It is a probability measure, representing the probability of a random event occurring. Indicates the agent's state The action sampling variables are used to generate action sequences that satisfy LSBRE. Together they describe the combination of behaviors of all interacting entities at a given moment.
[0118] A joint loss function is constructed based on trajectory prediction error, optimal alignment error, collaborative decision-making error, and equilibrium convergence error, and the entire group trajectory collaborative generation network is trained end-to-end.
[0119] To achieve collaborative generation and conflict resolution of multi-pedestrian trajectories in dynamic environments, this invention constructs a collaborative training framework that integrates graph attention network, deformable Transformer temporal prediction, bipartite graph optimal alignment, generalized Markov game, and LSBRE stochastic policy optimization. The specific steps are as follows:
[0120] Step 1: Initialize the cooperative network architecture parameters;
[0121] Step 2: Construct a dynamic crowd simulation environment and create a pedestrian interaction map;
[0122] Step 3: Extract spatial interaction features using graph attention networks;
[0123] Step 4: Generate a reference trajectory based on deformable temporal prediction and optimal alignment of bipartite graph;
[0124] Step 5: Construct a generalized Markov game model and perform trajectory collaborative optimization;
[0125] Step 6: Joint decision-making and value assessment based on the LSBRE stochastic strategy;
[0126] Step 7: Update the network parameters until the training termination condition is met; otherwise, repeat the above steps in sequence.
[0127] This invention provides a collaborative generation method for group trajectories in dynamic environments based on spatiotemporal relationship modeling. By integrating graph attention network spatial interaction modeling, adaptive sparse sampling-based deformable Transformer long-term temporal prediction, bipartite graph optimal matching-based trajectory exclusive alignment mechanism, and generalized Markov game coordination mechanism into the trajectory generation framework, it achieves joint optimization and collaborative generation of multi-pedestrian trajectories in complex dynamic environments. This method can dynamically learn the spatial interaction relationships and long-term behavioral evolution patterns among pedestrians during group movement, and achieve ordered alignment of multi-agent trajectories by minimizing the joint matching cost matrix. Combined with multi-agent joint state transition and stochastic policy decision-making mechanisms, it effectively reduces problems such as future trajectory conflicts, local congestion, and group behavioral incoordination. Compared with traditional independent trajectory prediction methods, this invention further achieves a deep integration of spatiotemporal sparse dependency modeling, group exclusive behavior coordination, and stochastic game decision-making. This not only improves the realism, continuity, exclusivity, and stability of group trajectory generation, but also enhances the robustness of agent behavior prediction and autonomous decision-making in complex dynamic environments. This method has good engineering application value and can be widely applied in fields such as intelligent navigation, crowd simulation, unmanned system path planning, and group behavior analysis in complex public scenarios. The technical solution of the present invention has the following beneficial technical effects:
[0128] 1. This invention combines the adaptive sparse sampling mechanism of the deformable Transformer with the bipartite graph optimal matching mechanism based on the Hungarian algorithm. At the feature extraction level, by adaptively predicting the positional offset of sparse sampling points, global dense attention is transformed into local focused computation of key temporal nodes, significantly reducing computational overhead while accurately capturing key turning features such as pedestrian collisions and turns. For trajectory alignment, a multi-task matching cost matrix integrating trajectory shape span and spatiotemporal absolute displacement is constructed, and the global allocation mapping is dynamically solved using the Hungarian algorithm. This deep coupling not only makes feature extraction more focused and efficient but also ensures ordered mapping between future trajectories in high-density scenes from the data source.
[0129] 2. This invention proposes a collaborative generation method for group trajectories that integrates a generalized Markov game coordination mechanism. By constructing a high-order multi-agent Markov dynamic evolutionary game flow and using future reference trajectories with exclusive semantics generated by a spatiotemporal alignment feature extraction model as dynamic boundary constraints for joint state transitions, a closed-loop transition from passive feature modeling to active collaborative control is achieved for multi-agents. Under a unified action space, the optimal joint behavior probability distribution is solved in real time using the LSBRE inference mechanism. Under the dual constraints of the underlying data flow and the top-level decision control, the generated trajectories possess excellent continuity and realistic social rationality.
[0130] 3. Based on the multi-agent collaborative optimization framework, this invention combines the stochastic optimal response decision-making mechanism of LSBRE with the entropy gain value assessment method to map the multi-agent behavioral gains into probabilistic stochastic policies, enabling agents and pedestrians to achieve non-perfectly rational dynamic behavioral coordination under long-term gain constraints. Simultaneously, by combining trajectory curvature constraints, neighborhood density constraints, and safe collision avoidance mechanisms, it jointly optimizes trajectory continuity and motion feasibility. Combined with end-to-end multi-task training loss functions for iterative updates, the model can effectively reduce policy oscillations and local optima risks in complex dynamic environments, improving the smoothness, safety, and adaptability to complex scenarios during the group trajectory generation process.
[0131] The invention will now be described in further detail with reference to the accompanying drawings. Attached Figure Description
[0132] Figure 1 This is an overall flowchart of the present invention;
[0133] Figure 2 This is a flowchart of the algorithm of the present invention. Detailed Implementation
[0134] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be described in detail below with reference to the accompanying drawings and specific embodiments.
[0135] Appendix Figure 1 This implementation case provides an overall flowchart, demonstrating a collaborative generation method for group trajectories based on spatiotemporal relationship modeling in a dynamic environment. It uses Webots simulation software to establish the simulation environment, collect pedestrian historical trajectories, extract GAT spatial interaction features, generate deformable Transformer temporal trajectories, construct a generalized Markov game model, model LSBRE stochastic policy decisions, and train the model.
[0136] Appendix Figure 2 This is the algorithm flowchart provided in this implementation case. The method first fuses the future reference trajectory generated by the prediction module with the robot's own motion state to construct a generalized state space in a complex dynamic environment. Then, it generates a joint action space by combining multi-agent motion constraints. Subsequently, a state transition model is established based on the interaction relationship between the multiple agents. On this basis, the LSBRE stochastic policy module performs probability sampling on the joint actions and interacts with the dynamic environment to obtain immediate rewards and the next joint state. All interaction data is stored in the experience replay pool for subsequent training. Furthermore, the policy network is iteratively optimized by combining value network evaluation and entropy gain mechanism. Stable convergence is achieved through soft updates between the policy network and the target value network. Finally, the optimal joint navigation policy that satisfies the cooperative constraints of the complex dynamic environment is output.
[0137] For ease of understanding, let's take the autonomous navigation task of an intelligent service robot in a large indoor public setting as an example. The complex dynamic environment consists of three elements: an intelligent agent undertaking service tasks such as guidance and delivery; a dynamic agent with random motion behavior and social coupling characteristics; and static structural obstacles such as walls and pillars. The intelligent agent needs to complete real-time navigation decisions under kinematic constraints, collision avoidance safety constraints, and social rationality constraints. This invention is not limited to the above scenario and can also be extended to complex environments with multi-agent dynamic interaction characteristics, such as factory logistics and transportation hubs.
[0138] The specific implementation steps are as follows:
[0139] Implementation Step 1: Establish a simulation environment. The algorithm in this invention needs to be trained and tested in a crowded and dynamic human-machine collaborative environment. Webots simulation software is used to customize the environment and add elements such as intelligent agents and pedestrians.
[0140] Implementation Step 2: Collect pedestrian historical trajectories. In order to accurately depict the spatial interaction relationship between pedestrians in a complex dynamic environment, this invention constructs a spatial interaction modeling module based on Graph Attention Network (GAT). By establishing a dynamic pedestrian interaction graph, the social influence relationship between neighboring pedestrians is modeled, spatial interaction features containing social semantics are extracted, and used as input for the subsequent time-series trajectory generation module.
[0141] Each pedestrian in the group is regarded as an independent graph node. A dynamic undirected graph structure is constructed based on the spatial distance and movement direction of the pedestrians. The node features are the spatiotemporal information such as the historical trajectory coordinates, speed, acceleration, and movement direction of the agent and the pedestrian. The edges represent the potential interaction relationships between the pedestrians.
[0142] Define the graph structure:
[0143] ,
[0144] ,
[0145] ,
[0146] ,
[0147] in Represents the pedestrian interaction topology graph. Representing pedestrian node features, For the number of pedestrians, For the original feature dimension, This represents the set of interaction edges between pedestrians. It is the set of real numbers; The weight matrix is linearly transformed, and the model continuously adjusts it based on the objective of trajectory prediction accuracy. The numerical values are processed until the original features are transformed into higher-dimensional features that are easier to process and more suitable for subsequent calculations. After linear transformation, the pedestrian node features are output. ,here This represents the dimension after linear transformation, for each pedestrian node. Corresponding new feature vector .
[0148] Step 3: Extract GAT spatial interaction features. Traditional methods typically establish adjacency relationships based solely on Euclidean distance between pedestrians, which is insufficient to describe the influence of motion trends in complex dynamic environments. Therefore, this invention considers the distance between pedestrians, motion direction, and speed differences simultaneously during the adjacency relationship construction process, constructing a dynamic interaction relationship matrix:
[0149] ,
[0150] in For pedestrians with pedestrians The strength of interaction between them To measure the Euclidean distance between pedestrians, a minimum threshold is set for the distance term to prevent the reciprocal of the Euclidean distance from diverging when two pedestrians are too close. ,when season , Indicates the angle between the directions of movement of the two pedestrians and , represents the minimum angle between the directions of movement of the two pedestrians. The velocity difference term is used to calculate the interaction intensity only when the two pedestrians are within the neighborhood. These are the weighting coefficients. This is the interaction threshold.
[0151] When the interaction strength satisfies the neighborhood constraint, interaction edges are established between nodes:
[0152] ,
[0153] in Let the edges represent the potential interaction relationships between people. This represents the set of interaction edges between pedestrians.
[0154] Compared with the traditional static adjacency method, this paper introduces motion trend relationships to achieve adaptive modeling of the impact of pedestrian spatial interaction in dynamic environments.
[0155] Perform a linear transformation on the features of each pedestrian node to obtain higher-dimensional feature information, and calculate the attention score:
[0156] ,
[0157] in For pedestrians The original feature vector, For the first The original feature vector of each pedestrian The weight matrix is a linear transformation matrix. The attention mechanism function and It can receive the feature vectors of two nodes.
[0158] Furthermore, masked self-attention is employed, focusing only on nodes. Nodes with interactive edge relationships Calculate attention scores and define the set of interactive neighbors:
[0159] ,
[0160] To dynamically measure the interaction influence of neighboring pedestrians on the target pedestrian, linear transformation and concatenation are performed on the features of the target node and neighboring nodes. The correlation score between nodes is calculated using an attention function, and a LeakyReLU non-linear activation function is introduced. To avoid the impact of differences in attention score scales between different nodes on model stability, a softmax function is used to process the attention scores, resulting in attention weights.
[0161] ,
[0162] in This is the attention weight, and its value range is... The larger the weight, the more pedestrians... right The stronger the influence of motion decisions, the more... This indicates a feature concatenation operation. This is the attention weight vector, used to calculate the interaction relevance score between nodes. Neighboring pedestrians The original feature vector, Indicates the target pedestrian The set of neighboring nodes, It is an exponential function. for The neighborhood set, For a single element in the set, This is a global traversal variable for the collection.
[0163] We perform weighted aggregation of neighborhood features to generate spatial interaction features that include social semantics:
[0164] ,
[0165] in This represents the spatial interaction characteristics after aggregation. It is a non-linear activation function.
[0166] To enhance the expressive power of spatiotemporal interaction features, this invention employs a multi-head graph attention mechanism. By setting multiple sets of independent linear transformation weight matrices, it calculates the attention weights between pedestrian nodes in parallel from multiple different perspectives, fully capturing multidimensional interaction information. The features output by each attention head are then concatenated and fused to obtain the final spatial interaction feature vector.
[0167] ,
[0168] in Indicates the number of attention heads. Indicates the first Attention weights corresponding to each attention head Indicates the first The linear transformation weight matrix corresponding to each attention head Indicates to The output features of each attention head are concatenated.
[0169] Implementation Step 4: Input the spatial interaction features into the deformable Transformer network, introduce the bipartite graph alignment mechanism, extract long-term dependencies by predicting the features of sparse sampling points in the time series, and use the Hungarian algorithm to complete the optimal alignment and allocation of the trajectory and the subject by minimizing the joint matching cost.
[0170] Implementation step 4.1: Arrange the spatial interaction features output by the graph attention network in chronological order to construct a pedestrian historical trajectory feature sequence:
[0171] ,
[0172] in pedestrian Historical trajectory feature sequence, Indicates time The corresponding spatial interaction feature vector, This is the time step index, representing the historical trajectory time step corresponding to the current feature.
[0173] The Transformer model itself lacks temporal sequence awareness, so a positional encoding mechanism is introduced. To enhance the model's ability to model the topological relationships of group interactions, a structural encoding mechanism is further introduced on top of the positional encoding, resulting in a feature representation that integrates temporal and spatial structural information.
[0174] ,
[0175] in This is a temporal feature sequence after embedding location information, which integrates the interaction features of the trajectory and temporal order information. For position encoding vectors, For structural encoding weight coefficients, For structural encoding.
[0176] Implementation step 4.2: In the encoder layer, the traditional Transformer adopts a global dense self-attention mechanism, which causes the computational cost to increase quadratically with the sequence length. Therefore, a deformable self-attention mechanism is introduced to adaptively predict the sparse sampling point offset for each query feature, thereby achieving efficient long-term dependency modeling.
[0177] For a given query feature Let its two-dimensional reference point coordinates on the time series feature map be... Define deformable attention:
[0178] ,
[0179] in Indicates the index of the attention head. This represents the total number of heads. Indicates the index of the sampling point. The total number of sparse sampling points pre-defined in the spatiotemporal neighborhood of each query feature and , and The weight matrix is a learnable linear transformation. This represents the offset of the sampling point location predicted from the query features through a linear mapping. Since the offset coordinates are usually continuous values... From the feature sequence using bilinear interpolation Extract features from them, The adaptive attention weights are obtained by linear prediction of query features.
[0180] Implementation Step 4.3: To address the issues of disordered future trajectories, overlapping, and non-exclusivity in traditional independent prediction methods, a bipartite graph optimal alignment mechanism is introduced. Given a set of true values generated collaboratively by group trajectories, the first step is to calculate the _th_ ... The node and the in the real set The cost of joint matching for individual pedestrians:
[0181] ,
[0182] in, This represents the set of invalid padding indices for pedestrians who are not moving. For indicator functions, and To balance the hyperparameters.
[0183] Furthermore, the joint matching cost consists of two parts:
[0184] The cost of matching trajectory shape and span is used to constrain the macroscopic consistency of movement trends:
[0185] ,
[0186] in Indicates the first The total span of the actual trajectory displacement of a pedestrian. Indicates the first The total span of the predicted trajectory.
[0187] Spatiotemporal alignment cost, used to precisely constrain the spatial proximity of each time step:
[0188] ,
[0189] in For the first The real trajectory of individual pedestrians in the future Two-dimensional coordinates of time, For the corresponding predicted coordinates, This represents the total number of future time steps predicted.
[0190] Step 4.4: Use the Hungarian algorithm to dynamically solve for the optimal assignment mapping of the bipartite graph, minimizing the total matching cost.
[0191] ,
[0192] in Let be a fully injective mapping function. To query the number of trajectories, For the first The trajectory is assigned to the first The matching cost for each target and the optimal allocation mapping result ensure that the trajectory output of each person in a high-density population is orderly and there will be no identity confusion or trajectory overlap.
[0193] Through this optimal allocation mapping, the generated unordered future reference trajectories are exclusively aligned with specific pedestrians, ultimately determining the future reference trajectory sequence for each pedestrian:
[0194] ,
[0195] in For the first The number of the predicted trajectory assigned to each pedestrian. The total number of time steps for future predictions. It is numbered The predicted trajectory in the first Predicted location values at each time step.
[0196] By extracting sparse features from a set of deformable Transformers and aligning them with Hungarian trajectories, efficient and ordered initialization of group trajectories in complex dynamic environments is achieved, avoiding the intermingling and conflict of generated trajectories from the bottom layer.
[0197] Implementation Step 5: Design a generalized Markov game mechanism. Traditional trajectory prediction methods usually only predict the future movement state of a single pedestrian independently, lacking a joint optimization mechanism for the mutual influence between groups, which can easily lead to problems such as conflict, overlap and incoordination of group behavior between future trajectories.
[0198] This invention uses a deformable Transformer temporal prediction network and a bipartite graph alignment mechanism to generate initial reference prediction trajectories for each pedestrian, thus initially resolving the problem of disordered trajectory interleaving at the underlying level. However, considering the rapidly changing and deeply coupled characteristics of social intentions and motion states among multiple agents in complex dynamic environments, a generalized Markov game coordination mechanism is further introduced to dynamically and collaboratively correct the aforementioned reference trajectories. By deeply fusing the extracted long-term spatiotemporal dependency features with the state transition probabilities of the Markov game, the dynamic deduction of the logically stochastic optimal response of the agents and pedestrians in the joint dynamic space is realized. This resolves trajectory conflicts and improves the realism and social rationality of group collaborative generation while satisfying kinematic feasibility.
[0199] Implementation Step 5.1: Within the framework of a generalized Markov game, the agent and surrounding pedestrians constitute a multi-agent interaction set. The agent and pedestrians share a unified state space and action space description, and their movements are coupled in the dynamic environment, jointly influencing the environmental state transition process. Specifically, the agent outputs autonomous navigation actions through a policy network, while pedestrians participate in joint state evolution based on trajectory prediction results and local interaction rules, thus forming a multi-agent game relationship in a complex dynamic environment.
[0200] The generalized Markov game is defined as follows:
[0201] ,
[0202] in Represents a set of multiple subjects. Represents the generalized state space. Represents the action space set, Represents the state transition function. Let be the initial state distribution function. Represents the reward function and trajectory constraints. This is used to constrain the safety, kinematic feasibility, and social rationality of the trajectory generation process, ensuring the generation of continuous, smooth, and collision-avoidance-compliant executable trajectories in dynamic environments. Represents the discount factor and It is used to weigh immediate and future benefits.
[0203] In the aforementioned multi-agent set, intelligent agents and pedestrians assume different roles within the game framework. Intelligent agents, as active decision-makers, autonomously output actions based on the current joint state through the policy network, possessing complete perception, decision-making, and execution capabilities. Pedestrians, as passive participants, do not have their actions generated by an independent policy network; instead, they are determined by a prediction module based on historical trajectory predictions, injected into the joint state evolution process as reference trajectories. Both types of agents share a unified state and action space description, but their action generation mechanisms differ fundamentally. Intelligent agent actions are constrained by policy optimization objectives, while pedestrian actions are constrained by trajectory prediction models. This design allows pedestrian movement to participate in the joint state transitions of multi-agent games in a structured manner, while avoiding unnecessary assumptions about active decision-making on pedestrians. Thus, while ensuring the theoretical integrity of the game framework, it more accurately reflects the interaction characteristics in real-world human-machine collaborative scenarios.
[0204] The generalized state space is jointly constructed by the agent and the reference trajectories of each pedestrian:
[0205] ,
[0206] exist At any given moment, the state is determined by the agent's current position. Current location of each pedestrian constitute.
[0207] Implementation step 5.2: In order to ensure continuous and smooth trajectory, avoid abrupt changes in action, and improve the fine control capability of trajectory coordination in complex dynamic environments, curvature constraints can be introduced to limit the steering angular velocity. The main action is defined as a joint action vector that includes speed adjustment, direction offset, trajectory curvature adjustment, and neighborhood collision avoidance control.
[0208] Define multi-agent actions:
[0209] ,
[0210] To adjust the speed increment, This represents the offset in the direction of motion. This represents the amount of trajectory curvature adjustment.
[0211] The above definition of action vectors applies to all agents, but the sources of action generation for each agent differ fundamentally. Agent actions are output in real time by the policy network, while pedestrian actions are obtained from known reference trajectories and participate in the calculation as known conditions rather than optimization variables during joint decision-making. Both types of agents share the same action description form to ensure that the joint action vector has a unified mathematical expression foundation within the game framework.
[0212] Implementation step 5.3: Under the combined action, the motion state of the subject evolves dynamically over time, and the state transition process is simultaneously affected by motion speed, direction change, trajectory curvature and neighborhood interaction intensity.
[0213] Define multi-agent states:
[0214] ,
[0215] Indicates spatial location, Indicates the current speed of motion. Indicates the direction angle of motion. Represents the curvature of the trajectory. This represents the local neighborhood density.
[0216] Location update:
[0217] ,
[0218] ,
[0219] The time interval for state updates. This represents the spatial location at the next moment.
[0220] Speed updates:
[0221] ,
[0222] Indicates the velocity at the next moment. This represents the neighborhood density inhibition coefficient, which measures the influence weight of local crowding on the agent's velocity change. The higher the local neighborhood density, the more obvious the inhibition effect on the agent's motion.
[0223] Curvature update:
[0224] ,
[0225] This represents the curvature of the trajectory at the next moment. Indicates the coefficient for suppressing changes in direction. This represents the absolute value of the directional offset, used to measure the magnitude of change in the direction of motion. By dynamically constraining the trajectory curvature, abrupt trajectory changes and path oscillations can be effectively reduced, improving trajectory continuity.
[0226] Implementation Step 6: Traditional agent decision-making methods typically employ deterministic action selection mechanisms. While these mechanisms can improve the utilization efficiency of locally optimal actions, they are prone to problems such as single-strategy approaches, local congestion, or long-term revenue degradation in complex dynamic environments. Especially in human-computer interaction scenarios, there is a clear behavioral coupling and dynamic game relationship between the agent and the pedestrian. Simply relying on deterministic strategies is insufficient to effectively describe the random interactive behaviors between the agents.
[0227] Implementation Step 6.1: To enable the agent to not only focus on the immediate gains at the current moment in a complex dynamic environment, but also to comprehensively consider the long-term impact of future continuous decisions, this invention introduces a long-term gain evaluation mechanism based on discounted cumulative rewards. By weighted accumulation of rewards at each future moment, the agent can achieve a more reasonable global trade-off between path efficiency, motion safety, and human-computer interaction stability, thereby avoiding short-sighted decision-making problems caused by relying on instantaneous rewards. At the same time, in human-computer interaction scenarios, this long-term gain modeling method can more effectively characterize the dynamic game relationship between the agent and the pedestrian that evolves over time.
[0228] Long-term returns are defined as the expected sum of discount rewards at future moments:
[0229] ,
[0230] in, The current time step is the starting point for calculating the expected return. For any future time step and , This is a power term of the discount factor, used to reduce the weight of future rewards. The larger, The smaller the value, the less impact it has on current decisions. From time until the end time The state sequence, From time until the end time The sequence of actions, A joint strategy for intelligent agents and pedestrians. For the agent's strategy, For pedestrians' strategy set, The immediate reward obtained by the intelligent agent. For any future moment The global state, For a moment The joint action of intelligent agents and pedestrians For a moment The global state, For intelligent agents at any time The actions taken.
[0231] Implementation Step 6.2: The agent's decision-making is modeled using Logistic Stochastic Best Response Equilibrium (LSBRE). Unlike the absolute rationality assumption in traditional game theory, this mechanism maps payoffs to probabilities. Actions with higher payoffs have a greater probability of being selected. However, the characteristics of the exponential function determine that even if a certain action has the highest payoff, it will not completely eliminate the probability of selecting other actions. Instead, it retains the possibility of selecting the second-best action, thus more accurately simulating the non-absolutely rational interactive behavior caused by perceptual bias or risk-taking motivation during decision-making.
[0232] LSBRE's random policy:
[0233] ,
[0234] The random policy is represented in the global state. Trajectory constraints Select action below The probability, A collection of pedestrian actions. These are alternative actions for the agent.
[0235] Implementation Step 6.3: Since the LSBRE decision-making mechanism needs to recursively evaluate the long-term interaction benefits between the agent and the pedestrian in a dynamic environment, its value estimation process is not constructed independently. Instead, it is based on the state space, action space, and state transition probabilities defined by the generalized Markov game model. By recursively calculating the long-term benefits of the state transition process, environmental evolution information, agent interaction relationships, and trajectory constraint mechanisms are integrated into the strategy value evaluation process, thereby achieving more stable joint decision optimization in a dynamic environment.
[0236] To balance immediate rewards with long-term decision-making benefits, a policy entropy term is further introduced into the value assessment process to quantify the uncertainty of actions. Through entropy gain constraints, the agent maintains necessary exploration capabilities while obtaining high rewards, thereby reducing the risk of policy oscillations in complex interactive environments.
[0237] Incorporating policy entropy into decision-making:
[0238] ,
[0239] Policy Entropy It quantifies the randomness of the strategy; a higher entropy value indicates more dispersed decision-making and a stronger exploratory nature. Indicating in strategy The expectation operator.
[0240] An agent value evaluation mechanism based on fusion entropy gain is used to measure the immediate feedback of action combinations to changes in environmental state, and policy entropy is introduced to quantify the uncertainty of the agent's future decisions.
[0241] ,
[0242] Q-value function in instant reward Based on this, the entropy gain of the future state is recursively added to the expected Q value of the subsequent state. Through the state transition and the expectation of the joint policy, the long-term return is estimated. As trajectory constraints, for the next state Take the expected value, state transition probability This indicates the transition from the current state to the next state under trajectory constraints. The transfer process, for the joint action in the next moment. Take the expected value. Obey the joint strategy of the agent and the pedestrian , This indicates that the agent relies on immediate rewards. Global state at time 1 Intelligent agent actions Combined motion vectors with pedestrians .
[0243] Implementation step 6.4: The goal of the LSBRE method is to maximize both reward and entropy objectives. To this end, Markov chains provide transition probabilities representing sequential equilibrium in the action space, iteratively updating the agent's policy:
[0244] ,
[0245] For intelligent agents at any time The conditional transition probability, Indicates the first In the next iteration, the pedestrian's action sampling vector Indicates the first intelligent agent The action sampling variable for the next iteration.
[0246] With the number of iterations The Markov chain converges to a stationary distribution, ultimately yielding the joint policy distribution of the agent and the pedestrian:
[0247] ,
[0248] in It is a probability measure, representing the probability of a random event occurring. Indicates the agent's state The action sampling variables are used to generate action sequences that satisfy LSBRE. Together they describe the combination of behaviors of all interacting entities at a given moment.
[0249] A joint loss function is constructed based on trajectory prediction error, optimal alignment error, collaborative decision-making error, and equilibrium convergence error, and the entire group trajectory collaborative generation network is trained end-to-end.
[0250] To achieve collaborative generation and conflict resolution of multi-pedestrian trajectories in dynamic environments, this invention constructs a collaborative training framework that integrates graph attention network, deformable Transformer temporal prediction, bipartite graph optimal alignment, generalized Markov game, and LSBRE stochastic policy optimization. The specific steps are as follows:
[0251] Step 1: Initialize the cooperative network architecture parameters;
[0252] Step 2: Construct a dynamic crowd simulation environment and create a pedestrian interaction map;
[0253] Step 3: Extract spatial interaction features using graph attention networks;
[0254] Step 4: Generate a reference trajectory based on deformable temporal prediction and optimal alignment of bipartite graph;
[0255] Step 5: Construct a generalized Markov game model and perform trajectory collaborative optimization;
[0256] Step 6: Joint decision-making and value assessment based on the LSBRE stochastic strategy;
[0257] Step 7: Update the network parameters until the training termination condition is met; otherwise, repeat the above steps in sequence.
Claims
1. A method for collaborative generation of group trajectories based on spatiotemporal relationship modeling in dynamic environments, characterized in that, Includes the following steps: Step 1: Establish a simulation environment and construct a crowded and dynamic human-machine collaborative simulation scenario. Add intelligent agents and several pedestrian elements to the environment for algorithm training and testing. Step 2: Construct a spatial interaction model based on graph attention network. Treat each pedestrian in the group as an independent graph node. Establish a dynamic undirected graph structure based on the spatial distance and movement direction relationship between pedestrians. Use the spatiotemporal information such as the historical trajectory coordinates, speed, acceleration and movement direction of each pedestrian as node features, and the potential interaction relationship between pedestrians as edges to establish a dynamic pedestrian interaction graph. Step 3: In the process of constructing adjacency relationships, the distance between pedestrians, the angle between movement directions, and the speed difference are comprehensively considered to construct a dynamic interaction relationship matrix, calculate the attention score, weight and aggregate the neighborhood features, calculate the attention weight between pedestrian nodes from multiple perspectives, and splice and fuse the output features of each attention head. Step 4: Input the spatial interaction features into the deformable Transformer network, introduce the bipartite graph alignment mechanism, extract long-term dependencies by predicting the features of sparse sampling points in the time series, and use the Hungarian algorithm to complete the optimal alignment and allocation of the trajectory and the subject by minimizing the joint matching cost. Step 5: Design a generalized Markov game mechanism to integrate agents and pedestrians into a multi-agent interaction set. Agents, as active decision-makers, are output in real time by the policy network, while pedestrians, as passive participants, are determined by the prediction module based on historical trajectory prediction results. Define a joint action vector that includes speed adjustment, direction shift, and curvature adjustment, and dynamically update the multi-agent state by introducing neighborhood density suppression and curvature constraints. Step 6: Use logical stochastic optimal response equilibrium to probabilistically model the agent's decision-making, introduce a discount cumulative reward mechanism to evaluate long-term returns, construct the Q-value function of the fused policy entropy, and iteratively converge to the agent-pedestrian joint policy distribution that satisfies the LSBRE equilibrium condition through Markov chain.
2. The method for collaborative generation of group trajectories based on spatiotemporal relationship modeling in a dynamic environment according to claim 1, characterized in that, Step two describes constructing a spatial interaction model based on a graph attention network. Each pedestrian in the group is treated as an independent graph node. A dynamic undirected graph structure is established based on the spatial distance and movement direction relationship between pedestrians. Spatiotemporal information such as the historical trajectory coordinates, velocity, acceleration, and movement direction of each pedestrian are used as node features, and potential interaction relationships between pedestrians are used as edges to establish a dynamic pedestrian interaction graph. This is implemented according to the following steps: Define the graph structure: , , , , in Represents the pedestrian interaction topology graph. Representing pedestrian node features, For the number of pedestrians, For the original feature dimension, This represents the set of interaction edges between pedestrians. It is the set of real numbers; The weight matrix is linearly transformed, and the model continuously adjusts it based on the objective of trajectory prediction accuracy. The numerical values are processed until the original features are transformed into higher-dimensional features that are easier to process and more suitable for subsequent calculations. After linear transformation, the pedestrian node features are output. ,here This represents the dimension after linear transformation, for each pedestrian node. Corresponding to the new feature vector .
3. The method for collaborative generation of group trajectories based on spatiotemporal relationship modeling in a dynamic environment according to claim 1, characterized in that, Step 3 describes the process of constructing adjacency relationships. It comprehensively considers the distance between pedestrians, the angle between their movement directions, and speed differences to build a dynamic interaction relationship matrix. It calculates attention scores and attention weights, weights and aggregates neighborhood features, calculates attention weights between pedestrian nodes from multiple perspectives, and then concatenates and fuses the output features of each attention head. The specific steps are as follows: Constructing a dynamic interaction relationship matrix: , in For pedestrians with pedestrians The strength of interaction between them Set a minimum threshold for the Euclidean distance between pedestrians. ,when season , Indicates the angle between the directions of movement of the two pedestrians and , Due to speed difference, These are the weighting coefficients. Interaction threshold; When the interaction strength satisfies the neighborhood constraint, interaction edges are established between nodes: , in As an edge, This represents the set of interaction edges between pedestrians; Perform a linear transformation on the features of each pedestrian node to obtain higher-dimensional feature information, and calculate the attention score: , in For pedestrians The original feature vector, For the first The original feature vector of each pedestrian The attention mechanism function and ; Furthermore, masked self-attention is employed, focusing only on nodes. Nodes with interactive edge relationships Calculate attention scores and define the set of interactive neighbors: , The features of the target node and its neighboring nodes are linearly transformed and concatenated, and the correlation score between nodes is calculated using an attention function. A LeakyReLU non-linear activation function is then introduced. , in This is the attention weight, and its value range is... The larger the weight, the more pedestrians... right The stronger the influence of motion decisions, the more... This indicates a feature concatenation operation. This is the attention weight vector, used to calculate the interaction relevance score between nodes. Neighboring pedestrians The original feature vector, Indicates the target pedestrian The set of neighboring nodes, It is an exponential function. for The neighborhood set, For a single element in the set, This is a global traversal variable within the collection; We perform weighted aggregation of neighborhood features to generate spatial interaction features that include social semantics: , in This represents the spatial interaction characteristics after aggregation. It is a non-linear activation function; The features output by each attention head are concatenated and fused to obtain the final spatial interaction feature vector: , in Indicates the number of attention heads. Indicates the first Attention weights corresponding to each attention head Indicates the first The linear transformation weight matrix corresponding to each attention head Indicates to The output features of each attention head are concatenated.
4. The method for collaborative generation of group trajectories based on spatiotemporal relationship modeling in a dynamic environment according to claim 1, characterized in that, Step four involves inputting spatial interaction features into a deformable Transformer network, extracting long-term dependencies by predicting temporally sparse sampling point features, and using the Hungarian algorithm to achieve optimal alignment between the trajectory and the subject by minimizing the joint matching cost. This is implemented specifically according to the following steps: Constructing pedestrian historical trajectory feature sequences: , in pedestrian Historical trajectory feature sequence, Indicates time The corresponding spatial interaction feature vector, For time step index; By introducing positional encoding and structural encoding mechanisms, a feature representation that integrates temporal and spatial structural information is obtained: , in This is a temporal feature sequence after embedding location information. For position encoding vectors, For structural encoding weight coefficients, Encoding the structure; For a given query feature Let its two-dimensional reference point coordinates on the time series feature map be... Define deformable attention: , in Indicates the index of the attention head. This represents the total number of heads. Indicates the index of the sampling point. The total number of sparse sampling points pre-defined in the spatiotemporal neighborhood of each query feature and , and The weight matrix is a learnable linear transformation. This represents the offset of the sampling point location predicted from the query features through a linear mapping. Since the offset coordinates are usually continuous values... From the feature sequence using bilinear interpolation Extract features from them, These are the adaptive attention weights obtained from linear prediction of query features; Introducing a bipartite graph optimal alignment mechanism, given a set of true values generated collaboratively by a group of trajectories, first calculate the value of the i-th trajectories in the set. The node and the in the real set The cost of joint matching for individual pedestrians: , in, This represents the set of invalid padding indices for pedestrians who are not moving. For indicator functions, and To balance the hyperparameters; Furthermore, the joint matching cost consists of two parts: The cost of matching trajectory shape and span is used to constrain the macroscopic consistency of movement trends: , in Indicates the first The total span of the actual trajectory displacement of a pedestrian. Indicates the first Total span of the predicted trajectory; Spatiotemporal alignment cost, used to precisely constrain the spatial proximity of each time step: , in For the first The real trajectory of individual pedestrians in the future Two-dimensional coordinates of time, For the corresponding predicted coordinates, This represents the total number of future time steps predicted. The Hungarian algorithm is used to dynamically find the optimal assignment mapping in a bipartite graph, minimizing the total matching cost. , in Let be a fully injective mapping function. To query the number of trajectories, For the first The trajectory is assigned to the first Matching cost when there are multiple targets; Through this optimal allocation mapping, the generated unordered future reference trajectories are exclusively aligned with specific pedestrians, ultimately determining the future reference trajectory sequence for each pedestrian: , in For the first The number of the predicted trajectory assigned to each pedestrian. The total number of time steps for future predictions. It is numbered The predicted trajectory in the first Predicted location values at each time step.
5. The method for collaborative generation of group trajectories based on spatiotemporal relationship modeling in a dynamic environment according to claim 1, characterized in that, Step 5 describes the design of a generalized Markov game coordination mechanism that integrates agents and pedestrians into a multi-agent interaction set. Agents, as active decision-makers, are output in real-time by the policy network, while pedestrians, as passive participants, are determined by the prediction module based on historical trajectory predictions. A joint action vector is defined, including speed adjustment, direction shift, and curvature adjustment. The multi-agent state is dynamically updated by introducing neighborhood density suppression and curvature constraints. This is implemented according to the following steps: In the framework of generalized Markov games, the agent and the surrounding pedestrians together constitute a multi-agent interaction set. The agent and the pedestrians share a unified state space and action space description form. Their motion behavior is coupled with each other in the dynamic environment and jointly affects the environmental state transition process. The generalized Markov game is defined as follows: , in Represents a set of multiple subjects. Represents the generalized state space. Represents the action space set, Represents the state transition function. Let be the initial state distribution function. Represents the reward function, For trajectory constraints, Represents the discount factor and ; Generalized state space: , exist At any given moment, the state is determined by the agent's current position. Current location of each pedestrian constitute; Curvature constraints are introduced to limit steering angular velocity. The main action is defined as a joint action vector that includes speed adjustment, direction offset, trajectory curvature adjustment, and neighborhood collision avoidance control. Multi-agent actions are defined as follows: , To adjust the speed increment, This represents the offset in the direction of motion. This is the amount of trajectory curvature adjustment; Under the combined action, the motion state of the subject evolves dynamically over time, and the state transition process is simultaneously affected by motion speed, direction change, trajectory curvature and neighborhood interaction intensity. Define multi-agent states: , Indicates spatial location, Indicates the current speed of motion. Indicates the direction angle of motion. Represents the curvature of the trajectory. Represents the local neighborhood density; Location update: , , The time interval for state updates. The spatial position at the next moment; Speed updates: , Indicates the velocity at the next moment. Represents the neighborhood density suppression coefficient; Curvature update: , This represents the curvature of the trajectory at the next moment. Indicates the coefficient for suppressing changes in direction. This represents the absolute value of the directional offset.
6. The method for collaborative generation of group trajectories based on spatiotemporal relationship modeling in a dynamic environment according to claim 1, characterized in that, Step six describes the probabilistic modeling of agent decision-making using logistic stochastic optimal response equilibrium, introducing a discounted cumulative reward mechanism to evaluate long-term returns, constructing a Q-value function that fuses policy entropy, and iteratively converging through a Markov chain to a joint agent-pedestrian policy distribution that satisfies the LSBRE equilibrium condition. This is implemented specifically according to the following steps: Long-term returns are defined as the expected sum of discount rewards at future moments: , in, For the current time step, For any future time step and , For the power of the discount factor, The larger, The smaller the value, the less impact it has on current decisions. From time until the end time The state sequence, From time until the end time The sequence of actions, A joint strategy for intelligent agents and pedestrians. For the agent's strategy, For pedestrians' strategy set, The immediate reward obtained by the intelligent agent. For any future moment The global state, For a moment The joint action of intelligent agents and pedestrians For a moment The global state, For intelligent agents at any time Actions taken; LSBRE's random policy: , The random policy is represented in the global state. Trajectory constraints Select action below The probability, A collection of pedestrian actions. Alternative actions for the agent; In the value assessment process, a strategy entropy term is further introduced to quantify the uncertainty of actions, thus incorporating strategy entropy into decision-making. , Indicating in strategy The expected operator below; An agent value evaluation mechanism based on fusion entropy gain is used to measure the immediate feedback of action combinations to changes in environmental state, and policy entropy is introduced to quantify the uncertainty of the agent's future decisions. , in For instant rewards, As trajectory constraints, for the next state Take the expected value, state transition probability This indicates the transition from the current state to the next state under trajectory constraints. The transfer process, for the joint action in the next moment. Take the expected value. Obey the joint strategy of the agent and the pedestrian , This indicates that the agent relies on immediate rewards. Global state at time 1 Intelligent agent actions With pedestrian action set vector ; Markov chains provide transition probabilities representing sequential equilibrium in the action space, iteratively updating the agent's policy: , For intelligent agents at any time The conditional transition probability, Indicates the first In the next iteration, the pedestrian's action sampling vector Indicates the first intelligent agent Action sampling variables for the next iteration; With the number of iterations The Markov chain converges to a stationary distribution, ultimately yielding the joint policy distribution of the agent and the pedestrian: , in It is a probability measure, representing the probability of a random event occurring. Indicates the agent's state The action sampling variable below, Together they describe the combination of behaviors of all interacting entities at a given moment.