Decision model training method and related equipment
By using data from the target vehicle and surrounding vehicles to update the sub-loss value and adjust the weights during the training of the decision model, the problem of the decision model being biased towards a single target is solved, and more accurate driving trajectory output is achieved.
Patent Information
- Application Number
- CN202610276360.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-03-09
- Publication Date
- 2026-04-07
AI Technical Summary
Decision models tend to favor a particular objective during training, resulting in lower accuracy of the output driving trajectory.
By acquiring the trajectory time series data of the target vehicle and the location data of other vehicles in the vicinity, multiple sub-loss values in the preset model are updated to keep each loss term within the same numerical range. The target weights are dynamically adjusted using gradient deviation values and historical deviations to achieve multi-objective collaborative optimization.
This ensures that the driving trajectory output by the trained decision model is more accurate, thus improving the accuracy of the driving trajectory.
Smart Images

Figure CN121809571A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of autonomous driving technology, and in particular to a decision model training method and related equipment. Background Technology
[0002] With the development of autonomous driving technology, vehicle trajectory planning in complex urban traffic scenarios has become an essential function of autonomous driving technology.
[0003] In the exemplary technology, by inputting vehicle detection data into a decision model, the vehicle drives based on the driving trajectory output by the decision model.
[0004] Decision-making models are trained on multiple objectives, requiring static weighting of multiple loss values to obtain a total loss value, which is then used to update the network parameters. However, during training, decision-making models can easily become biased towards a particular objective, resulting in lower performance and consequently lower accuracy in the driving trajectory output. Summary of the Invention
[0005] Based on the aforementioned technological status, this application provides a decision model training method and related equipment to address the problem of low accuracy in the driving trajectory output by the decision model.
[0006] To achieve the above-mentioned technical objectives, this application proposes the following technical solution: Firstly, this application provides a method for training a decision model, including: Acquire multiple training data, including the trajectory time series data of the target vehicle and the position data between the target vehicle and other surrounding vehicles; Based on the training data, a preset model is trained to obtain a decision model for outputting driving trajectories. The network parameters of the preset model are updated based on multiple sub-loss values determined by the training data and the target weights corresponding to the sub-loss values. Each target weight is used to maintain each loss term within the same numerical range, and the loss term is used to indicate the product between the sub-loss value and the corresponding target weight.
[0007] In some implementations, the process for determining the target weight corresponding to the sub-loss value is as follows: The gradient bias value corresponding to the sub-loss value is determined based on the sub-loss value and the normalized contribution ratio parameter corresponding to the sub-loss value. Based on the exponential moving average, moving standard deviation, and preset logarithmic loss interval corresponding to the sub-loss value, the historical deviation corresponding to the sub-loss value is determined; The target weight corresponding to the sub-loss value is determined based on the gradient deviation value and the historical deviation.
[0008] In some implementations, determining the target weight corresponding to the sub-loss value based on the gradient deviation value and the historical deviation includes: In response to the gradient deviation value being greater than a preset deviation value, the weight corresponding to the sub-loss value is reduced to obtain the target weight; In response to the gradient deviation value being less than or equal to a preset deviation value, the weight corresponding to the sub-loss value is increased to obtain the target weight; In response to the historical deviation being greater than a preset deviation, the weight corresponding to the sub-loss value is increased to obtain the target weight; In response to the historical deviation being less than or equal to a preset deviation, the weight corresponding to the sub-loss value is reduced to obtain the target weight.
[0009] In some implementations, determining the target weight corresponding to the sub-loss value based on the gradient deviation value and the historical deviation includes: Based on the gradient deviation value, the historical deviation, and the preset mapping relationship, the target weight corresponding to the sub-loss value is determined. The preset mapping relationship is used to indicate the mapping relationship between the gradient deviation value, the historical deviation, and the weight.
[0010] In some implementations, the sub-loss value includes a dynamic collision loss value, and determining the dynamic collision loss value based on the training data includes: Based on the trajectory time series data, multiple first circles of the target vehicle at each future time are determined, and multiple second circles of the other vehicles at each future time are determined based on the location data. Determine the target gap between multiple first circles and multiple second circles at the same future time, and determine the safety distance based on the buffer distance, the target gap, and the minimum expected gap; Based on the safe distance corresponding to each of the future moments, determine the collision probability value between the target vehicle and the other vehicles at each of the future moments; The dynamic collision loss value is determined based on the valid values among the various collision probability values.
[0011] In some implementations, the sub-loss value includes a static collision loss value, and determining the static collision loss value based on the training data includes: Based on the trajectory time series data, predict the optimal trajectory of the target vehicle; In a preset cost map, the cost value corresponding to each trajectory point in the optimal trajectory is determined. The cost value is used to indicate the probability value that there is an obstacle at the location of the trajectory point in the cost map. The static collision loss value is determined based on each of the aforementioned values.
[0012] In some implementations, the sub-loss value includes a predicted loss value or a regression loss value, and determining the sub-loss value based on the training data includes: Based on the trajectory time series data, predict the optimal trajectory of the target vehicle; Based on the optimal trajectory and the corresponding true trajectory, determine the first error of each trajectory point in the optimal trajectory; Among the various first errors, the valid first error is determined as the second error; The predicted loss value or regression loss value is determined based on the ratio between the sum of each of the second errors and the number of each of the second errors.
[0013] In some implementations, the sub-loss value includes a classification loss value, and determining the classification loss value based on the training data includes: Based on the training data, predict multiple candidate trajectories for the target vehicle and the prediction score corresponding to each candidate trajectory; The classification loss value is determined based on the target vehicle's actual trajectory, multiple candidate trajectories, and the predicted score corresponding to each candidate trajectory.
[0014] In some implementations, the sub-loss value includes a trajectory smoothing loss value, and determining the trajectory smoothing loss value based on the training data includes: Based on the trajectory time series data, predict the optimal trajectory of the target vehicle; Based on the direction of each trajectory point in the optimal trajectory, multiple direction vectors are determined; A first similarity is determined between adjacent direction vectors, and the trajectory smoothing loss value is determined based on the changing trend of each of the first similarities.
[0015] In some implementations, the sub-loss value includes a contrastive loss value, and determining the contrastive loss value based on the training data includes: Based on the training data, determine the anchor sample features, positive sample features, and negative sample features; Determine a second similarity between the anchor point sample features and the positive sample features, and determine a third similarity between the anchor point sample features and the negative sample features; The contrast loss value is determined based on the second similarity and the third similarity.
[0016] In some embodiments, after training the preset model based on the training data to obtain a decision model for outputting the driving trajectory, the method further includes: Obtain target data for the current vehicle, including the trajectory time series data of the current vehicle and the position data between the current vehicle and surrounding vehicles; The target data is input into the decision model to obtain the driving trajectory output by the decision model, and the driving trajectory is output.
[0017] Secondly, this application provides a decision model training device, comprising: The acquisition module is used to acquire multiple training data, including the trajectory time series data of the target vehicle and the position data between the target vehicle and other surrounding vehicles; The training module is used to train a preset model based on the training data to obtain a decision model for outputting driving trajectories. The network parameters of the preset model are updated based on multiple sub-loss values determined by the training data and the target weights corresponding to the sub-loss values. Each target weight is used to maintain each loss term within the same numerical range. The loss term is used to indicate the product between the sub-loss value and the corresponding target weight.
[0018] Thirdly, this application provides an electronic device, including a memory and a processor, wherein, The memory is connected to the processor and is used to store programs; The processor is used to implement the decision model training method as described in the first aspect or any implementation thereof by running a program in the memory.
[0019] Fourthly, this application provides a vehicle, the vehicle including a decision model training device, the decision model training device implementing the decision model training method as described in the first aspect or any implementation thereof.
[0020] Fifthly, this application provides a computer program product, which, when executed by a processor, implements the decision model training method as described in the first aspect or any implementation thereof.
[0021] In a sixth aspect, this application provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the decision model training method as described in the first aspect or any implementation thereof.
[0022] This application provides a decision model training method and related equipment. By using training data including the trajectory time series data of the target vehicle and the position data between the target vehicle and other vehicles around the target vehicle, multiple sub-loss values in a preset model are updated, so that each loss term is maintained within the same numerical range. This achieves collaborative optimization of multiple objectives, avoids the model from biasing towards a loss value of a certain objective during training, ensures that the driving trajectory output by the trained decision model is more accurate, and improves the accuracy of the driving trajectory output by the decision model. Attached Figure Description
[0023] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of this application. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.
[0024] Figure 1 The flowchart of a decision model training method provided in the embodiments of this application Figure 1 .
[0025] Figure 2 The flowchart of a decision model training method provided in the embodiments of this application Figure 2 .
[0026] Figure 3 The flowchart of a decision model training method provided in the embodiments of this application Figure 3 .
[0027] Figure 4 The flowchart of a decision model training method provided in the embodiments of this application Figure 4 .
[0028] Figure 5 The flowchart of a decision model training method provided in the embodiments of this application Figure 5 .
[0029] Figure 6 The flowchart of a decision model training method provided in the embodiments of this application Figure 6 .
[0030] Figure 7 The flowchart of a decision model training method provided in the embodiments of this application Figure 7 .
[0031] Figure 8 The flowchart of a decision model training method provided in the embodiments of this application Figure 8 .
[0032] Figure 9This is a schematic diagram of the functional modules of a decision model training device provided in an embodiment of this application.
[0033] Figure 10 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0034] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0035] It should be noted that the user information (including but not limited to electrical equipment information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, use and processing of the relevant data must comply with relevant laws, regulations and standards, and corresponding operation entry points are provided for users to choose to authorize or refuse.
[0036] With the development of autonomous driving technology, vehicle trajectory planning in complex urban traffic scenarios has become an essential function of autonomous driving technology.
[0037] In the exemplary technology, by inputting vehicle detection data into a decision model, the vehicle drives based on the driving trajectory output by the decision model.
[0038] Decision-making models are trained on multiple objectives, requiring static weighting of multiple loss values to obtain a total loss value, which is then used to update the network parameters. However, during training, decision-making models can easily become biased towards a particular objective, resulting in lower performance and consequently lower accuracy in the driving trajectory output.
[0039] To address the aforementioned technical issues, this application proposes a decision model training method. This method uses training data, including the trajectory time-series data of the target vehicle and the positional data between the target vehicle and other vehicles in the vicinity, to update multiple sub-loss values in a pre-defined model. This ensures that each loss term remains within the same numerical range, thereby achieving collaborative optimization of multiple objectives. This prevents the model from biasing towards a particular objective's loss value during training, ensuring that the driving trajectory output by the trained decision model is more accurate and improving the accuracy of the driving trajectory output by the decision model.
[0040] The following detailed description of the decision model training method proposed in this application is provided through various embodiments.
[0041] Reference Figure 1 , Figure 1 The flowchart of a decision model training method provided in the embodiments of this application Figure 1 .like Figure 1 As shown, the decision model training method provided in this embodiment includes: Step S101: Obtain multiple training data, including the trajectory time series data of the target vehicle and the position data between the target vehicle and other surrounding vehicles.
[0042] In this embodiment, the executing entity is a decision model training device, which can be any terminal device or server with model training capabilities. The decision model device can also be a component in a vehicle used for training the model. For ease of description, the term "device" will be used to refer to the decision model training device below.
[0043] When the device needs to train the decision model, it acquires multiple training data sets. These training data include the target vehicle's trajectory time-series data and the positional data between the target vehicle and other surrounding vehicles. The target vehicle refers to the vehicle from which the training data is collected; the trajectory time-series data includes information such as the target vehicle's position, speed, and heading angle at various times; the positional data includes information such as the target vehicle's distance, relative speed, and relative angle to other vehicles at various times.
[0044] Step S102: Train the preset model according to the training data to obtain a decision model for outputting the driving trajectory. The network parameters of the preset model are updated based on the multiple sub-loss values determined by the training data and the target weights corresponding to the sub-loss values. Each target weight is used to keep each loss term within the same numerical range. The loss term is used to indicate the product between the sub-loss value and the corresponding target weight.
[0045] After obtaining multiple training data sets, the preset model is trained using each set of data to obtain a decision model for outputting the driving trajectory. The preset model can be a deep learning model, such as a long short-term memory model.
[0046] The pre-defined model is configured with a multi-objective, fully constrained loss function system. This system includes multiple loss terms, each corresponding to a training objective. These loss terms include, but are not limited to: Predictive loss is used to accurately predict weekly vehicle trajectories; Trajectory regression loss is used to accurately track the target trajectory; Classification loss, adaptive matching of road reference line intent; Static collision loss is used to avoid collisions with static obstacles. Dynamic collision loss is used to predict a safe distance from dynamic vehicles; Trajectory smoothing loss is used to ensure the driving comfort of the vehicle; Contrast loss is used to enhance scene understanding and generalization capabilities.
[0047] Each of the above loss terms corresponds to a sub-loss value and a target weight. During the training of the preset model, each sub-loss value is determined using training data, and a total loss value is obtained by weighting each sub-loss value and its corresponding target weight. The network parameters of the preset model are then updated using the total loss value. It should be noted that each target weight can be dynamically adjusted to keep each loss term within the same numerical range. The loss term is the product of the sub-loss value and its corresponding target weight.
[0048] After training the decision model, target data for the current vehicle is acquired. This target data includes the vehicle's trajectory time series data and the positional data between the current vehicle and other surrounding vehicles. The target data is input into the decision model to obtain the driving trajectory output by the model, which is then output to ensure the current vehicle follows that trajectory. The "current vehicle" refers to the vehicle on which the decision model is deployed.
[0049] In this embodiment, training data containing the trajectory time series data of the target vehicle and the position data between the target vehicle and other vehicles around the target vehicle are used to update multiple sub-loss values in the preset model, so that each loss term is maintained within the same numerical range. This achieves collaborative optimization of multiple objectives, avoids the model from biasing the loss value of a certain objective during training, ensures that the driving trajectory output by the trained decision model is more accurate, and improves the accuracy of the driving trajectory output by the decision model.
[0050] Reference Figure 2 , Figure 2 The flowchart of a decision model training method provided in the embodiments of this application Figure 2 ,based on Figure 1 In the embodiment shown, step S102 includes: Step S201: Determine the gradient bias value corresponding to the sub-loss value based on the sub-loss value and the normalized contribution ratio parameter corresponding to the sub-loss value.
[0051] In this embodiment, after each training of the preset model, multiple sub-loss values are obtained. Based on the sub-loss values and the normalized contribution ratio parameter corresponding to the sub-loss values, the gradient bias value corresponding to the sub-loss values is determined.
[0052] Specifically, there are multiple sub-loss values, for example, six sub-loss values. The six sub-loss values are defined as L_t = [L_reg, L_cls, L_col, L_dyn, L_smooth, L_cont], where L_reg is the regression loss value, L_cls is the classification loss value, L_col is the static collision loss value, L_dyn is the dynamic collision loss value, L_smooth is the trajectory smoothing loss value, and L_cont is the contrast loss value.
[0053] Determine the gradient norm of the shared parameter θ for each sub-loss value. The gradient norm reflects the "influence" of each sub-loss value on the parameter updates of the model. Specifically, the gradient norm of each sub-loss value is represented as: G_t=[|| θL_reg||2,|| θL_cls||2,|| θL_col||2,|| θL_dyn||2,|| θL_smooth||2,|| θL_cont||2).
[0054] After obtaining the gradient norm corresponding to the sub-loss value, the normalized contribution ratio parameter of the sub-loss value's gradient is determined based on the gradient norm. For example, the normalized contribution ratio parameter is characterized as follows: p_i(t) = G_i(t) / ((Σ_{j=1 to 6}G_j(t)); where j refers to the above 6 sub-loss values, and i represents the current sub-loss value. It can be understood that the normalized contribution ratio parameter of the current sub-loss value is the ratio of the gradient norm of the current sub-loss value to the sum of the gradient norms of the various sub-loss values.
[0055] After determining the normalized contribution ratio parameter of the sub-loss value, the gradient bias value can be determined. The gradient bias value refers to the gradient consistency deviation, which is used to measure whether the gradient contribution of the current sub-loss value deviates from the fair contribution. For example, the gradient bias value can be characterized as: δ_i(t)=|p_i(t)-(1 / a)|, where a refers to the number of sub-loss values.
[0056] Step S202: Determine the historical deviation of the sub-loss value based on the exponential moving average, moving standard deviation and preset logarithmic loss interval corresponding to the sub-loss value.
[0057] For each loss term, a corresponding exponential moving average μ_i and moving standard deviation σ_i are maintained.
[0058] The logarithmic form of L_i(t) x t=log(L_i(t)), which is the moving standard deviation. This means that the moving mean and moving variance are updated iteratively first, and then the square root of the variance is calculated to obtain the moving standard deviation. t This refers to the training data.
[0059] For example, the exponential moving average is characterized as: μ_i(t)=α×μ_i(t-1)+(1-α)×log(L_i(t))σ_i(t)= sqrt(α×(σ_i(t-1))²+(1-α)×(log(L_i(t))-μ_i(t-1))²). Where α is the decay factor, a constant between 0 and 1, t refers to the current time, and t-1 is the previous time.
[0060] The historical deviation of a sub-loss value is determined by using its exponential moving average and moving standard deviation, along with a predefined logarithmic loss interval. Historical deviation measures the degree to which the current sub-loss value deviates from the logarithmic loss interval and can be normalized using historical volatility.
[0061] For example, a logarithmic loss interval can be set. For instance, if it is expected that each loss is stable at around 0.15 and some fluctuation is allowed, the logarithmic loss interval can be set to [μ_target-Δ, μ_target+Δ]=[1.7,2.1]. For example, μ_target is a set value of -ln(0.15)≈1.9, and Δ is the fluctuation value of 0.2.
[0062] The historical deviation is represented as: d_i(t)=max(0,|log(L_i(t))-μ_target|-Δ) / (σ_i(t)+ε), where ε is a local minimum value, such as 1e-8 (10 to the power of negative octave), to prevent division by zero errors.
[0063] Step S203: Determine the target weight corresponding to the sub-loss value based on the gradient deviation value and the historical deviation.
[0064] After obtaining the gradient deviation value and the historical deviation, the target weight corresponding to the sub-loss value can be determined.
[0065] In one example, when the gradient deviation is large, the dominant term needs to be penalized, so the weight of the sub-loss value corresponding to the gradient deviation can be reduced; when the historical deviation is large, the lagging term needs to be helped, so the weight of the sub-loss value corresponding to the historical deviation is increased.
[0066] In another example, if the gradient deviation value is greater than the preset deviation value, the weight corresponding to the sub-loss value is decreased to obtain the target weight; if the gradient deviation value is less than or equal to the preset deviation value, the weight corresponding to the sub-loss value is increased to obtain the target weight; if the historical deviation is greater than the preset deviation, the weight corresponding to the sub-loss value is increased to obtain the target weight; if the historical deviation is less than or equal to the preset deviation, the weight corresponding to the sub-loss value is decreased to obtain the target weight.
[0067] In another example, the target weights corresponding to the sub-loss values are determined based on the gradient bias values, historical deviations, and a predefined mapping relationship. This predefined mapping relationship indicates the mapping relationship between the gradient bias values, historical deviations, and weights. For example, the predefined mapping relationship is expressed as follows: w_i(t) =exp(-β×δ_i(t)+γ×d_i(t)); where w_i(t) is the weight; β is the gradient bias penalty coefficient, for example, β is 2.0; γ is the historical deviation reward coefficient, for example, γ is 1.5.
[0068] In this embodiment, by determining the historical deviation and gradient deviation of the sub-loss value, the target weight corresponding to the sub-loss value is accurately determined based on the historical deviation and gradient deviation.
[0069] Figure 3 The flowchart of a decision model training method provided in the embodiments of this application Figure 3 ,based on Figure 1 or Figure 2 In the embodiment shown, step S102 includes: Step S301: Based on the trajectory time series data, determine multiple first circles of the target vehicle at each future time, and based on the location data, determine multiple second circles of other vehicles at each future time.
[0070] In this embodiment, the target vehicle and other vehicles can be identified as circles, and the dynamic collision loss value can be determined through these circles. For example, the target vehicle and surrounding vehicles can be approximated as the center circles of the front wheels, the centroid, and the rear wheels to better capture the vehicle's outline and orientation.
[0071] To address this, the device can determine multiple first circles for the target vehicle at each future moment using trajectory time-series data. For example, the device predicts the target vehicle's trajectory over a future time period, where each future moment corresponds to a specific position on the trajectory. These multiple first circles at future moments can be the front wheel center circle, the centroid circle, and the rear wheel center circle of the target vehicle's future position. The coordinates of the centers of each first circle can be determined using the target vehicle's center point, heading angle, and dimensions. For example, the coordinates of the front wheel center circle are represented as: (target vehicle center point + (vehicle length / 2 - vehicle width / 2) × (cos(heading), sin(heading))); The coordinate representation of the center circle of the rear wheel is: (center point - (vehicle length / 2 - vehicle width / 2) × (cos(heading), sin(heading)); The coordinates of the centroid circle are the coordinates of the target vehicle's location.
[0072] After determining the center coordinates of each first circle, the radius of each first circle needs to be determined. The radius of the first circle is set to include the outline of the target vehicle within the first circle. For this purpose, the radius of the front wheel center circle and the rear wheel center circle can be set to more than half of the vehicle width, and the radius of the centroid circle can be set to be greater than sqrt((vehicle length / 4)×2), where sqrt refers to the square root.
[0073] It should be noted that the number of the first circle is not limited to three; it can also be two or more.
[0074] After determining the first circles of the target vehicle, it is also necessary to determine the second circles of other vehicles surrounding the target vehicle. The driving trajectories of other vehicles in the future time period can be predicted using location data. Thus, the second circles of other vehicles at each future time can be determined using their driving trajectories. The method for determining the second circles of other vehicles at each future time is the same as that for the target vehicle, and will not be elaborated here.
[0075] Step S302: Determine the target gap between multiple first circles and multiple second circles at the same future time, and determine the safety distance based on the buffer distance, the target gap, and the minimum expected gap.
[0076] After determining the first circle and the second circle, the target gap between each first circle of the target vehicle and each second circle of other vehicles at future time points is determined.
[0077] For example, the distance between each first circle and each second circle at future time points is determined. For instance, the distance between the first and second circles is calculated by drawing a line connecting their centers and subtracting the radii of both circles from the length of the line. Each future time point has multiple distances, and the smallest distance at each future time point is selected as the target gap for that future time point. A negative target gap indicates that a collision between the target vehicle and other vehicles is likely at a future time point. It should be noted that an increasing weight can be applied to the gaps at future time points, for example, from 0.5 to 1, making the model focus more on the more imminent and likely collision risks.
[0078] In addition, a safe distance needs to be determined so that the probability of the target vehicle colliding with other vehicles can be determined by the safe distance and the gap between the target and the target.
[0079] For example, the minimum expected gap can be determined using a function. For instance, the "minimum gap" operation can be approximated using a softmax function with a temperature parameter tau (weights = softmax(-gap / tau)). This step is performed sequentially in the dimensions of surrounding vehicles (second circle), the vehicle's own circle (first circle), and time, ultimately yielding a scalar sequence min_gap representing the minimum expected gap between the target vehicle and the nearest other vehicle over the entire planning period.
[0080] Set a buffer distance. For example, if the buffer distance `safe_buffer` is 0.5m, then the safe distance `distance` = `max(0, min_gap - safe_buffer)`. The safe distance `distance` is 0 (indicating risk) only when the minimum gap (target gap) is less than the buffer distance; otherwise, it is a positive number (indicating safety).
[0081] Step S303: Determine the collision probability values of the target vehicle and other vehicles at each future time based on the safe distances corresponding to each future time.
[0082] After determining the safe distance at each future moment, the probability value of collision between the target vehicle and other vehicles at each future moment is determined based on the safe distance.
[0083] For example, a Gaussian kernel function is used to convert the gap into a collision probability value: collision_prob=exp(-0.5×(distance / sigma) 2 ), where sigma is the scale parameter, which determines how steep the collision probability value changes with distance. For example, sigma = vehicle width / length.
[0084] Step S304: Determine the dynamic collision loss value based on the valid values among the various collision probability values.
[0085] After obtaining the collision probability values at each future time step, the dynamic collision loss value can be determined. For example, an effective mask is used to ensure that the loss is calculated only for actual surrounding vehicles. That is, an effective value is determined from each collision probability value using an effective mask, and the average of these effective values is taken to obtain the dynamic collision loss value. The smaller the dynamic collision loss value, the lower the probability of the model-planned trajectory colliding with surrounding vehicles, and the higher the safety. Ideally, the dynamic collision loss value should be optimized to be close to 0.
[0086] In this embodiment, the dynamic collision loss adopts "multi-circle approximation + double softmax (softmax function of temperature parameter tau, and safety distance aggregation)" to construct the minimum gap probability between the target vehicle and multiple dynamic obstacles. Combined with time weighting and safety buffering mechanism, the safety of the vehicle in complex interaction scenarios is significantly improved.
[0087] Figure 4 The flowchart of a decision model training method provided in the embodiments of this application Figure 4 .based on Figures 1 to 3 In any of the embodiments shown, step S102 includes: Step S401: Based on the trajectory time series data, predict the optimal trajectory of the target vehicle.
[0088] In this embodiment, the sub-loss value includes the static collision loss value, which is used to penalize trajectories that collide with obstacles or are unsafe, and to encourage the model to plan safe paths.
[0089] To address this, the trajectory time-series data is input into a preset model, which then predicts multiple trajectories for the target vehicle and determines the optimal trajectory among them. For example, each trajectory has a prediction score, and the trajectory with the highest prediction score is selected as the optimal trajectory.
[0090] Step S402: In the preset cost map, determine the cost value corresponding to each trajectory point in the optimal trajectory. The cost value is used to indicate the probability value that there is an obstacle at the location of the trajectory point in the cost map.
[0091] The device stores a cost map, which is a two-dimensional grid map. Each grid cell stores a cost value, which refers to the probability value of the presence of an obstacle in that grid cell.
[0092] The optimal trajectory point consists of multiple trajectory points. The grid cell in the cost map for each trajectory point is determined. The cost value of the grid cell where the trajectory point is located is the cost value corresponding to that trajectory point. Therefore, the cost value of a trajectory point refers to the probability value that there is an obstacle at the location of that trajectory point in the cost map.
[0093] Step S403: Determine the static collision loss value based on each factor value.
[0094] After determining the cost value for each trajectory point, the static collision loss value is determined based on these costs. In one example, the highest cost value is used as the static collision loss value. In another example, the average of the cost values is used as the static collision loss value. In yet another example, the average of the cost values exceeding the safety threshold is used as the static collision loss value.
[0095] In this embodiment, the higher the static collision loss value, the more dangerous the current trajectory of the target vehicle can be determined. During the model training process, by minimizing the static collision loss value, the driving trajectory output by the model can avoid static obstacles.
[0096] Figure 5 The flowchart of a decision model training method provided in the embodiments of this application Figure 5 .based on Figures 1 to 4 In any of the embodiments shown, step S102 includes: Step S501: Based on the trajectory time series data, predict the optimal trajectory of the target vehicle.
[0097] In this embodiment, the sub-loss value is either the predicted loss value or the regression loss value. Both the predicted loss value and the regression loss value can ensure that the optimal trajectory planned by the model is as close as possible to the actual future trajectory in terms of geometry.
[0098] The trajectory time series data is input into the preset model, which can then predict multiple trajectories. The trajectory with the highest predicted score is selected as the optimal trajectory.
[0099] Step S502: Based on the optimal trajectory and the corresponding true trajectory, determine the first error of each trajectory point in the optimal trajectory.
[0100] After determining the optimal trajectory, the corresponding real trajectory is obtained. The real trajectory can be the actual trajectory of the target vehicle at time T, while the optimal trajectory is the trajectory of the target vehicle at time T predicted by the model.
[0101] By comparing the optimal trajectory with the true trajectory, the first error of each trajectory point in the optimal trajectory can be determined. For example, the optimal and true trajectories have the same time dimension. We determine the trajectory point in the optimal trajectory and the trajectory point in the true trajectory at time 'a', and identify the differences between the two trajectory points in various dimensions, such as vehicle speed, coordinates, and heading angle. These differences at time 'a' constitute a multi-dimensional feature vector, which serves as the first error. In this way, the first error of each trajectory point in the optimal trajectory (one trajectory point per time point) can be calculated.
[0102] When determining the first error, the Smooth L1 Loss function can be used. It is less sensitive to large outliers than L2 loss, making the training process more stable. During calculation, set reduction='none' to preserve the loss for each dimension.
[0103] Step S503: Among the various first errors, determine the valid first error as the second error.
[0104] After determining each first error, the valid first errors are selected as the second errors. For example, the second errors can be determined using a valid mask. The valid mask is a Boolean or binary tensor that indicates which moments in the optimal trajectory have valid first errors. For instance, if the prediction period is a time interval D, and the model predicts the optimal trajectory of a target vehicle in scenario A, but the target vehicle is only in scenario A during time interval C, and time interval D includes time interval C, then the target vehicle is not in scenario A during time interval A (time interval A + time interval C = time interval D). Therefore, the first errors at each moment in time interval A are invalid, while the first errors at each moment in time interval C are valid and can be used as the second errors.
[0105] Step S504: Determine the predicted loss value or regression loss value based on the ratio between the sum of the second errors and the number of the second errors.
[0106] Once each second error is determined, the ratio between the sum of the second errors and the number of second errors can be used as the predicted loss value or the regression loss value.
[0107] For example, the sum of each second error is calculated to obtain the effective total error. The total error is divided by the total number of each second error to obtain the effective average error of the trajectory points, which is used as the prediction loss value or the regression loss value.
[0108] In this embodiment, the error of the trajectory points in the optimal trajectory is determined by using the optimal trajectory and the actual trajectory, thereby accurately determining the predicted loss value or the regression loss value based on the error.
[0109] Figure 6The flowchart of a decision model training method provided in the embodiments of this application Figure 6 .based on Figures 1 to 5 In any of the embodiments shown, step S102 includes: Step S601: Based on the training data, predict multiple candidate trajectories of the target vehicle and the prediction score corresponding to each candidate trajectory.
[0110] In this embodiment, the sub-loss value includes the classification loss value. The classification loss value enables the model to have correct judgment ability and to truly select the optimal trajectory from many candidate trajectories.
[0111] After the training data is input into the preset model, the preset model performs trajectory prediction based on the training data, and obtains multiple candidate trajectories, each of which has a corresponding prediction score.
[0112] Step S602: Determine the classification loss value based on the target vehicle's actual trajectory, multiple candidate trajectories, and the predicted score corresponding to each candidate trajectory.
[0113] After determining multiple candidate trajectories and their corresponding predicted scores, the classification loss value is determined based on the true labels, multiple candidate trajectories, and the predicted score for each candidate trajectory.
[0114] For example, the training data includes labels that indicate which candidate trajectory is the best trajectory to be selected in the current driving scenario. For example, the labels are actually the target vehicle's real trajectory, which is used to determine the optimal trajectory from multiple candidate trajectories through heuristic methods such as nearest neighbor search.
[0115] Invalid candidate trajectories are identified from among the candidate trajectories using a fill mask. The fill mask is a Boolean label. For example, if the fill mask reveals that a specific type of road reference line is missing from the candidate trajectory—a road reference line required by the target vehicle in its current driving scenario—then the candidate trajectory is invalid.
[0116] After identifying invalid candidate trajectories, their predicted scores are modified, for example, by making them negative. In subsequent calculations, the probability of selecting an invalid candidate trajectory will approach zero. Furthermore, the predicted score of the optimal trajectory determined from the actual trajectory is modified to be greater than a set value, increasing the probability of selecting this optimal trajectory in the candidate calculation.
[0117] All candidate trajectories are treated as a large set of categories. The difference between the model's predicted probability distribution and the label distribution is calculated using cross-entropy loss, and this difference is used as the classification loss value. Cross-entropy loss penalizes "the model assigning high probabilities to incorrect candidate trajectories" and "the model assigning low probabilities to correct candidate trajectories".
[0118] In this embodiment, the smaller the classification loss value, the higher the model's aesthetic sense or the more accurate its judgment ability. During the training process, the classification loss value is minimized so that the model can identify the optimal trajectory.
[0119] Figure 7 The flowchart of a decision model training method provided in the embodiments of this application Figure 7 .based on Figures 1 to 6 In any of the embodiments shown, step S102 includes: Step S701: Based on the trajectory time series data, predict the optimal trajectory of the target vehicle.
[0120] In this embodiment, the sub-loss value includes a trajectory smoothing loss value. The trajectory smoothing loss value penalizes drastic changes in the vehicle's direction, ensuring that the trajectory planned by the model is smooth and comfortable, so that the trajectory conforms to the vehicle's dynamic characteristics.
[0121] The trajectory time series data is input into the preset model, which can then predict multiple trajectories. The trajectory with the highest predicted score is selected as the optimal trajectory.
[0122] Step S702: Determine multiple direction vectors based on the direction of each trajectory point in the optimal trajectory.
[0123] After determining the optimal trajectory, multiple direction vectors are determined based on the direction of each trajectory point in the optimal trajectory. For example, the trajectory points in the optimal trajectory are connected sequentially, and the direction of the connecting line is the direction vector of the preceding trajectory point.
[0124] Step S703: Determine the first similarity between adjacent direction vectors, and determine the trajectory smoothing loss value based on the changing trend of each first similarity.
[0125] After determining each direction vector, the first similarity between each adjacent direction vector is determined. The first similarity can be determined by the cosine value of the angle between the direction vectors. For example, when the cosine value (first similarity) is close to 1, it means that the vehicle's direction is almost unchanged and the trajectory is straight; when the cosine value is close to 0, it means that the vehicle's direction is perpendicular and the vehicle has made a right-angle turn; when the cosine value is close to -1, it means that the direction is completely opposite and a sharp U-turn has occurred.
[0126] After determining each primary similarity score, the trajectory smoothing loss value can be determined by analyzing the changing trends of each primary similarity score. For example, the more drastic the change in direction, the greater the trajectory smoothing loss value.
[0127] In this embodiment, the smaller the trajectory smoothing loss value, the smoother the trajectory output by the model and the more comfortable the riding experience. Therefore, the trajectory smoothing loss value is minimized during the training process.
[0128] Figure 8 The flowchart of a decision model training method provided in the embodiments of this application Figure 8 .based on Figures 1 to 7 In any of the embodiments shown, step S102 includes: Step S801: Based on the training data, determine the anchor sample features, positive sample features, and negative sample features.
[0129] In this embodiment, the sub-loss value includes the contrastive loss value. The contrastive loss value is used by the model to learn a feature space such that the feature representation of the anchor sample is as similar as possible to the feature representation of the positive sample, and as dissimilar as possible to the feature representation of the negative sample.
[0130] Using training data, anchor point sample features, positive sample features, and negative sample features are determined. For example, the hidden features, effective mask, normalization flag, and temperature parameter are first obtained.
[0131] The hidden features consist of a tensor composed of the features of anchor points, positive samples, and negative samples. Its shape is (3×bs, D), where bs is the batch size of the training data and D is the dimension of the training data features. The first bs rows of this tensor are anchor point samples, the middle bs rows are positive samples, and the last bs rows are negative samples.
[0132] The valid mask is a Boolean tensor of shape (bs) that indicates which samples in a batch are valid (e.g., the sequence is not filled with zeros). Only samples marked as True are used in the loss calculation; invalid samples are filtered out to prevent them from interfering with the loss.
[0133] The normalization flag is a Boolean value. If the normalization flag is True, the hidden features are L2 normalized and projected onto a unit hypersphere before similarity calculation. This usually stabilizes training and improves performance.
[0134] The temperature parameter is a scalar value used to scale the similarity score (dot product). A lower temperature parameter increases the model's focus on hard samples (negative samples that are difficult to distinguish), making the loss function more "severe".
[0135] When the normalization flag is set to True, F.normalize is used to perform L2 normalization on all feature vectors of the hidden features, making their magnitude 1.
[0136] Check if there are any True values in the valid mask `valid_mask`. If not, return a loss tensor with a value of 0.
[0137] Using chunk(3, dim=0), the tensor of the concatenated hidden features is split into three equal parts along the batch dimension, resulting in: x_a: Anchor point sample features, shape (bs, D); x_p: Positive sample features, shape (bs, D); x_n: Negative sample features, shape (bs, D).
[0138] It should be noted that a valid mask is used to filter out only valid sample rows from x_a, x_p, and x_n to ensure that subsequent calculations are based only on meaningful data.
[0139] Step S802: Determine the second similarity between the anchor point sample features and the positive sample features, and determine the third similarity between the anchor point sample features and the negative sample features.
[0140] Determine the cosine similarity between the anchor sample features and the positive samples (since the features have been normalized, the dot product is the cosine similarity), then divide by the temperature parameter to scale and obtain the second similarity logits_ap, with the shape (num_valid); determine the cosine similarity between the anchor sample features and the negative samples as the second similarity, then divide by the temperature parameter to scale and obtain the third similarity logits_an, with the shape (num_valid).
[0141] Step S803: Determine the comparison loss value based on the second similarity and the third similarity.
[0142] After determining the second and third similarities, the contrast loss value is determined based on the second and third similarities.
[0143] For example, logits_ap and logits_an are stacked in the last dimension to form a (num_valid, 2) "predicted logits" matrix. This can be understood as the model predicting scores for two classes for each sample: the score XX for "is a positive sample" and the score YY for "is a negative sample".
[0144] Create labels, a long integer tensor filled with zeros, of shape (num_valid). This means that for each sample, the correct class is class 0, which is the class of "positive sample pairs".
[0145] The loss is calculated using the F.cross_entropy function. This function calculates the softmax for each sample: softmax([logits_ap_i,logits_an_i])=[exp(ap_i) / sum,exp(an_i) / sum]; Then calculate the negative log-likelihood for the correct class (class 0): loss_i=-log(exp(ap_i) / (exp(ap_i)+exp(an_i))).
[0146] The loss function `loss_i` will push `exp(ap_i)` (positive sample similarity) to be much greater than `exp(an_i)` (negative sample similarity), thus achieving the learning objective. `loss_i` is the classification loss value.
[0147] In this embodiment, the classification loss value is a tensor triplet_contrastive_loss, which represents the average contrastive loss of all valid sample pairs. The smaller the classification loss value, the closer the anchor point is to the positive sample in the feature space, and the farther the anchor point is from the negative sample. Therefore, during model training, minimizing the classification loss value will make the model learn better feature discrimination.
[0148] Corresponding to the decision model training method described above, this application also provides a decision model training device. Figure 9 This is a schematic diagram of a decision model training device provided in an embodiment of this application. The decision model training device 900 provided in this embodiment includes: The acquisition module 910 is used to acquire multiple training data, including the trajectory time series data of the target vehicle and the position data between the target vehicle and other surrounding vehicles. The training module 920 is used to train the preset model based on various training data to obtain a decision model for outputting driving trajectory. The network parameters of the preset model are updated based on multiple sub-loss values determined by the training data and the target weights corresponding to the sub-loss values. Each target weight is used to keep each loss term within the same numerical range, and the loss term is used to indicate the product between the sub-loss value and the corresponding target weight.
[0149] In some implementations, the decision model training device 900 is also used for: The gradient bias value corresponding to the sub-loss value is determined based on the sub-loss value and the normalized contribution ratio parameter corresponding to the sub-loss value. Based on the exponential moving average, moving standard deviation and preset log loss interval corresponding to the sub-loss value, determine the historical deviation corresponding to the sub-loss value; The target weights corresponding to the sub-loss values are determined based on the gradient deviation value and the historical deviation.
[0150] In some implementations, the decision model training device 900 is also used for: In response to a gradient deviation value exceeding a preset deviation value, the weight corresponding to the sub-loss value is reduced to obtain the target weight; In response to a gradient deviation value being less than or equal to a preset deviation value, the weight corresponding to the sub-loss value is increased to obtain the target weight; In response to a historical deviation exceeding a preset deviation, the weight corresponding to the sub-loss value is increased to obtain the target weight; In response to a historical deviation being less than or equal to a preset deviation, the weight corresponding to the sub-loss value is reduced to obtain the target weight.
[0151] In some implementations, the decision model training device 900 is also used for: Based on the gradient deviation value, historical deviation, and preset mapping relationship, the target weight corresponding to the sub-loss value is determined. The preset mapping relationship is used to indicate the mapping relationship between the gradient deviation value, historical deviation, and weight.
[0152] In some implementations, the decision model training device 900 is also used for: Based on trajectory time series data, multiple first circles of the target vehicle at each future time are determined, and multiple second circles of other vehicles at each future time are determined based on location data. Determine the target gap between multiple first circles and multiple second circles at the same future time, and determine the safety distance based on the buffer distance, the target gap, and the minimum expected gap; Based on the safe distance at each future moment, determine the probability value of collision between the target vehicle and other vehicles at each future moment; The dynamic collision loss value is determined based on the valid values among the various collision probability values.
[0153] In some implementations, the decision model training device 900 is also used for: Based on trajectory time series data, predict the optimal trajectory of the target vehicle; In the preset cost map, the cost value corresponding to each trajectory point in the optimal trajectory is determined. The cost value is used to indicate the probability value that there is an obstacle at the location of the trajectory point in the cost map. The static collision loss value is determined based on the value of each generation.
[0154] In some implementations, the decision model training device 900 is also used for: Based on trajectory time series data, predict the optimal trajectory of the target vehicle; Based on the optimal trajectory and the corresponding true trajectory, determine the first error of each trajectory point in the optimal trajectory; Among the various first errors, the valid first error is determined as the second error; The predicted loss or regression loss is determined by the ratio between the sum of the individual second errors and the number of individual second errors.
[0155] In some implementations, the decision model training device 900 is also used for: Based on the training data, predict multiple candidate trajectories for the target vehicle and the predicted score for each candidate trajectory; The classification loss value is determined based on the target vehicle's actual trajectory, multiple candidate trajectories, and the predicted score corresponding to each candidate trajectory.
[0156] In some implementations, the decision model training device 900 is also used for: Based on trajectory time series data, predict the optimal trajectory of the target vehicle; Based on the direction of each trajectory point in the optimal trajectory, determine multiple direction vectors; Determine the first similarity between adjacent direction vectors, and determine the trajectory smoothing loss value based on the changing trend of each first similarity.
[0157] In some implementations, the decision model training device 900 is also used for: Based on the training data, determine the anchor sample features, positive sample features, and negative sample features; Determine the second similarity between anchor sample features and positive sample features, and determine the third similarity between anchor sample features and negative sample features; The contrast loss value is determined based on the second and third similarity scores.
[0158] In some implementations, the decision model training device 900 is also used for: Acquire the target data of the current vehicle, which includes the trajectory time series data of the current vehicle and the position data between the current vehicle and surrounding vehicles; Input the target data into the decision model to obtain the driving trajectory output by the decision model, and then output the driving trajectory.
[0159] The decision model training apparatus and the decision model training method provided in the above embodiments of this application belong to the same application concept and can execute the decision model training method provided in any of the above embodiments of this application. They possess the corresponding functional modules and beneficial effects for executing the decision model training method. Technical details not described in detail in this embodiment can be found in the specific processing content of the decision model training method provided in the above embodiments of this application, and will not be repeated here.
[0160] The functions implemented by each module in the decision model training device can be implemented by the same or different processors, and this application embodiment does not limit this.
[0161] It should be understood that the modules in the above decision model training device can be implemented in the form of processor calling firmware. For example, the system includes a processor connected to a memory containing instructions. The processor calls the instructions stored in the memory to implement any of the above methods or to implement the functions of each module of the device. The processor can be a general-purpose processor, such as a CPU or microprocessor, and the memory can be internal to the device or external to the system. Alternatively, the modules in the system can be implemented in the form of hardware circuits. By designing the hardware circuits, some or all of the module functions can be implemented. The hardware circuits can be understood as one or more processors. For example, in one implementation, the hardware circuit is an ASIC, and the functions of some or all of the above modules are implemented by designing the logical relationships of the components within the circuit. In another implementation, the hardware circuit can be implemented using a PLD, such as an FPGA, which can include a large number of logic gates. The connection relationships between the logic gates are configured through configuration files to implement the functions of some or all of the above modules. All modules of the above decision model training device can be implemented entirely in the form of processor calling firmware, or entirely in the form of hardware circuits, or partially in the form of processor calling firmware with the remaining parts implemented in the form of hardware circuits.
[0162] In this application embodiment, a processor is a circuit with signal processing capabilities. In one implementation, the processor can be a circuit with instruction reading and execution capabilities, such as a CPU, microprocessor, GPU, or DSP. In another implementation, the processor can implement certain functions through the logical relationships of hardware circuits. These logical relationships are fixed or reconfigurable. For example, the processor may be a hardware circuit implemented as an ASIC or PLD, such as an FPGA. In a reconfigurable hardware circuit, the process of the processor loading a configuration document and configuring the hardware circuit can be understood as the processor loading instructions to implement the functions of some or all of the above modules. Furthermore, it can also be a hardware circuit designed for artificial intelligence, which can be understood as an ASIC, such as an NPU, TPU, or DPU.
[0163] As can be seen, each module in the above decision model training device can be one or more processors (or processing circuits) configured to implement the above methods, such as: CPU, GPU, NPU, TPU, DPU, microprocessor, DSP, ASIC, FPGA, or a combination of at least two of these processor types.
[0164] Furthermore, the modules in the above decision model training device can be integrated in whole or in part, or they can be implemented independently. In one implementation, these modules are integrated together and implemented in the form of a System-on-Chip (SoC). The SoC may include at least one processor for implementing any of the above methods or implementing the functions of the modules of the device. The at least one processor can be of different types, such as CPU and FPGA, CPU and AI processor, CPU and GPU, etc.
[0165] This application provides a schematic diagram of the structure of an electronic device, see [link]. Figure 10 As shown, the electronic device includes a memory 1000 and a processor 1010; wherein the memory 1000 is connected to the processor 1010 and is used to store programs; the processor 1010 is used to implement the decision model training method disclosed in any of the above embodiments by running the programs stored in the memory 1000.
[0166] Specifically, the aforementioned electronic device may further include: a bus, a communication interface 1020, an input device 1030, and an output device 1040. The electronic device may also include a data transceiver module, an image monitoring module, and a signal monitoring module.
[0167] The processor 1010, memory 1000, communication interface 1020, input device 1030, and output device 1040 are interconnected via a bus. Among them: A bus can include a pathway for transmitting information between various components in an electronic device.
[0168] The processor 1010 can be a general-purpose processor, such as a general-purpose central processing unit (CPU), a microprocessor, etc., or an application-specific integrated circuit (ASIC), or one or more integrated circuits used to control the execution of the program of the present invention. It can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), an off-the-shelf programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.
[0169] The processor 1010 may include a main processor, as well as a baseband chip, modem, etc.
[0170] The memory 1000 stores a program that executes the technical solution of this invention, and may also store an operating system and other key business functions. Specifically, the program may include program code, which includes computer operation instructions. More specifically, the memory 1000 may include read-only memory (ROM), other types of static storage devices capable of storing static information and instructions, random access memory (RAM), other types of dynamic storage devices capable of storing information and instructions, disk storage, flash memory, etc.
[0171] Input device 1030 may include a device for receiving user input data and information, such as a keyboard, mouse, camera, scanner, light pen, voice input device, touch screen, pedometer, or gravity sensor.
[0172] Output device 1040 may include devices that allow information to be output to a user, such as a display screen, printer, speaker, etc.
[0173] The communication interface 1020 may include a device that uses any transceiver to communicate with other devices or communication networks, such as Ethernet, Radio Access Network (RAN), Wireless Local Area Network (WLAN), etc.
[0174] The processor 1010 executes the program stored in the memory 1000 and calls other devices, which can be used to implement each step of any decision model training method provided in the above embodiments of this application.
[0175] It should be noted that electronic devices can be in-vehicle terminals, mobile phones, wearable devices, or servers, etc.; or, they can include electronic devices such as in-vehicle terminals.
[0176] This application also proposes a vehicle, which includes a decision model training device, which implements the decision model training method as described in any of the above embodiments.
[0177] This application also proposes a chip, which includes a processor and a data interface. The processor reads and runs a program stored in the memory through the data interface to execute the decision model training method described in any of the above embodiments. For the specific processing procedure and its beneficial effects, please refer to the above-described embodiments of the decision model training method.
[0178] In addition to the methods and devices described above, embodiments of this application may also be computer program products, which include computer program instructions that, when executed by a processor, cause the processor to perform the steps in the decision model training methods according to various embodiments of this application as described in any of the above embodiments of this specification.
[0179] Computer program products can be written in any combination of one or more programming languages to perform the operations of the embodiments of this application. The programming languages include object-oriented programming languages such as Java and C++, as well as conventional procedural programming languages such as C or similar languages. The program code can be executed entirely on the user's computing device, partially on the power device, as a standalone firmware package, partially on the user's computing device and partially on a remote computing device, or entirely on a remote computing device or server.
[0180] Furthermore, embodiments of this application may also be storage media storing computer programs, which are executed by a processor to perform the steps of the decision model training method according to various embodiments of this application described in any of the above embodiments of this specification, specifically implementing the steps of the decision model training method as described above.
[0181] For the foregoing method embodiments, in order to simplify the description, they are all described as a series of actions. However, those skilled in the art should understand that this application is not limited to the described order of actions, because according to this application, some steps can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily essential to this application.
[0182] It should be noted that the various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For apparatus embodiments, since they are basically similar to method embodiments, the description is relatively simple; relevant parts can be referred to the descriptions in the method embodiments.
[0183] The steps in the methods of the various embodiments of this application can be adjusted, merged, or deleted in order according to actual needs, and the technical features described in each embodiment can be replaced or combined.
[0184] The units of the apparatus in the various embodiments of this application can be merged, divided, and deleted according to actual needs.
[0185] It should be understood that the disclosed terminals, devices, and methods can be implemented in other ways, given the several embodiments provided in this application. For example, the terminal embodiments described above are merely illustrative. For instance, the division of modules or sub-modules is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple sub-modules or modules may be combined or integrated into another module, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be indirect coupling or communication connection through some interfaces, devices, or modules, and may be electrical, mechanical, or other forms.
[0186] The modules or submodules described as separate components may or may not be physically separate. The components that constitute a module or submodule may or may not be physical modules or submodules; that is, they may be located in one place or distributed across multiple network modules or submodules. Some or all of the modules or submodules can be selected to achieve the purpose of this embodiment's solution, depending on actual needs.
[0187] Furthermore, the functional modules or sub-modules in the various embodiments of this application can be integrated into one processing module, or each module or sub-module can exist physically separately, or two or more modules or sub-modules can be integrated into one module. The integrated modules or sub-modules described above can be implemented in hardware or as firmware functional modules or sub-modules.
[0188] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer firmware, or a combination of both. To clearly illustrate the interchangeability of hardware and firmware, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or firmware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0189] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein can be implemented directly using hardware, firmware units executed by a processor, or a combination of both. The firmware unit can be located in random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium known in the art.
[0190] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes the element.
[0191] The above description of the disclosed embodiments enables those skilled in the art to make or use this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for training a decision model, characterized in that, include: Acquire multiple training data, including the trajectory time series data of the target vehicle and the position data between the target vehicle and other surrounding vehicles; Based on the training data, a preset model is trained to obtain a decision model for outputting driving trajectories. The network parameters of the preset model are updated based on multiple sub-loss values determined by the training data and the target weights corresponding to the sub-loss values. Each target weight is used to maintain each loss term within the same numerical range, and the loss term is used to indicate the product between the sub-loss value and the corresponding target weight.
2. The decision model training method according to claim 1, characterized in that, The process for determining the target weight corresponding to the sub-loss value is as follows: The gradient bias value corresponding to the sub-loss value is determined based on the sub-loss value and the normalized contribution ratio parameter corresponding to the sub-loss value. Based on the exponential moving average, moving standard deviation, and preset logarithmic loss interval corresponding to the sub-loss value, the historical deviation corresponding to the sub-loss value is determined; The target weight corresponding to the sub-loss value is determined based on the gradient deviation value and the historical deviation.
3. The decision model training method according to claim 2, characterized in that, The step of determining the target weight corresponding to the sub-loss value based on the gradient deviation value and the historical deviation includes: In response to the gradient deviation value being greater than a preset deviation value, the weight corresponding to the sub-loss value is reduced to obtain the target weight; In response to the gradient deviation value being less than or equal to a preset deviation value, the weight corresponding to the sub-loss value is increased to obtain the target weight; In response to the historical deviation being greater than a preset deviation, the weight corresponding to the sub-loss value is increased to obtain the target weight; In response to the historical deviation being less than or equal to a preset deviation, the weight corresponding to the sub-loss value is reduced to obtain the target weight.
4. The decision model training method according to claim 2, characterized in that, The step of determining the target weight corresponding to the sub-loss value based on the gradient deviation value and the historical deviation includes: Based on the gradient deviation value, the historical deviation, and the preset mapping relationship, the target weight corresponding to the sub-loss value is determined. The preset mapping relationship is used to indicate the mapping relationship between the gradient deviation value, the historical deviation, and the weight.
5. The decision model training method according to claim 1, characterized in that, The sub-loss value includes a dynamic collision loss value. Determining the dynamic collision loss value based on the training data includes: Based on the trajectory time series data, multiple first circles of the target vehicle at each future time are determined, and multiple second circles of the other vehicles at each future time are determined based on the location data. Determine the target gap between multiple first circles and multiple second circles at the same future time, and determine the safety distance based on the buffer distance, the target gap, and the minimum expected gap; Based on the safe distance corresponding to each of the future moments, determine the collision probability value between the target vehicle and the other vehicles at each of the future moments; The dynamic collision loss value is determined based on the valid values among the various collision probability values.
6. The decision model training method according to claim 1, characterized in that, The sub-loss value includes a static collision loss value. Determining the static collision loss value based on the training data includes: Based on the trajectory time series data, predict the optimal trajectory of the target vehicle; In a preset cost map, the cost value corresponding to each trajectory point in the optimal trajectory is determined. The cost value is used to indicate the probability value that there is an obstacle at the location of the trajectory point in the cost map. The static collision loss value is determined based on each of the aforementioned values.
7. The decision model training method according to claim 1, characterized in that, The sub-loss value includes a predicted loss value or a regression loss value. Determining the sub-loss value based on the training data includes: Based on the trajectory time series data, predict the optimal trajectory of the target vehicle; Based on the optimal trajectory and the corresponding true trajectory, determine the first error of each trajectory point in the optimal trajectory; Among the various first errors, the valid first error is determined as the second error; The predicted loss value or regression loss value is determined based on the ratio between the sum of each of the second errors and the number of each of the second errors.
8. The decision model training method according to claim 1, characterized in that, The sub-loss value includes a classification loss value, which is determined based on the training data, including: Based on the training data, predict multiple candidate trajectories for the target vehicle and the prediction score corresponding to each candidate trajectory; The classification loss value is determined based on the target vehicle's actual trajectory, multiple candidate trajectories, and the predicted score corresponding to each candidate trajectory.
9. The decision model training method according to claim 1, characterized in that, The sub-loss value includes a trajectory smoothing loss value, which is determined based on the training data, including: Based on the trajectory time series data, predict the optimal trajectory of the target vehicle; Based on the direction of each trajectory point in the optimal trajectory, multiple direction vectors are determined; A first similarity is determined between adjacent direction vectors, and the trajectory smoothing loss value is determined based on the changing trend of each of the first similarities.
10. The decision model training method according to claim 1, characterized in that, The sub-loss value includes a contrastive loss value, and the contrastive loss value is determined based on the training data, including: Based on the training data, determine the anchor sample features, positive sample features, and negative sample features; Determine a second similarity between the anchor point sample features and the positive sample features, and determine a third similarity between the anchor point sample features and the negative sample features; The contrast loss value is determined based on the second similarity and the third similarity.
11. The decision model training method according to any one of claims 1-10, characterized in that, After training the preset model based on the training data to obtain a decision model for outputting the driving trajectory, the method further includes: Obtain target data for the current vehicle, including the trajectory time series data of the current vehicle and the position data between the current vehicle and surrounding vehicles; The target data is input into the decision model to obtain the driving trajectory output by the decision model, and the driving trajectory is output.
12. A decision model training device, characterized in that, include: The acquisition module is used to acquire multiple training data, including the trajectory time series data of the target vehicle and the position data between the target vehicle and other surrounding vehicles; The training module is used to train a preset model based on the training data to obtain a decision model for outputting driving trajectories. The network parameters of the preset model are updated based on multiple sub-loss values determined by the training data and the target weights corresponding to the sub-loss values. Each target weight is used to maintain each loss term within the same numerical range. The loss term is used to indicate the product between the sub-loss value and the corresponding target weight.
13. An electronic device, characterized in that, Including memory and processor, among which, The memory is connected to the processor and is used to store programs; The processor is used to implement the decision model training method as described in any one of claims 1-11 by running the program in the memory.
14. A vehicle, characterized in that, The vehicle includes a decision model training device, which implements the decision model training method as described in any one of claims 1-11.
15. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, which, when executed by a processor, implements the decision model training method as described in any one of claims 1-11.
16. A computer program product, characterized in that, When the computer program is executed by the processor, it implements the decision model training method as described in any one of claims 1-11.