Method and apparatus for training an autonomous driving decision model
Patent Information
- Application Number
- CN202211060062.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-31
- Publication Date
- 2026-10-23
- Estimated Expiration
- 2042-08-31
AI Technical Summary
[0018]本申请实施例提供的自动驾驶决策模型的训练方法及装置,通过在通过训练样本集训练初始自动驾驶决策模型的前向计算过程中,通过预设离散排列方法确定目标排列矩阵;通过目标排列矩阵,从表征完整卷积核空间的预设二值卷积核子码集中选择目标子集;根据目标子集和初始自动驾驶决策模型的全精度卷积矩阵,确定初始自动驾驶决策模型对应的二值卷积核矩阵;响应于确定采用二值卷积核矩阵的初始自动驾驶决策模型达到预设条件,得到训练后的自动驾驶决策模型,从而在进一步压缩和加速二值化的自动驾驶决策模型的同时,利用基于卷积核维度构建的预设二值卷积核子码集减小了二值化过程的量化误差;采用从预设二值卷积核子码集中寻找最接近全精度卷积矩阵的子码以进行二值化的方式,有效防止了二值卷积核子码集退化的现象,提高了预设二值卷积核子码集中的子码在网络训练过程中的表达能力,保证了自动驾驶决策模型的准确度。
Smart Images

Figure CN115293292B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, specifically to deep learning and artificial intelligence technologies, and particularly to a training method and apparatus for an autonomous driving decision-making model, and an autonomous driving decision-making method and apparatus. Background Technology
[0002] Network quantization methods convert network weights into low-bit values, offering efficiency advantages for resource-constrained devices. As an extreme solution to network quantization, Binary Neural Networks (BNNs) represent weights and activations with a single bit, resulting in a 32x storage compression ratio and approximately 58x reduction in CPU (central processing unit) computation. Currently, techniques to further compress and accelerate BNNs to make them more compact still yield significantly lower accuracy compared to BNNs, leading to lower accuracy in autonomous driving decision-making models employing BNNs. Summary of the Invention
[0003] This application provides a training method and apparatus for an autonomous driving decision-making model, an autonomous driving decision-making method and apparatus, a computer-readable medium, and an electronic device.
[0004] In a first aspect, embodiments of this application provide a training method for an autonomous driving decision-making model, comprising: in the forward computation process of training an initial autonomous driving decision-making model using a training sample set, determining a target permutation matrix using a preset discrete permutation method; selecting a target subset from a preset binary convolution kernel subcode set representing the complete convolution kernel space using the target permutation matrix; determining a binary convolution kernel matrix corresponding to the initial autonomous driving decision-making model based on the target subset and the full-precision convolution matrix of the initial autonomous driving decision-making model; and obtaining the trained autonomous driving decision-making model in response to determining that the initial autonomous driving decision-making model using the binary convolution kernel matrix has reached a preset condition.
[0005] In some embodiments, the above-mentioned determination of the target permutation matrix by a preset discrete permutation method includes: determining a real matrix with weights close to binarization by a preset discrete permutation method; and performing Hungarian matching on the real matrix to obtain the target permutation matrix.
[0006] In some embodiments, the above method further includes: during the reverse calculation of the initial autonomous driving decision model, determining the gradient of the target permutation matrix as the gradient of the real matrix based on the gradient channel pass-through method, so as to update the real matrix.
[0007] In some embodiments, before determining the gradient of the target permutation matrix as the gradient of a real matrix based on the gradient channel pass-through method to update the real matrix, the method further includes: determining the gradient corresponding to the target subset; and determining the gradient corresponding to the target permutation matrix based on the gradient corresponding to the target subset and a preset binary convolution kernel subcode set.
[0008] In some embodiments, the method further includes: determining the gradient corresponding to the full-precision convolution matrix based on the gradient corresponding to the binary convolution kernel matrix, so as to update the full-precision convolution matrix based on the gradient corresponding to the full-precision convolution matrix.
[0009] Secondly, embodiments of this application provide an autonomous driving decision-making method, including: acquiring environmental information of an autonomous vehicle; and determining decision instructions for the autonomous vehicle based on the environmental information using a pre-trained autonomous driving decision-making model, wherein the autonomous driving decision-making model is trained using the method described in any implementation of the first aspect.
[0010] Thirdly, embodiments of this application provide a training apparatus for an autonomous driving decision-making model, comprising: a first determining unit configured to determine a target permutation matrix by means of a preset discrete permutation method during the forward computation process of training an initial autonomous driving decision-making model using a training sample set; a selecting unit configured to select a target subset from a preset binary convolution kernel subcode set representing the complete convolution kernel space using the target permutation matrix; a second determining unit configured to determine a binary convolution kernel matrix corresponding to the initial autonomous driving decision-making model based on the target subset and the full-precision convolution matrix of the initial autonomous driving decision-making model; and a obtaining unit configured to obtain a trained autonomous driving decision-making model in response to the determination that the initial autonomous driving decision-making model using the binary convolution kernel matrix has reached a preset condition.
[0011] In some embodiments, the first determining unit is further configured to: determine a real matrix with weights close to binarization using a preset discrete permutation method; and perform Hungarian matching on the real matrix to obtain a target permutation matrix.
[0012] In some embodiments, the above apparatus further includes: a third determining unit, configured to determine the gradient of the target permutation matrix as the gradient of the real matrix based on the gradient channel pass-through method during the reverse calculation of the initial autonomous driving decision model, so as to update the real matrix.
[0013] In some embodiments, the above apparatus further includes: a fourth determining unit, configured to determine the gradient corresponding to the target subset; and to determine the gradient corresponding to the target permutation matrix based on the gradient corresponding to the target subset and a preset binary convolution kernel subcode set.
[0014] In some embodiments, the above apparatus further includes: a fifth determining unit, configured to determine the gradient corresponding to the full-precision convolution matrix based on the gradient corresponding to the binary convolution kernel matrix, so as to update the full-precision convolution matrix based on the gradient corresponding to the full-precision convolution matrix.
[0015] Fourthly, embodiments of this application provide an autonomous driving decision-making device, comprising: an acquisition unit configured to acquire environmental information of an autonomous vehicle; and a decision-making unit configured to determine decision instructions for the autonomous vehicle based on the environmental information using a pre-trained autonomous driving decision-making model, wherein the autonomous driving decision-making model is trained using the method described in any implementation of the third aspect.
[0016] Fifthly, embodiments of this application provide a computer-readable medium having a computer program stored thereon, wherein when the program is executed by a processor, it implements the method described in either the first or second aspect.
[0017] Sixthly, embodiments of this application provide an electronic device, including: one or more processors; and a storage device storing one or more programs thereon, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the method described in any implementation of the first aspect or the second aspect.
[0018] The training method and apparatus for an autonomous driving decision-making model provided in this application, during the forward computation process of training an initial autonomous driving decision-making model using a training sample set, determine a target permutation matrix using a preset discrete permutation method; select a target subset from a preset binary convolutional kernel subcode set representing the complete convolutional kernel space using the target permutation matrix; determine the binary convolutional kernel matrix corresponding to the initial autonomous driving decision-making model based on the target subset and the full-precision convolutional matrix of the initial autonomous driving decision-making model; and obtain the trained autonomous driving decision-making model in response to the determination that the initial autonomous driving decision-making model using the binary convolutional kernel matrix has met preset conditions. This further compresses and accelerates the binarized autonomous driving decision-making model while reducing the quantization error of the binarization process by utilizing the preset binary convolutional kernel subcode set constructed based on the convolutional kernel dimension. By using the method of finding the subcode closest to the full-precision convolutional matrix from the preset binary convolutional kernel subcode set for binarization, the degradation of the binary convolutional kernel subcode set is effectively prevented, improving the expressive power of the subcodes in the preset binary convolutional kernel subcode set during network training and ensuring the accuracy of the autonomous driving decision-making model. Attached Figure Description
[0019] Other features, objects, and advantages of this application will become more apparent from the following detailed description of non-limiting embodiments with reference to the accompanying drawings:
[0020] Figure 1This is an exemplary system architecture diagram in which one embodiment of this application can be applied;
[0021] Figure 2 This is a flowchart of an embodiment of the training method for the autonomous driving decision model according to this application;
[0022] Figure 3 This is a schematic diagram illustrating an application scenario of the training method for the autonomous driving decision-making model according to this embodiment;
[0023] Figure 4 This is a flowchart of yet another embodiment of the training method for the autonomous driving decision model according to this application;
[0024] Figure 5 This is a schematic diagram of the information flow of the training method for the autonomous driving decision model according to this application;
[0025] Figure 6 This is a flowchart of an embodiment of the autonomous driving decision-making method according to this application;
[0026] Figure 7 This is a structural diagram of an embodiment of a training device for an autonomous driving decision-making model according to this application;
[0027] Figure 8 This is a structural diagram of one embodiment of the autonomous driving decision-making device according to this application;
[0028] Figure 9 This is a schematic diagram of the structure of a computer system suitable for implementing the embodiments of this application. Detailed Implementation
[0029] The present application will now be described in further detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and not intended to limit it. Furthermore, it should be noted that, for ease of description, only the parts relevant to the invention are shown in the accompanying drawings.
[0030] It should be noted that, unless otherwise specified, the embodiments and features described in this application can be combined with each other. This application will now be described in detail with reference to the accompanying drawings and embodiments.
[0031] Figure 1 An exemplary architecture 100 of a training method and apparatus for an autonomous driving decision-making model that can be applied to this application, and an autonomous driving decision-making method and apparatus are shown.
[0032] like Figure 1As shown, the system architecture 100 may include terminal devices 101, 102, and 103, a network 104, and a server 105. The communication connections between terminal devices 101, 102, and 103 form a network topology. Network 104 serves as the medium for providing communication links between terminal devices 101, 102, and 103 and server 105. Network 104 may include various connection types, such as wired or wireless communication links or fiber optic cables, etc.
[0033] Users can use terminal devices 101, 102, and 103 to interact with server 105 via network 104 to receive or send messages, etc. Terminal devices 101, 102, and 103 can be hardware or software that supports network connectivity for data interaction and processing. When terminal devices 101, 102, and 103 are hardware, they can be various electronic devices that support network connectivity, information acquisition, interaction, display, and processing functions, including but not limited to in-vehicle computers, smartphones, tablets, e-book readers, laptops, and desktop computers. When terminal devices 101, 102, and 103 are software, they can be installed in the aforementioned electronic devices. They can be implemented as multiple software programs or software modules, for example, to provide distributed services, or as a single software program or software module. No specific limitations are made here.
[0034] Server 105 can be a server providing various services, such as a backend processing server for training a binary autonomous driving decision-making model based on the training sample set obtained from terminal devices 101, 102, and 103. During the forward propagation process of the initial autonomous driving decision-making model training, a target permutation matrix is determined using a preset discrete permutation method; a target subset is selected from a preset binary convolution kernel sub-code set representing the complete convolution kernel space using the target permutation matrix; based on the target subset and the full-precision convolution matrix of the initial autonomous driving decision-making model, the binary convolution kernel matrix corresponding to the initial autonomous driving decision-making model is determined; in response to the determination that the initial autonomous driving decision-making model using the binary convolution kernel matrix meets preset conditions, the trained autonomous driving decision-making model is obtained. As an example, server 105 can be a cloud server.
[0035] It should be noted that a server can be either hardware or software. When the server is hardware, it can be implemented as a distributed server cluster consisting of multiple servers, or as a single server. When the server is software, it can be implemented as multiple software programs or software modules (such as software programs or software modules used to provide distributed services), or as a single software program or software module. No specific limitations are made here.
[0036] It should also be noted that the training method and autonomous driving decision-making method of the autonomous driving decision-making model provided in the embodiments of this application can be executed by a server, executed by a terminal device, or executed by the server and the terminal device in cooperation with each other. Accordingly, the training device of the autonomous driving decision-making model and the various parts (e.g., various units) included in the autonomous driving decision-making device can all be set in the server, all in the terminal device, or separately in the server and the terminal device.
[0037] It should be understood that Figure 1 The number of terminal devices, networks, and servers shown is merely illustrative. Depending on implementation needs, any number of terminal devices, networks, and servers can be included. When the training method for the autonomous driving decision-making model and the electronic devices running on it do not require data transmission with other electronic devices, the system architecture may only include the training method for the autonomous driving decision-making model and the electronic devices running on it (e.g., servers or terminal devices).
[0038] Continue to refer to Figure 2 The flowchart 200 illustrates an embodiment of a training method for an autonomous driving decision-making model, including the following steps:
[0039] Step 201: In the forward computation process of training the initial autonomous driving decision model using the training sample set, the target permutation matrix is determined by a preset discrete permutation method.
[0040] In this embodiment, the execution entity of the training method for the autonomous driving decision model (e.g., Figure 1 The terminal device or server in the process can determine the target permutation matrix by using a preset discrete permutation method during the forward computation process of training the initial autonomous driving decision model through the training sample set.
[0041] The training samples in the training sample set include sample environment information and autonomous driving instruction labels. The sample environment information can be represented by multi-angle sample images and / or point cloud data, while the autonomous driving instruction labels represent the expected decision-making instructions of the autonomous vehicle under the given sample environment information. These decision-making instructions are used to indicate information such as the autonomous vehicle's acceleration and steering angle.
[0042] Binary neural networks (BNNs) use only two values, +1 and -1, to represent the weights and activations of the neural network. Typically, during the forward computation, a full-precision convolutional matrix is transformed into a binary convolutional matrix. Feature extraction and other operations are then performed using the binary convolutional matrix to obtain the network output. This embodiment uses binary representation of the initial autonomous driving decision-making model during the training of the initial autonomous driving decision-making model using a training sample set and a machine learning algorithm.
[0043] Neural networks typically consist of multiple network layers; for example, a convolutional neural network includes multiple convolutional layers. During the forward computation of the initial autonomous driving decision model, each convolutional layer uses the output of the previous convolutional layer as input to perform a convolution operation, thus obtaining the output of that convolutional layer.
[0044] In this embodiment, during the forward computation process of training the initial autonomous driving decision model using the training sample set, for each convolutional layer of the initial autonomous driving decision model, a target permutation matrix is determined using a preset discrete permutation method. The target permutation matrix is used to select a target subset from a preset binary convolutional kernel subcode set representing the complete convolutional kernel space.
[0045] As an example, the aforementioned execution entity can use the Gumbel-Sinkhorn technique to determine the target permutation matrix. Specifically, the process of determining the target permutation matrix using the Gumbel-Sinkhorn technique is represented by the following formula:
[0046] P = S κ ((X+∈) / τ)
[0047] Where P represents the target permutation matrix, S is the Sinkhorn operator of the Gumbel-Sinkhorn technique, κ and τ are its iteration number and temperature coefficient, respectively, and ∈ is the noise factor. When κ is infinitely large and τ is infinitely small, the target permutation matrix P obtained by the above formula is... GS It is a 0 / 1 binary matrix.
[0048] However, in actual calculations, due to limitations in computer equipment performance, both κ and τ are finite values. Therefore, P calculated by the above formula may not be a true 0 / 1 binary matrix.
[0049] When κ is large and τ is small, P is a real matrix close to 0 / 1, not a strictly binary permutation matrix. For this situation, in some optional implementations of this embodiment, the aforementioned execution entity can perform the following operations:
[0050] First, a real matrix with weights close to binary is determined by a preset discrete permutation method; then, Hungarian matching is performed on the real matrix to obtain the target permutation matrix.
[0051] Specifically, the process of determining the permutation matrix can be represented by the following formula:
[0052] P real =Hungarian(P GS )
[0053] Among them, P realHungarian(P) represents the strictly binarized target permutation matrix. GS ) represents the real matrix P obtained based on the Gumbel-Sinkhorn technique. GS Perform a Hungarian match.
[0054] This implementation provides a more practical way to determine the permutation matrix, improving the applicability of the permutation matrix determination process.
[0055] Step 202: Select a target subset from a preset set of binary convolution kernel subcodes that represent the complete convolution kernel space using the target permutation matrix.
[0056] In this embodiment, the aforementioned execution entity can select a target subset from a preset binary convolution kernel subcode set that represents the complete convolution kernel space through a target permutation matrix.
[0057] In this embodiment, a preset binary convolution kernel sub-code set representing the complete convolution kernel space is pre-configured in the aforementioned execution entity or an electronic device communicatively connected to the aforementioned execution entity. As an example, the preset binary convolution kernel sub-code set is a binary sub-code set consisting of 512 elements.
[0058] As an example, the aforementioned execution entity can determine the target subset using the following formula:
[0059] U = BP real V
[0060] Where B is a preset set of binary convolution kernel subcodes. The vectorized representation of U, where U is the target subset. The vectorized representation of P real V represents the target permutation matrix, where V is a fixed selection matrix.
[0061] Step 203: Determine the binary convolution kernel matrix corresponding to the initial autonomous driving decision model based on the target subset and the full-precision convolution matrix of the initial autonomous driving decision model.
[0062] In this embodiment, the aforementioned execution entity can determine the binary convolution kernel matrix corresponding to the initial autonomous driving decision model based on the target subset and the full-precision convolution matrix of the initial autonomous driving decision model. The full-precision convolution matrix represents the convolution matrix used by the neural network before binarization.
[0063] As an example, the aforementioned execution entity can determine the binary convolution kernel matrix in the following manner:
[0064]
[0065] in, Let u represent the binary convolution kernel matrix, and let u represent the target subset. In the sub-code, w represents the full-precision convolution matrix.
[0066] After obtaining the binary convolution kernel matrix corresponding to the full-precision convolution matrix, the initial autonomous driving decision model can use the binary convolution kernel matrix to complete the forward computation process.
[0067] Combining steps 201-203, the process of determining the binary convolution kernel matrix of the initial autonomous driving decision model can be represented by the following formula:
[0068]
[0069] in, Let u represent the binary convolution matrix and u represent the target subset. In the subcode, w represents the full-precision convolution matrix, and B is the preset binary convolution kernel subcode set. The vectorized representation of U, where U is the target subset. The vectorized representation of , where P represents the target permutation matrix, V represents the set of all permutation matrices, where V is a fixed selection matrix.
[0070] During the forward computation of the initial autonomous driving decision model, for each convolutional layer, the process of determining the binary convolution kernel matrix as shown in steps 201-203 above can be performed, thereby enabling the corresponding convolutional layer to adopt the determined binary convolution kernel matrix.
[0071] Step 204: In response to the determination that the initial autonomous driving decision model using the binary convolution kernel matrix has met the preset conditions, the trained autonomous driving decision model is obtained.
[0072] In this embodiment, the aforementioned execution entity can obtain the trained autonomous driving decision model in response to the determination that the initial autonomous driving decision model using a binary convolution kernel matrix has reached the preset conditions.
[0073] As an example, the aforementioned execution entity can repeatedly perform the following training operations: First, select untrained training samples from the training sample set; then, obtain an initial autonomous driving decision model using a binary convolution kernel matrix through steps 201-203 above, input the sample environment information from the selected training samples into the initial autonomous driving decision model using a binary convolution kernel matrix, and obtain the actual decision command output by the model; then, determine the loss between the actual decision command and the autonomous driving command label in the selected training samples, and then update the parameters of the initial autonomous driving decision model using the stochastic gradient descent method based on the loss, to obtain the initial autonomous driving decision model corresponding to the next training operation.
[0074] By iteratively executing the above training operations, the initial autonomous driving decision model using a binary convolutional kernel matrix that meets the preset conditions is ultimately used as the trained autonomous driving decision model. These preset conditions could include, for example, training time exceeding a preset time threshold, the number of training iterations exceeding a preset number of iterations threshold, and the loss tending towards convergence.
[0075] See also Figure 3 , Figure 3 This is a schematic diagram 300 illustrating an application scenario of the training method for the autonomous driving decision-making model according to this embodiment. Figure 3 In the application scenario, server 301 is performing the training process of the initial autonomous driving decision model based on the training sample set. During the forward computation of the initial autonomous driving decision model, server 301 determines the target permutation matrix 302 through a preset discrete permutation method; using the target permutation matrix 302, it selects a target subset 303 from a preset binary convolution kernel sub-code set representing the complete convolution kernel space; based on the target subset 303 and the full-precision convolution matrix 304 of the initial autonomous driving decision model, it determines the binary convolution kernel matrix 305 corresponding to the initial autonomous driving decision model; in response to the determination that the initial autonomous driving decision model using the binary convolution kernel matrix has reached the preset conditions, the trained autonomous driving decision model is obtained.
[0076] The method provided in the above embodiments of this application determines the target permutation matrix through a preset discrete permutation method during the forward computation process of training an initial autonomous driving decision model using a training sample set; selects a target subset from a preset binary convolution kernel sub-code set representing the complete convolution kernel space using the target permutation matrix; determines the binary convolution kernel matrix corresponding to the initial autonomous driving decision model based on the target subset and the full-precision convolution matrix of the initial autonomous driving decision model; and obtains the trained autonomous driving decision model after determining that the initial autonomous driving decision model using the binary convolution kernel matrix has met preset conditions upon determination. This new model further compresses and accelerates the binarization of autonomous driving decision-making models. Compared to existing binary convolutional kernel subcode sets built based on the channel dimension, it reduces the quantization error in the binarization process by using a preset binary convolutional kernel subcode set built based on the convolutional kernel dimension. By finding the subcode closest to the full-precision convolution matrix from the preset binary convolutional kernel subcode set for binarization, it effectively prevents the degradation of the preset binary convolutional kernel subcode set, improves the expressive power of the subcodes in the binary convolutional kernel subcode set during network training, and ensures the accuracy of the autonomous driving decision-making model.
[0077] In some optional implementations of this embodiment, the execution entity may perform the following operations: during the reverse calculation of the initial autonomous driving decision model, the gradient of the target permutation matrix is determined as the gradient of the real matrix based on the gradient channel pass-through method, so as to update the real matrix.
[0078] The training process of a neural network includes forward computation and backward computation. In the forward computation process, the neural network model takes the training samples as input and processes them layer by layer through its internal network structure to obtain the actual output. After completing the forward computation process, the loss between the actual output and the expected output (the autonomous driving decision instruction label corresponding to the input training samples) can be determined by a preset loss function.
[0079] During the reverse computation process, the neural network determines the gradient corresponding to each layer of the neural network structure based on the loss information and the chain rule, and then updates the weights of each network layer through methods such as gradient descent and stochastic gradient descent.
[0080] In this embodiment, the PSTE (Permutation Straight-Through Estimator) method is used to determine the gradient of the target permutation matrix as the gradient of the real matrix, thereby updating the real matrix. Using the PSTE method improves the information processing efficiency of the reverse computation process while ensuring gradient accuracy.
[0081] In some optional implementations of this embodiment, before determining the gradient of the target permutation matrix as the gradient of the real matrix based on the gradient channel pass-through method to update the real matrix, the execution entity needs to perform the following operations:
[0082] First, determine the gradient corresponding to the target subset; then, determine the gradient corresponding to the target permutation matrix based on the gradient corresponding to the target subset and the preset binary convolution kernel subcode set.
[0083] During the reverse computation process, the aforementioned execution entity can first determine the gradient g(u) corresponding to each subcode in the target subset. j Then, the gradient corresponding to the target permutation matrix is determined by the following formula:
[0084] g(P real ) = B T g(U)V T
[0085] Among them, g(P) real B represents the gradient corresponding to the target permutation matrix. T V T Let g(U) represent the transpose of the binary convolution kernel subcode set B and the transpose of the fixed selection matrix V, respectively, and g(U) represent the gradient corresponding to the target subset.
[0086] In some optional implementations of this embodiment, the execution entity may also perform the following operations: determine the gradient corresponding to the full-precision convolution matrix based on the gradient corresponding to the binary convolution kernel matrix, so as to update the full-precision convolution matrix based on the gradient corresponding to the full-precision convolution matrix.
[0087] As an example, the aforementioned execution entity can specifically determine the gradient corresponding to the full-precision convolution matrix using the following formula:
[0088]
[0089] Among them, g(w c,i ) represents the weights w in the full-precision convolution matrix. c,i gradient, Represents the weights in the binary convolution kernel matrix The weight.
[0090] After determining the gradient of the full-precision convolution matrix, the full-precision convolution matrix is updated based on the gradient descent method.
[0091] Thus, during the training of the initial autonomous driving decision model, for each input training sample, after each forward computation, the binary convolution matrix corresponding to each network layer is obtained through the above implementation method, and the loss between the actual output and the expected output of the initial autonomous driving decision model is determined. Through the backward computation process corresponding to this forward computation process, the gradient of each network layer is determined based on the loss obtained from the forward computation process, including the gradient corresponding to the binary convolution kernel matrix, the gradient of the real matrix, the gradient corresponding to the target permutation matrix, and the gradient corresponding to the full-precision convolution matrix. Then, the parameters are updated through their respective gradients, so that the updated parameters can be used for the next forward computation process.
[0092] It should be noted that the gradient corresponding to the target permutation matrix is used to determine the gradient of the real matrix, and is not used to update the target permutation matrix. The update process of the target permutation matrix is as follows: the gradient corresponding to the target permutation matrix is assigned as the gradient of the corresponding real matrix; the real matrix is updated with parameters through the corresponding gradient; Hungarian matching is performed on the real matrix after parameter update to obtain the updated target permutation matrix.
[0093] In this embodiment, after each forward and backward calculation process is completed, the initial autonomous driving decision model completes a sequential training operation by inputting the corresponding training samples until the preset conditions are met.
[0094] Continue to refer to Figure 4 The diagram illustrates a schematic flow 400 of an embodiment of a training method for an autonomous driving decision model according to this application, wherein the following steps are performed for each network layer in a binary neural network:
[0095] Step 401: In the forward computation process of training the initial autonomous driving decision model using the training sample set, a real number matrix with weights close to binary is determined by a preset discrete permutation method.
[0096] Step 402: Perform Hungarian matching on the real matrix to obtain the target permutation matrix.
[0097] Step 403: Select a target subset from a preset binary convolution kernel subcode set representing the complete convolution kernel space using the target permutation matrix.
[0098] Step 404: Determine the binary convolution kernel matrix corresponding to the initial autonomous driving decision model based on the target subset and the full-precision convolution matrix of the initial autonomous driving decision model.
[0099] Step 405: In the reverse calculation process of the initial autonomous driving decision model, determine the gradient corresponding to the target subset.
[0100] Step 406: Determine the gradient corresponding to the target permutation matrix based on the gradient corresponding to the target subset and the preset binary convolution kernel subcode set.
[0101] Step 407: Based on the gradient channel pass-through method, determine the gradient of the target permutation matrix as the gradient of the real matrix, so as to update the real matrix.
[0102] Step 408: Determine the gradient corresponding to the full-precision convolution matrix based on the gradient corresponding to the binary convolution kernel matrix, and update the full-precision convolution matrix based on the gradient corresponding to the full-precision convolution matrix.
[0103] Step 409: In response to the determination that the initial autonomous driving decision model using the binary convolution kernel matrix has met the preset conditions, the trained autonomous driving decision model is obtained.
[0104] As can be seen from this embodiment, with Figure 2 Compared to the corresponding embodiments, the training method flow 400 of the autonomous driving decision model in this embodiment specifically illustrates the determination process of the target permutation matrix in the forward calculation process and the parameter update process in the backpropagation process. While further compressing and accelerating the binarized autonomous driving decision model, it improves the accuracy of the autonomous driving decision model.
[0105] To further illustrate the information processing procedure of this application, such as Figure 5 As shown, it includes a target permutation matrix 501, a real number matrix 502, a full-precision convolution matrix 503, and a binary convolution kernel matrix 504. The specific information processing procedure is as follows:
[0106] 1. Let w and These are the full-precision convolution matrix and the corresponding binary convolution kernel matrix, respectively. and Let the preset binary convolution kernel sub-code set and the target subset of the sub-code set be respectively. Then the binary quantization process can be expressed as:
[0107]
[0108] Wherein, B and U are respectively: and The vectorized representation of, Let P be the set of all permutation matrices, and V be a fixed selection matrix.
[0109] 2. Based on the above binary quantization expression, the objective is to learn an appropriate permutation matrix P. A neural network can be designed to output this matrix, utilizing the existing Gumbel-Sinkhorn technique to learn the permutation matrix. The optimization process for the target subset of the preset convolutional kernel subcode set is as follows:
[0110] U=BS κ ((X+∈) / τ)V
[0111] Where S is the Sinkhorn operator of the Gumbel-Sinkhorn technique, k and τ are its iteration number and temperature coefficient, respectively, and ∈ is the noise factor. When κ is infinitely large and τ is infinitely small, the target permutation matrix P obtained by the above formula is... GS =S κ ((X+∈) / τ) is a 0 / 1 binary matrix.
[0112] However, in actual calculations, both κ and τ are finite values. When κ is large and τ is small, P GS It is a real number matrix close to 0 / 1, not a strictly permutation matrix. The Hungarian permutation matching algorithm based on P... GS We obtain the closest 0 / 1 discrete matrix, denoted as P. real In summary, the forward computation process of the initial autonomous driving decision model is as follows:
[0113] P real =Hungarian(P GS )
[0114] U = BP real V
[0115]
[0116] Among them, P GS P represents a real matrix with weights close to 0 / 1. real This represents the target permutation matrix obtained by performing Hungarian matching on a real matrix.
[0117] 4. During the reverse calculation process, based on the gradient path direct method using the permutation matrix, P is directly applied. real Gradient assigned to P GS The gradient. Specifically, the reverse calculation process is as follows:
[0118] g(P real ) = B T g(U)V T
[0119] g(P GS )≈g(P real )
[0120]
[0121] Among them, g(P) real B represents the gradient corresponding to the target permutation matrix. T V T Let g(U) represent the transpose of the preset binary convolution kernel subset B and the transpose of the fixed selection matrix V, respectively. Let g(P) represent the gradient corresponding to the target subset. GS ) represents a real matrix P GS The gradient, g(w) c,i ) represents the weights w in the full-precision convolution matrix. c,i gradient, Represents the weights in the binary convolution kernel matrix The weight.
[0122] Continue to refer to Figure 6 The flowchart 600 of an embodiment of an autonomous driving decision-making method is shown, including the following steps:
[0123] Step 601: Obtain environmental information for the autonomous vehicle.
[0124] In this embodiment, the executing entity of the autonomous driving decision-making method (e.g. Figure 1 Terminal devices or servers in the system can obtain environmental information from autonomous vehicles.
[0125] Autonomous vehicles can be equipped with data acquisition devices such as cameras and radar to collect image data and point cloud data around the autonomous vehicle, which serves as environmental information for the autonomous vehicle.
[0126] Step 602: Determine the decision instructions for the autonomous vehicle based on environmental information using a pre-trained autonomous driving decision model.
[0127] In this embodiment, the aforementioned execution entity can determine the decision instructions for the autonomous vehicle based on environmental information using a pre-trained autonomous driving decision model.
[0128] The autonomous driving decision-making model can be trained using any of the implementations in Examples 200, 400, and 500. Decision commands are used to instruct the autonomous vehicle on controllable information such as acceleration and steering angle. Upon receiving the decision commands, the autonomous vehicle can be controlled to operate according to them.
[0129] This embodiment provides an autonomous driving decision-making method based on a binarized autonomous driving decision-making model, which improves the efficiency and accuracy of decision command generation, thereby enhancing the safety of autonomous vehicles.
[0130] Continue to refer to Figure 7 As an implementation of the methods shown in the above figures, this application provides an embodiment of a training device for an autonomous driving decision-making model, which is similar to... Figure 2 Corresponding to the method embodiments shown, this device can be specifically applied to various electronic devices.
[0131] like Figure 7 As shown, the training device 700 for the autonomous driving decision model includes: a first determining unit 701, configured to determine a target permutation matrix by a preset discrete permutation method during the forward computation process of training the initial autonomous driving decision model using a training sample set; a selecting unit 702, configured to select a target subset from a preset binary convolution kernel subcode set representing the complete convolution kernel space using the target permutation matrix; a second determining unit 703, configured to determine the binary convolution kernel matrix corresponding to the initial autonomous driving decision model based on the target subset and the full-precision convolution matrix of the initial autonomous driving decision model; and a obtaining unit 704, configured to obtain the trained autonomous driving decision model in response to the determination that the initial autonomous driving decision model using the binary convolution kernel matrix has reached a preset condition.
[0132] In some optional implementations of this embodiment, the first determining unit 601 is further configured to: determine a real matrix with weights close to binarization by a preset discrete permutation method; and perform Hungarian matching on the real matrix to obtain the target permutation matrix.
[0133] In some optional implementations of this embodiment, the above-mentioned device further includes: a third determining unit (not shown in the figure), configured to determine the gradient of the target permutation matrix as the gradient of the real matrix based on the gradient channel pass-through method during the reverse calculation of the initial autonomous driving decision model, so as to update the real matrix.
[0134] In some optional implementations of this embodiment, the above apparatus further includes: a fourth determining unit (not shown in the figure), configured to determine the gradient corresponding to the target subset; and to determine the gradient corresponding to the target permutation matrix based on the gradient corresponding to the target subset and a preset binary convolution kernel subcode set.
[0135] In some optional implementations of this embodiment, the above apparatus further includes: a fifth determining unit (not shown in the figure), configured to determine the gradient corresponding to the full-precision convolution matrix based on the gradient corresponding to the binary convolution kernel matrix, so as to update the full-precision convolution matrix based on the gradient corresponding to the full-precision convolution matrix.
[0136] In this embodiment, the first determining unit in the training device for the autonomous driving decision model determines the target permutation matrix through a preset discrete permutation method during the forward computation process of training the initial autonomous driving decision model using the training sample set; the selection unit selects a target subset from a preset binary convolution kernel sub-code set representing the complete convolution kernel space using the target permutation matrix; the second determining unit determines the binary convolution kernel matrix corresponding to the initial autonomous driving decision model based on the target subset and the full-precision convolution matrix of the initial autonomous driving decision model; the obtaining unit obtains the trained autonomous driving decision model in response to determining that the initial autonomous driving decision model using the binary convolution kernel matrix has reached a preset condition. While further compressing and accelerating the binarized autonomous driving decision model, the preset binary convolution kernel sub-code set constructed based on the convolution kernel dimension reduces the quantization error in the binarization process; by finding the sub-code closest to the full-precision convolution matrix from the preset binary convolution kernel sub-code set for binarization, the phenomenon of degradation of the binary convolution kernel sub-code set is effectively prevented, the expressive power of the sub-codes in the binary convolution kernel sub-code set during network training is improved, and the accuracy of the autonomous driving decision model is guaranteed.
[0137] Continue to refer to Figure 8 As an implementation of the methods shown in the above figures, this application provides an embodiment of an autonomous driving decision-making device, which is similar to... Figure 6 Corresponding to the method embodiments shown, this device can be specifically applied to various electronic devices.
[0138] like Figure 8 As shown, the autonomous driving decision-making device 800 includes: an acquisition unit 801 configured to acquire environmental information of the autonomous vehicle; and a decision-making unit 802 configured to determine the decision instructions for the autonomous vehicle based on the environmental information using a pre-trained autonomous driving decision-making model. The autonomous driving decision-making model is trained using any of the implementation methods in embodiment 700.
[0139] In this embodiment, an unmanned driving decision-making device is provided. Based on a binary autonomous driving decision-making model, it improves the efficiency and accuracy of generating decision instructions, thereby improving the safety of unmanned vehicles.
[0140] The following is for reference. Figure 9 It illustrates a device suitable for implementing embodiments of this application (e.g., Figure 1The diagram shows the structure of the computer system 900 of the devices 101, 102, 103, and 105. Figure 9 The device shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of this application.
[0141] like Figure 9 As shown, the computer system 900 includes a processor (e.g., CPU, Central Processing Unit) 901, which can perform various appropriate actions and processes based on programs stored in read-only memory (ROM) 902 or programs loaded from storage section 908 into random access memory (RAM) 903. The RAM 903 also stores various programs and data required for the operation of the system 900. The processor 901, ROM 902, and RAM 903 are interconnected via a bus 904. An input / output (I / O) interface 905 is also connected to the bus 904.
[0142] The following components are connected to I / O interface 905: an input section 906 including a keyboard, mouse, etc.; an output section 907 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and speakers, etc.; a storage section 908 including a hard disk, etc.; and a communication section 909 including a network interface card such as a LAN card, modem, etc. The communication section 909 performs communication processing via a network such as the Internet. A drive 910 is also connected to I / O interface 905 as needed. A removable medium 911, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on drive 910 as needed so that computer programs read from it can be installed into storage section 908 as needed.
[0143] Specifically, according to embodiments of this application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication section 909, and / or installed from removable medium 911. When the computer program is executed by processor 901, it performs the functions defined in the methods of this application.
[0144] It should be noted that the computer-readable medium of this application can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this application, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In this application, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. Computer-readable signal media can also be any computer-readable medium other than computer-readable storage media, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wireless, wire, optical fiber, RF, etc., or any suitable combination thereof.
[0145] Computer program code for performing the operations of this application can be written in one or more programming languages or a combination thereof. Programming languages include object-oriented programming languages—such as Java, Smalltalk, and C++—as well as conventional procedural programming languages—such as the "C" language or similar programming languages. The program code can be executed entirely on the client computer, partially on the client computer, as a standalone software package, partially on the client computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the client computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0146] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0147] The units described in the embodiments of this application can be implemented in software or hardware. The described units can also be housed in a processor; for example, they can be described as: a processor including a first determining unit, a selecting unit, a second determining unit, and an obtaining unit; or they can be described as: a processor including an obtaining unit and a decision-making unit. The names of these units do not necessarily limit the unit itself; for example, the second determining unit can also be described as "a unit that determines the binary convolution kernel matrix corresponding to the initial autonomous driving decision model based on the target subset and the full-precision convolution matrix of the initial autonomous driving decision model."
[0148] In another aspect, this application also provides a computer-readable medium, which may be included in the device described in the above embodiments; or it may exist independently and not assembled into the device. The computer-readable medium carries one or more programs, which, when executed by the device, cause the computer device to: determine a target permutation matrix using a preset discrete permutation method during the forward computation process of training an initial autonomous driving decision model using a training sample set; select a target subset from a preset binary convolution kernel sub-code set representing the complete convolution kernel space using the target permutation matrix; determine the binary convolution kernel matrix corresponding to the initial autonomous driving decision model based on the target subset and the full-precision convolution matrix of the initial autonomous driving decision model; and further cause the computer device to: acquire environmental information of the autonomous vehicle; and determine the decision instructions for the autonomous vehicle based on the environmental information using the pre-trained autonomous driving decision model.
[0149] The above description is merely a preferred embodiment of this application and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of the invention involved in this application is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the above-described inventive concept. For example, technical solutions formed by substituting the above features with (but not limited to) technical features with similar functions disclosed in this application.
Claims
1. A training method for an autonomous driving decision-making model, comprising: In the forward computation process of training the initial autonomous driving decision model using the training sample set, a real number matrix with weights close to binary is determined by a preset discrete permutation method. The real matrix is subjected to Hungarian matching to obtain the target permutation matrix; the training samples in the training sample set include sample environment information. Using the target permutation matrix, a target subset is selected from a preset binary convolution kernel sub-code set that represents the complete convolution kernel space. The preset binary convolution kernel sub-code set is a binary sub-code set composed of multiple elements. Based on the target subset and the full-precision convolution matrix of the initial autonomous driving decision model, determine the binary convolution kernel matrix corresponding to the initial autonomous driving decision model; In response to determining that the sample environment information is used as input for training an initial autonomous driving decision model using the binary convolution kernel matrix, the obtained decision instructions meet preset conditions, and the trained autonomous driving decision model is obtained; the decision instructions include instructions for indicating the acceleration and / or steering angle of the autonomous vehicle.
2. The method according to claim 1, wherein, Also includes: In the reverse calculation process of the initial autonomous driving decision model, the gradient of the target permutation matrix is determined as the gradient of the real matrix based on the gradient channel pass-through method, so as to update the real matrix.
3. The method according to claim 2, wherein, Before determining the gradient of the target permutation matrix as the gradient of the real matrix based on the gradient channel pass-through method to update the real matrix, the method further includes: Determine the gradient corresponding to the target subset; The gradient corresponding to the target permutation matrix is determined based on the gradient corresponding to the target subset and the preset binary convolution kernel subcode set.
4. The method according to claim 2, wherein, Also includes: Based on the gradient corresponding to the binary convolution kernel matrix, the gradient corresponding to the full-precision convolution matrix is determined, and the full-precision convolution matrix is updated according to the gradient corresponding to the full-precision convolution matrix.
5. An autonomous driving decision-making method, comprising: Obtain environmental information for autonomous vehicles; The autonomous driving decision model is trained using a pre-trained autonomous driving decision model to determine the decision instructions for the autonomous vehicle based on the environmental information, wherein the autonomous driving decision model is trained using any one of claims 1-4.
6. A training device for an autonomous driving decision-making model, comprising: The first determining unit is configured to determine a real number matrix with weights that are close to binary by using a preset discrete arrangement method during the forward computation process of training the initial autonomous driving decision model through the training sample set. Perform Hungarian matching on the real matrix to obtain the target permutation matrix; The training samples in the training sample set include sample environment information; The selection unit is configured to select a target subset from a preset binary convolution kernel sub-code set representing the complete convolution kernel space through the target permutation matrix, wherein the preset binary convolution kernel sub-code set is a binary sub-code set composed of multiple elements; The second determining unit is configured to determine the binary convolution kernel matrix corresponding to the initial autonomous driving decision model based on the target subset and the full-precision convolution matrix of the initial autonomous driving decision model. The unit is configured to, in response to determining that the sample environment information is used as input for training an initial autonomous driving decision model using the binary convolution kernel matrix, and the resulting decision instruction meets preset conditions, obtain the trained autonomous driving decision model; the decision instruction includes instructions for indicating the acceleration and / or steering angle of the autonomous vehicle.
7. An autonomous driving decision-making device, comprising: The acquisition unit is configured to acquire environmental information of the autonomous vehicle. The decision-making unit is configured to determine the decision instructions of the autonomous vehicle based on the environmental information using a pre-trained autonomous driving decision-making model, wherein the autonomous driving decision-making model is trained using any one of claims 1-4.
8. A computer-readable medium having a computer program stored thereon, wherein, When the program is executed by the processor, it implements the method as described in any one of claims 1-5.
9. An electronic device, comprising: One or more processors; Storage device, on which one or more programs are stored, When the one or more programs are executed by the one or more processors, the one or more processors implement the method as described in any one of claims 1-5.