Target detection model training method, target detection method, electronic device, and medium

By transforming regression tasks into subclassification tasks and introducing knowledge distillation methods for subregression tasks, the problem of poor adaptability of model distillation schemes in the field of autonomous driving is solved, and efficient training and performance improvement of object detection models are achieved.

CN117253083BActive Publication Date: 2025-11-28CHONGQING CHANGAN AUTOMOBILE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311230035.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-09-21
Publication Date
2025-11-28
Estimated Expiration
2043-09-21

AI Technical Summary

Technical Problem

In existing technologies, deep learning models are used in target detection tasks in the field of autonomous driving. However, model distillation schemes are mainly used for classification tasks, and there are few schemes applied to regression tasks, resulting in poor vehicle target detection performance and difficulty in adapting to existing industrial models.

Method used

The regression task is transformed into a sub-classification task, and a sub-regression task is introduced. The object detection model is trained using the knowledge distillation method. The first model that has been trained is used to assist the second model to be trained in learning the features of the classification and regression tasks. The corresponding loss function is established for training.

Benefits of technology

This enables more effective model distillation in object detection tasks, improving model adaptability and detection performance, and solving the problem of insufficient performance improvement at the feature level due to model differences.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117253083B_ABST
    Figure CN117253083B_ABST
Patent Text Reader

Abstract

The application discloses a target detection model training method, a target detection method, an electronic device and a medium, and relates to the technical field of automatic driving. The method comprises the following steps: inputting an automatic driving front-view image sample into a first model which has completed training and a second model which needs to be trained, and obtaining prediction results of classification and regression tasks of the two models; taking the prediction result of the classification task of the first model as a target, training a classification task of the second model; classifying the prediction results of the regression tasks of the two models, and obtaining prediction results of respective regression task sub-classification tasks; taking the prediction result of the sub-classification task of the first model as a target, training a sub-classification task of the second model; determining the regression value of each class after the classification of the prediction results of the regression tasks of the two models as the prediction result of the respective sub-regression task; taking the prediction result of the sub-regression task of the first model as a target, training a sub-regression task of the second model; and determining the second model which has completed the classification, sub-classification and sub-regression tasks as a target detection model.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of automatic driving, in particular to a target detection model training method, a target detection method, an electronic device and a medium. BACKGROUND

[0002] Deep learning models have shown strong performance and excellent development potential in image classification, target detection, automatic driving and other fields, especially represented by convolutional neural networks. However, the parameter quantity and computational quantity of deep learning models are too large, which makes it difficult to satisfy real-time performance and accuracy at the same time. In order to solve this challenge, traditional deep model compression methods use pruning methods based on the importance of neural network connection weights. However, with the continuous development of deep neural networks, the limitations of these methods gradually appear. Therefore, the academic community proposes structured pruning schemes based on convolutional channels and introduces knowledge distillation and other compression schemes. These methods can compress deep learning models to a certain extent while maintaining model accuracy as much as possible. However, in specific applications, such as image classification, due to the large difference between the teacher model and the student model, such as network structure or parameter quantity, computational quantity, etc., these methods are difficult to obtain good results, resulting in a sharp decrease in the accuracy of the student model used for image classification, ultimately leading to low accuracy of image classification.

[0003] Knowledge distillation is a method for compressing deep learning models, which is generally applied to classification tasks. For regression tasks, the application of knowledge distillation schemes is relatively small. In the existing model distillation in the field of automatic driving, since the model distillation scheme is generally used for classification tasks, there are few model distillation schemes applied to regression tasks, and the few existing schemes are not suitable for the existing industrial models in the field of automatic driving, which cannot achieve good scheme adaptation, resulting in poor performance of the task model for vehicle target detection. Therefore, it is urgent to explore a method that can be easily implemented and adapted in target detection tasks. SUMMARY

[0004] In view of the above problems, the embodiments of the present application provide a target detection model training method, a target detection method, an electronic device and a medium, so as to overcome the above problems or at least partially solve the above problems.

[0005] In order to achieve the above purpose, the technical scheme adopted by the present application is as follows:

[0006] The first aspect of the embodiments of the present application provides a training method of a target detection model, the method comprising:

[0007] inputting an automatic driving front view image sample into a first model which has completed training, obtaining a prediction result of a first classification task and a prediction result of a first regression task output by the first model;

[0008] inputting the automatic driving front-view image sample into a second model to be trained, obtaining a prediction result of a second classification task and a prediction result of a second regression task output by the second model;

[0009] training the second classification task with the prediction result of the first classification task as a target;

[0010] performing classification processing on the prediction result of the first regression task to obtain a prediction result of a first sub-classification task of the first regression task, and performing the classification processing on the prediction result of the second regression task to obtain a prediction result of a second sub-classification task of the second regression task;

[0011] training the second sub-classification task with the prediction result of the first sub-classification task as a target;

[0012] determining a regression value in each class after the classification processing of the prediction result of the first regression task as a prediction result of a first sub-regression task, and determining a regression value in each class after the classification processing of the prediction result of the second regression task as a prediction result of a second sub-regression task;

[0013] training the second sub-regression task with the prediction result of the first sub-regression task as a target;

[0014] determining the second model after the training of the second classification task, and the training of the second sub-classification task and the second sub-regression task, as a target detection model.

[0015] Optionally, the training of the second classification task with the prediction result of the first classification task as a target comprises:

[0016] establishing a classification task loss function according to a difference between the respective classification task prediction results of the first classification task and the second classification task for the automatic driving front-view image sample;

[0017] training the second classification task of the second model based on the classification task loss function.

[0018] Optionally, the classification processing on the prediction result of the first regression task to obtain the prediction result of the first sub-classification task of the first regression task, and the classification processing on the prediction result of the second regression task to obtain the prediction result of the second sub-classification task of the second regression task, comprises:

[0019] a first distribution function of the first regression task is obtained by taking the prediction result of the first regression task as a mean of a first Gaussian function and taking a confidence degree of the prediction result of the first regression task as a variance coefficient of the first Gaussian function;

[0020] a prediction result of the first sub-classification task is obtained by filling the first distribution function into classification of the first sub-classification task;

[0021] a second distribution function of the second regression task is obtained by taking the prediction result of the second regression task as a mean of a second Gaussian function and taking a confidence degree of the prediction result of the second regression task as a variance coefficient of the second Gaussian function;

[0022] a prediction result of the second sub-classification task is obtained by filling the second distribution function into classification of the second sub-classification task.

[0023] Optionally, the training of the second sub-classification task based on the prediction result of the first sub-classification task comprises:

[0024] a first soft label of the first sub-classification task is obtained by dividing the prediction result of the first sub-classification task by a temperature coefficient and then performing a softmax operation;

[0025] a second soft label of the second sub-classification task is obtained by dividing the prediction result of the second sub-classification task by the temperature coefficient and then performing a softmax operation;

[0026] a sub-classification task loss function is established according to a difference between the first soft label and the second soft label;

[0027] the second sub-classification task is trained based on the sub-classification task loss function.

[0028] Optionally, the training of the second sub-regression task based on the prediction result of the first sub-regression task comprises:

[0029] a sub-regression task loss function is established according to a difference between the sub-regression task prediction results of the first sub-regression task and the second sub-regression task for the automatic driving front view image sample;

[0030] the second sub-regression task is trained based on the sub-regression task loss function.

[0031] Optionally, the method further comprises:

[0032] an automatic driving front view image sample with classification and regression labels is obtained;

[0033] The second model is supervised trained by using the automatic driving front view image sample with the classification and regression labels;

[0034] The second model, which is trained to complete the second classification task, and is trained to complete the second sub-classification task and the second sub-regression task, is determined as a target detection model, including:

[0035] The second model, which is trained to complete the second classification task, and is trained to complete the second sub-classification task and the second sub-regression task, and is supervised trained, is determined as the target detection model.

[0036] Optionally, before the automatic driving front view image sample is input into the first model which is trained, the method further includes:

[0037] A first model to be trained with a first parameter quantity is constructed, and a second model to be trained with a second parameter quantity is constructed, the second parameter quantity is less than the first parameter quantity;

[0038] The first model to be trained is trained by using a target number of automatic driving front view image samples, to obtain the first model which is trained.

[0039] The second aspect of the embodiment of the application provides a target detection method, the method comprising:

[0040] An automatic driving vehicle front view image collected by a vehicle-mounted camera is acquired;

[0041] The automatic driving vehicle front view image is input into a target detection model to obtain a target detection result, the target detection model is the target detection model trained according to any one of the first aspect of the embodiment of the application.

[0042] The third aspect of the embodiment of the application provides an electronic device, including a memory, a processor and a computer program stored in the memory, the processor executes the computer program to realize the training method of the target detection model according to any one of the first aspect of the embodiment of the application, or the target detection method according to the second aspect of the embodiment of the application.

[0043] The fourth aspect of the embodiment of the application provides a computer readable storage medium, which stores a computer program / instruction, the computer program / instruction is executed by a processor to realize the training method of the target detection model according to any one of the first aspect of the embodiment of the application, or the target detection method according to the second aspect of the embodiment of the application.

[0044] The beneficial effects of the application are as follows:

[0045] The present application realizes more effective distillation by converting the regression task into a sub-classification task during target detection model training. The present application solves the problem that in the existing automatic driving field, when performing model distillation, since the model distillation scheme is generally used for classification tasks, there are few model distillation schemes applied to regression tasks, and only some of the existing schemes in the automatic driving field have large differences in industrial models, which cannot realize better scheme adaptation, resulting in poor task model effect of vehicle target detection. The target detection model training method of the present application can realize more effective model distillation.

[0046] When converted into a sub-classification task, the present application introduces a sub-regression task, solves the distance error between the sub-regression task and the original regression task, and further adds the prediction result of the sub-regression task to the prediction result of the sub-classification task, thereby realizing the original complete regression task. The present application solves the problem that due to the difference between different models, the feature level distillation cannot effectively improve the performance, and realizes a simple and easy to adapt distillation method in the target detection task. BRIEF DESCRIPTION OF DRAWINGS

[0047] Figure 1 A step flow chart of a target detection model training method according to an embodiment of the present application is provided.

[0048] Figure 2 A model structure diagram for converting a regression task into a classification task in a target detection model training method according to an embodiment of the present application is provided.

[0049] Figure 3 A regression value classification display diagram of three classification processing methods for converting a regression task into a classification task in a target detection model training method according to an embodiment of the present application is provided.

[0050] Figure 4 A distribution display diagram of a regression value prediction result for converting a regression task into a sub-classification task in a target detection model training method according to an embodiment of the present application is provided.

[0051] Figure 5 A schematic diagram of an electronic device according to an embodiment of the present application is provided. DETAILED DESCRIPTION

[0052] Other advantages and embodiments of the present application will be disclosed in the following embodiments with reference to the accompanying drawings and preferred embodiments. Based on the disclosure herein, one skilled in the art can easily understand other advantages and effects of the present application. The present application can also be implemented or applied in other different specific embodiments, and various modifications or changes can be made to the details herein based on different views and applications without departing from the spirit of the present application. It should be understood that the preferred embodiments are only for illustrating the present application, but not for limiting the protection scope of the present application.

[0053] It should be noted that the diagrams provided in the following embodiments only schematically illustrate the basic concept of the present application, and only the components related to the present application are shown in the diagrams, but not drawn according to the number, shape and size of the components in actual implementation. The shape, number and proportion of each component in actual implementation can be arbitrarily changed, and the layout pattern of the components can also be more complex.

[0054] Referring to Figure 1 As shown in FIG. 1, a flowchart of steps of a target detection model training method in an embodiment of the present application is shown. As shown in FIG. 2, the target detection model training method can be used in a computer, a mobile phone, a tablet computer, a server and the like, and the target detection model training method includes the following steps: Figure 1

[0055] Step S101: input an automatic driving front view image sample into a first model which has completed training, obtain a prediction result of a first classification task and a prediction result of a first regression task output by the first model;

[0056] Step S102: input the automatic driving front view image sample into a second model to be trained, obtain a prediction result of a second classification task and a prediction result of a second regression task output by the second model;

[0057] Step S103: train the second classification task with the prediction result of the first classification task as a target;

[0058] Step S104: perform classification processing on the prediction result of the first regression task to obtain a prediction result of a first sub-classification task of the first regression task, and perform the classification processing on the prediction result of the second regression task to obtain a prediction result of a second sub-classification task of the second regression task;

[0059] Step S105: train the second sub-classification task with the prediction result of the first sub-classification task as a target;

[0060] ​Step S106: determining the regression value in each class after the classification processing of the prediction result of the first regression task as the prediction result of the first sub-regression task, and determining the regression value in each class after the classification processing of the prediction result of the second regression task as the prediction result of the second sub-regression task;

[0061] Step S107: training the second sub-regression task with the prediction result of the first sub-regression task as the target;

[0062] Step S108: determining the second model after the training of the second classification task and the training of the second sub-classification task and the second sub-regression task as the target detection model.

[0063] Optionally, step S101 and step S102 can be performed simultaneously. And after step S101 and step S102 are completed, step S104 can be performed, that is, step S103 and step S104 can also be performed simultaneously.

[0064] The first model is a trained model for target detection, which is used to assist the training of the second model; and the second model is a target detection model to be trained.

[0065] Optionally, in order to make the effect of assisted training better, the first model can be a model with large number of parameters and excellent performance after training. In order to save the calculation resources of the trained target detection model, the second model can be a model with small number of parameters. Through the assisted training of the first model, the second model with small number of parameters also has excellent performance after training.

[0066] Specifically, the first model is a model with large number of parameters and excellent performance after training, so the classification task prediction result and the regression task prediction result output by the first model for the automatic driving front view image sample are completely reliable; and the second model is a target detection model to be trained, so the classification task prediction result and the regression task prediction result output by the second model for the automatic driving front view image sample are not completely reliable, and the error is relatively large.

[0067] Optionally, after the two models output the classification task prediction result and the regression task prediction result, for the classification task, the second classification task is trained with the prediction result of the first classification task as the target, which can make the second model learn the recognition ability of the first model for classifying objects in the automatic driving front view image, so that the second model has better performance when classifying objects in the automatic driving front view image.

[0068] Optionally, with reference to Figure 2 , Figure 2is a model structure diagram for converting a regression task into a classification task in a target detection model training method in an embodiment of the present application. There is no good method for regression task training of a target detection model in the prior art. In the embodiment of the present application, the regression task is converted into a sub-classification task, and then the training method of the classification task is used for training, so that the regression task training can be realized.

[0069] Optionally, with reference to Figure 3 , Figure 3 is a classification display diagram of regression values of three classification processing methods for converting a regression task of a target detection model into a classification task in a target detection model training method in an embodiment of the present application.

[0070] Optionally, the classification processing operation has multiple implementation manners. In the embodiment, a bin processing manner is adopted. As shown in Figure 3 , first, the prediction result of the regression task is normalized. As shown in Figure 3 , it can be seen that the bin processing operation also has multiple implementation manners, including a mean bin distribution manner (UD), a linear bin distribution manner (LID), and a custom bin distribution manner (CTD). Different bin distribution manners can highlight different emphasis directions of the regression task during training. A coarser bin represents that the network has a higher tolerance for the regression value of the region, and vice versa. A finer bin represents that the network has a lower tolerance for the regression value of the region, and can amplify the error loss to obtain better training effect, but the convergence speed of the model is correspondingly slower. In the embodiment, the mean distribution bin processing manner is adopted to realize the sub-classification task.

[0071] Optionally, after the regression task is converted into the sub-classification task, the output will have errors compared with the original regression task. Therefore, the embodiment of the present application introduces a sub-regression task. The output result of the sub-regression task of the second model can predict the error value of the sub-classification task and the original regression task through the training of the sub-regression task of the first model on the sub-regression task of the second model. Finally, the prediction result of the original regression task is obtained by combining the output of the sub-classification task and the output of the sub-regression task.

[0072] In the embodiment of the present application, the regression task is converted into a sub-classification task during the training of the target detection model, and then more effective training is realized. In the embodiment of the present application, the sub-regression task is introduced when the regression task is converted into the sub-classification task, the distance error between the sub-regression task and the original regression task is solved, and the prediction result of the sub-regression task is further added to the prediction result of the sub-classification task, so that the original complete regression task is realized. The embodiment of the present application solves the problem that the feature level distillation cannot obtain effective performance improvement due to the difference between different models, and realizes a simple and easy-to-adapt distillation method in the target detection task.

[0073] Optionally, the embodiment of the present application trains the second classification task with the prediction result of the first classification task as a target, including:

[0074] According to the difference between the classification task prediction results of the first classification task and the second classification task for the automatic driving front view image sample, a classification task loss function is established;

[0075] Based on the classification task loss function, the second classification task of the second model is trained.

[0076] Specifically, the second model can learn the classification task features extracted by the first model of the first classification task for the automatic driving front view image sample through the following steps:

[0077] The classification task features extracted by the first model for the automatic driving front view image sample are obtained, and the classification task features extracted by the second model for the image sample are obtained; according to the difference between the classification task features extracted by the first model and the second model for the same sample, a classification task loss function is established; based on the classification task loss function, the second model is trained.

[0078] Among them, the first model can be multi-layer image feature extraction for image samples, and the second model can be less than the first model for image feature extraction. In order to let the second model can learn to the first model, the image features of the same image sample extracted by the first model and the second model respectively should be extracted at the same level or the same scale.

[0079] Optionally, the prediction result of the first regression task is classified to obtain the prediction result of the first sub-classification task of the first regression task, and the prediction result of the second regression task is classified to obtain the prediction result of the second sub-classification task of the second regression task, including:

[0080] Taking the prediction result of the first regression task as the mean of the first Gaussian function and the confidence of the prediction result of the first regression task as the variance coefficient of the first Gaussian function, the first distribution function of the first regression task is obtained;

[0081] The first distribution function is filled into the classification of the first sub-classification task to obtain the prediction result of the first sub-classification task;

[0082] The prediction result of the second regression task is taken as the mean of the second Gaussian function, and the confidence of the prediction result of the second regression task is taken as the variance coefficient of the second Gaussian function, to obtain a second distribution function of the second regression task;

[0083] The second distribution function is filled into the classification of the second sub-classification task to obtain a prediction result of the second sub-classification task.

[0084] Optionally, in a preferred embodiment of the present application, in order to optimize the network training process and facilitate model distillation, a distribution situation in the form of classification is constructed by using the prediction result and the confidence of the regression task, and a label smooth label construction method is realized. Figure 4 is a distribution display diagram of the regression value prediction result in the sub-classification task by using the Gaussian function to convert the regression task in the training method of the target detection model in the preferred embodiment.

[0085] As shown in Figure 4 , the Gaussian function expression is:

[0086] Among them:

[0087] The prediction result (u) of the regression task is taken as the mean of the first Gaussian function, that is, b = u in the formula;

[0088] The confidence (Conf) of the prediction result of the regression task is taken as the variance coefficient of the first Gaussian function;

[0089] The standard deviation δ = 1-Conf, and the variance Var = δ 2 ;

[0090] Thus, the normal distribution expression is obtained:

[0091] As shown in Figure 4 , curve 1 is the function image when u:0.5, Var:0.0001, and Conf:0.99; curve 2 is the function image when u:0.6, Var:0.01, and Conf:0.9; and curve 3 is the function image when u:0.4, Var:0.0025, and Conf:0.95. According to the prediction result of each regression task, the distribution display diagram of the regression value prediction result in the sub-classification task can be obtained.

[0092] Optionally, the training of the second sub-classification task by taking the prediction result of the first sub-classification task as the target comprises:

[0093] divide the prediction result of the first sub-classification task by a temperature coefficient, and perform a softmax operation to obtain a first soft label of the first sub-classification task;

[0094] divide the prediction result of the second sub-classification task by the temperature coefficient, and perform a softmax operation to obtain a second soft label of the second sub-classification task;

[0095] establish a sub-classification task loss function according to a difference between the first soft label and the second soft label;

[0096] train the second sub-classification task based on the sub-classification task loss function.

[0097] Specifically, in our normal training process, we will only focus on the difference between the highest probability result and the correct result, and this similarity is completely constructed through a sufficient number of samples. In the preferred embodiment of the present application, the loss value corresponding to the probability value of other classes is amplified when calculating the loss function, which makes the output results of different classes be equally considered. For example, the loss function used to train the second sub-classification task in the preferred embodiment can be composed of two parts: the comparison between the result with a temperature coefficient of 1 and the true value, and the loss composed of the outputs of the large network with a temperature coefficient of 20. This method promotes the training effect of the second sub-classification task.

[0098] Optionally, the training of the second sub-regression task based on the prediction result of the first sub-regression task comprises:

[0099] establish a sub-regression task loss function according to a difference between the sub-regression task prediction results of the first sub-regression task and the second sub-regression task for the automatic driving front view image sample;

[0100] train the second sub-regression task based on the sub-regression task loss function.

[0101] Optionally, in the preferred embodiment, the L1 or L2 loss function can be used to train the second sub-regression task. Specifically, the purpose of this step is to perform regression training on the classified output result, minimize the difference between the prediction result and the true result, and thus improve the prediction accuracy and generalization ability of the second model.

[0102] Optionally, on the basis of the above-mentioned embodiments of the application, in another preferred embodiment, the method further comprises:

[0103] obtaining an automatic driving front view image sample with classification and regression labels;

[0104] The second model is supervised trained by using the autonomous driving front view image sample with classification and regression labels;

[0105] The second model which is trained to complete the second classification task and the second sub-classification task and the second sub-regression task is determined as the target detection model, comprising:

[0106] The second model which is trained to complete the second classification task and the second sub-classification task and the second sub-regression task and the supervised training is determined as the target detection model.

[0107] Specifically, on the basis of the auxiliary training of the first model on the second model, the second model also performs its own training. Optionally, the second model can be supervised trained by using the autonomous driving front view image sample with classification and regression labels.

[0108] In this way, the auxiliary training of the first model and the supervised training of the second model can guarantee the excellent performance of the trained target detection model.

[0109] Optionally, in another preferred embodiment, before the autonomous driving front view image sample is input into the trained first model, the method further comprises:

[0110] The first model to be trained with a first parameter quantity and the second model to be trained with a second parameter quantity are constructed, the second parameter quantity being less than the first parameter quantity;

[0111] The first model to be trained is trained by using a target number of autonomous driving front view image samples to obtain the trained first model.

[0112] Specifically, for the screening of an excellent target detection model, the channel number of the convolution kernel can be increased to train an excellent model. By increasing the channel number of the convolution kernel, the image feature extraction capability of the model can be enhanced, and the performance and expression of the model can be improved. In the training process, full-quantity data and a large parameter quantity are used to obtain a more accurate and reliable first model.

[0113] Optionally, a picture training set to be predicted in the front view direction of the autonomous driving host vehicle is obtained, the vehicle categories and coordinate information in the picture data set are labeled, and then the labeled data set is used to train a deep convolutional neural network model to obtain a trained deep convolutional neural network model as the first model. The target detection network can be selected from YOLO, ResNet, etc.

[0114] Based on the same inventive concept, another embodiment of the present application provides a target detection method, comprising:

[0115] obtaining a front view image of an autonomous vehicle collected by a vehicle-mounted camera;

[0116] inputting the front view image of the autonomous vehicle into a target detection model to obtain a target detection result, the target detection model being trained by any one of the target detection models according to the first aspect of the present application.

[0117] Specifically, the target detection method provided by the embodiments of the present application is applied to an autonomous vehicle. When the autonomous vehicle is driving, a front view image of the autonomous vehicle collected by a vehicle-mounted camera is obtained and input into a target detection model to obtain the category of an object in the front view image of the autonomous vehicle, the position of the object in the image and other information, so as to ensure driving safety.

[0118] Based on the same inventive concept, another embodiment of the present application provides an electronic device, comprising a memory, a processor and a computer program stored in the memory, the processor executing the computer program to implement the training method of the target detection model according to any one of the first aspect of the embodiments of the present application, or the target detection method according to the second aspect of the embodiments of the present application.

[0119] Specifically, the embodiments of the present application also provide an electronic device, which is described with reference to Figure 5 , Figure 5 is a schematic diagram of the electronic device according to the embodiments of the present application. As shown in Figure 5 , the electronic device 100 comprises a memory 110 and a processor 120, the memory 110 and the processor 120 are communicatively connected through a bus, the memory 110 stores a computer program, the computer program is executable on the processor 120, and further implements the steps in the training method of the target detection model according to any one of the first aspect of the embodiments of the present application, or implements the steps in the target detection method according to the second aspect of the embodiments of the present application.

[0120] Based on the same inventive concept, another embodiment of the present application provides a computer readable storage medium, which stores a computer program / instruction, the computer program / instruction is executed by a processor to implement the training method of the target detection model according to any one of the first aspect of the embodiments of the present application, or the target detection method according to the second aspect of the embodiments of the present application.

[0121] Each of the embodiments in the present specification is described in a progressive manner, and each embodiment focuses on the difference from other embodiments. The same and similar parts of each embodiment can be referred to each other.

[0122] Those skilled in the art will understand that embodiments of the present application can be provided as methods, apparatus, electronic devices, storage media or computer program products. Accordingly, embodiments of the present application can take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, embodiments of the present application can take the form of a computer program product on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROMs, optical storage devices, etc.) embodying computer-readable program code.

[0123] Although the embodiments of the present application have been shown and described, it will be appreciated by those skilled in the art that changes, modifications, alternatives and variations to the embodiments can be made without departing from the principles and spirit of the application, and the scope of the application is defined by the claims and their equivalents.

[0124] Finally, it should be noted that the terms such as first and second, etc., are merely used to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between such entities or operations. Moreover, the terms "include", "contain" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal device including a series of elements not only includes those elements, but also includes other elements not explicitly listed or inherent to such process, method, article or terminal device. Without more limitations, the element defined by the phrase "including a" does not exclude the presence of additional identical elements in the process, method, article or terminal device including the element.

[0125] The above provides a detailed description of the target detection model training method, target detection method, electronic device and medium provided by the present application. The principles and implementation modes of the present application are described by applying specific examples. The above embodiment descriptions are only used to help understand the method and core idea of the present application; at the same time, for those skilled in the art, according to the idea of the present application, the specific implementation mode and application range will be changed; in summary, the content of the specification should not be understood as a limitation of the present application. The above embodiments are only preferred embodiments used to fully illustrate the present application, and the protection scope of the present application is not limited thereto. Any equivalent replacement or transformation made by those skilled in the art on the basis of the present application is within the protection scope of the present application.

Claims

1. A method for training a target detection model, the method comprising: The method comprises: inputting an automatic driving front view image sample into a first trained model, obtaining a prediction result of a first classification task and a prediction result of a first regression task output by the first model; inputting the automatic driving front view image sample into a second model to be trained, obtaining a prediction result of a second classification task and a prediction result of a second regression task output by the second model; training the second classification task with the prediction result of the first classification task as a target; performing classification processing on the prediction result of the first regression task to obtain a prediction result of a first sub-classification task of the first regression task, and performing the classification processing on the prediction result of the second regression task to obtain a prediction result of a second sub-classification task of the second regression task; training the second sub-classification task with the prediction result of the first sub-classification task as a target; determining a regression value in each class after the classification processing of the prediction result of the first regression task as a prediction result of a first sub-regression task, and determining a regression value in each class after the classification processing of the prediction result of the second regression task as a prediction result of a second sub-regression task; training the second sub-regression task with the prediction result of the first sub-regression task as a target; determining the second model after the training of the second classification task, the training of the second sub-classification task and the training of the second sub-regression task as a target detection model.

2. The training method of claim 1, wherein, The training of the second classification task with the prediction result of the first classification task as a target comprises: establishing a classification task loss function according to a difference between the classification task prediction results of the first classification task and the second classification task for the automatic driving front view image sample; training the second classification task of the second model based on the classification task loss function.

3. The training method of claim 1, wherein, The classification processing on the prediction result of the first regression task to obtain the prediction result of the first sub-classification task of the first regression task, and the classification processing on the prediction result of the second regression task to obtain the prediction result of the second sub-classification task of the second regression task comprise: taking the prediction result of the first regression task as a mean of a first Gaussian function, and taking a confidence of the prediction result of the first regression task as a variance coefficient of the first Gaussian function to obtain a first distribution function of the first regression task; filling the first distribution function into classification of the first sub-classification task to obtain the prediction result of the first sub-classification task; taking the prediction result of the second regression task as a mean of a second Gaussian function, and taking a confidence of the prediction result of the second regression task as a variance coefficient of the second Gaussian function to obtain a second distribution function of the second regression task; filling the second distribution function into classification of the second sub-classification task to obtain the prediction result of the second sub-classification task.

4. The training method of claim 1, wherein, The training of the second sub-classification task with the prediction result of the first sub-classification task as a target comprises: divide the prediction result of the first sub-classification task by a temperature coefficient, and perform a softmax operation to obtain a first soft label of the first sub-classification task; divide the prediction result of the second sub-classification task by the temperature coefficient, and perform a softmax operation to obtain a second soft label of the second sub-classification task; establish a sub-classification task loss function according to the difference between the first soft label and the second soft label; train the second sub-classification task based on the sub-classification task loss function.

5. The training method of claim 1, wherein, The training of the second sub-regression task based on the prediction result of the first sub-regression task includes: establishing a sub-regression task loss function according to the difference between the sub-regression task prediction results of the first sub-regression task and the second sub-regression task for the automatic driving front view image sample; training the second sub-regression task based on the sub-regression task loss function.

6. The training method according to any one of claims 1 to 5, characterized in that, The method further includes: obtaining an automatic driving front view image sample with classification and regression labels; training the second model in a supervised manner using the automatic driving front view image sample with classification and regression labels; determining the second model after the training of the second classification task, the training of the second sub-classification task, and the training of the second sub-regression task as a target detection model, including: determining the second model after the training of the second classification task, the training of the second sub-classification task, the training of the second sub-regression task, and the supervised training as the target detection model.

7. The training method according to any one of claims 1 to 5, characterized in that, Before inputting the automatic driving front view image sample into the first model after the training, the method further includes: constructing a first model to be trained with a first parameter quantity, and constructing a second model to be trained with a second parameter quantity, the second parameter quantity being less than the first parameter quantity; training the first model to be trained using a target number of automatic driving front view image samples to obtain the first model after the training.

8. A target detection method characterized by, The method includes: obtaining an automatic driving vehicle front view image collected by a vehicle-mounted camera; inputting the automatic driving vehicle front view image into a target detection model to obtain a target detection result, the target detection model being a target detection model trained according to any one of claims 1 to 7.

9. An electronic device comprising a memory, a processor, and a computer program stored on the memory, wherein the computer program comprises instructions that, when executed by the processor, cause the electronic device to perform the method of any one of claims 1-8. The processor executes the computer program to implement the training method of the target detection model according to any one of claims 1 to 7, or the target detection method according to claim 8.

10. A computer readable storage medium having stored thereon computer programs / instructions, characterized in that, The computer program / instructions are executed by the processor to implement the training method of the target detection model according to any one of claims 1 to 7, or the target detection method according to claim 8.

Citation Information

Patent Citations

  • Target detection model training method and target division method

    CN114639021A

  • Defect detection model training and defect detection method and device

    CN116596916A