A method, device and vehicle for generating autonomous driving trajectory

By stitching together the detection map and occupancy map into a risk map in the autonomous driving system, sampling to obtain risk features and correcting the trajectory, the problem of planning trajectory deviation caused by inconsistent perception tasks is solved, and safer and more stable autonomous driving trajectory generation is achieved.

CN123104697APending Publication Date: 2026-11-17CHONGQING CHANGAN TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611540160.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-30
Publication Date
2026-11-17

AI Technical Summary

Technical Problem

In existing autonomous driving systems, target detection and occupancy prediction tasks are trained independently without explicit constraints, leading to inconsistent perception results and affecting the accuracy and safety of planned trajectories. In particular, the detection and judgment of unknown objects and objects with rare shapes are not reliable enough.

Method used

By stitching together the detection map, occupancy map, and conflict map into a risk map, sampling is performed in multiple regions along the initial trajectory to obtain risk characteristics of multiple regions. The trajectory correction amount is determined by cross-attention calculation to correct the initial planned trajectory, constrain potential risk areas, and improve the safety and stability of the trajectory.

Benefits of technology

In autonomous driving systems, by explicitly constraining the consistency of perception tasks and correcting planned trajectories, the safety, stability, and accuracy of trajectories are improved, the planning difficulty is reduced, and the safety and comfort of driving are ensured.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123104697A_ABST
    Figure CN123104697A_ABST
Patent Text Reader

Abstract

This application relates to an autonomous driving trajectory generation method, apparatus, and vehicle. The method includes: acquiring environmental perception data and discretizing the space surrounding the vehicle into multiple spatial units; performing forward processing on the environmental perception data through a detection network, an occupancy network, and a planning network to obtain a detection map, an occupancy map, and an initial trajectory; determining a conflict map based on the degree of inconsistency between the detection map and the occupancy map; concatenating the detection map, occupancy map, and conflict map into a risk map; sampling the risk map along the initial trajectory in multiple preset regions to obtain multi-region risk features; performing cross-attention calculation using trajectory features as queries and risk coding features as keys and values; obtaining a trajectory correction amount by mapping the output of the cross-attention through an output layer; and superimposing the trajectory correction amount onto the initial trajectory to obtain the final planned trajectory. This solution can obtain a safer, more stable, and more accurate and reliable autonomous driving trajectory.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of autonomous driving technology, specifically to an autonomous driving trajectory generation method, device, and vehicle. Background Technology

[0002] Autonomous driving systems typically include modules such as perception, prediction, planning, and control. The perception module identifies information such as traffic participants, obstacles, lane structure, and drivable areas around the vehicle; the planning module uses the perception results, vehicle status, and navigation information as inputs to predict the vehicle's future trajectory, and the quality of the planned trajectory directly affects driving safety and comfort.

[0003] In existing perception solutions, object detection and occupancy prediction are two commonly used perception tasks. Object detection typically outputs the position, size, category, speed, and confidence level of targets such as vehicles, pedestrians, cyclists, and traffic cones. Occupancy prediction typically divides the space around the vehicle into multiple spatial units and outputs whether each spatial unit is occupied, used to distinguish between passable areas and obstacle areas. Ideally, the judgments of different tasks in the same perception system regarding the same spatial location should corroborate each other: if the object detection result shows that a target exists at a certain location, then the occupancy prediction result for that location should, in principle, be that it is occupied; conversely, if the occupancy prediction result shows that an area is occupied, then, in principle, there should be corresponding object detection results near that area.

[0004] However, existing autonomous driving solutions typically train and evaluate each perception task independently, lacking explicit constraints on the relationships between the outputs of different tasks, which can lead to inconsistencies in the aforementioned judgments. On the one hand, object detection relies on a predefined set of categories. For objects outside this set (such as scattered cardboard boxes, fallen trees, construction barriers), or known category objects with rare shapes (such as fallen traffic cones, pedestrians lying or squatting, open car doors, extended crane booms, and overturned vehicles), it is easy to miss detections or for the detection box to not completely cover the object. On the other hand, occupancy prediction is limited by the size of the spatial unit and the vehicle's computing power, and its judgment on whether small, distant targets are occupied is also unreliable. When different perception tasks give contradictory conclusions at the same location, the downstream planning module struggles to determine whether the location is passable, which in turn leads to deviations in the planned trajectory output by the autonomous driving system. Summary of the Invention

[0005] This application provides an autonomous driving trajectory generation method, device, and vehicle to solve the deviation in the planned trajectory caused by the inconsistency between target detection and occupancy detection in the autonomous driving perception task in the prior art.

[0006] Firstly, this application provides a method for generating an autonomous driving trajectory, the method comprising: The system acquires environmental perception data and discretizes the space around the vehicle into multiple spatial units. The environmental perception data is then processed by a detection network, an occupancy network, and a planning network to obtain a detection map, an occupancy map, and an initial trajectory. A conflict map is determined based on the degree of inconsistency between the detection map and the occupancy map. The conflict map is used to characterize the degree of error in the judgment of the same spatial unit by the detection map and the occupancy map. The detection map, the occupancy map, and the conflict map are combined to form a risk map, which is used to characterize the target detection status, space occupancy status, and judgment disagreement status of each spatial unit around the vehicle. The risk map is sampled in multiple preset regions along the initial trajectory to obtain multi-region risk features; The initial trajectory and the multi-region risk features are encoded to obtain trajectory features and risk coding features respectively. Cross attention is calculated using the trajectory features as the query and the risk coding features as the key and value. The trajectory correction amount is obtained by mapping the output of the cross attention through the output layer. The trajectory correction is superimposed on the initial trajectory to obtain the final planned trajectory.

[0007] In one embodiment of this application, determining the conflict map based on the degree of inconsistency between the detection map and the occupancy map includes: The detection map and the occupancy map are compared one by one according to spatial units, and the absolute value of the difference between the two values ​​is calculated. Spatial cells with an absolute difference greater than a preset threshold retain their original values, while the remaining spatial cells are set to zero to obtain the conflict map; wherein, the spatial cells in the conflict map that take non-zero values ​​are the spatial cells in which the detection map and the occupancy map are judged to be divergent.

[0008] In one embodiment of this application, the step of concatenating the detection map, the occupancy map, and the conflict map into a risk map includes: The detection map, the occupancy map, and the conflict map are used as the first input channel, the second input channel, and the third input channel, respectively, and then spliced ​​together to form the risk map with three input channels; Each spatial unit in the risk graph simultaneously records the target detection value, space occupancy value, and decision disagreement value for that spatial unit. These three values ​​are independently stored in their respective input channels, representing the target detection dimension, space occupancy dimension, and decision disagreement dimension, respectively.

[0009] In one embodiment of this application, sampling the risk map along the initial trajectory in multiple preset regions to obtain multi-region risk features includes: The preset multiple regions include the front region, rear region, left front region, right front region, left rear region and right rear region, which are divided according to preset azimuth angles with the geometric center of the vehicle as the center, as well as the overall vehicle body region formed by the shape of the vehicle. At each time point along the initial trajectory, the target detection value, space occupancy value, and judgment disagreement value of the spatial unit where each region is located are obtained in the risk map, which serve as the multi-region risk features.

[0010] In one embodiment of this application, the step of acquiring the target detection value, space occupancy value, and divergence judgment value of the spatial unit of each region in the risk map at each time point along the initial trajectory includes: The positions of each time point on the initial trajectory are mapped to the coordinate system of the risk map to obtain the sampling positions on the risk map, and the spatial units around the sampling positions are determined. Based on the distance from the sampling position to the center position of each surrounding spatial unit, the weight of each surrounding spatial unit is determined. The smaller the distance, the greater the weight, and the sum of all weights is 1. For each surrounding spatial unit, the target detection value, space occupancy value, and decision divergence value of that spatial unit are weighted and summed to obtain the target detection sample value, space occupancy sample value, and decision divergence sample value at the sampling location.

[0011] In one embodiment of this application, the method further includes: pre-training a network used to implement the trajectory generation and correction method, specifically including: During the training phase, environmental perception data samples are acquired, and the data samples are processed by the detection network, the occupancy network and the planning network respectively to obtain the training detection map, the training occupancy map and the initial training trajectory. Using the training detection map as the supervision basis for the training occupancy map, a first consistency loss is calculated; during backpropagation using the first consistency loss, a stopping gradient processing is performed on the training detection map so that the gradient of the loss only updates the parameters of the occupancy network; Using the training occupancy map as the supervision basis for the training detection map, a second consistency loss is calculated; during backpropagation using the second consistency loss, a stopping gradient processing is performed on the training occupancy map so that the gradient of the loss only updates the parameters of the detection network. The spatial cells traversed by the initial training trajectory are compared with the spatial cells in the training detection map whose confidence level is higher than a preset value. When the two overlap, the third consistency loss is increased. When backpropagating with the third consistency loss, the parameters of the planning network are updated only according to the gradient of the consistency loss. The spatial units traversed by the initial training trajectory are compared with the spatial units in the training occupancy map whose occupancy level is higher than a preset value. When the two overlap, the fourth consistency loss is increased. When backpropagating with the fourth consistency loss, the parameters of the planning network are updated only according to the gradient of the consistency loss. The spatial units traversed by the initial training trajectory are compared with the spatial units in the training detection map and the training occupancy map where discrepancies occur. When they overlap, the fifth consistency loss is increased. When backpropagating with the fifth consistency loss, the parameters of the planning network are updated only based on the gradient of the consistency loss. Determine the training trajectory correction amount along the initial training trajectory, and superimpose the training trajectory correction amount onto the initial training trajectory to obtain the final training planned trajectory; The first consistency loss to the fifth consistency loss, together with the detection task loss, the occupation task loss and the trajectory regression task loss, are weighted and summed to obtain the total loss; The parameters of the detection network, the occupancy network, and the planning network are updated by backpropagation using the total loss.

[0012] In one embodiment of this application, the training further includes: Obtain the marked driving trajectory, and expand the driving trajectory to a preset range to obtain a planned relevant area, which represents the spatial range of the vehicle's planned driving. When calculating the first consistency loss to the fifth consistency loss, the weight of spatial units located within the planning-related area is greater than the weight of spatial units located outside the area.

[0013] In one embodiment of this application, the total loss further includes correction magnitude loss and smoothing loss: The correction magnitude loss is obtained by averaging the absolute values ​​of the training trajectory correction amount at each time point; The smoothing loss is obtained by calculating the second difference of three adjacent trajectory points on the final planned trajectory of the training and averaging the absolute values. The second difference reflects the degree of change in the distance between adjacent trajectory points. The step of backpropagating the total loss to update the parameters of the detection network, the occupancy network, and the planning network further includes: The correction magnitude loss is incorporated into the total loss for backpropagation to limit the overall size of the training trajectory correction amount, and to make the final training planned trajectory consistent with the initial training trajectory when the training trajectory correction amount is zero. The smoothing loss is incorporated into the total loss for backpropagation to suppress abrupt changes in the spacing between adjacent trajectory points on the final planned trajectory of the training.

[0014] Secondly, this application provides an autonomous driving trajectory generation device, comprising: The acquisition module is used to acquire environmental perception data and discretize the space around the vehicle into multiple spatial units. The environmental perception data is then processed by a detection network, an occupancy network, and a planning network to obtain a detection map, an occupancy map, and an initial trajectory. The determination module is used to determine a conflict map based on the degree of inconsistency between the detection map and the occupancy map, wherein the conflict map is used to characterize the degree of judgment error between the detection map and the occupancy map for the same spatial unit; The stitching module is used to stitch the detection map, the occupancy map and the conflict map into a risk map, which is used to characterize the target detection status, space occupancy status and judgment of discrepancies in each spatial unit around the vehicle. The sampling module is used to sample the risk map in multiple preset areas along the initial trajectory to obtain multi-area risk features; The calculation module is used to encode the initial trajectory and the multi-region risk features to obtain trajectory features and risk coding features respectively, perform cross-attention calculation with the trajectory features as the query and the risk coding features as the key and value, and obtain the trajectory correction amount by mapping the output of the cross-attention through the output layer. The correction module is used to superimpose the trajectory correction amount onto the initial trajectory to obtain the final planned trajectory.

[0015] Thirdly, this application provides a vehicle, including a vehicle body and electronic devices, wherein the electronic devices include a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; Memory, used to store computer programs; When a processor executes a program stored in memory, it implements the autonomous driving trajectory generation method as described in any embodiment of the first aspect above.

[0016] Fourthly, this application also provides a computer storage medium storing computer-executable instructions for executing the autonomous driving trajectory generation method described in any of the preceding claims.

[0017] The beneficial effects of this invention are: In this embodiment, the detection map, occupancy map, and conflict map are stitched together to form a risk map. The risk map is sampled along the initial trajectory in multiple preset regions to obtain multi-region risk features. The initial trajectory is encoded as a trajectory feature, and the multi-region risk features are encoded as risk coding features. Cross-attention is calculated using the trajectory features as queries and the risk coding features as keys and values. The trajectory correction amount is determined by mapping the output of the cross-attention through the output layer. The trajectory correction amount is then superimposed on the initial trajectory to obtain the final planned trajectory. Therefore, this application fully considers the impact of inconsistencies between detection and occupancy prediction during trajectory calculation, appropriately correcting the initial autonomous vehicle planned trajectory and constraining the planned trajectory to focus on potential risk areas, resulting in a safer, more stable, and more accurate autonomous driving trajectory. Attached Figure Description

[0018] Figure 1 A flowchart illustrating an autonomous driving trajectory generation method according to an embodiment of this application; Figure 2 This is a schematic flowchart of a conflict graph determination method provided in an embodiment of this application; Figure 3 This is a schematic diagram of a multi-region risk feature extraction process provided in an embodiment of this application; Figure 4 A detailed flowchart of multi-region risk feature extraction provided in one embodiment of this application; Figure 5 This is a schematic diagram of the training phase process provided in an embodiment of this application; Figure 6 This is a schematic diagram illustrating the principle of training phase consistency loss calculation provided in the embodiments of this application; Figure 7 This is a schematic diagram illustrating the trajectory correction principle provided in an embodiment of this application; Figure 8 A schematic diagram of an autonomous driving trajectory generation device provided in an embodiment of this application; Figure 9 This is a structural view of an electronic device provided in an embodiment of this application. Detailed Implementation

[0019] The embodiments of the present invention will be described below with reference to the accompanying drawings and preferred embodiments. Those skilled in the art can easily understand other advantages and effects of the present invention from the content disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and various details in this specification can also be modified or changed based on different viewpoints and applications without departing from the spirit of the present invention. It should be understood that the preferred embodiments are only for illustrating the present invention and not for limiting the scope of protection of the present invention.

[0020] It should be noted that the illustrations provided in the following embodiments are only schematic representations of the basic concept of the present invention. Therefore, the drawings only show the components related to the present invention and are not drawn according to the actual number, shape and size of the components in the actual implementation. In the actual implementation, the form, quantity and proportion of each component can be arbitrarily changed, and the layout of the components may also be more complex.

[0021] To address the technical problem of insufficient trajectory safety in existing autonomous driving systems when perception results diverge, this application provides an autonomous driving trajectory generation method. On the one hand, during the model training phase, this method explicitly constrains the outputs of multiple tasks, such as target detection, occupancy prediction, and vehicle planning, through several consistency losses to maintain semantic consistency as much as possible, reducing discrepancies between task outputs from the source and lowering the learning difficulty of downstream planning. On the other hand, during the model runtime phase, the inconsistency information between target detection and occupancy prediction is used as a risk signal to correct the initial trajectory output by the planning network, ensuring that the final planned trajectory stays away from potentially high-risk areas. This approach balances driving safety with trajectory smoothness and comfort.

[0022] The inventive concept of this application lies in the fact that it no longer pursues the accuracy of a single perception result in object detection or occupancy prediction, nor does it simply superimpose collision penalties in the planning process. Instead, it uses the consistency between different perception tasks as usable information. When object detection and occupancy prediction agree on the same spatial location, it indicates that the perception result at that location is relatively reliable, and the vehicle can drive normally according to the initial trajectory. When the two show significant divergence at the same location, it indicates that there is uncertainty in the perception at that location, and this location should be considered a potentially high-risk area, which the vehicle's planned trajectory should conservatively avoid. Based on this concept, the training phase reduces the divergence between the outputs of each task through consistency loss, and the runtime phase encodes the divergent areas as risk features and makes minor corrections to the initial trajectory accordingly, improving the safety of the trajectory without replanning the entire trajectory.

[0023] In the following embodiments, the stage where the model is actually used for vehicle driving is called the running stage, and the stage where the model updates its parameters using training samples is called the training stage. The detection network, occupancy network, and planning network used in the running stage and the training stage are the same set of networks, and the network parameters used in the running stage are learned in the training stage. The training stage also calculates some consistency losses that are only used for training. These losses do not exist in the running stage, so they do not increase the computational load and latency of the running stage.

[0024] To facilitate understanding, several terms that are repeatedly used in the embodiments of this application will be explained first.

[0025] Detection map: A map derived from the detection results of the target detection network, with spatial cells as the basic unit. The value at each spatial cell represents the degree to which the spatial cell is covered by the target detection box, and the value ranges from 0 to 1.

[0026] Occupation Graph: A graph output by the occupancy network, with spatial cells as the basic unit. The value at each spatial cell represents the degree to which that spatial cell is occupied by an object, and the value ranges from 0 to 1.

[0027] Initial trajectory: The trajectory of the vehicle over a future period of time, output by the planning network, consists of a series of trajectory points arranged in time. Each trajectory point includes the vehicle's lateral position, longitudinal position, and heading angle at that moment.

[0028] Final planned trajectory: The trajectory obtained after correcting the initial trajectory with trajectory correction.

[0029] Vehicle body coverage map: A map derived from a certain trajectory, used to represent the spatial units covered by the vehicle body at various times when the vehicle is traveling along the trajectory.

[0030] Conflict graph: A graph that represents the degree of disagreement between the detection graph and the occupancy graph.

[0031] Risk map: A multi-channel map obtained by stitching together the detection map, occupancy map and conflict map along the channel dimension.

[0032] Human driving trajectory: The trajectory generated by actual driving by human drivers and labeled in the training samples, also known as expert trajectory.

[0033] Planning related area: The area obtained by extending the human driving trajectory outwards within a preset range is used to represent the area that the vehicle will pass through in the future and its surrounding areas.

[0034] Figure 1 A flowchart illustrating an autonomous driving trajectory generation method provided in this application embodiment; see reference Figure 1 As shown, the method in this embodiment includes the following steps S10-S60: S10. Acquire environmental perception data and discretize the space around the vehicle into multiple spatial units. Process the environmental perception data forward through a detection network, an occupancy network, and a planning network to obtain a detection map, an occupancy map, and an initial trajectory.

[0035] The detection map represents the confidence level of a target being detected at each spatial unit, the occupancy map represents the degree to which each spatial unit is occupied by an object, and the initial trajectory represents the vehicle's driving position at several future moments.

[0036] In this embodiment, the environmental perception data can be one or more combinations of images captured by cameras, point clouds captured by lidar, and echo signals captured by millimeter-wave radar. Each network can first extract features from the environmental perception data through a shared backbone network, and then the task heads corresponding to the detection network, occupancy network, and planning network will output their respective results based on the shared features. The shared backbone network is beneficial for each task to utilize the same underlying features and save on-board computing power.

[0037] Regarding spatial discretization, for example, from a bird's-eye view, the space surrounding the vehicle is divided into uniformly sized two-dimensional spatial units, each with a side length of, for example, 0.5 meters; or, the side length of the spatial unit is 1.0 meter to reduce computational load when onboard computing power is limited; in one implementation, the space surrounding the vehicle can also be divided into three-dimensional spatial units. This application does not limit the specific form of the spatial units; the following description uses two-dimensional spatial units as an example. After discretization, the detection map, occupancy map, conflict map, and risk map all take values ​​on the same set of spatial units, thus enabling comparison at the granularity of the spatial units.

[0038] The detection network outputs detection results typically including the target's category, center location, dimensions (length, width, height), orientation, velocity, and confidence level. When converting the detection results into a detection map, for each spatial cell, if it is covered by a bounding box, the confidence level of that bounding box is used as the target detection value for that spatial cell; spatial cells not covered by any bounding box have a target detection value of zero or close to zero. Thus, spatial cells with higher values ​​on the detection map are the areas where the detection network considers to contain targets. The occupancy network directly outputs the degree to which each spatial cell is occupied by an object, forming an occupancy map. The planning network outputs initial trajectories, for example, an initial trajectory covering the next 8 seconds, with one trajectory point every 0.5 seconds, for a total of 16 trajectory points; or an initial trajectory covering the next 5 seconds, with one trajectory point every 0.4 seconds, and so on.

[0039] S20. Determine a conflict map based on the degree of inconsistency between the detection map and the occupancy map. The conflict map is used to characterize the degree of judgment error between the detection map and the occupancy map for the same spatial unit.

[0040] The detection map and occupancy map are compared one by one, and the absolute value of the difference between the two values ​​is taken as the conflict value of that spatial unit, thus obtaining the conflict map. The spatial units with higher values ​​on the conflict map are the spatial units where the detection and occupancy judgments diverge. The divergence includes two situations: First, the detection map shows that the spatial unit contains a target, while the occupancy map shows that the spatial unit is not occupied, such as the occupancy network missing detection at this location; Second, the occupancy map shows that the spatial unit is occupied, but there is no target on the detection map, such as scattered cardboard boxes on the roadside, fallen trees, etc., which are not included in the predefined categories of target detection and are missed by target detection due to not recognizing them, but the occupancy network detects that there is an object occupying the space. Other examples include fallen cones, pedestrians lying or squatting, which are rare in the training samples, and irregular objects that cannot be completely covered by the detection box, such as open car doors, extended crane arms, and overturned vehicles. The part outside the detection box will show a divergence of being occupied and being detected as empty.

[0041] See Figure 2 In the embodiment shown, step S20 above, which involves determining the conflict map based on the degree of inconsistency between the detection map and the occupancy map, specifically includes the following steps S201-S202: S201. Compare the detection map and the occupancy map one by one according to spatial units, and calculate the absolute value of the difference between the two values.

[0042] S202. Retain the original value of the spatial units whose absolute difference value is greater than a preset threshold, and set the rest of the spatial units to zero to obtain the conflict map; wherein, the spatial units with non-zero values ​​in the conflict map are the spatial units in which the detection map and the occupancy map are judged to be divergent.

[0043] Since the detection network and the occupancy network are two different networks, even if they agree on the direction of a certain spatial location, their output values ​​will inevitably have slight differences. If all the absolute values ​​of the differences are included in the conflict graph without distinction, the conflict graph will be filled with slight numerical fluctuations, which will actually obscure the real disagreements. After thresholding by setting a preset threshold, only spatial units with substantially opposite judgment directions are retained in the conflict graph, making the conflict indication more accurate.

[0044] In practical implementation, the parameters can be set according to the output distribution of the detection network and the occupancy network. In addition, after thresholding, most spatial units in the conflict graph are zero, the risk graph is sparser, and sampling and subsequent calculations are more focused.

[0045] S30. The detection map, the occupancy map, and the conflict map are combined to form a risk map; wherein, the risk map is used to characterize the target detection status, space occupancy status, and judgment disagreement status of each spatial unit around the vehicle.

[0046] In this embodiment, the detection map, occupancy map, and conflict map are combined. Figure 3 The images are stitched together along the channel dimension as three input channels to obtain a risk map with three input channels. This risk map is not a single risk score map: if the three types of information were pre-weighted and summed into a single-channel map, firstly, the weighting coefficients would need to be manually set and would have strong prior knowledge; secondly, the three types of information would be mixed before entering the network, making it impossible for the network to distinguish whether a risk at a certain point stems from a detected target, occupied space, or a divergence between the two. By using multiple input channels, the three types of information are independently retained in their respective input channels, allowing the subsequent trajectory correction network to learn the meaning and interrelationships of the values ​​in each channel.

[0047] In one embodiment of this application, step S30 above, which involves concatenating the detection map, the occupancy map, and the conflict map into a risk map, specifically includes the following step S30': S30', The detection map, the occupancy map, and the conflict map are respectively used as the first input channel, the second input channel, and the third input channel, and spliced ​​together to form the risk map with three input channels.

[0048] Each spatial unit in the risk graph simultaneously records the target detection value, space occupancy value, and decision disagreement value for that spatial unit. These three values ​​are independently stored in their respective input channels, representing the target detection dimension, space occupancy dimension, and decision disagreement dimension, respectively.

[0049] The three numerical values ​​provide different suggestions for trajectory correction: a high target detection value indicates a known, categorizable target, which can be treated as a known target in the planning; a high space occupancy value and a low target detection value means there is an unknown obstacle that the detection network does not recognize, requiring more conservative avoidance; a high judgment discrepancy value directly indicates that the area has high perception uncertainty. The three numerical values ​​enter the trajectory correction network as independent channels, allowing the network to learn different correction strategies for different combinations of values. For example, a location with a high detection value and a low space occupancy value may be a missed detection by the space occupancy network, with relatively controllable risk; a location with a low detection value and a high space occupancy value is more likely to be an unknown obstacle and should be avoided first. This discriminatory ability cannot be provided by a single-channel weighted summation method.

[0050] S40. The risk map is sampled in multiple preset areas along the initial trajectory to obtain multi-area risk features.

[0051] S50. The initial trajectory and the multi-region risk features are encoded to obtain trajectory features and risk coding features respectively. Cross-attention is calculated using the trajectory features as the query and the risk coding features as the key and value. The trajectory correction amount is obtained by mapping the output of the cross-attention through the output layer.

[0052] S60. The trajectory correction amount is superimposed on the initial trajectory to obtain the final planned trajectory.

[0053] In one embodiment of this application, reference is made to... Figure 3 As shown, in step S40 above, sampling the risk map along the initial trajectory in multiple preset regions to obtain multi-region risk features specifically includes the following steps S401-S402: S401. The preset multiple regions include the front region, rear region, left front region, right front region, left rear region and right rear region, which are divided according to preset azimuth angles with the geometric center of the vehicle as the center, as well as the overall vehicle body region formed by the shape of the vehicle.

[0054] For example, the orientation region can be divided into six orientation regions centered on the vehicle's geometric center, with each region defined by a preset azimuth angle in increments of 60 degrees; or, in increments of 45 degrees, a region to the left and a region to the right can be further added. The overall vehicle body area is formed by the vehicle's outer shape, covering the space currently occupied by the vehicle; since a vehicle is a rectangle with length and width rather than a point, sampling only the trajectory points themselves cannot reflect the risks at the vehicle's edges, and sampling the overall vehicle body area compensates for this.

[0055] S402. At each time point along the initial trajectory, obtain the target detection value, space occupancy value, and judgment disagreement value of the spatial unit where each region is located in the risk map, as the multi-region risk feature.

[0056] The advantage of sampling multiple regions separately is that it preserves directionality: if only the features of the entire vehicle body area are available, the model can only know that the risk is high, but it is not easy to determine whether to correct to the left or right; after sampling regions such as the left front region and the right front region separately, the risk differences in different directions are explicitly preserved, and the network can choose the correction direction accordingly. For example, if the right front region is sampled as high risk while the left front region is low risk, the network can learn a strategy to correct to the left.

[0057] In one embodiment of this application, reference is made to... Figure 4 As shown, in step S402 above, the step of obtaining the target detection value, space occupancy value, and judgment divergence value of the spatial unit where each region is located in the risk map at each time point along the initial trajectory includes the following steps S4021-S4023: S4021. Map the position of each time point on the initial trajectory to the coordinate system of the risk map to obtain the sampling position on the risk map, and determine the spatial unit around the sampling position.

[0058] S4022. Based on the distance from the sampling position to the center position of each surrounding spatial unit, determine the weight of each surrounding spatial unit respectively. The smaller the distance, the greater the weight, and the sum of each weight is 1.

[0059] S4023. For each surrounding spatial unit, the target detection value, space occupancy value, and decision divergence value of that spatial unit are weighted and summed to obtain the target detection sample value, space occupancy sample value, and decision divergence sample value at the sampling location.

[0060] In the above sampling process, the trajectory points are continuous coordinates while the spatial cells are discrete grids. The sampling position usually does not fall at the center of the spatial cell. For example, after coordinate mapping, the continuous grid coordinates corresponding to the trajectory point on the risk map are (8.3, 9.7). In this case, the spatial cells around the sampling position are determined by taking the nearest spatial cell as the center (e.g., four spatial cells), and then weighted by distance. This distance-weighted sampling is bilinear interpolation sampling: when directly taking the nearest cell, a small movement of the trajectory point may cross the cell boundary, causing the sampled value to jump. Distance weighting ensures that the sampled value changes continuously as the trajectory point moves.

[0061] The sampling results for each region at a given time point can be obtained by averaging the sampled values ​​from multiple coordinate points within the region, or by splicing the sampled values ​​from a fixed number of coordinate points within the region. Each region contributes three numerical values: target detection, spatial occupancy, and decision divergence. Taking seven regions as an example, a total of twenty-one-dimensional multi-region risk features are obtained. Furthermore, sampling along the trajectory compresses the calculation scope from the entire risk map to a small number of regions near the trajectory, significantly reducing the computational load and learning difficulty, and avoiding excessive influence of distant, irrelevant regions on trajectory correction.

[0062] Reference Figure 7As shown, the trajectory correction module takes the detection map, occupancy map, and initial trajectory as inputs. Internally, it can be divided into two parallel feature generation branches and one merging branch. One branch starts from the detection map and occupancy map, determines the conflict map according to step S20, and concatenates them according to step S30 to obtain a risk map with three input channels. Then, according to step S40, it samples the risk map along the initial trajectory in multiple preset regions to obtain multi-region risk features, which are then encoded as risk coding features. The other branch starts from the initial trajectory and encodes the initial trajectory as trajectory features. The two branches merge at the intersection attention point, performing cross-attention calculation with the trajectory features as the query and the risk coding features as the key and value to obtain the attention update amount. The attention update amount is added to the trajectory feature residual to obtain the fusion feature. The fusion feature is mapped through the correction amount generation network to obtain the trajectory correction amount. Finally, the trajectory correction amount is superimposed on the initial trajectory to obtain the final planned trajectory. The trajectory correction module is used in both the runtime and training phases, with the only difference being the input: the input for the runtime phase is the detection map, the occupancy map, and the initial trajectory, while the input for the training phase is the training detection map, the training occupancy map, and the training initial trajectory.

[0063] In this embodiment, the trajectory features are encoded from the position information at each time point on the initial trajectory. For example, the lateral position, longitudinal position, and heading angle at each time point are arranged in chronological order and mapped into a feature vector through several layers of fully connected networks. The risk encoding features are encoded from multi-region risk features. For example, the target detection values, space occupancy values, and decision disagreement values ​​for each region are arranged in chronological order and mapped into a feature vector through several layers of fully connected networks. The meaning of the encoding of the two branches can be summarized as follows: the trajectory features answer where the vehicle is about to go at a certain time, and the risk encoding features answer what exists at the location of that time point and its surroundings.

[0064] During cross-attention calculation, the trajectory features at a specific time point are used as the query, and their correlation with the risk coding features of each time point and each region is calculated separately. The higher the correlation, the greater the proportion of that risk coding feature in the attention update. Thus, each time point in the trajectory features is assigned the risk status of its location and surrounding area. This is equivalent to each time point on the trajectory actively searching for the presence of a target, whether it is occupied, and whether there are any discrepancies in judgment in its vicinity. This ensures that the trajectory correction judgment is based on the actual perception results recorded in the risk map, rather than from pre-set fixed rules.

[0065] The fused features are obtained by adding the trajectory features to the residuals of the attention update, rather than replacing the trajectory features with the attention update. This is because the initial trajectory is the result of the planning network's output based on shared features, and it already contains judgments about road structure, traffic rules, and the intentions of traffic participants. The attention update is only used to supplement the risk information indicated by perception discrepancies. Adding the residuals allows the introduction of risk information to manifest as a fine-tuning of the initial trajectory. When the target detection values, space occupancy values, and judgment discrepancy values ​​in each area are all low, the attention update approaches zero, the fused features are essentially consistent with the trajectory features, and the final planned trajectory is essentially consistent with the initial trajectory. This ensures that the trajectory correction module does not change the output of the planning network unnecessarily.

[0066] The fused features are mapped through a correction generation network to obtain trajectory correction values ​​at each time point on the initial trajectory. These correction values ​​include the lateral and longitudinal offsets at that time point. The correction generation network is, for example, a two-layer fully connected network, whose output dimension corresponds to the number of time points on the initial trajectory; that is, each time point yields a set of lateral and longitudinal offsets. The trajectory correction values ​​are then superimposed on the initial trajectory, meaning that each time point on the initial trajectory is shifted according to its corresponding offset to obtain the final planned trajectory. For example, if the correction generation network outputs a rightward lateral offset at a certain time point, the final planned trajectory will deviate to the right to avoid the risk area at that time point, and the vehicle will not need to replan the entire trajectory.

[0067] Figure 5 This is a schematic diagram of the training phase process provided in an embodiment of this application; see reference. Figure 5 As shown in the embodiment of this application, the above method further includes: pre-training the network used to implement the trajectory generation and correction method, specifically the training stage including the following steps S501-S509: S501. Obtain environmental perception data samples, and process the data samples through the detection network, the occupancy network and the planning network respectively to obtain the training detection map, the training occupancy map and the training initial trajectory.

[0068] The training samples used in the training phase include environmental perception data samples and their annotation information. The annotation information includes ground truth values ​​for object detection, ground truth values ​​for occupancy, and human driving trajectories. Following the same approach as in the operational phase, the training trajectory correction and the final planned trajectory are further derived from the training detection map, training occupancy map, and initial training trajectory. In other words, the definitions of the training detection map, training occupancy map, initial training trajectory, training trajectory correction, and final planned trajectory are the same as those in the operational phase; both are output instances of the same network on different data.

[0069] The trajectory correction process during the training phase is the same as that during the running phase, the only difference being that the inputs in this embodiment are the training detection map, the training occupancy map, and the initial training trajectory.

[0070] During the training phase, each network is first constrained by conventional task losses, including: detection task loss between training detection results and ground truth object detection, occupancy task loss between training occupancy map and ground truth occupancy map, and trajectory regression task loss between training initial trajectory and human driving trajectory.

[0071] S502. Using the training detection map as the supervision basis for the training occupancy map, calculate the first consistency loss; when performing backpropagation with the first consistency loss, by performing stopping gradient processing on the training detection map, the gradient of the loss only updates the parameters of the occupancy network. S503. Using the training occupancy map as the supervision basis for the training detection map, calculate the second consistency loss; when performing backpropagation with the second consistency loss, by performing stopping gradient processing on the training occupancy map, the gradient of the loss only updates the parameters of the detection network. S504. Compare the spatial units traversed by the initial training trajectory with the spatial units in the training detection map whose confidence level is higher than a preset value. When the two overlap, increase the third consistency loss. When backpropagating with the third consistency loss, update the parameters of the planning network only according to the gradient of the consistency loss. S505. Compare the spatial units traversed by the initial training trajectory with the spatial units in the training occupancy map whose occupancy level is higher than a preset value. When the two overlap, increase the fourth consistency loss. When backpropagating with the fourth consistency loss, update the parameters of the planning network only according to the gradient of the consistency loss. S506. The spatial units traversed by the initial training trajectory are compared with the spatial units in the training detection map and the training occupancy map that show discrepancies. When they overlap, the fifth consistency loss is increased. When backpropagating with the fifth consistency loss, the parameters of the planning network are updated only according to the gradient of the consistency loss.

[0072] All five consistency loss methods mentioned above employ unidirectional gradient backpropagation, meaning that only the supervised network is updated, and the graph used as the basis for supervision does not backpropagate gradients to its source network.

[0073] Figure 6 A schematic diagram illustrating the principle of training phase consistency loss calculation provided in this application embodiment; see reference Figure 6 As shown, the inputs during the training phase are the training detection map, the training occupancy map, and the initial training trajectory. These three are obtained by the detection network, the occupancy network, and the planning network respectively, based on the same environmental perception data sample. Figure 6 The first to fifth consistency losses, calculated from the above three factors, are listed one by one. Figure 6 The image below illustrates the objective achieved during the training phase through the aforementioned loss: to improve the consistency among the outputs of the detection network, occupancy network, and planning network.

[0074] The first consistency loss is trained on the occupancy graph under the supervision of the training detection graph, and its backpropagation only updates the parameters of the occupancy network; the second consistency loss is trained on the detection graph under the supervision of the training occupancy graph, and its backpropagation only updates the parameters of the detection network. The two losses supervise in opposite directions, jointly constraining the detection and occupancy perception results to corroborate each other in spatial semantics; and the gradient of each loss is only propagated back to the supervised side, while the side serving as the supervision basis does not receive gradients.

[0075] The third consistency loss is obtained by comparing the initial training trajectory with the training detection map; the fourth consistency loss is obtained by comparing the initial training trajectory with the training occupancy map; and the fifth consistency loss is obtained by comparing the initial training trajectory with the regions where discrepancies are identified in the training detection map and the training occupancy map. Backpropagation of all three losses only updates the parameters of the planning network. Figure 1 The side also does not receive gradients.

[0076] The first to fifth consistency losses, along with the detection task loss, occupancy task loss, and trajectory regression task loss, are weighted and summed to form the total loss, which is then backpropagated. Each consistency loss only updates the parameters of the network on the side that should converge. The detection network, occupancy network, and planning network are constrained by their respective task losses as well as by the consistency losses associated with them.

[0077] Each gradient path contributing to the consistency loss is restricted individually, preventing it from propagating its gradient back to the other side of the comparison. The reason for this is that if backpropagation were allowed, the supervised side could reduce the consistency loss by lowering the credibility of its output rather than improving its quality; superficial consistency would come at the expense of task accuracy. Figure 6 After the gradients are restricted one by one in the directions shown, the supervised side aligns with the supervised side. The side that serves as the basis for supervision is still only constrained by its own task loss. Thus, the consistency constraint and the accuracy of each task can be satisfied simultaneously.

[0078] The first consistency loss and the second consistency loss constrain the spatial semantics of detection and occupancy from two directions. For scenarios such as squatting pedestrians, fallen traffic cones, open car doors, and extended crane booms, after the occupancy network delineates the complete occupancy region, the constraints in these two directions can reduce missed detections or make the detection boxes more accurate. The unidirectional update during backpropagation avoids speculation: if the gradient of the first consistency loss also updates the detection network, the detection network can reduce this loss by moving the detection box, shrinking the detection box, or lowering the detection confidence, with apparent consistency at the expense of detection quality; the unidirectional update ensures that the supervised occupancy network aligns with the detection graph, while the detection network is only constrained by the detection task loss.

[0079] The preset value for the third consistency loss is, for example, 0.7 or 0.5. Only detection boxes with confidence levels higher than the preset value are used to generate the detection map for comparison, which avoids interference from false detections with low confidence levels on the planning training. The third consistency loss and the fourth consistency loss respectively constrain the initial training trajectory to avoid detection targets and occupied regions. The backpropagation of both only updates the planning network: if updating the detection network is allowed, the detection network will move, shrink, or lower the confidence level of the true target's box; if updating the occupancy network is allowed, the occupancy network will predict obstacles as empty.

[0080] The fifth consistency loss targets spatial units where detection and occupancy judgments diverge. These regions represent uncertainties or potential risks in the model, and the vehicle's planned trajectory should not aggressively traverse them. Backpropagation of this loss only updates the planning network; neither the training detection map nor the training occupancy map, which serve as the basis for conflict calculations, backpropagates gradients. This prevents the detection or occupancy network from evading planning risks by suppressing conflict values ​​(e.g., both outputting low values).

[0081] S507. Determine the training trajectory correction amount along the initial training trajectory, and superimpose the training trajectory correction amount onto the initial training trajectory to obtain the final training planned trajectory.

[0082] S508. The first consistency loss to the fifth consistency loss, together with the detection task loss, the occupation task loss and the trajectory regression task loss, are weighted and summed to obtain the total loss.

[0083] S509. Backpropagate using the total loss to update the parameters of the detection network, the occupancy network, and the planning network.

[0084] The weights of the various losses in the total loss can be set according to the principle of prioritizing task loss and supplementing it with consistency loss. For example, the weight of consistency loss can be 0.1 to 0.3 times the weight of the corresponding task loss. It should be noted that the above-mentioned consistency losses only exist in the training phase. No consistency loss is calculated during the actual operation phase of the vehicle, so it does not increase any inference latency.

[0085] Compared to existing technologies, current supervision schemes only constrain the category consistency between two perception tasks, failing to incorporate vehicle planning into the consistency constraint or utilize inconsistencies between perception tasks to correct the trajectory during the inference phase. In this application's embodiments, firstly, the consistency constraint covers detection, occupancy, and planning, and each loss statement uses unidirectional gradient backpropagation. The supervised party learns while the supervisor remains unchanged, preventing any branch from speculatively reducing consistency loss by lowering its own output quality—a mechanism that simple bidirectional constraints cannot replace. Secondly, the discrepancy between detection and occupancy is not only constrained and reduced during the training phase but is further used as a risk signal during the runtime phase. The same information is utilized in different ways in the two phases, greatly improving task accuracy.

[0086] In one embodiment of this application, the above training process further includes the following steps A10-A20: Step A10: Obtain the marked driving trajectory, and expand the driving trajectory to a preset range to obtain a planned relevant area, which represents the spatial range of the vehicle's planned driving.

[0087] Step A20: When calculating the first consistency loss to the fifth consistency loss, the weight of spatial units located within the planning-related area is greater than the weight of spatial units located outside the area.

[0088] The extended preset range is, for example, 1 meter, or 3 meters. Spatial weights can be implemented through a weight map: spatial units located within the relevant planning area are given a high weight (e.g., 1), while spatial units located outside the area are given a low weight or zero weight; the weight map can also be further determined in conjunction with effectively labeled areas, and consistency loss is not calculated in areas lacking effective labels.

[0089] The technical advantage of this embodiment is that if the consistency loss is calculated uniformly across the entire map, the spatial units near the vehicle's driving route only account for a small proportion of the entire map, and their signals will be diluted by a large area of ​​irrelevant regions. For example, when the vehicle is preparing to turn right, whether the detection and occupation hundreds of meters behind on the left are consistent has little impact on the current driving decision. By concentrating the weights on the planning-related regions, the training attention is focused on the spaces that are truly relevant to the driving decision, and the improvement in consistency directly affects the locations that influence driving safety; at the same time, resetting the weights outside the regions to zero also reduces invalid calculations.

[0090] In one embodiment of this application, the total loss during the training phase further includes correction magnitude loss and smoothing loss: The aforementioned correction magnitude loss is obtained by averaging the absolute values ​​of the training trajectory correction at each time point; The smoothing loss mentioned above is obtained by calculating the second difference of three adjacent trajectory points on the final planned trajectory of the training and averaging the absolute values. The second difference reflects the degree of change in the distance between adjacent trajectory points.

[0091] In this embodiment of the application, step S509 above, which updates the parameters of the detection network, the occupancy network, and the planning network using the total loss through backpropagation, specifically includes the following steps B10-B20: Step B10: Incorporate the correction magnitude loss into the total loss for backpropagation to limit the overall size of the training trajectory correction amount, and ensure that the final training planned trajectory is consistent with the initial training trajectory when the training trajectory correction amount is zero.

[0092] Step B20: Incorporate the smoothing loss into the total loss for backpropagation to suppress abrupt changes in the spacing between adjacent trajectory points on the final planned trajectory of the training.

[0093] In this embodiment, the correction magnitude loss is used to limit the overall size of the training trajectory correction. Without constraints, the trajectory correction module may output excessively large offsets, causing the final planned trajectory to deviate too far from the initial trajectory, even exceeding the boundaries of comfort and safety. Specifically, when the correction magnitude loss approaches zero and the training trajectory correction is zero, the final planned trajectory is consistent with the initial training trajectory. That is, the correction module does not correct unnecessarily; this fallback property ensures that the introduction of the correction module will not impair the original planning capability.

[0094] Smoothing loss is used to suppress abrupt changes in the spacing between adjacent trajectory points on the final planned trajectory. If the spacing between adjacent trajectory points on the final planned trajectory fluctuates wildly, it indicates abrupt changes in the trajectory. When the vehicle travels along this trajectory, it will experience jerking, resulting in poor comfort and potentially exceeding the actuator's tracking capability. Smoothing loss constrains the degree of variation in spacing, ensuring that the corrected trajectory remains smooth. The weights of the correction magnitude loss and smoothing loss in the total loss can be set to, for example, both 0.1, or the weight of the correction magnitude loss can be set to 0.3 and the weight of the smoothing loss to 0.1.

[0095] Therefore, in this embodiment, a series of loss functions are designed during the training phase to ensure that the output results of object detection, occupancy prediction, and vehicle planning tasks are as consistent as possible. These include consistency loss between object detection and occupancy prediction, consistency loss between vehicle planning and object detection, consistency loss between vehicle planning and occupancy prediction, and consistency loss between vehicle planning and detection-occupancy conflict regions. These constraints reduce discrepancies between the outputs of different tasks, lowering the learning difficulty for downstream vehicle planning. For example, for scenarios such as a crouching pedestrian, a fallen traffic cone, an open car door, an extended crane arm, or an overturned truck, where occupancy prediction reaches the complete occupancy area, consistency constraints can reduce missed detections in object detection or output more accurate detection boxes.

[0096] On the other hand, considering that inconsistent areas may be risky, this application further incorporates trajectory correction, using inconsistency information to modify the vehicle's initial trajectory and constrain the vehicle's planning to stay away from potentially high-risk areas. This method simultaneously utilizes object detection results, occupancy prediction results, and the vehicle's initial planned trajectory in the autonomous driving model. By constructing object detection result maps, occupancy prediction maps, and detection-occupancy conflict maps, it identifies potential risk areas near the vehicle's future trajectory and corrects the vehicle's initial trajectory based on this risk information, thereby improving the safety of the planned trajectory.

[0097] Therefore, compared to existing technologies, this application does not simply improve the accuracy of object detection or occupancy prediction, nor does it simply add collision loss. Instead, it utilizes the loss function between object detection and occupancy prediction to reduce inconsistencies in prediction results, and also uses the potential high-risk areas indicated by these inconsistencies to guide the correction of the vehicle's trajectory. When detection and occupancy prediction are consistent, the system can plan normally; when there is a significant conflict between the two near the vehicle's future path, the system treats the conflict area as a potential risk or uncertain area and conservatively corrects the vehicle's trajectory.

[0098] This application can significantly improve some challenging scenarios in autonomous driving, such as improving the accuracy of target detection boxes and enhancing the safety of vehicle planning in scenarios with open car doors and extended crane arms; and improving obstacle avoidance capabilities for scenarios with fallen cones, lying or crouching pedestrians / dummies, and rollover vehicles.

[0099] Reference Figure 8 As shown in the figure, this application embodiment also provides an autonomous driving trajectory generation device, including: The acquisition module 801 is used to acquire environmental perception data and discretize the space around the vehicle into multiple spatial units. The environmental perception data is then processed by a detection network, an occupancy network, and a planning network to obtain a detection map, an occupancy map, and an initial trajectory. The detection map represents the confidence level of a target detected at each spatial unit, the occupancy map represents the degree to which each spatial unit is occupied by an object, and the initial trajectory represents the vehicle's driving position at several future moments. The determining module 802 is used to determine a conflict map based on the degree of inconsistency between the detection map and the occupancy map, wherein the conflict map is used to characterize the degree of judgment error between the detection map and the occupancy map for the same spatial unit; The stitching module 803 is used to stitch the detection map, the occupancy map and the conflict map into a risk map, which is used to characterize the target detection status, space occupancy status and judgment of divergence status of each spatial unit around the vehicle. The sampling module 804 is used to sample the risk map in multiple preset regions along the initial trajectory to obtain multi-region risk features; The calculation module 805 is used to encode the initial trajectory and the multi-region risk features to obtain trajectory features and risk coding features respectively, perform cross-attention calculation with the trajectory features as the query and the risk coding features as the key and value, and obtain the trajectory correction amount by mapping the output of the cross-attention through the output layer. The correction module 806 is used to superimpose the trajectory correction amount onto the initial trajectory to obtain the final planned trajectory.

[0100] Optionally, the aforementioned determining module 802 is specifically used for: The detection map and the occupancy map are compared one by one according to spatial units, and the absolute value of the difference between the two values ​​is calculated. Spatial cells with an absolute difference greater than a preset threshold retain their original values, while the remaining spatial cells are set to zero to obtain the conflict map; wherein, the spatial cells in the conflict map that take non-zero values ​​are the spatial cells in which the detection map and the occupancy map are judged to be divergent.

[0101] Optionally, the above-mentioned splicing module 803 is specifically used for: The detection map, the occupancy map, and the conflict map are used as the first input channel, the second input channel, and the third input channel, respectively, and then spliced ​​together to form the risk map with three input channels; Each spatial unit in the risk graph simultaneously records the target detection value, space occupancy value, and decision disagreement value for that spatial unit. These three values ​​are independently stored in their respective input channels, representing the target detection dimension, space occupancy dimension, and decision disagreement dimension, respectively.

[0102] Optionally, the above-mentioned splicing module 803 is also used for: The preset multiple regions include the front region, rear region, left front region, right front region, left rear region and right rear region, which are divided according to preset azimuth angles with the geometric center of the vehicle as the center, as well as the overall vehicle body region formed by the shape of the vehicle. At each time point along the initial trajectory, the target detection value, space occupancy value, and judgment disagreement value of the spatial unit where each region is located are obtained in the risk map, which serve as the multi-region risk features.

[0103] Optionally, the above-mentioned splicing module 803 is also used for: The positions of each time point on the initial trajectory are mapped to the coordinate system of the risk map to obtain the sampling positions on the risk map, and the spatial units around the sampling positions are determined. Based on the distance from the sampling position to the center position of each surrounding spatial unit, the weight of each surrounding spatial unit is determined. The smaller the distance, the greater the weight, and the sum of all weights is 1. For each surrounding spatial unit, the target detection value, space occupancy value, and decision divergence value of that spatial unit are weighted and summed to obtain the target detection sample value, space occupancy sample value, and decision divergence sample value at the sampling location.

[0104] Optionally, the above-mentioned device further includes a training module (not shown in the figure), specifically used for: Acquire environmental perception data samples, and process the data samples through the detection network, the occupancy network and the planning network respectively to obtain a training detection map, a training occupancy map and a training initial trajectory; Using the training detection map as the supervision basis for the training occupancy map, a first consistency loss is calculated; during backpropagation using the first consistency loss, a stopping gradient processing is performed on the training detection map so that the gradient of the loss only updates the parameters of the occupancy network; Using the training occupancy map as the supervision basis for the training detection map, a second consistency loss is calculated; during backpropagation using the second consistency loss, a stopping gradient processing is performed on the training occupancy map so that the gradient of the loss only updates the parameters of the detection network. The spatial cells traversed by the initial training trajectory are compared with the spatial cells in the training detection map whose confidence level is higher than a preset value. When the two overlap, the third consistency loss is increased. When backpropagating with the third consistency loss, the parameters of the planning network are updated only according to the gradient of the consistency loss. The spatial units traversed by the initial training trajectory are compared with the spatial units in the training occupancy map whose occupancy level is higher than a preset value. When the two overlap, the fourth consistency loss is increased. When backpropagating with the fourth consistency loss, the parameters of the planning network are updated only according to the gradient of the consistency loss. The spatial units traversed by the initial training trajectory are compared with the spatial units in the training detection map and the training occupancy map where discrepancies occur. When they overlap, the fifth consistency loss is increased. When backpropagating with the fifth consistency loss, the parameters of the planning network are updated only based on the gradient of the consistency loss. Determine the training trajectory correction amount along the initial training trajectory, and superimpose the training trajectory correction amount onto the initial training trajectory to obtain the final training planned trajectory; The first consistency loss to the fifth consistency loss, together with the detection task loss, the occupation task loss and the trajectory regression task loss, are weighted and summed to obtain the total loss; The parameters of the detection network, the occupancy network, and the planning network are updated by backpropagation using the total loss.

[0105] Optionally, the training module described above (not shown in the figure) is also used for: Obtain the marked driving trajectory, and expand the driving trajectory to a preset range to obtain a planned relevant area, which represents the spatial range of the vehicle's planned driving. When calculating the first consistency loss to the fifth consistency loss, the weight of spatial units located within the planning-related area is greater than the weight of spatial units located outside the area.

[0106] Optionally, the total loss may further include correction magnitude loss and smoothing loss: The correction magnitude loss is obtained by averaging the absolute values ​​of the training trajectory correction amount at each time point; The smoothing loss is obtained by calculating the second difference of three adjacent trajectory points on the final planned trajectory of the training and averaging the absolute values. The second difference reflects the degree of change in the distance between adjacent trajectory points. The aforementioned training module (not shown in the figure) is also used for: The correction magnitude loss is incorporated into the total loss for backpropagation to limit the overall size of the training trajectory correction amount, and to make the final training planned trajectory consistent with the initial training trajectory when the training trajectory correction amount is zero. The smoothing loss is incorporated into the total loss for backpropagation to suppress abrupt changes in the spacing between adjacent trajectory points on the final planned trajectory of the training.

[0107] One embodiment of this application also includes a vehicle, comprising a vehicle body and electronic equipment, such as... Figure 9 As shown, the electronic device includes a processor 111, a communication interface 112, a memory 113, and a communication bus 114, wherein the processor 111, the communication interface 112, and the memory 113 communicate with each other through the communication bus. Memory 113 is used to store computer programs; The processor 111 is used to execute a program stored in the memory to implement the autonomous driving trajectory generation method as described in any of the above method embodiments.

[0108] This application also provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the steps of the autonomous driving trajectory generation method provided in any of the foregoing method embodiments.

[0109] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.

[0110] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented using software plus a general-purpose hardware platform, or of course, using hardware. Based on this understanding, the above technical solutions, in essence or the parts that contribute to the related technology, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.

[0111] It should be understood that the terminology used herein is for the purpose of describing particular exemplary embodiments only and is not intended to be limiting. Unless the context clearly indicates otherwise, the singular forms “a,” “an,” and “described” as used herein may also include the plural forms. The terms “comprising,” “including,” “containing,” and “having” are inclusive and therefore indicate the presence of the stated features, steps, operations, elements, and / or components, but do not exclude the presence or addition of one or more other features, steps, operations, elements, components, and / or combinations thereof. The method steps, processes, and operations described herein are not construed as requiring them to be performed in a particular order described or illustrated unless the order of performance is explicitly indicated. It should also be understood that additional or alternative steps may be used.

[0112] The above description is merely a specific embodiment of the present invention, enabling those skilled in the art to understand or implement the invention. 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 the invention. Therefore, the present invention 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 claimed herein.

Claims

1. A method for generating autonomous driving trajectories, characterized in that, The method includes: The system acquires environmental perception data and discretizes the space around the vehicle into multiple spatial units. The environmental perception data is then processed by a detection network, an occupancy network, and a planning network to obtain a detection map, an occupancy map, and an initial trajectory. A conflict map is determined based on the degree of inconsistency between the detection map and the occupancy map. The conflict map is used to characterize the degree of error in the judgment of the same spatial unit by the detection map and the occupancy map. The detection map, the occupancy map, and the conflict map are combined to form a risk map, which is used to characterize the target detection status, space occupancy status, and judgment disagreement status of each spatial unit around the vehicle. The risk map is sampled in multiple preset regions along the initial trajectory to obtain multi-region risk features; The initial trajectory and the multi-region risk features are encoded to obtain trajectory features and risk coding features respectively. Cross attention is calculated using the trajectory features as the query and the risk coding features as the key and value. The trajectory correction amount is obtained by mapping the output of the cross attention through the output layer. The trajectory correction is superimposed on the initial trajectory to obtain the final planned trajectory.

2. The method according to claim 1, characterized in that, The step of determining the conflict map based on the degree of inconsistency between the detection map and the occupancy map includes: The detection map and the occupancy map are compared one by one according to spatial units, and the absolute value of the difference between the two values ​​is calculated. Spatial cells with an absolute difference greater than a preset threshold retain their original values, while the remaining spatial cells are set to zero to obtain the conflict map; wherein, the spatial cells in the conflict map that take non-zero values ​​are the spatial cells in which the detection map and the occupancy map are judged to be divergent.

3. The method according to claim 1, characterized in that, The step of concatenating the detection map, the occupancy map, and the conflict map into a risk map includes: The detection map, the occupancy map, and the conflict map are used as the first input channel, the second input channel, and the third input channel, respectively, and then spliced ​​together to form the risk map with three input channels; Each spatial unit in the risk graph simultaneously records the target detection value, space occupancy value, and decision disagreement value for that spatial unit. These three values ​​are independently stored in their respective input channels, corresponding to the target detection dimension, space occupancy dimension, and decision disagreement dimension, respectively.

4. The method according to claim 3, characterized in that, The risk map is sampled along the initial trajectory in multiple preset regions to obtain multi-region risk features, including: The preset multiple regions include the front region, rear region, left front region, right front region, left rear region and right rear region, which are divided according to preset azimuth angles with the geometric center of the vehicle as the center, as well as the overall vehicle body region formed by the shape of the vehicle. At each time point along the initial trajectory, the target detection value, space occupancy value, and judgment disagreement value of the spatial unit where each region is located are obtained in the risk map, which serve as the multi-region risk features.

5. The method according to claim 4, characterized in that, At each time point along the initial trajectory, the target detection value, space occupancy value, and judgment divergence value of the spatial unit where each region is located are obtained in the risk map, including: The positions of each time point on the initial trajectory are mapped to the coordinate system of the risk map to obtain the sampling positions on the risk map, and the spatial units around the sampling positions are determined. Based on the distance from the sampling position to the center position of each surrounding spatial unit, the weight of each surrounding spatial unit is determined. The smaller the distance, the greater the weight, and the sum of all weights is 1. For each surrounding spatial unit, the target detection value, space occupancy value, and decision divergence value of that spatial unit are weighted and summed to obtain the target detection sample value, space occupancy sample value, and decision divergence sample value at the sampling location.

6. The method according to claim 1, characterized in that, The method further includes: The network used to implement the trajectory generation and correction method is pre-trained, and the training process includes: Acquire environmental perception data samples, and process the data samples through the detection network, the occupancy network and the planning network respectively to obtain a training detection map, a training occupancy map and a training initial trajectory; Using the training detection map as the supervision basis for the training occupancy map, a first consistency loss is calculated; during backpropagation using the first consistency loss, a stopping gradient processing is performed on the training detection map so that the gradient of the loss only updates the parameters of the occupancy network; Using the training occupancy map as the supervision basis for the training detection map, a second consistency loss is calculated; during backpropagation using the second consistency loss, a stopping gradient processing is performed on the training occupancy map so that the gradient of the loss only updates the parameters of the detection network. The spatial cells traversed by the initial training trajectory are compared with the spatial cells in the training detection map whose confidence level is higher than a preset value. When the two overlap, the third consistency loss is increased. When backpropagating with the third consistency loss, the parameters of the planning network are updated only according to the gradient of the consistency loss. The spatial units traversed by the initial training trajectory are compared with the spatial units in the training occupancy map whose occupancy level is higher than a preset value. When the two overlap, the fourth consistency loss is increased. When backpropagating with the fourth consistency loss, the parameters of the planning network are updated only according to the gradient of the consistency loss. The spatial units traversed by the initial training trajectory are compared with the spatial units in the training detection map and the training occupancy map where discrepancies occur. When they overlap, the fifth consistency loss is increased. When backpropagating with the fifth consistency loss, the parameters of the planning network are updated only based on the gradient of the consistency loss. Determine the training trajectory correction amount along the initial training trajectory, and superimpose the training trajectory correction amount onto the initial training trajectory to obtain the final training planned trajectory; The first consistency loss to the fifth consistency loss, together with the detection task loss, the occupation task loss and the trajectory regression task loss, are weighted and summed to obtain the total loss; The parameters of the detection network, the occupancy network, and the planning network are updated by backpropagation using the total loss.

7. The method according to claim 6, characterized in that, The training process also includes: Obtain the marked driving trajectory, and expand the driving trajectory to a preset range to obtain a planned relevant area, which represents the spatial range of the vehicle's planned driving. When calculating the first consistency loss to the fifth consistency loss, the weight of spatial units located within the planning-related area is greater than the weight of spatial units located outside the area.

8. The method according to claim 6, characterized in that, The total loss also includes correction magnitude loss and smoothing loss: The correction magnitude loss is obtained by averaging the absolute values ​​of the training trajectory correction amount at each time point; The smoothing loss is obtained by calculating the second difference of three adjacent trajectory points on the final planned trajectory of the training and averaging the absolute values. The second difference reflects the degree of change in the distance between adjacent trajectory points. The step of backpropagating the total loss to update the parameters of the detection network, the occupancy network, and the planning network further includes: The correction magnitude loss is incorporated into the total loss for backpropagation to limit the overall size of the training trajectory correction amount, and to make the final training planned trajectory consistent with the initial training trajectory when the training trajectory correction amount is zero. The smoothing loss is incorporated into the total loss for backpropagation to suppress abrupt changes in the spacing between adjacent trajectory points on the final planned trajectory of the training.

9. An autonomous driving trajectory generation device, characterized in that, include: The acquisition module is used to acquire environmental perception data and discretize the space around the vehicle into multiple spatial units. The environmental perception data is then processed by a detection network, an occupancy network, and a planning network to obtain a detection map, an occupancy map, and an initial trajectory. The determination module is used to determine a conflict map based on the degree of inconsistency between the detection map and the occupancy map, wherein the conflict map is used to characterize the degree of judgment error between the detection map and the occupancy map for the same spatial unit; The stitching module is used to stitch the detection map, the occupancy map and the conflict map into a risk map, which is used to characterize the target detection status, space occupancy status and judgment of discrepancies in each spatial unit around the vehicle. The sampling module is used to sample the risk map in multiple preset areas along the initial trajectory to obtain multi-area risk features; The calculation module is used to encode the initial trajectory and the multi-region risk features to obtain trajectory features and risk coding features respectively, perform cross-attention calculation with the trajectory features as the query and the risk coding features as the key and value, and obtain the trajectory correction amount by mapping the output of the cross-attention through the output layer. The correction module is used to superimpose the trajectory correction amount onto the initial trajectory to obtain the final planned trajectory.

10. A vehicle, characterized in that, It includes a vehicle body and electronic devices, wherein the electronic devices include a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus; Memory, used to store computer programs; When a processor executes a program stored in memory, it implements the autonomous driving trajectory generation method as described in any one of claims 1-8.