BEV visual angle 3D target detection method and device based on target perception feature distillation
Through the target-aware feature distillation algorithm and query vector optimization technology, it solves the deployment problem of the BEV perspective 3D target detection algorithm under the DETR framework in an environment with limited computing resources, improves detection accuracy and efficiency, and realizes the bounding box of teacher and student models. The one-to-one correspondence between predictions improves the generalization ability of the model.
Patent Information
- Application Number
- CN202410610628.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-16
- Publication Date
- 2024-09-06
AI Technical Summary
The existing BEV perspective 3D target detection algorithm based on the DETR framework is difficult to deploy in an environment with limited computing resources. The traditional knowledge distillation method is difficult to be directly applied to the Transformer-based visual 3D target detection and bounding box prediction of the teacher model and student model. There is a lack of one-to-one correspondence.
The target-aware feature distillation algorithm is used to identify key feature points in the teacher and student models, and the query vector of the student model is optimized through the query vector prior allocation distillation algorithm and the Hungarian algorithm to achieve one-to-one correspondence between the bounding box predictions of the teacher and student models, improving detection Accuracy and efficiency.
It improves the accuracy and efficiency of 3D target detection from the BEV perspective, optimizes the learning process of the student model, improves the generalization ability of the model, reduces false predictions, and achieves effective knowledge transfer in the DETR framework.
Smart Images

Figure CN118608754A
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image processing technology, and in particular to a BEV perspective 3D target detection method and device based on target perception feature distillation. Background Art
[0002] In daily driving, people can easily build a map in their minds based on vision, which contains information about each object in the actual map, such as center coordinates, size, viewing angle, heading angle, etc., to achieve safe driving. However, how to pass this capability to computers has always been a difficult problem. Therefore, in the field of autonomous driving, 3D object detection, as a basic task of perceiving autonomous driving systems, has attracted extensive research. In visual 3D object detection, visual 3D object detection from the perspective of BEV has the following advantages:
[0003] Simplified perspective: The BEV algorithm simplifies the three-dimensional world space into a two-dimensional bird's-eye view, which can save a lot of resources in computing and storage;
[0004] Excellent visual effects: BEV provides a unique visual effect, making objects and spatial relationships in the scene more clearly visible, even partially obscured objects can be clearly displayed;
[0005] Easy processing: It is much easier to process object detection, tracking and classification tasks in BEV than directly in the raw 3D data.
[0006] Facilitates fusion and downstream task processing: The image data taken by the camera is converted into a unified BEV representation, making it easier to fuse with LiDAR and more user-friendly for downstream tasks such as path planning and control.
[0007] Scale consistency: When detecting with a camera, objects that are closer appear larger than those that are farther away. However, from the perspective of BEV, there is almost no scale difference between similar objects, making it easier to learn feature scale consistency.
[0008] Therefore, the 3D target detection algorithm from the perspective of BEV has become a current research hotspot. Thanks to the increasingly deeper network layers and the increasing number of parameters, various excellent works have emerged in an endless stream. However, this usually also means that the number of parameters and the amount of calculation of the algorithm model continue to grow, making it difficult to deploy on a real vehicle with limited computing resources. This requires researchers to make a trade-off between accuracy and computational complexity. To this end, this paper introduces knowledge distillation to achieve lightweight 3D target detection models. Since many excellent works in the visual 3D target detection algorithm from the perspective of BEV are based on Transformer, or in other words, they are based on the DETR framework to complete the task of 3D target detection, such as DETR3D, PETR, PETRv2, etc., the knowledge distillation method of the traditional convolutional network is difficult to directly apply to the visual 3D target detection algorithm based on DETR. The visual 3D target detection algorithm from the perspective of BEV is different from the traditional CNN-based target detection framework.
[0009] For example, in traditional object detection methods, bounding box predictions are closely related to feature maps, so logits-based distillation can easily ensure that the bounding box predictions of the teacher model and the student model correspond in space. However, for the DETR framework, it regards object detection as a set prediction problem, and the bounding box predictions output from the decoder are unordered, so there is naturally no one-to-one correspondence between the bounding box predictions of the teacher model and the student model. Therefore, it is necessary to design a new knowledge distillation method for the DETR-based visual 3D object detection algorithm. Summary of the invention
[0010] The present invention provides a BEV perspective 3D target detection method and device based on target perception feature distillation, which can improve the accuracy and efficiency of BEV perspective 3D target detection based on target perception feature distillation.
[0011] To achieve the above object, the present invention provides a BEV perspective 3D target detection method based on target perception feature distillation, comprising:
[0012] Acquire multi-view images, and input the multi-view images into the backbone networks of the target detection teacher model and the target detection student model respectively to extract image features, so as to obtain teacher image features and student image features;
[0013] Using a target-aware feature distillation algorithm to identify key feature points in the teacher image features to obtain a first key feature point, and using a target-aware feature distillation algorithm to identify key feature points in the student image features to obtain a second key feature point;
[0014] Initializing a teacher query vector of the target detection teacher model, optimizing the teacher query vector using the first key feature point to obtain an optimized teacher query vector, and generating a teacher prediction result according to the optimized teacher query vector;
[0015] Initializing a student query vector of the object detection student model, and optimizing the student query vector using a query vector prior allocation distillation algorithm to obtain an optimized student query vector;
[0016] A student prediction result is generated according to the optimized student query vector, and the student prediction result is optimized using the Hungarian algorithm and the teacher prediction result. After the optimization is completed, a prediction target of the multi-view image is obtained.
[0017] Optionally, the identifying key feature points in the teacher image features by using a target-aware feature distillation algorithm includes:
[0018] Selecting a soft mask according to the multi-view image, and calculating the distillation area of the multi-view image using the soft mask;
[0019] The image features in the distillation region are extracted to obtain the key feature points.
[0020] Optionally, before calculating the distillation region of the multi-view image using the soft mask, the method further includes calculating a quality assessment score in a target detection teacher model.
[0021] Optionally, calculating a quality assessment score in a target detection teacher model includes:
[0022] The quality assessment score in the object detection teacher model is calculated using the following formula:
[0023]
[0024] Among them, c i is the classification score of the i-th query vector in the target detection teacher model, is the predicted bounding box of the i-th query vector in the object detection teacher model, is the corresponding truth box, γ is a hyperparameter used to balance the weights, and IoU is the intersection over union ratio.
[0025] Optionally, the optimizing the student query vector by using a query vector prior distribution distillation algorithm includes:
[0026] Obtaining a query vector set in the target detection teacher model, and matching the query vector set with a true value sample to obtain a sample matching result;
[0027] The query vector set is input into the decoder of the target detection student model as prior knowledge, and the loss value between the predicted output result of the target detection student model and the true value sample is calculated using the sample matching result, and the student query vector is optimized by the loss value.
[0028] Optionally, the calculating the loss value between the predicted output result of the target detection student model and the true value sample by using the sample matching result includes:
[0029] The following formula is used to calculate the loss value between the predicted output result of the target detection student model and the true value sample:
[0030]
[0031] in, is the sample matching result of the i-th true value sample, C is the total number of query vectors of the teacher model, and y i represents the i-th true value sample, represents the prediction result of the target detection student model under the sample matching result distribution of the target detection teacher model, L match It is the optimal allocation calculated by the Hungarian algorithm in DETR3D.
[0032] Optionally, the adopting of the Hungarian algorithm to combine the teacher prediction result and the student prediction result includes:
[0033] Obtaining positive predictions and negative predictions in the teacher's prediction results, and using samples corresponding to the positive predictions as pseudo-true value samples;
[0034] Calculate the loss value between the student prediction result and the pseudo true value sample according to the pseudo true value sample to obtain a first loss value;
[0035] Taking the sample corresponding to the negative prediction as a negative true value sample, and calculating the loss value between the student prediction result and the negative true value sample to obtain a second loss value;
[0036] The student prediction result is optimized in combination with the first loss value and the second loss value to obtain a prediction target for the multi-view image.
[0037] In order to solve the above problems, the present invention also provides a BEV perspective 3D target detection device based on target perception feature distillation, the device comprising:
[0038] A feature extraction module is used to obtain multi-view images, and input the multi-view images into the backbone networks of the target detection teacher model and the target detection student model respectively to extract image features, so as to obtain teacher image features and student image features;
[0039] A query vector optimization module is used to use a target-aware feature distillation algorithm to identify key feature points in the teacher image features to obtain a first key feature point, and use a target-aware feature distillation algorithm to identify key feature points in the student image features to obtain a second key feature point; initialize the teacher query vector of the target detection teacher model, and optimize the teacher query vector using the first key feature point to obtain an optimized teacher query vector, and generate a teacher prediction result based on the optimized teacher query vector; initialize the student query vector of the target detection student model, and use a query vector prior distribution distillation algorithm to optimize the student query vector to obtain an optimized student query vector;
[0040] The prediction result acquisition module is used to generate a student prediction result according to the optimized student query vector, and optimize the student prediction result using the Hungarian algorithm and the teacher prediction result, and obtain the prediction target of the multi-view image after the optimization is completed.
[0041] In order to solve the above problem, the present invention further provides an electronic device, the electronic device comprising:
[0042] at least one processor; and,
[0043] a memory communicatively connected to the at least one processor; wherein,
[0044] The memory stores a computer program that can be executed by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the above-mentioned BEV perspective 3D target detection method based on target perception feature distillation.
[0045] In order to solve the above problems, the present invention also provides a computer-readable storage medium, in which at least one computer program is stored. The at least one computer program is executed by a processor in an electronic device to implement the above-mentioned BEV perspective 3D target detection method based on target perception feature distillation.
[0046] The present invention can improve the accuracy of target detection by introducing a target-aware feature distillation algorithm to identify key feature points in teacher image features and student image features. In addition, the query vector prior allocation distillation algorithm is used to optimize the student query vector, which can optimize the learning process of the student model, so that it can learn the knowledge of the teacher model faster, improve the overall learning efficiency, and improve the generalization ability of the model. In addition, the Hungarian algorithm and the teacher prediction results are used to optimize the student prediction results, which can effectively match the prediction results of the teacher model with the prediction results of the student model, reduce the erroneous predictions of the student model, and improve the quality of the final prediction target. The present invention can achieve that in the DETR framework, the prediction results of the bounding box output by the decoder are on an unordered basis, so that the bounding box predictions of the teacher model and the student model can correspond one to one. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] Figure 1 A schematic diagram of a flow chart of a BEV perspective 3D target detection method based on target perception feature distillation provided in an embodiment of the present invention;
[0048] Figure 2 An overall algorithm flow chart of a BEV perspective 3D target detection method based on target perception feature distillation provided in one embodiment of the present invention;
[0049] Figure 3 A functional module diagram of a BEV perspective 3D target detection device based on target perception feature distillation provided by an embodiment of the present invention;
[0050] Figure 4 A schematic diagram of the structure of an electronic device for implementing a BEV perspective 3D target detection method based on target perception feature distillation provided in one embodiment of the present invention.
[0051] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0052] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.
[0053] The embodiment of the present application provides a BEV perspective 3D target detection method based on target perception feature distillation. The execution subject of the BEV perspective 3D target detection method based on target perception feature distillation includes but is not limited to at least one of the electronic devices such as a server, a terminal, etc. that can be configured to execute the method provided by the embodiment of the present application. In other words, the BEV perspective 3D target detection method based on target perception feature distillation can be executed by software or hardware installed on a terminal device or a server device, and the software can be a blockchain platform. The server includes but is not limited to: a single server, a server cluster, a cloud server or a cloud server cluster, etc. The server can be an independent server, or it can be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (Content Delivery Network, CDN), and big data and artificial intelligence platforms.
[0054] Reference Figure 1 FIG. 1 is a flow chart of a BEV perspective 3D target detection method based on target perception feature distillation provided by an embodiment of the present invention. In this embodiment, the BEV perspective 3D target detection method based on target perception feature distillation includes:
[0055] S1. Acquire multi-view images, and input the multi-view images into the backbone networks of the target detection teacher model and the target detection student model respectively to extract image features, so as to obtain teacher image features and student image features.
[0056] In the embodiment of the present invention, the multi-view image refers to image data collected from the perspective of BEV (Bird's Eye View). For example, the multi-view image may come from a variety of sensors such as a vehicle-mounted camera, a laser radar, and a millimeter-wave radar.
[0057] In an embodiment of the present invention, the target detection teacher model and the target detection student model are constructed using the DETR3D model.
[0058] In an embodiment of the present invention, the backbone network refers to a neural network used to extract image features. For example, the backbone network may be a CNN convolutional neural network.
[0059] S2. Use the target-aware feature distillation algorithm to identify the key feature points in the teacher image features to obtain the first key feature points, and use the target-aware feature distillation algorithm to identify the key feature points in the student image features to obtain the second key feature points.
[0060] In the embodiment of the present invention, the query vector refers to a set of vectors of fixed length, which are learned during the model training process and can predict the position and attributes of the target object in the 3D space.
[0061] As an embodiment of the present invention, the method of identifying key feature points in the teacher image features by using a target-aware feature distillation algorithm includes:
[0062] Selecting a soft mask according to the multi-view image, and calculating the distillation area of the multi-view image using the soft mask;
[0063] The image features in the distillation region are extracted to obtain the key feature points.
[0064] In an embodiment of the present invention, the soft mask refers to a technology used to extract important features in an image. For example, the soft mask can be a matrix of the same size as the multi-view image, in which each element is a value between 0 and 1, which can be regarded as the probability that each pixel belongs to the distillation area. Multiplying the soft mask with the multi-view image can obtain the distillation area, thereby achieving the acquisition of important areas in the multi-view image.
[0065] Exemplarily, the selection of the soft mask according to the multi-view images may adopt the following calculation formula:
[0066]
[0067] in, For soft mask, is the i-th query vector of the teacher model, M represents the number of decoder layers of the teacher model, and where means "among them".
[0068] Furthermore, before calculating the distillation region of the multi-view image using the soft mask, it also includes calculating a quality assessment score in the target detection teacher model, wherein the quality assessment score in the target detection teacher model is calculated using the following formula:
[0069]
[0070] Among them, c i is the classification score of the i-th query vector in the target detection teacher model, is the predicted bounding box of the i-th query vector in the object detection teacher model, is the corresponding truth box, γ is a hyperparameter used to balance the weights, and IoU is the intersection over union ratio.
[0071] In the embodiment of the present invention, the intersection over union ratio refers to the area of the intersection of two bounding boxes divided by the area of their union. Its value ranges from 0 to 1, where 0 indicates no overlap and 1 indicates perfect overlap. In object detection, IoU is often used to evaluate the degree of match between the predicted bounding box and the true bounding box.
[0072] The embodiment of the present invention can realize the well-founded adoption of the query vector in the target detection teacher model by calculating the quality assessment score in the target detection teacher model.
[0073] For example, the feature representation generated by the network largely determines the detection performance of the model, so it is critical to first extract the knowledge of the teacher model at the feature level. The calculation formula for feature distillation to directly calculate the feature difference between the student model and the teacher model is as follows:
[0074]
[0075] in, is the output of the target detection teacher model, is the output of the target detection student model, H is the length of the multi-view image, W is the width of the multi-view image, d is the number of channels of the target detection teacher model, φ is the dimensional adaptation layer used to convert the features of the target detection student model into the feature dimensions that match the target detection teacher model, It is a soft mask used to select the distillation area in knowledge distillation, and ⊙ is the Hadamard product.
[0076] Furthermore, after calculating the soft mask and calculating the quality assessment score in the target detection teacher model, the calculation formula for directly calculating the feature difference between the student model and the teacher model by the feature distillation can be optimized to the following formula:
[0077]
[0078] The embodiment of the present invention directly calculates the feature difference between the target detection student model and the target detection teacher model through feature distillation, so as to minimize the difference between the output of the teacher model and the output of the student model after dimensional adaptation. The student model can learn the knowledge of the teacher model, which helps to improve the performance of the student model and make it closer to the output of the teacher model.
[0079] S3. Initialize the teacher query vector of the target detection teacher model, and use the first key feature point to optimize the teacher query vector to obtain an optimized teacher query vector, and generate a teacher prediction result based on the optimized teacher query vector.
[0080] S4. Initialize the student query vector of the target detection student model, and use the query vector prior allocation distillation algorithm to optimize the student query vector to obtain an optimized student query vector.
[0081] In an embodiment of the present invention, the query vector prior allocation distillation algorithm refers to a technology used to optimize the query vector in the target detection student model training. Usually, the query vector of the teacher model is input into the decoder part of the student model as prior knowledge, thereby serving as supervision to achieve stable allocation of the student model.
[0082] As an embodiment of the present invention, the optimization of the student query vector by using a query vector prior distribution distillation algorithm includes:
[0083] Obtaining a query vector set in the target detection teacher model, and matching the query vector set with a true value sample to obtain a sample matching result;
[0084] The query vector set is input into the decoder of the target detection student model as prior knowledge, and the loss value between the predicted output result of the target detection student model and the true value sample is calculated using the sample matching result, and the student query vector is optimized by the loss value.
[0085] Furthermore, the calculation of the loss value between the predicted output result of the target detection student model and the true value sample using the sample matching result includes:
[0086] The following formula is used to calculate the loss value between the predicted output result of the target detection student model and the true value sample:
[0087]
[0088] in, is the sample matching result of the i-th true value sample, C is the total number of query vectors of the teacher model, and y i represents the i-th true value sample, represents the prediction result of the target detection student model under the sample matching result distribution of the target detection teacher model, L match It is the optimal allocation calculated by the Hungarian algorithm in DETR3D.
[0089] In an embodiment of the present invention, the prior knowledge refers to relevant knowledge that has been optimized in the target detection teacher model when optimizing the target detection student model before the target detection student model is learned.
[0090] The embodiment of the present invention adopts a query vector prior distribution distillation algorithm to optimize the student query vector, and inputs the query vector of the teacher model as prior knowledge into the decoder part of the student model as supervision to encourage the student model to achieve stable distribution as much as possible.
[0091] S5. Generate a student prediction result according to the optimized student query vector, and optimize the student prediction result using the Hungarian algorithm and the teacher prediction result, and obtain the prediction target of the multi-view image after the optimization is completed.
[0092] In an embodiment of the present invention, the Hungarian algorithm is a combinatorial optimization algorithm for solving task allocation problems, which is used to solve the maximum matching problem of a bipartite graph, that is, how to find the largest matching set in a bipartite graph so that as many nodes as possible are uniquely matched.
[0093] As an embodiment of the present invention, the Hungarian algorithm is used to combine the teacher prediction result and the student prediction result, including:
[0094] Obtaining positive predictions and negative predictions in the teacher's prediction results, and using samples corresponding to the positive predictions as pseudo-true value samples;
[0095] Calculate the loss value between the student prediction result and the pseudo true value sample according to the pseudo true value sample to obtain a first loss value;
[0096] Taking the sample corresponding to the negative prediction as a negative true value sample, and calculating the loss value between the student prediction result and the negative true value sample to obtain a second loss value;
[0097] The student prediction result is optimized in combination with the first loss value and the second loss value to obtain a prediction target for the multi-view image.
[0098] Furthermore, the combining of the first loss value and the second loss value to optimize the student prediction result includes: obtaining the number of decoding layers in the target detection teacher model, and optimizing the student prediction result in the target detection student model by using the first loss value and the second loss value in each decoding layer.
[0099] Exemplarily, the prediction results of the target detection teacher model and the target detection student model are defined as:
[0100]
[0101]
[0102] Among them, M pos is the number of positive predictions of the target detection teacher model, Mneg is the number of negative prediction results of the target detection teacher model, M = M pos +M neg is the number of query vectors of the target detection teacher model in the Transformer decoder, N is the number of query vectors of the target detection student model in the Transformer decoder, and M is generally greater than or equal to N.
[0103] The embodiment of the present invention calculates the loss value between the student prediction result and the pseudo true value sample according to the pseudo true value sample to obtain a first loss value, using the following formula:
[0104]
[0105] L match It is the optimal allocation calculated by the Hungarian algorithm in DETR3D.
[0106] The embodiment of the present invention calculates the loss value between the student prediction result and the negative true value sample to obtain a second loss value, using the following formula:
[0107]
[0108] Among them, σ neg Represented as the negative prediction of the target detection teacher model and the target detection student model y S The match between the student prediction results.
[0109] Furthermore, the student prediction result is optimized by combining the first loss value and the second loss value, and the following formula may be used:
[0110]
[0111] Where K is the number of decoder layers, represents the loss of the k-th decoder layer in the positive prediction knowledge distillation, represents the loss of negative prediction knowledge distillation at the k-th layer decoder.
[0112] The present invention can improve the accuracy of target detection by introducing a target-aware feature distillation algorithm to identify key feature points in teacher image features and student image features. In addition, the query vector prior allocation distillation algorithm is used to optimize the student query vector, which can optimize the learning process of the student model, so that it can learn the knowledge of the teacher model faster, improve the overall learning efficiency, and improve the generalization ability of the model. In addition, the Hungarian algorithm and the teacher prediction results are used to optimize the student prediction results, which can effectively match the prediction results of the teacher model with the prediction results of the student model, reduce the erroneous predictions of the student model, and improve the quality of the final prediction target. The present invention can achieve that in the DETR framework, the prediction results of the bounding box output by the decoder are on an unordered basis, so that the bounding box predictions of the teacher model and the student model can correspond one to one.
[0113] Reference Figure 2 As shown, it is an overall algorithm flow chart of the BEV perspective 3D target detection method based on target perception feature distillation provided by one embodiment of the present invention.
[0114] like Figure 3 As shown, it is a functional module diagram of a BEV perspective 3D target detection device based on target perception feature distillation provided by an embodiment of the present invention.
[0115] The BEV perspective 3D object detection device 100 based on target perception feature distillation of the present invention can be installed in an electronic device. According to the implemented functions, the BEV perspective 3D object detection device 100 based on target perception feature distillation can include a feature extraction module 101, a query vector optimization module 102 and a prediction result acquisition module 103.
[0116] The module described in the present invention may also be referred to as a unit, which refers to a series of computer program segments that can be executed by a processor of an electronic device and can complete fixed functions, and is stored in a memory of the electronic device.
[0117] In this embodiment, the functions of each module / unit are as follows:
[0118] The feature extraction module 101 is used to obtain multi-view images, and input the multi-view images into the backbone networks of the target detection teacher model and the target detection student model respectively to extract image features, so as to obtain teacher image features and student image features.
[0119] In the embodiment of the present invention, the multi-view image refers to image data collected from the perspective of BEV (Bird's Eye View). For example, the multi-view image may come from a variety of sensors such as a vehicle-mounted camera, a laser radar, and a millimeter-wave radar.
[0120] In an embodiment of the present invention, the target detection teacher model and the target detection student model are constructed using the DETR3D model.
[0121] In an embodiment of the present invention, the backbone network refers to a neural network used to extract image features. For example, the backbone network may be a CNN convolutional neural network.
[0122] The query vector optimization module 102 is used to use the target-aware feature distillation algorithm to identify the key feature points in the teacher image features to obtain the first key feature points, and use the target-aware feature distillation algorithm to identify the key feature points in the student image features to obtain the second key feature points; initialize the teacher query vector of the target detection teacher model, and optimize the teacher query vector using the first key feature points to obtain an optimized teacher query vector, and generate a teacher prediction result based on the optimized teacher query vector; initialize the student query vector of the target detection student model, and use the query vector prior allocation distillation algorithm to optimize the student query vector to obtain an optimized student query vector.
[0123] In the embodiment of the present invention, the query vector refers to a set of vectors of fixed length, which are learned during the model training process and can predict the position and attributes of the target object in the 3D space.
[0124] As an embodiment of the present invention, the method of identifying key feature points in the teacher image features by using a target-aware feature distillation algorithm includes:
[0125] Selecting a soft mask according to the multi-view image, and calculating the distillation area of the multi-view image using the soft mask;
[0126] The image features in the distillation region are extracted to obtain the key feature points.
[0127] In an embodiment of the present invention, the soft mask refers to a technology used to extract important features in an image. For example, the soft mask can be a matrix of the same size as the multi-view image, in which each element is a value between 0 and 1, which can be regarded as the probability that each pixel belongs to the distillation area. Multiplying the soft mask with the multi-view image can obtain the distillation area, thereby achieving the acquisition of important areas in the multi-view image.
[0128] Exemplarily, the selection of the soft mask according to the multi-view images may adopt the following calculation formula:
[0129]
[0130] in, For soft mask, is the i-th query vector of the teacher model, M represents the number of decoder layers of the teacher model, and where means "among them".
[0131] Furthermore, before calculating the distillation region of the multi-view image using the soft mask, it also includes calculating a quality assessment score in the target detection teacher model, wherein the quality assessment score in the target detection teacher model is calculated using the following formula:
[0132]
[0133] Among them, c i is the classification score of the i-th query vector in the target detection teacher model, is the predicted bounding box of the i-th query vector in the object detection teacher model, is the corresponding truth box, γ is a hyperparameter used to balance the weights, and IoU is the intersection over union ratio.
[0134] In the embodiment of the present invention, the intersection over union ratio refers to the area of the intersection of two bounding boxes divided by the area of their union. Its value ranges from 0 to 1, where 0 indicates no overlap and 1 indicates perfect overlap. In object detection, IoU is often used to evaluate the degree of match between the predicted bounding box and the true bounding box.
[0135] The embodiment of the present invention can realize the well-founded adoption of the query vector in the target detection teacher model by calculating the quality assessment score in the target detection teacher model.
[0136] For example, the feature representation generated by the network largely determines the detection performance of the model, so it is critical to first extract the knowledge of the teacher model at the feature level. The calculation formula for feature distillation to directly calculate the feature difference between the student model and the teacher model is as follows:
[0137]
[0138] in, is the output of the target detection teacher model, is the output of the target detection student model, H is the length of the multi-view image, W is the width of the multi-view image, d is the number of channels of the target detection teacher model, φ is the dimensional adaptation layer used to convert the features of the target detection student model into the feature dimensions that match the target detection teacher model, It is a soft mask used to select the distillation area in knowledge distillation, and ⊙ is the Hadamard product.
[0139] Furthermore, after calculating the soft mask and calculating the quality assessment score in the target detection teacher model, the calculation formula for directly calculating the feature difference between the student model and the teacher model by the feature distillation can be optimized to the following formula:
[0140]
[0141] The embodiment of the present invention directly calculates the feature difference between the target detection student model and the target detection teacher model through feature distillation, so as to minimize the difference between the output of the teacher model and the output of the student model after dimensional adaptation. The student model can learn the knowledge of the teacher model, which helps to improve the performance of the student model and make it closer to the output of the teacher model.
[0142] Initialize a teacher query vector of the target detection teacher model, optimize the teacher query vector using the first key feature point to obtain an optimized teacher query vector, and generate a teacher prediction result based on the optimized teacher query vector.
[0143] In an embodiment of the present invention, the query vector prior allocation distillation algorithm refers to a technology used to optimize the query vector in the target detection student model training. Usually, the query vector of the teacher model is input into the decoder part of the student model as prior knowledge, thereby serving as supervision to achieve stable allocation of the student model.
[0144] As an embodiment of the present invention, the optimization of the student query vector by using a query vector prior distribution distillation algorithm includes:
[0145] Obtaining a query vector set in the target detection teacher model, and matching the query vector set with a true value sample to obtain a sample matching result;
[0146] The query vector set is input into the decoder of the target detection student model as prior knowledge, and the loss value between the predicted output result of the target detection student model and the true value sample is calculated using the sample matching result, and the student query vector is optimized by the loss value.
[0147] Furthermore, the calculation of the loss value between the predicted output result of the target detection student model and the true value sample using the sample matching result includes:
[0148] The following formula is used to calculate the loss value between the predicted output result of the target detection student model and the true value sample:
[0149]
[0150] in, is the sample matching result of the i-th true value sample, C is the total number of query vectors of the teacher model, and yi represents the i-th true value sample, represents the prediction result of the target detection student model under the sample matching result distribution of the target detection teacher model, L match It is the optimal allocation calculated by the Hungarian algorithm in DETR3D.
[0151] In an embodiment of the present invention, the prior knowledge refers to relevant knowledge that has been optimized in the target detection teacher model when optimizing the target detection student model before the target detection student model is learned.
[0152] The embodiment of the present invention adopts a query vector prior distribution distillation algorithm to optimize the student query vector, and inputs the query vector of the teacher model as prior knowledge into the decoder part of the student model as supervision to encourage the student model to achieve stable distribution as much as possible.
[0153] The prediction result acquisition module 103 is used to generate a student prediction result according to the optimized student query vector, and optimize the student prediction result using the Hungarian algorithm and the teacher prediction result, and obtain the prediction target of the multi-view image after the optimization is completed.
[0154] In an embodiment of the present invention, the Hungarian algorithm is a combinatorial optimization algorithm for solving task allocation problems, which is used to solve the maximum matching problem of a bipartite graph, that is, how to find the largest matching set in a bipartite graph so that as many nodes as possible are uniquely matched.
[0155] As an embodiment of the present invention, the Hungarian algorithm is used to combine the teacher prediction result and the student prediction result, including:
[0156] Obtaining positive predictions and negative predictions in the teacher's prediction results, and using samples corresponding to the positive predictions as pseudo-true value samples;
[0157] Calculate the loss value between the student prediction result and the pseudo true value sample according to the pseudo true value sample to obtain a first loss value;
[0158] Taking the sample corresponding to the negative prediction as a negative true value sample, and calculating the loss value between the student prediction result and the negative true value sample to obtain a second loss value;
[0159] The student prediction result is optimized in combination with the first loss value and the second loss value to obtain a prediction target for the multi-view image.
[0160] Furthermore, the combining of the first loss value and the second loss value to optimize the student prediction result includes: obtaining the number of decoding layers in the target detection teacher model, and optimizing the student prediction result in the target detection student model by using the first loss value and the second loss value in each decoding layer.
[0161] Exemplarily, the prediction results of the target detection teacher model and the target detection student model are defined as:
[0162]
[0163]
[0164] Among them, M pos is the number of positive predictions of the target detection teacher model, M neg is the number of negative prediction results of the target detection teacher model, M = M pos +M neg is the number of query vectors of the target detection teacher model in the Transformer decoder, N is the number of query vectors of the target detection student model in the Transformer decoder, and M is generally greater than or equal to N.
[0165] The embodiment of the present invention calculates the loss value between the student prediction result and the pseudo true value sample according to the pseudo true value sample to obtain a first loss value, using the following formula:
[0166]
[0167] L match It is the optimal allocation calculated by the Hungarian algorithm in DETR3D.
[0168] The embodiment of the present invention calculates the loss value between the student prediction result and the negative true value sample to obtain a second loss value, using the following formula:
[0169]
[0170] Among them, σ neg Represented as the negative prediction of the target detection teacher model and the target detection student model y S The match between the student prediction results.
[0171] Furthermore, the student prediction result is optimized by combining the first loss value and the second loss value, and the following formula may be used:
[0172]
[0173] Where K is the number of decoder layers, represents the loss of the k-th decoder layer in the positive prediction knowledge distillation, represents the loss of negative prediction knowledge distillation at the k-th layer decoder.
[0174] Reference Figure 4 As shown, it is a schematic diagram of the structure of an electronic device for implementing the BEV perspective 3D target detection method based on target perception feature distillation provided by one embodiment of the present invention.
[0175] The electronic device may include a processor 10, a memory 11, a communication bus 12 and a communication interface 13, and may also include a computer program stored in the memory 11 and executable on the processor 10, such as a BEV perspective 3D target detection method program based on target perception feature distillation.
[0176] In some embodiments, the processor 10 may be composed of an integrated circuit, for example, a single packaged integrated circuit, or a plurality of integrated circuits with the same or different functions, including one or more central processing units (CPUs), microprocessors, digital processing chips, graphics processors, and combinations of various control chips. The processor 10 is the control core (ControlUnit) of the electronic device, and uses various interfaces and lines to connect the various components of the entire electronic device. It runs or executes programs or modules stored in the memory 11 (for example, executes a BEV perspective 3D target detection method program based on target perception feature distillation, etc.), and calls the data stored in the memory 11 to execute various functions of the electronic device and process data.
[0177] The memory 11 includes at least one type of readable storage medium, and the readable storage medium includes a flash memory, a mobile hard disk, a multimedia card, a card-type memory (for example, SD or DX memory, etc.), a magnetic memory, a disk, an optical disk, etc. In some embodiments, the memory 11 may be an internal storage unit of an electronic device, such as a mobile hard disk of the electronic device. In other embodiments, the memory 11 may also be an external storage device of an electronic device, such as a plug-in mobile hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the electronic device. Further, the memory 11 may also include both an internal storage unit of the electronic device and an external storage device. The memory 11 can not only be used to store application software and various types of data installed in the electronic device, such as a code of a BEV perspective 3D target detection method program based on target perception feature distillation, but also can be used to temporarily store data that has been output or is to be output.
[0178] The communication bus 12 may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. The bus is configured to realize connection and communication between the memory 11 and at least one processor 10, etc.
[0179] The communication interface 13 is used for communication between the above-mentioned electronic device and other devices, including a network interface and a user interface. Optionally, the network interface may include a wired interface and / or a wireless interface (such as a WI-FI interface, a Bluetooth interface, etc.), which is generally used to establish a communication connection between the electronic device and other electronic devices. The user interface may be a display (Display), an input unit (such as a keyboard (Keyboard)), and optionally, the user interface may also be a standard wired interface, a wireless interface. Optionally, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, and an OLED (Organic Light-Emitting Diode, organic light-emitting diode) touch device, etc. Among them, the display may also be appropriately referred to as a display screen or a display unit, which is used to display information processed in the electronic device and to display a visual user interface.
[0180] Figure 4 Only an electronic device with components is shown, and those skilled in the art will understand that Figure 4The structure shown does not constitute a limitation on the electronic device, and may include fewer or more components than shown in the figure, or combine certain components, or arrange the components differently.
[0181] For example, although not shown, the electronic device may also include a power source (such as a battery) for supplying power to each component. Preferably, the power source may be logically connected to the at least one processor 10 through a power management device, so that the power management device can realize functions such as charging management, discharging management, and power consumption management. The power source may also include one or more DC or AC power sources, recharging devices, power failure detection circuits, power converters or inverters, power status indicators, and other arbitrary components. The electronic device may also include a variety of sensors, Bluetooth modules, Wi-Fi modules, etc., which will not be repeated here.
[0182] It should be understood that the embodiment is for illustration only and the scope of the patent application is not limited to this structure.
[0183] The memory 11 in the electronic device stores a BEV perspective 3D target detection method program based on target perception feature distillation, which is a combination of multiple instructions. When running in the processor 10, it can achieve:
[0184] Acquire multi-view images, and input the multi-view images into the backbone networks of the target detection teacher model and the target detection student model respectively to extract image features, so as to obtain teacher image features and student image features;
[0185] Using a target-aware feature distillation algorithm to identify key feature points in the teacher image features to obtain a first key feature point, and using a target-aware feature distillation algorithm to identify key feature points in the student image features to obtain a second key feature point;
[0186] Initializing a teacher query vector of the target detection teacher model, optimizing the teacher query vector using the first key feature point to obtain an optimized teacher query vector, and generating a teacher prediction result according to the optimized teacher query vector;
[0187] Initializing a student query vector of the object detection student model, and optimizing the student query vector using a query vector prior allocation distillation algorithm to obtain an optimized student query vector;
[0188] A student prediction result is generated according to the optimized student query vector, and the student prediction result is optimized using the Hungarian algorithm and the teacher prediction result. After the optimization is completed, a prediction target of the multi-view image is obtained.
[0189] Specifically, the specific implementation method of the processor 10 for the above instructions can refer to the description of the relevant steps in the corresponding embodiment of the accompanying drawings, which will not be repeated here.
[0190] Furthermore, if the module / unit integrated in the electronic device 1 is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. The computer-readable storage medium can be volatile or non-volatile. For example, the computer-readable medium can include: any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, a mobile hard disk, a magnetic disk, an optical disk, a computer memory, and a read-only memory (ROM).
[0191] The present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor of an electronic device, the computer program can implement:
[0192] Acquire multi-view images, and input the multi-view images into the backbone networks of the target detection teacher model and the target detection student model respectively to extract image features, so as to obtain teacher image features and student image features;
[0193] Using a target-aware feature distillation algorithm to identify key feature points in the teacher image features to obtain a first key feature point, and using a target-aware feature distillation algorithm to identify key feature points in the student image features to obtain a second key feature point;
[0194] Initializing a teacher query vector of the target detection teacher model, optimizing the teacher query vector using the first key feature point to obtain an optimized teacher query vector, and generating a teacher prediction result according to the optimized teacher query vector;
[0195] Initializing a student query vector of the object detection student model, and optimizing the student query vector using a query vector prior allocation distillation algorithm to obtain an optimized student query vector;
[0196] A student prediction result is generated according to the optimized student query vector, and the student prediction result is optimized using the Hungarian algorithm and the teacher prediction result. After the optimization is completed, a prediction target of the multi-view image is obtained.
[0197] In the several embodiments provided by the present invention, it should be understood that the disclosed devices, apparatuses and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of the modules is only a logical function division, and there may be other division methods in actual implementation.
[0198] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0199] In addition, each functional module in each embodiment of the present invention may be integrated into one processing unit, each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of hardware plus software functional modules.
[0200] It is obvious to those skilled in the art that the present invention is not limited to the details of the above exemplary embodiments, and that the present invention can be implemented in other specific forms without departing from the spirit or essential characteristics of the present invention.
[0201] Therefore, no matter from which point of view, the embodiments should be regarded as illustrative and non-restrictive, and the scope of the present invention is limited by the appended claims rather than the above description, so it is intended that all changes falling within the meaning and scope of the equivalent elements of the claims are included in the present invention. Any attached figure mark in the claims should not be regarded as limiting the claims involved.
[0202] The blockchain referred to in this invention is a new application mode of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, encryption algorithm, etc. Blockchain is essentially a decentralized database, a string of data blocks generated by cryptographic methods. Each data block contains a batch of network transaction information, which is used to verify the validity of its information (anti-counterfeiting) and generate the next block. Blockchain can include the underlying blockchain platform, platform product service layer, and application service layer.
[0203] The embodiments of the present application can acquire and process relevant data based on artificial intelligence technology. Among them, artificial intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.
[0204] In addition, it is clear that the word "comprising" does not exclude other units or steps, and the singular does not exclude the plural. Multiple units or devices stated in the system claim can also be implemented by one unit or device through software or hardware. The words first, second, etc. are used to indicate names, and do not indicate any particular order.
[0205] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solution of the present invention can be modified or replaced by equivalents without departing from the spirit and scope of the technical solution of the present invention.
Claims
1. A BEV perspective 3D object detection method based on object perception feature distillation, characterized in that: The method comprises: Acquire multi-view images, and input the multi-view images into the backbone networks of the target detection teacher model and the target detection student model respectively to extract image features, so as to obtain teacher image features and student image features; Using a target-aware feature distillation algorithm to identify key feature points in the teacher image features to obtain a first key feature point, and using a target-aware feature distillation algorithm to identify key feature points in the student image features to obtain a second key feature point; Initializing a teacher query vector of the target detection teacher model, optimizing the teacher query vector using the first key feature point to obtain an optimized teacher query vector, and generating a teacher prediction result according to the optimized teacher query vector; Initializing a student query vector of the object detection student model, and optimizing the student query vector using a query vector prior allocation distillation algorithm to obtain an optimized student query vector; A student prediction result is generated according to the optimized student query vector, and the student prediction result is optimized using the Hungarian algorithm and the teacher prediction result. After the optimization is completed, a prediction target of the multi-view image is obtained.
2. The BEV perspective 3D target detection method based on target perception feature distillation according to claim 1, characterized in that: The method of using the target-aware feature distillation algorithm to identify key feature points in the teacher image features includes: Selecting a soft mask according to the multi-view image, and calculating the distillation area of the multi-view image using the soft mask; The image features in the distillation region are extracted to obtain the key feature points.
3. The BEV perspective 3D target detection method based on target perception feature distillation according to claim 2, characterized in that: Before calculating the distillation region of the multi-view image using the soft mask, the method also includes calculating a quality assessment score in a target detection teacher model.
4. The BEV perspective 3D target detection method based on target perception feature distillation according to claim 3 is characterized in that: The calculation of the quality assessment score in the target detection teacher model includes: The quality assessment score in the object detection teacher model is calculated using the following formula: Among them, c i is the classification score of the i-th query vector in the target detection teacher model, is the predicted bounding box of the i-th query vector in the object detection teacher model, is the corresponding truth box, γ is a hyperparameter used to balance the weights, and IoU is the intersection over union ratio.
5. The BEV perspective 3D target detection method based on target perception feature distillation according to claim 1, characterized in that: The optimizing the student query vector by using a query vector prior distribution distillation algorithm includes: Obtaining a query vector set in the target detection teacher model, and matching the query vector set with a true value sample to obtain a sample matching result; The query vector set is input into the decoder of the target detection student model as prior knowledge, and the loss value between the predicted output result of the target detection student model and the true value sample is calculated using the sample matching result, and the student query vector is optimized by the loss value.
6. The BEV perspective 3D target detection method based on target perception feature distillation according to claim 5, characterized in that: The method of calculating the loss value between the predicted output result of the target detection student model and the true value sample by using the sample matching result includes: The following formula is used to calculate the loss value between the predicted output result of the target detection student model and the true value sample: in, is the sample matching result of the i-th true value sample, C is the total number of query vectors of the teacher model, and y i represents the i-th true value sample, represents the prediction result of the target detection student model under the sample matching result distribution of the target detection teacher model, L match It is the optimal allocation calculated by the Hungarian algorithm in DETR3D.
7. The BEV perspective 3D target detection method based on target perception feature distillation according to claim 1, characterized in that: The Hungarian algorithm is used to combine the teacher prediction result and the student prediction result, including: Obtaining positive predictions and negative predictions in the teacher's prediction results, and using samples corresponding to the positive predictions as pseudo-true value samples; Calculate the loss value between the student prediction result and the pseudo true value sample according to the pseudo true value sample to obtain a first loss value; Taking the sample corresponding to the negative prediction as a negative true value sample, and calculating the loss value between the student prediction result and the negative true value sample to obtain a second loss value; The student prediction result is optimized in combination with the first loss value and the second loss value to obtain a prediction target for the multi-view image.
8. A BEV perspective 3D target detection device based on target perception feature distillation, characterized in that: The device can implement the BEV perspective 3D target detection method based on target perception feature distillation as described in any one of claims 1 to 7, and the device includes: A feature extraction module is used to obtain multi-view images, and input the multi-view images into the backbone networks of the target detection teacher model and the target detection student model respectively to extract image features, so as to obtain teacher image features and student image features; A query vector optimization module is used to use a target-aware feature distillation algorithm to identify key feature points in the teacher image features to obtain a first key feature point, and use a target-aware feature distillation algorithm to identify key feature points in the student image features to obtain a second key feature point; initialize the teacher query vector of the target detection teacher model, and optimize the teacher query vector using the first key feature point to obtain an optimized teacher query vector, and generate a teacher prediction result based on the optimized teacher query vector; initialize the student query vector of the target detection student model, and use a query vector prior distribution distillation algorithm to optimize the student query vector to obtain an optimized student query vector; The prediction result acquisition module is used to generate a student prediction result according to the optimized student query vector, and optimize the student prediction result using the Hungarian algorithm and the teacher prediction result, and obtain the prediction target of the multi-view image after the optimization is completed.
9. An electronic device, characterized in that: The electronic device comprises: at least one processor; and, a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the BEV perspective 3D target detection method based on target perception feature distillation as described in any one of claims 1 to 7.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the BEV perspective 3D target detection method based on target perception feature distillation as described in any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Knowledge distillation method, target detection method, device, equipment and storage medium
CN117574998A
Cited By
Robust online vector map construction method for space-time simplified query
CN120426983A
