A pedestrian trajectory prediction method based on generative adversarial network and long short-term memory model

Through the pedestrian trajectory prediction method based on the generative adversarial network and the long short-term memory model, the challenging problem of pedestrian trajectory prediction in complex traffic scenes is solved. By training the model on the ETH data set, the prediction performance is improved and the ADE and FDE indicators are verified. Effect.

CN114580715BActive Publication Date: 2024-10-15NANJING UNIV OF AERONAUTICS & ASTRONAUTICS
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210149868.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-02-18
Publication Date
2024-10-15
Estimated Expiration
2042-02-18

AI Technical Summary

Technical Problem

Pedestrian trajectory prediction is challenging at intersections without traffic lights or when there are a large number of pedestrians. It is difficult for existing technologies to effectively consider multiple influencing factors and dynamic environments, resulting in low prediction accuracy.

Method used

A pedestrian trajectory prediction method based on generative adversarial networks and long short-term memory models is adopted. By constructing a generator and discriminator network, the ETH data set and its supplementary data set are used for training, and the encoder, decoder and social feature embedding layer are combined to optimize loss function to improve prediction performance.

Benefits of technology

It achieves better performance in pedestrian trajectory prediction, verifies the effectiveness of the model through ADE and FDE indicators, and is suitable for pedestrian movement prediction in complex traffic scenes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114580715B_ABST
    Figure CN114580715B_ABST
Patent Text Reader

Abstract

The present invention discloses a pedestrian trajectory prediction method based on a generative adversarial network and a long short-term memory model, comprising: selecting an ETH pedestrian trajectory dataset as a data source, selecting a Social GAN ​​method, modeling pedestrian historical trajectories and current positions with the help of a long short-term memory network LSTM, and realizing pedestrian trajectory prediction; wherein, a generator uses a long short-term memory network to perform feature analysis on the historical trajectory of each pedestrian in the data; a discriminator part extracts input features through several fully connected layers, and also memorizes the features of the historical trajectory through an LSTM network; considering that the official ETH dataset does not contain person ID label information, the model is successfully trained by using the ETH dataset and its supplementary dataset, and common trajectory prediction indicators ADE and FDE are selected as performance evaluation indicators.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of pedestrian trajectory prediction, and in particular to a pedestrian trajectory prediction method based on a generative adversarial network and a long short-term memory model. Background Art

[0002] Compared with other moving targets in traffic scenes, such as cars and cyclists, pedestrian trajectory prediction is more challenging because pedestrians do not travel in designated lanes like motor vehicles, nor do they stay within lane boundaries like non-motor vehicles. Pedestrians usually move irregularly when they move. Due to a series of defined "road rules", the movement of cars and bicycles is constrained by the owners' compliance with the rules. But pedestrians are different. There are no corresponding laws and regulations to restrict the trajectory that pedestrians should follow. When there are intersections without traffic lights in the traffic scene, or when there are a large number of pedestrians, pedestrian movement becomes more complicated. Therefore, effective pedestrian movement trajectory prediction algorithms are needed to address these challenges.

[0003] Predicting pedestrians' movement trajectories requires considering a variety of factors that may affect pedestrian movement. In recent years, most studies have started from the perspective of pedestrian behavior, for example, considering pedestrians' reactions to oncoming cars at intersections without traffic lights, exploring the mechanism of vehicle-pedestrian interaction; predicting when pedestrians will cross the street; in addition, online prediction of pedestrian behavior requires obtaining data from sensors and extracting multiple clues, for example, using machine vision technology to obtain multiple types of context clues.

[0004] 1. Prediction based on static environmental clues:

[0005] Some scholars have proposed behavioral CNN, which uses neural networks to model pedestrian behavior in crowded scenes and proves its effectiveness. Some scholars have also proposed a new pedestrian position prediction method by learning the weighted sum of ordinary differential equations from historical trajectory information in fixed scenes and verified its good results.

[0006] (2) Prediction based on dynamic environmental clues:

[0007] Pedestrian behavior is also affected by other dynamic targets in the scene. Some scholars have studied a micro-simulation model to analyze the behavior of cyclists at intersections without traffic lights. In addition to considering the presence of other road users, traffic participants should also negotiate the order of passage to coordinate traffic behavior. Some scholars have also provided a new dataset for studying the behavior of traffic participants, and focused on the communication methods between drivers and pedestrians to avoid collisions with each other.

[0008] (3) Prediction based on target cues:

[0009] People cannot be very familiar with their surroundings at all times, and pedestrians' lack of concentration is often an important cause of traffic accidents. The direction of pedestrians' heads can be used to determine whether pedestrians have noticed the approaching vehicle. The specific method is to use the results of multiple discrete directional classifiers, add physical constraints and time filtering to improve robustness, and obtain continuous head direction estimates. In addition, neural networks can be used to achieve real-time 2D estimation of the human body skeleton, thereby achieving the effect of detecting the postures of multiple people in the image. The full-body appearance of pedestrians can also be used for trajectory prediction, for example, to classify targets and predict the trajectory or posture of specific categories of targets7; dense optical flow features can also be used around the pedestrian bounding box to estimate whether pedestrians crossing the street will stop on the side of the road. Summary of the invention

[0010] In view of this, the purpose of the present invention is to provide a pedestrian trajectory prediction method based on a generative adversarial network and a long short-term memory model to train a new neural network model and improve the prediction performance.

[0011] In order to achieve the above object, the present invention adopts the following technical solution:

[0012] A pedestrian trajectory prediction method based on a generative adversarial network and a long short-term memory model, the pedestrian trajectory prediction method comprising the following steps:

[0013] Step S1, obtaining an ETH dataset and an ETH supplementary dataset, and matching the two to obtain a clear trajectory of each person object in the ETH dataset, and using the clear trajectory of each person object as a dataset for training and testing;

[0014] Step S2, dividing the training data set obtained in step S1 into a training set and a test set according to a certain ratio, and performing preprocessing;

[0015] Step S3, constructing a pedestrian trajectory prediction network, which includes: the pedestrian trajectory prediction network includes a generator network and a discriminator network, wherein the generator network and the discriminator network constitute a generative adversarial network;

[0016] Step S4: input the training set obtained in step S2 into the pedestrian trajectory prediction network constructed in step S3 to perform model training, and perform multiple rounds of iterative training until the loss function converges and the network parameters are fixed;

[0017] Step S5, performing pedestrian trajectory prediction, which includes: inputting the test set obtained in step S2 into the pedestrian trajectory prediction model obtained in step S4 for prediction, and obtaining a prediction result.

[0018] Furthermore, the step S1 specifically includes:

[0019] Step S101, first obtain the ETH data set, which is a parameter composed of a time tag, a person ID tag, and a person location point coordinate (x, y), and then read the idl tag file in the ETH data set in the form of a string, then read the valid information in the idl tag file through the general code re module in Python, and finally export the valid information in the form of a csv table;

[0020] Step S102, first obtain the ETH supplementary dataset, wherein there is no additional label data file in the dataset, only the segmentation of all person pictures; then refer to the label information in the ETH dataset, name each picture in the ETH supplementary dataset, and divide all pictures into different folders according to the classification of people; finally, obtain the file directory of each folder through the general code os module in Python;

[0021] Step S103, match the csv table obtained in step S101 and the various file directories obtained in step S102 one by one in the data list in Python to obtain the clear trajectory of each person object in the ETH dataset;

[0022] Step S104: Divide the trajectory data into observed trajectory data, predicted trajectory data, time list, and ID list, so as to construct a data set for model training and testing.

[0023] Furthermore, the step S2 includes:

[0024] Step S201, dividing the data set constructed in step S104 into a training set and a test set according to a division ratio of 4:1;

[0025] Step S202: Standardize all data to a value between 0 and 1.

[0026] Furthermore, the generator network also includes: an encoder, a decoder, a social feature embedding layer, and a social pooling layer, wherein the encoder and the decoder both include a fully connected layer and an LSTM layer;

[0027] In the generator network, the decoder and the social feature embedding layer are set in front, and their inputs are both trajectory data. The outputs of the decoder and the social feature embedding layer are both passed to the social feature embedding layer. The output of the social feature embedding layer is merged with the noise and input into the decoder. The output of the decoder is passed to the discriminator network. In the encoder, the fully connected layer is set in front, followed by multiple LSTM networks. Correspondingly, in the decoder, multiple LSTM networks are set in front, followed by a fully connected layer.

[0028] Furthermore, in the discriminator network, a fully connected layer is arranged in front, and another fully connected layer is arranged in the back, and a plurality of LSTM networks are arranged between the two fully connected layers.

[0029] Furthermore, the calculation formula of the discriminator network is as follows:

[0030]

[0031] In formula (1) to formula (4), t = 1, ..., t obs ,...,t obs +t prep , T i represents the union of true and false trajectories, t obs is the time length of the past trajectory, t prep is the length of future trajectory, X i , Y i is the position coordinate, δ is a fully connected layer used to convert the two-dimensional coordinates into feature vectors, W δ is the parameter of the fully connected layer; the LSTM layer encodes the feature vector at each moment until t=t obs +t prep At the end of the moment, the sequence encoding vector is obtained W di is the parameter of the LSTM layer; ρ is the multilayer perceptron, W ρ is the multilayer perceptron parameter, and the score s for the trajectory is obtained i .

[0032] The calculation formula of the encoder is as follows:

[0033]

[0034] In formula (5)-formula (6), t=1,...,t obs , t obs is the length of past trajectory time, is the position of pedestrian i at time t, μ is a fully connected layer used to convert two-dimensional coordinates into feature vectors, is the position feature vector, W μe is the parameter of the fully connected layer. The LSTM layer encodes the feature vector at each moment until t=t obs At the end of the moment, the sequence context vector is obtained W e are the parameters of the LSTM layer.

[0035] Furthermore, the calculation formula of the decoder is as follows:

[0036]

[0037] In formula (7) to formula (11), t = t obs +1,...,t prep , c i is the tensor of pedestrian i obtained by the attention module, indicating the influence of other pedestrians on pedestrian i in this scene; φ is a multi-layer perceptron, W φ are the parameters of the multilayer perceptron, Represents the impact of other pedestrians on pedestrian i at time t; the result is connected with the noise z to obtain the initial hidden state of the decoder LSTM μ is a fully connected layer used to transform the two-dimensional coordinates of the previous moment Converted into a feature vector, W μd is the parameter of the fully connected layer; the LSTM layer encodes each moment, and the hidden state at each moment The predicted coordinates at time t can be obtained through the multi-layer perceptron γ W d is the LSTM decoder parameter, W γ is the γ parameter of the multilayer perceptron.

[0038] Furthermore, the total loss function adopted is:

[0039] L=L GAN (G,D)+λL L2 (G) (12)

[0040] In formula (12), L GAN (G,D) represents the adversarial loss, L L2 (G) is represented by L2 loss, where

[0041]

[0042] In formula (13) and formula (14), λ is a hyperparameter used to balance the generation adversarial loss and L2 loss, k is a hyperparameter representing the number of sampling times of the generator generation results, and T i represents the union of true and false trajectories, X i , Y i is the position coordinate, z represents the noise, and p represents the number of training times.

[0043] The beneficial effects of the present invention are:

[0044] Considering that the official ETH dataset does not contain person ID tag information, the present invention successfully trained the model by using the ETH dataset and its supplementary dataset, and selected the commonly used trajectory prediction indicators ADE and FDE as performance evaluation indicators. Experimental results show that the model provided by the present invention has a good performance in pedestrian trajectory prediction. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] Figure 1 A schematic diagram of the structure of the pedestrian trajectory prediction network provided in Example 1;

[0046] Figure 2 A schematic diagram of the process of pedestrian trajectory prediction;

[0047] Figure 3 This is a schematic diagram of the structure of the generative adversarial network provided in Example 1. DETAILED DESCRIPTION

[0048] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0049] Example 1

[0050] See also Figure 1-Figure 3 This embodiment provides a pedestrian trajectory prediction method based on a generative adversarial network and a long short-term memory model, and the method specifically includes the following steps:

[0051] Step S1: Obtain the ETH dataset and the ETH supplementary dataset, and match the two to obtain the clear trajectory of each person object in the ETH dataset.

[0052] Specifically, in this embodiment, step S1 is based on Python. First, the parameter import module is called, and then the data file path is determined according to the obtained parameters, the file save directory is determined, the flag of the execution code is determined, and the training hyperparameters are initialized. The parameter import is composed of time tags, person ID tags, and person location point coordinates (x, y). Therefore, the data set processing file contains three functions. The first function is used to read the idl tag file in the form of a string, read the useful information through the regular expression module, and export the useful information in the form of a csv table. The function of the second function is to obtain the label information in the ETH supplementary data set by reading the csv file generated in the first function, matching one by one under the list, and arranging the data into the required format, so as to obtain the clear trajectory of each person object in the ETH data set. The third function is to save the training data, and divide the trajectory data into observed trajectory data, predicted trajectory data, time list, and ID list.

[0053] More specifically, in this embodiment, step S1 specifically includes the following sub-steps:

[0054] Step S101, first obtain the ETH data set, which is a parameter composed of time label, person ID label, and person location point coordinates (x, y), and then read the idl label file in the ETH data set in the form of a string, and then read the valid information in the idl label file through the general code re module in Python, and finally export the valid information in the form of a csv table.

[0055] Specifically, the above-mentioned general code re module is the regular expression module re, which can check whether a string matches a certain pattern. In this embodiment, the usefulness of this module is to read irregular data in the ETH data set in a required manner.

[0056] Step S102: first obtain the ETH supplementary data set, wherein there is no additional label data file in the data set, only the segmentation of all person pictures;

[0057] Then, refer to the label information in the ETH dataset to name each image in the ETH supplementary dataset, and divide all images into different folders according to the classification of people;

[0058] Finally, get the file directories of each folder through the os module.

[0059] Specifically, in this embodiment, the os module is a general code in Python.

[0060] Step S103: Match the csv table obtained in step S101 and the various file directories obtained in step S102 one by one in the data list in Python to obtain the clear trajectory of each person object in the ETH dataset.

[0061] Step S104: Divide the trajectory data into observed trajectory data, predicted trajectory data, time list, and ID list, so as to construct a data set for model training and testing.

[0062] Step S2: dividing and preprocessing the data set, which specifically includes the following sub-steps:

[0063] Step S201, dividing the data set constructed in step S104 into a training set and a test set according to a division ratio of 4:1;

[0064] Step S202: Standardize all data. Data standardization is in the form of a class. This class reads the maximum and minimum values ​​in the data, uses the maximum and minimum values ​​as the basis for standardization, and standardizes all data to between 0 and 1. The method of using this class is to first define the data boundary for this class and confirm the maximum and minimum values. Then, the data to be processed can be standardized by calling the standardization internal function. When observing the final output, you can also call de-standardization to restore the data to the original standard.

[0065] Step S3: constructing a pedestrian trajectory prediction network, which specifically includes:

[0066] The pedestrian trajectory prediction network includes a generator network and a discriminator network, and the generator network and the discriminator network constitute a generative adversarial network. The generator network also includes: an encoder, a decoder, a social feature embedding layer, and a social pooling layer, wherein the encoder and the decoder both include a fully connected layer and an LSTM layer;

[0067] Specifically, in the generator network, the decoder and the social feature embedding layer are set in front, and their inputs are both trajectory data. The outputs of the decoder and the social feature embedding layer are both passed to the social feature embedding layer. The output of the social feature embedding layer is merged with the noise and input into the decoder. The output of the decoder is passed to the discriminator network. In the encoder, the fully connected layer is set in front, followed by multiple LSTM networks. Correspondingly, in the decoder, multiple LSTM networks are set in front, followed by a fully connected layer.

[0068] Specifically, in the discriminator network, a fully connected layer is arranged in front, and another fully connected layer is arranged in the back, and a plurality of LSTM networks are arranged between the two fully connected layers.

[0069] The above is the overall structure of the pedestrian trajectory prediction network provided in this embodiment.

[0070] More specifically, in this embodiment, by building a model in the main function of Python, the first network model, the encoding LSTM layer is composed of a fully connected layer and an LSTM layer. The input dimension of the fully connected layer is four-dimensional, which is convenient for inputting the coordinates and speed of the character object, and then converted to the hidden layer size and output to the LSTM layer. In the internal function, in addition to the front-line function, an LSTM initialization function is also required to initialize the memory cells and the initial value of the output. All LSTM layers will have such an internal function.

[0071] The second network model is the social feature embedding layer. Such an embedding layer is usually composed of three fully connected layers, connected by activation functions in the middle to prevent gradient vanishing or gradient divergence. Here, the activation function selected is the ReLU() function.

[0072] The third network is the attention layer, which starts with a fully connected layer, then determines the number of data in the current data block and manually processes the acquired information through matrix multiplication to obtain the attention result.

[0073] The fourth network is the decoding layer, which is used to analyze the speed prediction value obtained by the network, and then use the speed prediction value to make trajectory prediction.

[0074] The fifth network is the decoding LSTM layer. This layer is not actually used in the code. It is an alternative to the fully connected decoding layer. If this layer is selected, the decoding network will be replaced by this layer.

[0075] The sixth network is the discriminator network. As a key network to complete the encapsulation, it is also the most complex. It consists of an LSTM layer, an observation path fully connected layer, a prediction path fully connected layer, a hidden encoder and a classifier. After the generator output enters the forward network, it first passes through the observation LSTM layer and then the observation fully connected layer. The input prediction trajectory passes through the prediction fully connected layer. The two parts are then connected in series and put into the classifier. The classifier needs to distinguish between the generator data and the prediction data of the validation set. The implicit parameters will be back-propagated as a numerical output.

[0076] More specifically, in this embodiment, the calculation formula of the discriminator network is as follows:

[0077]

[0078] In formula (1) to formula (4), t = 1, ..., t obs ,...,t obs +t prep , T i represents the union of true and false trajectories, t obs is the time length of the past trajectory, t prep is the length of future trajectory, X i , Y i is the position coordinate, δ is a fully connected layer used to convert the two-dimensional coordinates into feature vectors, W δ is the parameter of the fully connected layer. The LSTM layer encodes the feature vector at each moment until t=t obs +t prep At the end of the moment, the sequence encoding vector is obtained W di is the parameter of the LSTM layer. ρ is the multilayer perceptron, W ρ is the multilayer perceptron parameter, and the score s for the trajectory is obtained i .

[0079] More specifically, in this embodiment, the calculation formula of the encoder is as follows:

[0080]

[0081] In formula (5)-formula (6), t=1,...,t obs , t obs is the length of past trajectory time, is the position of pedestrian i at time t, μ is a fully connected layer used to convert two-dimensional coordinates into feature vectors, is the position feature vector, W μe is the parameter of the fully connected layer. The LSTM layer encodes the feature vector at each moment until t=t obs At the end of the moment, the sequence context vector is obtained W e are the parameters of the LSTM layer.

[0082] More specifically, in this embodiment, the calculation formula of the decoder is as follows:

[0083]

[0084] In formula (7) to formula (11), t = t obs +1,...,t prep , c i is the tensor of pedestrian i obtained by the attention module, indicating the influence of other pedestrians on pedestrian i in this scene. φ is a multi-layer perceptron, W φ are the parameters of the multilayer perceptron, It represents the impact of other pedestrians on pedestrian i at time t. The result is connected with the noise z to obtain the initial hidden state of the decoder LSTM μ is a fully connected layer used to transform the two-dimensional coordinates of the previous moment Converted into a feature vector, W μd is the parameter of the fully connected layer. The LSTM layer encodes each moment, and the hidden state at each moment The predicted coordinates at time t can be obtained through the multi-layer perceptron γ W d is the LSTM decoder parameter, W γ is the γ parameter of the multilayer perceptron.

[0085] Step S4: input the training set obtained in step S2 into the pedestrian trajectory prediction network constructed in step S3 to perform model training. After multiple rounds of iterative training, the loss function converges and the network parameters are fixed.

[0086] Specifically, in this embodiment, the pedestrian trajectory prediction network is trained using the traditional GAN ​​training method, that is, it is iteratively trained using the back propagation algorithm. More specifically, after the discriminator outputs the result, back propagation is first performed to change the network parameters of the discriminator. Then, back propagation is performed on the generator to lock the discriminator part and modify the network parameters of the generator.

[0087] After multiple rounds of iterative training, until the total loss function converges, the network parameters are fixed and the pedestrian trajectory prediction model is obtained.

[0088] Specifically, in this embodiment, the total loss function used is:

[0089] L=L GAN (G,D)+λL L2 (G) (12)

[0090] In formula (12), L GAN (G,D) represents the adversarial loss, L L2 (G) is represented by L2 loss, where

[0091]

[0092] In formula (13) and formula (14), λ is a hyperparameter used to balance the generation adversarial loss and L2 loss. k is a hyperparameter representing the number of sampling times of the generator generation results. i represents the union of true and false trajectories, X i , Y i is the position coordinate, z represents the noise, and p represents the number of training times. GAN It is actually a cross entropy. The discriminator should make D(T I ) is close to 1, let D(G(X i ,z)) is close to 0, so the discriminator should maximize L GAN , while the generator is the opposite, to minimize L GAN .L L2 Used to calculate the difference between the predicted value and the true value. For each scene, sample k trajectories from the generator and select L L2 The smallest trajectory is used as the predicted Because the discriminator loss regression only uses the prediction with the smallest difference from the true value, the L L2 The loss enables the model to generate as many different prediction trajectories as possible.

[0093] Specifically, in the prediction mode, the model parameters are first imported, and then the previous observation data and prediction data are merged and passed into the prediction code as raw data for trajectory prediction. After the prediction is completed, the results are restored to the original range and written into a text file for easy viewing.

[0094] Detection indicators:

[0095] Average offset error (ADE):

[0096]

[0097] Final offset error (FDE):

[0098]

[0099] In summary, this patent discloses a pedestrian trajectory prediction method based on generative adversarial networks and long short-term memory models. The main task is to build a model consisting of two parts, a generator and a discriminator, select the ETH pedestrian trajectory dataset as the data source, select the Social GAN ​​method, and use the long short-term memory network LSTM to model the pedestrian's historical trajectory and current position to achieve pedestrian trajectory prediction. Among them, the generator uses a long short-term memory network (LSTM) to perform feature analysis on the historical trajectory of each pedestrian in the data. The discriminator extracts input features through several fully connected layers, and also uses the LSTM network to memorize the features of the historical trajectory. Considering that the official ETH dataset does not contain character ID label information, the model was successfully trained by using the ETH dataset and its supplementary dataset, and the commonly used trajectory prediction indicators ADE and FDE were selected as performance evaluation indicators. The experimental results show that this model performs well in pedestrian trajectory prediction.

[0100] The matters not described in detail in the present invention are all known technologies to those skilled in the art.

[0101] The preferred specific embodiments of the present invention are described in detail above. It should be understood that a person skilled in the art can make many modifications and changes based on the concept of the present invention without creative work. Therefore, any technical solution that can be obtained by a person skilled in the art through logical analysis, reasoning or limited experiments based on the concept of the present invention on the basis of the prior art should be within the scope of protection determined by the claims.

Claims

1. A pedestrian trajectory prediction method based on generative adversarial network and long short-term memory model, characterized in that: The pedestrian trajectory prediction method comprises the following steps: Step S1, obtaining an ETH dataset and an ETH supplementary dataset, and matching the two to obtain a clear trajectory of each person object in the ETH dataset, and using the clear trajectory of each person object as a dataset for training and testing; Step S2, dividing the training data set obtained in step S1 into a training set and a test set according to a certain ratio, and performing preprocessing; Step S3, constructing a pedestrian trajectory prediction network, which includes: the pedestrian trajectory prediction network includes a generator network and a discriminator network, wherein the generator network and the discriminator network constitute a generative adversarial network; Step S4: input the training set obtained in step S2 into the pedestrian trajectory prediction network constructed in step S3 to perform model training, and perform multiple rounds of iterative training until the loss function converges and the network parameters are fixed; Step S5, performing pedestrian trajectory prediction, which includes: inputting the test set obtained in step S2 into the pedestrian trajectory prediction model obtained in step S4 to perform prediction and obtain a prediction result; The generator network also includes: an encoder, a decoder, a social feature embedding layer, and a social pooling layer, wherein the encoder and the decoder both include a fully connected layer and an LSTM layer; In the generator network, the decoder and social feature embedding layer are set in front, and their inputs are all trajectory data. The outputs of the decoder and social feature embedding layer are passed to the social feature embedding layer. The output of the social feature embedding layer is merged with the noise and input into the decoder. The output of the decoder is passed to the discriminator network. In the encoder, the fully connected layer is set in front, followed by multiple LSTM networks. Correspondingly, in the decoder, multiple LSTM networks are set in front, followed by a fully connected layer. In the discriminator network, a fully connected layer is set in front, and another fully connected layer is set in the back, and multiple LSTM networks are set between the two fully connected layers; The calculation formula of the discriminator network is as follows: In formula (1) to formula (4), t = 1, ..., t obs ,...,t obs +t prep , T i represents the union of true and false trajectories, t obs is the time length of the past trajectory, t prep is the length of future trajectory, X i , Y i is the position coordinate, δ is a fully connected layer used to convert the two-dimensional coordinates into feature vectors, W δ is the parameter of the fully connected layer; the LSTM layer encodes the feature vector at each moment until t=t obs +t prep At the end of the moment, the sequence encoding vector is obtained W di is the parameter of the LSTM layer; ρ is the multilayer perceptron, W ρ is the multilayer perceptron parameter, and the score s for the trajectory is obtained i ; The calculation formula of the encoder is as follows: In formula (5)-formula (6), t=1,...,t obs , t obs is the length of past trajectory time, is the position of pedestrian i at time t, μ is a fully connected layer used to convert two-dimensional coordinates into feature vectors, is the position feature vector, W μe is the parameter of the fully connected layer. The LSTM layer encodes the feature vector at each moment until t=t obs At the end of the moment, the sequence context vector is obtained W e are the parameters of the LSTM layer; The calculation formula of the decoder is as follows: In formula (7) to formula (11), t = t obs +1,...,t prep , ci is the tensor of pedestrian i obtained by the attention module, indicating the influence of other pedestrians on pedestrian i in this scene; φ is a multi-layer perceptron, W φ are the parameters of the multilayer perceptron, Represents the impact of other pedestrians on pedestrian i at time t; the result is connected with the noise z to obtain the initial hidden state of the decoder LSTM μ is a fully connected layer used to transform the two-dimensional coordinates of the previous moment Converted into a feature vector, W μd is the parameter of the fully connected layer; the LSTM layer encodes each moment, and the hidden state at each moment The predicted coordinates at time t can be obtained through the multi-layer perceptron γ W d is the LSTM decoder parameter, W γ is the multilayer perceptron γ parameter; The total loss function used is: L=L GAN (G,D)+λL L2 (G) (12) In formula (12), L GAN (G,D) represents the adversarial loss, L L2 (G) is represented by L2 loss, where In formula (13) and formula (14), λ is a hyperparameter used to balance the generation adversarial loss and L2 loss, k is a hyperparameter representing the number of sampling times of the generator generation results, and T i represents the union of true and false trajectories, X i , Y i is the position coordinate, z represents the noise, and p represents the number of training times.

2. The pedestrian trajectory prediction method based on generative adversarial network and long short-term memory model according to claim 1 is characterized in that: The step S1 specifically includes: Step S101, first obtain the ETH data set, which is a parameter composed of a time tag, a person ID tag, and a person location point coordinate (x, y), and then read the idl tag file in the ETH data set in the form of a string, then read the valid information in the idl tag file through the general code re module in Python, and finally export the valid information in the form of a csv table; Step S102, first obtain the ETH supplementary dataset, wherein there is no additional label data file in the dataset, only the segmentation of all person pictures; then refer to the label information in the ETH dataset, name each picture in the ETH supplementary dataset, and divide all pictures into different folders according to the classification of people; finally, obtain the file directory of each folder through the general code os module in Python; Step S103, match the csv table obtained in step S101 and the various file directories obtained in step S102 one by one in the data list in Python to obtain the clear trajectory of each person object in the ETH dataset; Step S104: Divide the trajectory data into observed trajectory data, predicted trajectory data, time list, and ID list, so as to construct a data set for model training and testing.

3. The pedestrian trajectory prediction method based on generative adversarial network and long short-term memory model according to claim 2 is characterized in that: The step S2 comprises: Step S201, dividing the data set constructed in step S104 into a training set and a test set according to a division ratio of 4:1; Step S202: Standardize all data to a value between 0 and 1.

Citation Information

Patent Citations

  • Pedestrian trajectory prediction method based on global dynamic scene information depth modeling

    CN113538506A

  • Systems and Methods for Latent Distribution Modeling for Scene-Consistent Motion Forecasting

    US20210276595A1