Track planning method, vehicle-mounted equipment, vehicle and computer program product
By using pre-trained neural networks to process perceived images in autonomous driving vehicles, the future grid of obstacles occupy images and cost matrix is generated, and the safety hazards caused by the irrationality of the cost matrix in the prior art are solved, and the autonomous driving is improved Vehicle safety and smooth driving.
Patent Information
- Application Number
- CN202411449324.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-16
- Publication Date
- 2024-11-15
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The cost matrix of existing autonomous driving vehicles is unreasonable when judging the generated sampling trajectory, resulting in safety hazards in the screened driving trajectory and it is difficult to effectively work in the ever-changing autonomous driving scenarios.
Using a pre-trained target neural network, including a feature extraction subnet, a first predictive subnet and a second predictive subnet, the future grid of the obstacles is occupied by the sensor image processing to determine the target driving trajectory, using The future of obstacles may occupy the situation. Supervision of the training of the second predictive subnetwork makes the prediction cost matrix more reasonable and improves driving safety.
Through reasonable cost matrix judgment, we can better avoid the possible location of obstacles in the future, and improve safety and smooth driving during autonomous driving.
Smart Images

Figure CN118968472A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of vehicle technology, and in particular to a trajectory planning method, an on-vehicle device, a vehicle, and a computer program product. Background Art
[0002] The generation and selection of planned trajectories for autonomous driving are of utmost importance in the process of autonomous driving, as they directly affect the driving safety, stability and smoothness of autonomous driving vehicles. Therefore, for the candidate planned trajectories generated by autonomous driving vehicles, it is necessary to design reasonable evaluation criteria to evaluate the danger and smoothness of these candidate trajectories. The cost function or cost matrix of the autonomous driving sampling trajectory is one of the important evaluation indicators for judging the rationality of the generated sampling trajectory. The currently generated cost matrix has certain irrationality, which causes certain safety hazards to the driving trajectory selected according to this cost matrix. Summary of the invention
[0003] The embodiments of the present disclosure at least provide a trajectory planning method, an on-vehicle device, a vehicle, and a computer program product.
[0004] In a first aspect, an embodiment of the present disclosure provides a trajectory planning method, including: Obtaining a perception image of the target vehicle at the current position; Inputting the perceived image into a pre-trained target neural network for processing to obtain a future grid occupancy image of the target obstacle included in the perceived image and a cost matrix corresponding to the perceived image; Determining a target driving trajectory from a plurality of candidate driving trajectories based on the future grid occupancy image and the cost matrix; Among them, the target neural network includes: a feature extraction subnetwork, a first prediction subnetwork and a second prediction subnetwork; the first prediction subnetwork is used to predict the future grid occupancy of obstacles; the second prediction subnetwork performs cost matrix prediction; and when training the target neural network, the model loss corresponding to the second prediction subnetwork is generated through the prediction results of the cost matrix prediction of the sample perception image and the prediction results of the future grid occupancy prediction of the BEV sample image.
[0005] In a possible implementation, the target neural network is trained in the following manner: Acquire the sample perception image generated by the sample vehicle during driving; Performing feature extraction processing on the sample perception image using the feature extraction subnetwork to be trained to obtain sample feature data of the sample perception image; Using a first prediction subnetwork to be trained, performing a first prediction process on the sample feature data to obtain a predicted grid occupancy image of a sample obstacle in the sample perception image within a sample future time period; determining a first loss based on the predicted grid occupancy image and an actual grid occupancy image of the sample obstacle within the sample future time period, and using the first loss to train the first prediction subnetwork to be trained and the feature extraction subnetwork to be trained; And, using the second prediction sub-network to be trained, perform a second prediction processing on the sample feature data to obtain a sample cost matrix corresponding to the sample perceived image; determine a second loss based on the sample cost matrix and the first loss, and use the second loss to train the second prediction sub-network to be trained and the feature extraction sub-network to be trained to generate the target neural network.
[0006] In a possible implementation manner, determining the second loss based on the sample cost matrix and the first loss includes: Based on the sample cost matrix, determining a first-generation value corresponding to a real driving trajectory of the sample vehicle in the sample future time period and a second-generation value corresponding to a plurality of sample candidate driving trajectories associated with the perceived image; and, determining a compensation loss value based on a real grid occupancy image corresponding to the sample obstacle, the real driving trajectory, and a plurality of the sample candidate driving trajectories; The second loss is obtained according to the first generation value, the second generation value, the compensation loss value and the first loss.
[0007] In a possible implementation manner, determining, based on the sample cost matrix, a first-generation value corresponding to the actual driving trajectory of the sample vehicle in the sample future period and a second-generation value corresponding to a plurality of sample candidate driving trajectories associated with the perceived image, respectively, includes: Projecting a plurality of real position points included in the real driving trajectory onto the sample cost matrix to obtain first projection points of the plurality of real position points in the sample cost matrix; summing the cost values of the corresponding elements of each of the first projection points in the sample cost matrix to obtain the first cost value; Furthermore, for each of the multiple sample candidate driving trajectories, the multiple candidate position points included in the sample candidate driving trajectories are projected onto the sample cost matrix to obtain the second projection points of the multiple candidate position points in the sample cost matrix; the cost values corresponding to the second projection points corresponding to the multiple candidate position points in the sample cost matrix are summed to obtain the path cost of each sample candidate driving trajectory; the path costs corresponding to the multiple sample candidate driving trajectories are summed to obtain the second generation value.
[0008] In a possible implementation manner, determining the compensation loss value based on the predicted grid occupancy image, the actual driving trajectory, and the plurality of sample candidate driving trajectories includes: Determine the minimum distance from the L2 distances between the plurality of sample candidate driving trajectories and the actual driving trajectory; and Projecting the candidate position point in each row of the plurality of sample candidate driving trajectories onto the real grid occupancy image to obtain a third projection point of the candidate position point in the real grid occupancy image; determining the occupation cost of the plurality of sample candidate driving trajectories according to the overlap degree of the sample obstacle distribution described by the third projection point and the real grid occupancy image; The minimum distance and the occupation cost are weightedly summed to obtain the compensation loss value.
[0009] In a possible implementation manner, determining a target driving trajectory from a plurality of candidate driving trajectories based on the future grid occupancy image and the cost matrix includes: Determining target costs corresponding to a plurality of candidate driving trajectories respectively according to the future grid occupancy image and the cost matrix; The target driving trajectory is determined from the multiple candidate driving trajectories according to the target costs respectively corresponding to the multiple candidate driving trajectories.
[0010] In a possible implementation, determining target costs corresponding to a plurality of candidate driving trajectories respectively according to the future grid occupancy image and the cost matrix includes: For each of the plurality of candidate driving trajectories, projecting each candidate driving trajectory into the future grid occupation image, and determining a collision degree value of each candidate driving trajectory; and projecting each of the candidate driving trajectories onto the cost matrix to obtain a cost value of each of the candidate driving trajectories; The collision degree value and the cost value are weightedly summed to obtain the target cost of each candidate driving trajectory.
[0011] In a possible implementation, the perception image includes four channels; the four channels are respectively used to store obstacle information, navigation line information, lane line information, and current grid occupancy and historical grid occupancy information of the vehicle.
[0012] In a second aspect, an embodiment of the present disclosure further provides a vehicle-mounted device, comprising a processor; the processor is used to execute the trajectory planning method as described in the first aspect, or any item of the first aspect.
[0013] In a third aspect, an embodiment of the present disclosure further provides a vehicle, comprising the vehicle-mounted device as described in the second aspect.
[0014] In a fourth aspect, an optional implementation of the present disclosure further provides a computer program product, wherein the computer program product carries a program code, and the program code includes instructions that can be used to execute the steps of the trajectory planning method as described in the first aspect, or any one of the first aspects.
[0015] The trajectory planning method provided by the embodiment of the present disclosure inputs the perception image of the target vehicle at the current position into the pre-trained target neural network for processing, obtains the future grid occupancy image of the target obstacle included in the perception image and the cost matrix corresponding to the perception image; based on the future grid occupancy image and the cost matrix, determines the target driving trajectory from multiple candidate driving trajectories; the target neural network used in this method includes a feature extraction subnetwork, a first prediction subnetwork and a second prediction subnetwork; wherein the first prediction subnetwork is used to predict the future grid occupancy of the obstacle; the second prediction subnetwork predicts the cost matrix; when training the target neural network, the model loss used to train the second prediction subnetwork is generated by the prediction results of the cost matrix prediction of the sample perception image and the prediction results of the future grid occupancy prediction of the sample image, so that the possible future occupancy of the obstacle is used to supervise the training process of the second prediction subnetwork, so that the cost matrix predicted by the target neural network model is more reasonable, and the possible location of the future obstacle can be better avoided, thereby improving the safety during driving.
[0016] In order to make the above-mentioned objectives, features and advantages of the present disclosure more obvious and easy to understand, preferred embodiments are specifically cited below and described in detail with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the technical solutions of the embodiments of the present disclosure, the following is a brief introduction to the drawings required for use in the embodiments. The drawings herein are incorporated into the specification and constitute a part of the specification. These drawings illustrate embodiments consistent with the present disclosure and are used together with the specification to illustrate the technical solutions of the present disclosure. It should be understood that the following drawings only illustrate certain embodiments of the present disclosure and should not be regarded as limiting the scope. For ordinary technicians in this field, other relevant drawings can also be obtained based on these drawings without creative work.
[0018] Figure 1 A flow chart of a trajectory planning method provided by some embodiments of the present disclosure is shown; Figure 2 An example of a process for training a target neural network provided by some embodiments of the present disclosure is shown; Figure 3 A flowchart showing a specific method for training a target neural network provided by some embodiments of the present disclosure; Figure 4 A schematic diagram of a vehicle-mounted device provided in some embodiments of the present disclosure is shown. DETAILED DESCRIPTION
[0019] In order to make the purpose, technical scheme and advantages of the embodiments of the present disclosure clearer, the technical scheme in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are only part of the embodiments of the present disclosure, rather than all of the embodiments. The components of the embodiments of the present disclosure generally described and shown here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present disclosure is not intended to limit the scope of the present disclosure claimed for protection, but merely represents the selected embodiments of the present disclosure. Based on the embodiments of the present disclosure, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present disclosure.
[0020] Sampled trajectory: refers to the trajectory cluster generated by various trajectory generators and provided to the self-driving vehicle planning module for selection. In the trajectory cluster, it usually includes multiple sample candidate driving trajectories. Cost function or cost matrix (cost volume): The cost matrix is the basis for the autonomous driving vehicle to select the appropriate planning trajectory from the sampled trajectory. The autonomous driving vehicle uses the cost matrix to judge each trajectory in the candidate planning trajectory cluster generated by the sampler, and selects the sampling trajectory with the lowest cost as the planning trajectory for the next moment. The cost matrix includes multiple matrix elements, and the element value of each matrix element is used to characterize the risk level of the driving trajectory falling into the corresponding position of the matrix element.
[0021] In early autonomous driving solutions, the cost matrix or cost function was mainly designed manually. By adding various rules and some human experience knowledge, penalties were imposed on factors in the sampled trajectory that did not meet the human constraints or human experience, thereby screening out the alternative planning trajectory with the lowest cost. However, the rules are limited, while the scenarios of autonomous driving are ever-changing. The cost function is often very complex when designed manually, and it is particularly dependent on human experience, making it difficult to design and ensure that the cost function works in the ever-changing autonomous driving scenarios.
[0022] With the rise of deep learning, the sampling trajectory cost function has gradually changed from manual design and parameter adjustment to autonomous learning by neural networks, avoiding complex manual design and human experience knowledge. However, generating trajectory evaluation cost functions or cost matrices through deep learning also relies on good neural network model design and neural network loss function design, which leads to the current use of neural network models.
[0023] Based on the above research, the present disclosure provides a trajectory planning method, which inputs a perception image of a target vehicle at a current position into a pre-trained target neural network for processing, and obtains a future grid occupancy image of a target obstacle included in the perception image and a cost matrix corresponding to the perception image; based on the future grid occupancy image and the cost matrix, a target driving trajectory is determined from multiple candidate driving trajectories; the target neural network used in this method includes a feature extraction subnetwork, a first prediction subnetwork and a second prediction subnetwork; wherein the first prediction subnetwork is used to predict the future grid occupancy of an obstacle; the second prediction subnetwork predicts the cost matrix; when training the target neural network, the model loss used to train the second prediction subnetwork is generated by the prediction results of the cost matrix prediction of the sample perception image and the prediction results of the future grid occupancy prediction of the sample image, so that the possible future occupancy of the obstacle is used to supervise the training process of the second prediction subnetwork, so that the cost matrix predicted by the target neural network model is more reasonable, and the possible location of future obstacles can be better avoided, thereby improving the safety during driving.
[0024] The defects existing in the above solutions are the results obtained by the inventor after practice and careful research. Therefore, the discovery process of the above problems and the solutions proposed by the present disclosure for the above problems below should be the contributions made by the inventor to the present disclosure during the disclosure process.
[0025] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, further definition and explanation thereof is not required in subsequent drawings.
[0026] To facilitate understanding of this embodiment, a trajectory planning method disclosed in the embodiment of the present disclosure is first introduced in detail. The execution subject of the trajectory planning method provided in the embodiment of the present disclosure is generally a computer device with certain computing capabilities, and the computer device includes, for example: a terminal device or a server or other processing device, and the terminal device can be a user equipment (UE), a mobile device, a user terminal, a vehicle-mounted device, etc. In some possible implementations, the trajectory planning method can be implemented by a processor calling a computer-readable instruction stored in a memory.
[0027] The trajectory planning method provided by the embodiment of the present disclosure is described below.
[0028] See also Figure 1 FIG. 1 is a flow chart of a trajectory planning method provided by an embodiment of the present disclosure, wherein the method includes steps S101 to S103, wherein: S101: Acquire a perception image of the target vehicle at the current position; wherein the image may be a BEV (Bird's-Eye-View) image.
[0029] S102: Inputting the perceived image into a pre-trained target neural network for processing to obtain a future grid occupancy image of the target obstacle included in the perceived image and a cost matrix corresponding to the perceived image; S103: determining a target driving trajectory from a plurality of candidate driving trajectories based on the future grid occupancy image and the cost matrix; Among them, the target neural network includes: a feature extraction subnetwork, a first prediction subnetwork and a second prediction subnetwork; the first prediction subnetwork is used to predict the future grid occupancy of obstacles; the second prediction subnetwork performs cost matrix prediction; and when training the target neural network, the model loss corresponding to the second prediction subnetwork is generated through the prediction results of the cost matrix prediction of the sample perception image and the prediction results of the future grid occupancy prediction of the BEV sample image.
[0030] The above S101 to S103 are described in detail below.
[0031] For the above S101: the target vehicle can be, for example, any vehicle that deploys the obstacle trajectory prediction method provided by the embodiment of the present disclosure. A visual perception system can be deployed in the target vehicle, and the visual perception system includes a camera, etc. The visual perception system can obtain the original image data within a certain range around the target vehicle. The original image data is usually data under a perspective view (Perspective View, PV); in the embodiment of the present disclosure, the original image data of multiple perspectives can be obtained from the perspective view by a plane projection method to obtain a BEV image under a bird's-eye view (Bird Eye View, BEV) centered on the visual perception system, which is the perception image described in the embodiment of the present disclosure. Compared with the collected original image, the BEV image can provide a wider perspective. In the perception image, according to the driving environment of the target vehicle, it may cover one or more of the lane lines, navigation lines, road boundaries, grid occupancy images of obstacles at the current time and historical time, and grid occupancy images of the vehicle at the current time and historical time.
[0032] In the disclosed embodiment, in order to enable the target neural network to better process the perceived image, the obstacle information, navigation line information, lane line information, and vehicle information are stored in four channels, R, G, B, and A, respectively, where: R channel: stores all obstacle information, including the current and historical occupancy of obstacles. The grayscale value of the historical occupancy decreases in sequence according to the distance from the current moment. That is, the older the historical moment, the lower the grayscale value.
[0033] G channel: stores the navigation line information. The width of the navigation line in the perceived image is 8 pixels.
[0034] B channel: stores lane line information. The width of the lane line in the perceived image is 4 pixels.
[0035] Channel A: stores the current grid occupancy and historical grid occupancy information of the vehicle. Similar to the R channel, the grayscale value of the vehicle's historical occupancy decreases step by step according to the distance in history, that is, the farther the vehicle grid occupancy is from the current moment, the lower its grayscale value.
[0036] Regarding S102 above: After obtaining the perceived image of the target vehicle at the current position, the perceived image is input into a pre-trained target neural network for processing to obtain a future grid occupancy image of the target obstacle included in the perceived image and a cost matrix corresponding to the perceived image.
[0037] The future grid occupancy image of the target obstacle is, for example, an image formed by projecting the position where the target obstacle may appear in the ego-vehicle coordinate system to the image coordinate system at multiple future moments after the timestamp corresponding to the perceived image is the current moment. The future grid occupancy image is divided into multiple grids and includes multiple channels, each channel corresponding to a future moment; the pixel value of each grid in the layer corresponding to each channel is used to represent the probability of the target obstacle appearing at the position corresponding to the grid at the future moment corresponding to the layer. The higher the grayscale value of the grid area, the higher the probability that the obstacle will appear at the position corresponding to the grid area in the future moment.
[0038] Specifically, Figure 2 In the example shown, the target neural network includes: a feature extraction subnetwork 21, a first prediction subnetwork 22, and a second prediction subnetwork 23.
[0039] The feature extraction subnetwork 21 may be, for example, a convolutional neural network (CNN), which is used to perform feature extraction processing on the perceived image, map various information carried in the perceived image to a high-dimensional feature space, and obtain feature data of the perceived image. The feature data includes feature information of various objects in the perceived image, for example, if there are obstacles in the image, the feature data will include feature information of the obstacles; if there are lane lines in the image, the feature data will also include feature information of the lane lines; if there are navigation lines in the image, the feature data will also include information of the navigation lines.
[0040] Exemplarily, the feature extraction subnetwork includes, for example, 12 convolutional layers connected in series; each convolutional layer performs convolution encoding processing on the input of the previous layer, and the last convolutional layer outputs feature data of the perceived image.
[0041] The first prediction subnetwork 22 is used to upsample the feature data output by the feature extraction subnetwork 21. During the upsampling process, the future grid occupancy distribution of the obstacle is predicted. If the perceived image includes a target obstacle, the first prediction subnetwork 22 generates a future grid occupancy image of the target obstacle.
[0042] In the embodiments of the present disclosure, obstacles in the perceived image may include, for example, dynamic obstacles and static obstacles; the dynamic obstacles may include, for example, other vehicles, pedestrians, non-motor vehicles, animals, etc. Static obstacles may include, for example, road facilities, road edges, non-road areas, etc. The target obstacles generally include the above-mentioned dynamic obstacles.
[0043] The second prediction subnetwork 23 is used to upsample the feature data output by the feature extraction subnetwork 21. During the upsampling process, the cost matrix is predicted to obtain the cost matrix. The size of the cost matrix is usually the same as the size of the perceived image. The element value of each element in the cost matrix represents the cost required for the future self-vehicle to occupy the position corresponding to the element. The higher the cost value, the greater the risk value of the self-vehicle trajectory planning here. The risks here include, for example, the risk of colliding with obstacles and the risk of the vehicle body running off the road. In the embodiment of the present disclosure, the element value of the cost matrix can be set in the interval of (-1000, 1000) to prevent extreme situations from occurring.
[0044] Specifically, combined Figure 2 , and see Figure 3 As shown, the embodiment of the present disclosure also provides an implementation method for training a target neural network, including: S301: Acquire the sample perception image generated by the sample vehicle during driving.
[0045] Here, the sample perception image may be, for example, a perception image acquired by a sample vehicle during driving; the sample perception image generally includes a sample obstacle, and the type of the sample obstacle is the same as the type of the target obstacle.
[0046] After obtaining the sample perception image, it is also possible to obtain the actual grid occupancy image of the sample obstacle, the sample trajectory cluster generated by the sample vehicle, and the actual driving path of the sample vehicle within a certain period of time after the perception image timestamp in the future. The above information is used as the true value label of the sample perception image to supervise the training process of the target neural network.
[0047] S302: Perform feature extraction processing on the sample perception image using the feature extraction sub-network to be trained to obtain sample feature data of the sample perception image.
[0048] S303: Using the first prediction sub-network to be trained, perform a first prediction process on the sample feature data to obtain a predicted grid occupancy image of the sample obstacle in the sample perception image in the sample future time period; determine a first loss based on the predicted grid occupancy image and the actual grid occupancy image of the sample obstacle in the sample future time period, and use the first loss to train the first prediction sub-network to be trained and the feature extraction sub-network to be trained.
[0049] Here, the sample future time period is a time period determined based on the timestamp of the sample perception image and located after the timestamp. The first prediction subnetwork to be trained can obtain a predicted grid occupancy image of the sample perception image at the sample future time by performing a first prediction process on the sample feature data.
[0050] The predicted grid occupancy image is obtained by predicting the future occupancy distribution of the sample obstacles. The predicted grid occupancy image is a matrix with the same size and resolution as the original input sample perception image. The value of each element represents the probability that there is an obstacle in the real physical area corresponding to the grid. The value is between (0~1). The larger the value, the greater the possibility that the corresponding real physical area will be occupied by obstacles in the future.
[0051] Previously, the cross entropy between the predicted grid occupancy image and the actual grid occupancy image of the sample obstacle in the future period of the sample, that is, the first loss, was determined, and the model parameters of the first prediction subnetwork to be trained and the feature extraction subnetwork to be trained were adjusted using the first loss.
[0052] S304: Using the second prediction sub-network to be trained, perform a second prediction process on the sample feature data to obtain a sample cost matrix corresponding to the sample perceived image; determine a second loss based on the sample cost matrix and the first loss, and use the second loss to train the second prediction sub-network to be trained and the feature extraction sub-network to be trained.
[0053] Here, the first loss is the cross entropy loss between the predicted grid occupancy image determined in S303 and the actual grid occupancy image of the sample obstacle in the future time period of the sample. When generating the second loss, the first loss is used, and then the future grid occupancy prediction result of the obstacle by the first prediction sub-network can be used to supervise the training process of the second prediction sub-network, so that the cost matrix predicted by the trained second prediction sub-network can be affected by the future obstacle distribution to a certain extent, and has higher rationality.
[0054] Specifically, the embodiment of the present disclosure provides a specific method for determining the second loss based on the sample cost matrix and the predicted grid occupancy image, including the following steps M1 to M3: M1: Based on the sample cost matrix, determine the first-generation value corresponding to the actual driving trajectory of the sample vehicle in the sample future period and the second-generation value corresponding to multiple sample candidate driving trajectories associated with the perceived image.
[0055] For example, the following method can be used to determine the first-generation value corresponding to the actual driving trajectory of the sample vehicle in the future period of the sample according to the sample cost matrix: Project multiple real position points included in the real driving trajectory onto the sample cost matrix to obtain first projection points of the multiple real position points in the sample cost matrix respectively; sum the cost values of the corresponding elements of each of the first projection points in the sample cost matrix to obtain the first cost value.
[0056] Here, the sample cost matrix is, for example, a multidimensional matrix of m×n×k, wherein m and n correspond to the height and width of the matrix, that is, the number of rows and columns, respectively; and k represents the number of channels included in the matrix; wherein each matrix channel in the multidimensional matrix corresponds to a future time point, and multiple channels constitute multiple time points in the future period of the sample. The real driving trajectory corresponding to the sample perception image includes multiple position points; multiple position points also correspond to multiple future moments; when the values of the corresponding elements of each first projection point in the sample cost matrix are summed to obtain the first generation value, the value of the corresponding element of the first projection point in the sample cost matrix is, for example, based on the timestamp of the position point corresponding to each first projection point, from each matrix channel of the sample cost matrix, determine the target channel corresponding to each first projection point, and then take the value of the corresponding element in the sample cost matrix at the first projection point in the target channel.
[0057] Assume k=30; the actual driving trajectory includes 30 positions; among them, 30 channels correspond to the timestamps of the 30 positions. For the i-th position, assume that its position after projection to the image coordinate system is: (x, y), then corresponding to this position, each channel has a specific value. Then the element corresponding to the first projection point of the i-th position in the sample cost matrix is the position (x, y, i).
[0058] According to the above method, the cost values corresponding to the 30 position points in the actual driving trajectory can be obtained, and then the cost values corresponding to the 30 position points are summed to obtain the above first cost value.
[0059] When determining the second generation values corresponding to the plurality of sample candidate driving trajectories associated with the perceived image based on the sample cost matrix, the following method may be specifically adopted: For each sample candidate driving trajectory among multiple sample candidate driving trajectories, multiple candidate position points included in the sample candidate driving trajectory are projected onto the sample cost matrix to obtain second projection points of the multiple candidate position points in the sample cost matrix; the cost values corresponding to the second projection points corresponding to the multiple candidate position points in the sample cost matrix are summed to obtain the path cost of each sample candidate driving trajectory; the path costs corresponding to the multiple sample candidate driving trajectories are summed to obtain the second generation value.
[0060] Here, the method of determining the path cost of each sample candidate driving trajectory is similar to the method of determining the first-generation value of the real driving trajectory mentioned above, and will not be repeated here.
[0061] Then the path costs corresponding to multiple sample candidate driving trajectories are summed up to obtain the second-generation value.
[0062] M2: Determine a compensation loss value based on the real grid occupancy image corresponding to the sample obstacle, the real driving trajectory, and the plurality of sample candidate driving trajectories.
[0063] Here, the compensation loss can be determined in the following ways: Determine the minimum distance from the L2 distances between the plurality of sample candidate driving trajectories and the actual driving trajectory; and Projecting the candidate position point in each row of the plurality of sample candidate driving trajectories onto the real grid occupancy image to obtain a third projection point of the candidate position point in the real grid occupancy image; determining the occupation cost of the plurality of sample candidate driving trajectories according to the overlap degree of the sample obstacle distribution described by the third projection point and the real grid occupancy image; The minimum distance and the occupation cost are weightedly summed to obtain the compensation loss value.
[0064] Specifically, for example, for each of the multiple sample candidate driving trajectories, the L2 distance between each sample candidate driving trajectory and the actual driving trajectory may be determined, and then the minimum distance may be determined from all the obtained L2 distances.
[0065] Exemplarily, the minimum distance satisfies, for example:
[0066] in, represents the sample candidate driving trajectory; Indicates the actual driving trajectory.
[0067] When determining the occupation costs of the plurality of sample candidate driving trajectories according to the degree of overlap between the third projection point and the obstacle distribution described by the real grid occupation image, for each sample candidate driving trajectory, each candidate position point in the selected driving trajectory is projected onto the real grid occupation image of the obstacle respectively; if a candidate position point falls at the location of the obstacle, the occupation cost of the sample candidate driving trajectory is increased by a preset value.
[0068] Here, the real grid occupancy image and predicted grid occupancy image of the obstacle are similar to the above cost matrix, and also include layers corresponding to multiple time points in the target future period. Taking the real grid occupancy image as an example, the size of the real grid occupancy image is: m×n×k, where m and n represent the height and width of the real grid occupancy image, respectively, and k represents the number of channels of the real grid occupancy image. Each channel corresponds to a future moment. Assuming that the real grid occupancy image includes the real occupancy of the obstacle in the next 3 seconds, and k=30, it means that the future time period of 3 seconds includes 30 time points, and each time point corresponds to a channel of the real grid occupancy image. When projecting the sample candidate driving trajectory into the real grid occupancy image, it is assumed that the sample candidate driving trajectory also includes 30 candidate position points, and the candidate position points also correspond to each channel in the real grid occupancy image one by one. The pixel point corresponding to the third projection point (x, y) of the i-th candidate position point on the sample candidate driving trajectory in the real grid occupancy image is located on the i-th channel, and the position is: (x, y, i).
[0069] If the pixel value of the pixel at the (x, y, i) position in the real grid occupation image represents that an obstacle appears at the position at the corresponding future moment, the occupation cost of the sample candidate driving trajectory is increased by a preset value.
[0070] For example, the trajectory points of the sample candidate driving trajectory generated by sampling are mapped to the future real distribution of obstacles occupying obs_map. If the trajectory points fall in the real distribution of obstacles, then:
[0071] Represents the occupancy cost of the sample candidate driving trajectory.
[0072] Then, the minimum distance and the occupation cost are weighted and summed to obtain the compensation loss value. For example, the following formula (1) is satisfied: (1) in, and Represents the weight coefficient of the weighted summation.
[0073] M3: Obtain the second loss according to the first generation value, the second generation value, the compensation loss value and the first loss.
[0074] Here, the second loss satisfies the following equation (2), for example: (2) in, , , and Represents the weight coefficient.
[0075] Represents the first generation value, that is, the cost value obtained by mapping the actual driving trajectory of the sample vehicle to the sample cost matrix.
[0076] Represents the second-generation value, that is, the cost value obtained by mapping multiple candidate driving estimates generated by the sample vehicle trajectory sampler to the sample cost matrix.
[0077] represents the compensation loss value, which is calculated according to the above formula (1).
[0078] Represents the first loss, that is, the cross entropy loss based on the predicted grid occupancy image and the actual grid occupancy image of the sample obstacle in the future period of the sample.
[0079] After obtaining the second loss based on the above process, the second loss is used for back propagation to adjust the network parameters of the feature extraction subnetwork to be trained and the second prediction subnetwork to be trained, so as to realize the training process of the feature extraction subnetwork to be trained and the second prediction subnetwork to be trained.
[0080] Regarding S103 above: When determining the target driving trajectory from a plurality of candidate driving trajectories based on the future grid occupancy image and the cost matrix, for example, the method described in the following steps K1 to K2 may be adopted: Step K1: determining target costs corresponding to a plurality of candidate driving trajectories respectively according to the future grid occupancy image and the cost matrix; Specifically, when determining the target costs respectively corresponding to the plurality of candidate driving trajectories according to the future grid occupancy image and the cost matrix, for example, for each of the plurality of candidate driving trajectories, each candidate driving trajectory may be projected into the future grid occupancy image to determine the collision degree value of each candidate driving trajectory; and projecting each of the candidate driving trajectories onto the cost matrix to obtain a cost value of each of the candidate driving trajectories; The collision degree value and the cost value are weightedly summed to obtain the target cost of each candidate driving trajectory.
[0081] Here, the method of projecting each candidate driving trajectory into the future grid occupancy image includes, for example: Each candidate position point in the candidate driving trajectory is projected into the future grid occupation image to obtain a fourth projection point of each candidate position point in the candidate driving trajectory in the future grid occupation image.
[0082] And according to the timestamp corresponding to the candidate position point, a first target channel associated with the candidate position point is determined from the future grid occupancy image.
[0083] The collision value corresponding to the candidate position point is determined according to the value of the fourth projection point in the first target channel.
[0084] The collision values corresponding to each candidate position point in the candidate driving trajectory are added together to obtain the collision degree value of the candidate driving trajectory.
[0085] Specifically, when determining the collision value corresponding to the candidate position point based on the value of the fourth projection point in the first target channel, since the pixel value of each pixel point in a certain channel in the future grid occupies the image, it represents the probability of the obstacle appearing at the real physical position corresponding to the pixel point at the future moment corresponding to the channel. Therefore, the value of the fourth projection point in the first target channel can be used as the collision value of the candidate position point.
[0086] In addition, the value of the fourth projection point in the first target channel may be compared with a preset probability threshold; if the value of the fourth projection point in the first target channel is greater than the preset probability threshold, the collision value of the candidate position point is set to a first value, such as 1, 2, etc. If the value of the fourth projection point in the first target channel is less than or equal to the probability threshold, the collision value of the candidate position point is set to a second value, such as 0, etc.
[0087] At the same time, when projecting each candidate driving trajectory to the cost matrix, for example, the selected position point in each candidate driving trajectory is projected to the cost matrix to obtain the fifth projection point of each candidate position point in the cost matrix.
[0088] And according to the timestamp corresponding to the candidate position point, a second target channel associated with the candidate position point is determined from the cost matrix.
[0089] The cost value corresponding to the candidate position point is determined according to the value of the fifth projection point in the second target channel.
[0090] Then, the cost values corresponding to the multiple candidate position points in the candidate driving trajectory are summed to obtain the cost value of the candidate driving trajectory.
[0091] Afterwards, the collision degree value and the cost value are weightedly summed to obtain the target cost of each candidate driving trajectory.
[0092] For example, the target cost of any candidate driving trajectory is Satisfies the following formula (3): (3) and Represents the weight of the weighted summation.
[0093] It represents projecting each candidate driving trajectory onto the cost matrix to obtain the cost value of each candidate driving trajectory.
[0094] It represents projecting the i-th candidate driving trajectory into the future grid occupation image to determine the collision degree value of each candidate driving trajectory.
[0095] Step K2: determining the target driving trajectory from the plurality of candidate driving trajectories according to the target costs respectively corresponding to the plurality of candidate driving trajectories.
[0096] Here, since the target cost corresponding to each candidate driving trajectory is larger, the risk value of the driving trajectory colliding with an obstacle or leaving a non-driving area is higher. Furthermore, in the disclosed embodiment, when determining the target driving trajectory from the plurality of candidate driving trajectories according to the target costs corresponding to the plurality of candidate driving trajectories, for example, the driving trajectory with the smallest target cost can be determined from the plurality of candidate driving trajectories as the target driving trajectory.
[0097] In addition, in order to ensure the stability of the vehicle when traveling along the target driving trajectory, other screening conditions can be added, such as: a smaller angle with the driving direction of the target vehicle, reducing lane changes, etc., for more refined screening.
[0098] After the target driving trajectory is determined, the target vehicle can be controlled to travel according to the target driving trajectory.
[0099] The target neural network used in the road planning method provided in the embodiment of the present disclosure includes a feature extraction subnetwork, a first prediction subnetwork and a second prediction subnetwork; the first prediction subnetwork is used to predict the future grid occupancy of obstacles; the second prediction subnetwork performs cost matrix prediction; and when training the target neural network, the model loss corresponding to the second prediction subnetwork is generated by the prediction results of the cost matrix prediction of the sample perception image and the prediction results of the future grid occupancy prediction of the BEV sample image, and then the possible future occupancy of the obstacle is used to supervise the training process of the second prediction subnetwork, so that the cost matrix predicted by the target neural network model is more reasonable, and the possible location of future obstacles can be better avoided, thereby improving safety during driving.
[0100] Those skilled in the art will appreciate that, in the above method of specific implementation, the order in which the steps are written does not imply a strict execution order and does not constitute any limitation on the implementation process. The specific execution order of the steps should be determined by their functions and possible internal logic.
[0101] The present disclosure also provides a vehicle-mounted device, such as Figure 4 FIG. 1 is a schematic diagram of a computer device structure provided in an embodiment of the present disclosure, including: A processor 41 and a memory 42; the memory 42 stores machine-readable instructions executable by the processor 41, and the processor 41 is used to execute the machine-readable instructions stored in the memory 42. When the machine-readable instructions are executed by the processor 41, the processor 41 performs the following steps: Obtaining a perception image of the target vehicle at the current position; Inputting the perceived image into a pre-trained target neural network for processing to obtain a future grid occupancy image of the target obstacle included in the perceived image and a cost matrix corresponding to the perceived image; Determining a target driving trajectory from a plurality of candidate driving trajectories based on the future grid occupancy image and the cost matrix; Among them, the target neural network includes: a feature extraction subnetwork, a first prediction subnetwork and a second prediction subnetwork; the first prediction subnetwork is used to predict the future grid occupancy of obstacles; the second prediction subnetwork performs cost matrix prediction; and when training the target neural network, the model loss corresponding to the second prediction subnetwork is generated through the prediction results of the cost matrix prediction of the sample perception image and the prediction results of the future grid occupancy prediction of the BEV sample image.
[0102] The above-mentioned memory 42 includes internal memory 421 and external memory 422; the memory 421 here is also called internal memory, which is used to temporarily store the calculation data in the processor 41 and the data exchanged with the external memory 422 such as the hard disk. The processor 41 exchanges data with the external memory 422 through the internal memory 421.
[0103] The specific execution process of the above instructions can refer to the steps of the trajectory planning method described in the embodiment of the present disclosure, which will not be repeated here.
[0104] Another embodiment of the present disclosure further provides a vehicle, comprising the vehicle-mounted device as described in the above embodiment.
[0105] The present disclosure also provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, the steps of the trajectory planning method described in the above method embodiment are executed. The storage medium may be a volatile or non-volatile computer-readable storage medium.
[0106] The present disclosure also provides a computer program product that carries a program code. The program code includes instructions that can be used to execute the steps of the trajectory planning method described in the above method embodiment. For details, please refer to the above method embodiment, which will not be repeated here.
[0107] The computer program product may be implemented in hardware, software or a combination thereof. In one optional embodiment, the computer program product is implemented as a computer storage medium. In another optional embodiment, the computer program product is implemented as a software product, such as a software development kit (SDK).
[0108] Those skilled in the art can clearly understand that, for the convenience and simplicity of description, the specific working process of the system and device described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here. In the several embodiments provided in the present disclosure, it should be understood that the disclosed system, device and method can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, and the indirect coupling or communication connection of the device or unit can be electrical, mechanical or other forms.
[0109] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0110] In addition, each functional unit in each embodiment of the present disclosure may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0111] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a non-volatile computer-readable storage medium that is executable by a processor. Based on this understanding, the technical solution of the present disclosure, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present disclosure. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0112] Finally, it should be noted that the above-described embodiments are only specific implementation methods of the present disclosure, which are used to illustrate the technical solutions of the present disclosure, rather than to limit them. The protection scope of the present disclosure is not limited thereto. Although the present disclosure is described in detail with reference to the above-described embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the above-described embodiments within the technical scope disclosed in the present disclosure, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present disclosure, and should be included in the protection scope of the present disclosure. Therefore, the protection scope of the present disclosure should be based on the protection scope of the claims.
Claims
1. A trajectory planning method, characterized in that: include: Obtaining a perception image of the target vehicle at the current position; Inputting the perceived image into a pre-trained target neural network for processing to obtain a future grid occupancy image of the target obstacle included in the perceived image and a cost matrix corresponding to the perceived image; Determining a target driving trajectory from a plurality of candidate driving trajectories based on the future grid occupancy image and the cost matrix; Among them, the target neural network includes: a feature extraction subnetwork, a first prediction subnetwork and a second prediction subnetwork; the first prediction subnetwork is used to predict the future grid occupancy of obstacles; the second prediction subnetwork performs cost matrix prediction; and during the training process of the target neural network, the model loss corresponding to the second prediction subnetwork is generated based on the prediction results of the cost matrix prediction of the sample perception image and the prediction results of the future grid occupancy prediction of the sample image.
2. The method according to claim 1, characterized in that The target neural network is trained in the following way: Acquire the sample image generated by the sample vehicle during driving; Performing feature extraction processing on the sample image using the feature extraction subnetwork to be trained to obtain sample feature data of the sample image; Using a first prediction subnetwork to be trained, performing a first prediction process on the sample feature data to obtain a predicted grid occupancy image of a sample obstacle in the sample image in a future sample period; determining a first loss based on the predicted grid occupancy image and an actual grid occupancy image of the sample obstacle in the future sample period, and using the first loss to train the first prediction subnetwork to be trained and the feature extraction subnetwork to be trained; And, using the second prediction sub-network to be trained, perform a second prediction processing on the sample feature data to obtain a sample cost matrix corresponding to the sample perceived image; determine a second loss based on the sample cost matrix and the first loss, and use the second loss to train the second prediction sub-network to be trained and the feature extraction sub-network to be trained to generate the target neural network.
3. The method according to claim 2, characterized in that The determining the second loss based on the sample cost matrix and the first loss includes: Based on the sample cost matrix, determining a first-generation value corresponding to a real driving trajectory of the sample vehicle in the sample future time period and a second-generation value corresponding to a plurality of sample candidate driving trajectories associated with the perceived image; and, determining a compensation loss value based on a real grid occupancy image corresponding to the sample obstacle, the real driving trajectory, and a plurality of the sample candidate driving trajectories; The second loss is obtained according to the first generation value, the second generation value, the compensation loss value and the first loss.
4. The method according to claim 3, characterized in that The determining, based on the sample cost matrix, of a first-generation value corresponding to the real driving trajectory of the sample vehicle in the sample future period and a second-generation value corresponding to a plurality of sample candidate driving trajectories associated with the perceived image, comprises: Projecting a plurality of real position points included in the real driving trajectory onto the sample cost matrix to obtain first projection points of the plurality of real position points in the sample cost matrix; summing the cost values of the corresponding elements of each of the first projection points in the sample cost matrix to obtain the first cost value; Furthermore, for each of the multiple sample candidate driving trajectories, the multiple candidate position points included in the sample candidate driving trajectories are projected onto the sample cost matrix to obtain the second projection points of the multiple candidate position points in the sample cost matrix; the cost values corresponding to the second projection points corresponding to the multiple candidate position points in the sample cost matrix are summed to obtain the path cost of each sample candidate driving trajectory; the path costs corresponding to the multiple sample candidate driving trajectories are summed to obtain the second generation value.
5. The method according to claim 3 or 4, characterized in that: The determining of the compensation loss value based on the predicted grid occupancy image, the actual driving trajectory, and the plurality of sample candidate driving trajectories includes: Determine the minimum distance from the L2 distances between the plurality of sample candidate driving trajectories and the actual driving trajectory; and Projecting the candidate position point in each row of the plurality of sample candidate driving trajectories onto the real grid occupancy image to obtain a third projection point of the candidate position point in the real grid occupancy image; determining the occupation cost of the plurality of sample candidate driving trajectories according to the overlap degree of the sample obstacle distribution described by the third projection point and the real grid occupancy image; The minimum distance and the occupation cost are weightedly summed to obtain the compensation loss value.
6. The method according to any one of claims 1 to 4, characterized in that: The step of determining a target driving trajectory from a plurality of candidate driving trajectories based on the future grid occupancy image and the cost matrix includes: Determining target costs corresponding to a plurality of candidate driving trajectories respectively according to the future grid occupancy image and the cost matrix; The target driving trajectory is determined from the multiple candidate driving trajectories according to the target costs respectively corresponding to the multiple candidate driving trajectories.
7. The method according to claim 6, characterized in that The determining, according to the future grid occupancy image and the cost matrix, target costs corresponding to the plurality of candidate driving trajectories respectively comprises: For each of the plurality of candidate driving trajectories, projecting each candidate driving trajectory into the future grid occupation image, and determining a collision degree value of each candidate driving trajectory; and projecting each of the candidate driving trajectories onto the cost matrix to obtain a cost value of each of the candidate driving trajectories; The collision degree value and the cost value are weightedly summed to obtain the target cost of each candidate driving trajectory.
8. The method according to any one of claims 1 to 4, characterized in that: The perception image includes four channels; the four channels are respectively used to store obstacle information, navigation line information, lane line information, and the vehicle's current grid occupancy and historical grid occupancy information.
9. A vehicle-mounted device, characterized in that: include: processor; The processor is used to execute the trajectory planning method as described in any one of claims 1-8.
10. A vehicle, characterized in that: include: A vehicle body and the vehicle-mounted device as claimed in claim 9.
11. A computer program product, characterized in that The computer program product carries a program code, and the program code includes instructions that can be used to execute the steps of the trajectory planning method according to any one of claims 1-8.
Citation Information
Patent Citations
Intelligent obstacle avoidance system and method of autonomous vehicle
CN110371112A
Technology to generalize safe driving experiences for automated vehicle behavior prediction
CN113844461A
Vehicle driving control method and system and computer readable storage medium
CN113942524A
Vehicle trajectory prediction method, neural network prediction model training method and device
CN117079235A
Vehicle control method, vehicle, electronic equipment and storage medium
CN117360546A
Cited By
Model training method, trajectory planning method, electronic device and program product
CN121580352A
