Training method of target detection model, target detection method and device

By introducing selection weights for unlabeled samples and a dynamic update mechanism during the training of the object detection model, the problem of imbalanced target quantity is solved, and the detection accuracy of the model is improved.

CN117011624BActive Publication Date: 2026-05-29MASHANG CONSUMER FINANCE CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
MASHANG CONSUMER FINANCE CO LTD
Filing Date
2022-04-26
Publication Date
2026-05-29

AI Technical Summary

Technical Problem

Existing object detection models suffer from low accuracy due to an imbalance in the number of targets of different categories during training. This imbalance leads to underfitting for targets with fewer targets and overfitting for targets with more targets.

Method used

By introducing selection weights for unlabeled samples, the model is dynamically selected and updated based on the current selection weights for training, ensuring that the model learns more rare targets and achieving self-balancing of the number of samples.

Benefits of technology

It improves the accuracy of the target detection model and avoids underfitting and overfitting problems caused by imbalance in the number of targets.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117011624B_ABST
    Figure CN117011624B_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide a target detection model training method, a target detection method and a device. The training method comprises: determining N target unlabeled samples for current model training according to the current selection weight of each unlabeled sample in a preset training set, N being an integer greater than 1; training an initial target detection model to be trained based on the target unlabeled samples and labeled samples to obtain a first target detection result of each target unlabeled sample; if it is determined that the current training result does not satisfy a preset training end condition and the current selection weight satisfies an update condition, updating the current selection weight according to the first target detection result, and determining the trained initial target detection model as an initial target detection model to be trained for next model training until the preset training end condition is satisfied, and a target detection model is obtained. Through the embodiments of the present application, the accuracy of the target detection model is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of artificial intelligence technology, and in particular to a training method for an object detection model, an object detection method, and an apparatus. Background Technology

[0002] With the continuous development of artificial intelligence technology, object detection models trained on these models are widely used in various scenarios for object detection in images, videos, and other data. In the training process of existing object detection models, training samples are typically randomly input into the model for each round of training. However, the training samples often exhibit an imbalance in the number of targets of different categories; for example, the number of "people" targets is often greater than the number of "sleds" targets. This causes the model to tend to identify the more numerous targets during training, ignoring the fewer targets, or even misidentifying the fewer targets as the more numerous targets. Ultimately, this results in underfitting for the fewer targets and overfitting for the more numerous targets. Therefore, object detection models trained using existing methods suffer from low object recognition accuracy. Summary of the Invention

[0003] The purpose of this application is to provide a training method for an object detection model, an object detection method, and an apparatus to improve the accuracy of the detection results of the object detection model.

[0004] To achieve the above technical solution, the embodiments of this application are implemented as follows:

[0005] In a first aspect, embodiments of this application provide a method for training an object detection model, comprising:

[0006] Based on the current selection weights of each unlabeled sample in the preset training set, determine the N target unlabeled samples for the current model training; where N is an integer greater than 1.

[0007] The initial target detection model to be trained is trained based on the unlabeled target samples and the labeled samples in the preset training set to obtain the trained initial target detection model and the first target detection result for each unlabeled target sample.

[0008] If the training result of the current model training does not meet the preset training termination condition and the current selection weights meet the update condition, then the current selection weights are updated according to the first target detection result, and the trained initial target detection model is determined as the initial target detection model to be trained in the next model training, until the preset training termination condition is met, and the target detection model is obtained; wherein, the updated selection weights are used to determine the target unlabeled samples for the next model training.

[0009] Secondly, embodiments of this application provide a target detection method, including:

[0010] Acquire the target image data to be detected;

[0011] The target image data is input into the target detection model for target detection processing to obtain the target detection result of the target image data; the target detection result includes the third probability of each target object in the target image data belonging to each preset category and the coordinate information of the reference box of each target object; the target detection model is trained by the target detection model training method provided in the first aspect above.

[0012] Thirdly, embodiments of this application provide a training apparatus for an object detection model, comprising:

[0013] The determination module is used to determine the N target unlabeled samples for the current model training based on the current selection weights of each unlabeled sample in the preset training set; where N is an integer greater than 1.

[0014] The training module is used to train the initial target detection model to be trained based on the target unlabeled sample and the labeled sample in the preset training set, so as to obtain the trained initial target detection model and the first target detection result of each target unlabeled sample.

[0015] An update module is configured to update the current selection weights based on the first target detection result if the training result of the current model training does not meet the preset training termination condition and the current selection weights meet the update condition, and determine the trained initial target detection model as the initial target detection model to be trained in the next model training, until the preset training termination condition is met, and obtain the target detection model; wherein, the updated selection weights are used to determine the target unlabeled samples for the next model training.

[0016] Fourthly, embodiments of this application provide a target detection device, comprising:

[0017] The acquisition module is used to acquire the target image data to be detected;

[0018] The detection module is used to input the target image data into the target detection model for target detection processing to obtain the target detection result of the target image data; the target detection result includes the third probability of each target object in the target image data belonging to each preset category and the coordinate information of the reference box of each target object; the target detection model is trained by the target detection model training method provided in the first aspect above.

[0019] Fifthly, embodiments of this application provide an electronic device, including:

[0020] A processor; and a memory arranged to store computer-executable instructions configured to be executed by the processor, the executable instructions including steps for performing a training method for the object detection model described in the first aspect above, or the executable instructions including steps for performing a target detection method described in the second aspect above.

[0021] In a sixth aspect, embodiments of this application provide a storage medium for storing computer-executable instructions that cause a computer to perform steps in the training method for the target detection model described in the first aspect, or cause the computer to perform steps in the target detection method described in the second aspect.

[0022] As can be seen, in this embodiment, N unlabeled target samples for the current model training are determined based on the current selection weights of each unlabeled sample in the preset training set; where N is an integer greater than 1; then, the current model training is performed on the initial target detection model to be trained based on the unlabeled target samples and the labeled samples in the preset training set, to obtain the trained initial target detection model and the first target detection result for each unlabeled target sample; finally, when it is determined that the training result of the current model training does not meet the preset training termination condition and the current selection weights meet the update condition, the current selection weights of each unlabeled sample are updated based on the first target detection result to determine the target unlabeled sample for the next model training; and the initial target detection model after the current training is determined as the initial target detection model to be trained for the next model training, until the preset training termination condition is met, and the target detection model is obtained. Therefore, before each model training iteration, N unlabeled target samples are determined based on their current selection weights, and the target detection model is trained on these samples. Furthermore, when the training result of the current iteration does not meet the preset training termination condition but the current selection weights meet the update condition, the current selection weights of each unlabeled sample are updated. This achieves timely updating of the selection weights of each unlabeled sample and targeted dynamic selection of samples during model training in corresponding iterations. This allows the model to input more samples with fewer detectable targets in the current model state, enabling the model to learn more samples containing rare targets and achieving self-balancing of the number of different target types. It avoids the problem of underfitting to targets with fewer targets and overfitting to targets with more targets due to an imbalance in the number of targets in the samples, thus improving the accuracy of the target detection model. Attached Figure Description

[0023] To more clearly illustrate the technical solutions in one or more embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0024] Figure 1 A schematic diagram of the first process of a training method for an object detection model provided in an embodiment of this application;

[0025] Figure 2 A second flowchart illustrating a training method for an object detection model provided in an embodiment of this application;

[0026] Figure 3 A schematic diagram illustrating a training method for an object detection model provided in an embodiment of this application;

[0027] Figure 4 A schematic diagram of a third method for training an object detection model provided in an embodiment of this application;

[0028] Figure 5 A schematic diagram illustrating the transformation of the first predicted probability set provided in an embodiment of this application;

[0029] Figure 6 This is a schematic diagram of the structure of the target detection model provided in the embodiments of this application;

[0030] Figure 7 A schematic diagram of the fourth process for training a target detection model provided in an embodiment of this application;

[0031] Figure 8 A schematic flowchart of a target detection method provided in an embodiment of this application;

[0032] Figure 9 A schematic diagram of the module composition of a training device for an object detection model provided in an embodiment of this application;

[0033] Figure 10 This is a schematic diagram of the module composition of a target detection device provided in an embodiment of this application;

[0034] Figure 11 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0035] To enable those skilled in the art to better understand the technical solutions in one or more embodiments of this application, the technical solutions in one or more embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of the embodiments. Based on one or more embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the protection scope of this document.

[0036] This application provides one or more embodiments of a training method for an object detection model, an image recognition method, and an apparatus. Currently, object detection based on image data is one of the typical image processing techniques in the field of image processing technology. To improve the accuracy of object detection, training a model using a large number of image samples to obtain an object detection model, and then using the object detection model to detect objects in the image data to be detected, has become the mainstream object detection method. Considering that in the training process of existing object detection models used for image data-based object detection, each image sample to be trained is usually randomly input into the model for each round of training. However, there is often an imbalance in the number of different types of targets in the image samples; for example, the number of targets "people" is often greater than the number of targets "sleds." This causes the model to tend to identify the larger number of targets during training, ignoring the smaller number of targets, or even misidentifying the smaller number of targets as the larger number of targets. Ultimately, this leads to underfitting the model for the smaller number of targets and overfitting the larger number of targets. In other words, the object detection models obtained by existing training methods for image data-based object detection processing have the problem of low object recognition accuracy. Based on this, the technical solution of this application introduces sample selection weights. Before each model training, N unlabeled target samples are determined for the current model training based on the current selection weights of each unlabeled sample. The current model training is then performed on the initial target detection model to be trained based on these unlabeled target samples and labeled samples in the preset training set. Furthermore, when the training result of the current model training does not meet the preset training termination condition and the current selection weights meet the update condition, the current selection weights of each unlabeled sample are updated. This achieves timely updating of the selection weights of each unlabeled sample and targeted dynamic selection of samples during corresponding rounds of model training. This allows the corresponding rounds of model training to input more samples with fewer detectable targets in the current model state, enabling the model to learn more samples containing rare targets and achieving self-balancing of the number of various targets. This avoids the problem of underfitting the model to targets with fewer targets and overfitting to targets with more targets due to an imbalance in the number of targets in the samples, thus improving the accuracy of the target detection model's detection results.

[0037] Specifically, Figure 1 This is a flowchart illustrating the training method of the target detection model provided in one or more embodiments of this application. Figure 1 The method described above can be executed by a training device for the object detection model, which can be located on a terminal device or a server. The terminal device can be a mobile phone, tablet, desktop computer, laptop, etc.; the server can be a standalone server or a server cluster consisting of multiple servers. For example... Figure 1 As shown, the method includes the following steps:

[0038] Step S102: Based on the current selection weights of each unlabeled sample in the preset training set, determine the N target unlabeled samples for the current model training; where N is an integer greater than 1.

[0039] Considering that acquiring a large number of labeled samples is usually time-consuming and difficult, and relies excessively on expert experience, while acquiring unlabeled samples is usually very easy and low-cost, and semi-supervised learning can effectively perform deep learning using a small number of labeled samples and a large number of unlabeled samples, this application embodiment uses a semi-supervised approach to train the object detection model to reduce the time and difficulty of sample acquisition, shorten the model training cycle, and improve the model training efficiency. That is, the preset training set in this application embodiment includes a first number of unlabeled samples and a second number of labeled samples, wherein the first number is greater than the second number. Each sample in the preset training set can be image data; that is, the unlabeled samples in the preset training set include image data (which can be called unlabeled image samples), and the labeled samples in the preset training set include image data (which can be called labeled image samples). Each unlabeled sample can be obtained from a specified unlabeled image library or obtained by extracting target frames from video data. Each labeled sample can be obtained by manual labeling or obtained from a specified labeled image library. This application does not specify the method for obtaining unlabeled and labeled samples; both methods can be set as needed in practical applications.

[0040] To enable targeted dynamic selection of unlabeled samples during model training, this embodiment introduces selection weights for unlabeled samples, with each unlabeled sample having a preset initial selection weight of 1. After all unlabeled samples in the preset training set have undergone one round of model training, the preset initial selection weights of each unlabeled sample are uniformly updated according to the preset selection weight update method. Subsequently, these uniformly updated selection weights are updated with each round of model training until the preset training termination condition is met. That is, the current selection weight in step S102 can be either the preset initial selection weight or the updated selection weight. A larger selection weight increases the probability that the corresponding unlabeled sample will be selected as the target unlabeled sample. The update process of the selection weights is described in detail below.

[0041] Step S104: Train the initial target detection model to be trained based on the determined unlabeled target samples and the labeled samples in the preset training set to obtain the trained initial target detection model and the first target detection result of each unlabeled target sample.

[0042] Understandably, each model training iteration is both a model learning process and a detection process for the input unlabeled target samples. Therefore, after training the initial target detection model based on the determined unlabeled target samples and labeled samples in the pre-set training set, we can obtain the trained initial target detection model and the first target detection result for each unlabeled target sample. The first target detection result can include a second predicted probability set for the unlabeled target samples and the coordinate information of each reference box in the unlabeled target samples. This coordinate information can be 4D coordinates. The second predicted probability set includes the second probability that each target object in the detected unlabeled target samples belongs to each pre-set category, with each target object corresponding to a reference box. The pre-set categories can be set as needed in practical applications, for example, they can include people, animals, plants, houses, vehicles, etc., and the target objects can be the elderly, cats, dogs, large trees, tall buildings, bicycles, etc.

[0043] As an example, there are 20 preset categories, including c1, c2...c 20 If the model detects three target objects d1, d2, and d3 in a certain unlabeled sample, then the second predicted probability set of the unlabeled sample includes the categories c1, c2, ..., c3 for target object d1. 20 The second probability is that the target object d2 belongs to each of the preset categories c1, c2...c 20 The second probability is that the target object d3 belongs to each of the preset categories c1, c2...c 20The second probability, that is, a total of 60 second probabilities; the target objects d1, d2 and d3 each correspond to a reference box; that is, the target detection result of the unlabeled sample of the target includes: a second predicted probability set consisting of 60 second probabilities and the coordinate information of 3 reference boxes.

[0044] Step S106: If the training result of the current model training does not meet the preset training termination condition and the current selection weights meet the update condition, then the current selection weights are updated according to the first target detection result, and the trained initial target detection model is determined as the initial target detection model to be trained in the next model training, until the preset training termination condition is met, and the target detection model is obtained; wherein, the updated selection weights are used to determine the target unlabeled samples for the next model training.

[0045] Specifically, after the current model training session ends, it is determined whether the training result of the current model training session meets the preset training termination condition. If the preset training termination condition is met, the trained initial object detection model is determined as the final object detection model, and training ends. If the preset training termination condition is not met, it is determined whether the current selection weights meet the update condition. If the current selection weights meet the update condition, the current selection weights are updated according to the object detection results, and the trained initial object detection model is determined as the initial object detection model to be trained in the next model training session. Furthermore, before the next model training session, the target unlabeled samples for the next model training session are determined according to the updated selection weights, that is, the updated selection weights are determined as the current selection weights for each unlabeled sample, and the process returns to step S102 until the preset training termination condition is met, resulting in the final object detection model. If the current selection weights do not meet the update condition, the process returns to step S102 to perform the next model training session.

[0046] The preset training termination conditions may include: the number of times the model is trained in the current iteration equals the total number of training iterations, or the preset loss function converges. To ensure the effectiveness of the selection weight update, in this embodiment, after each unlabeled sample has undergone one round of model training to obtain the first target detection result for each unlabeled sample, the current selection weights of each unlabeled sample are updated; that is, the update conditions for the current selection weights include: there are no candidate unlabeled samples in the preset training set that have not undergone model training.

[0047] In this embodiment, N unlabeled target samples are determined for the current model training based on the current selection weights of each unlabeled sample in the preset training set; where N is an integer greater than 1. Then, the current model training is performed on the initial target detection model to be trained based on the unlabeled target samples and the labeled samples in the preset training set, to obtain the trained initial target detection model and the first target detection result for each unlabeled target sample. Finally, when it is determined that the training result of the current model training does not meet the preset training termination condition and the current selection weights meet the update condition, the current selection weights of each unlabeled sample are updated according to the first target detection result to determine the target unlabeled samples for the next model training. The initial target detection model after the current training is determined as the initial target detection model to be trained for the next model training, until the preset training termination condition is met, and the target detection model is obtained. Therefore, before each model training iteration, N unlabeled target samples are determined based on their current selection weights, and the target detection model is trained on these samples. Furthermore, when the training result of the current iteration does not meet the preset training termination condition and the current selection weights meet the update condition, the current selection weights of each unlabeled sample are updated. This achieves timely updating of the selection weights of each unlabeled sample and targeted dynamic selection of samples during model training in corresponding iterations. This allows the model to input more samples with fewer detectable targets in the current model state, enabling the model to learn more samples containing rare targets and achieving self-balancing of the number of different target types. It avoids the problem of underfitting to targets with fewer targets and overfitting to targets with more targets due to an imbalance in the number of targets in the samples, thus improving the accuracy of the target detection model.

[0048] To achieve targeted dynamic selection of unlabeled samples, in one or more embodiments of this application, target unlabeled samples are first selected from each unlabeled sample corresponding to a preset initial selection weight, so that each unlabeled sample undergoes model training once. This allows the preset initial selection weights of each unlabeled sample to be updated based on the target detection results of each sample. Then, in subsequent training rounds, target unlabeled samples are dynamically selected in a targeted manner based on the updated selection weights. Specifically, as shown... Figure 2 As shown, step S102 may include steps S102-2 to S102-6:

[0049] Step S102-2: Determine whether the current selection weight of each unlabeled sample in the preset training set is the preset initial selection weight;

[0050] In one implementation, the current selection weights of each unlabeled sample in the preset training set can be recorded using recording tools such as tables or documents; correspondingly, step S102-2 may include: determining whether the current selection weights of each unlabeled sample recorded in the recording tool are the preset initial selection weights.

[0051] Step S102-4: If yes, then determine the candidate unlabeled samples that have not been trained by the model in each unlabeled sample, and randomly select N candidate unlabeled samples from the candidate unlabeled samples and determine them as the target unlabeled samples for the current model training.

[0052] Specifically, when it is determined in step S102-2 that the current selection weights of each unlabeled sample are all preset initial selection weights, candidate unlabeled samples that have not been trained on the model are identified among the unlabeled samples, and it is determined whether the number of candidate unlabeled samples is not less than N. If so, N unlabeled samples are randomly selected from the candidate unlabeled samples and determined as the target unlabeled samples for the current model training. Here, N is, for example, 56.

[0053] Furthermore, if the number of candidate unlabeled samples is determined to be less than N, the difference between N and the number of candidate unlabeled samples can be determined, and this difference can be used as the supplementary quantity. This supplementary quantity of unlabeled samples is then randomly selected from the unlabeled samples already used for model training. The candidate unlabeled samples and this supplementary quantity of unlabeled samples are then used as the target unlabeled samples for the current model training iteration. Alternatively, if the number of candidate unlabeled samples is determined to be less than N, then this candidate unlabeled sample is used as the target unlabeled sample for the current model training iteration.

[0054] Furthermore, to accurately determine candidate unlabeled samples and subsequently update the selection weights, in one or more embodiments of this application, after determining in step S106 that the training result of the current model training does not meet the preset training termination condition, it may further include: for each target unlabeled sample, determining whether there is associated detection information for the sample index of the target unlabeled sample; if so, generating detection information based on the obtained first target detection result of the target unlabeled sample, and replacing the currently associated detection information of the sample index of the target unlabeled sample with the generated detection information; if not, generating detection information based on the obtained first target detection result of the target unlabeled sample, and associating the generated detection information with the sample index of the target unlabeled sample. Correspondingly, determining candidate unlabeled samples that have not undergone model training in each unlabeled sample in steps S102-4 may include: determining the unlabeled sample corresponding to the sample index that has not been associated with detection information as a candidate unlabeled sample that has not undergone model training.

[0055] The detection information includes target category records, the specific meaning of which can be found in the relevant description below. The generated detection information is associated with the sample index of the target unlabeled sample. This can be done by saving the sample index and detection information to the aforementioned recording tool, or to other storage spaces; this application does not specifically limit this.

[0056] Step S102-6: If not, select M N unlabeled samples corresponding to the current selection weights from the preset training set, and determine the selected N unlabeled samples as the target unlabeled samples for the current model training; where M is an integer greater than 1 and less than or equal to N.

[0057] In this embodiment, the probability of selecting an unlabeled sample with a higher current selection weight is greater than the probability of selecting an unlabeled sample with a lower current selection weight. Since multiple unlabeled samples may have the same current selection weight among the target samples, meaning at least one of the M current selection weights may correspond to multiple unlabeled samples; for example, if N is 56, and the M current selection weights include 0.8, 0.7, etc., then 5 out of the 56 unlabeled samples have a current selection weight of 0.8 (i.e., a current selection weight of 0.8 corresponds to 5 unlabeled samples), 4 out of the 56 unlabeled samples have a current selection weight of 0.7 (i.e., a current selection weight of 0.7 corresponds to 4 unlabeled samples), and the current selection weights of the other unlabeled samples are other values. Furthermore, the current selection weights of each unlabeled sample may also be different from each other, meaning each of the M current selection weights corresponds to one unlabeled sample. Therefore, the value of M may be the same as or different from the value of N. Specifically, if at least one of the M current selection weights corresponds to multiple unlabeled samples, then M is less than N; if each of the M current selection weights corresponds to one unlabeled sample, then M equals N.

[0058] In one implementation, the current selection weights of each unlabeled sample in a preset training set can be sorted to obtain a sorting result. M current selection weights are then obtained from the sorting result, and the N unlabeled samples corresponding to these M current selection weights are determined as the target unlabeled samples for the current model training. Taking descending order as an example, after obtaining the sorting result, the first M current selection weights are obtained from the sorting result in a forward-to-back order, and the N unlabeled samples corresponding to these M current selection weights are determined as the target unlabeled samples for the current model training. It should be noted that if the total number of unlabeled samples corresponding to the M current selection weights is greater than N, then n1 unlabeled samples are randomly selected from the unlabeled samples corresponding to the Mth current selection weight, and the n2 unlabeled samples corresponding to the first M-1 current selection weights and these n1 unlabeled samples are determined as the target unlabeled samples for the current model training; where n1 and n2 are both integers greater than 1, and n1 + n2 = N. For example, if N is 56 and M is 15, the first 15 current selection weights are obtained from the descending sorted results in order from front to back. These 15 current selection weights correspond to 60 unlabeled samples, and the first 14 current selection weights correspond to 52 unlabeled samples, while the 15th current selection weight corresponds to 8 unlabeled samples. Then, 4 samples are randomly selected from the 8 unlabeled samples corresponding to the 15th current selection weight. The 52 unlabeled samples corresponding to the first 14 current selection weights and the 4 randomly selected unlabeled samples are determined as the target unlabeled samples for the current model training.

[0059] In another implementation, a preset random selection algorithm can be used to select N unlabeled samples corresponding to M current selection weights from the preset training set, based on the current selection weights of each unlabeled sample. These selected samples are then determined as the target unlabeled samples for the current model training. The random selection algorithm constrains the probability of selecting an unlabeled sample with a large current selection weight to be greater than the probability of selecting an unlabeled sample with a small current selection weight. The random selection algorithm can be set as needed in practical applications, and this application does not impose specific limitations on it.

[0060] Therefore, by prioritizing the selection of target unlabeled samples from candidate unlabeled samples that have never undergone model training, each unlabeled sample can quickly undergo model training to obtain its first target detection result. Based on the first target detection result, the preset initial selection weights of each unlabeled sample can be uniformly updated, allowing each unlabeled sample to participate in the selection fairly based on the updated selection weights. This enables targeted dynamic selection of samples and improves the accuracy of the trained target detection model.

[0061] To achieve semi-supervised model training, in the embodiments of this application, such as Figure 3 As shown, a pre-trained model can be trained based on labeled samples, and the target detection model to be trained can be trained based on unlabeled target samples, labeled samples in a pre-set training set, and the pre-trained model. Specifically, as... Figure 4 As shown, step S104 may include steps S104-2 to S104-10:

[0062] Step S104-2: Randomly select P labeled samples from the preset training set; where P is an integer greater than 1, and P and N satisfy a preset ratio;

[0063] In one implementation, the preset ratio can be 1:7. For example, if the total number of samples in the initial object detection model to be trained is preset to 64 each time the model is trained, then N=56 and P=8.

[0064] Step S104-4: Input N unlabeled target samples into the pre-trained model for prediction processing to obtain the pseudo-label of each unlabeled target sample; wherein, the pre-trained model is trained based on labeled samples;

[0065] Specifically, N unlabeled target samples are input into a pre-trained model for prediction processing, outputting a first predicted probability set for each unlabeled target sample and the coordinate information of at least one reference box for each unlabeled target sample; wherein, the first predicted probability set includes the first probability that each target object in the unlabeled target sample belongs to each preset category; each target object corresponds one-to-one with a reference box; and, each first predicted probability set is transformed according to a preset confidence threshold; based on the transformed first predicted probability sets and the coordinate information of the reference boxes, a pseudo-label for each unlabeled target sample is obtained.

[0066] The process involves transforming each first predicted probability set according to a preset confidence threshold. This includes: for each first predicted probability set, obtaining the maximum first probability of each target object corresponding to it; determining whether the maximum first probability is not less than the preset confidence threshold; if so, converting the maximum first probability into a first value and converting the other first probabilities of the corresponding target object into second values; if not, deleting each first probability of the corresponding target object from the first predicted set; if it is determined that the first probabilities of each target object corresponding to the first predicted probability set have undergone the aforementioned transformation process, then the current first predicted probability set is determined as the transformed first predicted probability set. For example, the first value is 1, the second value is 0, the preset categories include c1, c2, c3, c4, and the target unlabeled sample x with sample index i. i Three target objects d1, d2, and d3 were detected, along with an unlabeled sample x.i Examples of the first predicted probability set and its transformed first predicted probability set can be found in [reference needed]. Figure 5 As shown. Let T be the first number of unlabeled samples in the preset training set, where T is an integer greater than 1, and then 1≤i≤T.

[0067] Corresponding to the above conversion process, the aforementioned method of obtaining the pseudo-label of each unlabeled target sample based on the coordinate information of each first predicted probability set and the reference box after conversion includes: determining the preset category corresponding to each first probability with a probability value of a first value in the converted first predicted probability set, and the coordinate information of the reference box of the target object corresponding to each first probability with a probability value of a first value as the pseudo-label of the corresponding unlabeled target sample.

[0068] The process of transforming and processing the first predicted probability set and obtaining the pseudo-label can be expressed as: when max(p(x) i When θ))≥γ, then q * =ONE_HOT(argmax(p(x)) i ;θ)));where, x i Let q be the unlabeled target sample with sample index i, and θ be the current model parameters of the target detection model to be trained; * For the target unlabeled sample x i pseudo-tags; p(x i ;θ) represents the target unlabeled sample x i The first probability that the target object belongs to each preset category; max(p(x) i ;θ)) represents the maximum first probability; γ is the confidence threshold; argmax(p(x) i ;θ)) indicates that the maximum first probability is converted into the first value, and ONE_HOT indicates that the coordinate information of the reference box of the preset category corresponding to the first value and the target object corresponding to the first value is taken.

[0069] It should be noted that the process of training a pre-trained model based on labeled samples can refer to the training methods of existing pre-trained models. The labeled samples used for training the pre-trained model can be labeled samples in the preset training set or labeled samples not in the preset training set. This application does not make specific restrictions on this.

[0070] Step S104-6: Input N unlabeled target samples and P labeled target samples into the initial target detection model to be trained for training processing, and obtain the first target detection result for each unlabeled target sample and the second target detection result for each labeled target sample.

[0071] like Figure 6As shown, the initial object detection model to be trained includes a feature extraction module, an object detection module, a classification module, and a bounding box regression module. The feature extraction module performs feature extraction processing on each input sample to obtain sample features for each input sample; the input samples include unlabeled target samples and labeled target samples. The object detection module performs object detection processing on the sample features to obtain reference boxes corresponding to at least one target object in each input sample. The classification module performs classification processing on the target object corresponding to each reference box to obtain a second predicted probability set for each input sample; the second predicted probability set includes the second probability that each target object in the input sample belongs to each preset category. The bounding box regression module performs position detection processing on each reference box to obtain the coordinate information of each reference box. Accordingly, the object detection result for each input sample includes: the second predicted probability set and the coordinate information of each reference box. In one embodiment, the feature extraction module can be a ResNet50 pre-trained on ImageNet. The classification module can include a binary classifier and a k-classifier, where k is the total number of preset categories minus 1. When classifying the target object corresponding to each reference box, we can first perform binary classification on the target object corresponding to each reference box, that is, determine whether the target object belongs to the foreground category or the background category. Then, we use a k-classifier to classify each target object belonging to the foreground category, obtaining the second probability of the target object belonging to each of the k categories. That is, the preset categories include the k categories and the background category. For example, if k is 3, and the k categories include people, animals, and plants, when classifying a target object, we first perform binary classification to obtain the second probability of the target object belonging to the foreground category and the second probability of belonging to the background category. Based on the second probability of the target object belonging to the foreground category and the second probability of belonging to the background category, we determine that the target object belongs to the foreground category. Then, we perform k-classification on the target object to obtain the second probability of it belonging to the category "people", the second probability of it belonging to the category "animals", and the second probability of it belonging to the category "plants". Thus, we obtain the probability of the target object belonging to the four preset categories, that is, the second probability of it belonging to the category "people", the second probability of it belonging to the category "animals", the second probability of it belonging to the category "plants", and the second probability of it belonging to the "background category". It should be noted that the feature extraction module is pre-trained and can be directly used in each round of training of the object detection model. The object detection module, classification module, and bounding box regression module require training in each round. It is also understandable that, because the initial object detection model's object detection capability is not optimal in the early stages, or because the input samples do not contain target objects corresponding to the preset categories, the object detection module may not detect any target objects when processing the sample features.

[0072] andFigure 6 For the model structure shown, steps S104-6 may include: inputting N unlabeled target samples and P labeled target samples into the feature extraction module of the initial target detection model to be trained; performing feature extraction processing on each input sample through the feature extraction module to obtain the sample features of each input sample and inputting them into the target detection module; performing target detection processing on each sample feature through the target detection module to obtain the reference box corresponding to at least one target object in each input sample, and inputting the sample features containing the reference box into the classification module and the bounding box regression module respectively; performing classification processing on the target object corresponding to each reference box through the classification module to obtain the second predicted probability set of each input sample and outputting it; performing position detection processing on the bounding box regression module to obtain the coordinate information of each reference box and outputting it; and determining the second predicted probability set output for each input sample and the coordinate information of at least one reference box as the target detection result of the corresponding input sample.

[0073] Furthermore, to improve the image quality of unlabeled target samples and thus enhance the accuracy of the target detection model, in one or more embodiments of this application, before step S104-6, the method may further include: performing strong enhancement processing on N unlabeled target samples to obtain N strongly enhanced samples; correspondingly, step S104-6 includes: inputting the N strongly enhanced samples and P labeled target samples into the initial target detection model to be trained for training processing, to obtain the target detection result for each strongly enhanced sample and the target detection result for each labeled target sample. The strong enhancement processing includes, but is not limited to, image color transformation, geometric transformation, bounding box transformation, and noise addition, which can be set as needed in practical applications.

[0074] Step S104-8: Determine the target loss function based on the pseudo-label, the first target detection result, and the second target detection result;

[0075] Specifically, a first loss function is determined based on the labels of the labeled target samples and the second target detection results of the labeled target samples; a second loss function is determined based on the pseudo-labels and the first target detection results of the unlabeled target samples; and a target loss function is determined based on the first and second loss functions. The labels of the labeled target samples include the true category of each target object in the labeled target samples and the true coordinate information of the reference box of each target object.

[0076] To facilitate subsequent calculation of the target loss value of the target detection model based on the target loss function, in one or more embodiments of this application, after obtaining the target detection result, the method may further include: determining the target category corresponding to each first target detection result, wherein the target category is a preset target category to which the target object in the unlabeled target sample belongs. Specifically, for each second predicted probability set in each first target detection result, the maximum second probability of each target object corresponding to it is determined, and the preset category corresponding to the maximum second probability is determined as the target preset category. When there are multiple maximum second probabilities for a target object, one is randomly selected and determined as the maximum second probability. For example, the second predicted probability set of a certain input sample and... Figure 5 The target unlabeled sample x shown i If the first predicted probability sets are the same, then the maximum second probability of target object d1 is 0.6, the maximum second probability of target object d2 is 0.8, and the maximum second probability of target object d3 is 0.7; the target categories corresponding to the target detection results of this input sample are c1 and c2.

[0077] Furthermore, in one implementation, the first loss function described above can be expressed as:

[0078]

[0079] Where X represents the target labeled sample, p * t represents the target category corresponding to the second target detection result of the labeled sample. * This represents the coordinate information of each reference box in the second target detection result of the labeled sample; This represents the first loss value calculated based on the second target detection result of the labeled target sample, i.e., the supervised loss; r is the index of the target object corresponding to the second target detection result of the labeled target sample, and r is an integer greater than 1; This indicates the target's predefined category (which can be considered as the predicted category) to which the target object with index r belongs in the second target detection result of the labeled sample; This represents the coordinate information (which can be considered as predicted coordinate information) of the reference box of the target object with index r contained in the second target detection result of the labeled sample; p r This indicates the category (which can be considered the true category) to which the target object with index r belongs in the labels of the labeled samples; t r N represents the coordinate information (which can be considered as the true coordinate information) of the bounding box of the target object with index r contained in the label of the labeled sample; cls N represents the total number of target objects; reg λ represents the size of the sample feature map; λ is a hyperparameter for adjusting the weights. This represents the cross-entropy between the predicted class and the true class of the target object with index r. This represents the cross-entropy between the predicted coordinates and the actual coordinates of the target object with index r.

[0080] In one implementation, the second loss function described above can be expressed as:

[0081]

[0082] Where x represents the target unlabeled sample; A() represents strong augmentation processing, and since the category is affected by the strong augmentation processing, A(s) * q represents the target category corresponding to the first target detection result of a strongly enhanced sample obtained by strongly enhancing an unlabeled target sample. * This represents the coordinate information of each reference box in the first target detection result of the strongly enhanced sample; This represents the second loss value calculated based on the first target detection result of the unlabeled target sample, i.e., the unsupervised loss; y is the index of the target object corresponding to the first target detection result of the unlabeled target sample, and y is an integer greater than 1; This indicates the target preset category (which can be considered as the predicted category) to which the target object with index y belongs in the first target detection result of the unlabeled target sample; A(s)y represents the coordinate information of the reference box of the target object with index y contained in the first target detection result of the strongly enhanced sample (which can be considered as predicted coordinate information); A(s)y represents the category to which the target object with index y contained in the pseudo-label of the unlabeled target sample belongs (which can be considered as the true category); qy represents the coordinate information of the reference box of the target object with index y contained in the pseudo-label of the unlabeled target sample (which can be considered as true coordinate information); N cls N represents the total number of target objects; reg λ represents the size of the sample feature map; λ is a hyperparameter for adjusting the weights. The cross-entropy represents the predicted class and the true class of the target object with index y. This represents the cross-entropy between the predicted coordinates and the actual coordinates of the target object at index y.

[0083] The third loss function mentioned above can be expressed as:

[0084]

[0085] Where, λ u It is a hyperparameter used to adjust the ratio between supervised loss and unsupervised loss, and its value can be [1, 2].

[0086] It should be noted that after the target loss function is determined in the first model training, it is not necessary to perform the target loss function determination operation again in each subsequent model training. That is, starting from the second model training, step S104-8 can be skipped. Instead, after step S104-6 is executed, the following steps S104-10 are executed directly. In step S104-10, the model parameters of the initial object detection model to be trained are adjusted based on the target loss function determined in the first model training.

[0087] Steps S104-10: Based on the determined target loss function, adjust the model parameters of the initial target detection model to be trained to obtain the trained initial target detection model.

[0088] Specifically, using a determined target loss function, a target loss value is calculated based on pseudo-labels, the detection results of each first target, and the detection results of each second target. Then, using stochastic gradient descent, the model parameters of the initial target detection model are adjusted based on the target loss value, and the adjusted initial target detection model is determined as the trained target detection model. The calculation of the target loss value using the target loss function, based on pseudo-labels, the detection results of each first target, and the detection results of each second target can include: calculating a first loss value based on the labels of labeled target samples and the second target detection results of labeled target samples according to the determined first loss function; calculating a second loss value based on pseudo-labels and the detection results of unlabeled target samples according to the determined second loss function; and calculating the target loss value of the initial target detection model based on the first loss value and the second loss value according to the target loss function.

[0089] It should be noted that the process of adjusting the model parameters of the initial target detection model based on the target loss value using the stochastic gradient descent method can be found in the existing process of optimizing model parameters through backpropagation using the gradient descent method, and will not be repeated here.

[0090] Therefore, by training the model with a small number of labeled samples and a large number of unlabeled samples, and predicting the pseudo-labels of each unlabeled sample used in the current training by the pre-trained model, the model parameters of the object detection model can be optimized based on the pseudo-labels, the first object detection results of each unlabeled sample output by the initial object detection model in the current training, the second object detection results of each labeled sample output by the object detection model in the current training, and the labels of each labeled sample. This effectively realizes the training of a semi-supervised object detection model without spending a lot of time to obtain a large number of labeled samples, greatly reducing time costs and improving the overall training efficiency of the object detection model.

[0091] To balance the fitting of the object detection model to a large number of target objects with that to a small number of target objects, in one or more embodiments of this application, when it is determined that the training result of the current model training does not meet the preset training termination condition and the current selection weights meet the update condition, the total number of target objects included in each preset category is counted according to the first object detection result, and the current selection weights of each unlabeled sample are updated based on this total number. Specifically, as shown... Figure 7 As shown, step S106 may include steps S106-2 to S106-8:

[0092] Step S106-2: If it is determined that the training result of the current model training does not meet the preset training termination condition and the current selected weights meet the update condition, then the target category corresponding to the first target detection result is determined as the target category currently corresponding to the unlabeled target sample; wherein, the target category is the preset target category to which each target object in the unlabeled target sample belongs.

[0093] Specifically, if it is determined that the training result of the current model training does not meet the preset training termination condition, then the maximum second probability of each target object is obtained from the second prediction probability set included in each first target detection result, the preset category corresponding to the maximum second probability is determined as the target category corresponding to the first target detection result, and the target category is determined as the target category currently corresponding to the unlabeled target sample; wherein, the first target detection result is the first target detection result of the unlabeled target sample.

[0094] For example, the target unlabeled sample x i Three target objects d1, d2, and d3 were detected. The preset category corresponding to the maximum second probability of d1, the preset category corresponding to the maximum second probability of d2, and the preset category corresponding to the target second probability of d3 are c1 and c2, respectively, obtained from the second predicted probability set of the unlabeled target sample xi. Therefore, the target categories currently corresponding to the unlabeled target sample xi include c1 and c2, denoted by r. i Represents the target unlabeled sample x i If the target category record is r, then r i It can be represented as r i = {c1, c2, c2}, which represents the target unlabeled sample x. i Two target objects of category c1 and one target object of category c2 were detected.

[0095] Step S106-4: Determine the total number of target objects currently included in each preset category based on the target category corresponding to each unlabeled sample;

[0096] It is understandable that after each unlabeled sample undergoes model training, a target category record for the unlabeled sample can be generated based on the first target detection result. Detection information is then generated based on this target category record, and the detection information is associated with the sample index. Since the target detection model is continuously optimized, the target category record can change as the number of times the unlabeled sample participates in training increases. When it changes, the corresponding detection information is updated, or the corresponding detection information is updated each time a target category record is generated. In this embodiment, the target category included in the target category record of each unlabeled sample's detection information is determined as the target category currently corresponding to the unlabeled sample.

[0097] Set the preset category c j The total number of target objects currently included is denoted as N. j ,but:

[0098]

[0099] Where i represents the index of the unlabeled sample, T represents the total number of unlabeled samples, |·| represents the statistical count, and k represents the number of unlabeled samples x. i The object index of the target object, where k is an integer greater than 1; The value is 1 when the condition inside parentheses is true; r i For unlabeled sample x i Current target category record; For unlabeled sample x i Current target category record r i The target predefined category of the target object with index k is included, which is the unlabeled sample x. i Current target category record r i The k-th target category in the dataset.

[0100] Step S106-6: Determine the new selection weight for each unlabeled sample based on the total number;

[0101] Specifically, the total number of targets corresponding to the target category of each unlabeled sample is obtained from the determined total number; the candidate weight of each unlabeled sample is determined based on the total number of targets corresponding to each unlabeled sample; and the candidate weights are normalized to obtain the new selection weight of each unlabeled sample.

[0102] The candidate weights can be determined using the following formula:

[0103]

[0104] Among them, w i For unlabeled sample x iThe candidate weights; m represents the index of the preset category, where m is an integer greater than 1; Represents unlabeled sample x i The category index of the preset category to which the target object with object index k belongs is m; N m This indicates the total number of target objects included in the preset category with category index m.

[0105] As an example, unlabeled sample x i r i = {c1, c2}, where the category index of the preset category to which the target object with object index 1 belongs is 1, then the total number of target objects in target category c1 is obtained from the total number of target objects included in each preset category; the category index of the preset category to which the target object with object index 2 belongs is 1, then the total number of target objects in target category c1 is obtained from the total number of target objects included in each preset category; the category index of the preset category to which the target object with object index 3 belongs is 2, then the total number of target objects in target category c2 is obtained from the total number of target objects included in each preset category. For example, if the total number of target objects included in c1 is N1 = 1000 and the total number of target objects included in c2 is N2 = 3, then the unlabeled sample x... i The new selection weights are: (1 / 1000) + (1 / 1000) + (1 / 3).

[0106] Furthermore, the candidate weights can be normalized using the following formula to obtain a new selection weight for each unlabeled sample:

[0107]

[0108] in, For unlabeled sample x i The new selection weights are denoted as T, where T is an integer greater than 1, and 1 ≤ h ≤ T, ∑ h w h This represents the sum of the candidate weights of all unlabeled samples in the preset training set.

[0109] Step S106-8: Determine the new selection weights as the current selection weights for the unlabeled samples, and determine the trained initial object detection model as the initial object detection model to be trained in the next model training, until the preset training termination condition is met, and the object detection model is obtained.

[0110] Therefore, when it is determined that the training result of the current model training does not meet the preset training termination condition and the current selection weight meets the update condition, the selection weight of each unlabeled sample is updated, realizing the timely update of the selection weight. This ensures that in subsequent training rounds, the target unlabeled sample for the current training can be determined in a targeted manner based on the selection weight, thereby improving the accuracy of the trained target detection model.

[0111] In a specific embodiment, the example uses a preset training set comprising 550 unlabeled samples and 50 labeled samples, with N:P = 7:1. The number of samples input per training round is 64 (i.e., 56 unlabeled target samples and 8 labeled target samples). The preset training termination condition is that the number of training iterations equals the total number of training iterations of 500. During the first model training iteration, since the sample indices of each unlabeled sample are not associated with detection information, the 550 unlabeled samples are identified as candidate unlabeled samples, from which 56 target unlabeled samples are randomly selected, and from the 50 labeled samples, 8 target labeled samples are randomly selected. Then, the selected 56 target unlabeled samples are input into the pre-trained model for prediction processing to obtain a pseudo-label for each target unlabeled sample. Finally, the selected 56 target unlabeled samples and 8 target labeled samples are input into the initial target detection model to be trained for training processing to obtain the first target detection result for each target unlabeled sample and the second target detection result for each target labeled sample. As a result, since the number of training iterations is not equal to the total number of training iterations, it can be determined that the training result of the current model training does not meet the preset training termination condition. Therefore, the model parameters of the initial object detection model to be trained are adjusted using the determined target loss function to obtain the trained initial object detection model. Then, detection information is generated based on the first object detection result of each unlabeled target sample, and the detection information is associated with the sample index of the corresponding unlabeled target sample. At this time, based on the saved detection information, it can be determined that there are candidate unlabeled samples that have not been trained, that is, it is determined that the current selection weight does not meet the update condition, and no update processing of the selection weight is performed. Thus, the first model training is completed. In the second model training, the 504 unlabeled samples corresponding to the sample indexes of the unassociated detection information are determined as candidate unlabeled samples, and 56 target unlabeled samples are randomly selected from them, and then the subsequent processing is performed in the aforementioned manner. Following this pattern, after the 10th training iteration, the first and second object detection results are output. After associating the sample indices of the unlabeled target samples with the detection information corresponding to the first object detection result, it can be determined that there are no candidate unlabeled samples that have not undergone model training. This means the current selection weights meet the update conditions. Therefore, the current selection weights (i.e., the preset initial selection weights) of each unlabeled sample are updated according to the aforementioned selection weight update method. Furthermore, after each subsequent training iteration, it can be determined that the current selection weights meet the update conditions, and the current selection weights of each unlabeled sample are updated accordingly, until the 500th training iteration, resulting in the final object detection model. It should be noted that starting from the 11th round of model training, the model parameter update operation can also be performed after the current selection weight update process.

[0112] In one or more embodiments of this application, N unlabeled target samples for the current model training are determined based on the current selection weights of each unlabeled sample in a preset training set; where N is an integer greater than 1; then, the current model training is performed on the initial target detection model to be trained based on the unlabeled target samples and the labeled samples in the preset training set, to obtain the trained initial target detection model and the first target detection result for each unlabeled target sample; finally, when it is determined that the training result of the current model training does not meet the preset training termination condition and the current selection weights meet the update condition, the current selection weights of each unlabeled sample are updated according to the first target detection result to determine the target unlabeled samples for the next model training; and the initial target detection model after the current training is determined as the initial target detection model to be trained for the next model training, until the preset training termination condition is met, and the target detection model is obtained. Therefore, before each model training iteration, N unlabeled target samples are determined based on their current selection weights. The target detection model is then trained based on these unlabeled target samples. Furthermore, when the training result of the current iteration does not meet the preset training termination condition and the current selection weights meet the update condition, the current selection weights of each unlabeled sample are updated. This achieves timely updates of the selection weights of each unlabeled sample and targeted dynamic selection of samples during corresponding training iterations. This allows the model to input more samples with fewer detectable targets in the current model state, enabling the model to learn more samples containing rare targets and achieving self-balancing of the number of different target types. It avoids the problem of underfitting to targets with fewer targets and overfitting to targets with more targets due to an imbalance in the number of targets in the samples, thus improving the accuracy of the target detection model.

[0113] Corresponding to the training method of the target detection model described above, based on the same technical concept, one or more embodiments of this application also provide a target detection method. Figure 8 This is a flowchart illustrating a target detection method provided in one or more embodiments of this application. Figure 8 The method described can be executed by a target detection device, which can be located in a terminal device or a server. The terminal device can be a mobile phone, tablet, desktop computer, laptop, etc.; the server can be a standalone server or a server cluster consisting of multiple servers. Figure 8 As shown, the method includes the following steps:

[0114] Step S202: Obtain the target image data to be detected;

[0115] Step S204: Input the target image data into the target detection model for target detection processing to obtain the target detection result of the target image data; wherein, the target detection result includes the third probability of each target object in the target image data belonging to each preset category and the coordinate information of the reference box of each target object.

[0116] After obtaining the target detection results of the target image data, the target category corresponding to the target image data can be determined based on the target detection results. The process of determining the target category corresponding to the target image data based on the target detection results can be referred to the aforementioned process of determining the target category corresponding to the unlabeled target sample based on the target detection results, and the repetition will not be repeated here.

[0117] Furthermore, the target detection model in step S202 is trained according to the target detection model training method provided in the foregoing embodiments of this application. For the specific training process, please refer to the relevant description above, which will not be repeated here.

[0118] The target detection method in this embodiment introduces selection weights during the training process of the target detection model. Before each model training, N unlabeled target samples are determined based on the current selection weights of each unlabeled sample. The current model is then trained based on these unlabeled target samples and labeled samples in a preset training set. Furthermore, when the training result of the current model training does not meet the preset training termination condition and the current selection weights meet the update condition, the current selection weights of each unlabeled sample are updated. This achieves timely updates of the selection weights of each unlabeled sample and targeted dynamic selection of samples during corresponding rounds of model training. This allows the corresponding rounds of model training to input more samples with fewer detectable targets in the current model state, enabling the model to learn more samples containing rare targets and achieving self-balancing of the number of various targets. This avoids the problem of underfitting to targets with fewer targets and overfitting to targets with more targets due to an imbalance in the number of targets in the samples, thus improving the accuracy of the target detection model's detection results. Therefore, using this target detection model to perform target detection on the target image data to be processed improves the accuracy of the target detection results.

[0119] Corresponding to the training method of the target detection model described above, based on the same technical concept, one or more embodiments of this application also provide a training device for the target detection model. Figure 9 A schematic diagram illustrating the module composition of a training device for an object detection model provided in one or more embodiments of this application, as shown below. Figure 9 As shown, the device includes:

[0120] The determination module 301 is used to determine N target unlabeled samples for the current model training based on the current selection weights of each unlabeled sample in the preset training set; where N is an integer greater than 1.

[0121] Training module 302 is used to train an initial target detection model to be trained based on the unlabeled target samples and labeled samples in the preset training set, so as to obtain the trained initial target detection model and the first target detection result for each unlabeled target sample.

[0122] The update module 303 is used to update the current selection weights according to the first target detection result if the training result of the current model training does not meet the preset training termination condition and the current selection weights meet the update condition, and to determine the trained initial target detection model as the initial target detection model to be trained in the next model training, until the preset training termination condition is met, and the target detection model is obtained; wherein, the updated selection weights are used to determine the target unlabeled samples for the next model training.

[0123] The target detection model training device provided in this application determines N unlabeled target samples for the current model training based on the current selection weights of each unlabeled sample in a preset training set; where N is an integer greater than 1; then, the current model training is performed on the initial target detection model to be trained based on the unlabeled target samples and the labeled samples in the preset training set, to obtain the trained initial target detection model and the first target detection result for each unlabeled target sample; finally, when it is determined that the training result of the current model training does not meet the preset training termination condition and the current selection weights meet the update condition, the current selection weights of each unlabeled sample are updated according to the first target detection result to determine the target unlabeled samples for the next model training; and the initial target detection model after the current training is determined as the initial target detection model to be trained for the next model training, until the preset training termination condition is met, and the target detection model is obtained. Therefore, before each model training iteration, N unlabeled target samples are determined based on their current selection weights. The current model is then trained on the initial target detection model based on these unlabeled target samples. Furthermore, when the training result of the current model training does not meet the preset training termination condition and the current selection weights meet the update condition, the current selection weights of each unlabeled sample are updated. This achieves timely updates of the selection weights of each unlabeled sample and targeted dynamic selection of samples during corresponding training iterations. This allows the model to input more samples with fewer detectable targets in the current model state, enabling the model to learn more samples containing rare targets and achieving self-balancing of the number of different target types. It avoids the problem of underfitting to targets with fewer targets and overfitting to targets with more targets due to an imbalance in the number of targets in the samples, thus improving the accuracy of the target detection model.

[0124] It should be noted that the embodiments of the training device for the object detection model in this application and the embodiments of the training method for the object detection model in this application are based on the same inventive concept. Therefore, the specific implementation of this embodiment can be referred to the implementation of the corresponding training method for the object detection model mentioned above, and the repeated parts will not be described again.

[0125] Furthermore, corresponding to the target detection method described above, based on the same technical concept, one or more embodiments of this application also provide a target detection device. Figure 10 This is a schematic diagram of the module composition of the target detection device provided in one or more embodiments of this application, such as... Figure 10 As shown, the device includes:

[0126] The acquisition module 401 is used to acquire the target image data to be detected;

[0127] Detection module 402 is used to input the target image data into a target detection model for target detection processing to obtain the target detection result of the target image data; the target detection result includes the third probability of each target object in the target image data belonging to each preset category and the coordinate information of the reference box of each target object;

[0128] The target detection model is trained using the target detection model training method provided in the foregoing embodiments.

[0129] The target detection device provided in this application introduces selection weights into the target detection model during training. Before each round of model training, it determines N unlabeled target samples for the current model training based on the current selection weights of each unlabeled sample. The current model training is then performed on the initial target detection model to be trained based on these unlabeled target samples and labeled samples in a preset training set. Furthermore, when the training result of the current model training does not meet the preset training termination condition and the current selection weights meet the update condition, the current selection weights of each unlabeled sample are updated. This achieves timely updating of the selection weights of each unlabeled sample and targeted dynamic selection of samples during corresponding rounds of model training. This allows the corresponding rounds of model training to input more samples with fewer detectable targets in the current model state, enabling the model to learn more samples containing rare targets and achieving self-balancing of the number of various targets. This avoids the problem of underfitting the model to targets with fewer targets and overfitting to targets with more targets due to an imbalance in the number of targets in the samples, thus improving the accuracy of the target detection model's detection results. Therefore, using this target detection model to perform target detection on the target image data to be processed improves the accuracy of the target detection results.

[0130] It should be noted that the embodiments of the target detection device in this application and the embodiments of the target detection method in this application are based on the same inventive concept. Therefore, the specific implementation of this embodiment can be referred to the implementation of the corresponding target detection method mentioned above, and the repeated parts will not be described again.

[0131] Furthermore, corresponding to the training method of the object detection model described above, based on the same technical concept, one or more embodiments of this application also provide an electronic device that can be used to execute the above-described training method of the object detection model. Figure 11 This is a schematic diagram of the structure of an electronic device provided for one or more embodiments of this application.

[0132] like Figure 11As shown, electronic devices can vary considerably due to differences in configuration or performance. They may include one or more processors 501 and memories 502, with the memory 502 storing one or more application programs or data. The memory 502 can be temporary or persistent storage. The application programs stored in the memory 502 may include one or more modules (not shown), each module including a series of computer-executable instructions within the electronic device. Furthermore, the processor 501 may be configured to communicate with the memory 502, executing the series of computer-executable instructions stored in the memory 502 on the electronic device. The electronic device may also include one or more power supplies 503, one or more wired or wireless network interfaces 504, one or more input / output interfaces 505, one or more keyboards 506, etc.

[0133] In one specific embodiment, the electronic device includes a memory and one or more programs, wherein the one or more programs are stored in the memory, and the one or more programs may include one or more modules, and each module may include a series of computer-executable instructions for use in the electronic device, and is configured to be executed by one or more processors. The one or more programs include computer-executable instructions for performing the following:

[0134] Based on the current selection weights of each unlabeled sample in the preset training set, determine the N target unlabeled samples for the current model training; where N is an integer greater than 1.

[0135] The initial target detection model to be trained is trained based on the unlabeled target samples and the labeled samples in the preset training set to obtain the trained initial target detection model and the first target detection result for each unlabeled target sample.

[0136] If the training result of the current model training does not meet the preset training termination condition and the current selection weights meet the update condition, then the current selection weights are updated according to the first target detection result, and the trained initial target detection model is determined as the initial target detection model to be trained in the next model training, until the preset training termination condition is met, and the target detection model is obtained; wherein, the updated selection weights are used to determine the target unlabeled samples for the next model training.

[0137] The electronic device provided in one or more embodiments of this application determines N unlabeled target samples for the current model training based on the current selection weights of each unlabeled sample in a preset training set; where N is an integer greater than 1; then, the current model training is performed on the initial target detection model to be trained based on the unlabeled target samples and the labeled samples in the preset training set, to obtain the trained initial target detection model and the first target detection result for each unlabeled target sample; finally, when it is determined that the training result of the current model training does not meet the preset training termination condition and the current selection weights meet the update condition, the current selection weights of each unlabeled sample are updated according to the first target detection result to determine the target unlabeled samples for the next model training; and the initial target detection model after the current training is determined as the initial target detection model to be trained for the next model training, until the preset training termination condition is met, to obtain the target detection model. Therefore, before each model training iteration, N unlabeled target samples are determined based on their current selection weights. The current model is then trained on the initial target detection model based on these unlabeled target samples. Furthermore, when the training result of the current model training does not meet the preset training termination condition and the current selection weights meet the update condition, the current selection weights of each unlabeled sample are updated. This achieves timely updates of the selection weights of each unlabeled sample and targeted dynamic selection of samples during corresponding training iterations. This allows the model to input more samples with fewer detectable targets in the current model state, enabling the model to learn more samples containing rare targets and achieving self-balancing of the number of different target types. It avoids the problem of underfitting to targets with fewer targets and overfitting to targets with more targets due to an imbalance in the number of targets in the samples, thus improving the accuracy of the target detection model.

[0138] In another specific embodiment, the memory in the above-described electronic device may also execute one or more programs containing computer-executable instructions for performing the following:

[0139] Acquire the target image data to be detected;

[0140] The target image data is input into the target detection model for target detection processing to obtain the target detection result of the target image data; the target detection result includes the third probability of each target object in the target image data belonging to each preset category and the coordinate information of the reference box of each target object; the target detection model is trained by the target detection model training method provided in the embodiments of this application.

[0141] The electronic device provided in one or more embodiments of this application introduces selection weights into the target detection model during training. Before each round of model training, it determines N unlabeled target samples for the current model training based on the current selection weights of each unlabeled sample, and performs the current model training based on the unlabeled target samples and labeled samples in a preset training set. Furthermore, when the training result of the current model training does not meet the preset training termination condition and the current selection weights meet the update condition, the current selection weights of each unlabeled sample are updated. This achieves timely updating of the selection weights of each unlabeled sample and targeted dynamic selection of samples during corresponding rounds of model training. This allows the corresponding rounds of model training to input more samples with fewer detectable targets in the current model state, enabling the model to learn more samples containing rare targets and achieving self-balancing of the number of various targets. It avoids the problem of underfitting the model to targets with fewer targets and overfitting to targets with more targets due to an imbalance in the number of targets in the samples, thus improving the accuracy of the target detection model's detection results. Therefore, using this target detection model to perform target detection on the target image data to be processed improves the accuracy of the target detection results.

[0142] It should be noted that the embodiments concerning electronic devices in this application and the embodiments concerning the training method and object detection method of the object detection model in this application are based on the same inventive concept. Therefore, the specific implementation of this embodiment can be referred to the implementation of the corresponding training method and object detection method of the object detection model mentioned above, and the repeated parts will not be described again.

[0143] Furthermore, corresponding to the training method of the target detection model described above, based on the same technical concept, one or more embodiments of this application also provide a storage medium for storing computer-executable instructions. In a specific embodiment, the storage medium can be a USB flash drive, optical disk, hard disk, etc. When the computer-executable instructions stored in the storage medium are executed by the processor, they can realize the following process:

[0144] Based on the current selection weights of each unlabeled sample in the preset training set, determine the N target unlabeled samples for the current model training; where N is an integer greater than 1.

[0145] The initial target detection model to be trained is trained based on the unlabeled target samples and the labeled samples in the preset training set to obtain the trained initial target detection model and the first target detection result for each unlabeled target sample.

[0146] If the training result of the current model training does not meet the preset training termination condition and the current selection weights meet the update condition, then the current selection weights are updated according to the first target detection result, and the trained initial target detection model is determined as the initial target detection model to be trained in the next model training, until the preset training termination condition is met, and the target detection model is obtained; wherein, the updated selection weights are used to determine the target unlabeled samples for the next model training.

[0147] When the computer-executable instructions stored in the storage medium provided in one or more embodiments of this application are executed by a processor, the following steps are taken: First, N unlabeled target samples are determined for the current model training based on the current selection weights of each unlabeled sample in a preset training set, where N is an integer greater than 1. Then, the current model training is performed on the initial target detection model to be trained based on the unlabeled target samples and labeled samples in the preset training set, resulting in the trained initial target detection model and the first target detection result for each unlabeled target sample. Finally, if the training result of the current model training does not meet the preset training termination condition and the current selection weights meet the update condition, the current selection weights of each unlabeled sample are updated based on the first target detection result to determine the target unlabeled samples for the next model training. The current initial target detection model is then determined as the initial target detection model to be trained for the next model training, until the preset training termination condition is met, resulting in a target detection model. Therefore, before each model training iteration, N unlabeled target samples are determined based on their current selection weights. The current model is then trained on the initial target detection model based on these unlabeled target samples. Furthermore, when the training result of the current model training does not meet the preset training termination condition and the current selection weights meet the update condition, the current selection weights of each unlabeled sample are updated. This achieves timely updates of the selection weights of each unlabeled sample and targeted dynamic selection of samples during corresponding training iterations. This allows the model to input more samples with fewer detectable targets in the current model state, enabling the model to learn more samples containing rare targets and achieving self-balancing of the number of different target types. It avoids the problem of underfitting to targets with fewer targets and overfitting to targets with more targets due to an imbalance in the number of targets in the samples, thus improving the accuracy of the target detection model.

[0148] In another specific embodiment, the computer-executable instructions stored in the aforementioned storage medium, when executed by a processor, can also achieve the following process:

[0149] Acquire the target image data to be detected;

[0150] The target image data is input into the target detection model for target detection processing to obtain the target detection result of the target image data; the target detection result includes the third probability of each target object in the target image data belonging to each preset category and the coordinate information of the reference box of each target object; the target detection model is trained by the target detection model training method provided in the embodiments of this application.

[0151] When the computer-executable instructions stored in the storage medium provided in one or more embodiments of this application are executed by a processor, the target detection model introduced selection weights during training. Before each round of model training, N unlabeled target samples are determined based on the current selection weights of each unlabeled sample. The current model training is then performed on the initial target detection model to be trained based on these unlabeled target samples and labeled samples in a preset training set. Furthermore, when the training result of the current model training does not meet the preset training termination condition and the current selection weights meet the update condition, the current selection weights of each unlabeled sample are updated. This achieves timely updating of the selection weights of each unlabeled sample and targeted dynamic selection of samples during corresponding rounds of model training. This allows the corresponding rounds of model training to input more samples with fewer detectable targets in the current model state, enabling the model to learn more samples containing rare targets and achieving self-balancing of the number of various targets. This avoids the problem of underfitting the model to targets with fewer targets and overfitting to targets with more targets due to an imbalance in the number of targets in the samples, thus improving the accuracy of the target detection model's detection results. Therefore, using this target detection model to perform target detection on the target image data to be processed improves the accuracy of the target detection results.

[0152] It should be noted that the embodiments concerning the storage medium in this application are based on the same inventive concept as the embodiments concerning the training method and object detection method of the object detection model in this application. Therefore, the specific implementation of this embodiment can be referred to the implementation of the corresponding training method and object detection method of the object detection model mentioned above, and the repeated parts will not be described again.

[0153] The foregoing has described specific embodiments of this application. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in a different order than that shown in the embodiments and may still achieve the desired results. Furthermore, the processes depicted in the drawings do not necessarily require the specific or sequential order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0154] In the 1990s, improvements to a technology could be clearly distinguished as either hardware improvements (e.g., improvements to the circuit structure of diodes, transistors, switches, etc.) or software improvements (improvements to the methodology). However, with technological advancements, many methodological improvements today can be considered direct improvements to the hardware circuit structure. Designers almost always obtain the corresponding hardware circuit structure by programming the improved methodology into the hardware circuit. Therefore, it cannot be said that a methodological improvement cannot be implemented using a hardware physical module. For example, a Programmable Logic Device (PLD) (e.g., a Field Programmable Gate Array (FPGA)) is such an integrated circuit whose logic function is determined by the user programming the device. Designers can program a digital system themselves to "integrate" it onto a PLD, without needing chip manufacturers to design and manufacture dedicated integrated circuit chips. Furthermore, nowadays, instead of manually manufacturing integrated circuit chips, this programming is mostly implemented using "logic compiler" software. Similar to the software compiler used in program development, the original code before compilation must be written in a specific programming language, called a Hardware Description Language (HDL). There are many HDLs, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, and RHDL (Ruby Hardware Description Language). Currently, the most commonly used are VHDL (Very-High-Speed ​​Integrated Circuit Hardware Description Language) and Verilog. Those skilled in the art should understand that by simply performing some logic programming on the method flow using one of these hardware description languages ​​and programming it into an integrated circuit, the hardware circuit implementing the logical method flow can be easily obtained.

[0155] The controller can be implemented in any suitable manner. For example, it can take the form of a microprocessor or processor and a computer-readable medium storing computer-readable program code (e.g., software or firmware) executable by the (micro)processor, logic gates, switches, application-specific integrated circuits (ASICs), programmable logic controllers, and embedded microcontrollers. Examples of controllers include, but are not limited to, the following microcontrollers: ARC625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicon Labs C8051F320. A memory controller can also be implemented as part of the control logic of the memory. Those skilled in the art will also recognize that, in addition to implementing the controller in purely computer-readable program code form, the same functionality can be achieved by logically programming the method steps to make the controller take the form of logic gates, switches, ASICs, programmable logic controllers, and embedded microcontrollers. Therefore, such a controller can be considered a hardware component, and the means included therein for implementing various functions can also be considered as structures within the hardware component. Alternatively, the means for implementing various functions can be considered as both software modules implementing the method and structures within the hardware component.

[0156] The systems, devices, modules, or units described in the above embodiments can be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, a computer can be, for example, a personal computer, laptop computer, cellular phone, camera phone, smartphone, personal digital assistant, media player, navigation device, email device, game console, tablet computer, wearable device, or any combination of these devices.

[0157] For ease of description, the above apparatus is described by dividing it into various functional units. Of course, in implementing the embodiments of this application, the functions of each unit can be implemented in one or more software and / or hardware.

[0158] Those skilled in the art will understand that one or more embodiments of this application can be provided as a method, system, or computer program product. Therefore, one or more embodiments of this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0159] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0160] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0161] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 Figure 1 The steps of the function specified in one or more boxes.

[0162] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0163] Memory may include non-persistent storage in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.

[0164] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.

[0165] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0166] One or more embodiments of this application can be described in the general context of computer-executable instructions, such as program modules, that are executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc., that perform a specific task or implement a specific abstract data type. One or more embodiments of this application can also be practiced in distributed computing environments where tasks are performed by remote processing devices connected via a communication network. In a distributed computing environment, program modules can reside in local and remote computer storage media, including storage devices.

[0167] The various embodiments in this application are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the system embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions of the method embodiments.

[0168] The above description is merely an embodiment of this document and is not intended to limit the scope of this document. Various modifications and variations can be made to this document by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this document should be included within the scope of the claims of this document.

Claims

1. A training method for an object detection model, characterized in that, include: Based on the current selection weights of each unlabeled image sample in the preset training set, N target unlabeled image samples for the current model training are determined; wherein, the preset training set includes multiple unlabeled image samples and multiple labeled image samples, and N is an integer greater than 1; the current selection weights indicate the probability that the corresponding unlabeled image sample is selected as a target unlabeled image sample. The initial target detection model to be trained is trained based on the target unlabeled image samples and the labeled image samples in the preset training set, to obtain the trained initial target detection model and the first target detection result for each target unlabeled image sample; If the training result of the current model training does not meet the preset training termination condition and the current selection weight meets the update condition, then the current selection weight is updated according to the first target detection result, and the trained initial target detection model is determined as the initial target detection model to be trained in the next model training, until the preset training termination condition is met, and the target detection model is obtained; wherein, the updated selection weight is used to determine the target unlabeled image samples for the next model training, and the update process includes: determining a new selection weight for each unlabeled image sample according to the total number of target objects included in each preset category, wherein the smaller the total number of target objects included in the preset category, the greater the weight contribution value of the selection weight corresponding to the preset category.

2. The method according to claim 1, characterized in that, The step of determining the N target unlabeled image samples for the current model training based on the current selection weights of each unlabeled image sample in the preset training set includes: Determine whether the current selection weight of each unlabeled image sample is the preset initial selection weight; If so, then determine the candidate unlabeled image samples that have not been trained in the unlabeled image samples, and randomly select N candidate unlabeled image samples from the candidate unlabeled image samples and determine them as the target unlabeled samples for the current model training. If not, then select M N unlabeled samples corresponding to the current selection weights from the preset training set, and determine the selected N unlabeled image samples as the target unlabeled samples for the current model training; where M is an integer greater than 1 and less than or equal to N.

3. The method according to claim 2, characterized in that, After the training result of the current model training does not meet the preset training termination condition, the method further includes: For each of the target unlabeled image samples, determine whether there is associated detection information for the sample index of the target unlabeled image sample; If so, then generate detection information based on the first target detection result, and replace the detection information currently associated with the sample index with the generated detection information; If not, then generate detection information based on the first target detection result, and associate the detection information with the sample index; The step of determining candidate unlabeled image samples that have not undergone model training among the unlabeled image samples includes: Unlabeled image samples corresponding to sample indices that are not associated with the detection information are identified as candidate unlabeled image samples that have not undergone model training.

4. The method according to claim 2, characterized in that, If at least one of the M current selection weights corresponds to multiple unlabeled image samples, then M is less than N; If each of the M current selection weights corresponds to an unlabeled image sample, then M is equal to N.

5. The method according to claim 1, characterized in that, The initial target detection model is trained based on the unlabeled target image samples and the labeled image samples in the preset training set to obtain the trained initial target detection model and the target detection result for each unlabeled target image sample, including: P labeled image samples of targets are randomly obtained from the preset training set; where P is an integer greater than 1, and P and N satisfy a preset ratio; The N unlabeled target image samples are input into a pre-trained model for prediction processing to obtain a pseudo-label for each unlabeled target image sample; wherein, the pre-trained model is trained based on the labeled image samples; The N unlabeled image samples and P labeled image samples are input into the target detection model to be trained for training, and the first target detection result and the second target detection result of each unlabeled image sample and each labeled image sample are obtained. Based on the pseudo-label, the first target detection result, and the second target detection result, determine the target loss function; Based on the target loss function, the model parameters of the initial target detection model to be trained are adjusted to obtain the trained initial target detection model.

6. The method according to claim 5, characterized in that, The step of inputting the N unlabeled target image samples into a pre-trained model for prediction processing to obtain a pseudo-label for each unlabeled target image sample includes: The N unlabeled target image samples are input into a pre-trained model for prediction processing, and the first prediction probability set for each unlabeled target image sample and the coordinate information of at least one reference box for each unlabeled target image sample are output; wherein, the first prediction probability set includes the first probability that each target object in the unlabeled target image sample belongs to each preset category, and the target object corresponds one-to-one with the reference box; The first predicted probability set is transformed according to a preset confidence threshold. Based on the transformed first predicted probability sets and the coordinate information of the reference box, a pseudo-label is obtained for each of the target unlabeled image samples.

7. The method according to claim 5, characterized in that, The target detection model includes a feature extraction module, a target detection module, a classification module, and a bounding box regression module; The feature extraction module is used to perform feature extraction processing on each input sample to obtain the sample features of each input sample; wherein, the input sample includes the target unlabeled image sample and the target labeled image sample; The target detection module is used to perform target detection processing on the sample features to obtain a reference box corresponding to at least one target object in each input sample; The classification module is used to classify the target object corresponding to each reference box to obtain a second predicted probability set for each input sample, wherein the second predicted probability set includes the second probability that each target object belongs to each preset category; The bounding box regression module is used to detect the position of each reference box and obtain the coordinate information of each reference box. The first target detection result and the second target detection result include: a second predicted probability set and coordinate information of each reference box.

8. The method according to claim 7, characterized in that, The step of updating the current selection weight based on the first target detection result includes: The target category corresponding to the first target detection result is determined as the target category currently corresponding to the unlabeled image sample, wherein the first target detection result is the first target detection result of the unlabeled image sample, and the target category is the preset target category to which the target object in the unlabeled image sample belongs; Based on the target category corresponding to each unlabeled image sample, determine the total number of target objects currently included in each preset category; Based on the total number, a new selection weight is determined for each of the unlabeled image samples; The new selection weight is determined as the current selection weight of the unlabeled image sample.

9. The method according to claim 8, characterized in that, The step of determining a new selection weight for each of the unlabeled image samples based on the total number includes: Obtain the total number of targets corresponding to the target category for each of the unlabeled image samples from the total number; The candidate weight of each unlabeled image sample is determined based on the total number of targets corresponding to each unlabeled image sample; The candidate weights are normalized to obtain new selection weights for each unlabeled image sample.

10. The method according to claim 5, wherein determining the target loss function based on the pseudo-label, the first target detection result, and the second target detection result includes: Based on the labels of the labeled image samples of the target and the detection results of the second target, a first loss function is determined; Based on the pseudo-label and the first target detection result, a second loss function is determined; The target loss function is determined based on the first loss function and the second loss function.

11. A target detection method, characterized in that, include: Acquire the target image data to be detected; The target image data is input into the target detection model for target detection processing to obtain the target detection result of the target image data; The target detection result includes the third probability of each target object in the target image data belonging to each preset category and the coordinate information of the reference box of each target object; The target detection model is trained by the target detection model training method according to any one of claims 1-10.

12. A training device for an object detection model, characterized in that, include: The determination module is used to determine N target unlabeled image samples for the current model training based on the current selection weights of each unlabeled image sample in the preset training set; wherein, the preset training set includes multiple unlabeled image samples and multiple labeled image samples, and N is an integer greater than 1; the current selection weights indicate the probability that the corresponding unlabeled image sample is selected as a target unlabeled image sample; The training module is used to train the initial target detection model to be trained based on the target unlabeled image samples and the labeled image samples in the preset training set, so as to obtain the trained initial target detection model and the first target detection result for each target unlabeled image sample. An update module is configured to update the current selection weights based on the first target detection result if the training result of the current model training does not meet the preset training termination condition and the current selection weights meet the update condition, and determine the trained initial target detection model as the initial target detection model to be trained in the next model training, until the preset training termination condition is met, thus obtaining the target detection model; wherein, the updated selection weights are used to determine the target unlabeled image samples for the next model training, and the update process includes: determining a new selection weight for each unlabeled image sample based on the total number of target objects included in each preset category, wherein the smaller the total number of target objects included in the preset category, the greater the weight contribution value of the selection weight corresponding to the preset category.

13. A target detection device, characterized in that, include: The acquisition module is used to acquire the target image data to be detected; The detection module is used to input the target image data into the target detection model for target detection processing, and obtain the target detection result of the target image data; The target detection result includes the third probability of each target object in the target image data belonging to each preset category and the coordinate information of the reference box of each target object; The target detection model is trained by the target detection model training method according to any one of claims 1-10.

14. An electronic device, comprising: processor; as well as, A memory configured to store computer-executable instructions configured to be executed by the processor, the executable instructions including steps for performing the method as claimed in any one of claims 1-10, or the executable instructions including steps for performing the method as claimed in claim 11.

15. A storage medium, characterized in that, The storage medium is used to store computer-executable instructions that cause a computer to perform the method as described in any one of claims 1-10, or the executable instructions cause a computer to perform the method as described in claim 11.