Trajectory prediction methods, devices, equipment and storage media

By fusing the historical trajectory and trajectory correction of the target vehicle, and using a pre-trained decoder and feature extractor to generate a more accurate trajectory, the problems of vehicle collision and illegal lane crossing in existing technologies are solved, thus improving the safety of autonomous driving.

CN116118774BActive Publication Date: 2026-03-06CHANGCHUN YIHANG INTELLIGENT TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211667399.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-23
Publication Date
2026-03-06
Estimated Expiration
2042-12-23

AI Technical Summary

Technical Problem

Existing trajectory prediction methods cannot effectively avoid vehicle collisions and traffic violations, resulting in insufficient safety for autonomous driving.

Method used

By fusing the historical trajectory and trajectory correction of the target vehicle, and processing them with a pre-trained decoder, the collision rate and the probability of illegal lane crossing are reduced. The first and second feature extractors are used to process the collision and illegal lane crossing corrections respectively, and the attention model is used to fuse them to generate a more accurate trajectory.

Benefits of technology

While accurately predicting vehicle trajectories, it effectively reduces collision rates and the probability of illegally crossing lane lines, thereby improving vehicle driving safety.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116118774B_ABST
    Figure CN116118774B_ABST
Patent Text Reader

Abstract

This disclosure also provides a trajectory prediction method, apparatus, electronic device, and storage medium. The trajectory prediction method of this disclosure includes: determining a first trajectory of a target vehicle based on its historical trajectory; obtaining a first trajectory correction amount for the target vehicle based on its historical trajectory, the first trajectory correction amount being used to reduce the collision rate; obtaining a second trajectory correction amount for the target vehicle based on its historical trajectory, the second trajectory correction amount being used to reduce the probability of lane violations; fusing the first trajectory and the first trajectory correction amount to obtain a first fusion result; fusing the first trajectory and the second trajectory correction amount to obtain a second fusion result; and processing the first fusion result and the second fusion result using a pre-trained decoder to obtain a second trajectory of the target vehicle. This disclosure can accurately predict vehicle trajectories while reducing factors such as collision rate and the probability of lane violations.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to a trajectory prediction method, apparatus, electronic device, and storage medium. Background Technology

[0002] Trajectory prediction is crucial in autonomous driving scenarios, playing a vital role in vehicle control and hazard warning. It is essential for improving the safety of autonomous driving and its widespread adoption, making it a key challenge in autonomous driving technology.

[0003] To predict more accurate and safer trajectories, factors such as the likelihood of vehicle collisions and traffic violations need to be considered. Currently, many existing trajectory prediction methods cannot completely avoid situations like collisions and traffic violations. Therefore, how to reduce the probability of collisions and traffic violations while achieving trajectory prediction is a pressing issue that needs to be addressed. Summary of the Invention

[0004] To address at least one of the aforementioned technical problems, this disclosure provides a trajectory prediction method, apparatus, electronic device, and storage medium.

[0005] According to a first aspect of this disclosure, a trajectory prediction method is provided, comprising:

[0006] Determine the first trajectory of the target vehicle based on its historical trajectory.

[0007] The first trajectory correction amount of the target vehicle is obtained based on the historical trajectory of the target vehicle, and the first trajectory correction amount is used to reduce the collision rate.

[0008] The second trajectory correction amount of the target vehicle is obtained based on the historical trajectory of the target vehicle. The second trajectory correction amount is used to reduce the probability of violating the line crossing rule.

[0009] The first trajectory and the first trajectory correction of the target vehicle are fused to obtain the first fusion result;

[0010] The first and second trajectory corrections of the target vehicle are fused to obtain a second fusion result;

[0011] The first fusion result and the second fusion result are processed using a pre-trained decoder to obtain the second trajectory of the target vehicle.

[0012] In some implementations, the predicted position in the second trajectory differs from the predicted position of other vehicles around the target vehicle at the corresponding time; and / or, each trajectory vector in the second trajectory does not intersect with the solid road line in the scene where the target vehicle is located.

[0013] In some implementations, the first fusion result is obtained through a first attention model, and the second fusion result is obtained through a second attention model.

[0014] In some implementations, the first trajectory correction amount is obtained through a first feature extractor, and the second trajectory correction amount is obtained through a second feature extractor. The first feature extractor and / or the second feature extractor are respectively trained through contrastive learning.

[0015] In some implementations, the training data for the first feature extractor includes the historical trajectory of the sample vehicle, a first positive sample, and a first negative sample, wherein the first positive sample and the first negative sample are determined based on the first trajectories of other vehicles around the sample vehicle and the first trajectory of the sample vehicle.

[0016] In some implementations, the first positive sample includes N location data obtained by adding noise perturbation to N predetermined predicted positions in the first trajectory of the sample vehicle, and the first negative sample includes K location data obtained by adding noise perturbation to N predetermined predicted positions in the first trajectory of other vehicles, where N and K are both integers greater than 1.

[0017] In some implementations, the first negative sample includes the top K predetermined predicted positions that have the smallest distance from the first trajectory of all other vehicles around the sample vehicle.

[0018] In some implementations, the ratio of K to N is equal to a pre-set ratio of positive to negative sample numbers.

[0019] In some implementations, the training data for the second feature extractor includes the historical trajectory of the sample vehicle, a second positive sample, and a second negative sample, wherein the second positive sample and the second negative sample are determined based on map data of the scene in which the sample vehicle is located.

[0020] In some implementations, the second positive sample includes the endpoint positions of N trajectory vectors in the first trajectory of the sample vehicle that do not intersect with the solid road line, and the second negative sample includes K intersection points of the first trajectory of the sample vehicle and the solid road line, where N and K are both integers greater than 1, and K is less than or equal to a preset upper limit for the number of negative samples.

[0021] In some implementations, the step of using a pre-trained decoder to process the first fusion result and the second fusion result to obtain the second trajectory of the target vehicle includes: using a pre-trained multilayer perceptron to fuse the first fusion result and the second fusion result to obtain a third fusion result; and using the decoder to process the third fusion result to obtain the second trajectory of the target vehicle.

[0022] According to a second aspect of this disclosure, a trajectory prediction model training method is provided. The trajectory prediction model includes: an encoder, a decoder, a fusion module, a first feature extractor, and a second feature extractor. The encoder is used to determine a first trajectory of a target vehicle based on its historical trajectory. The first feature extractor is used to obtain a first trajectory correction amount for the target vehicle based on its historical trajectory, the first trajectory correction amount being used to reduce the collision rate. The second feature extractor is used to obtain a second trajectory correction amount for the target vehicle based on its historical trajectory, the second trajectory correction amount being used to reduce the probability of illegal lane crossing. The fusion module is used to fuse the first trajectory and the first trajectory correction amount of the target vehicle to obtain a first fusion result, and to fuse the first trajectory and the second trajectory correction amount of the target vehicle to obtain a second fusion result. The decoder is used to process the first fusion result and the second fusion result to obtain the second trajectory of the target vehicle.

[0023] The trajectory prediction model training method includes:

[0024] The encoder and decoder are trained using the historical trajectories and real trajectories of the sample vehicles to determine the parameters of the encoder;

[0025] Freeze the encoder parameters and train the first feature extractor using the historical trajector of the sample vehicle and other vehicles around it to determine the parameters of the first feature extractor.

[0026] Freeze the encoder parameters and train the second feature extractor using the historical trajectory of the sample vehicle and the map data of the scene where the sample vehicle is located, so as to determine the parameters of the second feature extractor.

[0027] The encoder parameters, first feature extractor parameters, and second feature extractor parameters are frozen. The fusion module and decoder are trained using the historical trajectory and real trajectory of the sample vehicles to determine the parameters of the fusion module and the decoder.

[0028] In some implementations, the method further includes: extracting a first positive sample and a first negative sample for training a first feature extractor based on the historical trajectories of the sample vehicle and other vehicles around it; wherein the first positive sample includes N position data obtained by adding noise perturbation to N predetermined predicted positions in the first trajectory of the sample vehicle; the first negative sample includes K position data obtained by adding noise perturbation to N predetermined predicted positions in the first trajectories of other vehicles, where N and K are both integers greater than 1.

[0029] In some implementations, the first negative samples include the top K positions of other vehicles at a predetermined time in their first trajectories that have the smallest distance from the first trajectory of the sample vehicle.

[0030] In some implementations, the ratio of K to N is equal to a pre-set ratio of positive to negative sample numbers.

[0031] In some implementations, the method further includes: extracting a second positive sample and a second negative sample for training a second feature extractor based on the historical trajectory of the sample vehicle and the map data of the scene where the sample vehicle is located; wherein the second positive sample includes the endpoint positions of any N trajectory vectors in the first trajectory of the sample vehicle that do not intersect with the solid road line, and the second negative sample includes the K intersection points of the first trajectory of the sample vehicle and the solid road line, where N and K are both integers greater than 1, and K is less than or equal to a preset upper limit for the number of negative samples.

[0032] In some implementations, the first feature extractor and / or the second feature extractor are obtained through contrastive learning training.

[0033] In some implementations, the first feature extractor and / or the second feature extractor are trained in the following manner:

[0034] The historical trajectory of the sample vehicle is processed using a feature extractor to obtain the trajectory correction amount of the sample vehicle, and feature mapping is performed on the trajectory correction amount of the sample vehicle to obtain the first feature mapping result.

[0035] The location data of positive samples are processed using a feature extractor to obtain the trajectory correction amount of the positive samples, and feature mapping is performed on the trajectory correction amount of the positive samples to obtain the second feature mapping result.

[0036] The location data of negative samples are processed using a feature extractor to obtain the trajectory correction of the sample vehicles. Feature mapping is then performed on the trajectory correction of the negative samples to obtain the third feature mapping result.

[0037] Estimate the contrast loss value based on the first feature mapping result, the second feature mapping result, and the third feature mapping result;

[0038] The parameters of the feature extractor are adjusted based on the contrastive loss value.

[0039] According to a third aspect of this disclosure, a trajectory prediction apparatus is provided, comprising:

[0040] The encoding unit is used to determine the first trajectory of the target vehicle based on its historical trajectory.

[0041] The first trajectory correction unit is used to obtain a first trajectory correction amount of the target vehicle based on the historical trajectory of the target vehicle. The first trajectory correction amount is used to reduce the collision rate.

[0042] The second trajectory correction unit is used to obtain the second trajectory correction amount of the target vehicle based on the historical trajectory of the target vehicle. The second trajectory correction amount is used to reduce the probability of violating the line.

[0043] The first fusion unit is used to fuse the first trajectory and the first trajectory correction of the target vehicle to obtain the first fusion result;

[0044] The second fusion unit is used to fuse the first trajectory and the second trajectory correction of the target vehicle to obtain a second fusion result.

[0045] The decoding unit is used to process the first fusion result and the second fusion result using a pre-trained decoder to obtain the second trajectory of the target vehicle.

[0046] According to a fourth aspect of this disclosure, a training apparatus for a trajectory prediction model is provided. The trajectory prediction model includes: an encoder, a decoder, a fusion module, a first feature extractor, and a second feature extractor. The encoder is used to determine a first trajectory of a target vehicle based on its historical trajectory. The first feature extractor is used to obtain a first trajectory correction amount for the target vehicle based on its historical trajectory, the first trajectory correction amount being used to reduce the collision rate. The second feature extractor is used to obtain a second trajectory correction amount for the target vehicle based on its historical trajectory, the second trajectory correction amount being used to reduce the probability of illegal lane crossing. The fusion module is used to fuse the first trajectory and the first trajectory correction amount of the target vehicle to obtain a first fusion result, and to fuse the first trajectory and the second trajectory correction amount of the target vehicle to obtain a second fusion result. The decoder is used to process the first fusion result and the second fusion result to obtain the second trajectory of the target vehicle.

[0047] The training device for the trajectory prediction model includes:

[0048] The first training unit is used to train the encoder and decoder using the historical trajectory and real trajectory of the sample vehicle to determine the encoder parameters.

[0049] The second training unit is used to freeze the encoder parameters and train the first feature extractor using the historical trajectories of the sample vehicle and other vehicles around it to determine the parameters of the first feature extractor.

[0050] The third training unit is used to freeze the encoder parameters and train the second feature extractor using the historical trajectory of the sample vehicle and the map data of the scene where the sample vehicle is located, so as to determine the parameters of the second feature extractor.

[0051] The fourth training unit is used to freeze the encoder parameters, the first feature extractor parameters, and the second feature extractor parameters, and to train the fusion module and the decoder using the historical trajectory and the real trajectory of the sample vehicle to determine the parameters of the fusion module and the decoder.

[0052] According to a fifth aspect of this disclosure, an electronic device is provided, comprising:

[0053] Memory, the memory storing execution instructions; and

[0054] A processor that executes the execution instructions stored in the memory, causing the processor to perform the trajectory prediction method and / or the trajectory prediction model training method described above.

[0055] According to a fifth aspect of this disclosure, a readable storage medium is provided, wherein executable instructions are stored therein, which, when executed by a processor, are used to implement the trajectory prediction method and / or the trajectory prediction model training method described above.

[0056] The embodiments of this disclosure incorporate a first trajectory correction amount and a second trajectory correction amount when predicting the trajectory. This can reduce factors such as collision rate and probability of illegal lane crossing while accurately predicting the vehicle trajectory, effectively reducing factors that may affect the safe driving of the vehicle and improving the safety of vehicle driving. Attached Figure Description

[0057] The accompanying drawings illustrate exemplary embodiments of the present disclosure and, together with the description thereof, serve to explain the principles of the present disclosure. These drawings are included to provide a further understanding of the present disclosure and are incorporated in and constitute a part of this specification.

[0058] Figure 1 This is a schematic flowchart of a trajectory prediction method according to some embodiments of the present disclosure.

[0059] Figure 2 This is a flowchart illustrating a trajectory prediction model training method according to some embodiments of the present disclosure.

[0060] Figure 3 This is a schematic diagram of the positive and negative sample extraction process of a first feature extractor according to some embodiments of the present disclosure.

[0061] Figure 4 This is a scene example diagram of positive and negative samples of the first feature extractor according to some embodiments of this disclosure.

[0062] Figure 5 This is a schematic diagram of the positive and negative sample extraction process of a second feature extractor according to some embodiments of the present disclosure.

[0063] Figure 6 This is a vectorized example diagram of the positive and negative sample extraction process of the second feature extractor according to some embodiments of this disclosure.

[0064] Figure 7 This is an example diagram of vector intersection according to some embodiments of this disclosure.

[0065] Figure 8This is a schematic block diagram of a trajectory prediction device that employs a hardware implementation of a processing system, according to one embodiment of the present disclosure.

[0066] Figure 9 This is a schematic block diagram of a trajectory prediction model training device that employs a hardware implementation of a processing system, according to one embodiment of this disclosure. Detailed Implementation

[0067] The present disclosure will now be described in further detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are for illustrative purposes only and are not intended to limit the scope of the disclosure. Furthermore, it should be noted that, for ease of description, only the parts relevant to the present disclosure are shown in the accompanying drawings.

[0068] It should be noted that, where there is no conflict, the embodiments and features described in this disclosure can be combined with each other. The technical solutions of this disclosure will now be described in detail with reference to the accompanying drawings and embodiments.

[0069] Unless otherwise stated, the exemplary implementations / embodiments shown are to be understood as providing exemplary features of various details that provide ways in which the technical concepts of this disclosure can be implemented in practice. Therefore, unless otherwise stated, the features of various implementations / embodiments may be additionally combined, separated, interchanged and / or rearranged without departing from the technical concepts of this disclosure.

[0070] The use of crosshairs and / or shading in the accompanying drawings is generally used to clarify the boundaries between adjacent components. Thus, unless otherwise stated, the presence or absence of crosshairs or shading does not convey or indicate any preference or requirement for the specific material, material properties, dimensions, proportions, commonalities between the illustrated components, or any other characteristics, properties, etc., of the components. Furthermore, in the accompanying drawings, the dimensions and relative dimensions of components may be exaggerated for clarity and / or descriptive purposes. When exemplary embodiments can be implemented differently, a specific process sequence may be performed in a different order than that described. For example, two consecutively described processes may be performed substantially simultaneously or in the reverse order of their description. Furthermore, the same reference numerals denote the same components.

[0071] When a component is referred to as being "on" or "above" another component, "connected to," or "joined to" another component, the component may be directly on, directly connected to, or directly joined to the other component, or there may be intermediate components. However, when a component is referred to as being "directly on" another component, "directly connected to," or "directly joined to" another component, there are no intermediate components. Therefore, the term "connection" can refer to a physical connection, an electrical connection, etc., and may or may not have intermediate components.

[0072] The terminology used herein is for the purpose of describing particular embodiments and is not intended to be limiting. As used herein, unless the context clearly indicates otherwise, the singular forms “a” and “the” are intended to include the plural forms as well. Furthermore, when the terms “comprising” and / or “including” and variations thereof are used in this specification, it indicates the presence of the stated features, integrals, steps, operations, parts, components, and / or groups thereof, but does not exclude the presence or addition of one or more other features, integrals, steps, operations, parts, components, and / or groups thereof. It should also be noted that, as used herein, the terms “substantially,” “about,” and other similar terms are used as approximate terms rather than as terms of degree, thus explaining the inherent biases in measurements, calculated values, and / or provided values ​​that would be recognized by one of ordinary skill in the art.

[0073] Brief description of related technologies:

[0074] 1) Chinese Patent Publication No. CN112258841 discloses an intelligent vehicle risk assessment method based on vehicle trajectory prediction. This method includes a trajectory prediction step and a threat assessment step. The trajectory prediction part employs a deep learning algorithm, using the NGSIM dataset to train and evaluate a behavior prediction model to classify driving intentions and obtain the trajectory probability distribution of the autonomous vehicle. The threat assessment part quantitatively and objectively assesses the threat in each state through a vehicle risk assessment function. Single-lane risk assessment is performed using indicators such as Time to Collision (TTC) and Time Headway (TH). Multi-lane risk assessment is performed using Collision Time and Enhanced Time to Collision (ETTC). For the scenario of vehicles changing lanes from adjacent lanes, a hazard assessment is performed by estimating the time it takes for vehicles from adjacent lanes to enter the autonomous vehicle's driving area. Although this scheme performs risk assessment for lane changes, the trajectory generation part does not adjust for potential collision risks.

[0075] 2) A paper titled "Social NCE: Contrastive Learning of Socially-aware Motion Representations" discloses a model that learns a robust neuromotor model by leveraging prior knowledge of socially adverse events, given a fixed training dataset. It introduces a social contrast loss to encourage the encoded motion representations to retain sufficient information to distinguish between a positive future event and a set of negative future events. These negative samples are plotted based on domain knowledge of socially adverse scenarios in multi-agent environments. While this method effectively improves the performance of previous trajectory prediction, behavior cloning, and reinforcement learning algorithms across various environments, its method of extracting depolar events using only one trajectory as the prediction result not only fails to effectively avoid unexpected situations such as collisions and traffic violations during trajectory prediction but also makes it difficult to guarantee the accuracy of trajectory prediction.

[0076] 3) The paper titled "Towards Robust and Adaptive Motion Forecasting: A Causal Representation Perspective" discloses a modular architecture containing two encoders responsible for invariant mechanisms and style mixing, respectively. This modular design approximates a sparse causal graph in our motion forms, enabling the model to precisely locate and adjust a small subset of parameters to account for potential style shifts. A style contrast loss is introduced, which strengthens the structure of the style representation, captures relationships between different scenes, and also serves as a self-supervised signal for refinement during dynamic testing. However, the model-generated characteristic data is used to train the ability to capture different styles, making it less practical than real-world data. While this method improves the robustness and transferability of learned motion representations, allowing for out-of-distribution generalization and few-shot transfer learning, it does not address how to effectively avoid situations such as collisions and traffic violations when predicting trajectories.

[0077] As the above analysis shows, current trajectory prediction methods cannot effectively avoid situations such as vehicle collisions and vehicles illegally crossing lane lines. Therefore, this disclosure provides the following trajectory prediction method, apparatus, electronic device, and storage medium, which can accurately predict vehicle trajectories while reducing factors such as collision rates and the probability of illegally crossing lane lines, thereby further reducing factors that may affect safe vehicle operation and improving vehicle safety. Furthermore, this disclosure also provides a corresponding trajectory prediction model training method, apparatus, electronic device, and storage medium.

[0078] Brief explanation of terms used in this article:

[0079] First trajectory: The output of the encoder.

[0080] Second trajectory: The output of the decoder, the final result of trajectory prediction.

[0081] First trajectory correction: The output of the first feature extractor.

[0082] Second trajectory correction: The output of the second feature extractor.

[0083] It should be noted that the target vehicle's first trajectory, second trajectory, trajectory correction amount, and third trajectory at a certain moment can be one or more. When using multimodal trajectory prediction, multiple trajectories are used.

[0084] The following text combines Figures 1 to 9 The specific embodiments of this disclosure will be described in detail.

[0085] Figure 1 A flowchart illustrating some embodiments of the trajectory prediction method of this disclosure is shown. For example... Figure 1 As shown, the trajectory prediction method of this disclosure embodiment may include:

[0086] Step S102: Determine the first trajectory of the target vehicle based on its historical trajectory.

[0087] Step S104: Obtain the first trajectory correction amount of the target vehicle based on the historical trajectory of the target vehicle. The first trajectory correction amount is used to reduce the collision rate.

[0088] Step S106: Obtain the second trajectory correction amount of the target vehicle based on the historical trajectory of the target vehicle. The second trajectory correction amount is used to reduce the probability of violating the line crossing rule.

[0089] Step S108: Fuse the first trajectory and the first trajectory correction of the target vehicle to obtain the first fusion result;

[0090] Step S110: Fuse the first trajectory and the second trajectory correction of the target vehicle to obtain a second fusion result;

[0091] Step S112: Use a pre-trained decoder to process the first fusion result and the second fusion result to obtain the second trajectory of the target vehicle.

[0092] In some implementations, the predicted position in the second trajectory differs from the predicted position of other vehicles around the target vehicle at the corresponding time; and / or, the trajectory vectors in the second trajectory do not intersect with the solid road lines in the scene where the target vehicle is located. Thus, when the target vehicle travels along the second trajectory, the probability of it colliding with other vehicles is low, while also minimizing violations of traffic rules and situations that affect driving safety, such as illegally crossing lane lines.

[0093] The trajectory prediction method of this disclosure can accurately predict the trajectory of a target vehicle while effectively reducing the collision rate and the probability of illegal lane crossing.

[0094] In step S102, the first trajectory of the target vehicle can be obtained by processing the historical trajectory of the target vehicle using a pre-trained encoder.

[0095] The first trajectory in step S102 can be multimodal, that is, the first trajectory obtained in step S102 includes data from multiple predicted trajectories, and the data of each predicted trajectory includes a timestamp, vehicle number and vehicle location.

[0096] In some embodiments, step S102 may utilize only the historical trajectory of the target vehicle to obtain the first trajectory of the target vehicle. In other embodiments, step S102 may utilize the historical trajectory of the target vehicle, map data of the scene where the historical vehicle was located, and / or the historical trajectories of other vehicles around the target vehicle to obtain the first trajectory of the target vehicle. In specific applications, the data used to determine the first trajectory depends on various factors such as scene requirements, accuracy requirements, and different encoder functions. This disclosure does not impose any limitations on these aspects.

[0097] For example, the process of determining the first trajectory in step S102 can be as follows: Let the time of the last frame of the historical trajectory be t, the duration of the historical observed trajectory be obs, and the length of the predicted trajectory be pred. In step S102, the historical trajectory s can be used. t-obs:t ={s t-obs ,s t-obs+1 ,…,s t To obtain the first trajectory, we can use {s}. The first trajectory can be represented as {s}. t+1 ,s t+2 ,…,s t+pred}, s t This represents the coordinates of the point on the first trajectory at time t. A trajectory is a combination of several points, and the coordinates of a point can be represented as (x, y), where x represents the horizontal coordinate in a predetermined coordinate system, and y represents the vertical coordinate in the predetermined coordinate system. In this way, multimodal trajectory prediction can be achieved.

[0098] Existing trajectory generation methods, when considering interaction information, mostly rely on historical vehicle trajectories. This can lead to collisions between predicted trajectories generated by different vehicles in the scene, which is clearly unreasonable. The trajectory prediction method of this disclosure reduces the probability of vehicle collisions by obtaining a first trajectory correction amount in step S104.

[0099] In step S104, the first trajectory correction amount can be obtained through the first feature extractor, which can be trained through contrastive learning.

[0100] In step S104, the first trajectory correction amount can be obtained using the historical trajectory of the target vehicle, or it can be obtained using the historical trajectory of the target vehicle and the historical trajectories of other vehicles around the target vehicle. That is, the input data of the first feature extractor can contain only the historical trajectory of the target vehicle, or it can include the historical trajectory of the target vehicle and the historical trajectories of other vehicles around the target vehicle.

[0101] In some implementations, the training data for the first feature extractor may include the historical trajectory of the sample vehicle, a first positive sample, and a first negative sample, which can be determined based on the first trajectories of other vehicles around the sample vehicle and the first trajectory of the sample vehicle.

[0102] In some implementations, the first positive sample may include N position data obtained by adding noise perturbation to N predetermined predicted positions in the first trajectory of the sample vehicle, and the first negative sample may include K position data obtained by adding noise perturbation to N predetermined predicted positions in the first trajectory of other vehicles, where N and K are both integers greater than 1.

[0103] Since negative samples that are far from the predicted trajectory of the target vehicle have a very low probability of colliding with the target vehicle, they are of little practical significance and may even affect the accuracy of the first feature extractor. Therefore, the first negative sample of the first feature extractor is preferably a predetermined prediction position that is relatively close to the predicted position of the target vehicle. That is, in some embodiments, the first negative sample may include the top K predetermined prediction positions with the smallest distance from the first trajectory of all other vehicles surrounding the sample vehicle.

[0104] To prevent the final predicted trajectory from violating traffic rules, such as crossing solid road lines or driving into non-driving areas on the side of the road, the trajectory prediction method of this embodiment obtains a second trajectory correction amount in step S106 to reduce the probability of violating the line.

[0105] In step S106, the second trajectory correction amount can be obtained through the second feature extractor, which can be trained through contrastive learning.

[0106] In step S106, the second trajectory correction amount can be obtained using the historical trajectory of the target vehicle, or it can be obtained using the historical trajectory of the target vehicle and map data of the scene where the target vehicle is located. That is, the input data of the second feature extractor can contain only the historical trajectory of the target vehicle, or it can include the historical trajectory of the target vehicle and map data of the scene where the target vehicle is located.

[0107] In some implementations, the training data for the second feature extractor may include the historical trajectory of the sample vehicle, a second positive sample, and a second negative sample, the second positive sample and the second negative sample being determined based on map data of the scene in which the sample vehicle is located.

[0108] In this embodiment of the disclosure, the map data for a certain scene may include, but is not limited to, data related to solid road lines in that scene, data related to landmarks such as traffic signs, trees, pedestrians, and utility poles, for example, the start and end points of solid road lines. Solid road lines may include, but are not limited to, roadside lines and lane lines. In specific applications, map data can be obtained through methods such as retrieving it from a cloud server, reading it from local storage, or any other means.

[0109] In some implementations, the second positive sample may include the endpoint positions of N trajectory vectors in the first trajectory of the sample vehicle that do not intersect with the solid road line, and the second negative sample may include the K intersection points of the first trajectory of the sample vehicle and the solid road line, where N and K are both integers greater than 1.

[0110] To avoid affecting the accuracy of the first and second feature extractors due to an imbalance in the number of positive and negative samples, in this embodiment of the disclosure, the ratio of the number of negative samples K to the number of positive samples N of the first feature extractor is equal to a pre-set ratio of the number of positive to negative samples (e.g., the hyperparameter M hereinafter). neg The number of negative samples K of the second feature extractor does not exceed the preset upper limit of the number of negative samples (e.g., the hyperparameter M below). end ).

[0111] It should be noted that the specific values ​​of the number of positive samples N, the number of negative samples K, the ratio of positive to negative samples, and the upper limit of the number of negative samples for the second feature extractor can be different or the same as those for the first feature extractor.

[0112] For details on the training process of the first and second feature extractors and the extraction of positive and negative samples, please refer to the relevant description in the trajectory prediction model training method below, which will not be repeated here.

[0113] In practical applications, steps S104 and S106 can be executed synchronously or sequentially, and the execution order is not limited in this embodiment. Similarly, steps S108 and S110 can be executed synchronously or sequentially, and the execution order is not limited in this embodiment.

[0114] In step S108, the first fusion result is obtained through the first attention model. That is, the first fusion result can be obtained by fusing the first trajectory and the first trajectory correction amount of the target vehicle based on the first attention model.

[0115] In some implementations, in step S108, the first trajectory and the first trajectory correction of the target vehicle can be spliced ​​together first, and then the splicing result can be processed using the first attention model to obtain the first fusion result.

[0116] For example, the process of step S108 can be represented by the following formulas (1) to (3):

[0117]

[0118] Q t =K t =V t =Z t (2)

[0119]

[0120] in, This represents the first fusion result at time t. h represents the first trajectory correction at time t. encoder Z represents a trajectory information of the first trajectory at time t. t This represents the concatenation result at time t of the first trajectory and its correction. "concat" indicates concatenation, "Attention" indicates the processing given by the attention network, and "softmax" indicates normalization. W t Q This represents the weight matrix of the query vector at time t. The weight matrix represents the key vector at time t. d represents the weight matrix of the value vector at time t. K For hyperparameters, d K Use the default fixed value. For example, d. K It can be set to 8 by default.

[0121] In step S110, the second fusion result is obtained through the second attention model. That is, the second fusion result can be obtained by fusing the first trajectory and the second trajectory correction amount of the target vehicle based on the second attention model.

[0122] In some implementations, in step S110, the first trajectory and the second trajectory correction of the target vehicle can be spliced ​​together first, and then the splicing result can be processed using a second attention model to obtain a second fusion result.

[0123] For example, the specific implementation process of step S110 may include the processing of the following formulas (4) to (6):

[0124]

[0125] Q end =Kend =V end =Z end (5)

[0126]

[0127] in, h represents the second fusion result at time t. end This represents the second trajectory correction at time t. Z represents the endpoint position of a trajectory vector in the first trajectory at time t, or the encoding result of an intermediate variable of that trajectory vector. end This represents the concatenation result at time t of the corrections to the first and second trajectories. "concat" indicates concatenation, "Attention" indicates the processing given by the attention network, and "softmax" indicates normalization. This represents the weight matrix of the query vector at time t. The weight matrix represents the key vector at time t. d represents the weight matrix of the value vector at time t. K For hyperparameters, d K Use the default fixed value. For example, d. K It can be set to 8 by default.

[0128] It should be noted that, with h encoder It can be obtained from different encoders or from the same encoder. For example, when using DenseTNT as the baseline model, h encoder It could be the output of the trajectory encoder in DenseTNT. This can be obtained from the endpoint encoder in DenseTNT.

[0129] In some implementations, step S112 may include: first using a pre-trained multi-layer perceptron (MLP) to fuse the first fusion result with the second fusion result to obtain a third fusion result, and then using a decoder to process the third fusion result to obtain the second trajectory of the target vehicle.

[0130] The second trajectory can also have multimodal characteristics. For example, when using the Dense-TNT model as the baseline model, the second trajectory can be a multimodal form containing multiple trajectories.

[0131] For example, the specific implementation process of step S112 may include the processing of the following formulas (7) to (8):

[0132]

[0133] q = Decoder(s)all (8)

[0134] Where q represents the second trajectory. This represents the second fusion result at time t. s represents the first fusion result at time t. all This indicates the third fusion result, "concat" means concatenation, and "Decoder" means decoder.

[0135] Figure 2 This disclosure illustrates a trajectory prediction model training method according to some embodiments, which can be used to implement the aforementioned methods. Figure 1 The trajectory prediction method shown.

[0136] The trajectory prediction model may include: an encoder, a decoder, a fusion module, a first feature extractor, and a second feature extractor. The encoder determines a first trajectory of the target vehicle based on its historical trajectories. The first feature extractor obtains a first trajectory correction value based on the target vehicle's historical trajectories. The second feature extractor obtains a second trajectory correction value based on the target vehicle's historical trajectories. The fusion module fuses the first trajectory and the first trajectory correction value to obtain a first fusion result, and fuses the first trajectory and the second trajectory correction value to obtain a second fusion result. The decoder processes the first and second fusion results to obtain the second trajectory of the target vehicle.

[0137] like Figure 2 As shown, the trajectory prediction model training method of this disclosure embodiment may include:

[0138] Step S202: Train the encoder and decoder using the historical trajectory and real trajectory of the sample vehicle to determine the encoder parameters; Step S204: Freeze the encoder parameters and train the first feature extractor using the historical trajectory of the sample vehicle and other vehicles around it to determine the parameters of the first feature extractor.

[0139] Step S206: Freeze encoder parameters, and train a second feature extractor using the historical trajectory of the sample vehicle and the map data of the scene where the sample vehicle is located, so as to determine the parameters of the second feature extractor.

[0140] Step S208: Freeze the encoder parameters, the first feature extractor parameters, and the second feature extractor parameters. Train the fusion module and the decoder using the historical trajectory and the real trajectory of the sample vehicle to determine the parameters of the fusion module and the decoder.

[0141] In the trajectory prediction model of this disclosure, the encoder and decoder can be implemented using existing trajectory prediction baseline models. Specifically, a trajectory prediction baseline model with an encoder-decoder structure can be pre-selected. There is no limitation on the specific baseline model used, as long as the baseline model is an encoder-decoder structure and includes a trajectory encoder, it can be applied to this disclosure.

[0142] In some implementations, the DenseTNT model can be used as a baseline model. The encoder used to determine the first trajectory may include, but is not limited to, the trajectory encoding module, map encoding module, and endpoint encoding module in the DenseTNT model. This disclosure does not limit the specific type of encoder. When the encoder performs map encoding and trajectory encoding, the VectorNet method can be used to vectorize the scene map and trajectory.

[0143] In the DenseTNT model, the input data of the trajectory encoding module is the historical trajectory of the sample vehicle and its surrounding vehicles, the input data of the map encoding module is scene information such as maps, the output data of the trajectory encoding module is the encoded historical trajectory, the output data of the map encoding module is the encoded scene information, the input data of the endpoint encoding module includes the historical trajectory of the sample vehicle and its surrounding vehicles and scene information such as maps, and the output data of the endpoint encoding module includes intermediate variables representing the endpoint.

[0144] It should be noted that the encoder generates intermediate variables such as the encoded trajectory and endpoint. In other words, the first trajectory in this article refers to the intermediate variables such as the encoded trajectory and endpoint.

[0145] In some implementations, the DenseTNT model can be used as the baseline model, and the decoder used to determine the second trajectory can be the trajectory generation decoder in the DenseTNT model.

[0146] In step S202, the selected baseline model can be trained using an existing dataset to determine the encoder parameters.

[0147] In some implementations, step S202 can use data from the Argoverse dataset to train the baseline model, enabling the model to generate multimodal predicted trajectories, thereby determining the encoder parameters.

[0148] The real trajectories of the sample vehicles used in steps S202 and S208 also come from existing datasets.

[0149] In steps S204 and S206, different positive and negative samples are sampled according to different purposes, features are extracted from the positive and negative samples, and the distance between the samples is calculated. The corresponding feature extractor is trained by optimizing the contrast loss.

[0150] In some implementations, the first feature extractor and the second feature extractor can be trained in steps S204 and S206 in the following manner (steps a1 to a5):

[0151] Step a1: Use a feature extractor to process the historical trajectory of the sample vehicle to obtain the trajectory correction amount of the sample vehicle, and perform feature mapping on the trajectory correction amount of the sample vehicle to obtain the first feature mapping result.

[0152] Step a2: Use a feature extractor to process the position data of the positive sample to obtain the trajectory correction amount of the positive sample, and perform feature mapping on the trajectory correction amount of the positive sample to obtain the second feature mapping result.

[0153] Step a3: Use a feature extractor to process the position data of negative samples to obtain the trajectory correction amount of the sample vehicles, and perform feature mapping on the trajectory correction amount of negative samples to obtain the third feature mapping result.

[0154] Step a4: Estimate the contrast loss value based on the first feature mapping result, the second feature mapping result, and the third feature mapping result;

[0155] Step a5: Adjust the parameters of the feature extractor based on the contrast loss value.

[0156] Steps a1 through a5 are executed iteratively until a predetermined convergence condition is met. The convergence condition can be flexibly set as needed. For example, the convergence condition may be, but is not limited to, reaching a predetermined maximum number of iterations, or the comparison loss value being less than a predetermined minimum value.

[0157] In step a4, the distance between the first feature mapping result and the second feature mapping result, and the distance between the first feature mapping result and the third feature mapping result can be calculated first using cosine similarity, and then the contrast loss value can be estimated using the predetermined contrast loss function spacing.

[0158] In step a5, the parameters of the feature extractor can be adjusted based on the contrastive loss value using, for example, gradient descent or other similar methods.

[0159] In some embodiments, the first feature extractor, the second feature extractor, and the feature mapper for performing feature mapping may each employ, for example, an MLP or other neural network architecture. This disclosure does not limit the network architecture.

[0160] In step S204, positive and negative samples of the first feature extractor are sampled by a sampling method that reduces the vehicle collision rate.

[0161] In some implementations, before step S204 or before training in step S204, the method may further include: extracting a first positive sample and a first negative sample for training the first feature extractor based on the historical trajectories of the sample vehicle and other vehicles around it.

[0162] The first positive sample may include N position data obtained by adding noise perturbation to N predetermined predicted positions in the first trajectory of the sample vehicle. The first negative sample may include K position data obtained by adding noise perturbation to N predetermined predicted positions in the first trajectory of other vehicles.

[0163] Preferably, the first negative samples include the top K positions of the predicted positions of other vehicles at a predetermined time that have the smallest distance from the first trajectory of the sample vehicle.

[0164] Figure 3 A schematic diagram of the positive and negative sample extraction process of the first feature extractor is shown. Figure 4 The diagram shows an example of positive and negative sample sampling in a collision scenario, which is also an example of the positive and negative sample extraction process of the first feature extractor.

[0165] Specifically, such as Figure 3 As shown, the process of extracting the first positive sample and the first negative sample may include:

[0166] Step S302: Use the encoder to process the historical trajectory of the target vehicle and other vehicles around it to obtain the first trajectory of the target vehicle and the first trajectory of other vehicles around the target vehicle.

[0167] Step S304: Sample the first trajectory of the first vehicle and other vehicles around it, and extract the predicted position of the predetermined time point in the total predicted time of the first trajectory as the predetermined predicted position.

[0168] For example, the predicted positions at the 1 / 2, 3 / 4, and final moments of the total prediction time in the first trajectory set can be extracted as predetermined prediction positions. Taking the first trajectory of 8 seconds as an example, the predicted positions at the 4th, 6th, and 8th seconds of the first trajectory of the first vehicle and other vehicles around it can be extracted as predetermined prediction positions.

[0169] like Figure 4 As shown, Figure 4 The vehicle in the lower center is the target vehicle, and the vehicle on the left is the other vehicle of the target vehicle. All trajectories are the first trajectory. Positive samples are sampled around the circle, and negative samples are sampled around the x point. That is, positive samples are sampled around the predicted positions of the target vehicle in the first trajectory at the 4th, 6th, and 8th seconds, while negative samples are sampled around the predicted positions of the other vehicles in the first trajectory in the scene at the 4th, 6th, and 8th seconds.

[0170] Step S306: Add a noise perturbation to the predetermined predicted position in the first trajectory of the target vehicle as the first positive sample;

[0171] The process of adding noise perturbation to the predetermined predicted position in the first trajectory of the target vehicle to obtain the first positive sample is as shown in equation (9):

[0172]

[0173] Where i is the vehicle number, t is the start time of the current trajectory prediction, and ∈ is a random perturbation ∈ ~ N(0,1). This represents the coordinates of the j-th predetermined predicted position. This represents the coordinates of the j-th positive sample. j represents the index of the first positive sample, j∈{1,2,…,N}. Figure 4 For example, N = 4, j ∈ {1, 2, 3, 4}.

[0174] Step S308: Add a small noise perturbation to the predetermined predicted position of other vehicles as the first negative sample.

[0175] The process of adding noise perturbation to the predetermined predicted position in the first trajectory of other vehicles to obtain the first negative sample is as shown in Equation (10):

[0176]

[0177] Where i is the vehicle number, t is the start time of the current trajectory prediction, and ∈ is a random perturbation ∈ ~ N(0,1). This represents the coordinates of the k-th predetermined predicted position. Let represent the coordinates of the k-th negative sample of the i-th vehicle. k represents the index of the first negative sample, k∈{1,2,…,N*M}, and M represents the number of other vehicles surrounding the target vehicle. Figure 4 For example, N = 4, k ∈ {1, 2, ..., 4M}.

[0178] Therefore, N*M first negative samples can be obtained.

[0179] Step S310: Filter the first negative samples so that the ratio of the number of first negative samples to the number of first positive samples is equal to the pre-set ratio of the number of positive and negative samples.

[0180] After the first negative sample extraction is completed, some first negative samples that are far from the predetermined predicted position of the target vehicle need to be removed. This is because such negative samples are not very meaningful for optimizing the trajectory prediction model, and the trajectory prediction model will not generate trajectories close to such samples before optimization. Furthermore, in order to prevent the trajectory generated by the trajectory prediction model from being too far from the corresponding negative samples and thus unreasonable, it is also necessary to ensure a balance between the number of positive and negative samples. Therefore, the first negative samples need to be screened.

[0181] Hyperparameter M can be preset neg This represents the ratio of positive to negative samples in the first feature extractor. Hyperparameter M neg The default value is a fixed value. The hyperparameter M varies depending on the scenario and the probability of collision. neg It can be set to different values. For example, the hyperparameter M neg It can be set to 2, that is, for every first positive sample sampled, two first negative samples need to be sampled.

[0182] In some implementations, the screening process for the first negative sample may include: for the N*M first negative samples extracted in step S308, calculating the minimum distance between each first negative sample and all first positive samples; sorting the N*M first negative samples according to their minimum distance to the first positive samples; retaining the top K first negative samples with the smallest distance; removing the bottom N*MK first negative samples; and using the K retained first negative samples as the negative samples for contrastive learning training of the first feature extractor. Here, K is N*M. neg .

[0183] by Figure 4 For example, the number of the first positive samples N is 4, and the hyperparameter M is assumed to be... neg If we set it to 2, then K is 8. That is, Figure 4 In the example, the first positive sample number of the first feature extractor is 4, and the first negative sample number is 8.

[0184] In step S204, contrastive learning can be used to train the first feature extractor. In some implementations, the specific implementation process of step S204 may include: inputting the historical trajectory of the sample vehicle, the first positive sample, and the first negative sample into the first feature extractor; the first feature extractor outputting the first trajectory correction amount of the sample vehicle, the first trajectory correction amount of the first positive sample, and the first trajectory correction amount of the first negative sample; inputting the first trajectory correction amount of the sample vehicle, the first trajectory correction amount of the first positive sample, and the first trajectory correction amount of the first negative sample into a first feature mapper to perform feature mapping; the first feature mapper outputting the first feature mapping result, the second feature mapping result, and the third feature mapping result; calculating the contrastive loss value based on the first feature mapping result, the second feature mapping result, and the third feature mapping result; and updating the parameters of the first feature extractor and the first feature mapper using the contrastive loss value. This process is iteratively executed until the convergence condition is met.

[0185] In step S204, the process by which the first feature extractor obtains the first trajectory correction amount of the sample vehicle can be expressed by the following equation (11):

[0186]

[0187] in, This represents the historical trajectory of the sample vehicles. This represents the first trajectory of the sample vehicle. φ represents the first trajectory correction amount for the sample vehicle, and φ represents the first feature extractor.

[0188] In step S204, the process by which the first feature mapper obtains the first feature mapping result can be expressed as the following equation (12):

[0189]

[0190] in, Let ψ represent the first trajectory correction for the sample vehicle, and let ψ represent the first feature mapper.

[0191] In step S204, the process of obtaining the first trajectory correction amount of the first positive sample and the corresponding second feature mapping result, the first trajectory correction amount of the first negative sample and the corresponding third feature mapping result is similar to equations (11) to (12), and will not be repeated here.

[0192] In step S204, the distance between the first feature mapping result and the second feature mapping result, as well as the distance between the first feature mapping result and the second feature mapping result, can be calculated using the cosine similarity sim(·) of equation (13) or other similar methods. Then, the contrast loss value L can be calculated using the contrast loss function shown in equation (14) below. NCE .

[0193]

[0194]

[0195] Where τ is the temperature coefficient, which can be taken as 0.07. N represents the number of the first positive samples, and K represents the number of the first negative samples. This represents the result of the first feature mapping. This represents the result of the second feature mapping. This represents the result of the third feature mapping. Let represent the first trajectory correction amount of the first negative sample of the i-th sample vehicle at time t. Let represent the first trajectory correction of the first positive sample of the i-th sample vehicle at time t, and sim() represent the cosine similarity operation, k∈{0,1,2,…,K}, n∈{0,1,2,…,N}.

[0196] In step S206, positive and negative samples of the second feature extractor are sampled by a sampling method that reduces the probability of vehicles illegally crossing the line.

[0197] In some implementations, before step S206 or before training in step S206, the method may further include: extracting second positive samples and second negative samples for training the second feature extractor based on the historical trajectory of the sample vehicle and the map data of the scene where the sample vehicle is located.

[0198] The second positive sample may include the endpoint positions of any N trajectory vectors in the first trajectory of the sample vehicle that do not intersect with the solid road line, and the second negative sample may include the K intersection points of the first trajectory of the sample vehicle and the solid road line, where N and K are both integers greater than 1.

[0199] Figure 5 A schematic diagram of the positive and negative sample extraction process of the second feature extractor is shown. Figure 6 An example diagram of the vectorization and sampling process in the positive and negative sample extraction process of the second feature extractor is shown.

[0200] like Figure 5 As shown, the process of extracting the second positive sample and the second negative sample may include:

[0201] Step S502: Use the encoder to process the historical trajectory of the target vehicle to obtain the first trajectory of the target vehicle;

[0202] Step S504: Vectorize the map data and the first trajectory of the sample vehicles;

[0203] Specifically, map data and the initial trajectories of sample vehicles can be vectorized using the VectorNet method. In some implementations, vectorization can be primarily performed on solid road lines in the map data, such as curb lines and lane lines.

[0204] If the encoder uses a DenseTNT encoder, the vectorization of the first trajectory may have already been completed in step S502, and it can be used directly without performing vectorization again.

[0205] Step S506: Detect the intersection of the first trajectory with the solid road line, select K intersection points of the first trajectory with the solid road line (i.e., the predicted positions where illegal crossing occurs) as the second negative samples, select the endpoint position of the trajectory vector that has no intersection with the solid road line (i.e., no crossing occurs) as the second positive samples, and ensure that the number K of the second negative samples does not exceed the preset upper limit of the number of negative samples.

[0206] Hyperparameter M can be preset end This represents the upper limit of the number of negative samples in the first feature extractor. Hyperparameter M end The default value is a fixed value. The hyperparameter M varies depending on the scenario and the probability of a violation. end It can be set to different values. For example, the hyperparameter M end It can be set to 8, meaning that a maximum of 8 second negative samples are sampled per scene, and a maximum of [number] samples are sampled per scene. The second positive sample.

[0207] In some implementations, an exemplary procedure for detecting the intersection of the first trajectory and the solid road line may include:

[0208] Select a trajectory vector segment and sequentially determine whether the trajectory vector intersects with the vectors of each roadside line and lane line.

[0209] Specifically, to determine if the projections of the starting and ending points of two vectors coincide on various coordinates, we need to check if the endpoint with the larger x-axis coordinate in one vector is smaller than the endpoint with the smaller x-axis coordinate in the other vector. If so, the two vectors do not intersect. If not, we need to use the same method to check the y-axis coordinates. If the endpoint with the larger y-axis coordinate in one vector is smaller than the endpoint with the smaller y-axis coordinate in the other vector, then the two vectors do not intersect. Otherwise, the two vectors intersect.

[0210] Figure 7 An example diagram of vector intersections is shown. (e.g.) Figure 7 Therefore, if two vectors intersect, it means they stand opposite each other. (Vectors) sum vector In the vector, endpoints A and B are respectively in the vector... On both sides, endpoints C and D are respectively in vector Both sides.

[0211] Determine whether point A and point B lie on the vector. On either side of vector CD, i.e., vectors AD and BD are at opposite ends of vector CD, meaning their cross product has opposite signs. That is, if... If this holds true, it means that point A and point B lie on the same vector path. Both sides;

[0212] At the same time, points C and D should also be on vectors respectively. The two ends, that is, It should also be true.

[0213] If both of the above conditions are met, then the vectors intersect.

[0214] In the critical case, that is, when the above equation is exactly 0, (AD)×(CD)*(BD)×(CD)=0 or (AD)×(CD)*(BD)×(CD)=0, it means that the intersection point of the two vectors lies on one of the vectors, which also means that the two vectors intersect.

[0215] That is, the two vectors can be determined by the following formula (15). and Do they intersect?

[0216]

[0217] Where A and B are vectors The two endpoints, C and D, are vectors. The two endpoints.

[0218] After determining that the two vectors have an intersection point, first determine whether there is a horizontal or vertical vector. If there is a horizontal or vertical vector, use the following formulas (16) to (17) to calculate the position of the intersection point.

[0219] There exists a vertical vector with ordinate C; (16)

[0220] There exists a horizontal vector with x-coordinate C; (17)

[0221] Here, (x1,y1) and (x2,y2) represent the coordinates of the two endpoints of a non-horizontal or vertical vector.

[0222] If there are no horizontal or vertical vectors, the intersection point can be calculated using the following formula (18).

[0223]

[0224] Here, (x1,y1) and (x2,y2) represent the coordinates of the two endpoints of one vector, and (x3,y3) and (x4,y4) represent the coordinates of the two endpoints of another vector.

[0225] In practical applications, instances of lane violations may be infrequent, potentially resulting in a limited number of second negative samples. Therefore, it is necessary to generate second negative samples for the contrastive learning training of the second feature extractor. In some implementations, predicted trajectories generated by a Social-LSTM model pre-trained on the same dataset (e.g., the Argoverse dataset) can be used to generate the second negative samples. Since the Social-LSTM model does not consider scene maps and only historical trajectories and vehicle interactions, the generated trajectories have more intersections with lane lines, making it more suitable for generating second negative samples.

[0226] In step S206, contrastive learning can be used to train the second feature extractor. In some implementations, the specific implementation process of step S206 may include: inputting the historical trajectory of the sample vehicle, the second positive sample, and the second negative sample into the second feature extractor; the second feature extractor outputs the second trajectory correction amount of the sample vehicle, the second trajectory correction amount of the second positive sample, and the second trajectory correction amount of the second negative sample; inputting the second trajectory correction amount of the sample vehicle, the second trajectory correction amount of the second positive sample, and the second trajectory correction amount of the second negative sample into the second feature mapper to perform feature mapping; the second feature mapper outputs the corresponding first feature mapping result, second feature mapping result, and third feature mapping result; calculating the contrastive loss value based on the first feature mapping result, second feature mapping result, and third feature mapping result; and updating the parameters of the second feature extractor and the second feature mapper using the contrastive loss value. This process is iteratively executed until the convergence condition is met.

[0227] In step S206, the process by which the first feature extractor obtains the first trajectory correction amount of the sample vehicle can be expressed by the following equation (19):

[0228] h end =φ end (s end ) = MLP(s end (19)

[0229] Among them, s end h represents the endpoint of the first trajectory of the sample vehicle. end φ represents the second trajectory correction amount for the sample vehicle. end This indicates the second feature extractor.

[0230] In step S206, the process by which the second feature mapper obtains the first feature mapping result can be expressed as the following equation (20):

[0231] ψend (h end ) = MLP(h end (20)

[0232] Among them, h end ψ represents the second trajectory correction amount for the sample vehicle. end This represents the second feature mapper.

[0233] In step S204, the process of obtaining the second trajectory correction amount and the corresponding second feature mapping result of the second positive sample, and the second trajectory correction amount and the corresponding third feature mapping result of the second negative sample is similar to equations (19) to (20), and will not be repeated here.

[0234] In step S206, the distance between the first feature mapping result and the second feature mapping result, as well as the distance between the first feature mapping result and the second feature mapping result, can be calculated using the cosine similarity sim(·) of equation (13) or other similar methods. Then, the contrast loss value can be calculated using the contrast loss function shown in equation (21) below.

[0235]

[0236] In equation (21), τ is the temperature coefficient, which can be taken as 0.07. N represents the number of the second positive samples, K represents the number of the second negative samples, and ψ end (h end ) represents the result of the first feature mapping. This represents the result of the second feature mapping. This represents the result of the third feature mapping. This represents the second trajectory correction amount for the second negative sample. represents the second trajectory correction amount of the second positive sample, sim(·) represents the cosine similarity operation, k∈{0,1,2,…,K}, n∈{0,1,2,…,N}.

[0237] In step S208, the parameters of the baseline model encoder, the first feature extractor, and the second feature extractor are frozen. The fusion module and decoder are trained using the loss function of the original baseline model. The specific training process is similar to that of the baseline model and will not be described in detail here.

[0238] The fusion module may include the first attention model and the second attention model described above. The input of the first attention model includes a first trajectory correction amount and a first trajectory, and the output is a first fusion result. The input of the second attention model includes a second trajectory correction amount and a first trajectory, and the output is a first fusion result. Both the first attention model and the second attention model can be implemented using existing attention networks. The embodiments of this disclosure do not limit their network architecture.

[0239] During the training process in step S208, the historical trajectory of the sample vehicle, the actual trajectory of the sample vehicle, the historical trajectories of other vehicles around the sample vehicle, and map data of the scene where the sample vehicle is located can be used as training data. The inference phase of the training process is executed using the processing flow corresponding to the trajectory prediction method described earlier, and the loss value is estimated using the loss function of the original baseline model. Keeping the encoder parameters, the first feature extractor parameters, and the second feature extractor parameters unchanged, the loss value is backpropagated in the trajectory prediction model using algorithms such as gradient descent, modifying the parameters of the fusion module and the decoder. This process is iterated until convergence.

[0240] The trajectory prediction model trained by the trajectory prediction model training method of the present disclosure can reduce the collision rate and the probability of illegal line crossing while accurately predicting the trajectory.

[0241] Figure 8 This is a schematic block diagram of a trajectory prediction device 800 that employs a hardware implementation of a processing system according to one embodiment of the present disclosure.

[0242] Figure 9 This is a schematic block diagram of a trajectory prediction model training device 900 that employs a hardware implementation of a processing system, according to one embodiment of this disclosure.

[0243] The apparatus may include corresponding modules that perform one or more steps in the flowchart above. Therefore, each or more steps in the flowchart above can be performed by a corresponding module, and the apparatus may include one or more of these modules. A module may be one or more hardware modules specifically configured to perform a corresponding step, or implemented by a processor configured to perform a corresponding step, or stored in a computer-readable medium for implementation by a processor, or implemented through some combination thereof.

[0244] This hardware architecture can be implemented using a bus architecture. The bus architecture can include any number of interconnect buses and bridges, depending on the specific application and overall design constraints of the hardware. Bus 1000 connects various circuits including one or more processors 1100, memory 1200, and / or hardware modules. Bus 1000 can also connect various other circuits 1300 such as peripherals, voltage regulators, power management circuits, external antennas, etc.

[0245] Bus 1000 can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Component (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc. For ease of representation, this diagram uses only one connection line, but this does not imply that there is only one bus or one type of bus.

[0246] Any process or method description in the flowcharts or otherwise herein can be understood as representing a module, segment, or portion of code comprising one or more executable instructions for implementing a particular logical function or process, and the scope of the preferred embodiments of this disclosure includes additional implementations in which functions may be performed not in the order shown or discussed, including substantially simultaneously or in reverse order depending on the functions involved, as will be understood by those skilled in the art to which embodiments of this disclosure pertain. The processor performs the various methods and processes described above. For example, the method embodiments of this disclosure may be implemented as software programs tangibly contained in a machine-readable medium, such as memory. In some embodiments, part or all of the software program may be loaded and / or installed via memory and / or a communication interface. When the software program is loaded into memory and executed by the processor, one or more steps of the methods described above may be performed. Alternatively, in other embodiments, the processor may be configured to perform one of the methods described above by any other suitable means (e.g., by means of firmware).

[0247] The logic and / or steps represented in the flowchart or otherwise described herein may be specifically implemented in any readable storage medium for use by, or in conjunction with, an instruction execution system, apparatus or device (such as a computer-based system, a processor-included system or other system that can fetch and execute instructions from, an instruction execution system, apparatus or device).

[0248] For the purposes of this specification, a "readable storage medium" can be any means capable of containing, storing, communicating, propagating, or transmitting a program for use by or in conjunction with an instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of readable storage media include: an electrical connection having one or more wires (electronic device), a portable computer disk drive (magnetic device), random access memory (RAM), read-only memory (ROM), erasable and programmable read-only memory (EPROM or flash memory), fiber optic devices, and portable read-only memory (CDROM). Furthermore, a readable storage medium can even be paper or other suitable media on which a program can be printed, since a program can be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, interpreting, or otherwise processing as necessary, and then stored in memory.

[0249] It should be understood that various parts of this disclosure can be implemented in hardware, software, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented in software stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, it can be implemented using any one or a combination of the following techniques known in the art: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc.

[0250] Those skilled in the art will understand that all or part of the steps of the methods described above can be implemented by a program instructing related hardware. The program can be stored in a readable storage medium, and when executed, the program includes one or a combination of the steps of the method implementation.

[0251] Furthermore, the functional units in the various embodiments of this disclosure can be integrated into a single processing module, or each unit can exist physically separately, or two or more units can be integrated into a single module. The integrated module can be implemented in hardware or as a software functional module. If the integrated module is implemented as a software functional module and sold or used as an independent product, it can also be stored in a readable storage medium. The storage medium can be a read-only memory, a disk, or an optical disk, etc.

[0252] like Figure 8 As shown, the trajectory prediction device 800 according to this disclosure may include:

[0253] Encoding unit 802 is used to determine the first trajectory of the target vehicle based on the historical trajectory of the target vehicle;

[0254] The first trajectory correction unit 804 is used to obtain the first trajectory correction amount of the target vehicle based on the historical trajectory of the target vehicle. The first trajectory correction amount is used to reduce the collision rate.

[0255] The second trajectory correction unit 806 is used to obtain the second trajectory correction amount of the target vehicle based on the historical trajectory of the target vehicle. The second trajectory correction amount is used to reduce the probability of violating the line.

[0256] The first fusion unit 808 is used to fuse the first trajectory and the first trajectory correction amount of the target vehicle to obtain a first fusion result;

[0257] The second fusion unit 810 is used to fuse the first trajectory and the second trajectory correction of the target vehicle to obtain a second fusion result.

[0258] Decoding unit 812 is used to process the first fusion result and the second fusion result using a pre-trained decoder to obtain the second trajectory of the target vehicle.

[0259] In some implementations, the predicted position in the second trajectory differs from the predicted position of other vehicles around the target vehicle at the corresponding time; and / or, the trajectory vectors in the second trajectory do not intersect with the solid road lines in the scene where the target vehicle is located.

[0260] In some implementations, the first fusion unit 808 is used to obtain a first fusion result through a first attention model, and the second fusion unit 810 is used to obtain a second fusion result through a second attention model.

[0261] In some implementations, the first trajectory correction unit 804 is used to obtain a first trajectory correction amount through a first feature extractor, and the second trajectory correction unit 806 is used to obtain a second trajectory correction amount through a second feature extractor. The first feature extractor and / or the second feature extractor are trained through contrastive learning.

[0262] In some implementations, the training data for the first feature extractor includes the historical trajectory of the sample vehicle, a first positive sample, and a first negative sample, wherein the first positive sample and the first negative sample are determined based on the first trajectories of other vehicles around the sample vehicle and the first trajectory of the sample vehicle.

[0263] In some implementations, the first positive sample includes N position data obtained by adding noise perturbation to N predetermined predicted positions in the first trajectory of the sample vehicle, and the first negative sample includes K position data obtained by adding noise perturbation to N predetermined predicted positions in the first trajectory of other vehicles, where N and K are both integers greater than 1. The ratio of K to N is equal to a pre-set ratio of positive to negative samples.

[0264] In some implementations, the first negative samples include the top K predetermined predicted positions that have the smallest distance from the first trajectory of all other vehicles around the sample vehicle.

[0265] In some implementations, the training data for the second feature extractor includes the historical trajectory of the sample vehicle, a second positive sample, and a second negative sample, the second positive sample and the second negative sample being determined based on map data of the scene in which the sample vehicle is located.

[0266] In some implementations, the second positive sample includes the endpoint positions of N trajectory vectors in the first trajectory of the sample vehicle that do not intersect with the solid road line, and the second negative sample includes K intersection points of the first trajectory of the sample vehicle and the solid road line, where N and K are both integers greater than 1, and K is less than or equal to a preset upper limit for the number of negative samples.

[0267] In some implementations, the decoding unit 812 may specifically be used to: fuse the first fusion result with the second fusion result using a pre-trained multilayer perceptron to obtain a third fusion result, and process the third fusion result using a decoder to obtain a second trajectory of the target vehicle.

[0268] like Figure 9 As shown, the trajectory prediction model training device 900 according to this disclosure may include:

[0269] The first training unit 902 is used to train the encoder and decoder using the historical trajectory and real trajectory of the sample vehicle to determine the parameters of the encoder.

[0270] The second training unit 904 is used to freeze encoder parameters and train the first feature extractor using the historical trajector of the sample vehicle and other vehicles around it to determine the parameters of the first feature extractor.

[0271] The third training unit 906 is used to freeze encoder parameters and train the second feature extractor using the historical trajectory of the sample vehicle and the map data of the scene where the sample vehicle is located, so as to determine the parameters of the second feature extractor.

[0272] The fourth training unit 908 is used to freeze the encoder parameters, the first feature extractor parameters, and the second feature extractor parameters, and to train the fusion module and decoder using the historical trajectory and the real trajectory of the sample vehicle to determine the parameters of the fusion module and the decoder.

[0273] In some embodiments, the trajectory prediction model training device 900 may further include: a first sample extraction unit 910, configured to extract a first positive sample and a first negative sample for training a first feature extractor based on the historical trajectories of the sample vehicle and other vehicles around it; wherein the first positive sample includes N position data obtained by adding noise perturbation to N predetermined prediction positions in the first trajectory of the sample vehicle; the first negative sample includes K position data obtained by adding noise perturbation to N predetermined prediction positions in the first trajectories of other vehicles, where N and K are both integers greater than 1.

[0274] In some embodiments, the trajectory prediction model training device 900 may further include: a second sample extraction unit 912, used to extract a second positive sample and a second negative sample for training a second feature extractor based on the historical trajectory of the sample vehicle and the map data of the scene where the sample vehicle is located; wherein, the second positive sample includes the endpoint positions of any N trajectory vectors in the first trajectory of the sample vehicle that do not intersect with the solid road line, and the second negative sample includes the K intersection points of the first trajectory of the sample vehicle and the solid road line, where N and K are both integers greater than 1, and K is less than or equal to a preset upper limit for the number of negative samples.

[0275] In some implementations, the first feature extractor and / or the second feature extractor are obtained through contrastive learning.

[0276] In some implementations, the second training unit 904 and the third training unit 906 are respectively used to train the first feature extractor and / or the second feature extractor in the following manner:

[0277] The historical trajectory of the sample vehicle is processed using a feature extractor to obtain the trajectory correction amount of the sample vehicle, and feature mapping is performed on the trajectory correction amount of the sample vehicle to obtain the first feature mapping result.

[0278] The location data of positive samples are processed using a feature extractor to obtain the trajectory correction amount of the positive samples, and feature mapping is performed on the trajectory correction amount of the positive samples to obtain the second feature mapping result.

[0279] The location data of negative samples are processed using a feature extractor to obtain the trajectory correction of the sample vehicles. Feature mapping is then performed on the trajectory correction of the negative samples to obtain the third feature mapping result.

[0280] Estimate the contrast loss value based on the first feature mapping result, the second feature mapping result, and the third feature mapping result;

[0281] The parameters of the feature extractor are adjusted based on the contrastive loss value.

[0282] In practical applications, the trajectory prediction device 800 and the trajectory prediction model training device 900 can be deployed in different electronic devices or in the same device, and can be implemented through software, hardware or a combination of both.

[0283] This disclosure also provides an electronic device, including: a memory storing execution instructions; and a processor or other hardware module executing the execution instructions stored in the memory, causing the processor or other hardware module to execute the trajectory prediction method and / or trajectory prediction model training method described above.

[0284] This disclosure also provides a readable storage medium storing execution instructions, which, when executed by a processor, are used to implement the trajectory prediction method and / or trajectory prediction model training method described above.

[0285] In the description of this specification, the references to terms such as "one embodiment / mode," "some embodiments / modes," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment / mode or example is included in at least one embodiment / mode or example of this application. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment / mode or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments / modes or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments / modes or examples described in this specification, as well as the features of different embodiments / modes or examples.

[0286] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this application, "multiple" means at least two, such as two, three, etc., unless otherwise explicitly specified.

[0287] Those skilled in the art should understand that the above embodiments are merely for illustrating the present disclosure and are not intended to limit the scope of the disclosure. Those skilled in the art can make other changes or modifications based on the above disclosure, and these changes or modifications still fall within the scope of the present disclosure.

Claims

1. A trajectory prediction method characterized by, The method comprises: determining a first trajectory of a target vehicle according to a historical trajectory of the target vehicle; obtaining a first trajectory correction amount of the target vehicle according to the historical trajectory of the target vehicle, the first trajectory correction amount being used to reduce a collision rate; obtaining a second trajectory correction amount of the target vehicle according to the historical trajectory of the target vehicle, the second trajectory correction amount being used to reduce a probability of violating a lane line; fusing the first trajectory of the target vehicle and the first trajectory correction amount to obtain a first fusion result; fusing the first trajectory of the target vehicle and the second trajectory correction amount to obtain a second fusion result; processing the first fusion result and the second fusion result by using a pre-trained decoder to obtain a second trajectory of the target vehicle; the first trajectory correction amount is obtained by a first feature extractor, and the second trajectory correction amount is obtained by a second feature extractor, the first feature extractor and the second feature extractor being trained by contrast learning respectively; training data of the first feature extractor comprises a historical trajectory of a sample vehicle, a first positive sample and a first negative sample, the first positive sample and the first negative sample being determined according to a first trajectory of other vehicles around the sample vehicle and the first trajectory of the sample vehicle; training data of the second feature extractor comprises the historical trajectory of the sample vehicle, a second positive sample and a second negative sample, the second positive sample and the second negative sample being determined according to map data of a scene in which the sample vehicle is located; the first feature extractor and the second feature extractor are trained in the following manner: processing the historical trajectory of the sample vehicle by using the feature extractor to obtain a trajectory correction amount of the sample vehicle, and performing feature mapping on the trajectory correction amount of the sample vehicle to obtain a first feature mapping result; processing position data of the positive sample by using the feature extractor to obtain a trajectory correction amount of the positive sample, and performing feature mapping on the trajectory correction amount of the positive sample to obtain a second feature mapping result; processing position data of the negative sample by using the feature extractor to obtain a trajectory correction amount of the sample vehicle, and performing feature mapping on the trajectory correction amount of the negative sample to obtain a third feature mapping result; estimating a contrast loss value according to the first feature mapping result, the second feature mapping result and the third feature mapping result; adjusting parameters of the feature extractor based on the contrast loss value.

2. The trajectory prediction method of claim 1, wherein, a predicted position in the second trajectory is different from a predicted position of other vehicles around the target vehicle at a corresponding moment; and / or each trajectory vector in the second trajectory does not intersect a real line of a road in a scene in which the target vehicle is located.

3. The trajectory prediction method of claim 1, wherein, the first fusion result is obtained by a first attention model, and the second fusion result is obtained by a second attention model.

4. The trajectory prediction method of claim 1, wherein, the first positive sample comprises N pieces of position data obtained by adding noise disturbance to N predetermined predicted positions in the first trajectory of the sample vehicle, and the first negative sample comprises K pieces of position data obtained by adding noise disturbance to N predetermined predicted positions in the first trajectory of the other vehicle, N and K being integers greater than 1.

5. The trajectory prediction method of claim 4, wherein, the first negative sample comprises K predetermined predicted positions with the smallest distance from the first trajectory of the sample vehicle among first trajectories of all other vehicles around the sample vehicle.

6. The trajectory prediction method of claim 5, wherein, a ratio of K to N is equal to a pre-set positive sample quantity ratio to negative sample quantity.

7. The trajectory prediction method of claim 6, wherein, The second positive sample includes end point positions of N trajectory vectors in the first trajectory of the sample vehicle which do not intersect with the road solid line, and the second negative sample includes K intersection positions of the first trajectory of the sample vehicle and the road solid line, N and K are both integers greater than 1, and K is less than or equal to the preset upper limit of the number of negative samples.

8. The trajectory prediction method of claim 1, wherein, The processing of the first fusion result and the second fusion result by the pre-trained decoder to obtain the second trajectory of the target vehicle comprises: fusing the first fusion result and the second fusion result by using a pre-trained multi-layer perceptron to obtain a third fusion result; processing the third fusion result by using the decoder to obtain the second trajectory of the target vehicle. 9.A method for training a trajectory prediction model, characterized in that: the trajectory prediction model comprises an encoder, a decoder, a fusion module, a first feature extractor, and a second feature extractor; the encoder is configured to determine a first trajectory of a target vehicle according to a historical trajectory of the target vehicle; the first feature extractor is configured to obtain a first trajectory correction amount of the target vehicle according to the historical trajectory of the target vehicle, the first trajectory correction amount being used to reduce a collision rate; the second feature extractor is configured to obtain a second trajectory correction amount of the target vehicle according to the historical trajectory of the target vehicle, the second trajectory correction amount being used to reduce a probability of violating a lane line; the fusion module is configured to fuse the first trajectory and the first trajectory correction amount of the target vehicle to obtain a first fusion result, and fuse the first trajectory and the second trajectory correction amount of the target vehicle to obtain a second fusion result; and the decoder is configured to process the first fusion result and the second fusion result to obtain a second trajectory of the target vehicle; the method for training the trajectory prediction model comprises: training the encoder and the decoder by using a historical trajectory of a sample vehicle and a real trajectory of the sample vehicle to determine parameters of the encoder; freezing the parameters of the encoder, training the first feature extractor by using historical trajectories of the sample vehicle and other vehicles around the sample vehicle to determine parameters of the first feature extractor; freezing the parameters of the encoder, training the second feature extractor by using the historical trajectory of the sample vehicle and map data of a scene where the sample vehicle is located to determine parameters of the second feature extractor; freezing the parameters of the encoder, the first feature extractor, and the second feature extractor, training the fusion module and the decoder by using the historical trajectory of the sample vehicle and the real trajectory of the sample vehicle to determine parameters of the fusion module and parameters of the decoder; the first feature extractor and the second feature extractor are respectively trained by contrastive learning; the first feature extractor and the second feature extractor are trained in the following manner: processing the historical trajectory of the sample vehicle by using the feature extractor to obtain a trajectory correction amount of the sample vehicle, and performing feature mapping on the trajectory correction amount of the sample vehicle to obtain a first feature mapping result; processing position data of a positive sample by using the feature extractor to obtain a trajectory correction amount of the positive sample, and performing feature mapping on the trajectory correction amount of the positive sample to obtain a second feature mapping result; processing position data of a negative sample by using the feature extractor to obtain a trajectory correction amount of the sample vehicle, and performing feature mapping on the trajectory correction amount of the negative sample to obtain a third feature mapping result; estimate a contrast loss value according to the first feature mapping result, the second feature mapping result, and the third feature mapping result; adjust parameters of the feature extractor based on the contrast loss value. 10.The method of claim 9, wherein, Further comprising: extract first positive samples and first negative samples for training the first feature extractor according to historical trajectories of a sample vehicle and other vehicles around the sample vehicle; wherein the first positive samples include N position data obtained by adding noise disturbance to N predetermined predicted positions in the first trajectory of the sample vehicle, and the first negative samples include K position data obtained by adding noise disturbance to K predetermined predicted positions in the first trajectory of the other vehicles, N and K are both integers greater than 1. 11.The method of claim 10, wherein, The first negative samples include the first K predicted positions in the first trajectory of the other vehicles that have the smallest distance to the first trajectory of the sample vehicle at a predetermined time. 12.The method of claim 11, wherein, The ratio of K to N is equal to a pre-set positive sample quantity ratio to negative sample quantity. 13.The method of claim 9, wherein, Further comprising: extract second positive samples and second negative samples for training the second feature extractor according to historical trajectories of a sample vehicle and map data of a scene where the sample vehicle is located; wherein the second positive samples include end positions of any N trajectory vectors in the first trajectory of the sample vehicle that do not intersect with a road solid line, and the second negative samples include K intersection positions of the first trajectory of the sample vehicle and the road solid line, N and K are both integers greater than 1, and K is less than or equal to a pre-set upper limit of negative sample quantity.

14. A trajectory prediction device, characterized by, Comprising: a coding unit configured to determine a first trajectory of a target vehicle according to historical trajectories of the target vehicle; a first trajectory correction unit configured to obtain a first trajectory correction amount of the target vehicle according to the historical trajectories of the target vehicle, the first trajectory correction amount being used to reduce a collision rate; a second trajectory correction unit configured to obtain a second trajectory correction amount of the target vehicle according to the historical trajectories of the target vehicle, the second trajectory correction amount being used to reduce a probability of violating a lane line; a first fusion unit configured to fuse the first trajectory of the target vehicle and the first trajectory correction amount to obtain a first fusion result; a second fusion unit configured to fuse the first trajectory of the target vehicle and the second trajectory correction amount to obtain a second fusion result; a decoding unit configured to process the first fusion result and the second fusion result by using a pre-trained decoder to obtain a second trajectory of the target vehicle; the first trajectory correction amount is obtained by a first feature extractor, and the second trajectory correction amount is obtained by a second feature extractor, the first feature extractor and the second feature extractor are respectively trained by contrast learning; training data of the first feature extractor includes historical trajectories of a sample vehicle, first positive samples, and first negative samples, the first positive samples and the first negative samples are determined according to first trajectories of the sample vehicle and other vehicles around the sample vehicle; training data of the second feature extractor includes historical trajectories of a sample vehicle, second positive samples, and second negative samples, the second positive samples and the second negative samples are determined according to map data of a scene where the sample vehicle is located; the first feature extractor and the second feature extractor are trained in the following manner: The historical trajectory of the sample vehicle is processed by using the feature extractor to obtain the trajectory correction amount of the sample vehicle, and the trajectory correction amount of the sample vehicle is subjected to feature mapping to obtain a first feature mapping result; The position data of the positive sample is processed by using the feature extractor to obtain the trajectory correction amount of the positive sample, and the trajectory correction amount of the positive sample is subjected to feature mapping to obtain a second feature mapping result; The position data of the negative sample is processed by using the feature extractor to obtain the trajectory correction amount of the sample vehicle, and the trajectory correction amount of the negative sample is subjected to feature mapping to obtain a third feature mapping result; The contrast loss value is estimated according to the first feature mapping result, the second feature mapping result and the third feature mapping result; The parameters of the feature extractor are adjusted based on the contrast loss value.

15. A training device for a trajectory prediction model, characterized in that, The trajectory prediction model comprises an encoder, a decoder, a fusion module, a first feature extractor and a second feature extractor; wherein the encoder is used to determine a first trajectory of a target vehicle according to a historical trajectory of the target vehicle; the first feature extractor is used to obtain a first trajectory correction amount of the target vehicle according to the historical trajectory of the target vehicle, the first trajectory correction amount being used to reduce the collision rate; the second feature extractor is used to obtain a second trajectory correction amount of the target vehicle according to the historical trajectory of the target vehicle, the second trajectory correction amount being used to reduce the probability of violating the lane line; the fusion module is used to fuse the first trajectory and the first trajectory correction amount of the target vehicle to obtain a first fusion result, and fuse the first trajectory and the second trajectory correction amount of the target vehicle to obtain a second fusion result; and the decoder is used to process the first fusion result and the second fusion result to obtain a second trajectory of the target vehicle; The training device for the trajectory prediction model comprises: A first training unit is configured to train the encoder and the decoder by using the historical trajectory of a sample vehicle and the real trajectory of the sample vehicle, so as to determine the parameters of the encoder; A second training unit is configured to freeze the parameters of the encoder, train the first feature extractor by using the historical trajectory of the sample vehicle and other vehicles around the sample vehicle, so as to determine the parameters of the first feature extractor; A third training unit is configured to freeze the parameters of the encoder, train the second feature extractor by using the historical trajectory of the sample vehicle and map data of a scene where the sample vehicle is located, so as to determine the parameters of the second feature extractor; A fourth training unit is configured to freeze the parameters of the encoder, the parameters of the first feature extractor and the parameters of the second feature extractor, train the fusion module and the decoder by using the historical trajectory of the sample vehicle and the real trajectory of the sample vehicle, so as to determine the parameters of the fusion module and the parameters of the decoder; The first feature extractor and the second feature extractor are respectively trained by contrast learning; The first feature extractor and the second feature extractor are trained in the following manner: The historical trajectory of the sample vehicle is processed by using the feature extractor to obtain the trajectory correction amount of the sample vehicle, and the trajectory correction amount of the sample vehicle is subjected to feature mapping to obtain a first feature mapping result; The position data of the positive sample is processed by using a feature extractor to obtain a trajectory correction amount of the positive sample, and feature mapping is performed on the trajectory correction amount of the positive sample to obtain a second feature mapping result; The position data of the negative sample is processed by using a feature extractor to obtain a trajectory correction amount of the sample vehicle, and feature mapping is performed on the trajectory correction amount of the negative sample to obtain a third feature mapping result; A contrast loss value is estimated according to the first feature mapping result, the second feature mapping result and the third feature mapping result; Parameters of the feature extractor are adjusted based on the contrast loss value.

16. An electronic device, comprising: Comprise: a memory, the memory stores execution instructions; and a processor, the processor executes the execution instructions stored in the memory, so that the processor executes the trajectory prediction method in any one of claims 1-8 and / or the training method of the trajectory prediction model in any one of claims 9-13.

17. A readable storage medium, characterized by, The readable storage medium stores execution instructions, and the execution instructions are executed by the processor to implement the trajectory prediction method in any one of claims 1-8 and / or the training method of the trajectory prediction model in any one of claims 9-13.

Citation Information

Patent Citations

  • Trajectory prediction method and device, electronic equipment and storage medium

    CN115009301A

  • Prediction trajectory processing method and device

    CN115456060A