Active learning training method for object detection model based on teacher-student training framework
Through the active learning method based on the teacher-student training framework, weak supervision annotation and comprehensive loss values are used to adjust the detection model parameters, which solves the problem of insufficient accuracy and adaptability of the target detection model in different scenarios, and achieves efficient training and generalization. Enhance.
Patent Information
- Application Number
- CN202410217731.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-02-27
- Publication Date
- 2024-09-10
- Estimated Expiration
- 2044-02-27
AI Technical Summary
Existing target detection models have difficulty maintaining multi-target accuracy and high recall in different scenarios, and cannot respond quickly to the need to quickly adapt to changes in new camera scenarios, resulting in high manual annotation costs, low training efficiency, and prone to overfitting. question.
The active learning training method based on the teacher-student training framework is used to perform weak supervision annotation through the detection model to be optimized, screen candidate sample images, train the auxiliary detection model, and use the comprehensive loss value to adjust its parameters, update the parameters of the detection model to be optimized, and reduce manual labor. Mark time to improve training efficiency and avoid overfitting.
On the premise of ensuring recognition accuracy, it significantly reduces the cost of manual annotation, improves the training efficiency of the target detection model, quickly adapts to scene migration and diversity, avoids over-fitting, and enhances the generalization of the model.
Smart Images

Figure CN117975200B
Abstract
Description
Technical Field
[0001] The present application relates to the field of model training technology, and in particular to an active learning training method for a target detection model based on a teacher-student training framework. Background Art
[0002] Object detection is to accurately locate and classify all specific targets (such as people, vehicles, objects, etc.) in video images at the same time. It is often used in scenarios such as smart transportation, smart parks, and industrial production. In recent years, with the rapid development of AI+security, technologies related to object detection have been unprecedentedly applied and innovative. However, there are still many limitations and challenges, such as how to ensure the accuracy and high recall of multiple targets in different scenarios, how to quickly adapt to changes and migrations in new camera scenes, etc.
[0003] At present, the common practice is to manually annotate a large number of real-life images of the target scene in order to mark the target boxes of each target to be identified in the real-life image, and to iteratively train the model so that the model is suitable for target detection in different scenarios, thereby ensuring the accuracy and high recall of the recognition results. This method requires a lot of time and manpower costs and cannot quickly respond to the diverse needs of actual scenarios. Summary of the invention
[0004] In view of this, the purpose of the present application is to provide an active learning training method for a target detection model based on a teacher-student training framework, which can make use of the detection model to be optimized, by determining the optimized detection results of the candidate sample images, and using a weak supervision method to assist the user in actively learning the candidate sample images, and using the auxiliary detection model to update the model parameters of the detection model to be optimized. In this way, the target detection model trained through the teacher-student training framework can effectively reduce the time cost of manual labeling, and can also improve the training efficiency of the target detection model, quickly adapt to the migration and diversity of the scene, and can avoid overfitting of the target detection model, thereby ensuring the generalization of the target detection model.
[0005] The present application embodiment provides an active learning training method for an object detection model based on a teacher-student training framework, the training method comprising:
[0006] In response to a category labeling operation applied by a user, determining an image labeling category to which each candidate sample image extracted from the target detection scene belongs;
[0007] The recognition detection result of each candidate sample image is inferred by the detection model to be optimized; wherein the detection model to be optimized is the teacher model in the teacher-student training framework;
[0008] For each candidate sample image, optimizing the recognition detection result of the candidate sample image, and obtaining the optimized detection result of the candidate sample image by filtering out redundant detection frames in the recognition detection result;
[0009] Based on the recognition detection results and optimization detection results of each candidate sample image, a training sample image for training an auxiliary detection model is screened out from multiple candidate sample images; wherein the auxiliary detection model and the detection model to be optimized constitute a teacher-student training framework; the auxiliary detection model is a student model in the teacher-student training framework;
[0010] The auxiliary detection model is trained using a plurality of training sample images, and during the training process, the auxiliary model parameters of the auxiliary detection model are adjusted using a comprehensive loss value determined in combination with the image annotation category of each training sample image, so as to obtain an auxiliary detection model that completes training in each training cycle;
[0011] The auxiliary model parameters of the auxiliary detection model that has completed training in each training cycle are used to update the model parameters of the detection model to be optimized to obtain the target detection model.
[0012] In a possible implementation, for each candidate sample image, optimizing the recognition detection result of the candidate sample image, and filtering out redundant detection frames in the recognition detection result to obtain the optimized detection result of the candidate sample image, includes:
[0013] For each candidate sample image, multiple recognition detection frames in the recognition detection result of the candidate sample image are classified and processed, and the recognition detection frames used to mark the same target detection object are divided into the same recognition category group;
[0014] For each recognition category group, the redundant detection frames in the recognition category group are filtered out using the set confidence threshold and intersection-over-union ratio threshold to obtain a target detection frame for marking the target detection object;
[0015] Until the redundant detection frames in each recognition category group are filtered out, an optimized detection result of the candidate sample image is obtained based on the target detection frame used to mark each target detection object.
[0016] In a possible implementation, the step of selecting a training sample image for training an auxiliary detection model from a plurality of candidate sample images based on the recognition detection result and the optimization detection result of each candidate sample image includes:
[0017] Determine the image quality score of the candidate sample image based on the recognition detection result and the optimization detection result of the candidate sample image;
[0018] According to the image quality score of each candidate sample image, the multiple candidate sample images are arranged in descending order, and the candidate sample image located at a front preset position is determined as a training sample image for training the auxiliary detection model.
[0019] In a possible implementation manner, determining the image quality score of the candidate sample image based on the recognition detection result and the optimization detection result of the candidate sample image includes:
[0020] Determine a first image quality score of the candidate sample image by determining an average information entropy of a frame target confidence of each target detection frame in a recognition detection result of the candidate sample image;
[0021] Based on the optimized detection result of the candidate sample image, determine a second image quality score of the candidate sample image by determining the sum of box confidences of each recognition detection box in the candidate sample image;
[0022] The image quality score of the candidate sample image is determined by normalizing the first image quality score and the second image quality score respectively.
[0023] In a possible implementation manner, the comprehensive loss value is determined by the following steps:
[0024] By identifying whether there is a target detection object in each training sample image, the plurality of training sample images are divided into positive sample images and negative sample images;
[0025] For the positive sample image, determining, in an unsupervised manner, a first loss value generated by the auxiliary detection model in a process of training the auxiliary detection model using the positive sample image;
[0026] For the negative sample image, in a supervised manner, determining a second loss value generated by the auxiliary detection model in a process of training the auxiliary detection model using the negative sample image;
[0027] In combination with the preset balance coefficient, the comprehensive loss value generated by the auxiliary detection model during the training process is determined by combining the first loss value and the second loss value.
[0028] In a possible implementation, determining, in an unsupervised manner, a first loss value generated by the auxiliary detection model in a process of training the auxiliary detection model using the positive sample image includes:
[0029] Respectively comparing the box target confidence, box category confidence, and box confidence of each target detection box in the recognition detection result of the positive sample image with the confidence threshold, and determining a target loss function involved in the auxiliary detection model and satisfying the applicable conditions in the process of training the auxiliary detection model using the positive sample image;
[0030] Based on the sub-loss values of the auxiliary detection model under each objective loss function, a first loss value generated by the auxiliary detection model is determined.
[0031] In a possible implementation, the comparing the box target confidence, box category confidence, and box confidence of each target detection box in the recognition detection result of the positive sample image with the confidence threshold, and determining the target loss function involved in the auxiliary detection model and satisfying the applicable conditions in the process of training the auxiliary detection model using the positive sample image, includes:
[0032] When the box confidence is greater than the confidence threshold, determining that the target loss function includes a classification loss function; and / or,
[0033] When the box confidence is greater than the confidence threshold or the box target confidence is greater than the confidence threshold, determining that the target loss function includes a target box regression loss function; and / or,
[0034] When the box confidence is greater than a confidence threshold or the box category confidence is greater than a confidence threshold, it is determined that the target loss function includes a target loss function.
[0035] In a possible implementation, obtaining the target detection model by using the auxiliary model parameters of the auxiliary detection model trained in each training cycle and updating the model parameters of the detection model to be optimized includes:
[0036] Using the auxiliary model parameters of the auxiliary detection model trained in each training cycle, and adopting an exponential moving average algorithm, determine the target model parameters of the detection model to be optimized;
[0037] The target model parameters are used to update the model parameters of the detection model to be optimized to obtain a target detection model.
[0038] The present application also provides an active learning training device for a target detection model based on a teacher-student training framework, the training device comprising:
[0039] An image annotation module, configured to determine, in response to a category annotation operation imposed by a user, the image annotation category to which each candidate sample image extracted from the target detection scene belongs;
[0040] An inference module, used to infer the recognition detection result of each candidate sample image through the detection model to be optimized; wherein the detection model to be optimized is the teacher model in the teacher-student training framework;
[0041] An optimization module is used to optimize the recognition detection result of each candidate sample image, and obtain the optimized detection result of the candidate sample image by filtering out redundant detection frames in the recognition detection result;
[0042] An image screening module, used to screen out training sample images for training the auxiliary detection model from multiple candidate sample images based on the recognition detection results and optimization detection results of each candidate sample image; wherein the auxiliary detection model and the detection model to be optimized constitute a teacher-student training framework; the auxiliary detection model is a student model in the teacher-student training framework;
[0043] A model training module, used to train the auxiliary detection model using a plurality of training sample images, and to adjust auxiliary model parameters of the auxiliary detection model using a comprehensive loss value determined in combination with the image annotation category of each training sample image during the training process, so as to obtain an auxiliary detection model that completes training in each training cycle;
[0044] The parameter updating module is used to update the model parameters of the detection model to be optimized by using the auxiliary model parameters of the auxiliary detection model trained in each training cycle to obtain the target detection model.
[0045] In a possible implementation, when the optimization module is used to optimize the recognition detection result of each candidate sample image, and obtain the optimized detection result of the candidate sample image by filtering out redundant detection frames in the recognition detection result, the optimization module is used to:
[0046] For each candidate sample image, multiple recognition detection frames in the recognition detection result of the candidate sample image are classified and processed, and the recognition detection frames used to mark the same target detection object are divided into the same recognition category group;
[0047] For each recognition category group, the redundant detection frames in the recognition category group are filtered out using the set confidence threshold and intersection-over-union ratio threshold to obtain a target detection frame for marking the target detection object;
[0048] Until the redundant detection frames in each recognition category group are filtered out, an optimized detection result of the candidate sample image is obtained based on the target detection frame used to mark each target detection object.
[0049] In a possible implementation, when the image screening module is used to screen out training sample images for training the auxiliary detection model from multiple candidate sample images based on the recognition detection result and the optimization detection result of each candidate sample image, the image screening module is used to:
[0050] Determine the image quality score of the candidate sample image based on the recognition detection result and the optimization detection result of the candidate sample image;
[0051] According to the image quality score of each candidate sample image, the multiple candidate sample images are arranged in descending order, and the candidate sample image located at a front preset position is determined as a training sample image for training the auxiliary detection model.
[0052] In a possible implementation, when the image screening module is used to determine the image quality score of the candidate sample image based on the recognition detection result and the optimization detection result of the candidate sample image, the image screening module is used to:
[0053] Determine a first image quality score of the candidate sample image by determining an average information entropy of a frame target confidence of each target detection frame in a recognition detection result of the candidate sample image;
[0054] Based on the optimized detection result of the candidate sample image, determine a second image quality score of the candidate sample image by determining the sum of box confidences of each recognition detection box in the candidate sample image;
[0055] The image quality score of the candidate sample image is determined by normalizing the first image quality score and the second image quality score respectively.
[0056] In a possible implementation, the training device further includes a loss calculation module, and the loss calculation module is used to determine the comprehensive loss value through the following steps:
[0057] By identifying whether there is a target detection object in each training sample image, the plurality of training sample images are divided into positive sample images and negative sample images;
[0058] For the positive sample image, determining, in an unsupervised manner, a first loss value generated by the auxiliary detection model in a process of training the auxiliary detection model using the positive sample image;
[0059] For the negative sample image, in a supervised manner, determining a second loss value generated by the auxiliary detection model in a process of training the auxiliary detection model using the negative sample image;
[0060] In combination with the preset balance coefficient, the comprehensive loss value generated by the auxiliary detection model during the training process is determined by combining the first loss value and the second loss value.
[0061] In a possible implementation, when the loss calculation module is used to determine, in an unsupervised manner, a first loss value generated by the auxiliary detection model in a process of training the auxiliary detection model using the positive sample image, the loss calculation module is used to:
[0062] Respectively comparing the box target confidence, box category confidence, and box confidence of each target detection box in the recognition detection result of the positive sample image with the confidence threshold, and determining a target loss function involved in the auxiliary detection model and satisfying the applicable conditions in the process of training the auxiliary detection model using the positive sample image;
[0063] Based on the sub-loss values of the auxiliary detection model under each objective loss function, a first loss value generated by the auxiliary detection model is determined.
[0064] In a possible implementation, the loss calculation module is used to compare the box target confidence, box category confidence, and box confidence of each target detection box in the recognition detection result of the positive sample image with the confidence threshold, and determine the target loss function involved in the auxiliary detection model and meeting the applicable conditions in the process of training the auxiliary detection model using the positive sample image. The loss calculation module is used to:
[0065] When the box confidence is greater than the confidence threshold, determining that the target loss function includes a classification loss function; and / or,
[0066] When the box confidence is greater than the confidence threshold or the box target confidence is greater than the confidence threshold, determining that the target loss function includes a target box regression loss function; and / or,
[0067] When the box confidence is greater than a confidence threshold or the box category confidence is greater than a confidence threshold, it is determined that the target loss function includes a target loss function.
[0068] In a possible implementation, when the parameter updating module is used to obtain the target detection model by using the auxiliary model parameters of the auxiliary detection model trained in each training cycle to update the model parameters of the detection model to be optimized, the parameter updating module is used to:
[0069] Using the auxiliary model parameters of the auxiliary detection model trained in each training cycle, and adopting an exponential moving average algorithm, determine the target model parameters of the detection model to be optimized;
[0070] The target model parameters are used to update the model parameters of the detection model to be optimized to obtain a target detection model.
[0071] An embodiment of the present application also provides an electronic device, including: a processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor and the memory communicate through the bus, and when the machine-readable instructions are executed by the processor, the steps of the active learning training method of the target detection model based on the teacher-student training framework are performed as described above.
[0072] An embodiment of the present application also provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the steps of the active learning training method for the target detection model based on the teacher-student training framework as described above are executed.
[0073] The active learning training method of the target detection model based on the teacher-student training framework provided in the embodiment of the present application determines the image annotation category to which each candidate sample image extracted from the target detection scene belongs in response to the category labeling operation applied by the user; obtains the recognition detection result of each candidate sample image by inference through the detection model to be optimized; optimizes the recognition detection result of each candidate sample image, and obtains the optimized detection result of the candidate sample image by filtering out the redundant detection frames in the recognition detection result; based on the recognition detection result and the optimized detection result of each candidate sample image, selects training sample images for training the auxiliary detection model from multiple candidate sample images; trains the auxiliary detection model using multiple training sample images, and adjusts the auxiliary model parameters of the auxiliary detection model using the comprehensive loss value determined by combining the image annotation category of each training sample image during the training process to obtain the auxiliary detection model that completes the training in each training cycle; updates the model parameters of the detection model to be optimized using the auxiliary model parameters of the auxiliary detection model that completes the training in each training cycle to obtain the target detection model. In this way, under the premise of ensuring the recognition accuracy of the trained target detection model, the detection model to be optimized can be used to adopt a weak supervision method to assist the user in actively learning the target detection objects in the candidate sample images; it can be seen that the target detection model trained by the teacher-student training framework can effectively reduce the time cost of manual labeling, and can also improve the training efficiency of the target detection model, quickly adapt to the migration and diversity of the scene, and can avoid overfitting of the target detection model, thereby ensuring the generalization of the target detection model.
[0074] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, preferred embodiments are specifically cited below and described in detail with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0075] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0076] Figure 1 A flowchart of an active learning training method for an object detection model based on a teacher-student training framework provided in an embodiment of the present application;
[0077] Figure 2 A schematic diagram of the loss value calculation process provided in an embodiment of the present application;
[0078] Figure 3 A schematic diagram of the model training process provided in an embodiment of the present application;
[0079] Figure 4 A schematic diagram of the structure of an active learning training device for an object detection model based on a teacher-student training framework provided in an embodiment of the present application;
[0080] Figure 5 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0081] To make the purpose, technical scheme and advantages of the embodiments of the present application clearer, the technical scheme in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all of the embodiments. The components of the embodiments of the present application usually described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application claimed for protection, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, each other embodiment obtained by those skilled in the art without making creative work belongs to the scope of protection of the present application.
[0082] Research has found that, at present, the common practice is to manually annotate a large number of real-life images of the target scene in order to mark out the target boxes of each target to be identified in the real-life image, and to iteratively train the model so that the model is suitable for target detection in different scenarios, thereby ensuring the accuracy and high recall of the recognition results; this method requires a lot of time and manpower costs, and cannot quickly respond to the diverse needs of actual scenarios.
[0083] Based on this, an embodiment of the present application provides an active learning training method for a target detection model based on a teacher-student training framework. Under the premise of ensuring the recognition accuracy of the trained target detection model, the detection model to be optimized can be used to assist users in actively learning candidate sample images in a weakly supervised manner. In this way, the target detection model trained through the teacher-student training framework can effectively reduce the time cost of manual labeling, and can also improve the training efficiency of the target detection model, so as to quickly adapt to the migration, generalization and diversity of the detection scenarios, and can avoid overfitting.
[0084] See also Figure 1 , Figure 1 Flow chart of an active learning training method for a target detection model based on a teacher-student training framework provided in an embodiment of the present application. Figure 1 As shown in , the active learning training method of the target detection model provided in the embodiment of the present application includes:
[0085] S101 . In response to a category labeling operation performed by a user, determine the image labeling category to which each candidate sample image extracted from a target detection scenario belongs.
[0086] S102: Obtain recognition detection results for each candidate sample image by inferring the detection model to be optimized.
[0087] S103 . For each candidate sample image, optimizing the recognition detection result of the candidate sample image, and obtaining the optimized detection result of the candidate sample image by filtering out redundant detection frames in the recognition detection result.
[0088] S104: based on the recognition detection result and the optimization detection result of each candidate sample image, select training sample images for training the auxiliary detection model from the multiple candidate sample images.
[0089] S105. Use multiple training sample images to train the auxiliary detection model, and during the training process, use the comprehensive loss value determined by combining the image annotation category of each training sample image to adjust the auxiliary model parameters of the auxiliary detection model to obtain an auxiliary detection model that completes the training in each training cycle.
[0090] S106. Using the auxiliary model parameters of the auxiliary detection model that has completed training in each training cycle, the model parameters of the detection model to be optimized are updated to obtain a target detection model.
[0091] An active learning training method for a target detection model based on a teacher-student training framework is provided in an embodiment of the present application. The user only needs to roughly and weakly supervise the acquired candidate sample images (that is, the user only needs to mark the image annotation category of the candidate sample images). On this basis, by means of the detection model to be optimized, the target detection object in the candidate sample image is inferred to determine the recognition detection result of the candidate sample image. At the same time, combined with the optimized detection result of each candidate sample image, the candidate sample images are screened to determine the training sample images that are more suitable for training the auxiliary detection model, so as to optimize the training efficiency of the model. In the process, the comprehensive loss value determined by the image annotation category of each training sample image is combined to realize the precise adjustment of the auxiliary model parameters of the auxiliary detection model, so that the trained auxiliary detection model can be more suitable for recognizing the images collected in the target detection scenario in an active learning manner; and then the auxiliary model parameters of the auxiliary detection model trained in each training cycle are used to update the model parameters of the detection model to be optimized, so as to obtain a target detection model with higher recognition accuracy, so as to realize the adaptation of the target detection model to scene migration during use, which not only improves the training efficiency of the target detection model, but also improves the recognition accuracy of the target detection model.
[0092] Here, a camera device is set in the target detection scene to collect scene images in the target detection scene in real time. In order to obtain training sample images that can be used to train the detection model to be optimized and the auxiliary detection model, the scene images obtained by the camera device are sampled at preset time intervals (the preset time interval is greater than 5 seconds), and the number of samples taken at the same collection position shall not exceed 50.
[0093] In the field of model training, positive and negative samples are needed to realize iterative training of the model. However, the candidate sample images directly extracted do not make accurate distinction between positive and negative samples. Therefore, in order to enable the "model" to better "learn" to label images with target detection objects to be labeled and avoid labeling images without target detection objects during iterative training, users are required to label the candidate sample images to distinguish between positive and negative sample images in the candidate sample images by identifying whether there are target detection objects in the images.
[0094] In step S101, the user can apply a category labeling operation to each candidate sample image, so as to distinguish the candidate sample images into positive sample images and negative sample images by labeling the image labeling category of each candidate sample image; specifically, in response to the category labeling operation applied by the user to each candidate sample image, a weakly supervised method is used to determine the image labeling category to which each candidate sample image extracted from the target detection scenario belongs.
[0095] Among them, the image annotation categories include positive sample images and negative sample images.
[0096] Here, the model parameters of the detection model to be optimized are optimized, and two "detection models" with the same structure are constructed, so that the candidate sample images are inferred and labeled through the detection model to be optimized (i.e., the teacher model); then the auxiliary detection model (i.e., the student model) is trained using the training sample images screened out by the inference and labeled detection results; finally, the model parameters of the detection model to be optimized are reversely updated using the auxiliary model parameters of the auxiliary detection model to obtain the trained target detection model.
[0097] In step S102, the candidate sample images are input into the pre-trained detection model to be optimized, and the detection model to be optimized is used to infer each candidate sample image to determine the recognition detection result (D o ), assisting users to actively learn target detection objects in candidate sample images.
[0098] The detection model to be optimized is the teacher model in the teacher-student training framework; the recognition detection result (D o ) includes the coordinate information of each recognition detection box marked in the candidate sample image, the box target confidence p obj , box category confidence p cls And the box confidence p c ; The coordinate information includes the coordinates of the upper left corner and lower right corner of the detection box [x1, y1, x2, y2].
[0099] Here, when the detection model to be optimized is performing inference, a large number of recognition detection boxes will be marked in the candidate sample image, and there are a large number of redundant detection boxes in these recognition detection boxes; therefore, in order to avoid interference of redundant detection boxes in the model training process, before using the detection results for model training, the recognition detection results given by the detection model to be optimized need to be optimized.
[0100] In step S103, for the inferred and marked recognition detection results (D o ) (for example, a non-maximum suppression algorithm can be used), the recognition detection result (D o ) is optimized to filter out the redundant detection frames included in the recognition detection result, and the optimized detection result (D f ).
[0101] Here, there are multiple target detection objects that need to be identified in the candidate sample image (for example, there are both people and vehicles that need to be detected). In this case, the multiple recognition detection frames marked in the recognition detection results include multiple recognition detection frames for each target detection object. At this time, if redundant detection frames are to be filtered, it is necessary to filter the redundant detection frames used to mark the target detection objects separately.
[0102] In one implementation, step S103 includes:
[0103] S1031 . For each candidate sample image, classify multiple recognition detection frames in the recognition detection result of the candidate sample image, and classify the recognition detection frames used to mark the same target detection object into the same recognition category group.
[0104] S1032: For each recognition category group, use the set confidence threshold and intersection-over-union threshold to filter out redundant detection frames in the recognition category group to obtain a target detection frame for marking the target detection object.
[0105] In this step, for each recognition category group obtained by division, each recognition detection box result is compared with the set confidence threshold τ conf and intersection-over-union threshold τ iou Comparison is performed, redundant detection frames in the recognition category group are filtered out, and a target detection frame for marking the target detection object marked by the recognition category group is obtained.
[0106] In one implementation, step S1032 includes:
[0107] S10321. Filter out the recognition detection frames whose box confidences in the recognition category group are less than the confidence threshold to obtain the remaining detection frames.
[0108] In this step, the frame target confidence of each recognition detection frame under the category recognition group is used to filter out the recognition detection frames in the recognition category group whose frame target confidence is less than the confidence threshold as redundant detection frames, so as to preliminarily filter out the remaining detection frames.
[0109] S10322, arranging the remaining detection frames in descending order according to the box confidences; and determining the detection frame intersection-and-union ratios between the remaining detection frames adjacent to them one by one according to the arrangement order, if the detection frame intersection-and-union ratios between the adjacent remaining detection frames are higher than the intersection-and-union ratio threshold, filtering out the remaining detection frames with smaller box confidences among the adjacent remaining detection frames, and so on, to obtain the target detection frame for marking the target detection object.
[0110] In this step, the remaining detection frames obtained by preliminary filtering are arranged in descending order according to the box confidence to determine the arrangement order of each remaining detection frame; according to the determined arrangement order, the detection frame intersection and union ratios between the adjacent remaining detection frames are determined in turn;
[0111] If the detection frame IoU ratio between two adjacent remaining detection frames is higher than the IoU ratio threshold, the remaining detection frame with the smaller box confidence between the two adjacent remaining detection frames will be filtered out as a redundant detection frame, and so on, until each remaining detection frame has undergone secondary filtering, and a target detection frame for marking the target detection object is obtained.
[0112] S1033, until the redundant detection frames in each recognition category group are filtered out, an optimized detection result of the candidate sample image is obtained based on the target detection frame used to mark each target detection object.
[0113] In this step, the non-maximum suppression algorithm is used to filter out the redundant detection frames in each recognition category group one by one until all the redundant detection frames in all recognition category groups are filtered out. Based on the coordinate information of the target detection frame remaining in each recognition category group for marking the target detection object, the frame target confidence p obj , box category confidence p cls And the box confidence p c , generate the optimized detection result of the candidate sample image (D f ), thereby optimizing the recognition detection results by filtering out redundant detection frames in the recognition detection results.
[0114] Here, after determining the precise recognition result (i.e., optimized detection result) of the candidate sample image, the extracted candidate sample image can be secondary screened with the aid of the recognition detection result and the optimized detection result of the candidate sample image, so as to further screen out high-quality training sample images from the extracted candidate sample images.
[0115] In step S104, based on the recognition detection results and optimization detection results of each candidate sample image, by calculating the image quality score of each candidate sample image, high-quality training sample images that are more suitable for training the auxiliary detection model are screened out from multiple candidate sample images to avoid selecting low-quality training sample images and improve the efficiency of training the auxiliary detection model.
[0116] Among them, the auxiliary detection model and the detection model to be optimized constitute a teacher-student training framework; the auxiliary detection model is the student model in the teacher-student training framework.
[0117] In the teacher-student training framework, the teacher model (i.e., the detection model to be optimized) can teach the "knowledge" to the student model (i.e., the auxiliary detection model) in stages, which can better fit the student model, prevent overfitting, and ensure the training accuracy of the target detection model.
[0118] In one implementation, step S104 includes:
[0119] S1041. Determine an image quality score of the candidate sample image based on a recognition detection result and an optimization detection result of the candidate sample image.
[0120] In this step, for each candidate sample image, the recognition detection result and the optimization detection result of the candidate sample image are respectively used to calculate the first image quality score and the second image quality score of the candidate sample image to determine the image quality score of the candidate sample image.
[0121] In one implementation, step S1041 includes:
[0122] S10411. Determine a first image quality score of the candidate sample image by determining an average information entropy of a box target confidence of each target detection box in a recognition detection result of the candidate sample image.
[0123] In this step, considering that information entropy can be used to represent the value distribution of information, the recognition detection result of the candidate sample image can be used to determine the average information entropy of the frame target confidence of each target detection frame in the recognition detection result of the candidate sample image to reflect the information diversity of the recognition detection result of the optimized candidate sample image, thereby determining the first image score S for measuring the image quality of the candidate sample image. ei .
[0124] Specifically, the first image score of the candidate sample image is determined by the following formula:
[0125]
[0126] Among them, S ei is the first image quality score of the i-th candidate sample image, p obj is the confidence of the box target, τ conf is the preset confidence threshold, D o is the recognition detection result of the candidate sample image.
[0127] S10412. Based on the optimized detection result of the candidate sample image, determine the second image quality score of the candidate sample image by determining the sum of the box confidences of each recognition detection box in the candidate sample image.
[0128] In this step, considering that the frame confidence of the recognition detection frame is used to represent the prediction probability of the recognition detection frame, the optimized detection result of the candidate sample image can be used to determine the sum of the frame confidences of each recognition detection frame in the optimized detection result of the candidate sample image, and infer the amount of information contained in the optimized detection result of the marked candidate sample image, thereby determining the second image quality score Sif used to measure the image quality of the candidate sample image. i .
[0129] Specifically, the second image quality score of the candidate sample image is determined by the following formula:
[0130] Sifi i =∑p c , i∈D f ;
[0131] Among them, Sif i is the second image quality score of the i-th candidate sample image, p c is the box confidence of each recognition detection box in the candidate sample image, D f is the optimized detection result of the candidate sample image.
[0132] S10413. Determine the image quality score of the candidate sample image by normalizing the first image quality score and the second image quality score respectively.
[0133] The image quality score of the candidate sample image is determined by the following formula:
[0134] Sco i =norm(Se i )+norm(Sif i );
[0135] Among them, Sco i is the image quality score of the i-th candidate sample image, S ei is the first image quality score of the i-th candidate sample image, Sif i is the second image quality score of the i-th candidate sample image, and norm represents normalization processing.
[0136] Normalization is performed using the following formula:
[0137] norm(R i )=R i / R max ;
[0138] Among them, R maxIt represents the maximum value of R value among i candidate sample images, where R can be the first image quality score or the second image quality score.
[0139] S1042. Arrange the multiple candidate sample images in descending order according to the image quality score of each candidate sample image, and determine the candidate sample image located at a front preset position as a training sample image for training the auxiliary detection model.
[0140] In step S105, the auxiliary detection model is trained using the determined multiple training sample images with higher quality scores; and during the training process, the comprehensive loss value generated by the auxiliary detection model during the training process is determined in both the positive training sample and negative training sample directions in combination with the image annotation category of each training sample image; the comprehensive loss value of the auxiliary training model is used to accurately adjust the auxiliary model parameters of the auxiliary detection model, so as to train an auxiliary detection model with higher recognition accuracy.
[0141] In one embodiment, the comprehensive loss value is determined by the following steps:
[0142] Step a: by identifying whether there is a target detection object in each training sample image, the plurality of training sample images are divided into positive sample images and negative sample images.
[0143] In this step, by identifying whether a target detection object exists in each training sample image, multiple training sample images are classified to determine positive sample images and negative sample images from the multiple training sample images.
[0144] Here, considering that the training sample images for training the auxiliary detection model include positive sample images and negative sample images, in order to enable the trained auxiliary detection model to accurately identify the target detection objects in the positive sample images (training images with target detection objects) and avoid incorrect identification of the negative sample images (training images without target detection objects), the first loss value generated by training the auxiliary detection model with the positive sample images and the second loss value generated by training the auxiliary detection model with the negative sample images can be determined respectively, and the comprehensive loss value for adjusting the auxiliary model parameters of the auxiliary detection model can be determined by combining the first loss value and the second loss value.
[0145] Step b: for the positive sample image, determine, in an unsupervised manner, a first loss value generated by the auxiliary detection model in the process of training the auxiliary detection model using the positive sample image.
[0146] In this step, for the positive sample images included in the training sample images, when the auxiliary detection model is trained using the positive sample images, an unsupervised method is used to use the optimized detection results of the positive sample images to determine the first loss value L generated by the auxiliary detection model in the process of training the auxiliary detection model using the positive sample images. u .
[0147] In one embodiment, step b comprises:
[0148] Step b1, respectively compare the box target confidence, box category confidence and box confidence of each target detection box in the recognition detection result of the positive sample image with the confidence threshold, and determine the target loss function involved in the auxiliary detection model and meeting the applicable conditions in the process of training the auxiliary detection model using the positive sample image.
[0149] In this step, by comparing the box target confidence, box category confidence and box confidence of each target detection box in the recognition detection result of the positive sample image with the confidence threshold, the target loss function suitable for adjusting the parameters of the auxiliary detection model in the process of training the auxiliary detection model using the positive sample image is determined, so as to adjust the parameters of the auxiliary detection model with the help of the loss value determined by the target loss function.
[0150] In one embodiment, step b1 includes:
[0151] When the box confidence is greater than a confidence threshold, it is determined that the target loss function includes a classification loss function.
[0152] In this step, if the box confidence of the target detection box in the recognition detection result of the positive sample image is greater than the confidence threshold, the target loss function suitable for adjusting the parameters of the auxiliary detection model can be determined, including the classification loss function L cls .
[0153] And / or, when the box confidence is greater than a confidence threshold or the box target confidence is greater than a confidence threshold, it is determined that the target loss function includes a target box regression loss function.
[0154] In this step, if the box confidence of the target detection box is greater than the confidence threshold or the box target confidence is greater than the confidence threshold in the recognition detection result of the positive sample image, the target loss function suitable for adjusting the parameters of the auxiliary detection model can be determined, including the target box regression loss function L box .
[0155] And / or, when the box confidence is greater than a confidence threshold or the box category confidence is greater than a confidence threshold, it is determined that the target loss function includes a target loss function.
[0156] In this step, if the box confidence of the target detection box is greater than the confidence threshold or the box category confidence is greater than the confidence threshold in the recognition detection result of the positive sample image, the target loss function suitable for adjusting the parameters of the auxiliary detection model can be determined, including the target loss function L obj .
[0157] Step b2: determine the first loss value generated by the auxiliary detection model based on the sub-loss value of the auxiliary detection model under each target loss function.
[0158] Specifically, the first loss value L generated by the auxiliary detection model is determined by the following formula: u :
[0159]
[0160] in, It is expressed as an indicator function, which takes the value 1 when the condition is met; τ u is the confidence threshold, L cls Expressed as the classification loss function, L box Expressed as the target box regression loss function, L obj It is expressed as the target loss function.
[0161] Step c: for the negative sample image, using a supervised approach, determine a second loss value generated by the auxiliary detection model in the process of training the auxiliary detection model using the negative sample image.
[0162] In this step, for the negative sample images included in the training sample images, when the auxiliary detection model is trained using the negative sample images, a supervised method is used to determine the second loss value L generated by the auxiliary detection model in the process of training the auxiliary detection model using the negative sample images. s .
[0163] Here, when the training sample image is a negative sample image, the target loss function suitable for adjusting the parameters of the auxiliary detection model can be determined to include a classification loss function, a target box regression loss function, and a target loss function. Then, based on the sub-loss value of the auxiliary detection model under each target loss function, the second loss value generated by the auxiliary detection model is determined.
[0164] Specifically, the second loss value L generated by the auxiliary detection model is determined by the following formula: s :
[0165] L s =L cls +L obj +L box ;
[0166] Among them, L cls Expressed as the classification loss function, L box Expressed as the target box regression loss function, L obj It is expressed as the target loss function.
[0167] Step d: In combination with a preset balance coefficient, the comprehensive loss value generated by the auxiliary detection model during the training process is determined by combining the first loss value and the second loss value.
[0168] In this step, the comprehensive loss value L generated by the auxiliary detection model is determined by the following formula:
[0169] L=L s +λ*L u ;
[0170] Among them, λ is the balance coefficient, L s is the second loss value, L u is the first loss value.
[0171] See also Figure 2 , Figure 2 This is a schematic diagram of the loss value calculation process provided in the embodiment of the present application. Figure 2 As shown, step 201, using the training sample image to train the auxiliary detection model; step 202, determining the image identification category of the training sample image; when the image identification category is 1 (that is, the image identification category is a positive sample image), executing step 203; when the image identification category is 0 (that is, the image identification category is a negative sample image), executing step 207; step 203, using the recognition detection result of the training sample image, calculating the first loss value L generated by the auxiliary training model u Step 204: Utilize the box target confidence p in the recognition detection result of the training sample image obj and box confidence p c , calculate the first loss value L u The target box regression loss function L in box Step 205: Utilize the box category confidence p in the recognition detection result of the training sample image cls and box confidence p c , calculate the first loss value L u The objective loss function L in obj Step 206: Utilize the box confidence p in the recognition detection result of the training sample image c , calculate the first loss value L uThe classification loss function L in cls Step 207: Calculate the second loss value L generated by the auxiliary training model using the recognition detection result of the training sample image. s .
[0172] Here, when the auxiliary model parameters of the trained auxiliary detection model are determined, the auxiliary model parameters θ of the auxiliary detection model can be used to calculate the auxiliary model parameters θ of the auxiliary detection model. s , to update the model parameters of the detection model to be optimized.
[0173] In step S106, the model parameters of the detection model to be optimized are updated using the auxiliary model parameters of the auxiliary detection model trained in each training cycle, and then the target detection model is obtained, thereby optimizing the detection model to be optimized.
[0174] In one implementation, step S106 includes:
[0175] S1061, using the auxiliary model parameters of the auxiliary detection model trained in each training cycle, and using an exponential moving average algorithm to determine the target model parameter θ of the detection model to be optimized t .
[0176] In this step, the exponential moving average algorithm is used to determine the target model parameter θ of the detection model to be optimized by the following formula: t :
[0177] θ t ←α*θ t +(1-α)*θ s ;
[0178] Among them, θ t Represents the target model parameters of the detection model to be optimized, θ s is the auxiliary model parameter of the auxiliary detection model, and α is the smoothing coefficient.
[0179] S1062: Use the target model parameters to update the model parameters of the detection model to be optimized to obtain a target detection model.
[0180] Here, the detection model to be optimized that is finally updated is the trained target detection model.
[0181] See also Figure 3 , Figure 3 This is a schematic diagram of the model training process provided in the embodiment of the present application. Figure 3As shown, candidate sample images are obtained from the target detection scene; the candidate sample images are annotated; the candidate sample images are input in batches; the detection model to be optimized is used for inference; the recognition detection result of each candidate sample image is output; the candidate sample images are sorted and / or screened according to the image annotation category and the image quality score, and the training sample images are screened out; the auxiliary detection model is trained using the training sample images; and the model parameters of the detection model to be optimized are updated using the auxiliary model parameters of the auxiliary detection model.
[0182] The training method of the target detection model based on the teacher-student training framework provided in the embodiment of the present application determines the image annotation category to which each candidate sample image extracted from the target detection scene belongs in response to the category labeling operation applied by the user; obtains the recognition detection result of each candidate sample image by inference through the detection model to be optimized; optimizes the recognition detection result of each candidate sample image, and obtains the optimized detection result of the candidate sample image by filtering out the redundant detection frames in the recognition detection result; based on the recognition detection result and the optimized detection result of each candidate sample image, selects training sample images for training the auxiliary detection model from multiple candidate sample images; trains the auxiliary detection model using multiple training sample images, and adjusts the auxiliary model parameters of the auxiliary detection model using the comprehensive loss value determined by combining the image annotation category of each training sample image during the training process to obtain the auxiliary detection model that completes the training in each training cycle; updates the model parameters of the detection model to be optimized using the auxiliary model parameters of the auxiliary detection model that completes the training in each training cycle to obtain the target detection model. In this way, under the premise of ensuring the recognition accuracy of the trained target detection model, a weak supervision method can be used to assist users in actively learning the target detection objects in the candidate sample images; it can be seen that the target detection model trained through the teacher-student training framework can effectively reduce the time cost of manual labeling, and can also improve the training efficiency of the target detection model, while making the model agilely adaptable to different scenes or complex backgrounds, avoiding overfitting of the target detection model and ensuring the generalization of the target detection model.
[0183] See also Figure 4 , Figure 4 This is a schematic diagram of the structure of an active learning training device for a target detection model based on a teacher-student training framework provided in an embodiment of the present application. Figure 4 As shown in , the training device 400 includes:
[0184] An image annotation module 410 is used to determine the image annotation category to which each candidate sample image extracted from the target detection scene belongs in response to a category annotation operation applied by a user;
[0185] The reasoning module 420 is used to infer the recognition detection result of each candidate sample image through the detection model to be optimized; wherein the detection model to be optimized is the teacher model in the teacher-student training framework;
[0186] The optimization module 430 is used to optimize the recognition detection result of each candidate sample image, and obtain the optimized detection result of the candidate sample image by filtering out redundant detection frames in the recognition detection result;
[0187] An image screening module 440 is used to screen out training sample images for training the auxiliary detection model from multiple candidate sample images based on the recognition detection results and optimization detection results of each candidate sample image; wherein the auxiliary detection model and the detection model to be optimized constitute a teacher-student training framework; and the auxiliary detection model is a student model in the teacher-student training framework;
[0188] A model training module 450 is used to train the auxiliary detection model using a plurality of training sample images, and to adjust auxiliary model parameters of the auxiliary detection model using a comprehensive loss value determined in combination with the image annotation category of each training sample image during the training process, so as to obtain an auxiliary detection model that completes training in each training cycle;
[0189] The parameter updating module 460 is used to update the model parameters of the detection model to be optimized by using the auxiliary model parameters of the auxiliary detection model trained in each training cycle to obtain the target detection model.
[0190] Furthermore, when the optimization module 430 is used to optimize the recognition detection result of each candidate sample image, and obtain the optimized detection result of the candidate sample image by filtering out the redundant detection frames in the recognition detection result, the optimization module 430 is used to:
[0191] For each candidate sample image, multiple recognition detection frames in the recognition detection result of the candidate sample image are classified and processed, and the recognition detection frames used to mark the same target detection object are divided into the same recognition category group;
[0192] For each recognition category group, the redundant detection frames in the recognition category group are filtered out using the set confidence threshold and intersection-over-union ratio threshold to obtain a target detection frame for marking the target detection object;
[0193] Until the redundant detection frames in each recognition category group are filtered out, an optimized detection result of the candidate sample image is obtained based on the target detection frame used to mark each target detection object.
[0194] Furthermore, when the image screening module 440 is used to screen out training sample images for training the auxiliary detection model from multiple candidate sample images based on the recognition detection result and the optimization detection result of each candidate sample image, the image screening module 440 is used to:
[0195] Determine the image quality score of the candidate sample image based on the recognition detection result and the optimization detection result of the candidate sample image;
[0196] According to the image quality score of each candidate sample image, the multiple candidate sample images are arranged in descending order, and the candidate sample image located at a front preset position is determined as a training sample image for training the auxiliary detection model.
[0197] Furthermore, when the image screening module 440 is used to determine the image quality score of the candidate sample image based on the recognition detection result and the optimization detection result of the candidate sample image, the image screening module 440 is used to:
[0198] Determine a first image quality score of the candidate sample image by determining an average information entropy of a frame target confidence of each target detection frame in a recognition detection result of the candidate sample image;
[0199] Based on the optimized detection result of the candidate sample image, determine a second image quality score of the candidate sample image by determining the sum of box confidences of each recognition detection box in the candidate sample image;
[0200] The image quality score of the candidate sample image is determined by normalizing the first image quality score and the second image quality score respectively.
[0201] Furthermore, the training device 400 further includes a loss calculation module (not shown in the figure), which is used to determine the comprehensive loss value through the following steps:
[0202] By identifying whether there is a target detection object in each training sample image, the plurality of training sample images are divided into positive sample images and negative sample images;
[0203] For the positive sample image, determining, in an unsupervised manner, a first loss value generated by the auxiliary detection model in a process of training the auxiliary detection model using the positive sample image;
[0204] For the negative sample image, in a supervised manner, determining a second loss value generated by the auxiliary detection model in a process of training the auxiliary detection model using the negative sample image;
[0205] In combination with the preset balance coefficient, the comprehensive loss value generated by the auxiliary detection model during the training process is determined by combining the first loss value and the second loss value.
[0206] Furthermore, when the loss calculation module is used to determine, in an unsupervised manner, a first loss value generated by the auxiliary detection model in the process of training the auxiliary detection model using the positive sample image, the loss calculation module is used to:
[0207] Respectively comparing the box target confidence, box category confidence, and box confidence of each target detection box in the recognition detection result of the positive sample image with the confidence threshold, and determining a target loss function involved in the auxiliary detection model and satisfying the applicable conditions in the process of training the auxiliary detection model using the positive sample image;
[0208] Based on the sub-loss values of the auxiliary detection model under each objective loss function, a first loss value generated by the auxiliary detection model is determined.
[0209] Further, the loss calculation module is used to compare the box target confidence, box category confidence and box confidence of each target detection box in the recognition detection result of the positive sample image with the confidence threshold, and determine the target loss function involved in the auxiliary detection model and meeting the applicable conditions in the process of training the auxiliary detection model using the positive sample image. The loss calculation module is used to:
[0210] When the box confidence is greater than the confidence threshold, determining that the target loss function includes a classification loss function; and / or,
[0211] When the box confidence is greater than the confidence threshold or the box target confidence is greater than the confidence threshold, determining that the target loss function includes a target box regression loss function; and / or,
[0212] When the box confidence is greater than a confidence threshold or the box category confidence is greater than a confidence threshold, it is determined that the target loss function includes a target loss function.
[0213] Further, when the parameter updating module 460 is used to obtain the target detection model by adjusting the model parameters of the detection model to be optimized using the auxiliary model parameters of the auxiliary detection model trained in each training cycle, the parameter updating module 460 is used to:
[0214] Using the auxiliary model parameters of the auxiliary detection model trained in each training cycle, and adopting an exponential moving average algorithm, determine the target model parameters of the detection model to be optimized;
[0215] The target model parameters are used to update the model parameters of the detection model to be optimized to obtain a target detection model.
[0216] The training method, device, electronic device and storage medium of the target detection model based on the teacher-student training framework provided in the embodiments of the present application determine the image annotation category to which each candidate sample image extracted from the target detection scene belongs in response to the category labeling operation applied by the user; obtain the recognition detection result of each candidate sample image by inference through the detection model to be optimized; optimize the recognition detection result of each candidate sample image, and obtain the optimized detection result of the candidate sample image by filtering out the redundant detection frames in the recognition detection result; based on the recognition detection result and the optimized detection result of each candidate sample image, select the training sample images for training the auxiliary detection model from multiple candidate sample images; train the auxiliary detection model using multiple training sample images, and adjust the auxiliary model parameters of the auxiliary detection model using the comprehensive loss value determined by combining the image annotation category of each training sample image during the training process to obtain the auxiliary detection model that completes the training in each training cycle; update the model parameters of the detection model to be optimized using the auxiliary model parameters of the auxiliary detection model that completes the training in each training cycle to obtain the target detection model. In this way, under the premise of ensuring the recognition accuracy of the trained target detection model, the detection model to be optimized can be used to adopt a weak supervision method to assist the user in actively learning the target detection objects in the candidate sample images; it can be seen that the target detection model trained by the teacher-student training framework can effectively reduce the time cost of manual labeling, and can also improve the training efficiency of the target detection model, quickly adapt to the migration and diversity of the scene, and can avoid overfitting of the target detection model, thereby ensuring the generalization of the target detection model.
[0217] See also Figure 5 , Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Figure 5 As shown in , the electronic device 500 includes a processor 510 , a memory 520 and a bus 530 .
[0218] The memory 520 stores machine-readable instructions executable by the processor 510. When the electronic device 500 is running, the processor 510 communicates with the memory 520 via the bus 530. When the machine-readable instructions are executed by the processor 510, the above-mentioned Figure 1 The steps of the active learning training method of the target detection model based on the teacher-student training framework in the method embodiment shown, the specific implementation method can be found in the method embodiment, and will not be repeated here.
[0219] The present application also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the computer program can execute the above-mentioned Figure 1 The steps of the active learning training method of the target detection model based on the teacher-student training framework in the method embodiment shown, the specific implementation method can be found in the method embodiment, and will not be repeated here.
[0220] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0221] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, and the indirect coupling or communication connection of devices or units can be electrical, mechanical or other forms.
[0222] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0223] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0224] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a non-volatile computer-readable storage medium that is executable by a processor. Based on this understanding, the technical solution of the present application can essentially be embodied in the form of a software product, or in other words, the part that contributes to the prior art or the part of the technical solution. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0225] Finally, it should be noted that the above-described embodiments are only specific implementation methods of the present application, which are used to illustrate the technical solutions of the present application, rather than to limit them. The protection scope of the present application is not limited thereto. Although the present application is described in detail with reference to the above-mentioned embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the above-mentioned embodiments within the technical scope disclosed in the present application, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application, and should be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the protection scope of the claims.
Claims
1. An active learning training method for an object detection model based on a teacher-student training framework, characterized in that: The training method comprises: In response to a category labeling operation applied by a user, determining an image labeling category to which each candidate sample image extracted from the target detection scene belongs; wherein the image labeling category includes a positive sample image and a negative sample image; The recognition detection result of each candidate sample image is inferred by the detection model to be optimized; wherein the detection model to be optimized is the teacher model in the teacher-student training framework; For each candidate sample image, optimizing the recognition detection result of the candidate sample image, and obtaining the optimized detection result of the candidate sample image by filtering out redundant detection frames in the recognition detection result; Based on the recognition detection results and optimization detection results of each candidate sample image, a training sample image for training an auxiliary detection model is screened out from multiple candidate sample images; wherein the auxiliary detection model and the detection model to be optimized constitute a teacher-student training framework; the auxiliary detection model is a student model in the teacher-student training framework; The auxiliary detection model is trained using a plurality of training sample images, and during the training process, the auxiliary model parameters of the auxiliary detection model are adjusted using a comprehensive loss value determined in combination with the image annotation category of each training sample image, so as to obtain an auxiliary detection model that completes training in each training cycle; Using the auxiliary model parameters of the auxiliary detection model trained in each training cycle, the model parameters of the detection model to be optimized are updated to obtain a target detection model; The method of selecting a training sample image for training the auxiliary detection model from multiple candidate sample images based on the recognition detection result and the optimization detection result of each candidate sample image includes: For each candidate sample image, determine a first image quality score of the candidate sample image by determining an average information entropy of a frame target confidence of each target detection frame in a recognition detection result of the candidate sample image; Based on the optimized detection result of the candidate sample image, determine a second image quality score of the candidate sample image by determining the sum of box confidences of each recognition detection box in the candidate sample image; Determine the image quality score of the candidate sample image by normalizing the first image quality score and the second image quality score respectively; According to the image quality score of each candidate sample image, the multiple candidate sample images are arranged in descending order, and the candidate sample image located at a front preset position is determined as a training sample image for training the auxiliary detection model.
2. The training method according to claim 1, characterized in that: The step of optimizing the recognition detection result of each candidate sample image and filtering out redundant detection frames in the recognition detection result to obtain the optimized detection result of the candidate sample image includes: For each candidate sample image, multiple recognition detection frames in the recognition detection result of the candidate sample image are classified and processed, and the recognition detection frames used to mark the same target detection object are divided into the same recognition category group; For each recognition category group, the redundant detection frames in the recognition category group are filtered out using the set confidence threshold and intersection-over-union ratio threshold to obtain a target detection frame for marking the target detection object; Until the redundant detection frames in each recognition category group are filtered out, an optimized detection result of the candidate sample image is obtained based on the target detection frame used to mark each target detection object.
3. The training method according to claim 1, characterized in that: The comprehensive loss value is determined by the following steps: By identifying whether there is a target detection object in each training sample image, the plurality of training sample images are divided into positive sample images and negative sample images; For the positive sample image, determining, in an unsupervised manner, a first loss value generated by the auxiliary detection model in a process of training the auxiliary detection model using the positive sample image; For the negative sample image, in a supervised manner, determining a second loss value generated by the auxiliary detection model in a process of training the auxiliary detection model using the negative sample image; In combination with the preset balance coefficient, the comprehensive loss value generated by the auxiliary detection model during the training process is determined by combining the first loss value and the second loss value.
4. The training method according to claim 3, characterized in that: The step of determining, in an unsupervised manner, a first loss value generated by the auxiliary detection model in a process of training the auxiliary detection model using the positive sample image comprises: Respectively comparing the box target confidence, box category confidence, and box confidence of each target detection box in the recognition detection result of the positive sample image with the confidence threshold, and determining a target loss function involved in the auxiliary detection model and satisfying the applicable conditions in the process of training the auxiliary detection model using the positive sample image; Based on the sub-loss values of the auxiliary detection model under each objective loss function, a first loss value generated by the auxiliary detection model is determined.
5. The training method according to claim 4, characterized in that: The step of comparing the box target confidence, box category confidence, and box confidence of each target detection box in the recognition detection result of the positive sample image with the confidence threshold, and determining the target loss function involved in the auxiliary detection model and satisfying the applicable conditions in the process of training the auxiliary detection model using the positive sample image, comprises: When the box confidence is greater than the confidence threshold, determining that the target loss function includes a classification loss function; and / or, When the box confidence is greater than the confidence threshold or the box target confidence is greater than the confidence threshold, determining that the target loss function includes a target box regression loss function; and / or, When the box confidence is greater than a confidence threshold or the box category confidence is greater than a confidence threshold, it is determined that the target loss function includes a target loss function.
6. The training method according to claim 1, characterized in that: The method of using the auxiliary model parameters of the auxiliary detection model trained in each training cycle to update the model parameters of the detection model to be optimized to obtain the target detection model includes: Using the auxiliary model parameters of the auxiliary detection model trained in each training cycle, and adopting an exponential moving average algorithm, determine the target model parameters of the detection model to be optimized; The target model parameters are used to update the model parameters of the detection model to be optimized to obtain a target detection model.
7. An active learning training device for a target detection model based on a teacher-student training framework, characterized in that: The training device comprises: An image annotation module, configured to determine, in response to a category annotation operation applied by a user, an image annotation category to which each candidate sample image extracted from the target detection scene belongs; wherein the image annotation category includes a positive sample image and a negative sample image; An inference module, used to infer the recognition detection result of each candidate sample image through the detection model to be optimized; wherein the detection model to be optimized is the teacher model in the teacher-student training framework; An optimization module is used to optimize the recognition detection result of each candidate sample image, and obtain the optimized detection result of the candidate sample image by filtering out redundant detection frames in the recognition detection result; An image screening module, used to screen out training sample images for training the auxiliary detection model from multiple candidate sample images based on the recognition detection results and optimization detection results of each candidate sample image; wherein the auxiliary detection model and the detection model to be optimized constitute a teacher-student training framework; the auxiliary detection model is a student model in the teacher-student training framework; A model training module, used to train the auxiliary detection model using a plurality of training sample images, and to adjust auxiliary model parameters of the auxiliary detection model using a comprehensive loss value determined in combination with the image annotation category of each training sample image during the training process, so as to obtain an auxiliary detection model that completes training in each training cycle; A parameter updating module, used to update the model parameters of the detection model to be optimized by using the auxiliary model parameters of the auxiliary detection model trained in each training cycle to obtain a target detection model; Wherein, when the image screening module is used to screen out training sample images for training the auxiliary detection model from multiple candidate sample images based on the recognition detection result and the optimization detection result of each candidate sample image, the image screening module is used to: For each candidate sample image, determine a first image quality score of the candidate sample image by determining an average information entropy of a frame target confidence of each target detection frame in a recognition detection result of the candidate sample image; Based on the optimized detection result of the candidate sample image, determine a second image quality score of the candidate sample image by determining the sum of box confidences of each recognition detection box in the candidate sample image; Determining the image quality score of the candidate sample image by normalizing the first image quality score and the second image quality score respectively; According to the image quality score of each candidate sample image, the multiple candidate sample images are arranged in descending order, and the candidate sample image located at a front preset position is determined as a training sample image for training the auxiliary detection model.
8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by the processor, the steps of the active learning training method for the target detection model based on the teacher-student training framework as described in any one of claims 1 to 6 are executed.
Citation Information
Patent Citations
Model training method and device based on knowledge distillation, terminal and storage medium
CN115661563A
Diversified query active learning method and device for image classification
CN116028878A
Semi-supervised sea surface target detection method, system and device and storage medium
CN116385879A
3D target detection method and device, equipment and storage medium
CN116453109A
Fuzzy resistance semi-supervised defect detection method and device and storage medium
CN116883390A
