Target detection self-training method and system based on uncertainty
By constructing labeled and unlabeled datasets and using iterative training of teacher and student networks, highly reliable pseudo-labels are generated, solving the problems of noise and feature bias in pseudo-label data and improving the robustness and accuracy of object detection.
Patent Information
- Application Number
- CN202411188619.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-28
- Publication Date
- 2025-01-10
AI Technical Summary
Existing self-training methods for object detection suffer from problems such as high noise in pseudo-label data, large feature extraction bias, and low model robustness, making them particularly difficult to adapt to real-world applications, especially in single-stage detectors.
An uncertainty-based self-training method for object detection is adopted. By constructing labeled and unlabeled datasets, iterative training of teacher and student networks is used, combined with exponential moving average, to generate highly reliable pseudo-labels, reduce pseudo-label noise, and improve model robustness.
It improves the robustness and adaptability of the self-training process, reduces false label noise, and enhances the accuracy and speed of target detection.
Smart Images

Figure CN119295891A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of deep learning computer vision target detection, and specifically relates to a target detection self-training method and system based on uncertainty. Background Art
[0002] Target recognition aims to find all the targets (objects) of interest in an image and determine their categories and locations. It is one of the core issues in the field of computer vision. Target detection based on deep learning has very high requirements on the quality of sample labels. It requires both the classification labels of the targets in the samples and the location labels of the targets. However, in actual application scenarios, the data is often too different from the offline training data and has the characteristics of non-independent and identically distributed, which will cause the target detection recognition rate to drop, making it difficult to meet the accuracy requirements of target detection based on deep learning. Therefore, developing a method for training using a small amount of labeled data and a large amount of unlabeled data has become a key research area.
[0003] The research on self-training algorithms for autonomous unmanned systems has made significant progress in target perception tasks. The mechanism of the self-training algorithm is to improve the generalization ability of the model so that the model can learn universal feature extraction capabilities using a small amount of labeled data and continuously augmented unlabeled data. This self-learning mode enables the target recognition model to continuously use actual scene data to enable the intelligent model to acquire new knowledge and apply it to future learning and reasoning processes. To solve the above problems, the "teacher-student network structure" has become a common basic framework for target perception self-training algorithms. Self-Training and the Augmentation driven Consistency regularization (STAC), [Reference: A Simple Semi-Supervised Learning Framework for Object Detection: A Simple Semi-Supervised Learning Framework for Object Detection] uses weak data augmentation and strong data augmentation to process unlabeled data respectively, improving data consistency. The unbiased teacher follows the standard "teacher-student network structure" to generate more accurate pseudo labels. In order to balance the impact of pseudo-labels, the soft "teacher model" (Soft Teacher) uses the score of pseudo-labels as the weight for loss calculation [Reference: Soft Teacher-End-to-End Semi-Supervised Object Detection with Soft Teacher: Soft Teacher Model-End-to-End Semi-Supervised Object Detection Using Soft Teacher Model]. Label matching (LabelMatch) uses the label distribution to dynamically determine the filtering threshold of pseudo-labels of different categories, reducing a certain amount of pseudo-label noise [Reference: Label Matching Semi-SupervisedObject Detection: Label Matching Semi-SupervisedObject Detection]. Although great progress has been made in self-training methods for object detection, three key issues remain challenging: 1) There is little research on single-stage self-training, and most methods are implemented on two-stage detectors, such as Faster R-CNN [Faster R-CNN: Towards Real-TimeObject Detection with Region Proposal Networks: Faster R-CNN: Real-Time Object Detection Using Region Proposal Networks].This structure will have better feature extraction capabilities, but its training and inference speeds are difficult to cope with actual scenarios; 2) In actual use, the extracted features often have large deviations from the potential true values due to the non-independent and identically distributed assumptions between the training data and the actual battlefield data, and this deviation does not have a trend, which will seriously restrict the self-learning algorithm from improving the target recognition rate; 3) Due to the serious inconsistency problem of pseudo-labels, the quantity and quality of pseudo-labels generated by the "teacher model" fluctuate greatly, and unqualified pseudo-labels may mislead model updates. Summary of the invention
[0004] (I) Purpose of the invention
[0005] The purpose of the present invention is to provide a method and system for target detection self-training based on uncertainty, so as to solve the problem that the pseudo-label data has a lot of noise due to the small amount of label data or the large gap between the actual scene and the pre-training scene during the target detection self-training process, form a highly reliable target detection self-training system, and improve the adaptability of self-training to uncertainty.
[0006] (II) Technical solution
[0007] To solve the above problems, a first aspect of the present invention provides an uncertainty-based target detection self-training method, comprising:
[0008] Constructing a target data set, wherein the target data set includes labeled data samples and unlabeled data samples;
[0009] Inputting the labeled data sample into the teacher network to obtain a prediction result of the labeled data sample;
[0010] Calculating a first total error based on the prediction result of the labeled data sample and the true value of the labeled data sample, and inputting the first total error into the teacher network for iterative training to obtain a trained first model;
[0011] Inputting the unlabeled data sample into the teacher network to obtain a pseudo label for the unlabeled data sample;
[0012] Inputting the unlabeled data sample into the student network to obtain a prediction result of the unlabeled data sample;
[0013] Calculating a second total error based on the prediction result of the unlabeled data sample and the pseudo label of the unlabeled data sample, and inputting the second total error into the student network for iterative training to obtain a trained second model;
[0014] The first model and the second model are integrated and updated using exponential moving average to obtain a final training detection model.
[0015] Further, the calculating the first total error based on the prediction result of the labeled data sample and the true value of the labeled data sample includes:
[0016] Based on the prediction result of the labeled data sample and the true value of the labeled data sample, a first error value and a first distribution calibration error value are calculated respectively, and then the first error value and the first distribution calibration error value are weighted to obtain the first total error.
[0017] Furthermore, the first error value is calculated using a GIOU loss function, and the first distribution calibration error value is calculated using a KL divergence loss function.
[0018] Furthermore, inputting the unlabeled data sample into the teacher network to obtain a pseudo label of the unlabeled data sample includes:
[0019] Generate a corresponding plurality of views for each of the unlabeled data samples;
[0020] The multiple views are simultaneously input into the teacher network, and are sequentially subjected to inverse transformation, non-maximum suppression aggregation and threshold screening to obtain a pseudo label corresponding to each of the unlabeled data samples, wherein the threshold screening is used to screen the pseudo label.
[0021] Furthermore, the multiple views include: an original image, a flipped image, a scaled image and a stretched image of the same sample.
[0022] Furthermore, the step of inputting the labeled data sample into the teacher network to obtain a prediction result of the labeled data sample includes:
[0023] Inputting the labeled data sample into the backbone of the teacher network to obtain a first extracted feature corresponding to the labeled data sample;
[0024] Using the first distribution parameter μ h,w , the second distribution parameter σ h,w The first extracted features corresponding to the labeled data samples are embedded, and then the second extracted features corresponding to the labeled data samples are generated by re-parameterization, wherein the first distribution parameter μ h,w represents the first distribution parameter value of the corresponding feature graph in the hth row and wth column, and the second distribution parameter σ h,w represents the second distribution parameter value corresponding to the hth row and wth column of the feature graph;
[0025] The second extracted features corresponding to the labeled data samples are successively input into the feature pyramid module and the detection head of the teacher network to generate the prediction results of the labeled data samples.
[0026] Furthermore, the use of the first distribution parameter μ h,w , the second distribution parameter σ h,w Embedding the first extracted features corresponding to the labeled data sample, and then generating the second extracted features corresponding to the labeled data sample through re-parameterization includes:
[0027] After the first extracted features corresponding to the labeled data samples are input into the first fully connected layer, they are first passed through the first distribution parameter μ h,w , the second distribution parameter σ h,w Perform the first embedding, then perform the second embedding through the second μ+εσ, then pass through the second fully connected layer, and then re-parameterize to generate the second extracted features corresponding to the labeled data sample; wherein the second fully connected layer has the opposite dimension to the first fully connected layer, μ is the first total distribution parameter of the corresponding feature map, and σ is the second total distribution parameter of the corresponding feature map.
[0028] Furthermore, the step of inputting the unlabeled data sample into the student network to obtain a prediction result of the unlabeled data sample includes:
[0029] The unlabeled data samples are subjected to strong enhancement processing to obtain two branches of strongly enhanced images;
[0030] Inputting the strongly enhanced images of the two branches into the backbone of the student network to obtain first extracted features corresponding to the unlabeled samples corresponding to the two branches respectively;
[0031] Using the third distribution parameter μ h,w , the fourth distribution parameter σ h,w Embedding the first extracted features corresponding to the unlabeled samples, and then generating the second extracted features corresponding to the unlabeled samples through re-parameterization;
[0032] The second extracted features corresponding to the unlabeled samples are sequentially input into the feature pyramid model and the detection head of the student network to generate prediction results for the unlabeled data samples.
[0033] Furthermore, the third distribution parameter μ h,w and the fourth distribution parameter σ h,w The calculation formulas are:
[0034] The third distribution parameter
[0035] Fourth distribution parameter
[0036] where μ1h ,w , μ2h ,wdenote the third sub-distribution parameter of the first branch and the third sub-distribution parameter of the second branch, σ 1h,w With σ 2h,w represent a fourth sub-distribution parameter of a first branch and a fourth sub-distribution parameter of a second branch respectively, and the two branches include the first branch and the second branch.
[0037] In addition, a second aspect of the present invention provides an uncertainty-based target detection self-training system, comprising:
[0038] A construction module, used to construct a target data set, wherein the target data set includes labeled data samples and unlabeled data samples;
[0039] The first prediction module is used to input the labeled data sample into the teacher network to obtain the prediction result of the labeled data sample,
[0040] A first training module, configured to calculate a first total error based on the prediction result of the labeled data sample and the true value of the labeled data sample, and input the first total error into the teacher network for iterative training to obtain a trained first model;
[0041] A pseudo label generation module, used for inputting the unlabeled data sample into the teacher network to obtain a pseudo label for the unlabeled data sample;
[0042] A second prediction module is used to input the unlabeled data sample into the student network to obtain a prediction result of the unlabeled data sample;
[0043] A second training module is used to calculate a second total error based on the prediction result of the unlabeled data sample and the pseudo label of the unlabeled data sample, and input the second total error into the student network for iterative training to obtain a trained second model;
[0044] The final model generation module is used to use exponential moving average to integrate and update the first model and the second model to obtain a final training detection model.
[0045] The present invention proposes a target detection self-training method and system based on uncertainty. The method is a general feature generation method for uncertainty estimation in a single-stage target detection framework. The normal distribution (Gaussian distribution) is used to estimate the distribution probability of samples in the latent space. The variance and mean are used to represent the uncertainty, which can improve the robustness in the self-training process. The principle is: first, based on the prediction results of the labeled data samples and the true values of the labeled data samples, a first total error is calculated, and the first total error is input into the teacher network for iterative training to obtain a trained first model; then, based on the prediction results of the unlabeled data samples and the pseudo labels of the unlabeled data samples, a second total error is calculated, and the second total error is input into the student network for iterative training to obtain a trained second model, wherein the first error includes the error value (first error) between the labeled data prediction results and the true value and the embedded distribution calibration error value (first distribution calibration error), and the second error includes the error value (second error) between the unlabeled data prediction results and the pseudo labels and the embedded distribution calibration error value (second distribution calibration error). Finally, the first training model and the second training model are integrated and updated using the exponential moving average to obtain a final training detection model. The present invention is based on the improvement of single-stage network without anchors, so the algorithm runs faster and has higher processing effect. At the same time, it solves the problem of low model robustness caused by the uncertainty of feature offset in the whole self-training process. The present invention can also greatly reduce the data noise in pseudo-labels. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] Figure 1 is a flow chart of the uncertainty-based target detection self-training method of the present invention;
[0047] Figure 2 is a schematic diagram of the uncertainty-based target detection self-training method of the present invention;
[0048] Figure 3 It is a network structure in which labeled data samples are input into a teacher network to obtain prediction results according to a specific embodiment of the present invention;
[0049] Figure 4 for Figure 3 The module structure diagram of the middle part encoding and decoding;
[0050] Figure 5 is a schematic diagram of a multi-view pseudo label generation method according to a specific embodiment of the present invention;
[0051] Figure 6 It is a network structure in which unlabeled data samples are input into a student network to obtain prediction results in a specific embodiment of the present invention;
[0052] Figure 7Schematic diagram of the uncertainty-based target detection self-training system of the present invention. DETAILED DESCRIPTION
[0053] In order to make the purpose, technical scheme and advantages of the present invention clearer, the present invention is further described in detail below in conjunction with specific embodiments and with reference to the accompanying drawings. It should be understood that these descriptions are only exemplary and are not intended to limit the scope of the present invention. In addition, in the following description, the description of well-known structures and technologies is omitted to avoid unnecessary confusion of the concept of the present invention.
[0054] On the one hand, if Figure 1 As shown, the present invention provides a target detection self-training method based on uncertainty, comprising:
[0055] S101, constructing a target data set, wherein the target data set includes labeled data samples and unlabeled data samples;
[0056] S102, inputting the labeled data sample into the teacher network to obtain the prediction result of the labeled data sample;
[0057] S103, calculating a first total error based on the prediction result of the labeled data sample and the true value of the labeled data sample, and inputting the first total error into the teacher network for iterative training to obtain a trained first model;
[0058] S104, inputting the unlabeled data sample into the teacher network to obtain a pseudo label of the unlabeled data sample;
[0059] S105, inputting the unlabeled data sample into the student network to obtain the prediction result of the unlabeled data sample;
[0060] S106, based on the prediction results of the unlabeled data samples and the pseudo-labels of the unlabeled data samples, calculate a second total error, input the second total error into the student network for iterative training, and obtain a trained second model; wherein the calculation of the second total error based on the prediction results of the unlabeled data samples and the pseudo-labels of the unlabeled data samples includes: based on the prediction results of the unlabeled data samples and the pseudo-labels of the unlabeled data samples, respectively calculate a second error value and a second distribution calibration error value, and then weight the second error value and the second distribution calibration error value to obtain the second total error.
[0061] S107, using exponential moving average to integrate and update the first model and the second model to obtain a final training detection model. Figure 2 Schematic diagram of the uncertainty-based target detection self-training method of the present invention. Figure 2The process includes three stages: warm-up training, pseudo-label generation, and self-training. The warm-up training corresponds to S102 and S103, the pseudo-label generation corresponds to S104, the self-training corresponds to S105 and S106, and the arrow indicating the sliding exponential average in the figure corresponds to S107.
[0062] The above steps are described in detail below in combination with specific implementation:
[0063] S101 constructs a target data set, specifically including: selecting a small amount of labeled data target detection data set S_1 for warm-up training, selecting a large amount of unlabeled data target detection data set S_2 for self-training, and merging to construct a new data set S', where S_1 is a labeled data sample, S_2 is an unlabeled data sample, and S' is the target data set.
[0064] S102 inputs the labeled data sample into the teacher network to obtain the prediction result of the labeled data sample, which specifically includes: inputting the pictures in S_1 into the teacher network in batches to obtain the prediction results of the corresponding batches of pictures in S_1. The process is as follows Figure 3 As shown, the backbone network of the "teacher network" adopts the CSPDarknet53 structure of YOLOX. First, the image in S_1 is extracted from different feature layers through the backbone feature extractor (backbone part) to extract multi-scale resolution feature maps to obtain the first extracted features corresponding to the S_1 image.
[0065] like Figure 3 As shown, using the first distribution parameter μ h,w , the second distribution parameter σ h,w The first extracted features corresponding to the S_1 image are embedded, and then the second extracted features corresponding to the S_1 image are generated through re-parameterization. Finally, the features are successively input into the feature pyramid module and the detection head of the teacher network to generate the prediction results of the corresponding batch of images in S_1, where the first distribution parameter μ h,w Indicates the value of the first distribution parameter in the hth row and wth column of the corresponding feature graph, and the second distribution parameter σ h,w represents the second distribution parameter value in the hth row and wth column of the corresponding feature graph, μ is the first total distribution parameter of the corresponding feature graph, and σ is the second total distribution parameter of the corresponding feature graph. h,w , the second distribution parameter σ h,w The embedding process of the first extracted feature corresponding to the S_1 image is as follows Figure 4 As shown: The first extracted feature corresponding to the S_1 image is input into the first fully connected layer f l (·) and then pass through the first distribution parameter μ h,w , the second distribution parameter σ h,w Perform the first embedding, then perform the second embedding through μ+εσ, and then pass through the second fully connected layer where f l (·) is a fully connected layer of appropriate dimension, For and f l (·) fully connected layers of opposite dimensions, Figure 4 Where ε~N(0,1) is random noise, For and f l The bracket part (·) is a general representation of feature extraction. In the specific implementation, for the entire feature map, the full connection operation in the embedding and reparameterization of each point in the feature map is completed in the form of point-by-point convolution. Taking a certain layer of the feature pyramid as an example, the input features of this module are:
[0066]
[0067] Among them, H, W, and C represent the height, width, and dimension of the feature respectively. is a set of real numbers. After backbone extraction of the input features in (1), the first distribution parameter is used Second distribution parameter (h=1…H,w=1…W) embeds the features, and then generates new features by reparameterization: e is the natural logarithm, ε is the noise of the standard normal distribution, including the first ε, the first ε and the second distribution parameter σ h,w Correspondingly, the first ε here is a dimension and the second distribution parameter σ h,w Vectors of equal size, Refers to the value of all channels of the input feature at row h and column w. It is then processed by spatial pyramid pooling and the prediction result is generated by the predictor.
[0068] S103 calculates a first total error based on the prediction results of the labeled data samples and the true values of the labeled data samples, and inputs the first total error into the teacher network for iterative training to obtain a trained first model (using a dual loss function to constrain neural network training), specifically including: using GIOU to calculate the error L between the prediction results of each batch of pictures in S_1 and the true value content (First error value), use KL divergence to calculate the calibration error of the embedded distribution (first distribution calibration error value) Where N(0; I) represents a standard normal distribution, and the total error value L is obtained by weighting sum , use the Adam optimizer to update the network parameters so that the total error value converges to the minimum, perform constrained training on the blurred image restoration network, and obtain the first training model after training.
[0069] S104 inputs the unlabeled data sample into the teacher network to obtain a pseudo label for the unlabeled data sample. The reasoning process is similar to S102, but multiple views are used to infer the unlabeled image in S_2, such as Figure 5 As shown, each of the unlabeled data samples is first generated with corresponding multiple views; the multiple views are simultaneously input into the teacher network, and then successively undergo inverse transformation, non-maximum suppression aggregation and threshold screening to obtain the pseudo-label corresponding to each of the unlabeled data samples. The inverse transformation is used to change the sizes of the multiple views back to the original sizes, and the purpose of non-maximum suppression aggregation is to reduce the number of frames to filter out some unnecessary candidate frames. The multiple views include original images, flipped images, scaled images, and stretched images. The threshold screening is used to screen pseudo-labels, and threshold screening (local threshold method) is used to determine the target confidence threshold that needs to be retained based on the score histogram: First, the candidate predictions p1,…,p of the same sample are n Perform histogram statistics and select the square column with the lowest density as the confidence threshold. The final pseudo-labeled dataset is D p , the calculation formula is as follows:
[0070]
[0071] In formula (2), N p is the number of candidate images for which at least one prediction satisfies yc ≥ τ (yc is the confidence of the prediction, τ is the threshold), is the image from the i-th perspective, is the pseudo label of the i-th view.
[0072] S105 inputs the unlabeled data sample into the student network to obtain the prediction result of the unlabeled data sample, specifically including: Figure 6 As shown in Figure 1, the "teacher network" is copied to form a "student network". The reasoning process is similar to S102, but two strong enhancement methods are used to enhance the image and infer the unlabeled image in S_2. After the sample is strongly enhanced (for example, by adjusting the contrast, adding blur, adding noise, etc.), two branches of strongly enhanced images are obtained, namely the first branch image (I1) and the second branch image (I2). The two branches of strongly enhanced images are input into the backbone of the student network to obtain the normal distribution parameters of each branch. The first branch is μ 1h,w and σ 1h,w , the second branch is μ 2h,w and σ 2h,w , ( Figure 6 μ1 in is μ 1h,w , μ2 is μ 2h,w , σ1 is σ 1h,w , σ2 is σ 2h,w ), and then merge the normal distribution parameters of each branch, using the third distribution parameter μ h,w and the fourth distribution parameter σ h,w To embed the distribution, the calculation formulas are as follows:
[0073] The third distribution parameter
[0074] Fourth distribution parameter
[0075] In formula (3) and formula (4), by adjusting the third distribution parameter μ h,w , the fourth distribution parameter σ h,w The distribution is merged and embedded with μ+εσ (where μ is the third total distribution parameter of the corresponding feature map, σ is the fourth total distribution parameter of the corresponding feature map, and ε also includes the second ε, which is a dimension and the fourth distribution parameter σ h,w The vectors of equal size are then reparameterized and then subjected to spatial pyramid pooling and the prediction results of S_2 samples are generated by the predictor. Among them, μ is the first total distribution parameter of the corresponding feature map, σ is the second total distribution parameter of the corresponding feature map, μ1h ,w , μ2h ,w represent the third sub-distribution parameter of the first branch and the third sub-distribution parameter of the second branch (i.e., μ1h ,w is the parameter value of the third sub-distribution in the hth row and wth column of the feature graph corresponding to the first branch, μ2h ,w is the parameter value of the third sub-distribution in the hth row and wth column of the second branch), σ 1h,w With σ 2h,w denote the fourth sub-distribution parameter of the first branch and the fourth sub-distribution parameter of the second branch (i.e., σ 1h,w is the parameter value of the fourth sub-distribution in the hth row and wth column of the feature graph corresponding to the first branch, σ 2h,w is the parameter value of the third and fourth sub-distribution at the hth row and wth column of the second branch).
[0076] S106 calculates a second total error based on the prediction results of the unlabeled data samples and the pseudo labels of the unlabeled data samples, and inputs the second total error into the student network for iterative training to obtain a trained second model, specifically including: using GIOU to calculate the error L between the prediction results of each batch of pictures in S_2 and the true value content (Second error value), use KL divergence to calculate the calibration error of the embedded distribution (second distribution calibration error value) L KL , the calculation formula is:
[0077]
[0078] Then, the second error value and the second distribution calibration error value are weighted to obtain the total error value L sum (Second total error), use Adam optimizer to update network parameters so that the total error value converges to the minimum, perform constrained training on the blurred image restoration network, and obtain the trained second model.
[0079] S107, using exponential moving average to integrate and update the first training model and the second training model to obtain a final training detection model.
[0080] On the other hand, Figure 7 As shown, another aspect of the present invention provides an uncertainty-based target detection self-training system, comprising:
[0081] A construction module 201 is used to construct a target data set, wherein the target data set includes labeled data samples and unlabeled data samples;
[0082] A first prediction module 202, used for inputting the labeled data sample into the teacher network to obtain a prediction result of the labeled data sample;
[0083] A first training module 203 is used to calculate a first total error based on the prediction result of the labeled data sample and the true value of the labeled data sample, and input the first total error into the teacher network for iterative training to obtain a trained first model;
[0084] A pseudo label generation module 204 is used to input the unlabeled data sample into the teacher network to obtain a pseudo label for the unlabeled data sample;
[0085] A second prediction module 205, used for inputting the unlabeled data sample into the student network to obtain a prediction result of the unlabeled data sample;
[0086] A second training module 206 is used to calculate a second total error based on the prediction result of the unlabeled data sample and the pseudo label of the unlabeled data sample, and input the second total error into the student network for iterative training to obtain a trained second model;
[0087] The final model generation module 207 is used to integrate and update the first model and the second model using exponential moving average to obtain a final training detection model.
[0088] The present invention provides a target detection self-training method and system based on uncertainty.
[0089] Using YOLOX as the backbone network, a single-stage anchor-free self-training form is proposed, and the algorithm runs faster and has higher processing effect; the present invention uses normal distribution to estimate the distribution probability of samples in the latent space, and expresses its uncertainty through variance and mean. In the warm-up training stage, the candidate target is embedded into a normal distribution in the neck part, and then reparameterized, and finally the prediction result is derived from the true value and trained. The pre-training model can be made more robust and the accuracy of the model in subsequent process predictions can be improved. In the process of generating pseudo-labels, unlabeled images are inferred under multiple views, and the final results are screened by the local threshold method for pseudo-labels. In the self-training process, by using a variety of strong enhancement methods, the different enhancement results of the candidate target are embedded into a normal distribution in the neck part, and then reparameterized, and finally the prediction result is derived from the pseudo-label and trained. The sample consistency (that is, the same sample with different form features obtains the same prediction) can be enhanced, thereby improving the adaptability of self-training to uncertainty. The present invention uses a multi-perspective pseudo-label prediction mode combined with a local threshold screening method to reduce the uncertainty of pseudo-labels and can significantly reduce data noise in pseudo-labels.
Claims
1. A target detection self-training method based on uncertainty, characterized in that: include: Constructing a target data set, wherein the target data set includes labeled data samples and unlabeled data samples; Inputting the labeled data sample into the teacher network to obtain a prediction result of the labeled data sample; Calculating a first total error based on the prediction result of the labeled data sample and the true value of the labeled data sample, and inputting the first total error into the teacher network for iterative training to obtain a trained first model; Inputting the unlabeled data sample into the teacher network to obtain a pseudo label for the unlabeled data sample; Inputting the unlabeled data sample into the student network to obtain a prediction result of the unlabeled data sample; Calculating a second total error based on the prediction result of the unlabeled data sample and the pseudo label of the unlabeled data sample, and inputting the second total error into the student network for iterative training to obtain a trained second model; The first model and the second model are integrated and updated using exponential moving average to obtain a final training detection model.
2. The uncertainty-based target detection self-training method according to claim 1, characterized in that: The calculating the first total error based on the prediction result of the labeled data sample and the true value of the labeled data sample comprises: Based on the prediction result of the labeled data sample and the true value of the labeled data sample, a first error value and a first distribution calibration error value are calculated respectively, and then the first error value and the first distribution calibration error value are weighted to obtain the first total error.
3. The uncertainty-based target detection self-training method according to claim 2, characterized in that: The first error value is calculated using the GIOU loss function, and the first distribution calibration error value is calculated using the KL divergence loss function.
4. The uncertainty-based target detection self-training method according to claim 1, characterized in that: The step of inputting the unlabeled data sample into the teacher network to obtain a pseudo label for the unlabeled data sample comprises: Generate a corresponding plurality of views for each of the unlabeled data samples; The multiple views are simultaneously input into the teacher network, and are sequentially subjected to inverse transformation, non-maximum suppression aggregation and threshold screening to obtain a pseudo label corresponding to each of the unlabeled data samples, wherein the threshold screening is used to screen the pseudo label.
5. The uncertainty-based target detection self-training method according to claim 4, characterized in that: The multiple views include: an original image, a flipped image, a scaled image and a stretched image of the same sample.
6. The uncertainty-based target detection self-training method according to claim 1, characterized in that: The step of inputting the labeled data sample into the teacher network to obtain a prediction result of the labeled data sample includes: Inputting the labeled data sample into the backbone of the teacher network to obtain a first extracted feature corresponding to the labeled data sample; Using the first distribution parameter μ h,w , the second distribution parameter σ h,w The first extracted features corresponding to the labeled data samples are respectively embedded, and then the second extracted features corresponding to the labeled data samples are generated by re-parameterization, where the first distribution parameter μ h,w represents the first distribution parameter value of the corresponding feature graph in the hth row and wth column, and the second distribution parameter σ h,w represents the second distribution parameter value corresponding to the hth row and wth column of the feature graph; The second extracted features corresponding to the labeled data samples are successively input into the feature pyramid module and the detection head of the teacher network to generate the prediction results of the labeled data samples.
7. The uncertainty-based target detection self-training method according to claim 6, characterized in that: The first distribution parameter μ is used h,w , the second distribution parameter σ h,w Embedding the first extracted features corresponding to the labeled data sample, and then generating the second extracted features corresponding to the labeled data sample through re-parameterization includes: After the first extracted features corresponding to the labeled data samples are input into the first fully connected layer, they are first passed through the first distribution parameter μ h,w , the second distribution parameter σ h,w Perform the first embedding, then perform the second embedding through μ+εσ, then pass through the second fully connected layer, and then generate the second extracted features corresponding to the labeled data sample through reparameterization; wherein the second fully connected layer has the opposite dimension to the first fully connected layer, μ is the first total distribution parameter of the corresponding feature map, σ is the second total distribution parameter of the corresponding feature map, ε is the noise of the normal distribution, including the first ε, and the first ε corresponds to the second distribution parameter σ h,w.
8. The uncertainty-based target detection self-training method according to claim 1, characterized in that: The step of inputting the unlabeled data sample into the student network to obtain the prediction result of the unlabeled data sample includes: The unlabeled data samples are subjected to strong enhancement processing to obtain two branches of strongly enhanced images; Inputting the strongly enhanced images of the two branches into the backbone of the student network to obtain first extracted features corresponding to the unlabeled samples corresponding to the two branches respectively; Using the third distribution parameter μ h,w , the fourth distribution parameter σ h,w Embedding the first extracted features corresponding to the unlabeled samples, and then generating the second extracted features corresponding to the unlabeled samples through re-parameterization; The second extracted features corresponding to the unlabeled samples are sequentially input into the feature pyramid model and the detection head of the student network to generate prediction results for the unlabeled data samples.
9. The uncertainty-based target detection self-training method according to claim 8, characterized in that: The third distribution parameter μ h,w and the fourth distribution parameter σ h,w The calculation formulas are: The third distribution parameter Fourth distribution parameter where μ 1h,w , μ 2h,w denote the third sub-distribution parameter of the first branch and the third sub-distribution parameter of the second branch, σ 1h,w With σ 2h,w represent a fourth sub-distribution parameter of a first branch and a fourth sub-distribution parameter of a second branch respectively, and the two branches include the first branch and the second branch.
10. An uncertainty-based target detection self-training system, characterized in that: include: A construction module, used to construct a target data set, wherein the target data set includes labeled data samples and unlabeled data samples; A first prediction module, used for inputting the labeled data sample into the teacher network to obtain a prediction result of the labeled data sample; A first training module, configured to calculate a first total error based on the prediction result of the labeled data sample and the true value of the labeled data sample, and input the first total error into the teacher network for iterative training to obtain a trained first model; A pseudo label generation module, used for inputting the unlabeled data sample into the teacher network to obtain a pseudo label for the unlabeled data sample; A second prediction module is used to input the unlabeled data sample into the student network to obtain a prediction result of the unlabeled data sample; A second training module is used to calculate a second total error based on the prediction result of the unlabeled data sample and the pseudo label of the unlabeled data sample, and input the second total error into the student network for iterative training to obtain a trained second model; The final model generation module is used to use exponential moving average to integrate and update the first model and the second model to obtain a final training detection model.