Neural network, self-driving method, and apparatus
Through the combination of expert hybrid MOE network and parallel head network, the interactivity and independence between autonomous driving tasks are realized, which solves the problem of mutual influence of prediction, decision-making and planning in the existing technology, and improves the output accuracy and accuracy of autonomous driving. Generalization ability.
Patent Information
- Application Number
- PCT/CN2024/077817
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-03-27
- Filing Date
- 2024-02-20
- Publication Date
- 2024-10-03
AI Technical Summary
Existing autonomous driving solutions based on neural networks fail to effectively consider the impact and needs of prediction, decision-making, and planning, resulting in output results that cannot meet actual driving needs.
The expert hybrid MOE network and multiple parallel head networks are used to uniformly encode the input data through the MOE network to achieve interactivity and independence between autonomous driving tasks, improve the model's generalization ability in multiple scenarios, and pass Multi-task unified encoding reduces computing power consumption.
It improves the accuracy and generalization ability of the output results of autonomous driving tasks, meets actual driving needs, and reduces the consumption of computing resources.
Smart Images

Figure CN2024077817_03102024_PF_FP_ABST
Abstract
Description
Neural network, autonomous driving method and device
[0001] This application claims priority to the Chinese patent application filed with the State Intellectual Property Office of China on March 27, 2023, with application number 202310334909.X and invention name “Neural Network, Autonomous Driving Method and Device”, the entire contents of which are incorporated by reference into this application. Technical Field
[0002] The present application relates to the field of autonomous driving technology, and in particular to a neural network, an autonomous driving method and an apparatus. Background Art
[0003] As the most essential module in an autonomous driving system, the decision-making and planning module is responsible for determining and planning the vehicle's next actions based on historical and current status. For example, if a car ahead is illegally parked and blocking the road, the vehicle will decide whether to change lanes, as well as when and how to do so. The prediction module plays a crucial role in interactive scenarios. Accurately predicting the next actions of other vehicles allows the vehicle to plan ahead and avoid collision risks.
[0004] Prediction, decision-making, and planning in autonomous driving have always been challenging, owing to their complexity, stemming from the diversity of traffic environments and the uncertainty of traffic participants' movements. Existing rule-based decision-making and planning methods rely on abstracted features and experience from algorithm designers. Their modeling capabilities for complex scenarios are limited, making it difficult to achieve comprehensive generalization across all scenarios. Consequently, non-human-like decision-making and planning results are often produced. With the advancement of deep learning, learning to drive by imitating the performance of human drivers through neural networks has become a major trend. By collecting massive amounts of human driver driving data and environmental data, networks can be trained to predict the future movement of obstacles, making decisions and planning for the vehicle's behavior and trajectory based on historical and current vehicle states, obstacle states, and environmental information.
[0005] However, existing neural network-based autonomous driving solutions do not consider the mutual influence and needs of prediction, decision-making and planning, so the output results of the solutions cannot meet actual driving needs.
[0006] Summary of the Invention
[0007] The embodiments of the present application provide a neural network, an autonomous driving method, and an apparatus, which can enable each autonomous driving task to maintain a certain degree of independence while maintaining a certain degree of interaction, and better meet actual driving needs.
[0008] In a first aspect, the present application provides a neural network for autonomous driving, comprising a mixture of experts (MOE) network and N parallel head networks, where N is a positive integer; wherein the MOE network is used to perform feature extraction and feature fusion on input data to obtain N types of feature data; wherein the input data includes vehicle data, obstacle data, road topology data, and navigation data, and the N types of feature data correspond one-to-one to the N parallel head networks, and each of the N parallel head networks corresponds to an autonomous driving task; each head network performs the corresponding autonomous driving task based on the corresponding input feature data; wherein the autonomous driving tasks include prediction tasks, decision tasks, and planning tasks.
[0009] From the perspective of technical effects, this application uses the MOE network to uniformly encode (i.e., extract features) the data required for each autonomous driving task, so that each autonomous driving task maintains a certain degree of interactivity (i.e., there is no specific upstream and downstream relationship between the head networks used to perform different autonomous driving tasks. Therefore, during the training process, the output results of each head network will be used to update the entire neural network, so that the head networks can influence each other). At the same time, since the head networks corresponding to each autonomous driving task have independent outputs, the head networks corresponding to each autonomous driving task can also be optimized independently (i.e., each network maintains a certain degree of independence), which is more in line with actual driving needs. In addition, using the MOE network for unified encoding can significantly increase the number of neural network model parameters while keeping the amount of computation basically unchanged during the inference process, effectively improving the model's generalization ability in multiple scenarios. At the same time, compared with single-task independent encoding, multi-task unified encoding can effectively save computing power consumption and shorten latency.
[0010] In a feasible embodiment, the MOE network includes multiple expert networks, each of the multiple expert networks includes a self-attention network and a mutual attention network; wherein, the self-attention network is used to extract features of the input data, and the mutual attention network is used to perform feature fusion on the features extracted by the self-attention network, and the N types of feature data are generated through the output results of the mutual attention network.
[0011] In a feasible embodiment, the multiple expert networks include a first expert network, which is an expert network that performs feature extraction and feature fusion on the input data during the reasoning process. The first expert network includes a first self-attention network, a first mutual attention network, a second self-attention network, and a second mutual attention network; the first self-attention network is used to perform feature extraction on the vehicle data and the obstacle data to obtain a first query matrix, a first key matrix, and a first value matrix; the second self-attention network is used to perform feature extraction on the road topology data and the navigation data to obtain a second query matrix, a second key matrix, and a second value matrix; the first mutual attention network is used to perform feature fusion on the first Query matrix, the second Key matrix, and the second Value matrix; the second mutual attention network is used to perform feature fusion on the second Query matrix, the first Key matrix, and the first Value matrix; the N types of feature data are generated through the output results of the first mutual attention network and the output results of the second mutual attention network.
[0012] From a technical perspective, this application adopts a cascade structure of self-attention and mutual attention in each expert network, which can make the feature data output by the MOE network for performing various autonomous driving tasks contain more information, thereby improving the accuracy of the output results corresponding to each autonomous driving task.
[0013] In a feasible implementation, the output results corresponding to the prediction task include the predicted trajectory of the obstacle and the distribution of the predicted trajectory of the obstacle; the output results corresponding to the decision task include the vehicle decision, which includes the vehicle seizure decision, the vehicle avoidance decision, and ignoring the obstacle; the output results corresponding to the planning task include the planned road of the vehicle, the planned trajectory of the vehicle, and the planned trajectory distribution of the vehicle.
[0014] In a second aspect, the present application provides a training method for a neural network, wherein the neural network includes an expert hybrid MOE network and N parallel head networks, and the MOE network includes M expert networks, where M and N are positive integers; the method includes: in each training process, performing feature extraction and feature fusion on each training data in a batch of training data by each expert network in the M expert networks to obtain N types of feature data; weighting the feature data of the same type output by the M expert networks respectively to obtain N types of weighted feature data; wherein the weighted N types of feature data correspond one-to-one to the N parallel head networks, and each head network in the N parallel head networks corresponds to an automatic driving The method comprises the following steps: inputting the weighted N types of feature data into the corresponding head network to obtain H types of output results corresponding to each training data, wherein the H types of output results include K types of output results, and K is a positive integer less than or equal to H; accumulating the loss values of part or all of the output results of each type of output result in the K types of output results obtained from the batch of training data to obtain K accumulated loss values corresponding to the K types of output results; weighting the K accumulated loss values to obtain a loss value corresponding to each training process; and updating the parameters in the neural network using the loss value.
[0015] Among them, the above K types of output results correspond to at least one autonomous driving task.
[0016] From a technical perspective, this application can select K types of output results related to the scenario from H types of output results during training for a specific application scenario, and then update the parameters in at least one head network corresponding to the K types of output results to achieve single-task training or multi-task joint training. At the same time, by selecting some or all of the output results from each type of K types for training, it is possible to select corresponding data for training for each autonomous driving task, thereby ensuring the generalization of each task and effectively improving the accuracy of the output results of each autonomous driving task.
[0017] In a feasible implementation, the K types of output results include first-type output results, and the K types of output results obtained from the batch of training data include F first-type output results, and the F first-type output results all correspond to the first autonomous driving task in the autonomous driving tasks; the F first-type output results include E first-type output results, and the training data used to calculate the E first-type output results all carry labels representing the first autonomous driving task, and the accumulated loss value corresponding to the first-type output result is obtained by accumulating the E loss values corresponding to the E first-type output results, and E is a positive integer less than or equal to F.
[0018] From a technical perspective, by adding a label representing the autonomous driving task to each piece of training data, it is possible to determine whether to use the data to train the corresponding autonomous driving task. The training data can be used selectively based on specific application scenarios, thereby meeting the scenario requirements, improving the accuracy of the neural network output results, and reducing the computing power consumption of the training process.
[0019] In a feasible embodiment, the N parallel head networks include a first head network, which outputs D-type output results, and the H-type output results include the D-type output results, where D is a positive integer; after using the one loss value to update the parameters in the neural network, the method further includes: inputting G training data in the training set into the updated neural network respectively to obtain the D-type output results output by the first head network, the training set includes the one batch of training data, and G is a positive integer; accumulating the loss values of part or all of the output results in each type of output results in the D-type output results to obtain D accumulated loss values corresponding to the D-type output results respectively; weighting the D accumulated loss values to obtain the first loss value corresponding to the first head network in each training process; and using the first loss value to update the parameters in the first head network.
[0020] The first head network is any one of the N parallel head networks.
[0021] From a technical perspective, during each training process, after updating the parameters of the entire neural network, the head network is adjusted by calculating the loss value corresponding to the output result of each head network, thereby achieving independent update and optimization of each head network, thereby achieving targeted optimization of each autonomous driving task and improving the accuracy of the output results corresponding to each autonomous driving task.
[0022] In a feasible embodiment, the N parallel head networks include L head networks, the L head networks correspond to the first autonomous driving task, the L head networks output P-type output results, the H-type output results include the P-type output results, L and P are positive integers greater than or equal to 2; after using the one loss value to update the parameters in the neural network, the method further includes: inputting G training data in the training set into the updated neural network respectively to obtain the P-type output results output by the L head networks, the training set includes the one batch of training data, G is a positive integer; accumulating the loss values of part or all of the output results in each type of output results in the P-type output results to obtain P accumulated loss values corresponding to the P-type output results respectively; weighting the P accumulated loss values to obtain a second loss value corresponding to the L head networks in each training process; and using the second loss value to update the parameters in the L head networks.
[0023] Among them, the above-mentioned L head networks are also the head networks corresponding to the first autonomous driving task in the N head networks.
[0024] From a technical perspective, during each training process, after updating the parameters of the entire neural network, the output results of the head network corresponding to each autonomous driving task are calculated to optimize one or more head networks corresponding to the autonomous driving task. This allows independent updating and optimization of the one or more head networks corresponding to each autonomous driving task, thereby achieving targeted optimization of the corresponding autonomous driving tasks and improving the accuracy of the output results corresponding to each autonomous driving task.
[0025] In a feasible implementation, the multiple types of output results include the predicted trajectory of the obstacle, the predicted trajectory distribution of the obstacle, the decision of the ego vehicle, the planned path of the ego vehicle, the planned trajectory of the ego vehicle, and the planned trajectory distribution of the ego vehicle; the predicted trajectory of the obstacle and the predicted trajectory distribution of the obstacle correspond to the prediction task, the decision of the ego vehicle corresponds to the decision task, and the planned path of the ego vehicle, the planned trajectory of the ego vehicle, and the planned trajectory distribution of the ego vehicle correspond to the planning task.
[0026] In a third aspect, the present application provides an autonomous driving method, comprising: obtaining input data, wherein the input data includes vehicle data, obstacle data, road topology data, and navigation data; performing feature extraction and feature fusion on the input data using a mixture of experts (MOE) network in a neural network to obtain N types of feature data, wherein the neural network further comprises N parallel head networks, where N is a positive integer; inputting each type of feature data into a corresponding head network of the N parallel head networks to perform an autonomous driving task corresponding to the head network; and controlling the vehicle based on the output result of each autonomous driving task.
[0027] In a feasible embodiment, each training process of the neural network is as follows: each expert network in the MOE network is used to perform feature extraction and feature fusion on each training data in a batch of training data to obtain the N types of feature data; the neural network is also used to weight the feature data of the same type output by the MOE network respectively to obtain the weighted N types of feature data; and the weighted N types of feature data are respectively input into the corresponding head network to obtain H types of output results corresponding to each training data, and the H types of output results include K types of output results, K is a positive integer less than or equal to H; the update of the neural network parameters is completed according to a loss value corresponding to each training process, and the loss value is obtained by weighting K accumulated loss values, and the K accumulated loss values correspond to the K types of output results one by one, and the K accumulated loss values are obtained by accumulating the loss values of part or all of the output results in each type of output results in the K types of output results obtained from the batch of training data.
[0028] In a feasible implementation, the K types of output results include first-type output results, and the K types of output results obtained from one batch of training data include F first-type output results, and the F first-type output results all correspond to the first autonomous driving task in the autonomous driving tasks; the F first-type output results include E first-type output results, and the training data used to calculate the E first-type output results all carry labels representing the first autonomous driving task, and the accumulated loss value corresponding to the first-type output result is obtained by accumulating the E loss values corresponding to the E first-type output results, and E is a positive integer less than or equal to F.
[0029] In a feasible embodiment, the N parallel head networks include a first head network, which outputs D-type output results, and the multiple types of output results include the D-type output results, where D is a positive integer; after using the one loss value to update the parameters in the neural network, the method also includes: inputting G training data in the training set into the updated neural network respectively to obtain the D-type output results output by the first head network, the training set includes the one batch of training data, and G is a positive integer; accumulating the loss values of part or all of the output results in each type of output results in the D-type output results to obtain D accumulated loss values corresponding to the D-type output results respectively; weighting the D accumulated loss values to obtain the first loss value corresponding to the first head network in each training process; using the first loss value to update the parameters in the first head network or adjust the structure of the first head network.
[0030] In a feasible embodiment, the N parallel head networks include L head networks, the L head networks correspond to the first autonomous driving task, the L head networks output P-type output results, the H-type output results include the P-type output results, L and P are positive integers greater than or equal to 2; after using the one loss value to update the parameters in the neural network, the method further includes: inputting G training data in the training set into the updated neural network respectively to obtain the P-type output results output by the L head networks, the training set includes the one batch of training data, G is a positive integer; accumulating the loss values of part or all of the output results in each type of output results in the P-type output results to obtain P accumulated loss values corresponding to the P-type output results respectively; weighting the P accumulated loss values to obtain a second loss value corresponding to the L head networks in each training process; and using the second loss value to update the parameters in the L head networks.
[0031] In a feasible embodiment, the MOE network includes multiple expert networks, each of the multiple expert networks includes a self-attention network and a mutual attention network; wherein, the self-attention network is used to extract features of the input data, and the mutual attention network is used to perform feature fusion on the features extracted by the self-attention network, and the N types of feature data are generated through the output results of the mutual attention network.
[0032] In a feasible implementation, the autonomous driving task includes a prediction task, a decision task, and a planning task; the output result of the prediction task includes the predicted trajectory of the obstacle and the predicted trajectory distribution of the obstacle, the output result of the decision task includes the ego vehicle decision, and the output result of the planning task includes the planned road of the ego vehicle, the planned trajectory of the ego vehicle, and the planned trajectory distribution of the ego vehicle.
[0033] In a fourth aspect, the present application provides a neural network training device, wherein the neural network includes an expert mixture MOE network and N parallel head networks, the MOE network includes M expert networks, where M and N are positive integers; the device includes: an encoding unit for performing feature extraction and feature fusion on each training data in a batch of training data through each expert network in the M expert networks during each training process to obtain N types of feature data; and weighting the same type of feature data output by the M expert networks to obtain weighted N types of feature data; wherein the weighted N types of feature data correspond one-to-one to the N parallel head networks, and each of the N parallel head networks corresponds to an autonomous driving task, The autonomous driving task includes a prediction task, a decision task and a planning task; a decoding unit is used to input the weighted N types of feature data into the corresponding head network respectively to obtain H types of output results corresponding to each training data, and the H types of output results include K types of output results, K is a positive integer less than or equal to H; an updating unit is used to accumulate the loss values of part or all of the output results of each type of output result in the K types of output results obtained from the batch of training data to obtain K accumulated loss values corresponding to the K types of output results respectively; and weight the K accumulated loss values to obtain a loss value corresponding to each training process; and use the one loss value to update the parameters in the neural network.
[0034] In a feasible implementation, the K types of output results include first-type output results, and the K types of output results obtained from the batch of training data include F first-type output results, and the F first-type output results all correspond to the first autonomous driving task in the autonomous driving tasks; the F first-type output results include E first-type output results, and the training data used to calculate the E first-type output results all carry labels representing the first autonomous driving task, and the accumulated loss value corresponding to the first-type output result is obtained by accumulating the E loss values corresponding to the E first-type output results, and E is a positive integer less than or equal to F.
[0035] In a feasible embodiment, the N parallel head networks include a first head network, which outputs D-type output results, and the H-type output results include the D-type output results, where D is a positive integer; after using the one loss value to update the parameters in the neural network, the encoding unit and the decoding unit are further used to: process G training data in the training set through the updated neural network to obtain the D-type output results output by the first head network, where the training set includes the one batch of training data, and G is a positive integer; the updating unit is further used to accumulate the loss values of part or all of the output results in each type of output results in the D-type output results to obtain D accumulated loss values corresponding to the D-type output results respectively; and weight the D accumulated loss values to obtain a first loss value corresponding to the first head network in each training process; and use the first loss value to update the parameters in the first head network.
[0036] In a feasible embodiment, the N parallel head networks include L head networks, the L head networks correspond to the first autonomous driving task, the L head networks output P-type output results, the H-type output results include the P-type output results, and L and P are positive integers greater than or equal to 2; after using the one loss value to update the parameters in the neural network, the encoding unit and the decoding unit are further used to: process G training data in the training set by the updated neural network to obtain the P-type output results output by the L head networks, the training set includes the one batch of training data, and G is a positive integer; the updating unit is further used to accumulate the loss values of part or all of the output results in each type of output results in the P-type output results to obtain P accumulated loss values corresponding to the P-type output results respectively; and weight the P accumulated loss values to obtain a second loss value corresponding to the L head networks in each training process; and use the second loss value to update the parameters in the L head networks.
[0037] In a feasible implementation, the H-type output results include the predicted trajectory of the obstacle, the predicted trajectory distribution of the obstacle, the ego vehicle decision, the planned road of the ego vehicle, the planned trajectory of the ego vehicle, and the planned trajectory distribution of the ego vehicle; the predicted trajectory of the obstacle and the predicted trajectory distribution of the obstacle correspond to the prediction task, the ego vehicle decision corresponds to the decision task, and the planned road of the ego vehicle, the planned trajectory of the ego vehicle, and the planned trajectory distribution of the ego vehicle correspond to the planning task.
[0038] In a fifth aspect, the present application provides an autonomous driving device, comprising: an acquisition unit for acquiring input data, wherein the input data includes vehicle data, obstacle data, road topology data, and navigation data; a processing unit for performing feature extraction and feature fusion on the input data using a mixture of experts (MOE) network in a neural network to obtain N types of feature data, wherein the neural network further comprises N parallel head networks, where N is a positive integer; and inputting each type of feature data into a corresponding head network of the N parallel head networks to perform an autonomous driving task corresponding to the head network; and a control unit for controlling the vehicle based on the output result of each autonomous driving task.
[0039] In a feasible embodiment, during each training process of the neural network, the processing unit is specifically used to: perform feature extraction and feature fusion on each training data in a batch of training data through each expert network in the MOE network to obtain the N types of feature data; and weight the feature data of the same type output by the MOE network through the neural network to obtain the weighted N types of feature data; and input the weighted N types of feature data into the corresponding head network to obtain H types of output results corresponding to each training data, the H types of output results include K types of output results, K is a positive integer less than or equal to H; wherein, the updating of the neural network parameters is completed according to a loss value corresponding to each training process, the loss value is obtained by weighting K accumulated loss values, the K accumulated loss values correspond to the K types of output results one by one, and the K accumulated loss values are obtained by accumulating the loss values of part or all of the output results of each type of output results in the K types of output results obtained for the batch of training data.
[0040] In a feasible implementation, the K types of output results include first-type output results, and the K types of output results obtained from one batch of training data include F first-type output results, and the F first-type output results all correspond to the first autonomous driving task in the autonomous driving tasks; the F first-type output results include E first-type output results, and the training data used to calculate the E first-type output results all carry labels representing the first autonomous driving task, and the accumulated loss value corresponding to the first-type output result is obtained by accumulating the E loss values corresponding to the E first-type output results, and E is a positive integer less than or equal to F.
[0041] In a feasible embodiment, the N parallel head networks include a first head network, which outputs D-type output results, and the multiple types of output results include the D-type output results, where D is a positive integer; after using the one loss value to update the parameters in the neural network, the processing unit is also used to: use the updated neural network to process G training data in the training set to obtain the D-type output results output by the first head network, where the training set includes the one batch of training data, and G is a positive integer; accumulate the loss values of part or all of the output results in each type of output results in the D-type output results to obtain D accumulated loss values corresponding to the D-type output results respectively; weight the D accumulated loss values to obtain the first loss value corresponding to the first head network in each training process; and use the first loss value to update the parameters in the first head network.
[0042] In a feasible embodiment, the N parallel head networks include L head networks, the L head networks correspond to the first autonomous driving task, the L head networks output P-type output results, the H-type output results include the P-type output results, L and P are positive integers greater than or equal to 2; after using the one loss value to update the parameters in the neural network, the processing unit is further used to: use the updated neural network to process G training data in the training set to obtain the P-type output results output by the L head networks, the training set includes the one batch of training data, G is a positive integer; accumulate the loss values of part or all of the output results in each type of output results in the P-type output results to obtain P accumulated loss values corresponding to the P-type output results respectively; weight the P accumulated loss values to obtain a second loss value corresponding to the L head networks in each training process; and use the second loss value to update the parameters in the L head networks.
[0043] In a feasible embodiment, the MOE network includes multiple expert networks, each of the multiple expert networks includes a self-attention network and a mutual attention network; wherein, the self-attention network is used to extract features of the input data, and the mutual attention network is used to perform feature fusion on the features extracted by the self-attention network, and the N types of feature data are generated through the output results of the mutual attention network.
[0044] In a feasible implementation, the autonomous driving task includes a prediction task, a decision task, and a planning task; the output result of the prediction task includes the predicted trajectory of the obstacle and the predicted trajectory distribution of the obstacle, the output result of the decision task includes the ego vehicle decision, and the output result of the planning task includes the planned road of the ego vehicle, the planned trajectory of the ego vehicle, and the planned trajectory distribution of the ego vehicle.
[0045] In the sixth aspect, an embodiment of the present application provides a chip system, which includes at least one processor, a memory and an interface circuit, wherein the memory, the interface circuit and the at least one processor are interconnected through lines, and instructions are stored in the at least one memory; when the instructions are executed by the processor, any method described in the aforementioned second aspect is implemented.
[0046] In the seventh aspect, an embodiment of the present application provides a chip system, which includes at least one processor, a memory and an interface circuit, wherein the memory, the interface circuit and the at least one processor are interconnected through lines, and instructions are stored in the at least one memory; when the instructions are executed by the processor, any method described in the aforementioned third aspect is implemented.
[0047] In an eighth aspect, an embodiment of the present application provides a server, which includes the chip system described in the sixth or seventh aspect.
[0048] In the ninth aspect, an embodiment of the present application provides a vehicle, which includes the chip system described in the seventh aspect.
[0049] In the tenth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program. When the computer program is executed, the method described in any one of the second aspect and / or third aspect above is implemented.
[0050] In the eleventh aspect, an embodiment of the present application provides a computer program product, which includes instructions. When the instructions are executed, the method described in any one of the second and / or third aspects above is implemented. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] The following is an introduction to the drawings used in the embodiments of this application.
[0052] FIG1 is a schematic diagram of an application scenario provided by an embodiment of the present application;
[0053] FIG2 is a schematic diagram of a process of a neural network performing an autonomous driving task according to an embodiment of the present application;
[0054] FIG3 is a schematic diagram of a flow chart of a method for executing autonomous driving using a neural network provided in an embodiment of the present application;
[0055] FIG4 is a schematic diagram of the structure of a neural network for autonomous driving provided by this application;
[0056] FIG5 is a flow chart of a neural network training method provided in an embodiment of the present application;
[0057] Figures 6a-6b are schematic diagrams of the training process of a neural network provided in an embodiment of the present application;
[0058] FIG7 is a schematic diagram of a flow chart of an autonomous driving method provided in an embodiment of the present application;
[0059] FIG8 is a schematic diagram of a chip hardware structure provided in an embodiment of the present application;
[0060] FIG9 is a neural network training device provided in an embodiment of the present application;
[0061] FIG10 is an automatic driving device provided in an embodiment of the present application;
[0062] FIG11 is a schematic structural diagram of a chip system provided in an embodiment of the present application. DETAILED DESCRIPTION
[0063] The following describes the embodiments of the present application in conjunction with the accompanying drawings. In the description of the embodiments of the present application, unless otherwise specified, " / " represents or, for example, A / B can represent A or B; "and / or" in the text is merely a description of the association relationship between associated objects, indicating that three relationships can exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, in the description of the embodiments of the present application, "multiple" refers to two or more than two.
[0064] The terms "first", "second", "third" and "fourth" in the specification and claims of this application and the accompanying drawings are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units that are not listed, or may optionally include other steps or units that are inherent to these processes, methods, products or devices. Reference to "embodiments" herein means that the specific features, structures or characteristics described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of this phrase in various places in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0065] The following are the professional terms involved in this application:
[0066] (1) Prediction Task: In autonomous driving, a prediction task is used to predict the movement of an obstacle over a period of time in the future. In this application, the output results corresponding to the prediction task include the predicted trajectory of the obstacle and the predicted trajectory distribution of the obstacle.
[0067] (2) Decision-making tasks: In autonomous driving, decision-making tasks are used to output ego-vehicle decisions. In this application, ego-vehicle decisions include ego-vehicle avoidance decisions, ego-vehicle preemption decisions, and obstacle-ignoring decisions when an obstacle is detected near the ego-vehicle.
[0068] (3) Planning Task: In autonomous driving, the planning task is used to output the vehicle's route for a period of time in the future. In this application, the output results corresponding to the planning task include the vehicle's planned path, the vehicle's planned trajectory, and the vehicle's planned trajectory distribution.
[0069] (4) Mixture of Experts (MOE) network: This network consists of multiple expert networks and gate networks. The internal structure of each expert network can be the same or different. During training, each expert network focuses on different aspects of feature extraction, and the gate network is used to weight the features extracted by each expert network. During inference, the gate network is usually used to determine which expert network to activate, and only the activated expert network is used for feature extraction.
[0070] (5) Self-Attention Network and Cross-Attention Network: The input of the Self-Attention network comes from the same sequence; the input of the Cross-Attention network comes from different sequences (such as text, sound, image, etc.), but these different sequences need to have the same dimension.
[0071] (6) Vehicle data: including the positioning of the vehicle, which is represented by the position and orientation of the vehicle.
[0072] (7) Obstacle data: including the position, direction, speed, length and width of each obstacle. Obstacles include other vehicles, pedestrians, and other moving or stationary objects or plants within a certain range from the vehicle. This application does not list them one by one.
[0073] (8) Road topology data: including road centerlines, sidelines, traffic lights, speed limit signs, etc., as well as their corresponding attribute data. The attribute data of centerlines and sidelines include whether they are dashed or solid, and their lengths; the attributes of speed limit signs include speed limits; and the attributes of traffic lights include the current color of the traffic light and the waiting time.
[0074] (9) Navigation data: Before outputting the control data of the ego vehicle, the navigation data of the current ego vehicle, including the road section, lane selection, trajectory, etc. planned for the ego vehicle in the future period, is generated.
[0075] Please refer to Figure 1, which is a schematic diagram of an application scenario provided in an embodiment of the present application, used to describe the scenario used to execute the autonomous driving method in this application.
[0076] In FIG1 , the vehicle is a vehicle that executes the autonomous driving method in this application, and the vehicle communicates with the server through a network.
[0077] The server is deployed with the neural network used for autonomous driving in this application. The server collects data transmitted by vehicles on the road and then generates training data for training the neural network. Each piece of training data includes vehicle data, navigation data, road topology data, obstacle data, etc. The server regularly trains the neural network used for autonomous driving deployed on it using the training data in the training set to update model parameters and / or adjust the model structure.
[0078] As the vehicle drives, it uses its onboard sensors and cameras to collect data from the environment within a certain range of the vehicle, including data on other vehicles, lane markings, pedestrians, and traffic lights, as shown in Figure 1. This data is then used to generate corresponding vehicle data, obstacle data, and road topology data. The autonomous driving neural network can be deployed or not deployed on the vehicle itself.
[0079] When the neural network is deployed on the ego vehicle, the server will periodically send the updated parameters of the neural network to the ego vehicle. During the autonomous driving process, the ego vehicle can input the above-generated ego vehicle data, obstacle data, road topology data, and navigation data into the neural network deployed on it, use the neural network to perform the corresponding autonomous driving tasks, and generate ego vehicle control data based on the output results of the autonomous driving tasks to complete the control of the ego vehicle.
[0080] When the neural network is not deployed on the vehicle, when the vehicle is performing autonomous driving, the above-mentioned collected data and the vehicle's navigation data will be sent to the server through the network. The server will generate the input data required for the neural network to perform the autonomous driving task (i.e., vehicle data, obstacle data, road topology data and navigation data), and input the input data into the neural network. The neural network will output the vehicle control data and send this control data to the vehicle through the network. The vehicle will control the vehicle based on the received control data.
[0081] Optionally, the input data of the neural network is vectorized data. Specifically, for vehicle data and obstacle data, the vectorized form is represented by the position, orientation, size, etc. of objects such as the vehicle and obstacles at different times in the past (e.g., the past 2 seconds from the time of acquisition). For road topology data, the vectorized form is represented by the attributes of the center line, side line, traffic light, speed limit sign, etc. on a section of road (e.g., 10-20 meters near the vehicle) at different times in the past. The vectorized form of navigation data is represented by the road, lane, and trajectory of the vehicle in the past.
[0082] Please refer to Figure 2, which is a schematic diagram of the process of a neural network performing an autonomous driving task provided in an embodiment of the present application, and is used to summarize the implementation process of the autonomous driving method in this application. The neural network in Figure 2 is a neural network used for autonomous driving, which includes a backbone network and N parallel head networks.
[0083] As shown in Figure 2, the ego vehicle collects data through onboard sensors, cameras, and other equipment (not shown in Figure 2) to obtain corresponding perception data. The perception data, ego vehicle data, and navigation data are then pre-processed (i.e., vectorized) to obtain the input data for the neural network (i.e., vectorized ego vehicle data, obstacle data, road topology data, and navigation data).
[0084] The backbone network is used to extract and fuse features from the vectorized input data, and then input the obtained feature data into the corresponding head network. Each head network is used to perform the corresponding autonomous driving task, and each head network outputs at least one type of output result.
[0085] The autonomous driving tasks in this application include prediction tasks, decision tasks, and planning tasks. Each head network corresponds to an autonomous driving task, and different head networks correspond to the same or different autonomous driving tasks. That is, each autonomous driving task corresponds to at least one head network.
[0086] Post-process the output results for each autonomous driving task. This process converts the outputs from the head network, including the predicted obstacle trajectory, ego vehicle decision-making, and planned trajectory, into the final control data for the ego vehicle. Specifically, post-processing includes checking the validity of the predicted obstacle trajectory and the planned trajectory, as well as ensuring trajectory smoothness and stability.
[0087] The vehicle controls its travel based on the control data.
[0088] The following uses Figures 3 and 4 to describe the structure of the neural network used for autonomous driving in this application and the execution process of the neural network in executing the autonomous driving method of this application. Figure 3 is a flow chart of a neural network executing the autonomous driving method provided by an embodiment of this application. Figure 4 is a schematic diagram of the structure of a neural network used for autonomous driving provided by this application.
[0089] As shown in Figure 4, the neural network includes a backbone network and N parallel head networks. The backbone network includes a mixture of experts (MOE) network. N is a positive integer.
[0090] The corresponding execution process of the neural network in the autonomous driving method includes steps S310 and S320.
[0091] Step S310: The MOE network is used to extract and fuse features from the input data to obtain N types of feature data; wherein the input data includes vehicle data, obstacle data, road topology data, and navigation data. The N types of feature data correspond one-to-one to N parallel head networks, and each of the N parallel head networks corresponds to an autonomous driving task.
[0092] The above input data is vectorized data.
[0093] The MOE network consists of multiple expert networks (M in Figure 4) and gate networks. Each expert network includes a self-attention network, a mutual attention network, and a multilayer perceptron (MLP).
[0094] Among them, the self-attention network is used to extract features of the input data, and the mutual attention network is used to fuse the features extracted by the self-attention network. The fused results are then input into the multi-layer perception network for processing to obtain N types of feature data output by each expert network based on the input data (or a piece of training data).
[0095] The above-mentioned multiple expert networks include a first expert network, which is any one of the multiple expert networks. The following is a specific description of the process of the first expert network executing the autonomous driving method of the present application in combination with an example of the internal structure of an expert network given in Figure 4 (i.e., expert network 1 in Figure 4).
[0096] Optionally, the first expert network includes a first self-attention network, a first mutual attention network, a second self-attention network, and a second mutual attention network.
[0097] As shown in Figure 4, the first self-attention network is used to extract features from the vehicle data and obstacle data in a piece of input data, and obtain a first query matrix, a first key matrix, and a first value matrix (i.e., Q, K, and V output by the first self-attention network in Figure 4). The second self-attention network is used to extract features from the road topology data and navigation data in a piece of input data, and obtain a second query matrix, a second key matrix, and a second value matrix (i.e., Q, K, and V output by the second self-attention network in Figure 4).
[0098] As shown in Figure 4, the first mutual attention network is used to perform feature fusion on the first query matrix, the second key matrix, and the second value matrix; the second mutual attention network is used to perform feature fusion on the second query matrix, the first key matrix, and the first value matrix. The N types of feature data are generated using the output of the first mutual attention network and the output of the second mutual attention network.
[0099] Optionally, the N types of feature data output by the first expert network are generated by inputting the output results of the first mutual attention network and the second mutual attention network into a structure such as a multilayer perceptron.
[0100] Optionally, the N types of feature data include prediction features, decision features, road features, and vehicle features. Each type of feature data is subsequently input into a corresponding head network to perform the corresponding autonomous driving task.
[0101] It should be understood that the above-mentioned internal structure of the expert network is only a feasible example given in this application and does not constitute a limitation. The internal structure of each expert network can be the same or different, and different expert networks have different focuses when extracting features from input data.
[0102] The following describes the role of the gate network in the MOE network:
[0103] During training, each piece of training data is fed into the M expert networks shown in Figure 4, resulting in N types of feature data output by each expert network. The gate network then weights the N types of feature data output by the M expert networks, yielding the N weighted feature data.
[0104] For multiple feature data of the same type, when weighting the multiple feature data, the weight corresponding to each feature data is related to the expert network that outputs the feature data.
[0105] During inference, the gate network activates one of the M expert networks based on the weight of each expert network to perform inference. The N types of feature data output by this expert network are then fed into the corresponding head network to execute the corresponding autonomous driving task. For example, the gate network might activate the most heavily weighted of the M expert networks to perform inference.
[0106] Step S320: Each head network performs a corresponding autonomous driving task based on a corresponding input feature data; wherein the autonomous driving task includes a prediction task, a decision task and a planning task.
[0107] Among them, the prediction features in the above N types of feature data are used to perform prediction tasks, the decision features are used to perform decision tasks, and the road features and vehicle features are used to perform planning tasks.
[0108] Among them, each head network corresponds to an autonomous driving task, and each autonomous driving task corresponds to at least one head network, that is, each autonomous driving task is executed by at least one head network.
[0109] Each of the N head networks outputs at least one type of output result.
[0110] In one feasible implementation, prediction tasks are performed by one head network, decision tasks are performed by one head network, and planning tasks are performed by two head networks. The output features of the head network performing the prediction task are prediction features, the input features of the head network performing the decision task are decision features, and the input features of the two head networks performing the planning task are vehicle features and road features, respectively.
[0111] Optionally, the output result corresponding to the prediction task includes the predicted trajectory of the obstacle and the predicted trajectory distribution of the obstacle.
[0112] Optionally, the output result corresponding to the decision task includes the ego vehicle decision, which includes the ego vehicle preemption decision, the ego vehicle avoidance decision, and ignoring the obstacle.
[0113] Optionally, the output results corresponding to the planning task include the planned road of the vehicle, the planned trajectory of the vehicle, and the planned trajectory distribution of the vehicle.
[0114] The predicted trajectory of the obstacle is the movement trajectory of the obstacle in the future. The predicted trajectory distribution of the obstacle is the probability value of the trajectory points on the obstacle's movement trajectory in the future falling on or around different locations.
[0115] Among them, the ego vehicle decision is used to provide the ego vehicle with corresponding decision-making behaviors when it is predicted that it will encounter an obstacle in the future, including preemptive decision, avoidance decision and ignoring the obstacle.
[0116] The planned road is the output of the planning result at the road scale, while the planned trajectory is the output of the planning result at the trajectory scale. The planned trajectory distribution is the probability of the trajectory points on the planned trajectory of the vehicle falling on or around different locations within a certain period of time in the future.
[0117] Please refer to Figure 5, which is a flow chart of a neural network training method provided in an embodiment of the present application, which is used to describe the training method of the neural network used for autonomous driving in the present application (i.e., the neural network in Figure 4 above).
[0118] As shown in Figure 5, the training method includes steps S510, S520, S530, S540, and S550. The training method shown in Figure 5 is described by taking one training process as an example. Each training process includes two parts: single-task training / multi-task joint training, and single-task optimization.
[0119] Step S510: During each training process, each expert network in the M expert networks performs feature extraction and feature fusion on each piece of training data in a batch of training data to obtain N types of feature data.
[0120] A batch of training data used in each training is located in a training set, and the batch of training data includes multiple training data. Each training data in the training set is the data in the aforementioned vectorized form.
[0121] Specifically, each piece of training data in the batch of training data is input into the M expert networks, and each of the M expert networks outputs N types of feature data based on each piece of training data. For each piece of training data, the N types of feature data output by each expert network are output to the gate network, which performs the weighted processing in step S520.
[0122] Step S520: Weighting the feature data of the same type output by the M expert networks respectively to obtain N weighted feature data; wherein the N weighted feature data correspond one-to-one to the N parallel head networks, and each head network in the N parallel head networks corresponds to an autonomous driving task, and the autonomous driving tasks include prediction tasks, decision tasks and planning tasks.
[0123] Specifically, for each piece of training data in a batch of training data, each expert network will output N types of feature data, the number of which is N. For each piece of training data, M expert networks will also output N types of feature data, the number of each type of feature data in the N types of feature data is M. The M pieces of each type of feature data are then weighted to obtain the weighted N types of feature data.
[0124] Among them, for the M pieces of feature data in each type of feature data, the weight corresponding to each piece of feature data when weighted is related to the expert network that outputs the feature data.
[0125] Among them, each weighted feature data corresponds to a head network, each head network corresponds to an autonomous driving task, and each autonomous driving task corresponds to at least one head network, that is, there is at least one head network for performing each autonomous driving task.
[0126] After obtaining the N weighted feature data, each weighted feature data will be input into a corresponding head network to perform the autonomous driving task corresponding to the head network.
[0127] Step S530: Input the weighted N types of feature data into the corresponding head network respectively to obtain H types of output results corresponding to each training data, and the H types of output results include K types of output results, where K is a positive integer less than or equal to H.
[0128] For each piece of training data, N head networks output a total of H types of output results, where each head network outputs at least one type of output result.
[0129] Optionally, the K-type output results in the H-type output results correspond to at least one autonomous driving task (or at least one head network corresponding to the K-type output results). The head network used to output the K-type output results will undergo parameter updates during subsequent single-task training / multi-task joint training (i.e., the single-task training / multi-task joint training process described below), while the other head networks will not undergo parameter updates during this process.
[0130] Step S540: Accumulate the loss values of part or all of the output results of each type of output results in the K types of output results obtained from the one batch of training data to obtain K accumulated loss values corresponding to the K types of output results.
[0131] Specifically, for each piece of training data, the N head networks output H types of output results (the number of which is also H, that is, the number of output results per category is 1). Assuming that a batch of training data contains F pieces of training data, H types of output results will also be obtained based on this batch of training data. The number of H types of output results is H*F, where the number of output results per category is F.
[0132] The above K categories of output results are selected from the H categories of output results obtained from the batch of training data. The number of the K categories of output results is K*F. The loss values of some or all of the F output results in each category of the K categories of output results are accumulated to obtain the accumulated loss value corresponding to each category of output results, and a total of K accumulated loss values are obtained.
[0133] The above-mentioned H-type output results include the predicted trajectory of the obstacle, the predicted trajectory distribution of the obstacle, the ego vehicle decision, the planned path of the ego vehicle, the planned trajectory of the ego vehicle, and the planned trajectory distribution of the ego vehicle.
[0134] The predicted obstacle trajectory and its distribution correspond to the prediction task. The ego vehicle decision corresponds to the decision task. The planned path, planned trajectory, and planned trajectory distribution correspond to the planning task.
[0135] The following describes a possible way to select some or all of the output results from each category and then accumulate their loss values:
[0136] The description is performed with the first type of output results among the K types of output results as the object, and the first type of output results is any type of output result among the K types of output results.
[0137] Since this selection method is based on the task labels of the training data, we first introduce the meaning of the task labels carried by the training data. For details, please refer to Table 1. Among them, each training data in the training set may or may not carry a task label. Furthermore, each training data with a task label can carry one or more task labels.
[0138] As shown in Table 1, if the training data carries a planning task label, the loss value of the output corresponding to the planning task in the H-category output results obtained based on the training data is used for the above cumulative calculation. Optionally, the planning task label can be attached to the ego vehicle data in the training data.
[0139] Similarly, if the training data carries a decision or prediction task label, the loss value of the output result corresponding to the decision or prediction task in the H-category output results obtained based on the training data is used for the above cumulative calculation. Optionally, the decision task label and prediction task label can be marked on the obstacle data in the training data.
[0140] Similarly, if the training data does not carry a task label (i.e., none), the loss value of the H-class output result obtained based on the training data will not be used for the above cumulative calculation.
[0141] Table 1. Example of task labels for training data
[0142] Taking the aforementioned example of a batch of training data containing F pieces of training data, the K-category output results obtained from the batch of training data include F first-category output results. If these F first-category output results all correspond to the first autonomous driving task among the aforementioned autonomous driving tasks, then these F first-category output results are all output by the head network corresponding to the first autonomous driving task. If these F first-category output results include E first-category output results, and the training data used to calculate these E first-category output results all carry labels representing the first autonomous driving task, then the accumulated loss value corresponding to the first-category output result is obtained by accumulating the E loss values corresponding to each of the E first-category output results, where E is a positive integer less than or equal to F.
[0143] After calculating and obtaining the K accumulated loss values corresponding to the K types of output results, the following step S550 is executed.
[0144] Step S550: weighting the K accumulated loss values to obtain a loss value corresponding to each training process; and using the loss value to update the parameters in the neural network.
[0145] Among them, the weight corresponding to each type of output result in the K types of output results is related to the autonomous driving task corresponding to the type of output result.
[0146] After obtaining a loss value corresponding to each training process, the parameters in the neural network (backbone network + head network for outputting the K-type output results) are updated using the loss value.
[0147] From the perspective of technical effects, the present application can target specific application scenarios, thereby selecting K-type output results from H-type output results during the training process (the K-type output results correspond to at least one autonomous driving task, that is, corresponding to a specific application scenario), and then updating the parameters in at least one head network corresponding to the K-type output results to achieve single-task training or multi-task joint training (for example, for weak interaction scenarios such as vulnerable road users (Vulnerable Road Users, VRU) occupying the lane in the same direction in front and the vehicle avoiding obstacles and overtaking, joint training of planning tasks and prediction tasks is performed; for strong interaction scenarios such as the vehicle changing lanes and vehicles coming from behind in the target lane, joint training of planning tasks, decision-making tasks and prediction tasks is performed).
[0148] At the same time, by selecting part or all of the output results of each category in K categories for training, corresponding data can be selected for training for each autonomous driving task, thereby ensuring the generalization of each task (for example, data on driving on open roads has no value for decision-making and prediction tasks, but is valuable for training planning tasks).
[0149] After updating the parameters of the above neural network, single-task optimization can be performed on the head network or the head network corresponding to a single autonomous driving task to achieve independent adjustment of each autonomous driving task. This optimization process can be divided into the following two methods:
[0150] (1) Optimize a single head network independently
[0151] The following describes the optimization process of the first head network among N parallel head networks. The first head network is any one of the N parallel head networks.
[0152] The first network outputs D categories of output results. The aforementioned H categories of output results include D categories of output results, where D is a positive integer. G training data points from the training set are input into the updated neural network to obtain D categories of output results from the first network. Each category of the D categories of output results contains G number of output results, resulting in a total of D*G output results, where G is a positive integer.
[0153] The G pieces of training data may be completely identical, completely identical, or partially identical to the training data contained in the aforementioned batch of training data.
[0154] For the D types of output results obtained from the G training data above, the loss values of some or all of the output results in each type of output result are accumulated to obtain D accumulated loss values corresponding to the D types of output results.
[0155] The process of selecting some or all of the output results from the G output results included in each type of output result can refer to the process of selecting using the training data task label in the aforementioned embodiment, which will not be repeated here.
[0156] After obtaining D accumulated loss values, the D accumulated loss values are weighted to obtain the first loss value corresponding to the first head network in each training process; then the first loss value is used to update the parameters in the first head network.
[0157] Among them, D accumulated loss values correspond to D types of output results, and the weight corresponding to each accumulated loss value is related to the autonomous driving task category corresponding to the output result of calculating the accumulated loss value.
[0158] Among them, the above-mentioned updating of the parameters in the first head network can adopt any one of the following two methods: (1) only updating the parameters in the first head network, and not adjusting the structure of the first head network; (2) adjusting the structure of the first head network, and at the same time updating the parameters in the adjusted first head network.
[0159] That is, the structure of the updated first-head network is the same as or different from the structure of the first-head network in the aforementioned updated neural network (that is, the neural network obtained after single-task training or multi-task joint training) (that is, after the above-mentioned update of the parameters of the first-head network, the structure of the first-head network changes or remains unchanged compared to before the update).
[0160] (2) Optimizing the head network corresponding to a single autonomous driving task
[0161] The following describes a process of optimizing the L head networks corresponding to the first autonomous driving task in the N parallel head networks, where the first autonomous driving task is any one of a plurality of autonomous driving tasks.
[0162] The above L head networks output P types of output results. In the above embodiment, the H type of output results include the P type of output results. L and P are positive integers greater than or equal to 2.
[0163] Input the G training data in the training set into the updated neural network respectively, and obtain P types of output results output by the L head networks. The number of output results contained in each category of the P types of output results is G, that is, a total of P*G output results are obtained, where G is a positive integer.
[0164] The G pieces of training data may be completely identical, completely identical, or partially identical to the training data contained in the aforementioned batch of training data.
[0165] The loss values of part or all of the output results in each category of P output results are accumulated to obtain P accumulated loss values corresponding to the P categories of output results.
[0166] After obtaining P accumulated loss values, the P accumulated loss values are weighted to obtain the second loss value corresponding to the L head networks in each training process.
[0167] The parameters in the L head networks are updated using the second loss value. The updating of the parameters in the L head networks can be performed in either of the following two ways: (1) only updating the parameters in the L head networks without adjusting the structure of the L head networks; or (2) adjusting the structure of the L head networks and simultaneously updating the parameters in the adjusted L head networks.
[0168] That is, the structure of each head network in the updated L head networks is the same as or different from the structure of the corresponding head network in the aforementioned updated neural network (that is, after the parameters of the L head networks are updated as described above, the structure of the L head networks changes or remains unchanged compared to before the update).
[0169] The relevant steps in the above process can be found in the corresponding description above and will not be repeated here.
[0170] Please refer to Figures 6a-6b, which are schematic diagrams of the neural network training process provided in the embodiments of the present application. Figure 6a is a schematic diagram of the process of performing single-task training / multi-task joint training during each training process; Figure 6b is a schematic diagram of the process of performing single-task optimization during each training process.
[0171] As shown in Figure 6a, in single-task training / multi-task joint training, a batch of training data in the training set is input into the backbone network of the neural network (the specific structure and execution process of the neural network can be found in the description of the embodiments of Figures 2 to 5 above). The backbone network extracts features from each training data in the batch of training data to obtain N weighted feature data. Each type of weighted N feature data is then input into a corresponding head network. Each head network outputs at least one type of output result, resulting in a total of H types of output results. Based on the specific application scenario, K types of output results are selected from the H types of output results, and the loss values of some or all of the output results in each type of output result in the K types of output results are accumulated to obtain K accumulated loss values corresponding to the K types of output results. Finally, the K accumulated loss values are weighted to obtain a loss value corresponding to the single-task training / multi-task joint training process, and this loss value is used for backpropagation to update the parameters of the entire neural network.
[0172] Specifically, the specific process of the above-mentioned single-task training / multi-task joint training can be found in the corresponding description in the embodiments of Figures 2 to 5 above, and will not be repeated here.
[0173] After completing the above-mentioned single-task training / multi-task joint training, the updated neural network is subjected to a single-task optimization, that is, the neural network in Figure 6b is the neural network obtained after completing the single-task training / multi-task joint training in Figure 6a.
[0174] As shown in Figure 6b, during the single-task optimization process, the training data in the training set (e.g., G pieces of data in the previous embodiment) are input into the updated neural network to obtain N weighted feature data corresponding to the G pieces of training data. These N weighted feature data are then input into each of the corresponding head networks to obtain H output results. Finally, referring to the description of the embodiment of Figure 5, single-task optimization is performed on a single head network or on at least one head network corresponding to a single autonomous driving task to update the parameters of the corresponding head network.
[0175] Specifically, the specific process of the above-mentioned single-task optimization can be found in the corresponding description in the embodiment of Figure 5 above, and will not be repeated here.
[0176] Please refer to Figure 7, which is a flow chart of an automatic driving method provided by an embodiment of the present application. As shown in Figure 7, the method includes steps S710, S720, S730, and S740.
[0177] Step S710: Acquire input data, where the input data includes vehicle data, obstacle data, road topology data, and navigation data.
[0178] Specifically, when the trained neural network is deployed on the vehicle, the vehicle perceives the surrounding environment based on the cameras, sensors, lidar and other equipment installed on it, and vectorizes the perceived data and the navigation data of the vehicle to obtain the input data.
[0179] When the above-mentioned neural network for autonomous driving is not deployed on the vehicle side but on a cloud server, the vehicle perceives the surrounding environment based on the cameras, sensors, lidar and other equipment installed on it, and can upload the perception data and the navigation data of the vehicle to the server. The server vectorizes the received data to obtain the above-mentioned input data.
[0180] Step S720: Using the expert mixture MOE network in the neural network to perform feature extraction and feature fusion on the input data to obtain N types of feature data, the neural network also includes N parallel head networks, where N is a positive integer.
[0181] Step S730: Input each type of feature data into a corresponding head network among the N parallel head networks to perform an autonomous driving task corresponding to the head network.
[0182] Specifically, the specific execution process of the above-mentioned step S720 and step S730 can be found in the description of the above-mentioned embodiment, and will not be repeated here.
[0183] Step S740: Control the vehicle based on the output results of each of the autonomous driving tasks.
[0184] Specifically, control data of the vehicle is generated based on the output results of the neural network, and then the vehicle is controlled based on the control data.
[0185] Among them, when the trained neural network is deployed on the vehicle, the control data is generated by the vehicle; when the neural network is deployed on the server, the control information is generated by the server and sent to the vehicle.
[0186] Optionally, each training process of the above-mentioned neural network is as follows: each expert network in the MOE network is used to perform feature extraction and feature fusion on each training data in a batch of training data to obtain the N types of feature data; the neural network is also used to weight the feature data of the same type output by the MOE network respectively to obtain the weighted N types of feature data; and the weighted N types of feature data are respectively input into the corresponding head network to obtain H types of output results corresponding to each training data, and the H types of output results include K types of output results, K is a positive integer less than or equal to H; the update of the neural network parameters is completed according to a loss value corresponding to each training process, and the loss value is obtained by weighting K accumulated loss values, and the K accumulated loss values correspond to the K types of output results one by one, and the K accumulated loss values are obtained by accumulating the loss values of part or all of the output results in each type of output results in the K types of output results obtained from the batch of training data.
[0187] Optionally, the K types of output results include first type output results, and the K types of output results obtained from the batch of training data include F first type output results, and the F first type output results all correspond to the first autonomous driving task in the autonomous driving tasks; the F first type output results include E first type output results, and the training data used to calculate the E first type output results all carry labels representing the first autonomous driving task, and the accumulated loss value corresponding to the first type output result is obtained by accumulating E loss values corresponding to the E first type output results, and E is a positive integer less than or equal to F.
[0188] Optionally, the N parallel head networks include a first head network, which outputs D-type output results, and the multiple types of output results include the D-type output results, where D is a positive integer; after using the one loss value to update the parameters in the neural network, the method further includes: inputting G training data in the training set into the updated neural network respectively to obtain the D-type output results output by the first head network, the training set includes the one batch of training data, and G is a positive integer; accumulating the loss values of part or all of the output results in each type of output results in the D-type output results to obtain D accumulated loss values corresponding to the D-type output results respectively; weighting the D accumulated loss values to obtain the first loss value corresponding to the first head network in each training process; and using the first loss value to update the parameters in the first head network.
[0189] Optionally, the N parallel head networks include L head networks, the L head networks correspond to the first autonomous driving task, the L head networks output P-type output results, the H-type output results include the P-type output results, L and P are positive integers greater than or equal to 2; after using the one loss value to update the parameters in the neural network, the method further includes: inputting G training data in the training set into the updated neural network respectively to obtain the P-type output results output by the L head networks, the training set includes the one batch of training data, G is a positive integer; accumulating the loss values of part or all of the output results in each type of output results in the P-type output results to obtain P accumulated loss values corresponding to the P-type output results respectively; weighting the P accumulated loss values to obtain a second loss value corresponding to the L head networks in each training process; and using the second loss value to update the parameters in the L head networks.
[0190] Optionally, the MOE network includes multiple expert networks, each of the multiple expert networks includes a self-attention network and a mutual attention network; wherein, the self-attention network is used to extract features from the input data, and the mutual attention network is used to perform feature fusion on the features extracted by the self-attention network, and the N types of feature data are generated through the output results of the mutual attention network.
[0191] Optionally, the autonomous driving task includes a prediction task, a decision task and a planning task; the output result of the prediction task includes the predicted trajectory of the obstacle and the predicted trajectory distribution of the obstacle, the output result of the decision task includes the vehicle decision, and the output result of the planning task includes the planned road of the vehicle, the planned trajectory of the vehicle and the planned trajectory distribution of the vehicle.
[0192] Specifically, the specific structure of the neural network used in the above-mentioned autonomous driving method and the corresponding training and reasoning process can be found in the description of the aforementioned embodiments and will not be repeated here.
[0193] Please refer to Figure 8, which is a schematic diagram of a chip hardware structure provided in an embodiment of the present application, which can be used to execute the training method and / or autonomous driving method in an embodiment of the present application.
[0194] As shown in FIG8 , the Neural-Networks Processing Unit (NPU) 80 is mounted on the host CPU (Host CPU) as a coprocessor, and the Host CPU assigns tasks to execute the neural network training method in the aforementioned embodiment or the related processes in the autonomous driving method in the aforementioned embodiment.
[0195] The core part of the NPU is the operation circuit 803, and the controller 804 controls the operation circuit 803 to extract data from the memory (weight memory or input memory) and perform operations.
[0196] In some implementations, the arithmetic circuit 803 includes multiple processing units (PEs). In some implementations, the arithmetic circuit 803 is a two-dimensional systolic array. The arithmetic circuit 803 can also be a one-dimensional systolic array or other electronic circuitry capable of performing mathematical operations such as multiplication and addition. In some implementations, the arithmetic circuit 803 is a general-purpose matrix processor.
[0197] For example, assume there are input matrix A, weight matrix B, and output matrix C. The arithmetic circuit retrieves the corresponding data of matrix B from weight memory 802 and caches it on each PE in the arithmetic circuit. The arithmetic circuit retrieves the data of matrix A from input memory 801 and performs a matrix operation on matrix B. The partial or final matrix result is stored in accumulator 808.
[0198] The vector calculation unit 807 can further process the output of the operation circuit, such as vector multiplication, vector addition, exponential operation, logarithmic operation, size comparison, etc. For example, the vector calculation unit 807 can be used for network calculations of non-convolutional / non-FC layers in a neural network, such as pooling, batch normalization, local response normalization, etc.
[0199] In some implementations, the vector calculation unit 807 can store the processed output vector to the unified memory 806. For example, the vector calculation unit 807 can apply a nonlinear function to the output of the operation circuit 803, such as a vector of accumulated values, to generate an activation value. In some implementations, the vector calculation unit 807 generates a normalized value, a merged value, or both. In some implementations, the processed output vector can be used as an activation input to the operation circuit 803, for example, for use in a subsequent layer in a neural network.
[0200] The unified memory 806 is used to store input data and output data.
[0201] The memory unit access controller 805 (Direct Memory Access Controller, DMAC) moves the input data in the external memory to the input memory 801 and / or the unified memory 806, stores the weight data in the external memory into the weight memory 802, and stores the data in the unified memory 806 into the external memory.
[0202] The bus interface unit (BIU) 810 is used to implement interaction between the main CPU, DMAC and instruction fetch memory 809 through the bus.
[0203] An instruction fetch buffer 809 connected to the controller 804 is used to store instructions used by the controller 804 .
[0204] The controller 804 is used to call the instructions cached in the instruction fetch memory 809 to control the working process of the computing accelerator.
[0205] Generally, the unified memory 806, the input memory 801, the weight memory 802 and the instruction fetch memory 809 are all on-chip memories, and the external memory is a memory outside the NPU, which can be a double data rate synchronous dynamic random access memory (DDR SDRAM), a high bandwidth memory (HBM) or other readable and writable memory.
[0206] Please refer to Figure 9, which shows a neural network training device provided in an embodiment of the present application, which is used to perform the neural network training method described in the aforementioned embodiment. The neural network used for training can be the neural network described in the aforementioned embodiment, i.e., the neural network includes a mixture of experts (MOE) network and N parallel head networks, wherein the MOE network includes M expert networks, where M and N are positive integers.
[0207] As shown in FIG9 , the apparatus includes an encoding unit 910, a decoding unit 920, and an updating unit 930.
[0208] The encoding unit 910 is configured to, during each training process, extract and fuse features for each piece of training data in a batch of training data using each of the M expert networks to obtain N types of feature data; and to weight the feature data of the same type output by the M expert networks to obtain N weighted feature data; wherein the weighted N types of feature data correspond one-to-one to the N parallel head networks, and each of the N parallel head networks corresponds to an autonomous driving task, including a prediction task, a decision task, and a planning task. The decoding unit 920 is configured to input the weighted N types of feature data into the corresponding head networks to obtain H types of output results corresponding to each piece of training data, wherein the H types of output results include K types of output results, where K is a positive integer less than or equal to H. An updating unit 930 is configured to accumulate the loss values of part or all of the output results of each type of output result in the K types of output results obtained from the batch of training data to obtain K accumulated loss values corresponding to the K types of output results, respectively; and to weight the K accumulated loss values to obtain a loss value corresponding to each training process; and to update the parameters in the neural network using the loss value.
[0209] In a feasible implementation, the K types of output results include first-type output results, and the K types of output results obtained from the batch of training data include F first-type output results, and the F first-type output results all correspond to the first autonomous driving task in the autonomous driving tasks; the F first-type output results include E first-type output results, and the training data used to calculate the E first-type output results all carry labels representing the first autonomous driving task, and the accumulated loss value corresponding to the first-type output result is obtained by accumulating the E loss values corresponding to the E first-type output results, and E is a positive integer less than or equal to F.
[0210] In a feasible embodiment, the N parallel head networks include a first head network, which outputs D-type output results, and the H-type output results include the D-type output results, where D is a positive integer; after using the one loss value to update the parameters in the neural network, the encoding unit 910 and the decoding unit 920 are further used to: process G training data in the training set through the updated neural network to obtain the D-type output results output by the first head network, where the training set includes the one batch of training data, and G is a positive integer; the updating unit is further used to accumulate the loss values of part or all of the output results in each type of output results in the D-type output results to obtain D accumulated loss values corresponding to the D-type output results respectively; and weight the D accumulated loss values to obtain a first loss value corresponding to the first head network in each training process; and use the first loss value to update the parameters in the first head network.
[0211] In a feasible embodiment, the N parallel head networks include L head networks, the L head networks correspond to the first autonomous driving task, the L head networks output P-type output results, the H-type output results include the P-type output results, and L and P are positive integers greater than or equal to 2; after using the one loss value to update the parameters in the neural network, the encoding unit 910 and the decoding unit 920 are further used to: process G training data in a training set using the updated neural network to obtain the P-type output results output by the L head networks, the training set includes the one batch of training data, and G is a positive integer; the updating unit is further used to accumulate the loss values of part or all of the output results in each type of output results in the P-type output results to obtain P accumulated loss values corresponding to the P-type output results respectively; and weight the P accumulated loss values to obtain a second loss value corresponding to the L head networks in each training process; and use the second loss value to update the parameters in the L head networks.
[0212] In a feasible implementation, the H-type output results include the predicted trajectory of the obstacle, the predicted trajectory distribution of the obstacle, the ego vehicle decision, the planned road of the ego vehicle, the planned trajectory of the ego vehicle, and the planned trajectory distribution of the ego vehicle; the predicted trajectory of the obstacle and the predicted trajectory distribution of the obstacle correspond to the prediction task, the ego vehicle decision corresponds to the decision task, and the planned road of the ego vehicle, the planned trajectory of the ego vehicle, and the planned trajectory distribution of the ego vehicle correspond to the planning task.
[0213] Specifically, the specific execution process of each unit in the above-mentioned device can refer to the corresponding description of the above-mentioned embodiment, which will not be repeated here.
[0214] Please refer to Figure 10, which shows an automatic driving device provided by an embodiment of the present application, which is used to execute the automatic driving method in the above embodiment. The device includes an acquisition unit 1010, a processing unit 1020 and a control unit 1030.
[0215] Acquisition unit 1010 is configured to acquire input data, including ego vehicle data, obstacle data, road topology data, and navigation data. Processing unit 1020 is configured to perform feature extraction and feature fusion on the input data using a mixture of experts (MOE) network within a neural network, generating N types of feature data. The neural network further comprises N parallel head networks, where N is a positive integer. Each type of feature data is input into a corresponding head network of the N parallel head networks to execute an autonomous driving task corresponding to the head network. Control unit 1030 is configured to control the ego vehicle based on the output of each autonomous driving task.
[0216] In a feasible embodiment, during each training process of the neural network, the processing unit 1020 is specifically used to: perform feature extraction and feature fusion on each training data in a batch of training data through each expert network in the MOE network to obtain the N types of feature data; and weight the feature data of the same type output by the MOE network through the neural network to obtain the weighted N types of feature data; and input the weighted N types of feature data into the corresponding head network to obtain H types of output results corresponding to each training data, the H types of output results include K types of output results, K is a positive integer less than or equal to H; wherein, the updating of the neural network parameters is completed according to a loss value corresponding to each training process, the loss value is obtained by weighting K accumulated loss values, the K accumulated loss values correspond to the K types of output results one-to-one, and the K accumulated loss values are obtained by accumulating the loss values of part or all of the output results of each type of output results in the K types of output results obtained for the batch of training data.
[0217] In a feasible implementation, the K types of output results include first-type output results, and the K types of output results obtained from one batch of training data include F first-type output results, and the F first-type output results all correspond to the first autonomous driving task in the autonomous driving tasks; the F first-type output results include E first-type output results, and the training data used to calculate the E first-type output results all carry labels representing the first autonomous driving task, and the accumulated loss value corresponding to the first-type output result is obtained by accumulating the E loss values corresponding to the E first-type output results, and E is a positive integer less than or equal to F.
[0218] In a feasible embodiment, the N parallel head networks include a first head network, which outputs D-type output results, and the multiple types of output results include the D-type output results, where D is a positive integer; after using the one loss value to update the parameters in the neural network, the processing unit 1020 is specifically used to: use the updated neural network to process G training data in the training set to obtain the D-type output results output by the first head network, where the training set includes the one batch of training data, and G is a positive integer; accumulate the loss values of part or all of the output results in each type of output results in the D-type output results to obtain D accumulated loss values corresponding to the D-type output results respectively; weight the D accumulated loss values to obtain the first loss value corresponding to the first head network in each training process; and use the first loss value to update the parameters in the first head network.
[0219] In a feasible embodiment, the N parallel head networks include L head networks, the L head networks correspond to the first autonomous driving task, the L head networks output P-type output results, the H-type output results include the P-type output results, L and P are positive integers greater than or equal to 2; after using the one loss value to update the parameters in the neural network, the processing unit 1020 is further used to: use the updated neural network to process G training data in the training set to obtain the P-type output results output by the L head networks, the training set includes the one batch of training data, G is a positive integer; accumulate the loss values of part or all of the output results in each type of output results in the P-type output results to obtain P accumulated loss values corresponding to the P-type output results respectively; weight the P accumulated loss values to obtain a second loss value corresponding to the L head networks in each training process; and use the second loss value to update the parameters in the L head networks.
[0220] In a feasible embodiment, the MOE network includes multiple expert networks, each of the multiple expert networks includes a self-attention network and a mutual attention network; wherein, the self-attention network is used to extract features of the input data, and the mutual attention network is used to perform feature fusion on the features extracted by the self-attention network, and the N types of feature data are generated through the output results of the mutual attention network.
[0221] In a feasible implementation, the autonomous driving task includes a prediction task, a decision task, and a planning task; the output result of the prediction task includes the predicted trajectory of the obstacle and the predicted trajectory distribution of the obstacle, the output result of the decision task includes the ego vehicle decision, and the output result of the planning task includes the planned road of the ego vehicle, the planned trajectory of the ego vehicle, and the planned trajectory distribution of the ego vehicle.
[0222] Specifically, the specific execution process of each unit in the above-mentioned automatic driving device can be found in the corresponding description in the above-mentioned method embodiment, and will not be repeated here.
[0223] Please refer to Figure 11, which is a schematic diagram of the structure of a chip system provided in an embodiment of the present application. As shown in Figure 11, the chip system includes at least one processor 1101, a memory 1102, and an interface circuit 1103; wherein the at least one processor 1101, the memory 1102, and the interface circuit 1103 are connected via a bus 1104. The at least one processor 1101 may include the neural network processor shown in Figure 8.
[0224] Memory 1102 stores program instructions corresponding to the aforementioned neural network training method and / or autonomous driving method. Interface circuit 1103 is used to transmit input data. Memory 1102 implements the neural network training method and / or autonomous driving method described in the aforementioned embodiments by executing the program instructions stored in memory 1102.
[0225] Specifically, the specific execution process of the above chip system can refer to the corresponding description in the aforementioned method embodiment, which will not be repeated here.
[0226] An embodiment of the present application provides a server, which includes the chip system described in the embodiment of Figure 11 above.
[0227] An embodiment of the present application provides a vehicle, which includes the chip system described in the embodiment of Figure 11 above.
[0228] An embodiment of the present application provides a computer-readable storage medium, which stores a computer program. When the computer program is executed, the method described in any one of the embodiments of Figures 3 and / or 5 is implemented.
[0229] An embodiment of the present application provides a computer program product, which includes instructions. When the instructions are executed, the method described in any one of the embodiments of Figures 3 and / or 5 is implemented.
[0230] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments. It should be noted that for the aforementioned method embodiments, in order to simplify the description, they are all expressed as a series of action combinations, but those skilled in the art should know that this application is not limited to the order of the actions described, because according to this application, some steps may be performed in other orders or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required for this application.
[0231] In the several embodiments provided in this application, it should be understood that the disclosed devices can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the above-mentioned units is only a logical function division. In actual implementation, there may be other division methods, such as 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 interfaces, and the indirect coupling or communication connection of devices or units can be electrical or other forms.
[0232] The units described above as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0233] As described above, the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the above embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the above embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A neural network for autonomous driving, It is characterized in that The neural network includes a mixture of experts MOE network and N parallel head networks, where N is a positive integer; wherein, The MOE network is used to extract and fuse features from input data to obtain N types of feature data; wherein the input data includes vehicle data, obstacle data, road topology data, and navigation data, and the N types of feature data correspond one-to-one to the N parallel head networks, and each of the N parallel head networks corresponds to an autonomous driving task; Each head network performs the corresponding autonomous driving task based on the corresponding input feature data; wherein the autonomous driving task includes a prediction task, a decision task and a planning task.
2. The method according to claim 1, It is characterized in that The MOE network includes multiple expert networks, each of the multiple expert networks includes a self-attention network and a mutual attention network; Among them, the self-attention network is used to extract features from the input data, the mutual attention network is used to fuse the features extracted by the self-attention network, and the N types of feature data are generated through the output results of the mutual attention network.
3. The method according to claim 2, It is characterized in that The multiple expert networks include a first expert network, which is an expert network that performs feature extraction and feature fusion on the input data during the reasoning process, and the first expert network includes a first self-attention network, a first mutual attention network, a second self-attention network, and a second mutual attention network; The first self-attention network is used to perform feature extraction on the vehicle data and the obstacle data to obtain a first query matrix, a first key matrix and a first value matrix; the second self-attention network is used to perform feature extraction on the road topology data and the navigation data to obtain a second query matrix, a second key matrix and a second value matrix; The first mutual attention network is used to perform feature fusion on the first Query matrix, the second Key matrix and the second Value matrix; the second mutual attention network is used to perform feature fusion on the second Query matrix, the first Key matrix and the first Value matrix; the N types of feature data are generated through the output results of the first mutual attention network and the output results of the second mutual attention network.
4. The method according to any one of claims 1 to 3, It is characterized in that The output result corresponding to the prediction task includes the predicted trajectory of the obstacle and the predicted trajectory distribution of the obstacle; The output result corresponding to the decision task includes self-vehicle decision, and the self-vehicle decision includes self-vehicle preemption decision, self-vehicle avoidance decision, and ignoring obstacles; The output results corresponding to the planning task include the planned road of the vehicle, the planned trajectory of the vehicle and the planned trajectory distribution of the vehicle.
5. A neural network training method, It is characterized in that The neural network includes an expert mixture MOE network and N parallel head networks, the MOE network includes M expert networks, M and N are positive integers; the method includes: In each training process, each expert network in the M expert networks performs feature extraction and feature fusion on each piece of training data in a batch of training data to obtain N types of feature data; The feature data of the same type output by the M expert networks are weighted respectively to obtain N types of weighted feature data; wherein the N types of weighted feature data correspond one-to-one to the N parallel head networks, and each head network in the N parallel head networks corresponds to an autonomous driving task, and the autonomous driving tasks include prediction tasks, decision tasks, and planning tasks; Input the weighted N types of feature data into the corresponding head network respectively to obtain H types of output results corresponding to each training data, wherein the H types of output results include K types of output results, where K is a positive integer less than or equal to H; Accumulating the loss values of part or all of the output results of each type of output results in the K types of output results obtained from the one batch of training data to obtain K accumulated loss values corresponding to the K types of output results respectively; The K accumulated loss values are weighted to obtain a loss value corresponding to each training process; and the parameters in the neural network are updated using the loss value.
6. The method according to claim 5, It is characterized in that The K types of output results include the first type of output results, and the K types of output results obtained from the one batch of training data include comprising F first-category output results, each of the F first-category output results corresponding to a first autonomous driving task in the autonomous driving tasks; The F first-category output results include E first-category output results, and the training data used to calculate the E first-category output results all carry labels representing the first autonomous driving task, and the accumulated loss value corresponding to the first-category output result is obtained by adding the E loss values corresponding to the E first-category output results, respectively, and E is a positive integer less than or equal to F.
7. The method according to claim 5 or 6, It is characterized in that The N parallel head networks include a first head network, the first head network outputs a D-type output result, the H-type output result includes the D-type output result, and D is a positive integer; After the parameters in the neural network are updated using the one loss value, the method further includes: Input G training data in the training set into the updated neural network respectively to obtain the D-type output results output by the first head network, the training set includes the one batch of training data, and G is a positive integer; Accumulate the loss values of part or all of the output results in each category of the D categories of output results to obtain D accumulated loss values corresponding to the D categories of output results respectively; Weighting the D accumulated loss values to obtain a first loss value corresponding to the first head network in each training process; The first loss value is used to update parameters in the first head network.
8. The method according to claim 5 or 6, It is characterized in that The N parallel head networks include L head networks, the L head networks correspond to the first autonomous driving task, the L head networks output P-type output results, the H-type output results include the P-type output results, and L and P are positive integers greater than or equal to 2; After the parameters in the neural network are updated using the one loss value, the method further includes: Input G training data in the training set into the updated neural network respectively to obtain the P types of output results output by the L head networks, the training set includes the one batch of training data, and G is a positive integer; Accumulate the loss values of part or all of the output results in each category of the P categories of output results to obtain P accumulated loss values corresponding to the P categories of output results; Weighting the P accumulated loss values to obtain a second loss value corresponding to the L head networks in each training process; The parameters in the L head networks are updated using the second loss value.
9. The method according to any one of claims 5 to 8, It is characterized in that The H-type output results include the predicted trajectory of the obstacle, the predicted trajectory distribution of the obstacle, the ego vehicle decision, the planned path of the ego vehicle, the planned trajectory of the ego vehicle, and the planned trajectory distribution of the ego vehicle; The predicted trajectory of the obstacle and the predicted trajectory distribution of the obstacle correspond to the prediction task, the ego vehicle decision corresponds to the decision task, and the planned road of the ego vehicle, the planned trajectory of the ego vehicle and the planned trajectory distribution of the ego vehicle correspond to the planning task.
10. An autonomous driving method, It is characterized in that The method comprises: Acquiring input data, wherein the input data includes vehicle data, obstacle data, road topology data, and navigation data; Using a mixture of experts MOE network in a neural network to perform feature extraction and feature fusion on the input data to obtain N types of feature data, the neural network also includes N parallel head networks, where N is a positive integer; Inputting each of the feature data into a corresponding head network among the N parallel head networks to perform an autonomous driving task corresponding to the head network; The vehicle is controlled based on the output results of each of the autonomous driving tasks.
11. The method according to claim 10, It is characterized in that Each training process of the neural network is as follows: each expert network in the MOE network is used to perform feature extraction and feature fusion on each piece of training data in a batch of training data to obtain the N types of feature data; the neural network is also used to weight the feature data of the same type output by the MOE network to obtain the weighted N types of feature data; and the weighted N types of feature data are respectively input into the corresponding head network to obtain H types of output results corresponding to each piece of training data, and the H types of output results include K types of output results, where K is a positive integer less than or equal to H; The updating of the neural network parameters is completed according to a loss value corresponding to each training process, wherein the loss value is obtained by weighting the K accumulated loss values, and the K accumulated loss values correspond to the K types of output results one by one, and the K accumulated loss values are obtained by calculating the middle of each type of output result in the K types of output results obtained by the one batch of training data. It is obtained by accumulating the loss values of the partial or all output results.
12. The method according to claim 10 or 11, It is characterized in that The K types of output results include first type of output results, the K types of output results obtained from one batch of training data include F first type of output results, and the F first type of output results all correspond to a first autonomous driving task in the autonomous driving tasks; The F first-category output results include E first-category output results, and the training data used to calculate the E first-category output results all carry labels representing the first autonomous driving task, and the accumulated loss value corresponding to the first-category output result is obtained by adding the E loss values corresponding to the E first-category output results, respectively, and E is a positive integer less than or equal to F.
13. The method according to any one of claims 10 to 12, It is characterized in that The N parallel head networks include a first head network, the first head network outputs D-type output results, the multiple types of output results include the D-type output results, and D is a positive integer; After the parameters in the neural network are updated using the one loss value, the method further includes: Input G training data in the training set into the updated neural network respectively to obtain the D-type output results output by the first head network, the training set includes the one batch of training data, and G is a positive integer; Accumulate the loss values of part or all of the output results in each category of the D categories of output results to obtain D accumulated loss values corresponding to the D categories of output results respectively; Weighting the D accumulated loss values to obtain a first loss value corresponding to the first head network in each training process; The first loss value is used to update parameters in the first head network.
14. The method according to any one of claims 10 to 12, It is characterized in that The N parallel head networks include L head networks, the L head networks correspond to the first autonomous driving task, the L head networks output P-type output results, the H-type output results include the P-type output results, and L and P are positive integers greater than or equal to 2; After the parameters in the neural network are updated using the one loss value, the method further includes: Input G training data in the training set into the updated neural network respectively to obtain the P types of output results output by the L head networks, the training set includes the one batch of training data, and G is a positive integer; Accumulate the loss values of part or all of the output results in each category of the P categories of output results to obtain P accumulated loss values corresponding to the P categories of output results; Weighting the P accumulated loss values to obtain a second loss value corresponding to the L head networks in each training process; The parameters in the L head networks are updated using the second loss value.
15. The method according to any one of claims 10 to 14, It is characterized in that The MOE network includes multiple expert networks, each of the multiple expert networks includes a self-attention network and a mutual attention network; Among them, the self-attention network is used to extract features from the input data, the mutual attention network is used to fuse the features extracted by the self-attention network, and the N types of feature data are generated through the output results of the mutual attention network.
16. The method according to any one of claims 10 to 15, It is characterized in that The autonomous driving task includes a prediction task, a decision task and a planning task; The output result of the prediction task includes the predicted trajectory of the obstacle and the predicted trajectory distribution of the obstacle, the output result of the decision task includes the vehicle decision, and the output result of the planning task includes the planned road of the vehicle, the planned trajectory of the vehicle and the planned trajectory distribution of the vehicle.
17. A neural network training device, It is characterized in that The neural network includes an expert mixture MOE network and N parallel head networks, the MOE network includes M expert networks, M and N are positive integers; the device includes: An encoding unit is used to extract and fuse features of each piece of training data in a batch of training data through each expert network in the M expert networks during each training process to obtain N types of feature data; and to weight the feature data of the same type output by the M expert networks to obtain weighted N types of feature data; wherein the weighted N types of feature data correspond one-to-one to the N parallel head networks, and each head network in the N parallel head networks corresponds to an autonomous driving task, and the autonomous driving tasks include prediction tasks, decision tasks, and planning tasks; A decoding unit is used to input the weighted N types of feature data into the corresponding head network to obtain each training data The corresponding H-type output result, wherein the H-type output result includes the K-type output result, where K is a positive integer less than or equal to H; An updating unit is used to accumulate the loss values of part or all of the output results of each type of output results in the K types of output results obtained by the one batch of training data to obtain K accumulated loss values corresponding to the K types of output results respectively; and to weight the K accumulated loss values to obtain a loss value corresponding to each training process; and to use the one loss value to update the parameters in the neural network.
18. The device according to claim 17, It is characterized in that The K types of output results include first type of output results, the K types of output results obtained from the one batch of training data include F first type of output results, and the F first type of output results all correspond to a first autonomous driving task in the autonomous driving tasks; The F first-category output results include E first-category output results, and the training data used to calculate the E first-category output results all carry labels representing the first autonomous driving task, and the accumulated loss value corresponding to the first-category output result is obtained by adding the E loss values corresponding to the E first-category output results, respectively, and E is a positive integer less than or equal to F.
19. The device according to claim 17 or 18, It is characterized in that The N parallel head networks include a first head network, the first head network outputs a D-type output result, the H-type output result includes the D-type output result, and D is a positive integer; after the parameters in the neural network are updated by using the one loss value, the encoding unit and the decoding unit are further used to: Processing G training data in a training set by the updated neural network to obtain the D-type output results output by the first head network, the training set includes the one batch of training data, and G is a positive integer; The updating unit is further used to accumulate the loss values of part or all of the output results in each category of the D types of output results to obtain D accumulated loss values corresponding to the D types of output results respectively; And weighting the D accumulated loss values to obtain a first loss value corresponding to the first head network in each training process; and using the first loss value to update the parameters in the first head network.
20. The device according to claim 17 or 18, It is characterized in that The N parallel head networks include L head networks, the L head networks correspond to the first autonomous driving task, the L head networks output P-type output results, the H-type output results include the P-type output results, and L and P are positive integers greater than or equal to 2; after the parameters in the neural network are updated by using the one loss value, the encoding unit and the decoding unit are further used to: Processing G training data in a training set by the updated neural network to obtain the P types of output results output by the L head networks, wherein the training set includes the one batch of training data, and G is a positive integer; The updating unit is further used to accumulate the loss values of part or all of the output results in each category of the P categories of output results to obtain P accumulated loss values corresponding to the P categories of output results respectively; And weighting the P accumulated loss values to obtain a second loss value corresponding to the L head networks in each training process; and using the second loss value to update the parameters in the L head networks.
21. The device according to any one of claims 17 to 20, It is characterized in that The H-type output results include the predicted trajectory of the obstacle, the predicted trajectory distribution of the obstacle, the ego vehicle decision, the planned path of the ego vehicle, the planned trajectory of the ego vehicle, and the planned trajectory distribution of the ego vehicle; The predicted trajectory of the obstacle and the predicted trajectory distribution of the obstacle correspond to the prediction task, the ego vehicle decision corresponds to the decision task, and the planned road of the ego vehicle, the planned trajectory of the ego vehicle and the planned trajectory distribution of the ego vehicle correspond to the planning task.
22. An automatic driving device, It is characterized in that The device comprises: An acquisition unit, used to acquire input data, wherein the input data includes vehicle data, obstacle data, road topology data and navigation data; A processing unit, configured to perform feature extraction and feature fusion on the input data using a mixture of experts MOE network in a neural network to obtain N types of feature data, wherein the neural network further includes N parallel head networks, where N is a positive integer; and input each type of the feature data into a corresponding head network among the N parallel head networks to perform an autonomous driving task corresponding to the head network; A control unit is used to control the vehicle based on the output results of each of the autonomous driving tasks.
23. The device according to claim 22, It is characterized in that During each training process of the neural network, the processing unit is specifically used to: Each expert network in the MOE network performs feature extraction and feature fusion on each piece of training data in a batch of training data to obtain the N types of feature data; and the feature data of the same type output by the MOE network are weighted by the neural network to obtain the weighted N types of feature data; and the weighted N types of feature data are respectively input into the corresponding head network to obtain H types of output results corresponding to each piece of training data, and the H types of output results include K types of output results, where K is a positive integer less than or equal to H; Among them, the updating of the neural network parameters is completed according to a loss value corresponding to each training process, and the loss value is obtained by weighting K accumulated loss values, and the K accumulated loss values correspond to the K types of output results one by one, and the K accumulated loss values are obtained by accumulating the loss values of part or all of the output results of each type of output results in the K types of output results obtained from the batch of training data.
24. The device according to claim 22 or 23, It is characterized in that The K types of output results include first type of output results, the K types of output results obtained from one batch of training data include F first type of output results, and the F first type of output results all correspond to a first autonomous driving task in the autonomous driving tasks; The F first-category output results include E first-category output results, and the training data used to calculate the E first-category output results all carry labels representing the first autonomous driving task, and the accumulated loss value corresponding to the first-category output result is obtained by adding the E loss values corresponding to the E first-category output results, respectively, and E is a positive integer less than or equal to F.
25. The device according to any one of claims 22 to 24, It is characterized in that The N parallel head networks include a first head network, the first head network outputs D-type output results, the multiple types of output results include the D-type output results, and D is a positive integer; after the parameters in the neural network are updated by using the one loss value, the processing unit is further used to: Using the updated neural network to process G training data in a training set to obtain the D-type output results output by the first head network, the training set includes the one batch of training data, and G is a positive integer; Accumulate the loss values of part or all of the output results in each category of the D categories of output results to obtain D accumulated loss values corresponding to the D categories of output results respectively; Weighting the D accumulated loss values to obtain a first loss value corresponding to the first head network in each training process; The first loss value is used to update parameters in the first head network.
26. The device according to any one of claims 22 to 24, It is characterized in that The N parallel head networks include L head networks, the L head networks correspond to the first autonomous driving task, the L head networks output P-type output results, the H-type output results include the P-type output results, and L and P are positive integers greater than or equal to 2; after the parameters in the neural network are updated by using the one loss value, the processing unit is further used to: Using the updated neural network to process G training data in a training set to obtain the P types of output results output by the L head networks, the training set includes the one batch of training data, and G is a positive integer; Accumulate the loss values of part or all of the output results in each category of the P categories of output results to obtain P accumulated loss values corresponding to the P categories of output results; Weighting the P accumulated loss values to obtain a second loss value corresponding to the L head networks in each training process; The parameters in the L head networks are updated using the second loss value.
27. The device according to any one of claims 22 to 26, It is characterized in that The MOE network includes multiple expert networks, each of the multiple expert networks includes a self-attention network and a mutual attention network; Among them, the self-attention network is used to extract features from the input data, the mutual attention network is used to fuse the features extracted by the self-attention network, and the N types of feature data are generated through the output results of the mutual attention network.
28. The device according to any one of claims 22 to 27, It is characterized in that The autonomous driving task includes a prediction task, a decision task and a planning task; The output result of the prediction task includes the predicted trajectory of the obstacle and the predicted trajectory distribution of the obstacle, the output result of the decision task includes the vehicle decision, and the output result of the planning task includes the planned road of the vehicle, the planned trajectory of the vehicle and the planned trajectory distribution of the vehicle.
29. A chip system, It is characterized in that The chip system includes at least one processor, a memory and an interface circuit. The memory, the interface circuit and the at least one processor are interconnected by lines. Instructions are stored in the at least one memory. When the instructions are executed by the processor, any method described in claims 5-9 is implemented.
30. A chip system, It is characterized in that The chip system includes at least one processor, a memory and an interface circuit. The memory, the interface circuit and the at least one processor are interconnected by lines. Instructions are stored in the at least one memory. When the instructions are executed by the processor, any method described in claims 10-16 is implemented.
31. A server, It is characterized in that The server comprises the chip system described in claim 29 or claim 30.
32. A vehicle, It is characterized in that The vehicle includes the chip system of claim 30.
33. A computer readable storage medium, It is characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed, the method described in any one of claims 5 to 16 is implemented.
34. A computer program product, It is characterized in that The computer program product comprises instructions, and when the instructions are executed, the method according to any one of claims 5 to 16 is implemented.
Citation Information
Patent Citations
Neural network, automatic driving method and device
CN118171684B
Automatic driving method, device, equipment, system, vehicle and computer readable storage medium
CN111572562A
Method for training recommendation probability prediction model and recommendation probability prediction method and device
CN113254792A
Multi-task model training method, multi-task prediction method and related products
CN114095381A
Decision-making method for safe driving of large commercial vehicle in urban low-speed environment
CN115257819A
