Object detection model training method and object detection method based on semi-supervised learning

By enhancing the unlabeled sample images and using the teacher network and student network to generate labels, and performing comparative learning to adjust the model parameters, the problems of slow training speed and low prediction performance of the target detection model in the existing technology are solved, and a more efficient Improved model training and prediction performance.

CN117635917BActive Publication Date: 2024-09-13BEIJING TELESOUND ELECTRONICS
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311619476.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-11-29
Publication Date
2024-09-13
Estimated Expiration
2043-11-29

AI Technical Summary

Technical Problem

Existing target detection model training methods based on supervised learning are slow to train under limited labeled image data, have low prediction performance, and cannot fully utilize the semantic information in low-confidence pseudo-labels.

Method used

By performing weak enhancement and strong enhancement processing on unlabeled sample images, the teacher network and student network are used to generate high-confidence and low-confidence prediction labels respectively, determine the positive sample and negative sample labels, and perform comparative learning to adjust model parameters.

Benefits of technology

It improves the training speed and prediction performance of the target detection model, reduces the consumption of computing resources, and makes full use of the information in low-confidence pseudo-labels.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117635917B
    Figure CN117635917B
Patent Text Reader

Abstract

The present invention provides a target detection model training method based on semi-supervised learning and a target detection method, comprising determining a first prediction label set based on each labeled sample image; determining multiple weakly enhanced images and multiple strongly enhanced images based on each unlabeled sample image; determining a second prediction label set based on multiple strongly enhanced images, and determining a third prediction label set based on multiple weakly enhanced images; determining a first confidence label set and a second confidence label set based on the second prediction label set; determining positive sample labels from the first confidence label set based on the prediction labels in the third prediction label set; and determining negative sample labels based on the second confidence label set; adjusting model parameters of an initial target detection model based on the first prediction label set, the third prediction label set, the second prediction label set, the positive sample labels, and the negative sample labels to obtain a target detection model. The present invention can improve the training speed of the target detection model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of image processing technology, and in particular to a target detection model training method and a target detection method based on semi-supervised learning. Background Art

[0002] Object detection is an important task in the field of computer vision, which aims to identify the location and category information of specific objects in images or videos. Object detection methods based on supervised learning use network models to train models on a large amount of labeled image data to achieve accurate identification and positioning of objects. In practical applications, object detection methods based on supervised learning have achieved great success and have been widely used in various computer vision tasks, such as autonomous driving, object recognition, face detection, etc.

[0003] Supervised learning-based methods require a large amount of labeled image data, but obtaining a large amount of labeled image data is expensive, time-consuming and laborious. How to improve the detection performance of the model in a limited labeled image data scenario is a research focus in the field of target detection. Therefore, target detection methods based on semi-supervised learning have emerged. Unlike supervised learning-based target detection methods, semi-supervised learning-based target detection methods use both labeled image data and unlabeled image data during model training. On the basis of reducing the requirements for sample image data, it can improve the detection performance and generalization ability of the target detection network. In semi-supervised learning, pseudo-label learning is usually used, that is, the model is used to obtain high-confidence pseudo-labels of unlabeled image data, and then these high-confidence pseudo-labels are used together with a small number of labeled sample images to train model parameters.

[0004] However, in the above method, low-confidence pseudo-labels are filtered by thresholds, which will result in that these pseudo-labels that consume a lot of resources to extract cannot be fully utilized, and these low-confidence pseudo-labels that are considered unreliable may also contain rich semantic information. Therefore, the above method will cause the training speed of the target detection model to be slow, and the trained target detection model will have low prediction performance when performing target detection. Summary of the invention

[0005] The present invention provides a target detection model training method and a target detection method based on semi-supervised learning, which are used to solve the defects in the prior art that the target detection model training speed is slow and the trained target detection model has low prediction performance when performing target detection, and achieve the purpose of improving the training speed of the target detection model and the prediction performance when performing target detection.

[0006] The present invention provides a target detection model training method based on semi-supervised learning, comprising:

[0007] Input a plurality of labeled sample images into the student network to obtain a first predicted label set;

[0008] Performing weak enhancement processing on a plurality of unlabeled sample images to obtain a plurality of weakly enhanced images, and performing strong enhancement processing on the plurality of unlabeled sample images to obtain a plurality of strongly enhanced images;

[0009] Inputting the multiple strongly enhanced images into the teacher network to obtain a second set of predicted labels, and inputting the multiple weakly enhanced images into the student network to obtain a third set of predicted labels;

[0010] Determine a first confidence label set based on prediction labels in the second prediction label set whose confidence is greater than a preset confidence, and determine a second confidence label set based on prediction labels in the second prediction label set whose confidence is less than or equal to the preset confidence;

[0011] Based on the predicted labels in the third predicted label set, determine the positive sample labels from the first confidence label set; and determine the negative sample labels based on the second confidence label set;

[0012] Determine loss information based on the first predicted label set, the third predicted label set, the second predicted label set, the positive sample label, and the negative sample label;

[0013] The model parameters of the initial target detection model are adjusted based on the loss information to obtain the target detection model.

[0014] According to a target detection model training method based on semi-supervised learning provided by the present invention, the positive sample label is determined from the first confidence label set based on the predicted label in the third predicted label set, including:

[0015] Determining the predicted target categories included in the predicted tags in the third predicted tag set;

[0016] The label in the first confidence label set that is the same as the predicted target category is determined as the positive sample label.

[0017] According to a target detection model training method based on semi-supervised learning provided by the present invention, determining the negative sample label based on the second confidence label set includes:

[0018] The label corresponding to the confidence level in the preset confidence range in the second confidence label set is determined as the negative sample label.

[0019] According to a target detection model training method based on semi-supervised learning provided by the present invention, the inputting of the plurality of labeled sample images into a student network to obtain a first prediction label set comprises:

[0020] Inputting the plurality of labeled sample images into the student network to obtain a first initial prediction label set output by the student network;

[0021] For the same frame of labeled sample image, when it is determined based on the first initial prediction label set that the number of first initial prediction labels corresponding to the labeled sample image is at least two, determining a first overlap area between target boxes included in at least two first initial prediction labels;

[0022] Determine at least two first target prediction labels corresponding to a first overlapping area larger than a preset area;

[0023] Among the at least two first target prediction labels, other first target prediction labels except the first target prediction label corresponding to the highest confidence are deleted to obtain the first prediction label set.

[0024] According to a target detection model training method based on semi-supervised learning provided by the present invention, the inputting of the multiple weakly enhanced images into the student network to obtain a third prediction label set includes:

[0025] Inputting the multiple weakly enhanced images into the student network to obtain a second initial prediction label set output by the student network;

[0026] For the same frame of weakly enhanced image, when it is determined based on the second initial prediction label set that the number of second initial prediction labels corresponding to the weakly enhanced image is at least two, determining a second overlap area between target boxes included in at least two second initial prediction labels;

[0027] Determine at least two second target prediction labels corresponding to a second overlapping area that is larger than a preset area;

[0028] Among the at least two second target prediction labels, other second target prediction labels except the second target prediction label corresponding to the highest confidence are deleted to obtain the third prediction label set.

[0029] According to a target detection model training method based on semi-supervised learning provided by the present invention, the first confidence label set is determined based on the prediction labels in the second prediction label set whose confidence is greater than a preset confidence, including:

[0030] Determining the predicted labels in the second predicted label set whose confidence is greater than a preset confidence as a first initial confidence label set;

[0031] For the same frame of strongly enhanced image, when it is determined based on the first initial confidence label set that the number of first initial confidence labels corresponding to the strongly enhanced image is at least two, determining a third overlap area between target boxes included in at least two first initial confidence labels;

[0032] Determine at least two first target confidence labels corresponding to a third overlapping area that is larger than a preset area;

[0033] Among the at least two first target confidence labels, other first target confidence labels except the first target confidence label corresponding to the highest confidence are deleted to obtain the first confidence label set.

[0034] According to a target detection model training method based on semi-supervised learning provided by the present invention, the second confidence label set is determined based on the prediction labels in the second prediction label set whose confidence is less than or equal to the preset confidence, including:

[0035] Determining the prediction labels in the second prediction label set whose confidence is less than or equal to the preset confidence as a second initial confidence label set;

[0036] For the same frame of weakly enhanced image, when it is determined based on the second initial confidence label set that the number of second initial confidence labels corresponding to the weakly enhanced image is at least two, determining a fourth overlap area between target boxes included in at least two second initial confidence labels;

[0037] Determine at least two second target confidence labels corresponding to a fourth overlapping area that is larger than a preset area;

[0038] Among the at least two second target confidence labels, other second target confidence labels except the second target confidence label corresponding to the highest confidence are deleted to obtain the second confidence label set.

[0039] According to a target detection model training method based on semi-supervised learning provided by the present invention, the method further includes:

[0040] Based on the multiple labeled sample images, training the initial student network to obtain the student network;

[0041] The model parameters of the student network are copied to the initial teacher network to obtain the teacher network, and the network structure of the initial student network is the same as the network structure of the initial teacher network.

[0042] According to a target detection model training method based on semi-supervised learning provided by the present invention, the loss information is determined based on the first prediction label set, the third prediction label set and the second prediction label set, the positive sample label and the negative sample label, including:

[0043] Determining a supervised loss based on the first predicted label set and the label information of the labeled sample image;

[0044] Determining an unsupervised loss based on the third set of predicted labels and the second set of predicted labels;

[0045] Determining a contrast loss based on the positive sample label and the negative sample label;

[0046] The loss information is determined based on the supervised loss, the unsupervised loss, and the contrastive loss.

[0047] The present invention also provides a target detection method, comprising:

[0048] Obtain an image to be recognized;

[0049] The image to be identified is input into a target detection model to obtain a detection result output by the target detection model, wherein the detection result includes a target box for representing the location of the target in the image to be identified, a target category, and a confidence level corresponding to the target category; the target detection model is trained based on any of the target detection model training methods based on semi-supervised learning as described above.

[0050] The present invention also provides a target detection model training device based on semi-supervised learning, comprising:

[0051] An input module, used for inputting a plurality of labeled sample images into a student network to obtain a first predicted label set;

[0052] A processing module, configured to perform weak enhancement processing on a plurality of unlabeled sample images to obtain a plurality of weakly enhanced images, and perform strong enhancement processing on the plurality of unlabeled sample images to obtain a plurality of strongly enhanced images;

[0053] The input module is further used to input the multiple strongly enhanced images into the teacher network to obtain a second prediction label set, and input the multiple weakly enhanced images into the student network to obtain a third prediction label set;

[0054] A determination module, configured to determine a first confidence label set based on prediction labels in the second prediction label set whose confidence is greater than a preset confidence, and to determine a second confidence label set based on prediction labels in the second prediction label set whose confidence is less than or equal to the preset confidence;

[0055] The determination module is further configured to determine a positive sample label from the first confidence label set based on the predicted label in the third predicted label set; and determine a negative sample label based on the second confidence label set;

[0056] The determination module is further used to determine loss information based on the first prediction label set, the third prediction label set and the second prediction label set, the positive sample label and the negative sample label;

[0057] An adjustment module is used to adjust the model parameters of the initial target detection model based on the loss information to obtain the target detection model.

[0058] The present invention also provides a target detection device, comprising:

[0059] An acquisition module, used for acquiring an image to be recognized;

[0060] An input module is used to input the image to be identified into a target detection model to obtain a detection result output by the target detection model, wherein the detection result includes a target box used to characterize the location of the target in the image to be identified, a target category, and a confidence level corresponding to the target category; the target detection model is trained based on any of the target detection model training methods based on semi-supervised learning as described above.

[0061] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, it implements any of the above-described target detection model training methods based on semi-supervised learning.

[0062] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements any of the above-described target detection model training methods based on semi-supervised learning.

[0063] The present invention also provides a computer program product, comprising a computer program, which, when executed by a processor, implements any of the above-mentioned target detection model training methods based on semi-supervised learning.

[0064] The target detection model training method and target detection method based on semi-supervised learning provided by the present invention perform weak enhancement processing on multiple unlabeled sample images to obtain multiple weakly enhanced images, and perform strong enhancement processing on multiple unlabeled sample images to obtain multiple strongly enhanced images, and then input the multiple strongly enhanced images into the teacher network to obtain a second prediction label set, and input the multiple weakly enhanced images into the student network to obtain a third prediction label set, and determine the first confidence label set based on the prediction labels with confidence greater than the preset confidence in the second prediction label set, and determine the second confidence label set based on the prediction labels with confidence less than or equal to the preset confidence in the second prediction label set. Afterwards, the positive sample label can be determined based on the determined high-confidence first confidence label set, and the negative sample label can be determined based on the determined low-confidence second confidence label set, so as to determine the loss information based on the first prediction label set, the third prediction label set and the second prediction label set, the positive sample label and the negative sample label obtained by using the labeled sample image, so as to adjust the model parameters of the initial target detection model and obtain the final target detection model. Since the above method can use the positive sample labels determined from the high-confidence label set and the negative sample labels determined from the low-confidence label set for comparative learning, the low-confidence prediction labels can be fully utilized, so that a large amount of computing resources do not need to be consumed to obtain high-confidence prediction labels, which can not only reduce computing resources but also improve the convergence speed during model training. In addition, since the information in the low-confidence prediction labels can be fully utilized, the prediction performance can be improved when the trained target detection model is used for target prediction. BRIEF DESCRIPTION OF THE DRAWINGS

[0065] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0066] Figure 1 A schematic diagram of a process flow of a target detection model training method based on semi-supervised learning provided by an embodiment of the present invention;

[0067] Figure 2 A schematic diagram of the overall process of a target detection model training method based on semi-supervised learning provided by an embodiment of the present invention;

[0068] Figure 3 A schematic diagram of a process flow of a target detection method based on semi-supervised learning provided by an embodiment of the present invention;

[0069] Figure 4is a schematic diagram of the structure of a target detection model training device based on semi-supervised learning provided by an embodiment of the present invention;

[0070] Figure 5 is a schematic diagram of the structure of a target detection device provided by an embodiment of the present invention;

[0071] Figure 6 An example physical structure diagram of an electronic device is provided. DETAILED DESCRIPTION

[0072] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0073] At present, when training the target detection model through semi-supervised learning, it is usually based on pseudo-label learning. The core idea of ​​this method is to obtain high-confidence pseudo-labels of unlabeled image data through the model, and then train the model parameters together with these high-confidence pseudo-labels and a small number of labeled sample images. The method based on pseudo-label learning can make full use of a large amount of unlabeled image data to expand the labeled image data set, thereby improving the detection performance and generalization ability of the model. At present, an initial target detection network is usually pre-trained with a small number of labeled sample images, and then the predicted probability and corresponding position information of the target in the unlabeled sample image are obtained through the initial target detection network. The position information with a predicted probability higher than the threshold is regarded as high-confidence position information, and vice versa. The high-confidence position information is retained, and this position information is used as pseudo-label information, and this pseudo-label information is used together with a small number of labeled sample images to optimize the model network parameters.

[0074] In the target detection method based on pseudo-label learning, since the low-confidence location information is filtered by threshold, this will result in that the location information extracted with a lot of resources cannot be fully utilized, and these low-confidence location information that is considered unreliable contains rich semantic information. Therefore, in the prior art, it is necessary to consume a lot of computing resources and time to obtain high-confidence pseudo-labels, resulting in a slow training speed of the target detection model, and since the semantic information in the low-confidence location information is not utilized, the trained target detection model will have low prediction performance when performing target detection.

[0075] In order to solve the above problems, an embodiment of the present invention proposes a target detection model training method based on semi-supervised learning. In this method, the unlabeled sample image is subjected to strong enhancement processing and weak enhancement processing respectively to obtain a strongly enhanced image and a weakly enhanced image, and the prediction label of the strongly enhanced image is obtained using a teacher network, and the high-confidence prediction label is used as the pseudo-label information of the unlabeled sample image, and semi-supervised learning is performed based on these pseudo-label information and the labeled sample image. In addition, the positive sample label is determined from the high-confidence prediction label, and the negative sample label is determined from the low-confidence prediction label. By comparing the positive sample label and the negative sample label, the model network parameters of the initial target detection model can be optimized. Since the low-confidence prediction label can be fully utilized in the above method, a large amount of computing resources do not need to be consumed to obtain the high-confidence prediction label, which can not only reduce the computing resources, but also improve the convergence speed during model training. In addition, since the information in the low-confidence prediction label can be fully utilized, the prediction performance can be improved when the trained target detection model is used for target prediction.

[0076] Combine the following Figures 1 to 3 The target detection model training method based on semi-supervised learning provided by an embodiment of the present invention is described. The execution subject of the method can be an electronic device such as a terminal, a computer or a server, or a specially designed intelligent device, or a target detection model training device based on semi-supervised learning set in an electronic device or an intelligent device, and the target detection model training device based on semi-supervised learning can be implemented by software, hardware or a combination of the two. Figure 1 A flow chart of a target detection model training method based on semi-supervised learning provided by an embodiment of the present invention is shown in FIG. Figure 1 As shown, the method includes:

[0077] Step 101: Input a plurality of labeled sample images into the student network to obtain a first predicted label set.

[0078] In this step, a sample image training set may be pre-constructed, wherein the sample image training set includes a first training subset containing a small number of labeled sample images. Among them, x i represents the i-th labeled sample image in the first training subset, y i represents the original label corresponding to the i-th labeled sample image, N lIndicates the total number of labeled sample images in the first training subset. Each labeled sample image in the first training subset has an original label. The original label is a target box for selecting the target to be tested and the category information of the target to be tested that is annotated in the labeled sample image by manual annotation. In addition, in the image training set, the proportion of labeled sample images in the first training subset can be between 20% and 30%.

[0079] The first training subset Each labeled sample image is input into the initialized (or parameter-updated) student network, and a first prediction label set is output, which includes the first prediction label of each labeled sample image, and the first prediction label includes the category information obtained by detecting the target to be detected in the labeled sample image Target frame location information and confidence information in, C represents the number of categories of the target to be tested, and R is a set including the confidence values ​​corresponding to each category.

[0080] Step 102: performing weak enhancement processing on a plurality of unlabeled sample images to obtain a plurality of weakly enhanced images, and performing strong enhancement processing on a plurality of unlabeled sample images to obtain a plurality of strongly enhanced images.

[0081] In this step, the sample image training set also includes a second training subset containing a large number of unlabeled sample images. Among them, x j represents the jth unlabeled sample image in the second training subset, N u Indicates the total number of unlabeled sample images in the second training subset. In addition, the proportion of unlabeled sample images and the proportion of labeled sample images can be complementary. For example, if the proportion of labeled sample images is 20%, the proportion of unlabeled sample images can be 80%.

[0082] For multiple unlabeled sample images, each unlabeled sample image can be subjected to strong enhancement processing operations such as cutout or cutmix to obtain a strong enhanced image. All the strong enhanced images form a strong enhanced training subset. Strong enhancement of unlabeled sample images is more helpful to increase the difference between positive and negative samples.

[0083] In addition, each unlabeled sample image can be subjected to a weak enhancement processing operation of rotation, flipping, color jittering, and adding Gaussian noise to obtain a weakly enhanced image. All weakly enhanced images form a weakly enhanced training subset. Weakly enhancing the unlabeled sample images helps to improve the similarity between positive samples.

[0084] Step 103: Input multiple strongly enhanced images into the teacher network to obtain a second set of predicted labels, and input multiple weakly enhanced images into the student network to obtain a third set of predicted labels.

[0085] In this step, the obtained strong enhancement training subset Each strongly enhanced image in the image is input into the teacher network, and the second prediction label set is obtained by inference detection. The second prediction label set includes the second prediction label of each strongly enhanced image, and the second prediction label includes the category information corresponding to the recommended area output after the target to be detected is detected in the strongly enhanced image. Target frame location information and confidence information After the above information is integrated, the feature representation is expressed as F using a multi-dimensional matrix. j,t ∈R D , where the feature representation is the output of the teacher network, represented by a multi-dimensional matrix, and D is the feature dimension.

[0086] In addition, the weakly enhanced training subset obtained by weak enhancement processing can be Each weakly enhanced image in the image is input into the student network, and a third prediction label set is obtained after inference detection by the student network. The third prediction label set includes the third prediction label of each weakly enhanced image, and the third prediction label includes the category information corresponding to the recommended area output after the target to be detected in the weakly enhanced image. Target frame location information and confidence information After the above information is integrated, the feature representation is expressed as F using a multi-dimensional matrix. j,s ∈R D , where the feature representation is the output of the student network, represented by a multi-dimensional matrix, and D is the feature dimension.

[0087] Step 104: Determine a first confidence label set based on prediction labels in the second prediction label set whose confidence is greater than a preset confidence, and determine a second confidence label set based on prediction labels in the second prediction label set whose confidence is less than or equal to the preset confidence.

[0088] In this step, based on the second predicted label set, the confidence information corresponding to each target box in the predicted label of each strongly enhanced image is determined. The confidence level is greater than the preset confidence level T h The recommended area corresponding to the predicted label is taken as the high confidence prediction result, and the first confidence label set is formed by statistics. Among them, the first confidence label set Includes the category information corresponding to the target to be tested Target frame location information and confidence information Set the confidence level to be less than or equal to the preset confidence level T h The recommended area corresponding to the predicted label is taken as the low confidence prediction result, and the second confidence label set is formed by statistics. Among them, the second confidence label set Includes the category information corresponding to the target to be tested Target frame location information and confidence information

[0089] The above-mentioned preset reliability can be set according to actual conditions or experience, for example, it can be set to between 0.3-0.4. The embodiment of the present invention does not limit the specific value of the preset reliability.

[0090] Step 105: Based on the predicted labels in the third predicted label set, determine the positive sample labels from the first confidence label set; and determine the negative sample labels based on the second confidence label set.

[0091] In this step, the predicted labels in the third predicted label set are constructed as anchor points. It should be noted that the anchor point serves as a reference sample for the calculation of positive and negative samples, and is used to compare and determine positive and negative samples. Based on the anchor point, the positive sample label is determined from the first confidence label set whose confidence is greater than the confidence threshold, and the negative sample label is determined from the second confidence label set whose confidence is less than or equal to the confidence threshold.

[0092] Step 106: Determine loss information based on the first prediction label set, the third prediction label set, the second prediction label set, the positive sample labels, and the negative sample labels.

[0093] Exemplarily, since the first prediction label set includes prediction labels obtained by predicting labeled sample images, the supervised loss can be determined based on each prediction label in the first prediction label set and the label information in the labeled sample image, and the unsupervised loss can be determined based on each prediction label in the third prediction label set. In addition, the contrast loss can be determined by performing comparative learning based on the positive sample label and the negative sample label. In this way, loss information can be determined based on the supervised loss, the unsupervised loss, and the contrast loss.

[0094] Step 107: Adjust the model parameters of the initial target detection model based on the loss information to obtain the target detection model.

[0095] In this step, after the loss information is determined, the model parameters of the initial target detection model can be adjusted based on the loss information, and the above steps are repeated until the trained model converges or the number of training times reaches a preset number. The final model is determined as the target detection model, wherein the target detection model is used to detect the target to be detected in the image to be identified.

[0096] The object detection model training method based on semi-supervised learning provided by the embodiment of the present invention performs weak enhancement processing on multiple unlabeled sample images to obtain multiple weakly enhanced images, and performs strong enhancement processing on multiple unlabeled sample images to obtain multiple strongly enhanced images, and then inputs the multiple strongly enhanced images into the teacher network to obtain a second prediction label set, and inputs the multiple weakly enhanced images into the student network to obtain a third prediction label set, and determines the first confidence label set based on the prediction labels with confidence greater than the preset confidence in the second prediction label set, and determines the second confidence label set based on the prediction labels with confidence less than or equal to the preset confidence in the second prediction label set. Afterwards, the positive sample label can be determined based on the determined high-confidence first confidence label set, and the negative sample label can be determined based on the determined low-confidence second confidence label set, so as to determine the loss information based on the first prediction label set, the third prediction label set and the second prediction label set, the positive sample label and the negative sample label obtained by using the labeled sample images, so as to adjust the model parameters of the initial object detection model and obtain the final object detection model. Since the above method can use the positive sample labels determined from the high-confidence label set and the negative sample labels determined from the low-confidence label set for comparative learning, the low-confidence prediction labels can be fully utilized, so that a large amount of computing resources do not need to be consumed to obtain high-confidence prediction labels, which can not only reduce computing resources but also improve the convergence speed during model training. In addition, since the information in the low-confidence prediction labels can be fully utilized, the prediction performance can be improved when the trained target detection model is used for target prediction.

[0097] Exemplarily, on the basis of the above embodiments, when determining the positive sample label from the first confidence label set based on the predicted label in the third predicted label set, the following method can be adopted: determine the predicted target category included in the predicted label in the third predicted label set, and determine the label in the first confidence label set that is the same as the predicted target category as the positive sample label.

[0098] Specifically, we can start from the first confidence label set In the example, the positive sample labels are filtered out with reference to the anchor points. The positive sample labels in this embodiment are filtered out with reference to the category information of the third predicted label corresponding to the anchor point. By determining the predicted target categories included in the predicted labels in the third predicted label set, the first confidence label set can be In the above, the predicted label of the same category as the predicted target category is determined as the positive sample label. For example, the category information corresponding to the predicted label in the third predicted label set is Select the predicted label of C as an anchor point and filter out the category information in the first confidence label set The predicted label of C is also used as the positive sample label.

[0099] In this embodiment, the predicted target category included in the predicted labels in the third predicted label set can be determined, and the predicted labels with the same predicted target category can be determined from the high-confidence first confidence label set, and these labels can be determined as positive sample labels. By selecting the positive sample labels by using the predicted labels in the third predicted label set as anchor points, the method of determining the positive sample labels is simple and efficient.

[0100] Exemplarily, when determining negative sample labels based on the second confidence label set, labels corresponding to confidences within a preset confidence range in the second confidence label set may be determined as negative sample labels.

[0101] Specifically, the second confidence label set with low confidence can be Select high confidence negative sample labels N c , such as determining the label corresponding to the confidence within the preset confidence range in the second confidence label set as the negative sample label.

[0102] Specifically, we can first obtain the second confidence label set In the process of batch rapid screening, that is, preliminary screening, you can set the lower threshold T l and the upper threshold T h , and then from the second confidence label set Select the confidence level at the lower threshold T l and the upper threshold T h The predicted label between, where the lower threshold T l For example, it can be 0.02, and the upper threshold T h For example, it can be 0.1. If the number of prediction labels selected by the above method is less than or equal to the number of preset negative sample labels, the above selected prediction labels are used as negative sample labels. If the number of prediction labels selected by the above method is greater than the number of preset negative sample labels, it is necessary to further screen from the selected prediction labels. Specifically, the above selected prediction labels can be sorted in order of confidence from large to small or from small to large to obtain a new set O(j,c), and a new threshold lower limit R is set.l and the new upper threshold R h , and then select from the new set O(j,c) the confidence level within the new threshold lower limit R l and the new upper threshold R h The predicted labels between, where the new lower threshold R l For example, it can be 0.03, and the new upper threshold R h For example, it can be 0.08. l and the new upper threshold R h The predicted labels between are used as negative sample labels.

[0103] For example, the negative sample label N can be selected by the following formula c :

[0104]

[0105] in, is the feature representation, express The confidence level meets the lower threshold T l and the upper threshold T h The conditions between 1(R l <O(j,c)<R h ) indicates that the confidence of the predicted label in O(j,c) satisfies the new lower threshold R l and the new upper threshold R h The conditions between.

[0106] It should be understood that the second confidence label set In the example, the confidence information is sorted and the sorted confidence information values ​​are placed in R l and R h The labels in between are determined as negative sample labels.

[0107] Among them, the above-mentioned preset confidence range can be set according to actual conditions or experience. For example, the upper limit of the preset confidence range can be determined as the maximum confidence corresponding to the label in the second confidence label set, and the lower limit can be set to the median value of the confidence corresponding to the label in the second confidence label set, or it can be set based on the number of negative sample labels, etc.

[0108] In this embodiment, the labels corresponding to the confidence levels within the preset confidence range in the second confidence label set can be determined as negative sample labels. Since a portion of labels can be selected from the second confidence label set with low confidence levels as negative sample labels to train the initial target detection model, the feature information in these negative sample labels can be fully utilized, thereby improving the performance and robustness of the target detection model.

[0109] Exemplarily, when multiple labeled sample images are input into the student network to obtain a first prediction label set, multiple labeled sample images can be input into the student network to obtain a first initial prediction label set output by the student network. For the same frame of labeled sample images, when the number of first initial prediction labels corresponding to the labeled sample images is determined to be at least two based on the first initial prediction label set, a first overlapping area between target boxes included in at least two first initial prediction labels is determined, at least two first target prediction labels corresponding to the first overlapping area greater than a preset area are determined, and among the at least two first target prediction labels, other first target prediction labels except the first target prediction label corresponding to the highest confidence are deleted to obtain a first prediction label set.

[0110] Specifically, after a plurality of labeled sample images are input into the student network, the student network can perform target detection on the labeled sample images, thereby obtaining a first initial prediction label corresponding to each target in each labeled sample image, and forming a first initial prediction label set.

[0111] Furthermore, in the embodiment of the present invention, a non-maximum suppression algorithm (NMS) is used to perform redundancy processing on all first initial prediction labels in the first initial prediction label set in the form of sub-units, that is, to remove the first initial prediction labels corresponding to the redundant target frames. Specifically, since the first initial prediction label set includes the first initial prediction label corresponding to each target in each frame of the labeled sample image, for the same frame of the labeled sample image, if the number of the first initial prediction labels in the labeled sample image is determined to be at least two from the first initial prediction label set, the first overlap area between the target frames included in the at least two first initial prediction labels can be determined. When the first overlap area corresponding to the target frame in at least two first target prediction labels is greater than the preset area, it means that the at least two first target prediction labels may correspond to the same target, therefore, the first target prediction label with the highest confidence in at least two first target prediction labels can be retained, and the other first target prediction labels except the first target prediction label with the highest confidence can be deleted, so as to achieve the purpose of label deduplication, thereby obtaining the first prediction label set after deduplication.

[0112] For example, all the first initial prediction labels from the same frame of labeled sample images can be taken as a unit. After the target to be detected is performed on a frame of labeled sample images, there may be multiple suggested areas, that is, multiple first initial prediction labels appear, and then multiple target frames appear. By determining the first overlap area between these target frames, and judging whether there are at least two first target frames whose first overlap area is greater than the preset area. Among them, the preset area can be 90%, for example. Then, among all the target frames whose area overlap is higher than the preset area, the first target prediction label corresponding to the target frame with the highest confidence is retained, and the remaining target frames are used as redundant target frames, and the first initial prediction labels remaining after removing the corresponding first target prediction labels are used as image unit output results. In the same way as above, after traversing the first initial prediction labels corresponding to all the labeled sample images, all the image unit output results obtained are merged to form a first prediction label set, which corresponds to a part of the first initial prediction labels.

[0113] In this embodiment, by determining the first overlapping area between the target boxes included in at least two first initial prediction labels, and based on whether the first overlapping area is greater than a preset area, it is determined whether there are redundant first initial prediction labels in the first initial prediction label set. If there are redundant first initial prediction labels, the redundant first initial prediction labels are deleted, which can not only filter out more useful information, but also reduce the amount of calculation during subsequent model training, thereby saving system resources.

[0114] Exemplarily, when multiple weakly enhanced images are input into the student network to obtain a third prediction label set, multiple weakly enhanced images can be input into the student network to obtain a second initial prediction label set output by the student network. For the same frame of weakly enhanced image, when the number of second initial prediction labels corresponding to the weakly enhanced image is determined to be at least two based on the second initial prediction label set, the second overlapping area between the target boxes included in the at least two second initial prediction labels is determined, at least two second target prediction labels corresponding to the second overlapping area greater than a preset area are determined, and among the at least two second target prediction labels, other second target prediction labels except the second target prediction label corresponding to the highest confidence are deleted to obtain a third prediction label set.

[0115] Specifically, after a plurality of weakly enhanced images are input into the student network, the student network can perform target detection on the weakly enhanced images, so as to obtain a second initial predicted label corresponding to each target in each weakly enhanced image, and form a second initial predicted label set.

[0116] Furthermore, in an embodiment of the present invention, the non-maximum suppression algorithm NMS is used to perform redundancy processing on all second initial prediction labels in the second initial prediction label set in the form of sub-units, that is, to remove the second initial prediction labels corresponding to the redundant target frames. Specifically, since the second initial prediction label set includes the second initial prediction label corresponding to each target in each frame of the weakly enhanced image, for the same frame of the weakly enhanced image, if the number of the second initial prediction labels in the weakly enhanced image is determined to be at least two from the second initial prediction label set, the second overlap area between the target frames included in the at least two second initial prediction labels can be determined. When the second overlap area corresponding to the target frames in at least two second target prediction labels is greater than the preset area, it means that the at least two second target prediction labels may correspond to the same target, therefore, the second target prediction label with the highest confidence in at least two second target prediction labels can be retained, and the other second target prediction labels except the second target prediction label with the highest confidence can be deleted, so as to achieve the purpose of label deduplication, thereby obtaining the third prediction label set after deduplication.

[0117] For example, all the second initial prediction labels from the same frame of weakly enhanced image can be taken as a unit. After the target to be detected is performed on a frame of weakly enhanced image, there may be multiple suggested areas, that is, multiple second initial prediction labels appear, and then multiple target frames appear. By determining the second overlap area between these target frames, and judging whether there are at least two second target frames whose second overlap area is greater than the preset area. Among them, the preset area can be 90%, for example. Then, among all the target frames whose area overlap is higher than the preset area, the second target prediction label corresponding to the target frame with the highest confidence is retained, and the remaining target frames are used as redundant target frames, and the second initial prediction labels remaining after removing the corresponding second target prediction labels are used as image unit output results. In the same way as above, after traversing the second initial prediction labels corresponding to all weakly enhanced images, all the image unit output results obtained are merged to form a third prediction label set, which corresponds to a portion of the second initial prediction labels.

[0118] In this embodiment, by determining the second overlapping area between the target boxes included in at least two second initial prediction labels, and based on whether the second overlapping area is greater than a preset area, it is determined whether there are redundant second initial prediction labels in the second initial prediction label set. If there are redundant second initial prediction labels, the redundant second initial prediction labels are deleted, which can not only filter out more useful information, but also reduce the amount of calculation during subsequent model training, thereby saving system resources.

[0119] Exemplarily, when determining the first confidence label set based on the prediction labels in the second prediction label set whose confidence is greater than a preset confidence, the prediction labels in the second prediction label set whose confidence is greater than a preset confidence can be determined as the first initial confidence label set; for the same frame of strongly enhanced image, when the number of first initial confidence labels corresponding to the strongly enhanced image determined based on the first initial confidence label set is at least two, determine the third overlapping area between the target boxes included in the at least two first initial confidence labels; determine at least two first target confidence labels corresponding to the third overlapping area greater than the preset area, and delete the other first target confidence labels except the first target confidence label corresponding to the highest confidence among the at least two first target confidence labels to obtain the first confidence label set.

[0120] Specifically, a preset confidence level can be set, and a confidence level greater than the preset confidence level is considered high confidence, and a confidence level less than or equal to the preset confidence level is considered low confidence. In the second prediction tag set, prediction tags with a confidence level greater than the preset confidence level are selected to form the first initial confidence tag set.

[0121] Furthermore, in the embodiment of the present invention, the non-maximum suppression algorithm NMS is used to perform the first initial confidence label set All the first initial confidence labels in are processed in the form of sub-units, that is, the first initial confidence labels corresponding to the redundant target boxes are removed. Specifically, since the first initial confidence label set In the strong enhanced image, the first initial confidence label corresponding to each target in each frame is included. Therefore, for the same frame of strong enhanced image, if the first initial confidence label set When it is determined that the number of first initial confidence labels in the strongly enhanced image is at least two, the third overlap area between the target boxes included in the at least two first initial confidence labels can be determined. When the third overlap area corresponding to at least two first target confidence labels is greater than the preset area, it means that the at least two first target confidence labels may correspond to the same target. Therefore, the first target confidence label with the highest confidence among the at least two first target confidence labels can be retained, and the other first target confidence labels except the first target confidence label with the highest confidence can be deleted, so as to achieve the purpose of label deduplication, and thus the first confidence label set after deduplication can be obtained.

[0122] For example, all the first initial confidence labels from the same frame of strongly enhanced image can be taken as a unit. After the detection of the target to be measured, there may be multiple suggested areas in a frame of strongly enhanced image, that is, multiple first initial confidence labels appear, and then multiple target frames appear. By determining the third overlap area between these target frames, and judging whether there are at least two target frames whose third overlap area is greater than the preset area. Among them, the preset area can be 90%, for example. Then, among all the target frames whose area overlap is higher than the preset area, the first target confidence label corresponding to the target frame with the highest confidence is retained, and the remaining target frames are used as redundant target frames, and the first initial confidence labels remaining after removing the corresponding first target confidence labels are used as image unit output results. In the same way as above, after traversing the first initial confidence labels corresponding to all strongly enhanced images, all the image unit output results obtained are merged to form a first confidence label set, which corresponds to a portion of the first initial confidence labels.

[0123] In this embodiment, by determining the third overlapping area between the target boxes included in at least two first initial confidence labels, and based on whether the third overlapping area is greater than a preset area, it is determined whether there are redundant first initial confidence labels in the first initial confidence label set. If there are redundant first initial confidence labels, the redundant first initial confidence labels are deleted, which can not only filter out more useful information, but also reduce the amount of calculation during subsequent model training, thereby saving system resources.

[0124] Exemplarily, when determining the second confidence label set based on the prediction labels in the second prediction label set whose confidence is less than or equal to the preset confidence, the prediction labels in the second prediction label set whose confidence is less than or equal to the preset confidence can be determined as the second initial confidence label set; for the same frame of weakly enhanced image, when the number of second initial confidence labels corresponding to the weakly enhanced image is determined to be at least two based on the second initial confidence label set, determine the fourth overlapping area between the target frames included in the at least two second initial confidence labels; determine at least two second target confidence labels corresponding to the fourth overlapping area greater than the preset area; and delete the other second target confidence labels except the second target confidence label corresponding to the highest confidence among the at least two second target confidence labels to obtain the second confidence label set.

[0125] Specifically, in the second prediction tag set, prediction tags with a confidence less than or equal to a preset confidence are screened to form a second initial confidence tag set. Among them, the second initial confidence label set The confidence of the second initial confidence label in is considered to be low confidence.

[0126] Furthermore, in the embodiment of the present invention, the non-maximum suppression algorithm NMS is used to select the second initial confidence label set All the second initial confidence labels in are processed in the form of units, that is, the second initial confidence labels corresponding to the redundant target boxes are removed. Specifically, since the second initial confidence label set In the , including each frame of weakly enhanced image corresponding to each target of the second initial confidence label, therefore, for the same frame of weakly enhanced image, if from the second initial confidence label set When it is determined that the number of second initial confidence labels in the weakly enhanced image is at least two, the fourth overlap area between the target frames included in the at least two second initial confidence labels can be determined. When there are at least two second target confidence labels corresponding to a fourth overlap area greater than a preset area, it means that the at least two second target confidence labels may correspond to the same target. Therefore, the second target confidence label with the highest confidence among the at least two second target confidence labels can be retained, and the other second target confidence labels except the second target confidence label with the highest confidence can be deleted, so as to achieve the purpose of label deduplication, thereby obtaining a set of deduplicated second confidence labels.

[0127] For example, all the second initial confidence labels from the same frame of weakly enhanced image can be taken as a unit. After the detection of the target to be detected, there may be multiple suggested areas in each frame of weakly enhanced image, that is, multiple second initial confidence labels appear, and then multiple target frames appear. By determining the first overlap area between these target frames, and judging whether there are at least two target frames whose fourth overlap area is greater than the preset area. Among them, the preset area can be 90%, for example. Then, among all the target frames whose area overlap is higher than the preset area, the second target confidence label corresponding to the target frame with the highest confidence is retained, and the remaining target frames are used as redundant target frames, and the second initial confidence labels remaining after removing the corresponding second target confidence labels are used as image unit output results. In the same way as above, after traversing the second initial confidence labels corresponding to all weakly enhanced images, all the image unit output results obtained are merged to form a second confidence label set, which corresponds to a part of the second initial confidence labels.

[0128] In this embodiment, by determining the fourth overlapping area between the target boxes included in at least two second initial confidence labels, and based on whether the fourth overlapping area is greater than a preset area, it is determined whether there are redundant second initial confidence labels in the second initial confidence label set. If there are redundant second initial confidence labels, the redundant second initial confidence labels are deleted. This can not only screen out more useful information, but also reduce the amount of calculation during subsequent model training, thereby saving system resources.

[0129] Exemplarily, based on the above embodiments, the student network and teacher network mentioned in the above embodiments can be determined based on the following method:

[0130] Based on multiple labeled sample images, an initial student network is trained to obtain a student network, and the model parameters of the student network are copied to the initial teacher network to obtain a teacher network, wherein the network structure of the initial student network is the same as the network structure of the initial teacher network.

[0131] Specifically, an initial teacher network and an initial student network with the same structure can be constructed, and the initial teacher network and the initial student network together constitute an initial target detection model, so that after training the initial target detection model, a target detection model including a teacher network and a student network is obtained, which is used to identify the target to be tested in the image to be tested. All parameters of the initial teacher network and the initial student network are randomly assigned values ​​between 0 and 1 according to a normal distribution.

[0132] After obtaining the initial student network, multiple labeled sample images can be input into the initial student network to train the initial student network, thereby obtaining the student network. The model parameters of the student network are obtained, and the model parameters of the student network are copied one by one to the initial teacher network to initialize the parameters of the initial teacher network, thereby obtaining the teacher network.

[0133] In this embodiment, the target detection model includes a student network and a teacher network, which can reduce the size of the model without increasing the computational cost. In addition, after determining the student network based on multiple labeled sample images, the model parameters of the student network can be copied to the initial teacher network to obtain the teacher network, thereby simplifying the process of determining the teacher network parameters and improving the efficiency of determining the teacher network parameters.

[0134] Exemplarily, in the process of training the target detection model, the loss information can be determined based on the following methods: determining the supervised loss based on the first predicted label set and the label information of the labeled sample image; determining the unsupervised loss based on the third predicted label set and the second predicted label set; determining the contrast loss based on the positive sample label and the negative sample label; determining the loss information based on the supervised loss, the unsupervised loss and the contrast loss.

[0135] Specifically, the feature representation of the predicted label in the third predicted label set can be The feature representation F corresponding to the positive sample label P The feature representation F corresponding to the negative sample label N , calculate the contrast loss L c :

[0136]

[0137] Among them, N a and N n They represent the number of positive sample labels and the number of negative sample labels respectively, C represents the specific category of the category information of the positive sample label; τ represents the dimension coefficient, represents the feature representation of the i-th positive sample label, Represents the feature representation of the j-th negative sample label.

[0138] In addition, the predicted labels in the first predicted label set can be compared with the label information of the labeled sample image to obtain the classification loss and the regression loss, and the sum of the classification loss and the regression loss is determined as the supervised loss. Specifically, the classification loss L can be calculated based on the category and position information of the predicted target included in the predicted label in the first predicted label set. u,c and regression loss L u,r ; The classification loss is the cross entropy loss and the regression loss is the L2 loss.

[0139] Furthermore, the predicted labels in the third predicted label set can be compared with the predicted labels in the second predicted label set obtained by the teacher network to obtain the classification loss L u,c and regression loss L u,r , and the classification loss L u,c and the regression loss L u,r The sum is determined as the unsupervised loss, where the classification loss L u,c is the cross entropy loss, and the regression loss L u,r is the L2 loss.

[0140] The final loss information can be obtained by adding the above-determined contrast loss, supervised loss and unsupervised loss. In practical applications, after determining the final loss information, the model parameters of the student network can be optimized by back propagation. After the student network converges, the model parameters of the final student network are copied to the teacher network by exponential moving average (EMA), so that the final target detection model can be obtained.

[0141] In this embodiment, contrastive learning can be performed through positive sample labels and negative sample labels, so the information in the negative sample labels can be fully utilized, which not only improves the convergence speed during target detection model training, but also improves the discrimination performance and prediction performance during target detection. In addition, by determining the supervised loss, unsupervised loss and contrast loss together for training the target detection model, the accuracy of the target detection model can be improved.

[0142] The following describes the overall process of the target detection model training method based on semi-supervised learning provided by an embodiment of the present invention. Figure 2 The overall process diagram of the target detection model training method based on semi-supervised learning provided by the embodiment of the present invention is as follows: Figure 2 As shown, when conducting model training, a small number of labeled sample images can be used as the first training subset, and the first training subset can be input into the student network to obtain the first initial prediction label corresponding to each labeled sample image, thereby forming a first initial prediction label set. After the first initial prediction label set is deduplicated using a non-maximum suppression algorithm, a first prediction label set is obtained. The prediction labels in the first prediction label set are compared with the label information corresponding to each labeled sample image in the first training subset to obtain a supervised loss.

[0143] In addition, multiple unlabeled sample images are used as the second training subset, and each unlabeled sample image in the second training subset is weakly enhanced to obtain each weakly enhanced image, thereby forming a weakly enhanced training subset, and each unlabeled sample image in the second training subset is strongly enhanced to obtain each strongly enhanced image, thereby forming a strongly enhanced training subset.

[0144] In addition, after the initial student network is trained based on the labeled sample images in the first training subset to obtain the student network, the EMA algorithm can be used to copy the network parameters of the student network one by one to the initial teacher network to obtain the teacher network. Furthermore, each strongly enhanced image in the strongly enhanced training subset can be input into the teacher network to obtain a second set of prediction labels. In the second prediction label set, the prediction labels with a confidence greater than a preset confidence are determined as the first initial confidence label set, and the prediction labels with a confidence less than or equal to the preset confidence are determined as the second initial confidence label set. In order to reduce the redundancy of the prediction labels in the first initial confidence label set and the second initial confidence label set, a non-maximum suppression algorithm can be used to deduplicate the prediction labels in the first initial confidence label set and the second initial confidence label set, respectively, to obtain the first confidence label set and the second confidence label set.

[0145] In addition, the weakly enhanced images in the weakly enhanced training subset need to be input into the student network to obtain a second initial prediction label set, and the second initial prediction label set is deduplicated using a non-maximum suppression algorithm to obtain a third prediction label set.

[0146] Each prediction tag in the third prediction tag set is used as an anchor point, and prediction tags with the same category information as the prediction tags corresponding to the anchor points are determined from the first confidence tag set, and these prediction tags are determined as positive sample tags. In addition, prediction tags within a preset confidence range can be screened from the second confidence tag set, and these prediction tags are determined as negative sample tags.

[0147] Comparative learning is performed based on positive sample labels and negative sample labels, so that the comparative loss can be obtained. The unsupervised loss can be calculated by comparing each predicted label in the third predicted label set with each predicted label in the second predicted label set.

[0148] Furthermore, the sum of supervised loss, unsupervised loss and contrast loss can be used as the final loss information, and the model parameters of the student network can be updated by back propagation based on the loss information. Afterwards, the EMA algorithm can be used to copy the updated model parameters of the student network to the classroom network one by one, so as to obtain the final target detection model.

[0149] The embodiment of the present invention provides a method of performing weak enhancement processing on multiple unlabeled sample images to obtain multiple weakly enhanced images, and performing strong enhancement processing on multiple unlabeled sample images to obtain multiple strongly enhanced images, and then inputting the multiple strongly enhanced images into the teacher network to obtain a second prediction label set, and inputting the multiple weakly enhanced images into the student network to obtain a third prediction label set, and determining the first confidence label set based on the prediction labels in the second prediction label set whose confidence is greater than a preset confidence, and determining the second confidence label set based on the prediction labels in the second prediction label set whose confidence is less than or equal to the preset confidence. Afterwards, the positive sample label can be determined based on the determined high-confidence first confidence label set, and the negative sample label can be determined based on the determined low-confidence second confidence label set, so as to determine the loss information based on the first prediction label set, the third prediction label set, the second prediction label set, the positive sample label, and the negative sample label obtained by using the labeled sample images, so as to adjust the model parameters of the initial target detection model and obtain the final target detection model. Since the above method can use the positive sample labels determined from the high-confidence label set and the negative sample labels determined from the low-confidence label set for comparative learning, the low-confidence prediction labels can be fully utilized, so that a large amount of computing resources do not need to be consumed to obtain high-confidence prediction labels, which can not only reduce computing resources but also improve the convergence speed during model training. In addition, since the information in the low-confidence prediction labels can be fully utilized, the prediction performance can be improved when the trained target detection model is used for target prediction.

[0150] Figure 3 A flow chart of a target detection method based on semi-supervised learning provided by an embodiment of the present invention, the method comprising:

[0151] Step 301: Obtain an image to be recognized.

[0152] In this step, the image to be identified includes a target to be identified, wherein the target may include a pedestrian, a vehicle or other objects.

[0153] Step 302: Input the image to be identified into the target detection model to obtain the detection result output by the target detection model, which includes the target box used to characterize the location of the target in the image to be identified, the target category and the confidence corresponding to the target category.

[0154] The target detection model may be trained based on the method described in any of the aforementioned embodiments.

[0155] The target detection method based on semi-supervised learning provided by the embodiment of the present invention can obtain the detection result output by the target detection model by inputting the image to be identified into the target detection model. Since the information in the low-confidence prediction label is fully utilized when training the target detection model, the prediction performance can be improved when the trained target detection model is used for target prediction.

[0156] The target detection model training device based on semi-supervised learning provided by the present invention is described below. The target detection model training device based on semi-supervised learning described below and the target detection model training method based on semi-supervised learning described above can be referenced to each other.

[0157] Figure 4 is a schematic diagram of the structure of a target detection model training device based on semi-supervised learning provided by an embodiment of the present invention, referring to Figure 4 As shown, the target detection model training device 400 based on semi-supervised learning includes:

[0158] An input module 401 is used to input a plurality of labeled sample images into a student network to obtain a first predicted label set;

[0159] The processing module 402 is used to perform weak enhancement processing on the multiple unlabeled sample images to obtain multiple weakly enhanced images, and perform strong enhancement processing on the multiple unlabeled sample images to obtain multiple strongly enhanced images;

[0160] The input module 401 is further used to input the multiple strongly enhanced images into the teacher network to obtain a second prediction label set, and input the multiple weakly enhanced images into the student network to obtain a third prediction label set;

[0161] A determination module 403, configured to determine a first confidence label set based on prediction labels in the second prediction label set whose confidence is greater than a preset confidence, and determine a second confidence label set based on prediction labels in the second prediction label set whose confidence is less than or equal to the preset confidence;

[0162] The determination module 403 is further configured to determine a positive sample label from the first confidence label set based on the predicted label in the third predicted label set; and determine a negative sample label based on the second confidence label set;

[0163] The determination module 403 is further configured to determine loss information based on the first prediction label set, the third prediction label set, the second prediction label set, the positive sample label, and the negative sample label;

[0164] The adjustment module 404 is used to adjust the model parameters of the initial target detection model based on the loss information to obtain the target detection model.

[0165] In an exemplary embodiment, the determining module 403 is specifically configured to:

[0166] Determining the predicted target categories included in the predicted tags in the third predicted tag set;

[0167] The label in the first confidence label set that is the same as the predicted target category is determined as the positive sample label.

[0168] In an exemplary embodiment, the determining module 403 is specifically configured to:

[0169] The label corresponding to the confidence level in the preset confidence range in the second confidence label set is determined as the negative sample label.

[0170] In an exemplary embodiment, the input module 401 is specifically configured to:

[0171] Inputting the plurality of labeled sample images into the student network to obtain a first initial prediction label set output by the student network;

[0172] For the same frame of labeled sample image, when it is determined based on the first initial prediction label set that the number of first initial prediction labels corresponding to the labeled sample image is at least two, determining a first overlap area between target boxes included in at least two first initial prediction labels;

[0173] Determine at least two first target prediction labels corresponding to a first overlapping area larger than a preset area;

[0174] Among the at least two first target prediction labels, other first target prediction labels except the first target prediction label corresponding to the highest confidence are deleted to obtain the first prediction label set.

[0175] In an exemplary embodiment, the input module 401 is specifically configured to:

[0176] Inputting the multiple weakly enhanced images into the student network to obtain a second initial prediction label set output by the student network;

[0177] For the same frame of weakly enhanced image, when it is determined based on the second initial prediction label set that the number of second initial prediction labels corresponding to the weakly enhanced image is at least two, determining a second overlap area between target boxes included in at least two second initial prediction labels;

[0178] Determine at least two second target prediction labels corresponding to a second overlapping area that is larger than a preset area;

[0179] Among the at least two second target prediction labels, other second target prediction labels except the second target prediction label corresponding to the highest confidence are deleted to obtain the third prediction label set.

[0180] In an exemplary embodiment, the determining module 403 is specifically configured to:

[0181] Determining the predicted labels in the second predicted label set whose confidence is greater than a preset confidence as a first initial confidence label set;

[0182] For the same frame of strongly enhanced image, when it is determined based on the first initial confidence label set that the number of first initial confidence labels corresponding to the strongly enhanced image is at least two, determining a third overlap area between target boxes included in at least two first initial confidence labels;

[0183] Determine at least two first target confidence labels corresponding to a third overlapping area that is larger than a preset area;

[0184] Among the at least two first target confidence labels, other first target confidence labels except the first target confidence label corresponding to the highest confidence are deleted to obtain the first confidence label set.

[0185] In an exemplary embodiment, the determining module 403 is specifically configured to:

[0186] Determining the prediction labels in the second prediction label set whose confidence is less than or equal to the preset confidence as a second initial confidence label set;

[0187] For the same frame of weakly enhanced image, when it is determined based on the second initial confidence label set that the number of second initial confidence labels corresponding to the weakly enhanced image is at least two, determining a fourth overlap area between target boxes included in at least two second initial confidence labels;

[0188] Determine at least two second target confidence labels corresponding to a fourth overlapping area that is larger than a preset area;

[0189] Among the at least two second target confidence labels, other second target confidence labels except the second target confidence label corresponding to the highest confidence are deleted to obtain the second confidence label set.

[0190] In an exemplary embodiment, the apparatus further comprises: a training module and a replication module;

[0191] The training module is used to train the initial student network based on the multiple labeled sample images to obtain the student network;

[0192] The copy module is used to copy the model parameters of the student network to the initial teacher network to obtain the teacher network, and the network structure of the initial student network is the same as the network structure of the initial teacher network.

[0193] In an exemplary embodiment, the determining module 403 is specifically configured to:

[0194] Determining a supervised loss based on the first predicted label set and the label information of the labeled sample image;

[0195] Determining an unsupervised loss based on the third set of predicted labels and the second set of predicted labels;

[0196] Determining a contrast loss based on the positive sample label and the negative sample label;

[0197] The loss information is determined based on the supervised loss, the unsupervised loss, and the contrastive loss.

[0198] The device of this embodiment can be used to execute the method of any embodiment in the target detection model training method based on semi-supervised learning embodiment. Its specific implementation process and technical effects are similar to those in the target detection model training method based on semi-supervised learning embodiment. For details, please refer to the detailed introduction in the target detection model training method based on semi-supervised learning embodiment, which will not be repeated here.

[0199] Figure 5 is a schematic diagram of the structure of the target detection device provided by an embodiment of the present invention, referring to Figure 5 As shown, the target detection device 500 includes:

[0200] An acquisition module 501 is used to acquire an image to be recognized;

[0201] An input module 502 is used to input the image to be identified into a target detection model to obtain a detection result output by the target detection model, wherein the detection result includes a target box used to characterize the location of the target in the image to be identified, a target category, and a confidence level corresponding to the target category; the target detection model is trained based on a target detection model training method based on semi-supervised learning as described in any of the above embodiments.

[0202] The device of this embodiment can be used to execute the method of any embodiment in the target detection method side embodiment. Its specific implementation process and technical effects are similar to those in the target detection method side embodiment. For details, please refer to the detailed introduction in the target detection method side embodiment, which will not be repeated here.

[0203] Figure 6 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 6 As shown, the electronic device may include: a processor 610, a communication interface 620, a memory 630 and a communication bus 640, wherein the processor 610, the communication interface 620 and the memory 630 communicate with each other through the communication bus 640. The processor 610 may call the logic instructions in the memory 630 to execute the target detection model training method based on semi-supervised learning, the method comprising: inputting a plurality of labeled sample images into a student network to obtain a first prediction label set; performing weak enhancement processing on a plurality of unlabeled sample images to obtain a plurality of weakly enhanced images, and performing strong enhancement processing on the plurality of unlabeled sample images to obtain a plurality of strongly enhanced images; inputting the plurality of strongly enhanced images into a teacher network to obtain a second prediction label set, and inputting the plurality of weakly enhanced images into the student network to obtain a third prediction label set; based on the confidence level in the second prediction label set being greater than a preset confidence level, Determine a first confidence label set based on the predicted labels with a confidence less than or equal to the preset confidence in the second predicted label set, and determine a second confidence label set based on the predicted labels in the second predicted label set whose confidence is less than or equal to the preset confidence; determine positive sample labels from the first confidence label set based on the predicted labels in the third predicted label set; and determine negative sample labels based on the second confidence label set; determine loss information based on the first predicted label set, the third predicted label set and the second predicted label set, the positive sample labels and the negative sample labels; adjust the model parameters of the initial target detection model based on the loss information to obtain the target detection model.

[0204] The processor 610 can also call the logic instructions in the memory 630 to execute the target detection method, which includes: obtaining an image to be identified; inputting the image to be identified into a target detection model to obtain a detection result output by the target detection model, the detection result including a target box used to characterize the location of the target in the image to be identified, a target category and a confidence level corresponding to the target category; the target detection model is trained based on the target detection model training method based on semi-supervised learning as described in any of the above embodiments.

[0205] In addition, the logic instructions in the above-mentioned memory 630 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of 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 invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.

[0206] On the other hand, the present invention also provides a computer program product, which includes a computer program, which can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the target detection model training method based on semi-supervised learning provided by the above methods, and the method includes: inputting multiple labeled sample images into a student network to obtain a first prediction label set; performing weak enhancement processing on multiple unlabeled sample images to obtain multiple weakly enhanced images, and performing strong enhancement processing on the multiple unlabeled sample images to obtain multiple strongly enhanced images; inputting the multiple strongly enhanced images into a teacher network to obtain a second prediction label set, and inputting the multiple weakly enhanced images into the student network. Obtain a third prediction label set; determine a first confidence label set based on the prediction labels in the second prediction label set whose confidence is greater than a preset confidence, and determine a second confidence label set based on the prediction labels in the second prediction label set whose confidence is less than or equal to the preset confidence; determine positive sample labels from the first confidence label set based on the prediction labels in the third prediction label set; and determine negative sample labels based on the second confidence label set; determine loss information based on the first prediction label set, the third prediction label set and the second prediction label set, the positive sample labels and the negative sample labels; adjust model parameters of the initial target detection model based on the loss information to obtain the target detection model.

[0207] When the computer program is executed by the processor, the computer can execute the target detection method provided by the above methods, which method includes: obtaining an image to be identified; inputting the image to be identified into a target detection model to obtain a detection result output by the target detection model, wherein the detection result includes a target box for representing the location of the target in the image to be identified, a target category and a confidence level corresponding to the target category; the target detection model is trained based on the target detection model training method based on semi-supervised learning as described in any of the above embodiments.

[0208] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to execute the target detection model training method based on semi-supervised learning provided by the above-mentioned methods, the method comprising: inputting a plurality of labeled sample images into a student network to obtain a first prediction label set; performing weak enhancement processing on a plurality of unlabeled sample images to obtain a plurality of weakly enhanced images, and performing strong enhancement processing on the plurality of unlabeled sample images to obtain a plurality of strongly enhanced images; inputting the plurality of strongly enhanced images into a teacher network to obtain a second prediction label set, and inputting the plurality of weakly enhanced images into the student network to obtain a third prediction label set; based on the The first confidence label set is determined based on the prediction labels in the second prediction label set whose confidence is greater than the preset confidence, and the second confidence label set is determined based on the prediction labels in the second prediction label set whose confidence is less than or equal to the preset confidence; the positive sample labels are determined from the first confidence label set based on the prediction labels in the third prediction label set; and the negative sample labels are determined based on the second confidence label set; loss information is determined based on the first prediction label set, the third prediction label set and the second prediction label set, the positive sample labels and the negative sample labels; model parameters of the initial target detection model are adjusted based on the loss information to obtain the target detection model.

[0209] When the computer program is executed by the processor, it is implemented to execute the target detection method provided by the above methods, and the method includes: obtaining an image to be identified; inputting the image to be identified into a target detection model to obtain a detection result output by the target detection model, and the detection result includes a target box for representing the location of the target in the image to be identified, a target category and a confidence level corresponding to the target category; the target detection model is trained based on the target detection model training method based on semi-supervised learning as described in any of the above embodiments.

[0210] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.

[0211] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0212] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A target detection model training method based on semi-supervised learning, characterized in that: include: Input a plurality of labeled sample images into the student network to obtain a first predicted label set; Performing weak enhancement processing on a plurality of unlabeled sample images to obtain a plurality of weakly enhanced images, and performing strong enhancement processing on the plurality of unlabeled sample images to obtain a plurality of strongly enhanced images; Inputting the multiple strongly enhanced images into the teacher network to obtain a second set of predicted labels, and inputting the multiple weakly enhanced images into the student network to obtain a third set of predicted labels; Determine a first confidence label set based on prediction labels in the second prediction label set whose confidence is greater than a preset confidence, and determine a second confidence label set based on prediction labels in the second prediction label set whose confidence is less than or equal to the preset confidence; Based on the predicted labels in the third predicted label set, determining positive sample labels from the first confidence label set; And determining a negative sample label based on the second confidence label set; Determine loss information based on the first predicted label set, the third predicted label set, the second predicted label set, the positive sample label, and the negative sample label; Adjusting model parameters of an initial target detection model based on the loss information to obtain the target detection model; The step of inputting the plurality of weakly enhanced images into the student network to obtain a third set of predicted labels comprises: Inputting the multiple weakly enhanced images into the student network to obtain a second initial prediction label set output by the student network; For the same frame of weakly enhanced image, when it is determined based on the second initial prediction label set that the number of second initial prediction labels corresponding to the weakly enhanced image is at least two, determining a second overlap area between target boxes included in at least two second initial prediction labels; Determine at least two second target prediction labels corresponding to a second overlapping area that is larger than a preset area; Among the at least two second target prediction labels, other second target prediction labels except the second target prediction label corresponding to the highest confidence level are deleted to obtain the third prediction label set; The determining the loss information based on the first prediction label set, the third prediction label set, the second prediction label set, the positive sample label, and the negative sample label includes: Determining a supervised loss based on the first predicted label set and the label information of the labeled sample image; Determining an unsupervised loss based on the third set of predicted labels and the second set of predicted labels; Determining a contrast loss based on the positive sample label and the negative sample label; The loss information is determined based on the supervised loss, the unsupervised loss, and the contrastive loss.

2. The target detection model training method based on semi-supervised learning according to claim 1, characterized in that: The determining the positive sample label from the first confidence label set based on the predicted label in the third predicted label set includes: Determining the predicted target categories included in the predicted tags in the third predicted tag set; The label in the first confidence label set that is the same as the predicted target category is determined as the positive sample label.

3. The target detection model training method based on semi-supervised learning according to claim 1 is characterized in that: The determining the negative sample label based on the second confidence label set includes: The label corresponding to the confidence level in the preset confidence range in the second confidence label set is determined as the negative sample label.

4. The target detection model training method based on semi-supervised learning according to claim 1, characterized in that: The step of inputting the plurality of labeled sample images into a student network to obtain a first set of predicted labels comprises: Inputting the plurality of labeled sample images into the student network to obtain a first initial prediction label set output by the student network; For the same frame of labeled sample image, when it is determined based on the first initial prediction label set that the number of first initial prediction labels corresponding to the labeled sample image is at least two, determining a first overlap area between target boxes included in at least two first initial prediction labels; Determine at least two first target prediction labels corresponding to a first overlapping area larger than a preset area; Among the at least two first target prediction labels, other first target prediction labels except the first target prediction label corresponding to the highest confidence are deleted to obtain the first prediction label set.

5. The target detection model training method based on semi-supervised learning according to claim 1, characterized in that: The determining the first confidence label set based on the prediction labels in the second prediction label set whose confidence is greater than a preset confidence includes: Determining the predicted labels in the second predicted label set whose confidence is greater than a preset confidence as a first initial confidence label set; For the same frame of strongly enhanced image, when it is determined based on the first initial confidence label set that the number of first initial confidence labels corresponding to the strongly enhanced image is at least two, determining a third overlap area between target boxes included in at least two first initial confidence labels; Determine at least two first target confidence labels corresponding to a third overlapping area that is larger than a preset area; Among the at least two first target confidence labels, other first target confidence labels except the first target confidence label corresponding to the highest confidence are deleted to obtain the first confidence label set.

6. The target detection model training method based on semi-supervised learning according to claim 5, characterized in that: The determining the second confidence label set based on the prediction labels in the second prediction label set whose confidence is less than or equal to the preset confidence includes: Determining the prediction labels in the second prediction label set whose confidence is less than or equal to the preset confidence as a second initial confidence label set; For the same frame of weakly enhanced image, when it is determined based on the second initial confidence label set that the number of second initial confidence labels corresponding to the weakly enhanced image is at least two, determining a fourth overlap area between target boxes included in at least two second initial confidence labels; Determine at least two second target confidence labels corresponding to a fourth overlapping area that is larger than a preset area; Among the at least two second target confidence labels, other second target confidence labels except the second target confidence label corresponding to the highest confidence are deleted to obtain the second confidence label set.

7. The target detection model training method based on semi-supervised learning according to any one of claims 1 to 6, characterized in that: The method further comprises: Based on the multiple labeled sample images, training the initial student network to obtain the student network; The model parameters of the student network are copied to the initial teacher network to obtain the teacher network, and the network structure of the initial student network is the same as the network structure of the initial teacher network.

8. A target detection method, characterized in that: include: Obtain an image to be recognized; The image to be identified is input into a target detection model to obtain a detection result output by the target detection model, wherein the detection result includes a target box for representing the location of the target in the image to be identified, a target category, and a confidence level corresponding to the target category; the target detection model is trained based on the target detection model training method based on semi-supervised learning as described in any one of claims 1 to 7.