Target detection model training method, device, equipment and readable storage medium
By combining the first training data set manually annotated and the second training data set without labels, the object detection teacher model predicts labels and optimizes the learning rate and label processing, the problem of dependence on labeled data in the training of the object detection model is solved, and the problem of dependence on labeled data is realized. Efficient model training and accuracy improvement.
Patent Information
- Application Number
- CN202210819858.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-13
- Publication Date
- 2024-12-31
- Estimated Expiration
- 2042-07-13
AI Technical Summary
The training of existing object detection models requires a large amount of labeled data, especially in some fields such as the detection of scattered targets in smart cities. It is difficult to obtain labeled data, resulting in difficulty in training.
By obtaining a first training data set containing manual labels and a second training data set without labels, the trained object detection teacher model predicts the label of the second training data set, and combining the two to perform the object detection model Training, using different learning rates and label smoothing processing to optimize the model.
It realizes the training of an effective object detection model without a large amount of labeled data, which improves the detection accuracy and generalization ability of the model, and reduces the dependence on labeled data.
Smart Images

Figure CN115115922B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of machine vision technology, and more specifically, to a target detection model training method, device, equipment and readable storage medium. Background Art
[0002] With the rapid development of deep learning and computer vision, related technologies have been widely used in many fields. Object detection is an important part of image understanding. Its task is to find all the targets (objects) of interest in the image and determine their positions and sizes. It is one of the core issues in the field of machine vision. Object detection has application needs in many fields, including face detection, pedestrian detection, vehicle detection, and important ground object detection in remote sensing images.
[0003] At present, the training of target detection models relies on a large amount of labeled data. However, in some fields, some scattered targets need to be detected. For example, in the smart city business field, it is necessary to detect scattered targets such as environmental workers, medical waste bags, and hand-pushed garbage trucks. In this scenario, it is often very difficult to obtain a large amount of labeled data, and only a small amount of labeled data can be obtained.
[0004] Therefore, how to provide a target detection model training method that does not rely on a large amount of labeled data has become a technical problem that needs to be urgently solved by technical personnel in this field. Summary of the invention
[0005] In view of the above problems, this application proposes a target detection model training method, device, equipment and readable storage medium. The specific scheme is as follows:
[0006] A target detection model training method, the method comprising:
[0007] Obtain a first training data set, a second training data set and a target detection model, wherein the labels of the training data in the first training data set are manually annotated labels, and the labels include target box labels and target category labels; the training data in the second training data set is unlabeled data;
[0008] Predicting labels of training data in the second training data set based on the trained target detection teacher model;
[0009] The target detection model is trained using the first training data set, labels of the training data in the first training data set, the second training data set, and labels of the training data in the second training data set to obtain a trained target detection model.
[0010] Optionally, the target detection model includes a backbone network, a regression branch network, and a classification branch network, and the target detection model is trained using the first training data set, the labels of the training data in the first training data set, the second training data set, and the labels of the training data in the second training data set to obtain a trained target detection model, including:
[0011] Using the first training data set and the labels of the training data in the first training data set, and using a first learning rate, the target detection model is trained for the first time to obtain the target detection model after the first training;
[0012] The regression branch network of the target detection model after the first training is fixed, and the backbone network and the classification branch network of the target detection model after the first training are trained for the second time using the second training data set and the labels of the training data in the second training data set, using a second learning rate to obtain a trained target detection model, and the second learning rate is less than the first learning rate.
[0013] Optionally, the using the first training data set and the labels of the training data in the first training data set to perform a first training on the target detection model using a first learning rate to obtain the target detection model after the first training includes:
[0014] Taking each training data in the first training data set as a training sample, taking the output of the classification branch network approaching the target category label of each training data in the first training data set, and the output of the regression branch network approaching the target box label of each training data in the first training data set as a training target, using a first learning rate to perform a first training on the target detection model to obtain a target detection model after the first training.
[0015] Optionally, the step of fixing the regression branch network of the target detection model after the first training, using the second training data set and the labels of the training data in the second training data set, and adopting a second learning rate to perform a second training on the backbone network and the classification branch network of the target detection model after the first training to obtain a trained target detection model includes:
[0016] Performing label smoothing processing on the target category label of each training data in the second training data set to obtain the target category label of each training data in the second training data set after label smoothing processing;
[0017] The regression branch network of the target detection model after the first training is fixed, and the second training data set, the smoothed target category labels of the training data in the second training data set, and the target frame labels of the training data in the second training data set are used to perform a second training on the backbone network and the classification branch network of the target detection model after the first training with a second learning rate to obtain a trained target detection model.
[0018] Optionally, the regression branch network of the target detection model after the first training is fixed, and the second training data set, the target category labels of the training data in the second training data set after smoothing, and the target frame labels of the training data in the second training data set are used to perform a second training on the backbone network and the classification branch network of the target detection model after the first training using a second learning rate to obtain a trained target detection model, including:
[0019] Performing enhancement processing on each training data in the second training data set to obtain enhanced data corresponding to each training data in the second training data set;
[0020] The enhanced data corresponding to each training data in the second training data set is used as a training sample, and the output of the classification branch network of the target detection model after the first training is close to the target category label of each training data in the second training data set after label smoothing, and the output of the regression branch network of the target detection model after the first training is close to the target box label of each training data in the second training data set as a training target, and the second learning rate is used to perform a second training on the backbone network and the classification branch network of the target detection model after the first training to obtain a trained target detection model.
[0021] Optionally, the target detection teacher model is trained as follows:
[0022] Obtaining a target detection teacher model, wherein the target detection teacher model has the same structure as the target detection model;
[0023] The target detection teacher model is trained using the first training data set to obtain a trained target detection teacher model.
[0024] Optionally, the using the first training data set to train the target detection teacher model to obtain a trained target detection teacher model includes:
[0025] Taking the training data in the first training data set as training samples, taking the output of the classification branch network approaching the target category of each training data in the first training data set, and the output of the regression branch network approaching the target box of each training data in the first training data set as training targets, the target detection teacher model is trained to obtain a trained target detection teacher model.
[0026] A target detection model training device, the device comprising:
[0027] An acquisition unit is used to acquire a first training data set, a second training data set and a target detection model, wherein the labels of the training data in the first training data set are manually annotated labels, and the labels include target box labels and target category labels; the training data in the second training data set is unlabeled data;
[0028] A label prediction unit, configured to predict labels of training data in the second training data set based on a trained object detection teacher model;
[0029] A training unit is used to train the target detection model using the first training data set, the labels of the training data in the first training data set, the second training data set, and the labels of the training data in the second training data set to obtain a trained target detection model.
[0030] Optionally, the target detection model includes a backbone network, a regression branch network and a classification branch network, and the training unit includes:
[0031] A first training unit is used to perform a first training on the target detection model using the first training data set and labels of the training data in the first training data set and a first learning rate to obtain a target detection model after the first training;
[0032] The second training unit is used to fix the regression branch network of the target detection model after the first training, use the second training data set and the labels of the training data in the second training data set, and use a second learning rate to perform a second training on the backbone network and the classification branch network of the target detection model after the first training to obtain a trained target detection model, and the second learning rate is less than the first learning rate.
[0033] Optionally, the first training unit is specifically used to:
[0034] Taking each training data in the first training data set as a training sample, taking the output of the classification branch network approaching the target category label of each training data in the first training data set, and the output of the regression branch network approaching the target box label of each training data in the first training data set as a training target, using a first learning rate to perform a first training on the target detection model to obtain a target detection model after the first training.
[0035] Optionally, the second training unit includes:
[0036] a label smoothing unit, configured to perform label smoothing processing on the target category label of each training data in the second training data set to obtain the target category label of each training data in the second training data set after label smoothing processing;
[0037] The training subunit is used to fix the regression branch network of the target detection model after the first training, use the second training data set, the smoothed target category labels of the training data in the second training data set, and the target frame labels of the training data in the second training data set, and adopt a second learning rate to perform a second training on the backbone network and the classification branch network of the target detection model after the first training to obtain a trained target detection model.
[0038] Optionally, the training subunit is specifically used to:
[0039] Performing enhancement processing on each training data in the second training data set to obtain enhanced data corresponding to each training data in the second training data set;
[0040] The enhanced data corresponding to each training data in the second training data set is used as a training sample, and the output of the classification branch network of the target detection model after the first training is close to the target category label of each training data in the second training data set after label smoothing, and the output of the regression branch network of the target detection model after the first training is close to the target box label of each training data in the second training data set as a training target, and the second learning rate is used to perform a second training on the backbone network and the classification branch network of the target detection model after the first training to obtain a trained target detection model.
[0041] Optionally, the device further comprises: a target detection teacher model training unit, wherein the target detection teacher model training unit comprises:
[0042] A target detection teacher model acquisition unit, used to acquire a target detection teacher model, wherein the target detection teacher model has the same structure as the target detection model;
[0043] The target detection teacher model training subunit is used to train the target detection teacher model using the first training data set to obtain a trained target detection teacher model.
[0044] Optionally, the target detection teacher model training subunit is specifically used for:
[0045] Taking the training data in the first training data set as training samples, taking the output of the classification branch network approaching the target category of each training data in the first training data set, and the output of the regression branch network approaching the target box of each training data in the first training data set as training targets, the target detection teacher model is trained to obtain a trained target detection teacher model.
[0046] A target detection model training device, comprising a memory and a processor;
[0047] The memory is used to store programs;
[0048] The processor is used to execute the program to implement the various steps of the target detection model training method as described above.
[0049] A readable storage medium having a computer program stored thereon, characterized in that when the computer program is executed by a processor, each step of the target detection model training method as described above is implemented.
[0050] By means of the above technical scheme, the present application discloses a method, apparatus, device and readable storage medium for training a target detection model. In this scheme, a first training data set, a second training data set and a target detection model are obtained, the labels of the training data in the first training data set are manually annotated labels, and the training data in the second training data set are unlabeled data; the labels of the training data in the second training data set are predicted based on the trained target detection teacher model; the target detection model is trained using the first training data set, the labels of the training data in the first training data set, the second training data set and the labels of the training data in the second training data set to obtain a trained target detection model. In the above scheme, pseudo labels for unlabeled data are obtained by using the trained target detection teacher model, so as to achieve the purpose of training the target detection teacher model with unlabeled data, so that the training of the target detection model does not need to rely on a large amount of annotated data. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] Various other advantages and benefits will become apparent to those of ordinary skill in the art by reading the detailed description of the preferred embodiments below. The accompanying drawings are only for the purpose of illustrating the preferred embodiments and are not to be considered as limiting the present application. Also, the same reference symbols are used throughout the accompanying drawings to represent the same components. In the accompanying drawings:
[0052] Figure 1 A flowchart of a target detection model training method disclosed in an embodiment of the present application;
[0053] Figure 2 A schematic diagram of the structure of a target detection model disclosed in an embodiment of the present application;
[0054] Figure 3 A flowchart of a method for training a target detection model using a first training data set, labels of training data in the first training data set, a second training data set, and labels of training data in the second training data set to obtain a trained target detection model is disclosed in an embodiment of the present application;
[0055] Figure 4 A schematic diagram of the structure of a target detection model training device disclosed in an embodiment of the present application;
[0056] Figure 5 A hardware structure block diagram of a target detection model training device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0057] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0058] Next, the target detection model training method provided in this application is introduced through the following embodiments.
[0059] Reference Figure 1 , Figure 1 A flowchart of a target detection model training method disclosed in an embodiment of the present application, the method may include:
[0060] Step S101: Obtain a first training data set, a second training data set and a target detection model, wherein the labels of the training data in the first training data set are manually annotated labels, and the labels include target box labels and target category labels; the training data in the second training data set are unlabeled data.
[0061] In this application, the first training data set and the second training data set can be training data sets in the same scattered target detection scenario, such as environmental worker detection, medical waste detection, hand-pushed garbage truck detection, etc., and this application does not impose any restrictions on this. The first training data set includes a small amount of training (for example, 5000), and the label of each training data is a manually marked label, and the training data in the second training data set is unlabeled data.
[0062] It should be noted that the architecture of the target detection model can be any one of the models such as FasterR-CNN, SSD and YOLO.
[0063] Step S102: Predicting labels of training data in the second training data set based on the trained target detection teacher model.
[0064] In the present application, the target detection teacher model can be pre-trained, and the labels of the training data in the second training data set are predicted based on the trained target detection teacher model.
[0065] As an implementable method, the target detection teacher model is trained as follows:
[0066] Obtain a target detection teacher model, the target detection teacher model has the same structure as the target detection model; use the first training data set to train the target detection teacher model to obtain a trained target detection teacher model. Specifically, using the first training data set to train the target detection teacher model to obtain a trained target detection teacher model includes: using each training data in the first training data set as a training sample, using the output of the classification branch network that is close to the target category of each training data in the first training data set, and using the output of the regression branch network that is close to the target box of each training data in the first training data set as a training target, training the target detection teacher model to obtain a trained target detection teacher model.
[0067] It should be noted that when the target detection teacher model is trained using the first training data set, a classification loss function and a regression loss function can be pre-constructed. When the output of the classification branch network is close to the target category of each training data in the first training data set, and the output of the regression branch network is close to the target box of each training data in the first training data set, it indicates that the classification loss function and the regression loss function converge. After the classification loss function and the regression loss function converge, a trained target detection teacher model can be obtained.
[0068] Step S103: train the target detection model using the first training data set, labels of the training data in the first training data set, the second training data set, and labels of the training data in the second training data set to obtain a trained target detection model.
[0069] In the present application, the target detection model can be trained once using the first training data set and the labels of the training data in the first training data set to obtain the target detection model after the first training, and then the target detection model after the first training can be trained again using the second training data set and the labels of the training data in the second training data set to obtain a trained target detection model to improve the training effect of the target detection model. The specific implementation method will be described in detail through the following embodiments.
[0070] This embodiment discloses a method for training a target detection model. In this scheme, a first training data set, a second training data set and a target detection model are obtained, the labels of the training data in the first training data set are manually annotated labels, and the training data in the second training data set are unlabeled data; the labels of the training data in the second training data set are predicted based on the trained target detection teacher model; the target detection model is trained using the first training data set, the labels of the training data in the first training data set, the second training data set and the labels of the training data in the second training data set to obtain a trained target detection model. In the above scheme, pseudo labels of unlabeled data are obtained by using the trained target detection teacher model, so as to achieve the purpose of training the target detection teacher model with unlabeled data, so that the training of the target detection model does not need to rely on a large amount of annotated data.
[0071] In another embodiment of the present application, the structure of the target detection model is introduced.
[0072] Reference Figure 2 , Figure 2 A schematic diagram of the structure of a target detection model disclosed in an embodiment of the present application is shown in FIG. Figure 2 As shown, the target detection model includes a backbone network, a regression branch network and a classification branch network. The specific structures of the backbone network, the regression branch network and the classification branch network can be determined according to the scene requirements, and this application does not impose any restrictions.
[0073] based on Figure 2The target detection model shown in another embodiment of the present application, in step S103, the target detection model is trained using the first training data set, the label of the training data in the first training data set, the second training data set, and the label of the training data in the second training data set to obtain the trained target detection model. The specific implementation method is introduced.
[0074] In the present application, the target detection teacher model is weak due to insufficient training data set and insufficient model generalization ability during training. The labels of the training data in the second training data set predicted based on the trained target detection teacher model are of poor quality relative to the manually labeled labels. Generally, the following problems exist: inaccurate target box position, target box error, for example, the target box is actually background interference information, the target boxes of some targets are not labeled due to missed detection, the target category labels are incorrectly labeled, etc. In order to make the target detection model trained using the labels of the training data in the second training data set of poor quality have better results than the target detection teacher model trained using the labels of the training data in the manually labeled first training data set, the following target detection model training method is proposed in the present application.
[0075] Reference Figure 3 , Figure 3 A flowchart of a method for training a target detection model using a first training data set, labels of training data in the first training data set, a second training data set, and labels of training data in the second training data set to obtain a trained target detection model is disclosed in an embodiment of the present application. The method may include the following steps:
[0076] Step S201: using the first training data set and the labels of the training data in the first training data set, and using a first learning rate to perform a first training on the target detection model, to obtain a target detection model after the first training.
[0077] As an implementable embodiment, the target detection model is trained for the first time using the first training data set and the labels of the training data in the first training data set, using a first learning rate to obtain the target detection model after the first training, including: using each training data in the first training data set as a training sample, using the output of the classification branch network that is close to the target category label of each training data in the first training data set, and using the output of the regression branch network that is close to the target box label of each training data in the first training data set as a training target, and using the first learning rate to train the target detection model for the first time to obtain the target detection model after the first training.
[0078] It should be noted that when the target detection model is trained for the first time using the first training data set, a classification loss function and a regression loss function can be pre-constructed. When the output of the classification branch network is close to the target category of each training data in the first training data set, and the output of the regression branch network is close to the target box of each training data in the first training data set, it indicates that the classification loss function and the regression loss function converge. After the classification loss function and the regression loss function converge, the target detection model after the first training can be obtained.
[0079] Step S202: Fix the regression branch network of the target detection model after the first training, use the second training data set and the labels of the training data in the second training data set, and use a second learning rate to perform a second training on the backbone network and the classification branch network of the target detection model after the first training to obtain a trained target detection model, and the second learning rate is less than the first learning rate.
[0080] In this step, considering that the target detection model after the first training has a low accuracy in predicting the target frame through the regression branch network due to insufficient training data set and insufficient model generalization ability, the regression branch network of the target detection model after the first training is fixed, and the backbone network and the classification branch network of the target detection model after the first training are trained for the second time using the second training data set and the labels of the training data in the second training data set, with a second learning rate, to obtain a trained target detection model.
[0081] As an implementable method, the second learning rate may be one Nth of the first learning rate, where N is an integer greater than 1. According to experiments, N=10 has a good training effect. For example, if the first learning rate is 1, the second learning rate may be 0.1.
[0082] Taking into account the situation that the labels of the training data in the second training data set predicted based on the trained target detection teacher model have incorrect target category labels, in the present application, the target category labels can be processed using a label smoothing strategy. For example, there are 10 target category labels in total and the target categories are 3. The target category labels can be [0, 0, 0, 1, 0, 0, 0, 0, 0]. The target category labels obtained after processing the target category labels with the label smoothing strategy can be [0.01, 0.01, 0.01, 0.91, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01].
[0083] It should be noted that by processing the target category labels through the label smoothing strategy, it is possible to overcome the degradation of the target detection model training effect caused by the erroneous target category labels obtained by the weak target detection teacher model.
[0084] Based on the above considerations, in the present application, as an implementable method, the regression branch network of the target detection model after the first training is fixed, and the second training data set and the labels of the training data in the second training data set are used to perform a second training on the backbone network and the classification branch network of the target detection model after the first training using a second learning rate to obtain a trained target detection model, including:
[0085] Performing label smoothing processing on the target category label of each training data in the second training data set to obtain the target category label of each training data in the second training data set after label smoothing processing;
[0086] The regression branch network of the target detection model after the first training is fixed, and the second training data set, the smoothed target category labels of the training data in the second training data set, and the target frame labels of the training data in the second training data set are used to perform a second training on the backbone network and the classification branch network of the target detection model after the first training with a second learning rate to obtain a trained target detection model.
[0087] Considering that the image and image + interference should have the same output results in the network, the training data in the second training data set contains interference, and the target box labels of the training data in the second training data set are predicted under the condition of interference, the training data in the second training data set is enhanced to remove interference and then input into the target detection model. If the target box output by the target detection model is consistent with the target box label of the training data in the second training data set, it means that the target detection model has a strong ability to resist noise interference.
[0088] Based on the above considerations, in the present application, as an implementable embodiment, when using the second training data set, the target category labels after smoothing of the training data in the second training data set, and the target box labels of the training data in the second training data set, and using the second learning rate to perform a second training on the backbone network and the classification branch network of the target detection model after the first training, each training data in the second training data set can be enhanced first to obtain the enhanced data corresponding to each training data in the second training data set; then the enhanced data corresponding to each training data in the second training data set is used as a training sample, and the output of the classification branch network of the target detection model after the first training is close to the target category labels after label smoothing of each training data in the second training data set, and the output of the regression branch network of the target detection model after the first training is close to the target box labels of each training data in the second training data set as the training target, and the second learning rate is used to perform a second training on the backbone network and the classification branch network of the target detection model after the first training to obtain a trained target detection model.
[0089] The target detection model training device disclosed in the embodiment of the present application is described below. The target detection model training device described below and the target detection model training method described above can be referenced to each other.
[0090] Reference Figure 4 , Figure 4 Schematic diagram of the structure of a target detection model training device disclosed in the embodiment of the present application. Figure 4 As shown, the target detection model training device may include:
[0091] An acquisition unit 11 is used to acquire a first training data set, a second training data set and a target detection model, wherein the labels of the training data in the first training data set are manually annotated labels, and the labels include target box labels and target category labels; the training data in the second training data set is unlabeled data;
[0092] A label prediction unit 12 is used to predict labels of training data in the second training data set based on the trained target detection teacher model;
[0093] The training unit 13 is used to train the target detection model using the first training data set, the labels of the training data in the first training data set, the second training data set, and the labels of the training data in the second training data set to obtain a trained target detection model.
[0094] As an implementable method, the target detection model includes a backbone network, a regression branch network and a classification branch network, and the training unit includes:
[0095] A first training unit is used to perform a first training on the target detection model using the first training data set and labels of the training data in the first training data set and a first learning rate to obtain a target detection model after the first training;
[0096] The second training unit is used to fix the regression branch network of the target detection model after the first training, use the second training data set and the labels of the training data in the second training data set, and use a second learning rate to perform a second training on the backbone network and the classification branch network of the target detection model after the first training to obtain a trained target detection model, and the second learning rate is less than the first learning rate.
[0097] As an implementable embodiment, the first training unit is specifically used for:
[0098] Taking each training data in the first training data set as a training sample, taking the output of the classification branch network approaching the target category label of each training data in the first training data set, and the output of the regression branch network approaching the target box label of each training data in the first training data set as a training target, using a first learning rate to perform a first training on the target detection model to obtain a target detection model after the first training.
[0099] As an implementable embodiment, the second training unit includes:
[0100] a label smoothing unit, configured to perform label smoothing processing on the target category label of each training data in the second training data set to obtain the target category label of each training data in the second training data set after label smoothing processing;
[0101] The training subunit is used to fix the regression branch network of the target detection model after the first training, use the second training data set, the smoothed target category labels of the training data in the second training data set, and the target frame labels of the training data in the second training data set, and adopt a second learning rate to perform a second training on the backbone network and the classification branch network of the target detection model after the first training to obtain a trained target detection model.
[0102] As an implementable embodiment, the training subunit is specifically used for:
[0103] Performing enhancement processing on each training data in the second training data set to obtain enhanced data corresponding to each training data in the second training data set;
[0104] The enhanced data corresponding to each training data in the second training data set is used as a training sample, and the output of the classification branch network of the target detection model after the first training is close to the target category label of each training data in the second training data set after label smoothing, and the output of the regression branch network of the target detection model after the first training is close to the target box label of each training data in the second training data set as a training target, and the second learning rate is used to perform a second training on the backbone network and the classification branch network of the target detection model after the first training to obtain a trained target detection model.
[0105] As an implementable embodiment, the device further includes: a target detection teacher model training unit, the target detection teacher model training unit including:
[0106] A target detection teacher model acquisition unit, used to acquire a target detection teacher model, wherein the target detection teacher model has the same structure as the target detection model;
[0107] The target detection teacher model training subunit is used to train the target detection teacher model using the first training data set to obtain a trained target detection teacher model.
[0108] As an implementable method, the target detection teacher model training subunit is specifically used for:
[0109] Taking the training data in the first training data set as training samples, taking the output of the classification branch network approaching the target category of each training data in the first training data set, and the output of the regression branch network approaching the target box of each training data in the first training data set as training targets, the target detection teacher model is trained to obtain a trained target detection teacher model.
[0110] Reference Figure 5 , Figure 5 A hardware structure diagram of a target detection model training device provided in an embodiment of the present application, referring to Figure 5 ,The hardware structure of the target detection model training device may include: at least one processor 1, at least one communication interface 2, at least one memory 3 and at least one communication bus 4;
[0111] In the embodiment of the present application, the number of the processor 1, the communication interface 2, the memory 3, and the communication bus 4 is at least one, and the processor 1, the communication interface 2, and the memory 3 communicate with each other through the communication bus 4;
[0112] The processor 1 may be a central processing unit CPU, or an application-specific integrated circuit ASIC (Application Specific Integrated Circuit), or one or more integrated circuits configured to implement the embodiments of the present invention, etc.;
[0113] The memory 3 may include a high-speed RAM memory, and may also include a non-volatile memory, such as at least one disk memory;
[0114] The memory stores a program, and the processor can call the program stored in the memory, wherein the program is used to:
[0115] Obtain a first training data set, a second training data set and a target detection model, wherein the labels of the training data in the first training data set are manually annotated labels, and the labels include target box labels and target category labels; the training data in the second training data set is unlabeled data;
[0116] Predicting labels of training data in the second training data set based on the trained target detection teacher model;
[0117] The target detection model is trained using the first training data set, labels of the training data in the first training data set, the second training data set, and labels of the training data in the second training data set to obtain a trained target detection model.
[0118] Optionally, the detailed functions and extended functions of the program may refer to the above description.
[0119] The embodiment of the present application further provides a readable storage medium, which may store a program suitable for execution by a processor, wherein the program is used to:
[0120] Obtain a first training data set, a second training data set and a target detection model, wherein the labels of the training data in the first training data set are manually annotated labels, and the labels include target box labels and target category labels; the training data in the second training data set is unlabeled data;
[0121] Predicting labels of training data in the second training data set based on the trained target detection teacher model;
[0122] The target detection model is trained using the first training data set, labels of the training data in the first training data set, the second training data set, and labels of the training data in the second training data set to obtain a trained target detection model.
[0123] Optionally, the detailed functions and extended functions of the program may refer to the above description.
[0124] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0125] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0126] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A target detection model training method, characterized in that: The method comprises: Obtain a first training data set, a second training data set and a target detection model, wherein the labels of the training data in the first training data set are manually annotated labels, and the labels include target box labels and target category labels; the training data in the second training data set is unlabeled data; Predicting labels of training data in the second training data set based on a trained target detection teacher model, wherein the target detection teacher model has the same structure as the target detection model; Training the target detection model using the first training data set, labels of the training data in the first training data set, the second training data set, and labels of the training data in the second training data set to obtain a trained target detection model; The target detection model is trained using the first training data set, the label of the training data in the first training data set, the second training data set, and the label of the training data in the second training data set to obtain a trained target detection model, including: first training the target detection model once using the first training data set and the label of the training data in the first training data set to obtain the target detection model after the first training, and then training the target detection model after the first training again using the second training data set and the label of the training data in the second training data set to obtain a trained target detection model.
2. The method according to claim 1, characterized in that The target detection model includes a backbone network, a regression branch network, and a classification branch network. The target detection model is trained using the first training data set, the labels of the training data in the first training data set, the second training data set, and the labels of the training data in the second training data set to obtain a trained target detection model, including: Using the first training data set and the labels of the training data in the first training data set, and using a first learning rate, the target detection model is trained for the first time to obtain the target detection model after the first training; The regression branch network of the target detection model after the first training is fixed, and the backbone network and the classification branch network of the target detection model after the first training are trained for the second time using the second training data set and the labels of the training data in the second training data set, using a second learning rate to obtain a trained target detection model, and the second learning rate is less than the first learning rate.
3. The method according to claim 2, characterized in that The first training data set and the labels of the training data in the first training data set are used to perform a first training on the target detection model using a first learning rate to obtain the target detection model after the first training, including: Taking each training data in the first training data set as a training sample, taking the output of the classification branch approaching the target category label of each training data in the first training data set, and the output of the regression branch approaching the target box label of each training data in the first training data set as a training target, and using a first learning rate to perform a first training on the target detection model to obtain a target detection model after the first training.
4. The method according to claim 3, characterized in that The method of fixing the regression branch network of the target detection model after the first training, using the second training data set and the labels of the training data in the second training data set, and adopting a second learning rate to perform a second training on the backbone network and the classification branch network of the target detection model after the first training, to obtain a trained target detection model, comprises: Performing label smoothing processing on the target category label of each training data in the second training data set to obtain the target category label of each training data in the second training data set after label smoothing processing; The regression branch network of the target detection model after the first training is fixed, and the second training data set, the smoothed target category labels of the training data in the second training data set, and the target frame labels of the training data in the second training data set are used to perform a second training on the backbone network and the classification branch network of the target detection model after the first training with a second learning rate to obtain a trained target detection model.
5. The method according to claim 4, characterized in that The method fixes the regression branch network of the target detection model after the first training, uses the second training data set, the target category labels of the training data in the second training data set that have been smoothed, and the target frame labels of the training data in the second training data set, and uses a second learning rate to perform a second training on the backbone network and the classification branch network of the target detection model after the first training to obtain a trained target detection model, including: Performing enhancement processing on each training data in the second training data set to obtain enhanced data corresponding to each training data in the second training data set; The enhanced data corresponding to each training data in the second training data set is used as a training sample, and the output of the classification branch network of the target detection model after the first training is close to the target category label of each training data in the second training data set after label smoothing, and the output of the regression branch network of the target detection model after the first training is close to the target box label of each training data in the second training data set as a training target, and the second learning rate is used to perform a second training on the backbone network and the classification branch network of the target detection model after the first training to obtain a trained target detection model.
6. The method according to claim 1, characterized in that The target detection teacher model is trained as follows: Obtaining a target detection teacher model, wherein the target detection teacher model has the same structure as the target detection model; The target detection teacher model is trained using the first training data set to obtain a trained target detection teacher model.
7. The method according to claim 6, characterized in that The target detection teacher model includes a backbone network, a regression branch network, and a classification branch network. The target detection teacher model is trained using the first training data set to obtain a trained target detection teacher model, including: Taking the training data in the first training data set as training samples, taking the output of the classification branch network approaching the target category of each training data in the first training data set, and the output of the regression branch network approaching the target box of each training data in the first training data set as training targets, the target detection teacher model is trained to obtain a trained target detection teacher model.
8. A target detection model training device, characterized in that: The device comprises: An acquisition unit is used to acquire a first training data set, a second training data set and a target detection model, wherein the labels of the training data in the first training data set are manually annotated labels, and the labels include target box labels and target category labels; the training data in the second training data set is unlabeled data; a label prediction unit, configured to predict labels of training data in the second training data set based on a trained target detection teacher model, wherein the target detection teacher model has the same structure as the target detection model; A training unit, configured to train the target detection model using the first training data set, labels of the training data in the first training data set, the second training data set, and labels of the training data in the second training data set to obtain a trained target detection model; The training unit is specifically used to first train the target detection model using the first training data set and the labels of the training data in the first training data set to obtain the target detection model after the first training, and then train the target detection model after the first training again using the second training data set and the labels of the training data in the second training data set to obtain a trained target detection model.
9. A target detection model training device, characterized in that: including memory and processor; The memory is used to store programs; The processor is used to execute the program to implement each step of the target detection model training method as described in any one of claims 1 to 7.
10. A readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, each step of the target detection model training method as described in any one of claims 1 to 7 is implemented.