Pedestrian Trajectory Prediction Based on an Intention Randomness Influence Strategy

: Pedestrian trajectory prediction is a key technical prerequisite for autonomous vehicle trajectory planning. However, a pedestrian is a changeable individual, and their intentions exhibit certain degrees of randomness and uncertainty, which leads to the issue that modeling only past trajectories does not enable the effective description of the random intentions and future trajectory directions of the pedestrian. Therefore, this paper proposes a flexible and embeddable stochastic intention vector construction strategy for modeling sudden pedestrian intention changes in real scenes and for better fitting the stochastic properties of pedestrian behaviors. First, we dynamically fuse historical trajectory information with random factors and construct an intention change probability based on the historical trajectory fitting errors of pedestrians, aiming to explicitly model the associated direction and velocity changes caused by random pedestrian intentions. Second, a new intention loss function is designed to guide the model to adaptively learn the probability of intention changes, which is used to dynamically describe pedestrian intention changes. Our proposed method is generalizable and can be applied as an embeddable module to any baseline pedestrian trajectory prediction method. The experimental results obtained on multiple large-scale public pedestrian trajectory prediction datasets demonstrate that our strategy achieves consistent performance improvements over different baselines.


Introduction
The accurate prediction of pedestrians' future trajectories through their historical trajectories is an urgent problem to be solved with respect to autonomous driving technology and has attracted a large amount of attention from researchers.In recent years, the field of pedestrian trajectory prediction has also garnered considerable attention and new methods have constantly emerged.
The current methods are generally based on recurrent neural networks (RNNs); they model pedestrians' historical trajectories to simulate the hidden states of pedestrian movements, and then, based on an attention module, they weight the interactions between pedestrians [1][2][3] or directly model pedestrian nodes based on different graph neural networks.The adjacency matrix of the interactions between pedestrians is calculated and used to predict the future trajectories of pedestrians [4][5][6].Although some of the current methods have achieved good results, because a pedestrian is an uncertain individual, their movements are random.Specifically, in a normal traffic scene, the intention to change at any time due to the different semantic constraints of a scene instructs pedestrians to choose change at any time due to the different semantic constraints of a scene instructs pedestrians to choose to slow down or change their walking directions, directly leading to sudden changes in their future trajectories.
At present, research methods based on modeling the motion patterns of pedestrians according only to their historical motion trajectories may not be suitable for pedestrian trajectory prediction tasks in actual scenarios.This is because the existing methods do not consider the random intentions of pedestrians themselves.Specifically, the existing methods do not model the influence of the random intentions of pedestrians on their future trajectories.As shown in Figure 1, the information provided by a historical trajectory alone cannot be used to cope with trajectory changes caused by sudden pedestrian intention changes.The linear extension in the figure is the continuation of the pedestrian's current intention.The pedestrian's intention clearly changes during the subsequent walking process, and their future trajectory changes accordingly.Notably, this random change in intent cannot be predicted solely from the pedestrian's historical trajectory information.Therefore, the method of predicting future trajectories based on historical trajectory data is ideal for prediction scenarios where pedestrian intentions do not change.Once the intentions of pedestrians change, information such as the directions and speeds provided by historical trajectories no longer has absolute reference significance.Therefore, this randomness should be fully considered in both autonomous driving applications and intelligent robot applications.To our knowledge, the current methods rarely consider the impacts of pedestrian intention changes on their directions and speeds [3,5,7].On the one hand, the randomness of pedestrian movement is difficult to describe; on the other hand, pedestrian movements have certain limitations under social rules, so the current methods pay more attention to the interactions between pedestrians and their physical environment.However, this does not mean that the randomness of pedestrians themselves can be ignored.In complex scenes, an automatic driving system must have extremely high driving safety, especially in cases where pedestrians interact with the system.Therefore, pedestrian trajectory prediction systems for automatic driving applications must consider the influence of random pedestrian intentions to ensure safety.To our knowledge, the current methods rarely consider the impacts of pedestrian intention changes on their directions and speeds [3,5,7].On the one hand, the randomness of pedestrian movement is difficult to describe; on the other hand, pedestrian movements have certain limitations under social rules, so the current methods pay more attention to the interactions between pedestrians and their physical environment.However, this does not mean that the randomness of pedestrians themselves can be ignored.In complex scenes, an automatic driving system must have extremely high driving safety, especially in cases where pedestrians interact with the system.Therefore, pedestrian trajectory prediction systems for automatic driving applications must consider the influence of random pedestrian intentions to ensure safety.
To this end, this paper proposes a stochastic intention vector modeling strategy for characterizing the randomness of pedestrian intentions.Specifically, we generate an intention vector that simulates pedestrian intention changes by combining the displacement information of the last frame of the historical trajectory with the random normal distribution and then predicting the subsequent pedestrian trajectory.The movement direction and speed changes caused by the intention vector are introduced to simulate the pedestrian intention changes.Then, we designed a module that models the probability of pedestrian intention changes.First, the direct manifestation of a pedestrian intention change is often reflected on their trajectory; that is, trajectory performance is not linear.Pedestrians with variable historical trajectories are more likely to change their future intentions.Therefore, the linear fitting error of the historical trajectory can be used as the probability of a pedestrian intention change to determine whether to use the intention vector.Finally, the impacts of sudden changes in pedestrians' directions and speeds can be continuously reduced through the use of the intention vector during training.Our proposed method is a general plug-in module that is designed to model the influence of the randomness of pedestrian intentions on pedestrian trajectory prediction, and our method can be embedded into different existing methods.In this paper, we also implement some applications based on the state-of-the-art baseline modeling method.The experimental results show that our method demonstrates good improvements over the baseline model.
The main contributions of this paper are as follows. 1.
We propose a random intention vector construction strategy that combines historical trajectory information with random factors, where the aim is to predict a trajectory by directly considering the direction and speed changes caused by the changes in a pedestrian's own intentions.

2.
We designed an intention change probability based on the fitting error induced by the historical trajectory of the pedestrian and introduce an intention loss function to self-update the intention change probability, ensuring that the process of modeling the trajectory change caused by the randomness of pedestrian movement is targeted.

3.
The proposed intention vector construction method can be embedded into all trajectory prediction benchmark methods as a plug-in module to supplement the pedestrian randomness modeling process to improve the pedestrian trajectory prediction accuracies of the benchmark methods.

Pedestrian Trajectory Prediction
Pedestrian trajectory prediction is based mainly on the combination of a pedestrian's own movement pattern and their interactions with the outside world.In the early methods, pedestrian movements were mainly simulated by artificial motion functions [8,9].These predictions were usually deterministic and did not involve multiple modes, so it was difficult to simulate the randomness of pedestrian movements.Moreover, these methods did not consider the historical trajectory information of pedestrians but rather focused on the continuation of the current motion state.
With the rapid development of deep learning, pedestrian trajectory prediction methods have also been improved.Social long short-term memory (LSTM) [10] utilizes RNNs to model the motion state of each pedestrian to obtain the hidden state representing their motion mode.Then, the proposed social pooling module combines the hidden states of adjacent pedestrians within a certain spatial distance to simulate interactions between the pedestrians.The social-generative adversarial network (GAN) [11], SoPhie [1] and Social-Ways [2] all retain the part of Social LSTM that uses RNNs to determine pedestrian motion states; in addition, they use GANs as their overall network architectures.The pooling module proposed for Social-GAN comprehensively considers global pedestrian information, which is different from the local pooling operation of Social LSTM, so the generated trajectory is more in line with social norms.On the basis of pedestrians' historical trajectories, SoPhie also introduces real scene information, integrating social interaction attention and physical scene attention.Social-Ways simulates pedestrian interactions and introduces an attention mechanism to comprehensively consider the distances between pedestrians, the angles between the motion directions of pedestrians and the shortest distances between pedestrians to better understand the interactions between pedestrians.SR-LSTM [12] employs a data-driven LSTM state refinement network to enable the utilization of the current intentions of neighbors through a message-passing framework.Other methods adopt the variational autoencoder (VAE) framework in combination with RNNs to directly predict tracks [7,13].Additionally, some methodologies incorporate convolutional neural networks to model the spatial characteristics of pedestrians.In [14], a convolutional LSTM network was designed to extract the temporal and multichannel spatial features of pedestrians to predict their future trajectories.In [15], a two-dimensional convolutional model was directly introduced instead of an RNN, and data normalization and data enhancement techniques were combined to predict the trajectories of pedestrians.
Some methods have also begun to consider the characteristics of graph networks.Pedestrians and their influences on other pedestrians can be embedded as the nodes and edges of graph networks, which can better simulate the interactions between people.Social-BiGAT [16] and STGAT [3] still use RNNs as their main frameworks and employ only a graph attention network (GAT) to address pedestrian interactions in trajectory prediction tasks, while Social-STGCNN [4] directly models pedestrian trajectories as graphs and performs trajectory prediction on graph structures.In the prediction stage, a multimodal prediction strategy based on a Gaussian distribution is used to replace the confirmed trajectory predicted by the model to improve the resulting prediction accuracy.When a graph convolutional network (GCN) is used to model pedestrian interactions according to the distances between them, the impacts between pedestrians are the same, leading to redundant interactions.SGCN [5] improved upon Social-STGCNN by utilizing sparse GCNs to learn trajectory representations.

Intention Prediction
Some relevant studies have focused on the uncertainty encountered in driving scenes, investigated drivers' behavioral characteristics, and identified drivers' intentions [17,18].Correctly predicting a pedestrian's intentions is also crucial for achieving autonomous driving, as it provides a safe way to plan vehicle routes.Pedestrian intentions can be used to better judge the subsequent destinations and paths of pedestrians.Therefore, it is extremely important to predict pedestrian intentions by combining historical trajectory information and even physical scenes.Some early works used hidden Markov models to predict pedestrian intentions [19,20].Recently, several methods for use with intelligent driving assistance systems have emerged; they mainly predict pedestrian intentions regarding whether to cross a road [21,22].Other works aimed at predicting the intentions of pedestrians with respect to their future destinations; such methods pay more attention to scene information, and the final target locations of pedestrians are considered before performing trajectory prediction [23,24].However, these methods use the historical trajectory and scene information of a pedestrian to judge their current intention information.This strategy often ignores the fact that the pedestrian's own movement is stochastic, i.e., the pedestrian's current intention may change in subsequent movements.Such random intention fluctuations influence the pedestrian's subsequent movements and future destinations, thereby further compromising the predictive efficacy of the baseline trajectory prediction model.Consequently, the random intention module contained in our approach is designed to model the impacts of sudden pedestrian intention changes.It can be used as a plug-and-play module to complement the ability of the baseline method to model intention randomness.

Methods
In this section, we present the process for constructing a random intention vector and the full implementation details of the baseline model.Some of the main notations used in this paper are summarized in Table 1.

Problem Definition
Pedestrian track prediction operates based mainly on historical track information and physical scene information to predict subsequent position coordinates.In the current method, the historical time frames t 1 ∈ {1, 2, . . . ,t obs } are generally given, and for each person n ∈ [1, . . . ,N] included in the scene of interest, the spatial coordinates x n t 1 , y n t 1 in time frame t 1 are defined as historical track coordinates.Based on these coordinates, the coordinate information in the subsequent time frame t 2 ∈ t obs + 1, t obs + 2, . . ., t pred is predicted.
Pedestrian interactions E n can be obtained from the input pedestrian trajectory or scene information.After passing through the trajectory prediction network F θ (•) in sequence, the future trajectory of a pedestrian can be modeled as follows: where . ., t obs represents the historical trajectory of the nth pedestrian in the scene and . ., t pred represents the predicted future trajectory of the nth pedestrian.The current method basically uses relative positions, namely, displacement values, to replace absolute positions.The pedestrian movement pattern obtained according to the given historical track information predicts the subsequent displacement on the basis of the direction and speed provided by the displacement of the last frame, enabling the acquisition of future position coordinates.

Construction of a Random Intention Vector and Intention Change Probabilities
This section describes how to construct a random intention vector based on a given historical trajectory to simulate the impacts of pedestrians' actual intention changes.The intuitive expression of a pedestrian intention change encountered in a real scene represents the fact that the current speed and direction of a pedestrian change, so we need to simulate such changes manually.
The displacement of the last frame in the historical trajectory reflects the direction and magnitude of the current speed of the pedestrian, that is, the direct manifestation of the pedestrian's current intention.In real scenes, the change in a pedestrian's intention is intuitively represented by their trajectory change.With a physical background, as long as the coordinate component of the pedestrian speed changes, it will produce changes in the magnitude and direction of the subsequent velocity.
The specific structure of our random intention module is shown in Figure 2. First, the displacement information of the last frame of the input historical trajectory is combined with a random number factor generated from the standard normal distribution, and then the combined information is passed through a biased linear layer to obtain a random intention vector → I .In the fit error module, we initialize the intentional change probability of each pedestrian based on the magnitudes of the second-order fitness error values of all the coordinate points in the input history trajectory and then run it through a linear layer with a random bias term to obtain the intentional change probability → P I .In the sparse intention module, the need for the random intention vector → I is determined based on the magnitude of the intention change probability → P I for each pedestrian.The output → I s of the sparse intention module is eventually concatenated with a zero vector to maintain the same length as that of the historical trajectory.

Construction of a Random Intention Vector and Intention Change Probabilities
This section describes how to construct a random intention vector based on a given historical trajectory to simulate the impacts of pedestrians' actual intention changes.The intuitive expression of a pedestrian intention change encountered in a real scene represents the fact that the current speed and direction of a pedestrian change, so we need to simulate such changes manually.
The displacement of the last frame in the historical trajectory reflects the direction and magnitude of the current speed of the pedestrian, that is, the direct manifestation of the pedestrian's current intention.In real scenes, the change in a pedestrian's intention is intuitively represented by their trajectory change.With a physical background, as long as the coordinate component of the pedestrian speed changes, it will produce changes in the magnitude and direction of the subsequent velocity.
The specific structure of our random intention module is shown in Figure 2. First, the displacement information of the last frame of the input historical trajectory is combined with a random number factor generated from the standard normal distribution, and then the combined information is passed through a biased linear layer to obtain a random intention vector  ⃗ .In the fit error module, we initialize the intentional change probability of each pedestrian based on the magnitudes of the second-order fitness error values of all the coordinate points in the input history trajectory and then run it through a linear layer with a random bias term to obtain the intentional change probability  ⃗ .In the sparse intention module, the need for the random intention vector  ⃗ is determined based on the magnitude of the intention change probability  ⃗ for each pedestrian.The output  ⃗ of the sparse intention module is eventually concatenated with a zero vector to maintain the same length as that of the historical trajectory.We sample a random number factor → η from the standard normal distribution, feed → R obs into a biased linear layer, and multiply the result by → η to obtain the random intention vector: where represents the multiplication of the corresponding elements of two vectors; w and b represent the learnable weight parameters and bias terms in the linear layer, respectively; and → R obs contains the speed and direction of the pedestrian in the last frame, that is, the intention information.Combined with the randomness caused by the random number factor → η , the random intention vector combined with the current pedestrian state can be initially obtained.Afterward, the values of w and b are constantly updated during the model training process to enable the model to self-adjust to the randomness in the random intention vector and avoid extremely unreasonable intention changes.

Constructing the Intention Change Probability
Next, a standard is set based on the historical trajectory data to define which pedestrians may be more inclined to change their intentions, making our random intention vector more targeted and thus improving the randomness of pedestrians without creating too many redundant influences.Since a pedestrian's trajectory is a direct reflection of their intention, we design a fitting error module.First, we perform second-order fitting for the coordinate points of each pedestrian's historical trajectory based on the least-squares method to obtain the fitting error and then initialize the fitting error to a vector → p between 0 and 1 according to the size of the error.Then, the vector → p is passed through a linear layer, Linear*, with a random bias for obtaining the vector representing the intention change probability of each pedestrian as follows: where ν and µ are learnable parameters in the defined randomly biased linear layer (Linear*), and φ n is a set of random numbers drawn from a uniform distribution with the interval [0, 1 ).The weight ν and random bias term µφ n are introduced here mainly to make the model more flexible for updating the probability of pedestrian intention changes during the training process according to different real scenarios.At the same time, the linear layer uses the artificially designed random bias term µφ n , which also makes it possible to use for pedestrians with small probabilities.

Intention Loss Function
Notably, the loss function of the baseline model cannot effectively update a pedestrian's intention change probability vector → P I on its own.Therefore, to help the model capture the relationship between the historical trajectory offset and the future trajectory offset of a pedestrian, we introduce a new intention loss to ensure that the model can more flexibly update the pedestrian's intention change probability → P I during the training process.The loss is calculated as follows: where PI represents the true value of the intention change probability obtained according to the fitting error between the last frame of the pedestrian's historical trajectory and the future trajectory.The final loss function is defined as a linear combination of the loss functions L Baseline and L Intention of the baseline model, namely, L = L Baseline + λL Intention .
We set a penalty factor λ = 0.1 to balance the primary and secondary relationships between the two losses.

Sparse Intention
As shown in Figure 2, the obtained random intention vector → I and the intention change probability vector → P I are also passed through a sparse intention module to obtain a sparse random intention vector → I s .The designed sparse module determines whether the corresponding pedestrian should use the generated random intention vector or use the zero vector without any influence according to each probability contained in → P I .In other words, element-by-element threshold judgments are needed for → P I .Instead of setting a specific threshold, a random number θ n between 0 and 1 is generated for each pedestrian n.In this way, when Finally, a zero vector is generated and spliced with the sparse random intention vector → I s to obtain the module output → I out , which is mainly used to subsequently superimpose it with the complete historical pedestrian trajectory displacement.

Implementation Details
To evaluate the generality of our method for constructing random intention vectors, we add the proposed method as a module to the existing method for evaluation purposes.As shown in Figure 3, first, the historical trajectory coordinates of pedestrians need to be coded as a displacement vector → R, and the displacement is defined as the coordinate difference between two adjacent frames to facilitate consistency with the input form of the baseline model data during the test.At the same time, the historical trajectory coordinates of pedestrians are input into the random intention module to obtain the intention module output → I out spliced with the zero vector.Afterward, the displacement vector where ⊕ represents the elementwise addition operation.In this way, the intention vector can induce pedestrian speed and direction changes, thus simulating the influences of pedestrian intention changes.
We then input the displacement vector → R I , which adds the intention changes to the baseline model we want to evaluate.Here, we add → R I to three advanced baseline methods-the GNN-based SGCN [5] and the RNN-based STGAT [3] and SVAE [7] methods-for training purposes to obtain the predicted trajectories.Additionally, when evaluating our methods, we use the same hyperparameters as those of the baseline models for training, employing a fixed random number seed, allowing our results to be efficiently reproduced, thus providing a fair comparison between the results of the baseline models and those produced after the addition of our intention module.
where ⊕ represents the elementwise addition operation.In this way, the intention vector can induce pedestrian speed and direction changes, thus simulating the influences of pedestrian intention changes.

Experiments
In this section, we introduce comprehensive evaluation experiments, which are performed on the proposed intention vector construction method to confirm its effectiveness and generality through a detailed comparison.In Section 4.1, we first briefly introduce the employed pedestrian trajectory prediction datasets (ETH [25] and UCY [26]) and the current mainstream evaluation indicators.In Section 4. At the same time, we remove some components from the random intention module to obtain different variants and evaluate the contributions of different components to the final attained performance.Finally, in Section 4.3, we present the visualization results obtained on the ETH and UCY datasets.

Datasets and Evaluation Metrics
Datasets: To train and evaluate our method, we conducted experiments on two public datasets, ETH and UCY, which were sampled every 0.4 s from pedestrian trajectories produced in different real scenarios.The ETH dataset includes two real ETH and Hotel scenarios.The UCY dataset includes ZARA1, ZARA2, and UNIV, which are three real scenes.To evaluate our method, we adopted the mainstream training idea.For the five real scenario datasets, we trained and validated the model by evaluating it on four of the datasets and tested it on the remaining dataset.In the experiment, the historical trajectory lasted for 3.2 s (8 frames), and the predicted future trajectory was 4.8 s (12 frames).
Evaluation Metrics: We used the same evaluation criteria as those of the baseline method to evaluate the prediction results, namely, the mean displacement error (ADE) [27] and the final displacement error (FDE) [10], where the ADE calculates the mean Euclidean distance between all the predicted trajectory coordinates and all the true trajectory coordinates.The final displacement distance is calculated by the Euclidean distance between the predicted endpoint coordinates and the real destination coordinates.The specific definitions of these metrics are as follows: At the same time, the assessment strategy of the baseline method was also adopted during the test; that is, 20 samples were generated, and the samples closest to the real trajectory were selected for evaluation purposes.

Quantitative Evaluation
In this section, we present all the experiments we performed to determine the effectiveness of the proposed random intention module.
Experimental evaluation of the intention vector construction process: To evaluate the effectiveness of our approach, as shown in Table 2, we conducted experiments on the official source codes of three representative CNN-based and RNN-based baseline models (SGCN, STGAT, and SVAE) and compared the results of the baseline models with those of Intention-SGCN, Intention-STGAT, and Intention-SVAE rafter adding our approach.An * in Table 2 indicates the results we reproduced using the official code of the method.Due to the different settings of some hyperparameters or the use of different experimental equipment, our directly reproduced results may have been different from the results produced in the original papers.Therefore, to ensure the fairness of the comparison and to better reflect the actual results of our methods, all the hyperparameters in our evaluations of Intention-SGCN and Intention-STGAT were consistent with those in the baseline models.
For different baseline models, our intention vector construction method improved the error metrics produced during model testing.In particular, Intention-SGCN improved the average ADE/FDE values for the five real-world scenarios by 0.02/0.12,respectively, over those of SGCN *.Compared with that of STGAT *, the FDEs of Intention-STGAT improved by 0.03/0.05over those of STGAT*, and that of Intention-SVAE improved by 0.01 over that of SVAE *.The Stanford UAV dataset [28], which contains eight different real-world scenarios, was also used as a pedestrian trajectory prediction benchmark [7,13,29].For the sake of the comprehensiveness of the evaluation, we kept the same dataset segmentation settings as those in [29] and evaluated the trajectory prediction effectiveness of Intention-SVAE with the addition of our intention module on the SDD dataset, using the latest SVAE approach as the baseline model.As shown in Table 3, in the evaluation conducted on the SDD dataset, our Intention-SVAE achieved an effective FDE improvement of 0.02 over the baseline SVAE model.In the evaluation of our method, the y-coordinate component of the displacement in the last frame of the historical trajectory was used to construct the intention vector as the benchmark information → R obs .Table 4 presents our attempts to adopt different forms of displacement coordinate components for the last frame of the historical trajectory ( → R obs ) and provides the relevant experimental evaluation results.
Evaluation of the results produced when selecting different → R obs .As shown in Table 4, before determining the final scheme, we tried to use different forms of the coordinate components in the last frame of the historical trajectory as benchmark information for constructing intention vectors.The experiments included three schemes: Intention-SGCN-X, Intention-SGCN-Y, and Intention-SGCN-XY.Intention-SGCN-X involved the use of the y-coordinate of the displacement of frame 8 as → R obs , Intention-SGCN-Y means used the y-coordinate as → R obs , and Intention-SGCN-XY used both the x-and y-coordinates as → R obs .It can be seen that any of the schemes could yield performance improvements over the baseline model and improvements in the randomness of pedestrian intention changes.These results also demonstrate the universality of our intention vector construction method.Overall, the better results produced by Intention-SGCN-Y may have been obtained because pedestrian movements are always regular in specific scenarios, such as pedestrians walking along the street when shopping and pedestrians walking parallel to the zebra crossing, that is, pedestrians walking along a "road".When the given dataset is labeled, under the set coordinate system, the forward direction for most pedestrians is consistent with the direction of the x-coordinate system, so the x-component of pedestrian displacement mainly affects the speed, while changes in the y-component can not only affect the speeds of pedestrians but also cause more direction changes.At the same time, although pedestrian movements are random, the walking speeds of pedestrians are relatively low, and their speed changes are continuous.Even if a change occurs, it is more represented by a shift in direction.Therefore, Intention-SGCN-Y is more suitable for actual situations; that is, the selected → R obs must be set according to the vertical direction of the route in an actual application scene.
Evaluation of the → η generated from different data distributions: To determine the final data distribution we adopted in Section 3.2 and further verify the validity of our conjecture regarding the standard normal distribution, as shown in Table 5, we designed relevant experiments to evaluate the actual effects of the random number factors → η generated by different data distributions, including the uniform distribution, random normal distribution, and standard normal distribution, on the resulting models.The standard normal distribution achieved the best comprehensive effects in different real scenes, which was consistent with our conjecture.The standard normal distribution provided random positive and negative factors, and small random factors were obtained with high probability so that a large proportion of the pedestrian trajectories were only slightly changed, which was in line with the pedestrian movement patterns observed in real scenes.Evaluating the contributions of different components in the proposed module: As shown in Table 6, we evaluated three different variants of our random intention module, where (1) Intention-SGCN w/o RBLL indicates that the random biased linear layer (Linear*) was removed, making it difficult for pedestrians with small initial intention change probabilities to change their intentions; (2) Intention-SGCN w/o RNF means that the random number factor → η was not used, so the random intention vector → I lost its randomness; and (3) Intention-SGCN w/o POI means that intentions were not used to directly change the probabilities, and each pedestrian had a random intention vector so that the constructed random intention vector was no longer targeted, resulting in some redundant effects.As shown by the results of our ablation experiments (presented in Table 6), removing any component from the model resulted in a substantial performance degradation.In particular, Intention-SGCN w/o POI did not conform to the pedestrian movement pattern in the real scene because each pedestrian considered their intention change, which directly led to a decline in the prediction performance achieved in scenarios other than the ETH scenario relative to that of the baseline model.This result shows that setting the intention change probability is crucial to the universality of the random intention module.

Visualization
We qualitatively visualize the results to show that our intention vector can indeed improve the consideration of the randomness of pedestrian intention changes.As shown in Figures 4 and 5, we visualize the trajectories predicted by Intention-SGCN and Intention-STGAT along with those of their corresponding baseline models in different scenarios.As illustrated in Figures 4 and 5, the utilization of our proposed methodology enables the predicted trajectories of the baseline model to be more closely aligned with the actual future trajectories of pedestrians when the true future trajectories exhibit significant deviations from the historical trajectories.Our method can effectively lessen the negative impact caused by the randomness of pedestrian movements and improve the overall accuracy of trajectory prediction.

Visualization
We qualitatively visualize the results to show that our intention vector can indeed improve the consideration of the randomness of pedestrian intention changes.As shown in Figures 4 and 5, we visualize the trajectories predicted by Intention-SGCN and Intention-STGAT along with those of their corresponding baseline models in different scenarios.As illustrated in Figures 4 and 5, the utilization of our proposed methodology enables the predicted trajectories of the baseline model to be more closely aligned with the actual future trajectories of pedestrians when the true future trajectories exhibit significant deviations from the historical trajectories.Our method can effectively lessen the negative impact caused by the randomness of pedestrian movements and improve the overall accuracy of trajectory prediction.

Conclusions
In this paper, we propose an intention vector construction method to model trajectory alterations caused by the randomness of pedestrian movements.This result is achieved through the designed random intention module, in which the intention change probabilities of pedestrians are obtained based on their historical trajectory information.At the same time, a pedestrian trajectory change is modeled according to the displacement information of the last frame of the historical trajectory and is superimposed on the displacement of the pedestrian through the sparse intention module.Our method is a plug-andplay module that can effectively improve the pedestrian trajectory prediction effects of different models.The experimental results show that our method achieves consistent performance improvements over the baseline models and is effective in different real-world scenarios.In addition, ablation experiments involving different intention vector construction methods verify the generalizability of our method.Similarly, the practical effectiveness of the method proposed in this paper as a plug-in module is constrained by the trajectory prediction efficacy of the baseline model.In future research, it would be beneficial to improve the process used to model scene information to gain a deeper understanding of the various possibilities of pedestrian movements.

Conclusions
In this paper, we propose an intention vector construction method to model trajectory alterations caused by the randomness of pedestrian movements.This result is achieved through the designed random intention module, in which the intention change probabilities of pedestrians are obtained based on their historical trajectory information.At the same time, a pedestrian trajectory change is modeled according to the displacement information of the last frame of the historical trajectory and is superimposed on the displacement of the pedestrian through the sparse intention module.Our method is a plug-and-play module that can effectively improve the pedestrian trajectory prediction effects of different models.The experimental results show that our method achieves consistent performance improvements over the baseline models and is effective in different real-world scenarios.In addition, ablation experiments involving different intention vector construction methods verify the generalizability of our method.Similarly, the practical effectiveness of the method proposed in this paper as a plug-in module is constrained by the trajectory prediction efficacy of the baseline model.In future research, it would be beneficial to improve the process used to model scene information to gain a deeper understanding of the various possibilities of pedestrian movements.

Figure 1 .
Figure 1. Background of our approach.The figure shows the impact of a sudden pedestrian intention change in an actual scene.The solid blue line represents the observed historical track, the dashed blue line represents the linear extension of the current track, and the solid red line represents the subsequent real track.

Figure 1 .
Figure 1. Background of our approach.The figure shows the impact of a sudden pedestrian intention change in an actual scene.The solid blue line represents the observed historical track, the dashed blue line represents the linear extension of the current track, and the solid red line represents the subsequent real track.

→pR
Initialized fitting error vector with values between 0 and 1 → P I A learnable vector that represents the probability of each pedestrian's intention to change PI The true value of the intention change probability obtained from the fitting error of the future trajectory → I s The output of the sparse intention module-a sparse random intention vector φ n , θ n Random number between 0 and 1 → P I (n) The probability of the intention of agent n changing → I out The final output of the module obtained by splicing → I s with zero vectors → The displacement vector obtained by encoding the historical trajectory of a pedestrian → R I Displacement vectors that superimpose intention changes

Figure 3 .Figure 3 .
Figure 3. Practical use of our intention vector construction method.The historical trajectory coordinates of a pedestrian are encoded to obtain a displacement vector.Additionally, the trajectory coordinates of the pedestrian are sent to the random intention module and superimposed on the displacement vector of the pedestrian.
2, the comparison results obtained by adding our intention module to the baseline model and the original baseline model are shown in detail.The displacement coordinate components of the last frame of the input historical trajectory ( → R obs ) obtained using different forms are experimentally evaluated.The impacts of the random number factors → η generated by different distributions are evaluated.

Figure 4 .
Figure 4. Visual presentation of the trajectories produced by our Intention-SGCN method in different real-world scenarios.We compare the predicted trajectories generated by the Intention-SGCN and baseline SGCN methods on five datasets: ETH, HOTEL, ZARA1, ZARA2, and UNIV.These comparison results qualitatively show that our method can reduce the impact of random pedestrian intentions.

Figure 4 .
Figure 4. Visual presentation of the trajectories produced by our Intention-SGCN method in different real-world scenarios.We compare the predicted trajectories generated by the Intention-SGCN and baseline SGCN methods on five datasets: ETH, HOTEL, ZARA1, ZARA2, and UNIV.These comparison results qualitatively show that our method can reduce the impact of random pedestrian intentions.

Figure 5 .
Figure 5. Visual presentation of the trajectories produced by our Intention-STGAT method in different real-world scenarios.We contrast the predicted trajectories generated by the Intention-STGAT and baseline STGAT methods on five datasets: ETH, HOTEL, ZARA1, ZARA2, and UNIV.

Author Contributions:
Investigation, Y.D. (Yingjian Deng), L.Z. and J.C.; methodology, Y.D. (Yingjian Deng); validation, Y.D. (Yingjian Deng); writing-original draft, Y.D. (Yingjian Deng); writing-review and editing, L.Z., J.C., Y.D. (Yu Deng) and J.L.All authors have read and agreed to the published version of the manuscript.Funding: This work was supported in part by the National Natural Science Foundation of China under grant 62001003 and in part by the China Postdoctoral Science Foundation under grant 2020M671851 and in part by the National Science Foundation of China under grant U23B2007 and

Figure 5 .
Figure 5. Visual presentation of the trajectories produced by our Intention-STGAT method in different real-world scenarios.We contrast the predicted trajectories generated by the Intention-STGAT and baseline STGAT methods on five datasets: ETH, HOTEL, ZARA1, ZARA2, and UNIV.

Author Contributions:
Investigation, Y.D. (Yingjian Deng), L.Z. and J.C.; methodology, Y.D. (Yingjian Deng); validation, Y.D. (Yingjian Deng); writing-original draft, Y.D. (Yingjian Deng); writing-review and editing, L.Z., J.C., Y.D. (Yu Deng) and J.L.All authors have read and agreed to the published version of the manuscript.Funding: This work was supported in part by the National Natural Science Foundation of China under grant 62001003 and in part by the China Postdoctoral Science Foundation under grant 2020M671851 and in part by the National Science Foundation of China under grant U23B2007 and in part by the Key Research and Development Plan (Industry) Project of Yancheng under grant BE2023002.

Table 1 .
Summary of the main notations.
→IA random intention vector that combines coordinate components and random number factors

Table 2 .
Evaluation results produced by several advanced baseline models.Our two-stage optimization strategy improved the predictive efficacy levels of all three baseline methods.Lower values of both the ADE and FDE metrics signify better results.The table highlights the best results for ADE/FDE in bold.

Table 3 .
Results of evaluation experiments conducted on the SDD dataset, where * denotes the results reproduced using the baseline model.

Table 4 .
The SGCN was used as the baseline model to evaluate the results obtained when using different forms of the displacement components of frame 8 to construct the intention vector.

Table 5 .
The SGCN was used as the baseline model to evaluate the influences of the random number factors generated by different data distributions on the experimental results.

Table 6 .
Ablation experiments with variants of random intention modules with different components removed to evaluate the effect of different components in the module.