Traffic entity trajectory prediction method and system based on lstm deep learning
By using an LSTM deep learning approach, combined with attention mechanisms and feature information, first and second prediction models were constructed. This solved the accuracy problem of predicting the trajectories of different types of traffic entities in complex traffic environments, achieving trajectory prediction with higher applicability and flexibility.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- BEIJING UNIV OF POSTS & TELECOMM
- Filing Date
- 2024-05-14
- Publication Date
- 2026-05-19
AI Technical Summary
Existing technologies struggle to accurately predict the trajectories of different types of traffic entities in complex traffic environments, especially since they neglect the interactions between different entities.
An LSTM-based deep learning approach is adopted. By acquiring the type and historical spatial data of the traffic entity to be tested, the LSTM model is used to predict the trajectory. The model is then modified by combining attention mechanism and feature information to construct the first and second prediction models to improve prediction accuracy.
In complex traffic environments, it can more accurately predict the movement trajectories of different types of traffic entities, improving the applicability and flexibility of the prediction and providing more comprehensive and accurate prediction results.
Smart Images

Figure CN118657174B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of vehicle control technology, and in particular to a method and system for predicting traffic entity trajectories based on LSTM deep learning. Background Technology
[0002] In recent years, autonomous driving has become a focal point of technological revolution, and it will be gradually deployed and promoted to the general public in the future. The core of an autonomous driving system mainly consists of three parts: perception, planning, and control. Among these, vehicle trajectory prediction plays a crucial role in bridging the gap between perception and planning, and is one of the core modules of an autonomous driving system.
[0003] In trajectory prediction for autonomous vehicles using related technologies, machine learning and the vehicle's physical characteristics are typically employed. However, these physics-based prediction methods rely excessively on the vehicle's physical properties and simplified motion models, neglecting the potential impact of interactions between different entities on trajectory prediction. Consequently, the detection methods in these technologies fail to accurately predict the trajectories of different types of traffic entities in complex traffic environments. Therefore, effectively predicting the trajectories of various types of traffic entities has become a pressing technical problem in this field. Summary of the Invention
[0004] In view of this, the purpose of this application is to propose a method and system that can accurately predict the movement trajectory of different types of traffic entities when facing complex traffic environments and different types of traffic entities.
[0005] To achieve the above objectives, this application provides a traffic entity trajectory prediction method based on LSTM deep learning, comprising:
[0006] Receive a prediction request for a traffic entity to be tested, and obtain the type of the traffic entity to be tested and its historical spatial data, wherein the historical spatial data includes spatial interaction information between the traffic entity to be tested and other traffic entities within a preset time period;
[0007] The historical spatial data is input into a pre-built and trained LSTM-based first prediction model to obtain a first trajectory prediction result.
[0008] Determine the feature information of the traffic entity type to be measured corresponding to the first trajectory prediction result, and input the historical spatial data and the feature information into a pre-constructed and trained LSTM-based second prediction model to obtain the second trajectory prediction result;
[0009] The second trajectory prediction result is embedded into a vector of the same length as the first trajectory prediction result to complete the concatenation, thus obtaining the traffic entity trajectory prediction result.
[0010] Based on the same inventive concept, this disclosure also provides a system including a presentation layer, a display layer, a service layer, a data layer, and a database layer, wherein the service layer includes a business layer and a sub-service layer, and the system implements the method described above.
[0011] As can be seen from the above, the traffic entity trajectory prediction method based on LSTM deep learning provided in this application utilizes an LSTM model to obtain the type of the traffic entity to be tested, its current position, the spatial influence of different entities of different categories on the traffic entity to be tested, and the information on how the influence on the traffic entity to be tested changes over time due to changes in the positions of other traffic entities. The predicted trajectory of the traffic entity to be tested is then obtained through a first prediction model. Faced with complex traffic environments and different types of traffic entities, it can predict the movement trajectories of different types of traffic entities. Furthermore, by combining the output of the first prediction model with the features of the current traffic entity to be tested and inputting this into a second prediction model, the first trajectory prediction result is corrected, making the final trajectory prediction result more accurate. This makes the proposed method more applicable and flexible in predicting traffic entity trajectories, allowing users to obtain more comprehensive and accurate predicted trajectories. Attached Figure Description
[0012] To more clearly illustrate the technical solutions in this application or related technologies, the drawings used in the description of the embodiments or related technologies will be briefly introduced below. Obviously, the drawings described below are only embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0013] Figure 1 This is a flowchart illustrating the traffic entity trajectory prediction method based on LSTM deep learning, as described in an embodiment of this application.
[0014] Figure 2 This is a schematic diagram of the training process of the first prediction model in the traffic entity trajectory prediction method based on LSTM deep learning in this application embodiment;
[0015] Figure 3 This is a schematic diagram of the training process of the second prediction model in the traffic entity trajectory prediction method based on LSTM deep learning in this application embodiment;
[0016] Figure 4 This is a schematic diagram illustrating a traffic entity trajectory prediction method based on LSTM deep learning, as described in an embodiment of this application.
[0017] Figure 5 This is a schematic diagram of a traffic entity trajectory prediction device based on LSTM deep learning, according to an embodiment of this application.
[0018] Figure 6 This is a more specific system architecture diagram provided in the embodiments of this application;
[0019] Figure 7 This is a schematic diagram of a more specific electronic device hardware structure provided in an embodiment of this application. Detailed Implementation
[0020] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with specific embodiments and the accompanying drawings.
[0021] It should be noted that, unless otherwise defined, the technical or scientific terms used in the embodiments of this application should have the ordinary meaning understood by one of ordinary skill in the art to which this application pertains. The terms "first," "second," and similar terms used in the embodiments of this application do not indicate any order, quantity, or importance, but are merely used to distinguish different components. Terms such as "comprising" or "including" mean that the element or object preceding the word encompasses the elements or objects listed after the word and their equivalents, without excluding other elements or objects. Terms such as "connected" or "linked" are not limited to physical or mechanical connections, but can include electrical connections, whether direct or indirect. Terms such as "upper," "lower," "left," and "right" are only used to indicate relative positional relationships; when the absolute position of the described object changes, the relative positional relationship may also change accordingly.
[0022] In recent years, autonomous driving has become a focal point of technological revolution, and it will gradually be deployed and promoted to the general public in the future. The core of an autonomous driving system mainly consists of three parts: perception, planning, and control. Among them, vehicle trajectory prediction plays a crucial role in connecting the three parts and is one of the core modules of the autonomous driving system. The vehicle trajectory module obtains information and relevant knowledge collected from the environment by the perception module; on the other hand, it predicts the trajectory of surrounding dynamic and static objects by combining high-precision maps, predicting the next movement of these surrounding obstacles, and then transmits the accurate and effective motion prediction results to the decision-making and planning layer to assist the decision-making and planning layer in making decisions in advance.
[0023] Existing technologies for trajectory prediction have several significant drawbacks. First, physics-based prediction methods rely excessively on the physical characteristics of vehicles and simplified motion models, resulting in insufficient adaptability and flexibility in complex traffic environments. Furthermore, traditional machine learning methods require pre-defined features and model assumptions, which may fail to fully capture the complexity of time-series data. While deep learning techniques such as CNNs (Convolutional Neural Networks) and RNNs (Recurrent Neural Networks) have improved the handling of spatial and temporal data, they each have their limitations. For example, convolutional neural networks are not adept at handling time series data, while recurrent neural networks are susceptible to the vanishing or exploding gradient problem. These limitations reduce the model's performance in terms of prediction accuracy and generalization ability. Overall, current methods have rarely extended research to multi-class trajectory prediction in complex traffic scenarios and have never considered the potential impact of interactions between different entities on trajectory prediction.
[0024] The key to LSTM (Long Short-Term Memory) standing out from RNNs lies in the hidden states of its neurons, which are essentially the recurrent neural network's "memory" of the input data. These vectors encapsulate the neural network's "summary" of all input information at any given time step.
[0025] LSTM includes: forget gate, remember gate, and output gate.
[0026] In this context, the forget gate allows some information from the previous LSTM cell state to be discarded over time. To prevent excessive memory from affecting the neural network's processing of the current input, some components from previous cell states are selectively forgotten.
[0027] Each time a new input is input, the LSTM first determines which memories to forget based on the new input and the output of the previous step. The input and the output of the previous step are combined into a single vector, then passed through a sigmoid layer, and finally multiplied point-to-point in the cell state. Because the sigmoid function compresses any input into the 0-1 range, if a component of the combined vector becomes 0 after passing through the sigmoid layer, the corresponding component in the cell state will also become 0 after point-to-point multiplication; if a component becomes 1 after passing through the sigmoid layer, the cell state will retain the complete memory. Different sigmoid outputs result in different information being remembered and forgotten. In this way, the LSTM can retain important information for a long time, and the memory can be dynamically adjusted with the input.
[0028] The memory gate is a control unit used to determine whether current data is incorporated into the cell state. First, a tanh function layer extracts valid information from the current vector. Then, a sigmoid function controls how much of this memory is input into the cell state. Valid information extracted from the current input is filtered, and each component is rated (0-1). Higher-rated components receive more memory input into the cell state.
[0029] The output gate is the neural layer of the LSTM unit used to calculate the output value at the current time step. The output layer first extracts information from the vector obtained by integrating the current input value and the output value at the previous time step using the sigmoid function. Then, it compresses and maps the current unit state to the interval (-1, 1) using the tanh function.
[0030] This technical solution, combining an attention mechanism and an LSTM model, aims to address the aforementioned problems. By leveraging the long-term memory function of a Long Short-Term Memory (LSTM) recurrent neural network, this model can effectively handle long-term dependencies in time-series data while avoiding the gradient problem faced by traditional recurrent neural networks. The integrated attention mechanism allows the model to dynamically focus on the most influential parts of the interactions between traffic entities, thereby improving the accuracy and relevance of predictions. This combination not only enhances the model's adaptability to complex traffic scenarios but also improves its predictive ability in changing environments, giving this technical solution a significant advantage in trajectory prediction tasks, especially when dealing with complex and dynamically changing urban traffic environments.
[0031] The embodiments of this application will be described in detail below with reference to the accompanying drawings.
[0032] Figure 1 The flowchart of the traffic entity trajectory prediction method based on LSTM deep learning provided in this disclosure embodiment is shown as follows. Figure 1 As shown, the steps are as follows:
[0033] S101, receive a prediction request for the traffic entity to be tested, and obtain the type of the traffic entity to be tested and historical spatial data, wherein the historical spatial data includes spatial interaction information of the traffic entity to be tested and other traffic entities within a preset time period.
[0034] After receiving a prediction request from a user for a traffic entity to be tested, the type of the traffic entity to be tested is obtained. It can be any one of pedestrians, non-motorized vehicles, or motorized vehicles. The type of traffic entity can also be further classified as needed, without specific limitations here.
[0035] Acquire historical spatial data, including spatial interaction information between the traffic entity to be measured and other traffic entities. For example, denote the traffic entity to be measured as entity i, and other traffic entities related to the traffic entity to be measured as entities j, and the interaction information transmitted between entities i and j at time t. Formula (1) is as follows:
[0036]
[0037] In formula (1) and This indicates the relative position between two entities. The relative position can be determined in three-dimensional coordinates, based on the positional relationship between coordinate points determined by the centroid of the entities. This represents the encoded information of the interaction information passed between two entities, where the relative position is used as positional information and the interaction information is embedded to facilitate subsequent computation in the LSTM model.
[0038] S102, input the historical spatial data into the first prediction model based on LSTM that has been pre-built and trained, and obtain the first trajectory prediction result.
[0039] Historical spatial data is input into the LSTM model. This historical spatial data is arranged in a time series. The model combines the current location information of the traffic entity to be tested with the location information from the historical spatial data, and integrates this with the interaction information of the traffic entity at different historical moments to determine the location information of the traffic entity at the next moment, thus achieving trajectory prediction. For example, at different historical moments, other traffic entities associated with the traffic entity to be tested will not continuously affect it. When other traffic entities are within a preset distance range, their influence on the traffic entity to be tested gradually decreases until it disappears. The preset distance can be 50m. The historical spatial data of the traffic entity to be tested is then input into the first model to obtain the location information of the traffic entity at the next moment. This next moment's location information is used as input information, and the above steps are repeated until the prediction results are connected to form a predicted trajectory, which is then used as the first trajectory prediction result.
[0040] S103, determine the feature information of the traffic entity type to be measured corresponding to the first trajectory prediction result, input the historical spatial data and the feature information into the second prediction model based on LSTM that has been pre-built and trained, and obtain the second trajectory prediction result.
[0041] The first trajectory detection result also includes the type of traffic entity to be detected, such as pedestrians, non-motorized vehicles, or motorized vehicles. Different types of traffic entities have different characteristics, such as speed, turning angle, turning timing, or position within traffic. These characteristics, combined with the first trajectory prediction result, are input into the second trajectory prediction model. The second trajectory prediction model corrects the predictions made by the first trajectory prediction model based on the characteristics of the traffic entity to be detected, ensuring the accuracy of the traffic entity trajectory prediction.
[0042] S104, the second trajectory prediction result is embedded into a vector of the same length as the first trajectory prediction result to complete the splicing, thereby obtaining the traffic entity trajectory prediction result.
[0043] Since the second trajectory prediction result output by the second trajectory prediction model is a corrected result, the corrected result is embedded with the first trajectory prediction result to obtain the final traffic entity trajectory prediction result.
[0044] Therefore, by acquiring the type of the traffic entity to be measured, its current position, the spatial influence of other different types of entities on the traffic entity to be measured, and the information on how the influence of other traffic entities on the traffic entity changes over time, the predicted trajectory of the traffic entity to be measured is obtained through the first prediction model. Faced with complex traffic environments and different types of traffic entities, this model can predict the movement trajectories of different types of traffic entities. Furthermore, by combining the output of the first prediction model with the characteristics of the current traffic entity to be measured and inputting this into the second prediction model, the first trajectory prediction result is corrected, making the final trajectory prediction result more accurate. This makes the applicability and flexibility of this solution for predicting traffic entity trajectories higher, allowing users to obtain more comprehensive and accurate predicted trajectories.
[0045] Figure 2 This diagram illustrates the training process of the first prediction model in the traffic entity trajectory prediction method based on LSTM deep learning provided in this embodiment of the present disclosure. Figure 2 As shown, the steps are as follows:
[0046] S201, Construct the first initial prediction model.
[0047] S202, obtain the location information of traffic sample entities arranged according to historical time, and the interaction information between the traffic sample entities and other traffic entities corresponding to each location information.
[0048] For each location information in the traffic sample entity, and the corresponding interaction information, execute:
[0049] S203, input the location information and the interaction information into the first initial prediction model for training, output the training result, match the training result with the location information of the traffic sample entity at the next moment, and adjust the parameters of the first initial prediction model according to the matching result to obtain the trained first initial prediction model.
[0050] S204, determine whether the first initial prediction model after training meets the termination condition.
[0051] S2041, in response to the fact that the first initial prediction model after training does not meet the termination condition, the next location information of the traffic sample entity is continued to be trained based on the first initial prediction model after training.
[0052] S2042, in response to the training of the first initial prediction model satisfying the termination condition, the final training of the first initial prediction model is used as the first prediction model.
[0053] The above steps are the pre-training steps for the first prediction model. First, a first initial prediction model is established, where the weights can be pre-set or randomly assigned. The first initial prediction model is then trained based on the location information of traffic entities in the sample dataset that can serve as the traffic entities to be tested, and the interaction information of entities associated with these traffic entities. The sample dataset contains various types of traffic entities, such as vehicles, bicycles, and pedestrians.
[0054] As shown in formula (2), the interaction information between traffic entities and other entities at a preset time is used. Inputting into the embedding function yields the embedding vector.
[0055]
[0056]
[0057] in, and The model weights and state weights in the corresponding layers can be preset or randomly assigned. h is the hidden state output by the LSTM model, which is also the location information of the traffic entity to be tested, as shown in formula (3). The spatial features of the traffic entity to be tested obtained from the interaction information at time t-1 in the historical spatial data are used. Inputting into the first initial prediction model yields the hidden state of the first initial prediction model. That is, the spatial characteristics of the traffic entity to be measured at time t are obtained through interactive information.
[0058] Then, as shown in formula (4), the final output of the spatial features of node i at time t is obtained by weighted summation. Weight is j represents the summation count, which is determined based on the traffic entity associated with node i:
[0059]
[0060] Next, obtain the time features transmitted according to the time series. The obtained time features are shown in formula (6). The final output of the spatial features of node i After concatenation, the input to the embedding layer is used to obtain the embedded representation. Then, according to formula (5), the position information f of node i is... i t Embedded representation With Embedded Representation The final output result is obtained by connecting the components according to formula (7) and inputting them into the first prediction model.
[0061]
[0062]
[0063]
[0064] and These represent the weight parameters of the two embedding layers, The weights in the network can be pre-set or randomly assigned. This represents the first hidden state output by the first prediction model. This represents the last hidden state output by the first prediction model at the last moment.
[0065] Repeat steps S203 and S204 until the preset number of training iterations is reached or the information in the historical spatial data is exhausted. The hidden states at each time point constitute the training processing result. Determine whether the training processing result meets the preset conditions. The conditions may be to compare the training processing result with the real historical information and determine whether the fitting degree between the trajectory of the training processing result and the trajectory of the real historical information is greater than the preset threshold. If the fitting degree between the trajectory of the training processing result and the trajectory of the real historical information is greater than the preset threshold, then the first initial prediction model after final training is used as the first prediction model.
[0066] Therefore, when pre-training the first prediction model, it is possible to consider not only the feature information of the traffic entity to be tested itself, but also the interaction information of other traffic entities related to the traffic entity. It can also consider the relationship between the traffic entity to be tested and other related entities in the time series from multiple perspectives. Pre-training the first prediction model makes the trajectory prediction of the traffic entity to be tested more accurate.
[0067] In some embodiments, step S202, obtaining the interaction information between the traffic sample entity and other traffic entities corresponding to each location information, further includes steps S202A and S202B, such as... Figure 2 As shown:
[0068] S202A, in response to determining that the traffic sample entity has an other traffic entity corresponding to each location information, the spatial feature information of the traffic sample entity and the other traffic entity arranged according to historical time is obtained, and weights are assigned to the spatial feature information according to the self-attention mechanism to obtain the interaction information of the traffic sample entity and other traffic entities.
[0069] S202B, in response to determining that the traffic sample entity has at least two other traffic entities corresponding to each location information, the spatial feature information corresponding to the different other traffic entities, arranged according to historical time, is weighted and summed according to a multi-head attention mechanism to obtain the interaction information between the traffic sample entity and other traffic entities.
[0070] Each traffic entity's behavior has different effects on other traffic entities. For example, while a vehicle is in motion, a pedestrian walking on the roadside may have little impact on the vehicle's direction of travel, but the turning of a vehicle traveling in the same direction may have a significant impact on the travel route. Therefore, different attention needs to be applied to different nodes. Based on this phenomenon, as shown in formulas (8) to (12), this attention mechanism is used to assign various weights to the influence of other traffic entities on the traffic entity being tested:
[0071] Q = W q h temp oral (8)
[0072] K = W k h spatials (9)
[0073]
[0074]
[0075] MultiHead(Q,K,V)=Concat(head1,…,head h WO (12)
[0076] Where Q is the query, K is the key, and W is the key. Q is the LSTM model, a core component of the attention mechanism. q W k W o It is a trainable parameter matrix, h temporal and h spatials These represent the feature information in the time and space dimensions, respectively. Multiplying them by the parameter matrix yields the linearly transformed weight matrix, namely Q and K. This increases the fitting ability of the feature information in the time and space dimensions. Q and K T Multiplying them generates a similarity matrix. Each element of the similarity matrix is then divided by... d k Let K be the dimension size. This division is called scaling. When d k When it is very large, QK T The variance of the multiplication result increases, and scaling can reduce the variance, making gradient updates more stable during training. a This represents the output of the a-th header, d k The dimension of each head is used to prevent gradient explosion or vanishing. Concat represents the join operation, and the final weights are... The ratio to the total.
[0077] Therefore, using a multi-head attention mechanism can also give the output of the attention layer encoded representation information from different subspaces, thereby enhancing the model's expressive power. Different weights are assigned to the different interaction information between the traffic entity being tested and other traffic entities, which is more conducive to model learning and outputting more accurate detection results.
[0078] In some embodiments, step S203, which involves inputting the location information and the interaction information into a first initial prediction model for training and outputting the training result, specifically includes:
[0079] The location information is embedded into a vector of equal length to the interaction information to complete the concatenation, resulting in an intermediate vector.
[0080] The intermediate vector is input into the first initial prediction model to obtain the initial hidden state and the final hidden state, and the final hidden state is used as the training result.
[0081] Converting discrete variables into continuous vectors not only reduces the spatial dimension of the discrete variables, but also allows for a meaningful representation of the intermediate variable.
[0082] In some embodiments, the termination condition and the specific execution steps after the condition is met in step S204 may further include:
[0083] The training result is compared with the location information of the traffic sample entity at the next moment.
[0084] In response to determining that the goodness of fit between the training result and the location information of the traffic sample entity at the next moment is not greater than a preset goodness of fit threshold, the hyperparameters of the trained first prediction model are tuned using a loss function, and the training continues to be performed on the next location information of the traffic sample entity based on the trained first initial prediction model.
[0085] In response to determining that the goodness of fit between the training processing result and the position information of the traffic sample entity at the next moment is greater than a preset goodness of fit threshold, the first initial prediction model after training is used as the first prediction model, and the training of the first prediction model is completed.
[0086] The system determines whether the goodness of fit between the trajectory of the training result and the trajectory of the real historical information is greater than a preset threshold. If the goodness of fit is greater than the preset threshold, the first initial prediction model after final training is used as the first prediction model. The preset threshold can be set as needed.
[0087] For predicting the location of the traffic entity to be measured at the next moment, when it satisfies a binary Gaussian distribution, its calculation formula is as follows: Formula (13):
[0088]
[0089] Represents the position coordinates of the entity at time t. These represent the mean, variance, and standard deviation of the coordinates, respectively, with N being the symbol for the function representation of the variance or standard deviation.
[0090] The loss function of the first prediction model is the log-likelihood equation, as shown in formula (14):
[0091]
[0092] Where L i This represents the intermediate parameter cost function. The W in parentheses represents the weights adjusted by the loss function, which can include the model's weight parameters from other formulas in this paper, for example: t represents the interval of the sample in time. In response, intermediate parameters are obtained by summing logarithms and taking the negative value. All parameters are updated by joint backpropagation through the loss function.
[0093] Figure 3This diagram illustrates the training process of the second prediction model in the traffic entity trajectory prediction method based on LSTM deep learning provided in this embodiment of the present disclosure. Figure 3 As shown, the steps are as follows:
[0094] S301, Construct the second initial prediction model.
[0095] S302, Obtain the spatial features of at least two traffic sample entities of the same type arranged according to historical time.
[0096] Perform the following for each spatial feature of at least two traffic sample entities belonging to the same type:
[0097] S303, input the spatial feature into the second initial prediction model for training, output the training result, match the training result with the spatial features of the at least two traffic sample entities at the next time step, and adjust the parameters of the second initial prediction model according to the matching result to obtain the trained second initial prediction model.
[0098] S304, determine whether the trained second initial prediction model meets the termination condition.
[0099] S3041, in response to the training of the second initial prediction model not meeting the termination condition, the next spatial features of the at least two traffic sample entities are further trained based on the training of the second initial prediction model.
[0100] S3042, in response to the training of the second initial prediction model satisfying the termination condition, the final trained second initial prediction model is used as the second prediction model.
[0101] The training of the second prediction model in steps S301-S304 is similar to the training steps S201-S204 for the first prediction model, resulting in the second prediction model, which will not be described in detail here.
[0102] Traffic entities of the same category share similar dynamic characteristics, including speed, acceleration, steering, and similar responses to other types of traffic entities or the overall environment. Learning motion patterns from instances of the same category allows for better prediction of the trajectory of the entire instance. Selecting just two traffic entities yields the features of entities within that category; acquiring motion features from more entities allows for more accurate feature extraction for that category. The specific number of entities to be selected can be set according to actual needs.
[0103] To more accurately understand and predict the behavior and interactions of different categories of traffic entities in a transportation system. For example, by analyzing the behavioral patterns of different entities such as vehicles, bicycles, and pedestrians, their overall dynamics within the transportation network can be revealed. Relationships between entity categories and their corresponding characteristics, such as the influence of entities on categories and the influence of categories on entities, can be established. Tracking changes in characteristics over time reflects the dynamic changes of categories at different points in time.
[0104] In some specific embodiments, obtaining spatial features in step S302 specifically includes:
[0105] Obtain at least two traffic sample entities of the same type arranged according to historical time, and the hidden state and unit state of the first prediction model based on LSTM that are pre-built and trained respectively, and determine the motion features of the at least two traffic sample entities.
[0106] The average value of the motion features of the at least two traffic sample entities is used as the spatial feature corresponding to the at least two samples.
[0107] For example: There are currently n entities of the same category. Obtain the hidden state of the m-th traffic entity at time t in the first prediction model. and unit state Since the unit state contains the instance's historical trajectory information, a self-attention mechanism is used for softmax operation to explore patterns in the internal sequence. At time, the motion features of the m-th traffic entity in this category are captured. As shown in formula (15):
[0108]
[0109] In this process, by leveraging self-attention mechanisms, the system is able to more effectively understand and analyze the dynamic relationships and interactions between instances. This approach allows the model to capture common patterns and trends among instances across the entire category, while considering the unique history and trajectory information of each instance. This is particularly important when dealing with complex sequence data, such as time series data, as it provides a more granular and in-depth analytical approach.
[0110] Next, the feature information of the feature node to which the instance node belongs is obtained by averaging all the acquired features. As shown in formula (16):
[0111]
[0112] Where u represents the category of the feature node (e.g., pedestrian), and n represents the number of entities, the motion features obtained from each m entity in formula (15) are... The motion features of n entities are summed and averaged to obtain an internal motion law that captures effective trajectory information from the entities and learns the category.
[0113] In some embodiments, step S304 further includes:
[0114] The spatial features are input into the second initial prediction model to obtain intermediate hidden states. The intermediate hidden states are then embedded into a vector of the same length as the initial hidden states to complete the concatenation and obtain the training results.
[0115] In response to determining that the fitting degree between the training processing result and the spatial features of the at least two traffic sample entities at the next moment is greater than a preset fitting degree threshold, the trained second initial prediction model is used as the second prediction model to complete the training of the second prediction model.
[0116] In response to determining that the goodness of fit between the training result and the spatial features of the at least two traffic sample entities at the next moment is not greater than a preset goodness of fit threshold, the hyperparameters of the trained second prediction model are tuned using a loss function, and the training continues to be performed on the next spatial features of the at least two traffic sample entities based on the trained second initial prediction model.
[0117] The training steps S201-S204 of the first prediction model are used to obtain the second prediction model, which will not be repeated here.
[0118] In some embodiments, determining the motion characteristics of the at least two traffic sample entities specifically includes:
[0119] The unit states of the at least two traffic entities based on the first prediction model of LSTM are normalized and tensor products are performed with the first trajectory prediction results respectively to obtain the motion features of the at least two traffic entities.
[0120] Taking a feature node with two instance nodes as an example, suppose there are n instances belonging to the same category in the current time frame, and the hidden state and cell state from the instance LSTM have been obtained. Since the cell state contains the historical trajectory information of the instance, a self-attention mechanism is used to perform a softmax operation to explore the pattern of the internal sequence.
[0121] In this process, by leveraging self-attention mechanisms, the system is able to more effectively understand and analyze the dynamic relationships and interactions between instances. This approach allows the model to capture common patterns and trends among instances across the entire category, while considering the unique history and trajectory information of each instance. This is particularly important when dealing with complex sequence data, such as time series data, as it provides a more granular and in-depth analytical approach.
[0122] Therefore, this application utilizes an LSTM model to obtain the predicted trajectory of the traffic entity being measured. This is achieved by acquiring information such as the current position of the traffic entity under test, the spatial influence of other different types of entities on the traffic entity, and the changes in the influence of these other traffic entities on the traffic entity over time. This allows for more accurate prediction of the trajectories of different types of traffic entities in complex traffic environments, demonstrating greater applicability and flexibility.
[0123] For ease of understanding, the actual application scenarios of this application solution are as follows: Figure 4 The scene diagram is shown in the image.
[0124] Figure 4 The diagram shows the instance layer and the feature layer, where the instance layer contains... Let A be the first type A entity at time t. Let A be the first type A entity at time t+1, where type B and type C entities are labeled in the same way as type A entities.
[0125] In urban traffic, the interacting entities are often of multiple types, such as cars, trucks, motorcycles, bicycles, and pedestrians. Each type of traffic entity has unique motion characteristics. Therefore, this application proposes a feature layer to extract coarse-grained features of different entities in motion. This paper categorizes different traffic entities into three classes for the feature layer to record: vehicles, non-motorized vehicles, and pedestrians. For each different traffic entity, an instance layer is proposed to extract the individual motion features of each entity instance, and different entities are connected through the instance layer. In this scenario, the traffic scene at each time step in the instance layer is plotted as follows: Figure 4 In the graph at any given moment, a spatial edge connects each entity in this scenario, for example: It is used to transmit information between different entities, and the formula for transmitting information is as mentioned above in formula (1).
[0126] In this scenario, a time edge is connected to the same node at different times to transmit time information; the information transmission formula is similar to that of the spatial edge. At this point, the feature extraction stage in this scenario has four methods for extracting features: instance nodes, feature nodes, spatial edges, and time edges, i.e., four-dimensional features.
[0127] Finally, by constructing an instance layer and a feature layer, a four-dimensional feature map is obtained in this scenario, which covers two dimensions of traffic entities and their interactions, one dimension of time series, and one dimension of high-level categories, thereby constructing a comprehensive traffic information network.
[0128] Similarly, as mentioned earlier, in the constructed four-dimensional feature map, there are also temporal edges between feature nodes of the same category, used to convey the motion patterns or features of the category entities learned over time. For the calculation of the temporal edge information of feature nodes, in this scenario, the information conveyed by the temporal information represents the edge information, i.e., the temporal edge between the same feature node in adjacent frames.
[0129] Next, in this scenario, information from instance groups and time edges is integrated into the input of the feature nodes. Features are embedded into fixed-length vectors, which are then concatenated to obtain the hidden states of the feature nodes.
[0130] Finally, this scenario describes the process of transferring descriptive information from feature nodes to instance nodes along directed edges. For the nth instance in the group, the hidden state of the feature node in the second prediction model is concatenated with the hidden state of the instance node in the first prediction model, and then embedded into a vector with the same length as the hidden state of the first prediction model to obtain the final output. The feature layer is a correction to the instance layer prediction; that is, the second prediction model is a re-prediction of the first prediction model, ensuring that the trajectories of each entity in the aforementioned four-dimensional spatial graph can be accurately predicted.
[0131] It should be noted that the method in this embodiment can be executed by a single device, such as a computer or server. The method can also be applied in a distributed scenario, where multiple devices cooperate to complete the task. In such a distributed scenario, one of these devices may execute only one or more steps of the method in this embodiment, and the multiple devices will interact with each other to complete the method described.
[0132] It should be noted that the above description describes some embodiments of this application. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in a different order than that shown in the above embodiments and still achieve the desired result. Furthermore, the processes depicted in the drawings do not necessarily require a specific or sequential order to achieve the desired result. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0133] Based on the same inventive concept, and corresponding to any of the above embodiments, this application also provides a traffic entity trajectory prediction device based on LSTM deep learning.
[0134] refer to Figure 5 The traffic entity trajectory prediction device based on LSTM deep learning includes:
[0135] The receiving module 501 is used to receive a prediction request for the traffic entity to be tested, and to obtain the type of the traffic entity to be tested and historical spatial data, wherein the historical spatial data includes spatial interaction information between the traffic entity to be tested and other traffic entities within a preset time period.
[0136] The first prediction module 502 is used to input the historical spatial data into a pre-built and trained LSTM-based first prediction model to obtain a first trajectory prediction result.
[0137] The second prediction module 503 is used to determine the feature information of the traffic entity type to be measured corresponding to the first trajectory prediction result, and input the historical spatial data and the feature information into the second prediction model based on LSTM that has been pre-built and trained to obtain the second trajectory prediction result.
[0138] The traffic entity trajectory prediction module 504 is used to embed the second trajectory prediction result into a vector of the same length as the first trajectory prediction result to complete the splicing and obtain the traffic entity trajectory prediction result.
[0139] In some specific embodiments, the training module trains the first prediction model based on LSTM, and the training module is specifically used for:
[0140] Construct the first initial prediction model;
[0141] Obtain the location information of traffic sample entities arranged according to historical time, and the interaction information between the traffic sample entities and other traffic entities corresponding to each location information;
[0142] For each location information in the traffic sample entity, and the corresponding interaction information, execute:
[0143] The location information and the interaction information are input into the first initial prediction model for training, and the training result is output. The training result is matched with the location information of the traffic sample entity at the next moment. The parameters of the first initial prediction model are adjusted according to the matching result to obtain the trained first initial prediction model.
[0144] Determine whether the first initial prediction model after training meets the termination condition;
[0145] In response to the fact that the first initial prediction model after training does not meet the termination condition, the next location information of the traffic sample entity is trained based on the first initial prediction model after training.
[0146] In response to the first initial prediction model after training satisfying the termination condition, the first initial prediction model after final training is used as the first prediction model.
[0147] In some specific embodiments, the training module is further used for:
[0148] In response to determining that the traffic sample entity has an other traffic entity corresponding to each location information, spatial feature information of the traffic sample entity and the other traffic entity arranged in historical time is obtained, and weights are assigned to the spatial feature information according to the self-attention mechanism to obtain the interaction information between the traffic sample entity and other traffic entities.
[0149] In response to determining that the traffic sample entity has at least two other traffic entities corresponding to each location information, the spatial feature information corresponding to the different other traffic entities, arranged according to historical time, is weighted and summed according to a multi-head attention mechanism to obtain the interaction information between the traffic sample entity and other traffic entities.
[0150] In some specific embodiments, the training module is further used for:
[0151] The location information is embedded into a vector of equal length to the interaction information to complete the concatenation, resulting in an intermediate vector;
[0152] The intermediate vector is input into the first initial prediction model to obtain the initial hidden state and the final hidden state, and the final hidden state is used as the training result.
[0153] In some specific embodiments, the training module is further used for:
[0154] The training result is compared with the location information of the traffic sample entity at the next moment.
[0155] In response to determining that the goodness of fit between the training result and the location information of the traffic sample entity at the next moment is not greater than a preset goodness of fit threshold, the hyperparameters of the trained first prediction model are tuned using a loss function, and the next location information of the traffic sample entity is further trained based on the trained first initial prediction model.
[0156] In response to determining that the goodness of fit between the training processing result and the position information of the traffic sample entity at the next moment is greater than a preset goodness of fit threshold, the first initial prediction model after training is used as the first prediction model, and the training of the first prediction model is completed.
[0157] In some specific embodiments, the training module trains the second prediction model based on LSTM, and the training module is specifically used for:
[0158] Construct a second initial prediction model;
[0159] Obtain the spatial features of at least two traffic sample entities of the same type arranged according to historical time.
[0160] Perform the following for each spatial feature of at least two traffic sample entities belonging to the same type:
[0161] The spatial features are input into the second initial prediction model for training, and the training results are output. The training results are then matched with the spatial features of the at least two traffic sample entities at the next time step. Based on the matching results, the parameters of the second initial prediction model are adjusted to obtain the trained second initial prediction model.
[0162] Determine whether the second initial prediction model after training meets the termination condition;
[0163] In response to the training of the second initial prediction model not meeting the termination condition, the training continues to train the next spatial features of the at least two traffic sample entities based on the trained second initial prediction model.
[0164] In response to the training of the second initial prediction model satisfying the termination condition, the final trained second initial prediction model is used as the second prediction model.
[0165] In some specific embodiments, the training module is further used for:
[0166] Obtain at least two traffic sample entities of the same type arranged according to historical time, and the hidden state and unit state of the first prediction model based on LSTM that are pre-built and trained respectively, and determine the motion features of the at least two traffic sample entities.
[0167] The average value of the motion features of the at least two traffic sample entities is used as the spatial feature corresponding to the at least two samples.
[0168] In some specific embodiments, the training module is further used for:
[0169] The spatial features are input into the second initial prediction model to obtain intermediate hidden states. The intermediate hidden states are then embedded into a vector of the same length as the initial hidden states to complete the concatenation and obtain the training results.
[0170] In response to determining that the fitting degree between the training processing result and the spatial features of the at least two traffic sample entities at the next moment is greater than a preset fitting degree threshold, the trained second initial prediction model is used as the second prediction model to complete the training of the second prediction model.
[0171] In response to determining that the goodness of fit between the training result and the spatial features of the at least two traffic sample entities at the next moment is not greater than a preset goodness of fit threshold, the hyperparameters of the trained second prediction model are tuned using a loss function, and the training continues to be performed on the next spatial features of the at least two traffic sample entities based on the trained second initial prediction model.
[0172] In some specific embodiments, the training module is further used for:
[0173] The unit states of the at least two traffic entities based on the first prediction model of LSTM are normalized and tensor products are performed with the first trajectory prediction results respectively to obtain the motion features of the at least two traffic entities.
[0174] For ease of description, the above devices are described in terms of function, divided into various modules. Of course, in implementing this application, the functions of each module can be implemented in one or more software and / or hardware.
[0175] The apparatus of the above embodiments is used to implement the corresponding LSTM deep learning-based traffic entity trajectory prediction method in any of the foregoing embodiments, and has the beneficial effects of the corresponding method embodiments, which will not be repeated here.
[0176] Based on the same inventive concept, corresponding to the methods of any of the above embodiments, this application also provides a system whose structure includes a presentation layer, a display layer, a service layer, a data layer, and a database layer. The system is configured to implement the traffic entity trajectory prediction method based on LSTM deep learning as described in any of the above embodiments.
[0177] Figure 6 A more specific system architecture diagram provided in this embodiment is shown. The system may include a presentation layer 910, a display layer 920, a service layer 930, a data layer 940, and a database layer 950. The service layer 930 includes a business layer 931 and sub-service layers 932.
[0178] The presentation layer 910 is built using Vue 3 (a front-end development framework), Tailwind CSS (Tailwind Cascading Style Sheets), and Echarts (a data visualization chart library), and is located at the top layer of the system. This layer is mainly responsible for the presentation and interaction of the user interface. Users can perform various operations on this layer, such as submitting query requests, uploading trajectory data, and performing trajectory predictions. The front-end development framework (Vue 3) is an upgraded version of the front-end development framework (Vue 2), providing more efficient performance, an improved composable API (Application Programming Interface), better type support, and other advanced features, enabling developers to more easily build rich and interactive Web (World Wide Web) applications. Tailwind CSS is a pragmatic CSS (Cascading Style Sheets) framework that provides a large number of atomic classes, allowing developers to quickly build customized designs without leaving HTML (Hypertext Markup Language). This combination gives presentation layer 910 both powerful interactivity and maintains styling flexibility and customization. Through Echarts, this layer can also present various complex data visualization charts, providing users with intuitive and dynamic data displays.
[0179] The presentation layer 920 handles interactions with backend services. It uses Axios (a network request library) to send GET (get data) and POST (form submission) requests to retrieve the necessary data from the service layer 930 and pass it to the presentation layer 910. During this process, the presentation layer 920 is responsible for receiving, processing, and formatting data, and ensuring the security of data transmission. This includes verifying data integrity, converting formats to suit the needs of the presentation layer 910, and handling errors and exceptions. These functions of the presentation layer 920 ensure the effective processing of user requests and the secure transmission of data.
[0180] Service layer 930 implements the core business logic of the system and supports user-layer services. The business layer specifically includes business layer 931 and sub-service layer 932. This layer primarily uses the Java Spring Boot framework (a rapid development framework for Spring) to build backend services, handle user HTTP (Hypertext Transfer Protocol) requests, and execute corresponding business logic. Spring Boot's flexibility provides the system with high scalability and customizability, thus meeting complex business needs. Furthermore, sub-service layer 932 includes scheduled task functionality for periodically executing critical operations, such as automatically updating the trajectory prediction model and generating traffic scene analysis reports. Model preloading ensures the system's rapid response to user requests, especially during data-intensive trajectory prediction and analysis. On the user layer side, sub-service layer 932 supports various functions such as registration and login, data upload, trajectory prediction and visualization, entity data analysis, and traffic scene prediction, ensuring users can efficiently upload and analyze data while obtaining intuitive and practical prediction results. This architecture is designed to achieve efficient collaboration between business layer 931 and the user layer, providing stable and reliable services while optimizing the user experience.
[0181] Data Layer 940 handles data-related logic, ensuring data validity and consistency. It acts as an intermediary between the application and the database, responsible for performing data queries, updates, deletions, and insertions. In this system, Data Layer 940 is particularly crucial because it needs to handle large amounts of traffic entity data, including but not limited to entity location, speed, and trajectory information. To achieve efficient data processing, Data Layer 940 uses MyBatis as its database operation framework. The MyBatis framework provides a semi-automated ORM (Object Relational Mapping) solution, which maps complex SQL queries to simple Java object operations, greatly simplifying data access code and improving development efficiency. JDBC (Java Database Connectivity) is a set of application programming interfaces (APIs) for executing SQL statements. Applications can connect to relational databases through this API and use SQL statements to perform operations such as querying, updating, and deleting data in the database.
[0182] Database Layer 950 uses MySQL, a widely used open-source relational database management system renowned for its reliability and high performance. In this system, MySQL (My Structured Query Language) stores user data. The database design follows standard normalization principles to reduce data redundancy and ensure data integrity and consistency. Database Layer 950's design also considers data security, employing appropriate measures to protect data from unauthorized access and potential data leakage.
[0183] Based on the same inventive concept, corresponding to the methods of any of the above embodiments, this application also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, it implements the traffic entity trajectory prediction method based on LSTM deep learning described in any of the above embodiments.
[0184] Figure 7 This embodiment illustrates a more specific hardware structure of an electronic device, which may include a processor 1010, a memory 1020, an input / output interface 1030, a communication interface 1040, and a bus 1050. The processor 1010, memory 1020, input / output interface 1030, and communication interface 1040 are interconnected internally via the bus 1050.
[0185] The processor 1010 can be implemented using a general-purpose CPU (Central Processing Unit), microprocessor, application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of this specification.
[0186] The memory 1020 can be implemented in the form of ROM (Read Only Memory), RAM (Random Access Memory), static storage device, dynamic storage device, etc. The memory 1020 can store the operating system and other applications. When the technical solutions provided in the embodiments of this specification are implemented by software or firmware, the relevant program code is stored in the memory 1020 and is called and executed by the processor 1010.
[0187] The input / output interface 1030 is used to connect input / output modules to realize information input and output. Input / output modules can be configured as components within the device (not shown in the figure) or externally connected to the device to provide corresponding functions. Input devices may include keyboards, mice, touchscreens, microphones, various sensors, etc., while output devices may include displays, speakers, vibrators, indicator lights, etc.
[0188] The communication interface 1040 is used to connect a communication module (not shown in the figure) to enable communication between this device and other devices. The communication module can communicate via wired means (such as USB, Ethernet cable, etc.) or wireless means (such as mobile network, WIFI, Bluetooth, etc.).
[0189] Bus 1050 includes a pathway for transmitting information between various components of the device, such as processor 1010, memory 1020, input / output interface 1030, and communication interface 1040.
[0190] It should be noted that although the above-described device only shows the processor 1010, memory 1020, input / output interface 1030, communication interface 1040, and bus 1050, in specific implementations, the device may also include other components necessary for normal operation. Furthermore, those skilled in the art will understand that the above-described device may only include the components necessary for implementing the embodiments of this specification, and not necessarily all the components shown in the figures.
[0191] The electronic devices described above are used to implement the corresponding LSTM deep learning-based traffic entity trajectory prediction method in any of the foregoing embodiments, and have the beneficial effects of the corresponding method embodiments, which will not be repeated here.
[0192] Based on the same inventive concept, corresponding to the methods of any of the above embodiments, this application also provides a non-transitory computer-readable storage medium storing computer instructions for causing the computer to execute the traffic entity trajectory prediction method based on LSTM deep learning as described in any of the above embodiments.
[0193] The computer-readable medium of this embodiment includes permanent and non-permanent, removable and non-removable media, and information storage can be implemented by any method or technology. Information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transfer medium that can be used to store information accessible by a computing device.
[0194] The computer instructions stored in the storage medium of the above embodiments are used to cause the computer to execute the traffic entity trajectory prediction method based on LSTM deep learning as described in any of the above embodiments, and have the beneficial effects of the corresponding method embodiments, which will not be repeated here.
[0195] It is understood that before using the technical solutions of the various embodiments in this disclosure, users will be informed of the type, scope of use, and usage scenarios of the personal information involved in an appropriate manner, and user authorization will be obtained.
[0196] For example, upon receiving a user's active request, a prompt message is sent to the user to explicitly inform them that the requested operation will require the acquisition and use of the user's personal information. This allows the user to independently choose, based on the prompt message, whether to provide personal information to the software or hardware such as electronic devices, applications, servers, or storage media performing the operations of this disclosed technical solution.
[0197] As an optional but not limited implementation, in response to a user's active request, sending a prompt message to the user can be done via a pop-up window, where the prompt message can be presented in text format. Furthermore, the pop-up window can also include a selection control allowing the user to choose "agree" or "disagree" to provide personal information to the electronic device.
[0198] It is understood that the above notification and user authorization process are merely illustrative and do not constitute a limitation on the implementation of this disclosure. Other methods that comply with relevant laws and regulations may also be applied to the implementation of this disclosure.
[0199] Those skilled in the art should understand that the discussion of any of the above embodiments is merely exemplary and is not intended to imply that the scope of this application (including the claims) is limited to these examples; within the framework of this application, the technical features of the above embodiments or different embodiments can also be combined, the steps can be implemented in any order, and there are many other variations of different aspects of the embodiments of this application as described above, which are not provided in the details for the sake of brevity.
[0200] Additionally, to simplify the description and discussion, and to avoid obscuring the embodiments of this application, the well-known power / ground connections to integrated circuit (IC) chips and other components may or may not be shown in the provided drawings. Furthermore, the apparatus may be shown in block diagram form to avoid obscuring the embodiments of this application, and this also takes into account the fact that the details of the implementation of these block diagram apparatuses are highly dependent on the platform on which the embodiments of this application will be implemented (i.e., these details should be fully understood by those skilled in the art). While specific details (e.g., circuits) have been set forth to describe exemplary embodiments of this application, it will be apparent to those skilled in the art that the embodiments of this application can be implemented without these specific details or with variations thereof. Therefore, these descriptions should be considered illustrative rather than restrictive.
[0201] Although this application has been described in conjunction with specific embodiments thereof, many substitutions, modifications, and variations of these embodiments will be apparent to those skilled in the art from the foregoing description. For example, other memory architectures (e.g., dynamic RAM (DRAM)) may be used with the embodiments discussed.
[0202] The embodiments of this application are intended to cover all such substitutions, modifications, and variations that fall within the broad scope of the appended claims. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the embodiments of this application should be included within the protection scope of this application.
Claims
1. A traffic entity trajectory prediction method based on LSTM deep learning, characterized in that, include: Receive a prediction request for a traffic entity to be tested, and obtain the type of the traffic entity to be tested and its historical spatial data, wherein the historical spatial data includes spatial interaction information between the traffic entity to be tested and other traffic entities within a preset time period; The historical spatial data is input into a pre-built and trained LSTM-based first prediction model to obtain a first trajectory prediction result. Determine the feature information of the traffic entity type to be measured corresponding to the first trajectory prediction result, and input the historical spatial data and the feature information into a pre-constructed and trained LSTM-based second prediction model to obtain the second trajectory prediction result; The second trajectory prediction result is embedded into a vector of the same length as the first trajectory prediction result to complete the concatenation, thus obtaining the traffic entity trajectory prediction result; The training steps of the second prediction model based on LSTM include: Construct a second initial prediction model; Obtain the spatial features of at least two traffic sample entities of the same type arranged according to historical time. Perform the following for each spatial feature of at least two traffic sample entities belonging to the same type: The spatial features are input into the second initial prediction model for training, and the training results are output. The training results are then matched with the spatial features of the at least two traffic sample entities at the next time step. Based on the matching results, the parameters of the second initial prediction model are adjusted to obtain the trained second initial prediction model. Determine whether the second initial prediction model after training meets the termination condition; In response to the training of the second initial prediction model not meeting the termination condition, the training continues to train the next spatial features of the at least two traffic sample entities based on the trained second initial prediction model. In response to the training of the second initial prediction model satisfying the termination condition, the final trained second initial prediction model is used as the second prediction model.
2. The traffic entity trajectory prediction method based on LSTM deep learning according to claim 1, characterized in that, The training steps of the first prediction model based on LSTM include: Construct the first initial prediction model; Obtain the location information of traffic sample entities arranged according to historical time, and the interaction information between traffic sample entities and other traffic entities corresponding to each location information; For each location information in the traffic sample entity, and the corresponding interaction information, execute: The location information and the interaction information are input into the first initial prediction model for training, and the training result is output. The training result is matched with the location information of the traffic sample entity at the next moment. The parameters of the first initial prediction model are adjusted according to the matching result to obtain the trained first initial prediction model. Determine whether the first initial prediction model after training meets the termination condition; In response to the fact that the first initial prediction model after training does not meet the termination condition, the next location information of the traffic sample entity is trained based on the first initial prediction model after training. In response to the first initial prediction model after training satisfying the termination condition, the first initial prediction model after final training is used as the first prediction model.
3. The traffic entity trajectory prediction method based on the LSTM model according to claim 2, characterized in that, The interaction information between the traffic sample entity and other traffic entities corresponding to each location information includes: In response to determining that the traffic sample entity has an other traffic entity corresponding to each location information, spatial feature information of the traffic sample entity and the other traffic entity arranged in historical time is obtained, and weights are assigned to the spatial feature information according to the self-attention mechanism to obtain the interaction information between the traffic sample entity and other traffic entities. In response to determining that the traffic sample entity has at least two other traffic entities corresponding to each location information, the spatial feature information corresponding to the different other traffic entities, arranged according to historical time, is weighted and summed according to a multi-head attention mechanism to obtain the interaction information between the traffic sample entity and other traffic entities.
4. The traffic entity trajectory prediction method based on the LSTM model according to claim 2, characterized in that, The step of inputting the location information and the interaction information into the first initial prediction model for training and outputting the training result includes: The location information is embedded into a vector of equal length to the interaction information to complete the concatenation, resulting in an intermediate vector; The intermediate vector is input into the first initial prediction model to obtain the initial hidden state and the final hidden state, and the final hidden state is used as the training result.
5. The traffic entity trajectory prediction method based on LSTM deep learning according to claim 2, characterized in that, The determination of whether the first initial prediction model after training meets the termination condition specifically includes: The training result is compared with the location information of the traffic sample entity at the next moment. In response to determining that the goodness of fit between the training result and the location information of the traffic sample entity at the next moment is not greater than a preset goodness of fit threshold, the hyperparameters of the trained first prediction model are tuned using a loss function, and the next location information of the traffic sample entity is further trained based on the trained first initial prediction model. In response to determining that the goodness of fit between the training processing result and the position information of the traffic sample entity at the next moment is greater than a preset goodness of fit threshold, the first initial prediction model after training is used as the first prediction model, and the training of the first prediction model is completed.
6. The traffic entity trajectory prediction method based on LSTM deep learning according to claim 1, characterized in that, The acquisition of spatial features of at least two traffic sample entities of the same type, arranged according to historical time, includes: Obtain at least two traffic sample entities of the same type arranged according to historical time, and the hidden state and unit state of the first prediction model based on LSTM that are pre-built and trained respectively, and determine the motion features of the at least two traffic sample entities. The average value of the motion features of the at least two traffic sample entities is used as the spatial feature corresponding to the at least two samples.
7. The traffic entity trajectory prediction method based on the LSTM model according to claim 1, characterized in that, The determination of whether the trained second initial prediction model meets the termination condition specifically includes: The spatial features are input into the second initial prediction model to obtain intermediate hidden states. The intermediate hidden states are then embedded into a vector of the same length as the initial hidden states to complete the concatenation and obtain the training results. In response to determining that the fitting degree between the training processing result and the spatial features of the at least two traffic sample entities at the next moment is greater than a preset fitting degree threshold, the trained second initial prediction model is used as the second prediction model to complete the training of the second prediction model. In response to determining that the goodness of fit between the training result and the spatial features of the at least two traffic sample entities at the next moment is not greater than a preset goodness of fit threshold, the hyperparameters of the trained second prediction model are tuned using a loss function, and the training continues to be performed on the next spatial features of the at least two traffic sample entities based on the trained second initial prediction model.
8. The traffic entity trajectory prediction method based on the LSTM model according to claim 6, characterized in that, Determining the motion characteristics of the at least two traffic sample entities includes: The unit states of the at least two traffic entities based on the first prediction model of LSTM are normalized and tensor products are performed with the first trajectory prediction results respectively to obtain the motion features of the at least two traffic entities.
9. A system comprising a presentation layer, a display layer, a service layer, a data layer, and a database layer, wherein, The service layer includes a business layer and a sub-service layer, characterized in that the system implements the method as described in any one of claims 1 to 8.