A pedestrian trajectory prediction method based on each dimension anisotropy and target guidance

By combining Transformer and Conditional Variational Autoencoder network, fine-grained spatial interaction modeling and target-driven trajectory generation are achieved, solving the problems of multidimensional anisotropy and target constraints in pedestrian trajectory prediction in existing technologies, and improving the prediction accuracy and stability in complex traffic scenarios.

CN122333418APending Publication Date: 2026-07-03SHIJIAZHUANG TIEDAO UNIV +2

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SHIJIAZHUANG TIEDAO UNIV
Filing Date
2026-04-09
Publication Date
2026-07-03

AI Technical Summary

Technical Problem

Existing technologies fail to effectively characterize the multidimensional heterogeneous features of spatial interactions in pedestrian trajectory prediction and lack structural constraints on target information, resulting in insufficient prediction accuracy and stability in complex traffic scenarios.

Method used

We employ Transformer-based trajectory time series modeling, combined with a relation-aware attention network for fine-grained spatial interaction modeling, and a conditional variational autoencoder network for target point prediction and explicit labeling, to construct a target-driven trajectory generation mechanism.

Benefits of technology

It improves the accuracy and stability of pedestrian trajectory prediction, enabling accurate multimodal trajectory prediction in complex traffic scenarios and enhancing the physical rationality and directional consistency of the prediction results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122333418A_ABST
    Figure CN122333418A_ABST
Patent Text Reader

Abstract

This invention discloses a pedestrian trajectory prediction method based on anisotropy and target guidance across dimensions, belonging to the technical field of trajectory prediction and intelligent transportation systems. The method takes the pedestrian's historical trajectory and the positions of surrounding pedestrians as input. After trajectory feature extraction and Transformer temporal modeling, spatial interactions are decoupled by dimension, and the effectiveness of the interaction is determined by a discriminator on a target-by-target, time-step-by-time, and spatial-dimensional basis. Multimodal target points are predicted based on a conditional variational autoencoder network and explicitly encoded and marked with their positions, which are then introduced as structural constraints into the decoding stage. Masking is removed, and non-autoregressive global decoding is employed, ensuring that the predicted positions are all globally constrained by the target points. This method improves the precision of spatial interaction modeling and the stability and rationality of trajectory prediction, while reducing computational overhead. It can be applied to autonomous driving and intelligent transportation systems, providing accurate prediction basis for path planning and risk warning.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of trajectory prediction technology, specifically to a method for predicting pedestrian trajectories based on anisotropy in various dimensions and target guidance. Background Technology

[0002] With the rapid development of autonomous driving and intelligent transportation technologies, pedestrian trajectory prediction is a core technology for autonomous driving path planning, safety decision-making, intelligent traffic flow control, and risk warning. Its prediction accuracy and rationality directly determine the reliability and practical application value of the system. The basic task of pedestrian trajectory prediction is to predict the movement path of pedestrians in the future based on their historical trajectories and surrounding environmental information. However, in real traffic scenarios, pedestrian movement is affected by their own walking intentions and has complex spatial interactions with surrounding pedestrians. Therefore, this problem has the characteristics of strong nonlinearity and multimodality, and is difficult to model.

[0003] Existing technologies for pedestrian trajectory prediction mainly focus on two core dimensions: spatial interaction modeling and target information constraints. On the one hand, by constructing spatial relationships between pedestrians, the mutual influence between multiple pedestrians is described. Typically, spatial interaction influence is used as an overall feature or a single weight to characterize the strength of the effect of neighboring pedestrians on the target pedestrian. Although some methods introduce sparsity mechanisms to distinguish the presence or absence of interaction, they still follow the overall on / off modeling logic. On the other hand, by introducing information such as pedestrian endpoints and target location distribution, the direction of trajectory prediction is attempted to be constrained. Usually, this type of target information is fused with trajectory features as ordinary features and then input into the network.

[0004] However, the existing modeling methods still have significant shortcomings and are difficult to meet the high-precision prediction requirements in complex traffic scenarios, specifically in two aspects: First, the spatial interaction modeling is too coarse and fails to characterize dimensional heterogeneous features: In real-world scenarios, spatial interactions between pedestrians are not singular; different spatial feature dimensions correspond to different interaction meanings. Some dimensions manifest as avoidance or repulsion, while others involve following or gathering. The interaction mechanisms of each dimension are fundamentally different. However, existing methods do not differentiate between these dimensional differences in their modeling. Once interaction is determined to exist, all feature dimensions take effect simultaneously; if no interaction is determined, all dimensions become invalid simultaneously. This fails to achieve the refined processing of "modeling interaction in some dimensions and relying solely on pedestrian movement in others," easily introducing redundant interference information from irrelevant dimensions, reducing prediction accuracy while increasing unnecessary computational overhead.

[0005] Second, the target information lacks structural constraints, failing to achieve true target guidance: Existing methods only treat the distribution of target points and endpoints as ordinary additional features in network computation. The model cannot identify these as the destination positions that pedestrians need to reach, nor does it set the target information as a core constraint for trajectory generation at the model structure level. The target information is only fed into the encoder for fusion with other features, without forming a global directional constraint in the decoding stage. This makes such information easily weakened during the prediction process, making it difficult to provide stable and clear guidance for long-term trajectory prediction. This easily leads to problems such as predicted trajectories deviating from the target direction and lacking physical rationality.

[0006] Overall, existing technologies fail to adequately characterize the multidimensional and heterogeneous features of spatial interactions and lack a trajectory generation constraint mechanism centered on the target location. Consequently, in real-world traffic scenarios such as high-density pedestrians and complex urban intersections, the stability and accuracy of trajectory prediction are insufficient to meet the application requirements of autonomous driving and intelligent transportation systems. Therefore, developing a pedestrian trajectory prediction method capable of achieving fine-grained, dimensional spatial interaction modeling and introducing target-driven structural constraints at the model structure level has become a pressing technical problem to be solved in this field. Summary of the Invention

[0007] Therefore, this invention proposes a pedestrian trajectory prediction method based on anisotropy in various dimensions and target guidance, which can at least partially solve the technical problems mentioned in the background art.

[0008] The technical solution of the present invention is as follows: A pedestrian trajectory prediction method based on anisotropy in various dimensions and target guidance includes the following steps: S1. Historical trajectory feature extraction: Input the pedestrian historical trajectory data into the data embedding layer for dimensional transformation, encode the transformed high-dimensional trajectory data, and extract the self-motion features that represent the pedestrian's speed changes, movement direction and time evolution. S2. Trajectory Time Series Modeling: Adding position encoding to the self-motion features, The trajectory time position is set, and the position code is generated according to the sine / cosine formula. Then, the time dependency relationship is constructed using Transformer. The query, key, and value vectors are obtained through linear mapping. After multi-head attention calculation and dual residual block structure processing, the time feature representation is output. S3. Spatial interaction feature modeling: At each time step, a pedestrian interaction graph is constructed, with pedestrians as nodes and spatial relationships between pedestrians as directed edges. Relationship feature vectors representing relative displacement, relative velocity, or motion differences are constructed. A relationship-aware attention network is introduced to jointly construct query, key, and value vectors by combining node features and relationship features. After weighted aggregation by a multi-head attention mechanism, a spatial interaction feature representation is output. The relationship-aware attention network is stacked in two layers. S4. Validity determination of spatial interaction in each dimension: A discriminator is introduced to determine whether there is valid interaction on a target-by-target, time-by-time-step, and spatial-dimensional basis, and only spatial interaction features with valid interaction dimensions are retained. S5. Target Point Prediction and Labeling: The temporal feature representation is concatenated with the spatial interaction features after validity assessment to form a joint spatiotemporal context feature. Based on a Conditional Variational Autoencoder (CVAE) network, the location of multimodal potential targets is predicted. The target points are then positionally encoded, and their values ​​are... Set the destination location to complete the explicit location coding marking; S6. Trajectory generation based on target-driven constraints: The marked target points are introduced as structural constraints into the decoding stage. A sequence of positions to be predicted is constructed with the last observation position as the starting point and the connection is initialized to zero. The marked target points are added to the end of the decoding input sequence. The future information masking code of the Transformer decoder is removed. A non-autoregressive global decoding method is used to predict the position points at multiple future time points at the same time.

[0009] Furthermore, in step S2, the process of trajectory time series modeling is as follows: The self-motion features are subjected to data embedding layer dimensionality transformation to obtain a high-dimensional pedestrian trajectory data sequence; To add location encoding to a high-dimensional pedestrian trajectory data sequence, the location encoding formula is as follows:

[0010] in, Indicates location, Dimensions representing the temporal characteristics of the trajectory. This indicates the dimension of the model; adding it yields the time-series sequence features. Using the time-series features as input, the query, key, and value vectors are obtained through linear mapping, and the time feature representation is output after multi-head attention calculation.

[0011] Furthermore, in step S3, the process of spatial interaction feature modeling is as follows: Using the time feature representation output in step S2 as input, a pedestrian interaction graph is constructed at each time step, with each pedestrian as a node and the relative spatial relationship between any two pedestrians as a directed edge. Based on the pedestrian interaction graph, construct a relational feature vector representing the difference in relative displacement, relative velocity, or motion for any node pair; A relation-aware attention network is introduced, which combines the temporal feature representation of nodes with the relation feature vector of node pairs. The query, key and value vectors are constructed through linear projection. After the attention weights are calculated by scaling dot product attention, the features of neighboring nodes are weighted and aggregated and processed by a nonlinear activation function to obtain the single-head spatial interaction features. The relationship-aware attention process is extended by adopting a multi-head attention mechanism. After calculating the single-head spatial interaction features of each attention head, the output results of each attention head are spliced ​​together. All parameters are shared between different time steps and used as the output of the spatial interaction module. The relation-aware attention network is stacked in a two-layer structure.

[0012] Furthermore, in the relation-aware attention network, for each time step... t The formulas for constructing the query, key, and value vectors for pedestrian node pairs are as follows:

[0013] in, For the time step of the trajectory, For node pairs in the pedestrian interaction graph, The attention head in a multi-head attention mechanism; The projection matrix of the node features. The projection matrix represents the relational features; The node output in step S2 At time step The time characteristics are represented, For pedestrian node pairs in step S3 At time step The relational feature vector.

[0014] Furthermore, the process of determining the validity of each dimension of spatial interaction in step S4 is as follows: The spatial interaction feature S output from step S3 is input into the discriminator and processed by the tangent function. Mapping to the interval (-1, 1) yields tensor A; Learnable threshold and unit step function Constructing spatial interaction indicators The calculation formula is: Where N is the number of people in the row. Where D is the number of observation time steps, and D is the spatial feature dimension; The non-differentiable unit step function problem is solved using a pass-through estimator, and the forward propagation is calculated according to the formula. Backpropagation calculates the gradient using an approximate formula; Multiply the spatial interaction indicator V element-wise with the spatial interaction module output S, i.e., S′=V⊙S, to retain the characteristics of the effective interaction dimension.

[0015] Furthermore, in step S5, the target point prediction uses a prediction module based on a conditional variational autoencoder network (CVAE), and the process is as follows: The temporal features of step S2 and the spatial features after validity determination in step S4 are combined to form the joint spatiotemporal context features of the pedestrian. Target point prediction: During the training phase, the CVAE encoder takes the joint spatiotemporal context features and the true destination location of the pedestrian trajectory as input, learns the mean and variance parameters of the latent variable probability distribution, and samples the latent variables through reparameterization; the CVAE decoder takes the sampled latent variables and the joint spatiotemporal context features as input, and outputs the predicted location coordinates of the target point; joint optimization is performed with the weighted sum of the target point reconstruction error term and the KL divergence constraint term of the latent variable distribution as the training objective; During the testing phase, the joint spatiotemporal context features are used as input, and latent variables are sampled multiple times from the standard normal distribution and input into the CVAE decoder to generate multiple multimodal target point candidates. Explicitly mark the target point: The predicted target point candidates are position-encoded, and the position codes are... Set as the destination location, complete the explicit location coding mark of the target point, so that the target point is identified as the final destination that the pedestrian needs to reach.

[0016] Furthermore, the trajectory generation process based on target-driven constraints in step S6 is as follows: Using the target point marked by explicit location encoding in step S5 as a structural constraint, construct the decoding input sequence of the Transformer decoder. The sequence starts from the last observation position in the pedestrian's historical trajectory, connects to the prediction position sequence with a length equal to the number of prediction time steps and initialized to zero, and adds the location-encoded target point to the end of the sequence. A non-autoregressive global decoding method is adopted to remove the future information masking code of the Transformer decoder, so that the self-attention calculation of the decoder can cover the entire decoding input sequence, and the position sequence of multiple future time moments can be generated at one time based on the decoding input sequence.

[0017] Furthermore, it also includes model training and testing steps: Step 1 preprocesses the trajectory dataset, including trajectory coordinate normalization, abnormal trajectory removal, and time step alignment. The preprocessed data is divided into training set, validation set, and test set according to the proportion. Only the training set is batch-partitioned. Step 2: Input the batch data of the training set into the model in the format of pedestrian historical trajectory and surrounding pedestrian position. The model executes the operations of steps S1 to S6 in sequence to obtain the future trajectory prediction value, solves the loss value between the prediction value and the actual trajectory value, and uses a gradient descent optimizer to adjust the model parameters. Step 3 is to traverse all batches of the training set in one round as one iteration. Repeat step 2 until the number of iterations reaches the preset value. During the training process, the model performance is verified through the validation set to prevent overfitting. Step four involves inputting historical pedestrian trajectory data from the test set that meets the observation time step requirements into the trained model. After the model is executed through steps S1 to S6, it outputs the trajectory coordinate sequence of the pedestrian at each future time step, which is the prediction result of the pedestrian's future trajectory.

[0018] Furthermore, in the spatial interaction feature modeling in step S3, a two-layer structure is set up for the relationship-aware attention network in a serial stack. The spatial relationships of the pedestrian interaction graph are modeled sequentially through the two-layer network to enhance the ability to model complex spatial interaction relationships. The parameters of the two-layer network are shared between different time steps.

[0019] The working principle and beneficial effects of this invention are as follows: 1. This invention decouples and models the spatial interactions between pedestrians according to different feature dimensions, rather than treating spatial interactions as a uniform overall influence. This allows for the differentiation of interaction differences across different dimensions, avoids interference from redundant information in irrelevant directions, and improves the rationality of spatial interaction modeling.

[0020] 2. This invention introduces an interaction validity determination mechanism, enabling the model to adaptively determine whether to model the interaction between pedestrians in different dimensions, thereby achieving a selective modeling approach of "introducing when needed and ignoring when not needed", reducing unnecessary computational overhead and improving the stability and robustness of prediction results.

[0021] 3. This invention explicitly marks the target point and uses it as a structural constraint in the trajectory generation process, rather than as a normal input feature. This ensures that the prediction process always revolves around the target direction, fundamentally avoiding the problem in existing methods where "the target point has input but no substantial guiding effect".

[0022] 4. This invention adopts an integrated trajectory generation method, which enables all points to be predicted to perceive the global constraints of the target point during the generation process, thereby ensuring the consistency of the predicted trajectory in terms of directionality and overall trend, and improving the stability and physical rationality of long-term prediction. Attached Figure Description

[0023] The present invention will now be described in further detail with reference to the accompanying drawings and specific embodiments.

[0024] Figure 1 This is a schematic diagram of the overall process of the pedestrian trajectory prediction method based on anisotropy and target guidance of the present invention.

[0025] Figure 2This is a schematic diagram of the overall framework of the pedestrian trajectory prediction method based on anisotropy and target guidance of the present invention.

[0026] Figure 3 This invention provides information on each dimension of spatial interaction after being discriminated by a discriminator.

[0027] Figure 4 A schematic diagram of the trajectory generation for the target anchoring. Detailed Implementation

[0028] The technical solutions of the present invention will be clearly and completely described below with reference to the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present invention.

[0029] This invention defines the pedestrian trajectory prediction task as: given a past Pedestrian trajectory coordinates at each time step Predicting the future Trajectory coordinates at each time step ,in, This is the time step for the observation phase. Here, N represents the time step in the prediction phase, and N is the number of pedestrians in the scene. It has two dimensions because the trajectory coordinates only have two dimensions.

[0030] I. Data Preprocessing The collected pedestrian trajectory data is preprocessed and divided into training set, validation set and test set according to the proportion.

[0031] The preprocessed training set data is denoted as , This represents the total observation time steps for a single trajectory.

[0032] II. Historical Trajectory Feature Extraction and Trajectory Time Series Modeling This step extracts high-dimensional features from pedestrian historical trajectories and constructs temporal dependencies using a Transformer, corresponding to the attached... Figure 2 The time encoding module specifically includes: Step 1: Dimensional Transformation of Data Embedding Layer Preprocessed training set data Input data is embedded in a layer, and dimensionality transformation is performed to obtain a high-dimensional pedestrian trajectory data sequence. This enables high-dimensional feature representation of low-dimensional trajectory coordinates, capturing the basic motion features of pedestrians. This indicates the number of dimensions after expansion. Through the dimensionality transformation described above, pedestrian trajectory data sequences can capture higher-dimensional information during training.

[0033] Step 2: Location Encoding To ensure that pedestrian trajectory data retains its temporal order, high-dimensional trajectory data sequences are... Add position encoding The location coding formula is:

[0034] in, For the time position index of the trajectory, Dimension index for trajectory time features. Indicates the dimension of the model.

[0035] By fusing location encoding with high-dimensional trajectory data sequences, time-series sequence features with temporal order are obtained:

[0036] Step 3: Transformer Temporal Modeling Using time-series features E′ as input, the temporal dependencies of pedestrian trajectories are constructed through a Transformer, specifically including: 1. Linear mapping: The query vector is obtained through linear mapping. Key vector Value vector ,satisfy:

[0037] in,

[0038] It is a linear projection matrix.

[0039] 2. Multi-head attention computation: For vectors Key vector Value vector Perform multi-head attention (MHSA) computation to capture multi-scale temporal dependencies:

[0040] in, yes Dimensions.

[0041] 3. Double Residual Block Processing: The multi-head attention calculation results are processed using a pre-normalized double residual block structure to obtain the temporal feature representation. :

[0042] in This is a point-by-point multilayer perceptron with a nonlinear activation function. Representation layer normalization operation. The final temporal feature representation. This represents the temporal motion characteristics of each pedestrian at each time step.

[0043] III. Spatial Interaction Feature Modeling This step enables fine-grained modeling of spatial interactions between pedestrians, corresponding to the spatial interaction module in Figure 2, and stacks two layers of relationship-aware attention networks to enhance the ability to model complex interactions. Specifically, it includes: Step 1: Construct pedestrian interaction graph At each time step Represented by time characteristics Based on this, construct a pedestrian interaction graph. Among them, node set For all pedestrians in the scene, edge set Given the relative spatial relationship between any two pedestrians, we represent it as a directed edge, which is used to describe the potential interaction between the target pedestrian and surrounding pedestrians.

[0044] Step 2: Construct relation feature vectors Pedestrian interaction map Any pair of nodes Construct relation feature vectors This vector represents the pedestrian. with pedestrians At time step The relative displacement, relative velocity, and motion differences enable multi-dimensional representation of spatial interaction characteristics.

[0045] Step 3: Relationship-aware attention calculation By introducing a relation-aware attention network, which combines the temporal feature representation of nodes with the relation feature vector of node pairs, we construct query, key, and value vectors for attention computation to capture multi-dimensional spatial interaction features.

[0046] in, For time steps, For attention head index, The node feature projection matrix, The feature projection matrix of the relation. For nodes At time step The time characteristics are represented.

[0047] Nodes are calculated using scaled dot product attention. Its neighboring nodes Attention weights, and in the neighborhood Normalization:

[0048] Finally, the features of the neighboring nodes are weighted and aggregated to obtain the pedestrian data. At time step Spatial interaction features:

[0049] in, It is a non-linear activation function.

[0050] Step 4: Multi-head attention fusion and network stacking A multi-head attention mechanism is used to fuse single-head spatial interaction features. The outputs of each attention head are concatenated and linearly projected to obtain a single-layer spatial interaction feature. This feature is then input into a second-layer relation-aware attention network, and the operation in step 3 above is repeated. The two layers are stacked sequentially with parameters shared between different time steps, ultimately yielding the spatial interaction feature. .

[0051] IV. Validity Assessment of Spatial Interaction in Various Dimensions This step implements the effectiveness determination of pedestrian spatial interaction on a target-by-target, time-by-time, and spatial dimension basis, with corresponding appendices. Figure 2 The discriminator module and attachment Figure 3 Specifically, it includes: Step 1: Tensor Mapping Spatial interaction features Input discriminator, through the tangent function Mapping to the interval (−1,1) yields a tensor. :

[0052] Unconditional modeling of spatial interactions introduces significant noise. However, this modeling approach is not always necessary for accurate trajectory prediction. Therefore, this invention introduces a discriminator, a task-driven module that adaptively selects whether to apply spatial interaction modeling along each dimension. The tangent function constrains its output value between (-1, 1), which aids in subsequent calculations.

[0053] Step 2: Construct spatial interaction indicators Through learnable thresholds and unit step function Based on tensors Constructing spatial interaction indicators To achieve multi-dimensional interaction validity determination: This spatial interaction indicator is used to identify whether spatial interaction features in the corresponding direction are introduced on a target-by-target, time-step-by-time, and spatial-dimensional-by-spatial basis, thereby achieving fine-grained, anisotropic spatial interaction modeling. For example, The value belongs to . The value is This indicates that spatial interactions along the corresponding dimension are explicitly included in the prediction; the value is... This indicates that spatial interactions along the corresponding dimension can be ignored.

[0054] tensor By a learnable threshold The unit step function was calculated. Defined as:

[0055] in It is a learnable threshold used to adaptively determine whether to apply spatial interaction modeling along each dimension.

[0056] Step 3: Solve the non-differentiable problem The unit step function is not differentiable, making it difficult to train the PIE using gradient-based methods. To address this issue, a pass-through estimator (STE) is employed. During forward propagation, it is calculated according to formula (15). During backpropagation, use formula (16) to calculate. The gradient. This formula is derived from formula (17) and is used to approximate the backpropagation process.

[0057]

[0058]

[0059] During training, the gating threshold and the prediction target are optimized together and converge to an equilibrium state, thereby avoiding degenerate "always on" or "always off" behavior.

[0060]

[0061] Here, It is the output of the discriminator (see formula (15)). It is the output of the spatial interaction module (see formula (12)). This indicates element-wise multiplication. Element-wise multiplication ensures that only actual interaction features are modeled; otherwise, these features would be set to zero. This strategy guarantees that only task-relevant spatial interaction features are included in the prediction.

[0062] The interaction-dependent branch is fused with the temporal feature branch to combine spatiotemporal information. These two branches are then aggregated, so that the representation at each time step may contain only temporal features, or both temporal and spatial features. Finally, the fused representation is fed into the Transformer decoder to generate the predicted future trajectory.

[0063] V. Target Point Prediction and Explicit Marking After completing the temporal and spatial interaction feature modeling of pedestrian historical trajectories, this invention further constructs a pedestrian destination prediction module based on a Conditional Variational Autoencoder (CVAE) network to probabilistically model and predict the target locations that pedestrians may reach in the future. In real-world scenarios, pedestrians typically have multiple potential walking intentions, and their possible destinations exhibit multimodal distribution characteristics. If ordinary regression is used for prediction, the results are prone to collapse towards the average position, thus losing physical plausibility. Therefore, this invention employs a generative modeling approach to learn the distribution of target locations. Specifically, the temporal features obtained in the aforementioned steps are concatenated with the spatial features determined by interaction validity to form the pedestrian's joint spatiotemporal context features. Subsequently, this joint feature is fed as a conditional input into the CVAE network to constrain the target location generation process.

[0064] During training, the CVAE encoder takes joint spatiotemporal features and the true target point location as input to learn the probability distribution parameters of the latent variables and samples them through reparameterization. The decoder takes the latent variables and joint spatiotemporal features as input and outputs the predicted target point location coordinates. The network's training objective is composed of the target point reconstruction error term and the KL divergence constraint term of the latent variable distribution, enabling the model to accurately fit the true target location while maintaining a reasonable latent spatial structure. During testing, only the joint spatiotemporal features need to be input, and latent variables are sampled from a standard normal distribution to generate one or more possible target point candidates, thereby achieving the modeling and representation of the multimodal uncertainty of pedestrian destinations.

[0065] VI. After obtaining the predicted target point, this invention introduces the target point as structural constraint information in the trajectory generation process into the decoding stage, rather than as a regular feature in the calculation. First, the target point is explicitly marked. When encoding the position of the target point using formula (1), the position encoding... Set the location as the destination so that the model can clearly distinguish that the point is the end point that the pedestrian needs to reach, rather than a normal trajectory point.

[0066] Subsequently, an input sequence structure containing target information is constructed during the decoding phase. This sequence begins with the last observed position, followed by a sequence of predicted positions initialized to zero, and ends with a target point that has been encoded in its position. In this way, the target point is explicitly incorporated into the decoded sequence structure, becoming a structural node in the trajectory generation process.

[0067] To enhance the global constraint effect of the target point on the trajectory generation process, this invention employs a non-autoregressive global decoding approach and removes the future information masking code from the traditional Transformer decoder. Thus, during the self-attention calculation process, each position to be predicted can directly obtain information from the target point, ensuring that all predicted positions are consistently constrained by the same target position's direction during the generation process. This achieves truly target-driven trajectory generation, avoiding situations where the trajectory deviates from the target direction in the middle and requires correction at the end.

[0068] 7. Calculate the predicted loss value, which is the error between the true value corresponding to the training sample and the predicted value output by the model. Adjust the network parameters of the entire model based on the loss of all samples in the batch.

[0069] 8. Repeat steps 2 through 7 until all batches of the training dataset have been used in model training.

[0070] 9. Repeat steps 2 through 8 until the specified number of iterations is reached. Specifically, set the specified number of iterations to 300.

[0071] 10. Input the observed trajectory data into the trained model to obtain the prediction results.

[0072] In summary, this invention addresses the task of pedestrian trajectory prediction by constructing a complete prediction method. This method consists of multiple functional modules. Each module has a clearly defined function and works in concert with the others.

[0073] First, a temporal coding network is used to model the temporal changes in pedestrian historical trajectories. Then, the spatial interaction relationships between pedestrians are modeled. Simultaneously, a discriminative mechanism is introduced to determine whether interaction information needs to be incorporated into various dimensions. This ensures sufficient modeling while avoiding interference from irrelevant spatial information.

[0074] Secondly, a target point prediction module based on a conditional variational autoencoder network is used to predict the possible future destinations of pedestrians. This module outputs the probability distribution of target points.

[0075] Subsequently, the predicted target point is used as the termination constraint for the trajectory generation process. In the trajectory generation stage, a non-autoregressive global decoding method is employed. All trajectory points to be predicted are generated at once. Each trajectory point can directly obtain target point information during generation. This ensures that the entire trajectory always points towards the target position.

[0076] Through the above design, this invention can more accurately describe the spatial interaction relationships between pedestrians. Simultaneously, it structurally ensures the rationality of the predicted trajectory in terms of directionality, overall trend, and termination consistency. Ultimately, it can significantly improve the accuracy, stability, and practical value of pedestrian trajectory prediction in complex traffic scenarios.

[0077] The steps described above in this invention correspond one-to-one with Figures 1-4: (Figures 1-4 are attached) Figure 1 Figure 1 is a schematic diagram of the overall process of the method, showing the entire process logic from data preprocessing to outputting prediction results; Figure 2 is a schematic diagram of the overall framework of the method, showing the interaction relationship of core modules such as time encoding, spatial action module, and discriminator; Figure 3 is a schematic diagram of spatial interaction information in various dimensions, showing the effective interaction judgment results of each spatial dimension at different time steps; Figure 4 is a schematic diagram of target anchoring trajectory generation, showing the trajectory generation method of non-autoregressive decoding and anchoring all prediction points to the endpoint of the present invention.

[0078] The above embodiments are preferred embodiments of the present invention, but the embodiments of the present invention are not limited to the above embodiments. Any changes, modifications, substitutions, combinations, or simplifications made without departing from the spirit and principle of the present invention shall be considered equivalent substitutions and shall be included within the protection scope of the present invention.

Claims

1. A pedestrian trajectory prediction method based on anisotropy in various dimensions and target guidance, characterized in that, Includes the following steps: S1. Historical trajectory feature extraction: Input the pedestrian historical trajectory data into the data embedding layer for dimensional transformation, encode the transformed high-dimensional trajectory data, and extract the self-motion features that represent the pedestrian's speed changes, movement direction and time evolution. S2. Trajectory Time Series Modeling: Adding position encoding to the self-motion features, The trajectory time position is set, and the position code is generated according to the sine / cosine formula. Then, the time dependency relationship is constructed using Transformer. The query, key, and value vectors are obtained through linear mapping. After multi-head attention calculation and dual residual block structure processing, the time feature representation is output. S3. Spatial interaction feature modeling: At each time step, a pedestrian interaction graph is constructed, with pedestrians as nodes and spatial relationships between pedestrians as directed edges. Relationship feature vectors representing relative displacement, relative velocity, or motion differences are constructed. A relationship-aware attention network is introduced to jointly construct query, key, and value vectors by combining node features and relationship features. After weighted aggregation by a multi-head attention mechanism, a spatial interaction feature representation is output. The relationship-aware attention network is stacked in two layers. S4. Validity determination of spatial interaction in each dimension: A discriminator is introduced to determine whether there is valid interaction on a target-by-target, time-by-time-step, and spatial-dimensional basis, and only spatial interaction features with valid interaction dimensions are retained. S5. Target Point Prediction and Labeling: The temporal feature representation is concatenated with the spatial interaction features after validity assessment to form a joint spatiotemporal context feature. Based on a Conditional Variational Autoencoder (CVAE) network, the location of multimodal potential targets is predicted. The target points are then positionally encoded, and their values ​​are... Set the destination location to complete the explicit location coding marking; S6. Trajectory generation based on target-driven constraints: The marked target points are introduced as structural constraints into the decoding stage. A sequence of positions to be predicted is constructed with the last observation position as the starting point and the connection is initialized to zero. The marked target points are added to the end of the decoding input sequence. The future information masking code of the Transformer decoder is removed. A non-autoregressive global decoding method is used to predict the position points at multiple future time points at the same time.

2. The pedestrian trajectory prediction method based on anisotropy and target guidance according to claim 1, characterized in that, In step S2, the process of trajectory time series modeling is as follows: The self-motion features are subjected to data embedding layer dimensionality transformation to obtain a high-dimensional pedestrian trajectory data sequence; To add location encoding to a high-dimensional pedestrian trajectory data sequence, the location encoding formula is as follows: in, Indicates location, Dimensions representing the temporal characteristics of the trajectory. This indicates the dimension of the model; adding it yields the time-series sequence features. Using the time-series features as input, the query, key, and value vectors are obtained through linear mapping, and the time feature representation is output after multi-head attention calculation.

3. The pedestrian trajectory prediction method based on anisotropy and target guidance according to claim 2, characterized in that, In step S3, the process of spatial interaction feature modeling is as follows: Using the time feature representation output in step S2 as input, a pedestrian interaction graph is constructed at each time step, with each pedestrian as a node and the relative spatial relationship between any two pedestrians as a directed edge. Based on the pedestrian interaction graph, construct a relational feature vector representing the difference in relative displacement, relative velocity, or motion for any node pair; A relation-aware attention network is introduced, which combines the temporal feature representation of nodes with the relation feature vector of node pairs. The query, key and value vectors are constructed through linear projection. After the attention weights are calculated by scaling dot product attention, the features of neighboring nodes are weighted and aggregated and processed by a nonlinear activation function to obtain the single-head spatial interaction features. The relationship-aware attention process is extended by adopting a multi-head attention mechanism. After calculating the single-head spatial interaction features of each attention head, the output results of each attention head are spliced ​​together. All parameters are shared between different time steps and used as the output of the spatial interaction module. The relation-aware attention network is stacked in a two-layer structure.

4. The pedestrian trajectory prediction method based on anisotropy and target guidance according to claim 3, characterized in that, In the relation-aware attention network, for each pedestrian node pair at time step t, the formulas for constructing the query, key, and value vectors are as follows: in, For the time step of the trajectory, , For node pairs in the pedestrian interaction graph, The attention head in a multi-head attention mechanism; The projection matrix of the node features. The projection matrix represents the relational features; The node output in step S2 , At time step The time characteristics are represented, For pedestrian node pairs in step S3 , At time step The relational feature vector.

5. The pedestrian trajectory prediction method based on anisotropy and target guidance according to claim 1, characterized in that, The process of determining the validity of each dimension of spatial interaction in step S4 is as follows: The spatial interaction feature S output from step S3 is input into the discriminator and processed by the tangent function. Mapping to the interval (-1, 1) yields tensor A; Learnable threshold and unit step function Constructing spatial interaction indicators The calculation formula is: Where N is the number of people in the row. Where D is the number of observation time steps, and D is the spatial feature dimension; The non-differentiable unit step function problem is solved using a pass-through estimator, and the forward propagation is calculated according to the formula. Backpropagation calculates the gradient using an approximate formula; Multiply the spatial interaction indicator V element-wise with the spatial interaction module output S, i.e., S′=V⊙S, to retain the characteristics of the effective interaction dimension.

6. The pedestrian trajectory prediction method based on anisotropy and target guidance according to claim 1, characterized in that, In step S5, the target point prediction uses a prediction module based on a Conditional Variational Autoencoder (CVAE) network. The process is as follows: The temporal features of step S2 and the spatial features after validity determination in step S4 are combined to form the joint spatiotemporal context features of the pedestrian. Target point prediction: During the training phase, the CVAE encoder takes the joint spatiotemporal context features and the true destination location of the pedestrian trajectory as input, learns the mean and variance parameters of the latent variable probability distribution, and samples the latent variables through reparameterization; the CVAE decoder takes the sampled latent variables and the joint spatiotemporal context features as input, and outputs the predicted location coordinates of the target point; joint optimization is performed with the weighted sum of the target point reconstruction error term and the KL divergence constraint term of the latent variable distribution as the training objective; During the testing phase, the joint spatiotemporal context features are used as input, and latent variables are sampled multiple times from the standard normal distribution and input into the CVAE decoder to generate multiple multimodal target point candidates. Explicitly mark the target point: The predicted target point candidates are position-encoded, and the position codes are... Set as the destination location, complete the explicit location coding mark of the target point, so that the target point is identified as the final destination that the pedestrian needs to reach.

7. The pedestrian trajectory prediction method based on anisotropy and target guidance according to claim 1, characterized in that, The trajectory generation process based on target-driven constraints in step S6 is as follows: Using the target point marked by explicit location encoding in step S5 as a structural constraint, construct the decoding input sequence of the Transformer decoder. The sequence starts from the last observation position in the pedestrian's historical trajectory, connects to the prediction position sequence with a length equal to the number of prediction time steps and initialized to zero, and adds the location-encoded target point to the end of the sequence. A non-autoregressive global decoding method is adopted to remove the future information masking code of the Transformer decoder, so that the self-attention calculation of the decoder can cover the entire decoding input sequence, and the position sequence of multiple future time moments can be generated at one time based on the decoding input sequence.

8. The pedestrian trajectory prediction method based on anisotropy and target guidance according to claim 1, characterized in that, It also includes model training and testing steps: Step 1 preprocesses the trajectory dataset, including trajectory coordinate normalization, abnormal trajectory removal, and time step alignment. The preprocessed data is divided into training set, validation set, and test set according to the proportion. Only the training set is batch-partitioned. Step 2: Input the batch data of the training set into the model in the format of pedestrian historical trajectory and surrounding pedestrian position. The model executes the operations of steps S1 to S6 in sequence to obtain the future trajectory prediction value, solves the loss value between the prediction value and the actual trajectory value, and uses a gradient descent optimizer to adjust the model parameters. Step 3 is to traverse all batches of the training set in one round as one iteration. Repeat step 2 until the number of iterations reaches the preset value. During the training process, the model performance is verified through the validation set to prevent overfitting. Step four involves inputting historical pedestrian trajectory data from the test set that meets the observation time step requirements into the trained model. After the model is executed through steps S1 to S6, it outputs the trajectory coordinate sequence of the pedestrian at each future time step, which is the prediction result of the pedestrian's future trajectory.

9. The pedestrian trajectory prediction method based on anisotropy and target guidance according to claim 3, characterized in that, In the spatial interaction feature modeling in step S3, a two-layer structure is set up for the relationship-aware attention network in a serial stack. The spatial relationships of the pedestrian interaction graph are modeled sequentially through the two-layer network to enhance the ability to model complex spatial interaction relationships. The parameters of the two-layer network are shared between different time steps.