Vehicle map decoding model training method, map decoding method, device and autonomous vehicle

By calculating the point matching results and geometric errors in the map decoding model and generating an additional penalty term, the problem of deviation between the feature representation of each layer and the predicted target in the existing technology is solved, thereby improving the prediction accuracy and positioning reliability of the map decoding model.

CN123135083APending Publication Date: 2026-11-20上海易博图科技有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611601425.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-10-15
Publication Date
2026-11-20

AI Technical Summary

Technical Problem

In existing map decoding model training methods, there is a discrepancy between the feature representations learned by each layer and the final prediction target, resulting in low prediction accuracy.

Method used

By acquiring road environment data and ground truth points collected by vehicle sensors, feature encoding and prediction are performed using a map decoder with multiple decoding layers. Point matching results and geometric errors are calculated, additional penalty terms are generated, the total training loss is constructed, and the parameters of the map decoding model are updated.

Benefits of technology

This improves the positioning accuracy and reliability of the map decoding model when generating or updating road environment maps, ensuring the consistency and accuracy of error assessment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123135083A_ABST
    Figure CN123135083A_ABST
Patent Text Reader

Abstract

The application provides a map decoding model training method and device of a vehicle, a map decoding method and an autonomous vehicle, and is applied to the field of autonomous driving, for example, unmanned driving, autonomous driving, unmanned vehicle and the like. The method comprises the following steps: inputting spatial features of observation data into a map decoding model; matching a predicted point column output by a last decoding layer with a true value point column to obtain a point column matching result; calculating, based on the point column matching result, a geometric error of a predicted point column of a previous decoding layer relative to the true value point column as a prediction error; in the case that the prediction error of the previous decoding layer is less than a preset error threshold, generating an additional penalty term based on the predicted point column of the current decoding layer, the predicted point column of the previous decoding layer and the true value point column; determining a cumulative loss of the map decoding model based on the predicted point column output by each decoding layer and the true value point column; constructing a total training loss based on the additional penalty term and the cumulative loss, and updating the map decoding model based on the total training loss.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of autonomous driving, and more specifically to a method for training a map decoding model for a vehicle, a map decoding method, a device, and an autonomous vehicle. Background Technology

[0002] In autonomous driving systems, vehicles need to generate or update road maps in real time based on road elements collected by sensors to support environmental perception and path planning. Existing map decoding models typically employ a neural network structure with multiple decoding layers, processing layer by layer to progressively extract and refine the location information of road elements.

[0003] However, training methods for multi-layer map decoding models in related technologies typically only use the prediction results of the final output layer of the model and the ground truth to calculate the loss and perform backpropagation, or calculate the loss of each decoding layer independently and simply sum them. This training method leads to a discrepancy between the feature representations learned by each layer of the model and the final prediction target, resulting in low prediction accuracy of the map decoding model. Summary of the Invention

[0004] In view of the above problems, embodiments of this application provide a method for training a map decoding model for a vehicle, a map decoding method, an apparatus, and an autonomous vehicle.

[0005] According to a first aspect of this application, a method for training a map decoding model for a vehicle is provided, comprising:

[0006] The process involves acquiring observational data of the road environment collected by vehicle sensors and the ground truth point sequence of road elements corresponding to the observational data; inputting the spatial features obtained by feature encoding of the observational data into a map decoder comprising multiple decoding layers to obtain the predicted point sequence of road elements output by each decoding layer; matching the predicted point sequence output by the last decoding layer with the ground truth point sequence to obtain the point sequence matching result, which represents the correspondence between the predicted point sequence and the ground truth point sequence; and for each decoding layer except the first decoding layer, calculating the predicted point sequence relative to the ground truth point sequence of the previous decoding layer based on the point sequence matching result. The geometric error is used as the prediction error of the previous decoding layer. If the prediction error of the previous decoding layer is less than the preset error threshold, an additional penalty term is generated based on the prediction point sequence of the current decoding layer, the prediction point sequence of the previous decoding layer, and the ground truth point sequence. Based on the prediction point sequence and ground truth point sequence output by each decoding layer, the cumulative loss of the map decoding model is determined. The total training loss is constructed based on the additional penalty term and the cumulative loss, and the model parameters of the map decoding model are updated based on the total training loss to obtain the trained map decoding model. The trained map decoding model is used to generate or update the vector map of the road environment where the target vehicle is located.

[0007] According to an embodiment of this application, matching the predicted point sequence output by the last decoding layer among multiple decoding layers with the ground truth point sequence to obtain a point sequence matching result includes: determining an instance correspondence between each predicted point sequence and the ground truth point sequence based on the matching of the predicted point sequence output by the last decoding layer among multiple decoding layers; determining a point order correspondence between each predicted point in the predicted point sequence and each ground truth point in the ground truth point sequence in the instance correspondence; and establishing a point sequence matching result between the predicted point sequence output by each decoding layer and the ground truth point sequence based on the instance correspondence and the point order correspondence.

[0008] According to an embodiment of this application, based on the point matching result, the geometric error of the predicted point sequence of the previous decoding layer relative to the ground truth point sequence is calculated as the prediction error of the previous decoding layer, including: based on the point matching result, determining multiple corresponding point pairs between the predicted point sequence of the previous decoding layer and the corresponding ground truth point sequence, each corresponding point pair including a predicted point of the previous decoding layer and a corresponding ground truth point; determining the geometric error of each corresponding point pair based on the geometric distance between each corresponding point pair; and averaging the geometric errors of all corresponding point pairs to obtain the prediction error of the previous decoding layer.

[0009] According to an embodiment of this application, the additional penalty term includes: a displacement penalty term; generating the additional penalty term based on the predicted point sequence of the current decoding layer, the predicted point sequence of the previous decoding layer, and the ground truth point sequence includes: determining a first correspondence between the predicted point sequence of the current decoding layer and the predicted point sequence of the previous decoding layer based on the point sequence matching result; determining the displacement distance between each predicted point in the predicted point sequence of the current decoding layer and the corresponding predicted point in the previous decoding layer based on the first correspondence; averaging the displacement distance of each predicted point to obtain the average displacement of the current decoding layer relative to the previous decoding layer; calculating the difference between the average displacement and a preset allowable displacement threshold, taking the larger value between the difference and zero to obtain the displacement excess, and squaring the displacement excess to construct the displacement penalty term.

[0010] According to an embodiment of this application, determining the displacement distance between each predicted point in the current decoding layer prediction point column and the corresponding predicted point in the previous decoding layer based on the first correspondence relationship includes: determining the prediction point column of the previous decoding layer and performing gradient blocking on the prediction point column of the previous decoding layer to obtain the previous layer reference point column of the previous decoding layer; and determining the displacement distance between each predicted point in the current decoding layer prediction point column and the corresponding predicted point in the previous layer reference point column based on the first correspondence relationship.

[0011] According to an embodiment of this application, the additional penalty term further includes: an error penalty term; generating the additional penalty term based on the predicted point sequence of the current decoding layer, the predicted point sequence of the previous decoding layer, and the ground truth point sequence, including: determining a second correspondence between the predicted point sequence and the ground truth point sequence of the current decoding layer based on the point sequence matching result; determining the geometric distance between each predicted point in the predicted point sequence of the current decoding layer and the corresponding ground truth point in the ground truth point sequence based on the second correspondence; averaging the geometric distance of each predicted point to obtain the average ground truth error of the current decoding layer relative to the ground truth point sequence; determining the sum of the predicted error of the previous decoding layer that stopped the gradient and a preset error margin to obtain an error threshold; calculating the difference between the average ground truth error and the error threshold, taking the larger value between the difference and zero to obtain the error excess, and squaring the error excess to construct the error penalty term.

[0012] According to an embodiment of this application, the cumulative loss of the map decoding model is determined based on the predicted point series and ground truth point series output by each decoding layer, including: determining the correspondence between the predicted point series and the ground truth point series of each decoding layer based on the point series matching results; determining the geometric loss of matched instances with effective geometric supervision in each decoding layer based on the correspondence, and determining the classification loss of matched queries and unmatched queries with effective classification supervision in each decoding layer; determining the basic loss of each decoding layer based on the geometric loss, the classification loss, and other applicable supervision losses; and weighted summing the basic losses of all decoding layers to obtain the cumulative loss of the map decoding model.

[0013] According to a second aspect of this application, a vehicle map decoding method is provided, comprising: acquiring road elements to be processed, wherein the road elements are road environment data collected by vehicle sensors of a target vehicle; and performing forward propagation decoding on the road elements using a map decoding model to obtain a predicted point sequence corresponding to the road elements in the road map loaded by the target vehicle, wherein the map decoding model is trained according to the aforementioned vehicle map decoding model training method.

[0014] According to a third aspect of this application, a vehicle map decoding model training apparatus is provided, comprising: an acquisition module for acquiring road elements in the environment of a target vehicle collected by vehicle sensors and ground truth point sequences corresponding to the road elements in a road map loaded by the target vehicle; a propagation module for inputting the road elements into a map decoding model including multiple decoding layers for forward propagation to obtain predicted point sequences of road elements output by each decoding layer; a matching module for matching the predicted point sequences output by the last decoding layer among the multiple decoding layers with the ground truth point sequences to obtain point sequence matching results, the point sequence matching results being used to represent the correspondence between the predicted point sequences and the ground truth point sequences; and an error module for, for each decoding layer except the first decoding layer, based on... The point matching results are used to calculate the geometric error of the predicted point sequence of the previous decoding layer relative to the ground truth point sequence, which is taken as the prediction error of the previous decoding layer. The penalty module is used to generate an additional penalty term based on the predicted point sequence of the current decoding layer, the predicted point sequence of the previous decoding layer, and the ground truth point sequence, provided that the prediction error of the previous decoding layer is less than a preset error threshold. The loss module is used to determine the cumulative loss of the map decoding model based on the predicted point sequence and the ground truth point sequence output by each decoding layer. The update module is used to construct the total training loss based on the additional penalty term and the cumulative loss, and to update the model parameters of the map decoding model based on the total training loss, thereby obtaining the trained map decoding model. The trained map decoding model is used to update the road map of the environment in which the target vehicle is located.

[0015] According to a fourth aspect of this application, a computer-readable storage medium is also provided, on which a computer program or instructions are stored, wherein the computer program or instructions, when executed by a processor, implement the steps of the above-described method.

[0016] According to a fifth aspect of this application, an autonomous driving vehicle is also provided, including vehicle sensors and an on-board processor; the vehicle sensors are used to collect observation data of the road environment, and the on-board processor is used to execute the map decoding method of the vehicle and generate a predicted list of road elements using a trained map decoding model.

[0017] This application's embodiments acquire observational data of the road environment collected by vehicle sensors and ground truth points of road elements corresponding to the observational data, providing accurate supervision signals for model training. The spatial features obtained by feature encoding of the observational data are input into a map decoder comprising multiple decoding layers, and the predicted point sequences of each layer are output, realizing multi-level feature extraction and location prediction of road elements. The predicted point sequences of the last decoding layer are matched with the ground truth point sequences to obtain point sequence matching results, establishing a unified geometric error calculation benchmark for each decoding layer, ensuring the consistency and accuracy of error assessment. Based on this matching result, the prediction error of the previous decoding layer for each decoding layer (excluding the first decoding layer) is calculated, aligning the optimization objective of the intermediate layers with the final output layer. When the prediction error of the previous decoding layer is less than a preset error threshold, an additional penalty term is generated to constrain the predicted point sequences and ground truth point sequences of the current and previous decoding layers, prompting the model to learn more refined feature representations. The cumulative loss is determined based on the predicted point sequences and ground truth point sequences of each layer, and combined with the additional penalty term to construct the total training loss to update the model parameters, enabling the trained map decoding model to have higher positioning accuracy and reliability when generating or updating vector maps of the road environment where the target vehicle is located. Attached Figure Description

[0018] The above-mentioned contents, other objects, features and advantages of this application will become clearer from the following description of embodiments with reference to the accompanying drawings, in which:

[0019] Figure 1 The illustration shows an application scenario of the vehicle map decoding model training method according to an embodiment of this application.

[0020] Figure 2 A flowchart illustrating a method for training a map decoding model for a vehicle according to an embodiment of this application is shown.

[0021] Figure 3 The schematic diagram illustrates the calculation relationship of the front reference stopping gradient according to an embodiment of this application.

[0022] Figure 4 The schematic diagram illustrates the principle of a vehicle map decoding model training method according to an embodiment of this application.

[0023] Figure 5 The schematic diagram illustrates two cases: front-layer calibration and front-layer miscalibration, according to embodiments of this application.

[0024] Figure 6 A flowchart illustrating a map decoding method for a vehicle according to an embodiment of this application is shown schematically.

[0025] Figure 7 A schematic block diagram of a vehicle map decoding model training device according to an embodiment of this application is shown. Detailed Implementation

[0026] The embodiments of this application will now be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of this application. In the following detailed description, numerous specific details are set forth to provide a thorough understanding of the embodiments of this application for ease of explanation. However, it will be apparent that one or more embodiments may be implemented without these specific details. Furthermore, descriptions of well-known structures and technologies are omitted in the following description to avoid unnecessarily obscuring the concepts of this application.

[0027] The terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the scope of this application. The terms “comprising,” “including,” etc., as used herein indicate the presence of features, steps, operations, and / or components, but do not exclude the presence or addition of one or more other features, steps, operations, or components.

[0028] All terms used herein (including technical and scientific terms) have the meanings commonly understood by those skilled in the art, unless otherwise defined. It should be noted that the terms used herein are to be interpreted in a manner consistent with the context of this specification, and not in an idealized or overly rigid way.

[0029] Figure 1 The illustration shows an application scenario of the vehicle map decoding model training method according to an embodiment of this application.

[0030] like Figure 1 As shown, application scenario 100 according to an embodiment of this application may include an autonomous vehicle 101 and a controller 102. The autonomous vehicle 101 and the controller 102 can establish a communication connection via a network 103. The network 103 may be, for example, a controller local area network bus, an in-vehicle Ethernet, etc.

[0031] The autonomous vehicle 101 can be a passenger car, commercial vehicle, or other vehicle with autonomous driving capabilities. Passenger cars can include sedans, sport utility vehicles (SUVs), etc., while commercial vehicles can include driverless taxis, driverless buses, driverless trucks, etc. The autonomous vehicle 101 can be equipped with various sensors (such as cameras, lidar, millimeter-wave radar, ultrasonic radar, and positioning inertial navigation systems) to collect information about the surrounding environment and the vehicle's own status.

[0032] The controller 102 can be a computing device that provides autonomous driving decision-making and planning functions, such as an electronic control unit, an autonomous driving domain controller, or a vehicle control domain controller. The controller 102 can be a physical controller that is an independent peripheral, an on-board controller integrated within the autonomous vehicle 101, or a distributed control system composed of multiple controllers. The controller 102 can interact with the sensors, actuators, etc., of the autonomous vehicle 101 via the network 103 to receive sensor data and send control commands to the actuators. The controller 102 is used to execute the vehicle map decoding model training method provided in the embodiments of this application.

[0033] It should be understood that Figure 1 The number of autonomous vehicles and controllers shown is merely illustrative. Depending on the implementation requirements, there can be any number of autonomous vehicles and controllers, such as a fleet of multiple autonomous vehicles or a redundant computing platform consisting of multiple controllers.

[0034] This application belongs to the field of online vector map model training for autonomous driving, and involves conditional inter-layer supervision of road polylines such as lane lines, center lines, and curbs generated by multi-layer map decoders. The model reads spatial features generated by vehicle sensors, uses multiple queries to predict road element point sequences layer by layer, and finally outputs a vector map for vehicle environmental understanding and planning.

[0035] In an iterative decoder, the geometric position of the previous layer serves as a sampling reference for the next layer. The next layer needs to correct larger errors in the previous layer while also preserving the already accurate road structure. Typically, each layer receives regression supervision relative to the ground truth, but this supervision doesn't explicitly distinguish between situations requiring significant error correction and those where accurate geometry should be preserved. Therefore, the same curve might be close to the ground truth in the previous layer but deviate after being updated by the next layer; or it might simply be due to inconsistencies in the inter-layer sequence or matching objects, leading to a mistaken perception of a geometric jump.

[0036] However, unconditionally restricting the inter-layer displacement of all curves may hinder subsequent layers from significantly correcting erroneous predictions from previous layers. Furthermore, for road instances where only some points are valid, the road is truncated, or lacks reliable labeling, directly calculating inter-layer constraints on the complete point sequence may introduce erroneous gradients. Therefore, this application determines whether to apply additional refinement constraints based on the matched geometric error, ensuring that the constraints are concentrated on curves with reliable supervision and already relatively accurate previous layers.

[0037] Figure 2 A flowchart illustrating a vehicle map decoding model training method according to an embodiment of this application is shown schematically. Figure 2 As shown, the vehicle map decoding model training method 200 according to an embodiment of this application may include steps S210 to S270.

[0038] Step S210: Obtain the observation data of the road environment collected by the vehicle sensor and the ground truth point sequence of the road elements corresponding to the observation data.

[0039] In this embodiment, the target vehicle can be an intelligent car equipped with autonomous driving or assisted driving functions. Vehicle sensors may include cameras, lidar, millimeter-wave radar, etc., for collecting environmental data around the target vehicle.

[0040] The training samples for the map decoding model can include observation data of the road environment collected by vehicle sensors (as training data) and ground truth points of the road elements corresponding to the observation data (as labels).

[0041] Road elements refer to structured information in a road scene, such as lane lines, road center lines, and curbs. These elements are usually represented as vector polylines in a map.

[0042] During the model training phase, sensor data for the current frame is acquired and processed by a feature encoder to obtain the spatial features of road elements for input to the map decoding model. Simultaneously, the corresponding ground truth points need to be obtained. These ground truth points originate from the labeled data in the road map (such as a high-precision map) loaded by the target vehicle, or are generated manually.

[0043] For each road element, its ground truth point sequence consists of multiple two-dimensional or three-dimensional coordinate points sampled along the direction of the element according to certain rules, and each point has a fixed index order. For example, the ground truth point sequence of a lane line can be represented as {(x1,y1),(x2,y2),...,(xP,yP)}, where P is the preset number of target points. In addition, the ground truth data can also include information such as point supervision weights and instance supervision labels to indicate whether the point is valid or truncated.

[0044] Step S220: Input the spatial features obtained by feature encoding of the observation data into a map decoder including multiple decoding layers to obtain the predicted point list of road elements output by each decoding layer.

[0045] In this embodiment, the map decoding model is a neural network model for online vector map generation. Its decoder portion comprises multiple cascaded decoding layers (e.g., a three-layer structure of L0, L1, and L2). Each decoding layer receives the output or initial query from the previous layer and outputs an updated list of road element points. The model inputs spatial features obtained by feature encoding from the observed data and performs predictions layer by layer through multiple queries. Each query outputs a two-dimensional list of target points P, i.e., the predicted list of points, at each decoding layer.

[0046] For example, the first decoding layer (L0) outputs a preliminary prediction result, and subsequent decoding layers (L1, L2) refine the prediction results with reference to the prediction positions of the previous layer, outputting a more accurate prediction point sequence. After forward propagation is completed, the prediction point sequences corresponding to each decoding layer from the first to the last can be obtained.

[0047] Step S230: Match the predicted point sequence output by the last decoding layer among multiple decoding layers with the true point sequence to obtain the point sequence matching result.

[0048] The point matching result is used to represent the correspondence between the predicted point series and the true point series.

[0049] In this embodiment of the application, a shared matching mechanism is adopted to avoid changes in the comparison object caused by independent matching of different decoding layers.

[0050] Specifically, the predicted point series output from the final decoding layer is matched with the ground truth point series. The matching process can employ a bipartite graph matching algorithm, using the geometric distance and / or classification confidence between the predicted point series and the ground truth point series as the cost matrix to establish the correspondence between the predicted point series and the ground truth point series.

[0051] After a successful match, the correspondence between the predicted point sequence and the ground truth point sequence, as well as the point order correspondence between each predicted point and the ground truth point, are determined. This point sequence matching result will be shared with all decoding layers within this training sample, ensuring that when calculating inter-layer errors, each layer compares the same road instance and the same target point order.

[0052] Step S240: For each decoding layer except the first decoding layer, calculate the geometric error of the predicted point sequence of the previous decoding layer relative to the true point sequence based on the point sequence matching result, and use it as the prediction error of the previous decoding layer.

[0053] In this embodiment, for the second decoding layer and subsequent decoding layers, it is necessary to evaluate the prediction quality of the previous decoding layer. Based on the shared point sequence matching result obtained in step S230, the correspondence between the predicted point sequence of the previous decoding layer and each point in the corresponding ground truth point sequence can be determined.

[0054] At each valid pair of corresponding points (i.e., points with finite coordinates and a supervision weight greater than 0), the geometric distance (e.g., 2D Euclidean distance) between each pair of corresponding points is calculated. Then, the average geometric distance of all valid point pairs is calculated to obtain the average geometric error of the previous decoding layer relative to the ground truth point sequence, which is used as the prediction error of the previous decoding layer. This prediction error reflects the accuracy of the previous layer's prediction.

[0055] During computation, the predicted point sequence of the previous decoding layer can be used as a numerical benchmark and its gradient blocked, so that the error is only used as the basis for determining the current layer's constraints, and the gradient is not backpropagated to the previous layer through this path.

[0056] Step S250: If the prediction error of the previous decoding layer is less than a preset error threshold, an additional penalty term is generated based on the prediction point sequence of the current decoding layer, the prediction point sequence of the previous decoding layer, and the ground truth point sequence.

[0057] In this embodiment, the preset error threshold is a positive number pre-set for different decoding layers, used to distinguish whether the prediction of the previous layer is accurate enough. If the prediction error of the previous decoding layer is strictly less than the preset error threshold, it indicates that the prediction of the previous layer is relatively accurate, and additional constraints should be imposed on it to preserve the existing accurate geometry.

[0058] At this point, an additional penalty term is generated based on the predicted point sequence of the current decoding layer, the predicted point sequence of the previous decoding layer, and the ground truth point sequence. When generating the additional penalty term, the displacement change of the predicted point sequence of the current decoding layer relative to the predicted point sequence of the previous decoding layer, and the error change of the predicted point sequence of the current decoding layer relative to the ground truth point sequence can be calculated, and a penalty is constructed for the excess portion based on the allowed threshold.

[0059] If the prediction error of the previous decoding layer is greater than or equal to the preset error threshold, no additional penalty term is generated, allowing the current layer to significantly correct the larger error of the previous layer under the drive of the basic loss.

[0060] Step S260: Based on the predicted point sequence and ground truth point sequence output by each decoding layer, determine the cumulative loss of the map decoding model.

[0061] In the embodiments of this application, cumulative loss refers to the sum of the basic task losses during model training.

[0062] For example, for each decoding layer, the deviation between the predicted point sequence and the ground truth point sequence output by that layer is calculated. The deviation calculation can include classification loss (such as the loss for determining the category of road elements) and regression loss (such as coordinate regression loss calculated based on valid points).

[0063] The base losses of all decoding layers are summed using preset layer weights to obtain the cumulative loss. This cumulative loss reflects the model's basic predictive performance across all layers and is a major component of the total training loss.

[0064] Step S270: Construct the total training loss based on the additional penalty term and the cumulative loss, and update the model parameters of the map decoding model based on the total training loss to obtain the trained map decoding model. The trained map decoding model is used to generate or update the vector map of the road environment where the target vehicle is located.

[0065] In this embodiment, the additional penalty term obtained in step S250 is added to the cumulative loss obtained in step S260 to construct the total training loss. The additional penalty term can be multiplied by the corresponding weight coefficient and then accumulated layer by layer into the cumulative loss. For the first decoding layer or a curve that does not meet the constraint qualification, its additional penalty term is zero. After obtaining the total training loss, the gradient is calculated using the backpropagation algorithm, and all trainable parameters of the map decoding model are updated through the optimizer.

[0066] Through multiple iterations of training, a well-trained map decoding model is finally obtained. This model does not require ground truth points or additional penalty calculations during the inference phase; it can output accurate predicted road element points using only forward propagation. This is used to generate or update road maps of the target vehicle's environment in real time, providing support for autonomous driving decision-making and planning.

[0067] In some embodiments, matching the predicted point series output by the last decoding layer among multiple decoding layers with the ground truth point series to obtain a point series matching result includes: determining an instance correspondence between each predicted point series and the ground truth point series based on the matching of the predicted point series output by the last decoding layer among multiple decoding layers; determining a point order correspondence between each predicted point in the predicted point series and each ground truth point in the ground truth point series in the instance correspondence; and establishing a point series matching result between the predicted point series output by each decoding layer and the ground truth point series based on the instance correspondence and the point order correspondence.

[0068] In this embodiment, the final decoding layer of the map decoding model outputs multiple predicted point columns, each corresponding to a road element instance (such as lane lines, center lines, or curbs) predicted by a query. Simultaneously, the training samples provide ground truth point columns corresponding to the sensor data of that frame, each representing a real road element instance. To determine the supervisory relationship between prediction and reality, an instance-level correspondence needs to be established.

[0069] In practice, a bipartite graph matching algorithm (such as the Hungarian algorithm) can be used to complete the matching. When constructing the cost matrix, the classification cost (e.g., the cross-entropy between the predicted and true classes) and geometric cost (e.g., the average Euclidean distance between the predicted and true points after a uniform number of points) between each predicted point column and each ground truth point column can be weighted and combined. By solving for the minimum cost matching, the optimal instance correspondence can be obtained.

[0070] After instance-level matching is completed, for each matched predicted point column and ground truth point column, it is necessary to further determine the correspondence between the points, i.e., the point order correspondence. Since the predicted point column has a fixed target number P, and the ground truth point column may also have a preset number of points (or be unified through interpolation), it is necessary to clarify which point in the ground truth point column corresponds to the i-th point in the predicted point column.

[0071] For a matched instance, following the direction of the road elements, the point order of the ground truth point sequence is directly assigned as an equivalent point order to the predicted point sequence, such that the p-th point (p=1,2,…,P) in the predicted point sequence corresponds to the p-th point in the ground truth point sequence. If the number of points in the ground truth point sequence is inconsistent with the target number P, one-dimensional linear interpolation can be performed along the point order and the start and end endpoints aligned to obtain a ground truth point sequence with the same number of points as the predicted point sequence, while maintaining the consistent point index order. In this way, each predicted point can find a corresponding ground truth point, forming a point order correspondence. This point order correspondence ensures that when calculating the geometric error subsequently, points at the same location are compared.

[0072] After obtaining the instance correspondence and the point order correspondence within each instance, a complete point-sequence matching result can be constructed. This matching result contains the mapping relationship for querying true values ​​shared by all decoding layers, meaning that all decoding layers use the same set of instance correspondence and the same set of point order correspondence.

[0073] In this embodiment, during the forward propagation of the training samples, the predicted point sequences output by each decoding layer establish a stable correspondence with the same set of ground truth point sequences. This avoids the problem of inconsistent comparison objects or misaligned point sequences that may result from independent matching by different decoding layers. The point sequence matching results will be used to subsequently calculate the error of each layer's predicted point sequence relative to the ground truth, as well as to calculate inter-layer displacement and additional penalty terms.

[0074] The matching process described above relies only on the output of the last decoding layer and the ground truth, without involving the refined predictions of the previous or current layers. Furthermore, the matching results are shared during training, thus ensuring that the geometric comparisons between layers have the same target benchmark.

[0075] In some embodiments, based on the point matching results, the geometric error of the predicted point sequence of the previous decoding layer relative to the ground truth point sequence is calculated as the prediction error of the previous decoding layer. This includes: determining multiple corresponding point pairs between the predicted point sequence of the previous decoding layer and the corresponding ground truth point sequence based on the point matching results, wherein each corresponding point pair includes a predicted point of the previous decoding layer and a corresponding ground truth point; determining the geometric error of each corresponding point pair based on the geometric distance between each corresponding point pair; and averaging the geometric errors of all corresponding point pairs to obtain the prediction error of the previous decoding layer.

[0076] In this embodiment, the point matching result provides the instance correspondence and point order correspondence between the predicted point sequence and the ground truth point sequence output by each decoding layer. For the current refinement layer other than the first decoding layer, the predicted point sequence output by its previous decoding layer (i.e., the previous layer) has been associated with the specific ground truth point sequence through the shared matching result. Based on the point order correspondence in the matching result, each predicted point in the predicted point sequence of the previous layer and the ground truth point in the corresponding ground truth point sequence can be extracted, thereby forming multiple corresponding point pairs, where each corresponding point pair includes a predicted point from the previous decoding layer and a corresponding ground truth point.

[0077] In one alternative implementation, to eliminate the influence of unreliable supervision on error calculation, a valid point screening mechanism can be incorporated when determining corresponding point pairs. Specifically, the original point supervision weights and the finiteness state of the coordinate components of the ground truth points are read. A point is considered valid only if its original point supervision weight is greater than 0 and all coordinate components of the ground truth point are finite values ​​(not infinite or non-numerical). After screening, only valid points in the predicted point sequence of the previous decoding layer participate in constructing corresponding point pairs, while invalid points are excluded from subsequent error calculations. This avoids the problem of calculating a non-finite distance first and then multiplying it by zero to obtain a non-finite value, ensuring the numerical stability of geometric error calculation.

[0078] For each valid pair of corresponding points, their geometric distance needs to be calculated as the geometric error of that pair. First, the predicted point sequence from the previous decoding layer is converted from the normalized coordinates of the model output to metric coordinates (unit: meters) for comparison to ensure consistency in physical dimensions. Simultaneously, a gradient-stopping operation is performed on the predicted point sequence from the previous decoding layer (i.e., the path through which gradients were passed to the previous decoding layer during backpropagation is disconnected), preserving its values ​​as a reference benchmark. This operation ensures that when calculating additional constraints, the penalty is not reduced by moving the previous layer reference, but rather that the current layer learns to retain the reliable geometry of the previous layer.

[0079] For each valid pair of corresponding points, the two-dimensional Euclidean distance (L2 norm) between the two-dimensional coordinates of the predicted point from the previous decoding layer and the two-dimensional coordinates of the corresponding ground truth point is calculated. This Euclidean distance directly reflects the degree of deviation between the predicted point and the true position in metric space, and is used as the geometric error of the pair. After obtaining the geometric errors of all valid pairs of corresponding points, these geometric errors are summed and divided by the number of valid points to obtain the average geometric error of the previous decoding layer relative to the ground truth point sequence.

[0080] In the embodiments of this application, the average geometric error is the prediction error of the previous decoding layer (i.e., the average error of the previous layer), which is used to determine whether the prediction of the previous decoding layer is accurate enough (i.e., compared with a preset error threshold). This prediction error comprehensively reflects the geometric performance of the previous layer on the entire curve and is calculated only based on the effective points of reliable supervision, providing a basis for determining whether to enable additional refinement constraints.

[0081] In some embodiments, the additional penalty term includes: a displacement penalty term; generating the additional penalty term based on the predicted point sequence of the current decoding layer, the predicted point sequence of the previous decoding layer, and the ground truth point sequence includes: determining a first correspondence between the predicted point sequence of the current decoding layer and the predicted point sequence of the previous decoding layer based on the point sequence matching result; determining the displacement distance between each predicted point in the predicted point sequence of the current decoding layer and the corresponding predicted point in the previous decoding layer based on the first correspondence; averaging the displacement distance of each predicted point to obtain the average displacement of the current decoding layer relative to the previous decoding layer; calculating the difference between the average displacement and a preset allowable displacement threshold, taking the larger value between the difference and zero to obtain the displacement excess, and squaring the displacement excess to construct the displacement penalty term.

[0082] In this embodiment, the point matching result includes instance correspondence and point order correspondence, and all decoding layers share this matching result within the current training sample. Since the predicted point columns output by the current decoding layer and the previous decoding layer both originate from the same query set, and each query has been associated with the same ground truth point column through shared matching, there is a natural correspondence between the predicted point columns of the current decoding layer and the predicted point columns of the previous decoding layer based on query number and point order index.

[0083] For example, for the same matched curve (i.e., the same query), the p-th point in the current decoded layer's predicted point list (p=1,2,…,P, where P is the number of unified target points) corresponds to the p-th point in the previous decoded layer's predicted point list. This first correspondence ensures that when calculating inter-layer displacement, points at the same location within the same road instance are compared.

[0084] After obtaining the first correspondence, it is necessary to calculate the movement range of the current decoding layer relative to the previous decoding layer point by point.

[0085] The predicted point sequences of the current and previous decoding layers are uniformly converted from the normalized coordinates of the model output to metric coordinates (unit: meters) to measure displacement in physical units. For the predicted point sequences of the previous decoding layer, a copy of its stop-gradient is obtained as a reference benchmark. That is, only its value is retained for the calculation of the current layer, while the additional loss is blocked from backpropagating the gradient to the previous decoding layer through the reference point sequence, thereby avoiding artificially reducing the penalty by moving the previous layer reference during the optimization process.

[0086] Based on the first correspondence, for a valid corresponding point (i.e., the coordinates of the ground truth point corresponding to the point are finite and the supervision weight is greater than 0), the two-dimensional Euclidean distance (L2 norm) between the two-dimensional coordinates of the current decoding layer prediction point and the two-dimensional coordinates of the previous decoding layer reference point is calculated. This Euclidean distance represents the displacement distance of the current layer prediction point relative to the corresponding prediction point of the previous layer.

[0087] For a curve that meets the constraints, sum the displacement distances at all its valid corresponding points and divide by the number of valid points on the curve (if the number of valid points is 0, use a safety denominator of 1 to prevent division by zero). This yields the average displacement (in meters) of the curve relative to the previous layer in the current layer. This average displacement comprehensively reflects the overall geometric movement of the entire curve from the previous layer to the current layer and is a key indicator for determining whether there is an excessive change in position.

[0088] The preset allowable displacement threshold is a non-negative value pre-set for different decoding layers (for example, the allowable displacement threshold for L1 layer can be set to 2.0 meters, and for L2 layer it can be set to 1.0 meter), used to define the acceptable maximum inter-layer movement range. For each curve that meets the additional constraint qualification (i.e., the prediction error of the previous layer is less than the preset error threshold), the difference between its average displacement and the preset allowable displacement threshold is calculated. If the difference is greater than 0, the difference is considered displacement excess; if the difference is less than or equal to 0, the displacement excess is set to 0. Subsequently, the displacement excess is squared to form the displacement excess penalty for that curve.

[0089] After obtaining the displacement excess penalty for all qualified curves, sum them and divide by the number of instances actually participating in the constraints in the current layer (if the number of instances is 0, a safe denominator is used and zero additional loss is returned) to obtain the displacement penalty term for the current decoding layer. This displacement penalty term is multiplied by the corresponding layer weight and then summed with the cumulative loss to construct the total training loss.

[0090] Through the embodiments of this application, it is possible to constrain the current decoding layer from undergoing excessive positional shifts relative to the previous layer during the refinement process, thereby preserving the already relatively accurate geometric structure of the previous layer.

[0091] In some embodiments, determining the displacement distance between each predicted point in the current decoding layer prediction point column and the corresponding predicted point in the previous decoding layer based on the first correspondence includes: determining the prediction point column of the previous decoding layer and performing gradient blocking on the prediction point column of the previous decoding layer to obtain the previous layer reference point column of the previous decoding layer; and determining the displacement distance between each predicted point in the current decoding layer prediction point column and the corresponding predicted point in the previous layer reference point column based on the first correspondence.

[0092] In the embodiments of this application, the predicted point sequence of the previous decoding layer refers to the original road element point sequence output by the decoding layer preceding the current decoding layer in the map decoding model during the forward propagation process (e.g., for L1 layer, the previous decoding layer is L0; for L2 layer, the previous decoding layer is L1). This predicted point sequence contains the estimate of the road's geometric location by the previous decoding layer, typically represented in normalized coordinates.

[0093] To avoid unwanted gradient manipulation of the previous layer's predictions when calculating additional constraints, gradient blocking (Stop-gradient) is required on the predicted point sequence of the previous decoding layer. Specifically, the predicted point sequence output by the previous decoding layer is read, its normalized coordinates are restored to metric coordinates (unit: meters), and then a stopping gradient operator is applied. After gradient blocking, a previous layer reference point sequence is obtained. This reference point sequence retains the values ​​of the previous decoding layer's predicted point sequence as a numerical benchmark, but when backpropagating to calculate the gradient of additional losses (such as displacement penalty terms), the input end containing this reference point sequence is cut off; that is, the gradient of the additional loss is not propagated to the previous decoding layer through the reference point sequence.

[0094] Gradient blocking can interrupt the path of constraint pulled back by the previous layer reference point, ensuring that during training and optimization, the additional loss cannot artificially reduce the inter-layer displacement penalty by moving the position of the previous layer reference point. Instead, it forces the current decoding layer to learn to retain the already relatively accurate geometry of the previous layer during refinement. At the same time, stopping gradients only cuts off the direct gradient of the "previous layer geometric reference point". The original basic supervision of the previous layer (such as classification and regression loss) continues to drive it to learn accurate geometry. Moreover, since the current layer still depends on upstream shared features and previous layer hidden states, the additional loss may affect the shared parameters along the current layer's computation path.

[0095] Figure 3 The schematic diagram illustrates the calculation relationship of the front reference stopping gradient according to an embodiment of this application.

[0096] The preceding layer prediction point sequence output from the previous decoding layer is obtained, and a stopping gradient reference process is performed on it to obtain a preceding layer reference point sequence. This preceding layer reference point sequence has its gradient propagation path cut off during backpropagation, so it is only used as a numerical benchmark. Based on the shared first and second correspondences, a displacement and preceding layer error benchmark is established by combining the current layer prediction point sequence and the preceding layer reference point sequence. Based on this benchmark, a double excess loss is calculated, that is, a displacement excess is constructed using the displacement distance and an error excess is constructed using the preceding layer error combined with a preset margin, so as to generate an additional penalty term containing a displacement penalty term and an error penalty term. The gradient of the double excess loss is fed back to the current layer prediction point sequence for backpropagation update, thereby preserving the accurate geometric structure of the preceding layer during the process of constraining the refinement of the current decoding layer and effectively preventing error degradation.

[0097] The first correspondence is the point order correspondence between the current decoding layer and the previous decoding layer, determined based on the shared point matching results. That is, for the same curve (the same query), the p-th point (p=1,2,…,P, where P is the number of unified target points) in the current decoding layer's predicted point list corresponds to the p-th point in the previous layer's reference point list.

[0098] Based on this first correspondence, for each valid corresponding point on the curve (i.e., the coordinates of the ground truth point corresponding to this point are finite and the supervision weight is greater than 0), obtain the metric coordinates of this point in the current decoding layer prediction point column and the metric coordinates of the corresponding point in the previous layer reference point column. Calculate the two-dimensional Euclidean distance (L2 norm) between these two coordinates, which is the displacement distance of the current decoding layer prediction point relative to the corresponding prediction point of the previous decoding layer.

[0099] Through the embodiments of this application, the displacement distances at all valid corresponding points are calculated point by point. These displacement distances will be used to calculate the average displacement of the current decoding layer relative to the previous decoding layer, thereby determining whether there is an excess displacement exceeding the preset allowable displacement threshold, and providing basic data for constructing the displacement penalty term.

[0100] In some embodiments, the additional penalty term further includes: an error penalty term; generating the additional penalty term based on the predicted point sequence of the current decoding layer, the predicted point sequence of the previous decoding layer, and the ground truth point sequence, including: determining a second correspondence between the predicted point sequence and the ground truth point sequence of the current decoding layer based on the point sequence matching result; determining the geometric distance between each predicted point in the predicted point sequence of the current decoding layer and the corresponding ground truth point in the ground truth point sequence based on the second correspondence; averaging the geometric distance of each predicted point to obtain the average ground truth error of the current decoding layer relative to the ground truth point sequence; determining the sum of the predicted error of the previous decoding layer that stopped the gradient and a preset error margin to obtain an error threshold; calculating the difference between the average ground truth error and the error threshold, taking the larger value between the difference and zero to obtain the error excess, and squaring the error excess to construct the error penalty term.

[0101] In this embodiment, the point matching result is a matching relationship shared by all decoding layers within the training samples, including instance correspondence and point order correspondence. For the current decoding layer (e.g., L1 or L2), each predicted point column output by it has been associated with a specific ground truth point column through shared matching. The second correspondence refers to the one-to-one correspondence between points in the predicted point column and points in the ground truth point column based on this shared matching result. Specifically, for the same matched curve (same query), the p-th point in the predicted point column of the current decoding layer (p=1,2,…,P, where P is the unified target number of points) corresponds to the p-th point in the ground truth point column. This second correspondence ensures that when calculating the deviation between the current layer and the ground truth, points at the same location of the same road instance are compared.

[0102] After obtaining the second correspondence, it is necessary to calculate the deviation of the current decoding layer prediction point from the actual position point by point.

[0103] The predicted point list output by the current decoding layer is converted from normalized coordinates to metric coordinates (unit: meters). For a valid corresponding point (i.e., the coordinate components of the ground truth point corresponding to this point are all finite values ​​and the original point supervision weight is greater than 0), the metric coordinates of the current decoding layer's predicted point and the corresponding ground truth point are obtained, and the two-dimensional Euclidean distance (L2 norm) between them is calculated. This Euclidean distance is the geometric distance of the predicted point relative to the ground truth point, directly reflecting the magnitude of the prediction error of the current layer at this point.

[0104] For a curve, the geometric distances at all valid corresponding points are summed and divided by the number of valid points on the curve (if the number of valid points is 0, a safety denominator of 1 is used to prevent division by zero). This yields the average truth error (in meters) of the current decoding layer relative to the true point sequence. This average truth error comprehensively reflects the geometric prediction accuracy of the current decoding layer on the entire curve and is a core indicator for subsequent judgment of whether error degradation has occurred.

[0105] The prediction error of the previous decoding layer is the average geometric error of the previous layer calculated in step S240 (i.e., the average distance between the predicted point sequence and the shared truth point sequence at valid corresponding points, in meters). The preset error margin is a non-negative value pre-set for different decoding layers (for example, the error margin for L1 layer can be set to 0.20 meters, and for L2 layer it can be set to 0.10 meters), used to allow the error of the current layer to be slightly higher than the error of the previous layer within a certain range. The prediction error of the previous decoding layer is added to the preset error margin, and the sum is the error threshold. This error threshold defines the acceptable upper limit of the average truth error of the current layer: as long as the error of the current layer does not exceed this upper limit, it is considered that the current layer has not experienced significant error degradation.

[0106] For each curve that meets the additional constraint qualification (i.e., the previous layer prediction error is strictly less than a preset error threshold), the difference between its average true error and the error threshold is calculated. If the difference is greater than 0, it means that the current layer prediction not only fails to retain the accurate geometry of the previous layer, but is actually worse than the previous layer error plus the allowable margin. In this case, the difference is the error excess. If the difference is less than or equal to 0, the error excess is set to 0. Subsequently, the error excess is squared to form the error degradation penalty for that curve.

[0107] After obtaining the error degradation penalties for all qualified curves, sum them and divide by the number of instances actually participating in the constraints in the current layer (if the number of instances is 0, a safe denominator is used and zero additional loss is returned) to obtain the error penalty term for the current decoding layer. This error penalty term is then multiplied by the corresponding layer weights and summed with the cumulative loss to construct the total training loss.

[0108] For example, if the prediction error of a curve in the previous layer (L0) of layer L1 is 1.2 meters, and the preset error margin of layer L1 is 0.20 meters, then the error threshold is 1.4 meters. If the average true value error of the current layer L1 is 1.5 meters, then the difference is 0.1 meters, which, when squared, results in an error penalty of 0.01 square meters.

[0109] Through the embodiments of this application, it is possible to constrain the current decoding layer from experiencing error degradation relative to the previous layer during the refinement process. For curves that were already relatively accurate in the previous decoding layer, the training cost is increased when the error of the current decoding layer exceeds the error of the previous decoding layer and the allowable margin, thereby suppressing the tendency of geometric degradation. This constraint is a soft constraint in the training phase, and does not guarantee that the error of each instance on each decoding layer will decrease strictly monotonically, nor does it constitute an upper bound for the displacement in the inference phase.

[0110] In some embodiments, the cumulative loss of the map decoding model is determined based on the predicted point series and ground truth point series output by each decoding layer, including: determining the correspondence between the predicted point series and ground truth point series of each decoding layer based on the point series matching results; determining the geometric loss of matched instances with effective geometric supervision in each decoding layer based on the correspondence, and determining the classification loss of matched queries and unmatched queries with effective classification supervision in each decoding layer; determining the basic loss of each decoding layer based on the geometric loss, classification loss, and other applicable supervision losses; and weighted summing the basic losses of all decoding layers to obtain the cumulative loss of the map decoding model.

[0111] In this embodiment, the point matching result is established during the forward propagation of the training samples by matching the final decoding layer with the ground truth point sequence, including instance correspondence and point order correspondence. According to the shared matching mechanism, this point matching result will be reused in all decoding layers.

[0112] Effective geometric supervision is used to represent that, for a matched instance, there are a sufficient number of corresponding point pairs with reliable weights between its predicted point sequence and its ground truth point sequence, such that the geometric loss calculated based on these point pairs is reliable and non-degenerate.

[0113] Effective classification supervision is used to indicate that for each query in the decoding layer (including matched and unmatched queries), its classification label is clear and the classification loss weight is effective, so that it can participate normally in the calculation of classification loss.

[0114] For each decoding layer (including the first decoding layer L0, intermediate layers L1, and the last layer L2, etc.), the correspondence between the predicted point series and the ground truth point series output by this layer can be directly determined based on the shared point series matching results. For example, for any predicted point series output by this layer, by querying the shared matching results, its corresponding ground truth point series can be determined, and it can be known that the p-th point (p=1,2,…,P) in the predicted point series corresponds to the p-th point in the ground truth point series.

[0115] After obtaining the correspondence between the predicted point series and the ground truth point series for each decoding layer, the geometric loss of matched instances with effective geometric supervision is determined based on this correspondence. Simultaneously, the classification loss of matched and unmatched queries with effective classification supervision is calculated based on the predicted category and corresponding classification target of each query.

[0116] For a matched instance, based on the point order correspondence in the correspondence relationship, valid corresponding point pairs (i.e., points with finite coordinate components and a supervision weight greater than 0) are extracted. The geometric distance (such as two-dimensional Euclidean distance) between the current decoding layer's predicted point and the corresponding ground truth point is calculated. The geometric distances on all valid points are then averaged to obtain the geometric loss of the matched instance. This loss directly reflects the degree of deviation of the predicted point column from the true annotation in terms of geometry and position.

[0117] For matched queries with effective classification supervision, the classification loss is calculated based on the predicted category and the corresponding ground truth category. For unmatched queries with effective classification supervision, the classification loss is calculated based on the background or no-instance classification objective specified in the original training scheme. Unmatched queries are not assigned ground truth points due to participation in classification supervision, nor are the corresponding geometric regression losses calculated based on these points.

[0118] Other applicable supervised losses can be auxiliary supervised loss terms that already exist in the original training scheme of the map decoding model, in addition to classification loss and geometric regression loss. These loss terms are used to constrain the model learning from other dimensions, such as direction loss (used to supervise the forward direction of each line segment in the predicted point column to ensure consistency with the actual road direction) and smoothness loss (used to constrain the curvature of the predicted point column to avoid outputting drastically jittery broken lines), etc.

[0119] The geometric loss, classification loss, and other applicable supervision losses for each decoding layer are combined to determine the base loss for each decoding layer. The geometric loss is calculated based on matched instances with effective geometric supervision; unmatched queries participate in applicable classification or background supervision according to the original scheme. The base losses of each layer are summed according to their corresponding weights.

[0120] The map decoding model contains multiple decoding layers. The outputs of different decoding layers may contribute differently to the final map quality. Therefore, a layer weight can be pre-configured for each decoding layer (e.g., the weight of layer L0 can be set to 0.5, the weight of layer L1 can be set to 0.5, and the weight of layer L2 can be set to 1.0). The base loss of each layer is multiplied by its corresponding layer weight and then summed. This cumulative loss reflects the model's basic predictive performance across all decoding layers and will serve as the main component of the total training loss.

[0121] In one alternative implementation, the cumulative loss can serve as a major component of the total training loss, which will then be combined with additional penalty terms (such as displacement penalty terms and error penalty terms) to construct the total training loss for updating the model parameters.

[0122] Through the embodiments of this application, even if some curves do not meet the additional constraint qualifications (i.e. unqualified curves), they still accept the basic supervision (including geometric loss and classification loss) applicable to the original scheme, thereby preserving the learning opportunity for the current layer to make significant corrections under the drive of basic loss when the previous layer has obvious errors, and avoiding the obstruction of necessary error correction by unconditional constraints.

[0123] Figure 4 The schematic diagram illustrates the principle of a vehicle map decoding model training method according to an embodiment of this application. Specifically, it includes the following steps S1 to S8.

[0124] Step S1: Decode each layer and establish shared matching. During the forward propagation of the map decoding model, each decoding layer outputs predicted point columns and matches them with ground truth point columns in the final layer to establish a point column matching result that includes instance correspondence and point order correspondence. This matching result is shared and reused among all decoding layers.

[0125] Step S2: Unify the number of points, metric coordinates, and valid points. Unify the predicted point series and ground truth point series output by each decoding layer to the target number of points (P), and unify the normalized coordinates to metric coordinates (unit: meters). At the same time, determine the valid points based on the finiteness of coordinates and the supervision weights.

[0126] Step S3: Screening basic qualified curves. Based on the matching results and the proportion of valid points, determine whether each curve meets the basic qualifications (i.e., basic qualified curves). Basic qualifications include matching positive samples, effective instance supervision, category permission, and meeting the required proportion of valid points.

[0127] Step S4: Stop gradient in the previous layer and calculate geometric error. Gradient blocking (stop gradient) is applied to the predicted point sequence output by the previous decoding layer to obtain the reference point sequence of the previous layer. The average geometric error (i.e., the previous layer error) between the predicted point sequence and the ground truth point sequence of the previous decoding layer is calculated based on shared matching.

[0128] Step S5: The error of the previous layer is less than the threshold and the basic qualification is qualified. Based on the constraint qualification judgment rule, it is determined whether the current curve meets the additional constraint qualification, that is, for each query corresponding to the curve, it is determined whether the curve meets the basic qualification; under the premise that the basic qualification is met, it is further determined whether the average geometric error of the previous decoding layer is strictly less than the preset error threshold.

[0129] If the judgment result of step S5 is "yes", then step S6 is executed to calculate the displacement excess and error degradation penalty. For curves that are eligible for constraints, the displacement distance of the current layer relative to the reference point column of the previous layer is calculated based on the first correspondence, the average displacement is obtained and the displacement excess is calculated. At the same time, the average true value error of the current layer relative to the true value is calculated. The error threshold is calculated by combining the error of the previous layer and the preset error margin, and the error excess is obtained. Then, the displacement penalty term and the error penalty term (additional penalty term) are constructed.

[0130] If the result of step S5 is "no", then step S7 is executed, the additional penalty is zero, and the basic supervision is retained. For curves that do not qualify for constraint, no additional penalty term is generated (i.e., the additional penalty is set to zero), and only the original basic supervision loss of that layer is retained, allowing the model to freely correct errors driven by the basic loss.

[0131] Step S8: Normalize and train based on the number of qualified instances. Sum the excess square penalty for displacement and the excess square penalty for error degradation for each qualified instance in the current decoding layer, and normalize using the larger of the number of qualified instances in the layer and the value in step 1 as the denominator. Multiply the normalized additional losses by their corresponding weights, and then add them to the weighted sum of the base losses of each decoding layer to construct the total training loss. When there are no qualified instances, both additional losses are zero, and the base loss is calculated in the original manner.

[0132] In some embodiments, for each query within a batch (Corresponding to a road element curve) and index of each point ( , To unify the target number of points, first obtain the original point supervision weight of that point. And the coordinates of the truth points after the matching. When determining finiteness, the judgment is based on the true coordinates before the safe replacement. If all coordinate components are finite values ​​(not infinite or non-numerical) and their weights are greater than 0, then the indicator value (i.e., the mask) is determined. It is 1 if true, otherwise 0. That is:

[0133]

[0134] Subsequently, all queries were performed on this topic. points Summing gives the number of valid points. :

[0135]

[0136] And calculate the effective point ratio :

[0137]

[0138] Among them, the mask This will be used for all subsequent calculations of geometric errors and displacements, ensuring that only valid points are involved.

[0139] For the decoding layer Obtain the metric coordinates of the current layer's predicted points. Based on the same valid point mask Calculate the two-dimensional Euclidean distance between the predicted point and the true point at each valid point. Summing and dividing by the number of valid points (if Then, using the safety denominator 1), the average truth error of the current layer is obtained. :

[0140]

[0141] Current layer average truth error It reflects the geometric deviation of the current layer's predicted point sequence relative to the true point sequence, in meters.

[0142] For the current decoding layer (Not the first decoding layer), obtain the previous decoding layer The predicted point sequence is converted to metric coordinates and then a stopping gradient operator is applied. The previous layer reference point list is obtained. Based on the same valid point mask, calculate the Euclidean distance between the current layer's predicted point and the previous layer's reference point, sum them, and divide by the number of valid points (use 1 if the distance is zero) to obtain the average displacement. :

[0143]

[0144] The average displacement characterizes the overall movement of the current layer relative to the predicted point series of the previous layer.

[0145] Determine basic qualifications , For a value of 1, the following conditions must be met simultaneously: the query is a matched positive sample, the instance supervision weight is greater than zero, the query belongs to the predetermined polyline category (such as lane line, center line, curb), and the proportion of valid points is [missing information]. Not less than a preset threshold, and if truncation exclusion is enabled, the geometric supervision weight is greater than or equal to 0.999. When Then, the average truth error of the previous decoding layer is further calculated. ,like Less than the previous layer error admission threshold corresponding to the current layer (For example, L1 is 2.0 meters and L2 is 1.5 meters), then the qualification indicator value If it is 1, then it is 0 otherwise:

[0146]

[0147] For those who meet the qualifications The curves are used to calculate the two types of excess penalties.

[0148] Displacement Excess Penalty :

[0149]

[0150] in, Indicates the current decoding layer Displacement excess penalty (displacement penalty item). Indicates the current decoding layer Query in Does the indicator value for whether the additional constraint qualification is met? Indicates the current decoding layer The average displacement of the predicted point sequence relative to the predicted point sequence of the previous decoding layer. Indicates the current decoding layer The preset allowable displacement threshold, Indicates the current decoding layer The total number of curves (instances) that meet the additional constraints. Error degradation penalty. :

[0151]

[0152] in, Indicates the current decoding layer Error degradation penalty (error penalty term). Indicates the current decoding layer The average truth error of the predicted point sequence relative to the true point sequence. Indicates the previous decoding layer The average geometric error of the predicted point sequence relative to the true point sequence. This indicates that the gradient operator is stopped. Indicates the current decoding layer The preset error margin.

[0153] Calculate the base map loss for each decoding layer (Including existing supervised methods such as classification and regression), and multiplied by the corresponding layer weights. At the same time, weights are assigned to the additional penalty items. and Total loss for:

[0154]

[0155] Indicates the total number of decoding layers, the first layer ( No additional penalty is calculated. The total loss is used for backpropagation to update the model parameters.

[0156] Through the embodiments of this application, soft constraints of interlayer displacement and error degradation are applied only to curves with relatively accurate predictions and reliable supervision in the previous layer during the training phase, while curves with large errors or that are unqualified in the previous layer are corrected freely only by relying on the basic loss, thereby improving the geometric stability of the map decoding model training and the final map accuracy.

[0157] Figure 5 The schematic diagram illustrates two cases: front-layer calibration and front-layer miscalibration, according to embodiments of this application.

[0158] like Figure 5 As shown, the left figure illustrates the scenario of "accurate initial layer, local degradation in subsequent layer," where the solid line represents the ground truth, the long dashed line represents the predicted points of the initial layer, and the dotted line represents the predicted points of the current layer. Since the initial layer prediction is relatively close to the ground truth, but the current layer exhibits local degradation, the initial layer error is less than the threshold and meets the basic eligibility criteria, thus entering the constraint. Two types of excess penalties—displacement excess and error degradation—are calculated to constrain the training of the current layer. The right figure illustrates the scenario of "poor initial layer, significant error correction in subsequent layer." Because the initial layer prediction itself differs significantly from the ground truth (initial layer error greater than or equal to the threshold), it is not considered to enter the constraint, and a penalty of zero is directly applied, preserving basic supervision to allow the model to freely correct errors driven by the basic loss. The horizontal axis of both figures represents the schematic position along the road direction (not actual measured data). This comparison mechanism effectively improves the geometric stability of model training.

[0159] For example, the previous layer is accurate but the current layer degenerates. Consider L2, with an allowable displacement of 1.0 meter, an admission threshold of 1.5 meters, and a degradation margin of 0.1 meters, and both types of losses weighted at 0.1. A qualified curve has an error of 0.4 meters in the previous layer, an error of 1.0 meter in the current layer, and an average inter-layer displacement of 1.2 meters. The previous layer meets the admission criteria. The excess displacement is 0.2 meters, with a squared value of 0.04; the excess error degradation is 0.5 meters, with a squared value of 0.25. If only this curve is involved, the weighted sum of the two items is 0.029. This set of distances satisfies the geometric triangle inequality and can be achieved by prediction points in different directions on both sides of the true value.

[0160] The previous layer has obvious errors, and the current layer needs significant correction. Still considering L2, the previous layer error is 3.0 meters, the current layer error is 0.5 meters, and the inter-layer displacement is 2.5 meters. Because the previous layer error is not less than 1.5 meters, its qualification is zero, and this scheme has no additional penalty; the current layer continues to be corrected by supervised learning from the basic truth value. If a fixed step size penalty is used for all curves, this necessary correction will also be penalized.

[0161] Insufficient point supervision or truncation of instances. One curve has 60 points, of which 12 have reliable supervision, resulting in an effective proportion of 0.2, which is less than 0.3, and therefore it is not included in the candidate set. Another curve has an effective point proportion of 0.8, but its truncation-related geometric weight is 0.5, and it is also not included in the candidate set when exclusion is enabled. Both simply do not increase this additional loss, and the original applicable supervision is retained.

[0162] The previous layer has been aligned; the current layer maintains or improves upon it. A previous layer error of 0.4 meters, a current layer error of 0.3 meters, and an inter-layer displacement of 0.2 meters are sufficient for eligibility, but both excess values ​​are zero. This method does not impose a positive penalty on every curve for participation in constraints.

[0163] Through the embodiments of this application, shared matching and point order enable inter-layer geometric comparisons to have the same target benchmark; effective point and instance qualification screening reduces the impact of unreliable supervision on additional constraints; previous layer error admission distinguishes between already accurate curves and curves requiring significant error correction; two types of excess loss express excessive movement and error degradation respectively; and stopping the gradient at the previous layer reference end prevents the reference from being directly pulled to the current layer by additional loss, thus reducing the penalty.

[0164] Based on the above-mentioned vehicle map decoding model training method, embodiments of this application also provide a vehicle map decoding method.

[0165] Figure 6 A flowchart illustrating a map decoding method for a vehicle according to an embodiment of this application is shown schematically. Figure 6 As shown, the vehicle map decoding model training method according to the embodiments of this application may include steps S610 to S620.

[0166] Step S610: Obtain observation data of the road environment collected by vehicle sensors.

[0167] Step S620: Input the spatial features obtained by feature encoding of the observation data into the trained map decoding model to obtain the prediction point list corresponding to each road element of the road environment.

[0168] The map decoding model is trained according to the vehicle map decoding model training method of any of the above embodiments.

[0169] Based on the above-described vehicle map decoding model training method, embodiments of this application also provide a vehicle map decoding model training device.

[0170] Figure 7 The schematic diagram illustrates a structural block diagram of a vehicle map decoding model training apparatus according to an embodiment of this application. It includes an acquisition module 710, a propagation module 720, a matching module 730, an error module 740, a penalty module 750, a loss module 760, and an update module 770.

[0171] The acquisition module 710 is used to acquire the observation data of the road environment collected by the vehicle sensors and the true value points of the road elements corresponding to the observation data.

[0172] The propagation module 720 is used to input the spatial features obtained by feature encoding of the observation data into a map decoder including multiple decoding layers, and to obtain the predicted point list of road elements output by each decoding layer.

[0173] The matching module 730 is used to match the predicted point series output by the last decoding layer among multiple decoding layers with the true point series to obtain the point series matching result, which is used to represent the correspondence between the predicted point series and the true point series.

[0174] Error module 740 is used to calculate the geometric error of the predicted point sequence of the previous decoding layer relative to the true point sequence based on the point sequence matching result for each decoding layer except the first decoding layer, as the prediction error of the previous decoding layer.

[0175] The penalty module 750 is used to generate an additional penalty term based on the prediction point sequence of the current decoding layer, the prediction point sequence of the previous decoding layer, and the true point sequence when the prediction error of the previous decoding layer is less than a preset error threshold.

[0176] The loss module 760 is used to determine the cumulative loss of the map decoding model based on the predicted point series and ground truth point series output by each decoding layer.

[0177] The update module 770 is used to construct the total training loss based on the additional penalty term and the cumulative loss, and to update the model parameters of the map decoding model based on the total training loss, so as to obtain the trained map decoding model. The trained map decoding model is used to generate or update the vector map of the road environment where the target vehicle is located.

[0178] According to embodiments of this application, any multiple modules among the acquisition module 710, propagation module 720, matching module 730, error module 740, penalty module 750, loss module 760, and update module 770 can be combined into one module, or any one of these modules can be split into multiple modules. Alternatively, at least part of the functionality of one or more of these modules can be combined with at least part of the functionality of other modules and implemented in one module. According to embodiments of this application, at least one of the acquisition module 710, propagation module 720, matching module 730, error module 740, penalty module 750, loss module 760, and update module 770 can be at least partially implemented as hardware circuitry, such as a field-programmable gate array, programmable logic array, system-on-a-chip, system-on-a-substrate, system-on-package, application-specific integrated circuit, or any other reasonable means of integrating or packaging circuitry, or implemented in software, hardware, or firmware, or in any suitable combination of any of these three implementation methods. Alternatively, at least one of the acquisition module 710, propagation module 720, matching module 730, error module 740, penalty module 750, loss module 760 and update module 770 may be implemented at least partially as a computer program module, which can perform corresponding functions when the computer program module is run.

[0179] Embodiments of this application also provide a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments; or it may exist independently and not assembled into the device / apparatus / system. The computer-readable storage medium carries one or more programs, which, when executed, implement the method according to the embodiments of this application.

[0180] Based on the above-mentioned vector map generation method for vehicles, this application also provides an autonomous vehicle, including: vehicle sensors for collecting road environment data of the environment in which the target vehicle is located; and an on-board processor configured to execute the above-mentioned map decoding method for vehicles, so as to use a trained map decoding model to perform forward propagation decoding on road elements in the road environment data to obtain a predicted point series corresponding to the road elements, the predicted point series being used to update or generate a road map of the environment in which the target vehicle is located.

[0181] In this embodiment, the map decoding model training system (such as a cloud server or offline training device) uses historical observation data collected by vehicle sensors and the corresponding road ground truth point series to execute the vehicle map decoding model training method of any of the above embodiments to obtain a trained map decoding model.

[0182] Subsequently, the trained map decoding model is deployed to the onboard inference device of the autonomous vehicle. During actual vehicle operation, the onboard processor calls the trained map decoding model to perform forward propagation decoding on the real-time collected road elements, outputting predicted point sequences to update or generate vector maps. During the inference phase, training-specific operations such as truth-based qualification, additional penalty term calculation, and gradient blocking are not performed; only the map decoding structure and output interface are reused, thus ensuring the efficiency and real-time performance of onboard inference.

[0183] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0184] Those skilled in the art will understand that the features described in the various embodiments of this application can be combined and / or combined in various ways, even if such combinations or combinations are not explicitly described in this application. In particular, the features described in the various embodiments of this application can be combined and / or combined in various ways without departing from the spirit and teachings of this application. All such combinations and / or combinations fall within the scope of this application.

Claims

1. A method for training a vehicle map decoding model, characterized in that, The method includes: Acquire the observation data of the road environment collected by vehicle sensors and the true value point sequence of the road elements corresponding to the observation data; The spatial features obtained by feature encoding of the observation data are input into a map decoder with multiple decoding layers to obtain the predicted point list of road elements output by each decoding layer; The predicted point sequence output by the last decoding layer among the multiple decoding layers is matched with the true point sequence to obtain a point sequence matching result, which is used to represent the correspondence between the predicted point sequence and the true point sequence; For each decoding layer except the first decoding layer, based on the point matching results, the geometric error of the predicted point sequence of the previous decoding layer relative to the true point sequence is calculated as the prediction error of the previous decoding layer; If the prediction error of the previous decoding layer is less than a preset error threshold, an additional penalty term is generated based on the prediction point sequence of the current decoding layer, the prediction point sequence of the previous decoding layer, and the truth point sequence. Based on the predicted point sequence and the ground truth point sequence output by each decoding layer, the cumulative loss of the map decoding model is determined; The total training loss is constructed based on the additional penalty term and the cumulative loss, and the model parameters of the map decoding model are updated based on the total training loss to obtain the trained map decoding model. The trained map decoding model is used to generate or update a vector map of the road environment where the target vehicle is located.

2. The method according to claim 1, characterized in that, The predicted point sequence output by the last decoding layer among the multiple decoding layers is matched with the ground truth point sequence to obtain the point sequence matching result, including: Based on the matching of the predicted point column output by the last decoding layer among the multiple decoding layers with the true point column, the instance correspondence between each predicted point column and the true point column is determined. Determine the point order correspondence between each predicted point in the predicted point column and each true point in the true point column in the instance correspondence relationship; Based on the instance correspondence and the point sequence correspondence, a point sequence matching result is established between the predicted point sequence output by each decoding layer and the true point sequence.

3. The method according to claim 1, characterized in that, Based on the point matching results, the geometric error of the predicted point sequence of the previous decoding layer relative to the ground truth point sequence is calculated as the prediction error of the previous decoding layer, including: Based on the point matching results, multiple corresponding point pairs are determined between the predicted point pairs of the previous decoding layer and the corresponding ground truth point pairs. Each corresponding point pair includes a predicted point of the previous decoding layer and a corresponding ground truth point. The geometric error of each corresponding point pair is determined based on the geometric distance between each corresponding point pair. The geometric errors of all corresponding point pairs are averaged to obtain the prediction error of the previous decoding layer.

4. The method according to claim 1, characterized in that, The additional penalty items include: displacement penalty items; The additional penalty term is generated based on the predicted point sequence of the current decoding layer, the predicted point sequence of the previous decoding layer, and the ground truth point sequence, including: Based on the point matching results, the first correspondence between the predicted point column of the current decoding layer and the predicted point column of the previous decoding layer is determined; Based on the first correspondence, determine the displacement distance between each prediction point in the current decoding layer prediction point column and the corresponding prediction point in the previous decoding layer; The average displacement of the current decoding layer relative to the previous decoding layer is calculated by averaging the displacement distance of each prediction point. Calculate the difference between the average displacement and the preset allowable displacement threshold, take the larger value between the difference and zero to obtain the displacement excess, and square the displacement excess to construct the displacement penalty term.

5. The method according to claim 4, characterized in that, Based on the first correspondence, the displacement distance between each prediction point in the current decoding layer prediction point column and the corresponding prediction point in the previous decoding layer is determined, including: Determine the prediction point sequence of the previous decoding layer, and apply gradient blocking to the prediction point sequence of the previous decoding layer to obtain the previous layer reference point sequence of the previous decoding layer. Based on the first correspondence, the displacement distance between each prediction point in the current decoding layer prediction point column and the corresponding prediction point in the previous layer reference point column is determined.

6. The method according to claim 4, characterized in that, The additional penalty items also include: an error penalty item; The additional penalty term is generated based on the predicted point sequence of the current decoding layer, the predicted point sequence of the previous decoding layer, and the ground truth point sequence, including: Based on the point matching results, a second correspondence between the predicted point series and the ground truth point series of the current decoding layer is determined; Based on the second correspondence, the geometric distance between each prediction point in the prediction point column of the current decoding layer and the corresponding truth point in the truth point column is determined; The average truth error of the current decoding layer relative to the column of truth points is obtained by averaging the geometric distance of each prediction point. The error threshold is obtained by summing the prediction error of the previous decoding layer before the stopping gradient with the preset error margin. Calculate the difference between the average true error and the error threshold, take the larger value between the difference and zero to obtain the error excess, and square the error excess to construct the error penalty term.

7. The method according to claim 1, characterized in that, The determination of the cumulative loss of the map decoding model based on the predicted point sequence output by each decoding layer and the ground truth point sequence includes: Based on the point matching results, the correspondence between the predicted point series and the true point series of each decoding layer is determined; Based on the correspondence, the geometric loss of the matched instances with effective geometric supervision in each decoding layer is determined, and the classification loss of the matched and unmatched queries with effective classification supervision in each decoding layer is determined. Based on the geometric loss, the classification loss, and other applicable supervisory losses, determine the base loss for each decoding layer; The cumulative loss of the map decoding model is obtained by weighted summation of the basic losses of all decoding layers.

8. A method for decoding vehicle maps, characterized in that, The method includes: Acquire observational data of the road environment collected by vehicle sensors; The spatial features obtained by feature encoding of the observed data are input into the trained map decoding model to obtain the prediction point sequence corresponding to each road element of the road environment. The map decoding model is trained by the vehicle map decoding model training method according to any one of claims 1-7.

9. A vehicle map decoding model training device, characterized in that, The device includes: The acquisition module is used to acquire observation data of the road environment collected by vehicle sensors and the true value point sequence of road elements corresponding to the observation data; The propagation module is used to input the spatial features obtained by feature encoding of the observation data into a map decoder including multiple decoding layers, and to obtain the predicted point list of road elements output by each decoding layer; The matching module is used to match the predicted point sequence output by the last decoding layer among the multiple decoding layers with the true point sequence to obtain a point sequence matching result, which is used to represent the correspondence between the predicted point sequence and the true point sequence. The error module is used to calculate the geometric error of the predicted point sequence of the previous decoding layer relative to the true point sequence based on the point sequence matching result for each decoding layer except the first decoding layer, and use it as the prediction error of the previous decoding layer. The penalty module is used to generate an additional penalty term based on the prediction point list of the current decoding layer, the prediction point list of the previous decoding layer, and the truth point list when the prediction error of the previous decoding layer is less than a preset error threshold. The loss module is used to determine the cumulative loss of the map decoding model based on the predicted point sequence and the ground truth point sequence output by each decoding layer. The update module is used to construct a total training loss based on the additional penalty term and the cumulative loss, and update the model parameters of the map decoding model based on the total training loss to obtain a trained map decoding model. The trained map decoding model is used to generate or update a vector map of the road environment where the target vehicle is located.

10. An autonomous vehicle, characterized in that, include: Vehicle sensors are used to collect road environment data of the target vehicle's surroundings; An onboard processor is configured to execute the vehicle map decoding method according to claim 8, to perform forward propagation decoding on road elements in the road environment data using a trained map decoding model to obtain a predicted point sequence corresponding to the road elements, the predicted point sequence being used to update or generate a road map of the environment in which the target vehicle is located.