Passive domain adaptive target detection method and device

By constructing feature prototypes and correcting pseudo labels, the problem of poor pseudo label quality in passive domain adaptive target detection is solved, and the detection performance and accuracy of the target detection model in new environments are improved.

CN117636086BActive Publication Date: 2024-09-24INST OF AUTOMATION CHINESE ACAD OF SCI
View PDF 12 Cites 0 Cited by

Patent Information

Application Number
CN202311332829.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-10-13
Publication Date
2024-09-24
Estimated Expiration
2043-10-13

AI Technical Summary

Technical Problem

In existing passive domain adaptive target detection methods, the quality of pseudo labels is poor, resulting in poor detection performance of the target detection model in new environments, especially the performance of rare category target detection is affected, and the model is sensitive to domain shift. resulting in lower accuracy.

Method used

The teacher model extracts the first instance features of various targets from the target domain data set, builds multiple feature prototypes, corrects the target detection results of the target domain data set, generates more accurate pseudo labels, and uses them to train the student model. Improve the accuracy of target detection.

Benefits of technology

It improves the quality of pseudo labels and the detection performance of the target detection model in the target domain, reduces the sensitivity to domain offset, and improves the accuracy of target detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117636086B
    Figure CN117636086B
Patent Text Reader

Abstract

The present invention provides a passive domain adaptive target detection method and device, comprising: constructing multiple feature prototypes of each type of target based on the first instance features of each type of target extracted from part of the images of the target domain data set by a teacher model; correcting the target detection results of each image in the target domain data set obtained by the teacher model according to the multiple feature prototypes of each type of target, and obtaining pseudo labels of each image; using each image of the target domain data set as a sample, using the pseudo labels of each image as a label to train a student model, and using the trained student model to detect targets in the image to be detected; the teacher model and the student model are obtained by pre-training a target detection model using a source domain data set. The present invention uses multiple feature prototypes of various types of targets in the target domain to guide the generation of more accurate pseudo labels as supervisory information for model training, thereby improving the accuracy of target detection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer vision technology, and in particular to a passive domain adaptive target detection method and device. Background Art

[0002] When performing target detection, if the target detection model trained with the training set is used to detect targets in a new environment, there is a problem of inconsistent data distribution between the training set (source domain) and the test set (target domain), resulting in poor performance of the trained target detection model in the new environment. Collecting and annotating a large enough dataset for a new environment is time-consuming, labor-intensive, and costly.

[0003] To solve this problem, passive domain adaptive target detection was proposed, which aims to transfer the knowledge in the target detection model trained in the source domain to the target domain. Without the need to label and access the target domain data, the detection performance of the target detection model in the target domain is improved, greatly reducing the labeling cost.

[0004] Existing passive domain adaptation object detection methods usually adopt a pseudo-label generation strategy. The object detection model pre-trained on the source domain generates pseudo-labels for the target domain dataset, which are used as supervision information on the target domain to fine-tune the object detector. In this type of method, the quality of the pseudo-labels affects the performance of the object detection model after adaptation. For example, the class imbalance problem will introduce noisy pseudo-labels because common categories receive more attention, affecting the performance of object detection for rare categories. Therefore, problems such as inaccurate pseudo-labels and the sensitivity of the object detection model to domain shift lead to low accuracy of object detection. Summary of the invention

[0005] The present invention provides a passive domain adaptive target detection method and device, which are used to solve the defect that the quality of pseudo labels generated by the target detection model for the target domain data set in the prior art is poor, which affects the accuracy of target detection, and improve the quality of pseudo labels, thereby improving the accuracy of target detection.

[0006] The present invention provides a passive domain adaptive target detection method, comprising:

[0007] Based on the first instance features of various types of targets extracted by the teacher model from some images of the target domain dataset, multiple feature prototypes of the various types of targets are constructed;

[0008] According to the multiple feature prototypes of the various types of targets, the target detection results of each image in the target domain dataset obtained by the teacher model are corrected to obtain pseudo labels of each image;

[0009] Using each image of the target domain data set as a sample, using the pseudo label of each image as a label to train the student model, and using the trained student model to detect the target in the image to be detected;

[0010] The teacher model and the student model are obtained by pre-training the target detection model using a source domain dataset.

[0011] According to a passive domain adaptation target detection method provided by the present invention, the first instance features of various targets extracted from part of the images of the target domain data set based on the teacher model are used to construct multiple feature prototypes of the various targets, including:

[0012] Randomly extracting some images from the target domain dataset;

[0013] Detecting a first category label and a first detection frame of each target in the partial image based on the teacher model, and using an image area within the first detection frame of the target as the first instance feature;

[0014] Determining objects in the partial image that belong to the same category according to the first category labels of the objects;

[0015] According to the first instance features of each type of target, a plurality of feature prototypes of each type of target are constructed.

[0016] According to a passive domain adaptive target detection method provided by the present invention, the step of constructing multiple feature prototypes of each type of target based on first instance features of each type of target includes:

[0017] Clustering the first instance features of the various types of targets multiple times, with the number of clusters in each clustering being different;

[0018] The silhouette score of each clustering is determined, and the cluster center of each cluster in the cluster corresponding to the largest silhouette score is used as the feature prototype of each type of target.

[0019] According to a passive domain adaptive target detection method provided by the present invention, the target detection result of each image in the target domain data set obtained by the teacher model is corrected according to the multiple feature prototypes of the various types of targets to obtain a pseudo label of each image, including:

[0020] Detecting a second category label, a second detection frame, and a confidence score that each target belongs to the second category label of each target from each image of the target domain dataset based on the teacher model;

[0021] Using the image area within the second detection frame of each target as the second instance feature of each target;

[0022] Correcting the second category label of each target and the confidence score that each target belongs to the second category label according to the similarity between the second instance feature of each target and the multiple feature prototypes of each type of target;

[0023] Determine a pseudo label for each target according to the second detection box, the corrected second category label, and the corrected confidence score of each target.

[0024] According to a passive domain adaptive target detection method provided by the present invention, the second category label of each target and the confidence score that each target belongs to the second category label are corrected according to the similarity between the second instance feature of each target and the multiple feature prototypes of each type of target, including:

[0025] Determine a first maximum value among similarities between the second instance feature of each target and a plurality of feature prototypes of each type of target;

[0026] According to the first category label corresponding to the maximum value among the first maximum values ​​corresponding to all categories of targets, as the corrected second category label of each target;

[0027] The maximum value among the first maximum values ​​corresponding to all categories of targets is used as the corrected confidence score of each target.

[0028] According to a passive domain adaptation target detection method provided by the present invention, the step of using the image area within the second detection frame of each target as the second instance feature of each target includes:

[0029] Comparing the confidence score of each target belonging to the second category label with a preset threshold, where the preset threshold is determined according to the number of preset detection categories corresponding to the target detection model;

[0030] When the confidence score is less than or equal to the preset threshold, the image area within the second detection frame of each target is used as the second instance feature of each target.

[0031] According to a passive domain adaptation target detection method provided by the present invention, each image of the target domain data set is used as a sample, and the pseudo label of each image is used as a label to train the student model, including:

[0032] Detecting a third category label, a third detection frame, and a confidence score that each target belongs to the third category label of each target from each image of the target domain dataset based on the student model;

[0033] Using the image area within the third detection frame of each target as the third instance feature of each target;

[0034] Determine a first loss for each target according to a loss between a third category label of each target in each image of the target domain dataset and the corrected second category label, and a loss between a third detection frame and a second detection frame;

[0035] Determine the second loss of each target according to the similarity between the second instance feature, the third instance feature of each target and the plurality of feature prototypes of each type of target;

[0036] Determining a third loss for each target according to the confidence score that each target belongs to the third category label and the corrected confidence score;

[0037] The student model is trained according to the first loss, the second loss and the third loss.

[0038] According to a passive domain adaptive target detection method provided by the present invention, the second loss of each target is determined according to the similarity between the second instance feature and the third instance feature of each target and the plurality of feature prototypes of each type of target, including:

[0039] Determine a first maximum value among similarities between the second instance feature of each target and a plurality of feature prototypes of each type of target;

[0040] Determine a second maximum value of similarities between the third instance feature of each target and a plurality of feature prototypes of each type of target;

[0041] A second loss of each of the targets is determined according to the first maximum value and the second maximum value.

[0042] According to a passive domain adaptation target detection method provided by the present invention, while taking each image of the target domain data set as a sample and taking the pseudo label of each image as a label to train the student model, it also includes:

[0043] Determining new cluster centers of each class of targets according to the second instance features of each target newly generated in each preset number of iterations during the training process;

[0044] Selecting the feature prototypes that are most similar to the new cluster centers of the various types of targets from the feature prototypes of the various types of targets;

[0045] The new cluster centers of the various types of targets are used to update the selected feature prototypes of the various types of targets.

[0046] The present invention also provides a passive domain adaptive target detection device, comprising:

[0047] A construction module, configured to construct a plurality of feature prototypes of each type of target based on first instance features of each type of target extracted by the teacher model from a portion of images of the target domain dataset;

[0048] A generation module, configured to correct the target detection result of each image in the target domain data set obtained by the teacher model according to the multiple feature prototypes of the various types of targets, so as to obtain a pseudo label of each image;

[0049] The training module is used to use each image of the target domain data set as a sample, use the pseudo label of each image as a label to train the student model, and use the trained student model to detect the target in the image to be detected.

[0050] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the passive domain adaptive target detection method as described above is implemented.

[0051] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the passive domain adaptive target detection method as described above is implemented.

[0052] The present invention also provides a computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the passive domain adaptive target detection method as described above is implemented.

[0053] The passive domain adaptive target detection method and device provided by the present invention constructs multiple feature prototypes of each type of target by using the first instance features of each type of target extracted from part of the images of the target domain data set by the teacher model, thereby providing more representative category information for the target domain. After the target detection results of each image in the target domain data set predicted by the teacher model are corrected by the multiple feature prototypes of each type of target, more accurate pseudo labels are obtained as supervision information for the student model training, thereby improving the accuracy of target detection. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0055] Figure 1 It is a flowchart of the passive domain adaptive target detection method provided by the present invention;

[0056] Figure 2 It is a schematic diagram of the framework of the passive domain adaptive target detection method provided by the present invention;

[0057] Figure 3 It is a structural schematic diagram of the passive domain adaptive target detection device provided by the present invention;

[0058] Figure 4 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION

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

[0060] Combine the following Figure 1 A passive domain adaptive target detection method of the present invention is described, comprising:

[0061] Step 101, constructing multiple feature prototypes of various types of targets based on first instance features of various types of targets extracted by the teacher model from some images of the target domain dataset;

[0062] Target domain dataset Including N t images, and the images in the target domain dataset are unlabeled. Extract part of the image.

[0063] Input the extracted part of the image into the teacher model θ tea Target detection is performed in the image to obtain the first instance feature f of the target in the partial image. t , that is, the image area within the detection box of the target, and the first category label of the target.

[0064] According to the first category label of the target, each type of target in the partial image is counted. The first instance features of each type of target are analyzed to obtain multiple feature prototypes of each type of target. The multiple feature prototypes of each type of target are used to represent the features of each type of target.

[0065] The cluster centers adaptively generated according to the distribution of the first instance features of each type of target can be used as multiple feature prototypes of each type of target, thereby providing more representative category information for the target domain. The migration of knowledge from the source domain to the target domain is guided by constructing category-specific multi-feature prototypes. This embodiment does not limit the construction method of the feature prototype.

[0066] Step 102, according to multiple feature prototypes of various types of targets, correct the target detection results of each image in the target domain data set obtained by the teacher model to obtain a pseudo label for each image;

[0067] Each image in the target domain dataset is input into the teacher model to obtain the object detection results of each image.

[0068] Before each image in the target domain dataset is input into the teacher model, each image can be weakly enhanced, including random horizontal flipping. That is, the teacher model inputs a weakly enhanced image.

[0069] Since the teacher model is trained using the source domain dataset, the pseudo labels predicted by the teacher model for each image are inaccurate. Multiple feature prototypes specific to each type of target in the target domain dataset are introduced to correct the target detection results of each image predicted by the teacher model, so as to assign more accurate pseudo labels to the targets in each image in the presence of intra-class variations.

[0070] More accurate pseudo labels can be obtained based on the distance between the second instance features of the target extracted by the teacher model from each image in the target domain dataset and multiple feature prototypes of each type of target.

[0071] Step 103, using each image of the target domain data set as a sample, using the pseudo label of each image as a label to train the student model, and using the trained student model to detect the target in the image to be detected; using the target detection model trained using the source domain data set as the teacher model and the student model.

[0072] The source domain dataset includes multiple images, and the objects in each image are annotated with category labels and detection boxes.

[0073] The target detection model may adopt a two-stage target detector Faster-RCNN (Faster Region Convolutional Neural Networks), but is not limited to this model.

[0074] The target detection model is trained on the source domain dataset to obtain the initial target detection model θ. The initial target detection model θ is used as the initial teacher model θ tea and the initial student model θ tea After the object detection model is trained on the source domain dataset, the source domain dataset is no longer used.

[0075] Each image of the target domain dataset is input as a sample into the student model θ stu In the above example, we get the student model θ stu Predicted target detection results. According to the student model θ stuThe difference between the predicted target detection result and the corresponding pseudo label, adjust the student model θ stu The parameters of the student model θ stu The difference between the predicted object detection result and the corresponding pseudo label is less than the set value.

[0076] The parameters of the teacher model are updated using the exponential moving average method based on the parameters of the student model, and the formula is as follows:

[0077] θ tea =η·θ tea +(1-η)·θ stu ;

[0078] Among them, η is the coefficient of the exponential moving average method, which can be set to 0.99.

[0079] The updated teacher model continues forward reasoning, and the trained student model can detect objects in new environments.

[0080] Before inputting each image in the target domain data set into the student model, each image may be strongly enhanced, including one or more of random grayscale, Gaussian blur and color jitter. That is, the student model inputs a strongly enhanced image. The framework diagram of the passive domain adaptation target detection method provided in this embodiment is as follows: Figure 2 shown.

[0081] Experiments are conducted on multiple domain adaptation object detection benchmarks, including Cityscapes, Foggy Cityscapes, KITTI, Sim10k, BDD100k, PASCAL VOC, and Watercolor datasets. The experimental results show that the method provided in this embodiment outperforms other passive domain adaptation object detection methods in terms of performance.

[0082] This embodiment constructs multiple feature prototypes of each type of target by using the first instance features of each type of target extracted by the teacher model from some images of the target domain dataset, thereby providing more representative category information for the target domain. After the target detection results of each image in the target domain dataset predicted by the teacher model are corrected by the multiple feature prototypes of each type of target, more accurate pseudo-labels are obtained as supervision information for student model training, thereby improving the accuracy of target detection.

[0083] On the basis of the above embodiment, in this embodiment, a plurality of feature prototypes of various types of targets are constructed based on the first instance features of various types of targets extracted by the teacher model from some images of the target domain dataset, including:

[0084] Randomly extract some images from the target domain dataset;

[0085] Detecting a first category label and a first detection frame of each target in a partial image based on the teacher model, and taking an image region within the first detection frame of the target as a first instance feature;

[0086] According to the first category label of each target, determine the targets belonging to the same category in some images;

[0087] According to the first instance features of each type of target, multiple feature prototypes of each type of target are constructed.

[0088] From the target domain dataset Randomly select some images from , such as randomly sampling 500 images.

[0089] The teacher model is used to perform target detection on each image in some images to obtain the first category label, the first detection frame and the confidence score of each target belonging to the first category label for each target in each image.

[0090] When determining the first category label of the target, the teacher model first predicts the confidence score that the target belongs to each preset category label, and takes the preset category label with the highest confidence score as the first category label of the target.

[0091] For each type of target in each image of the extracted partial images, only the instance feature of the target with the highest confidence score in each type of target can be retained as the first instance feature with category representativeness

[0092] According to the first instance features of the target with the same first category label in the partial image Build multiple feature prototypes for various types of targets.

[0093] On the basis of the above embodiment, in this embodiment, multiple feature prototypes of various types of targets are constructed according to the first instance features of various types of targets, including:

[0094] The first instance features of each type of target are clustered multiple times, with a different number of clusters each time;

[0095] Determine the silhouette score of each clustering, and take the cluster center of each cluster in the cluster corresponding to the largest silhouette score as the feature prototype of each type of target.

[0096] The first instance features of the i-th category target are clustered multiple times. Each clustering divides the first instance features of the i-th category target into multiple groups, so that the differences between the first instance features in each group are small, and the differences between the first instance features of different groups are large. The number of groups into which the first instance features are divided is the number of clusters.

[0097] Calculate the silhouette score of each clustering. The silhouette score is used to characterize the compactness of each cluster in the clustering. The larger the value, the better. The average of the silhouette scores of each cluster in each clustering can be used as the silhouette score S of each clustering. Keep the clustering with the largest silhouette score, and use the number of clusters n in this clustering as the number of characteristic prototypes of the i-th target.

[0098] The cluster center of each cluster in this clustering is used as the characteristic prototype of the i-th type of target in is the jth feature prototype of the i-th target, |G ij | is the jth cluster G belonging to the i-th category target ij The number of first instance features.

[0099] For example, the first instance feature of the i-th target is clustered three times, and the first instance feature of the i-th target is divided into 2, 3, and 4 clusters respectively. The silhouette score of the first clustering is 0.82, the silhouette score of the second clustering is 0.92, and the silhouette score of the third clustering is 0.88. Then the number of feature prototypes of the i-th target is the number of clusters divided in the second clustering, 2. The feature prototype of the i-th target is the cluster center of the two clusters in the second clustering.

[0100] On the basis of the above embodiment, in this embodiment, according to multiple feature prototypes of various types of targets, the target detection results of each image in the target domain data set obtained by the teacher model are corrected to obtain pseudo labels of each image, including:

[0101] Based on the teacher model, a second category label, a second detection box, and a confidence score that each target belongs to the second category label are detected from each image of the target domain dataset;

[0102] Using the image area within the second detection frame of each object as the second instance feature of each object;

[0103] According to the similarity between the second instance feature of each target and multiple feature prototypes of each target, the second category label of each target and the confidence score of each target belonging to the second category label are corrected;

[0104] A pseudo label of each target is determined according to the second detection frame of each target, the corrected second category label and the corrected confidence score.

[0105] The i-th image in the target domain dataset Input the teacher model and get the target detection results predicted by the teacher model:

[0106]

[0107] in, is the second category label of the target in the i-th image in the predicted target domain dataset, is the second detection box of the target in the i-th image in the predicted target domain dataset, is the confidence score that the target output by the classification layer such as softmax belongs to the second category label, and F is the teacher model.

[0108] Due to the domain shift between the source domain and the target domain, the object detection results contain noisy samples, such as misclassified positive samples.

[0109] In order to further correct the misclassified positive samples, the target detection results are corrected by using the similarity between the second instance features of the target and multiple feature prototypes of each type of target to obtain the pseudo label of each target.

[0110] On the basis of the above embodiment, in this embodiment, according to the similarity between the second instance feature of each target and multiple feature prototypes of each type of target, the second category label of each target and the confidence score of each target belonging to the second category label are corrected, including:

[0111] Determine a first maximum value among similarities between a second instance feature of each target and a plurality of feature prototypes of each class of targets;

[0112] The first category label corresponding to the maximum value among the first maximum values ​​corresponding to all categories of targets is used as the corrected second category label of each target;

[0113] The maximum value among the first maximum values ​​corresponding to all class targets is taken as the corrected confidence score of each target.

[0114] According to the similarity between the second instance feature of each target and multiple feature prototypes of each target, the formula for correcting and filtering the target detection results predicted by the teacher model can be expressed as follows:

[0115]

[0116]

[0117]

[0118] Among them, f t ′ is the second detection frame B t The corresponding second instance feature, is the nth feature prototype of the i-th target, f t 'and The similarity between them can be expressed by the dot product of the two, Nc is the total number of target categories, is the nth feature prototype of the jth target, is the corrected second category label, exp represents the exponential function, is the corrected confidence score, τ is the set constant, is the final pseudo label.

[0119] On the basis of the above embodiment, in this embodiment, the image area within the second detection frame of each target is used as the second instance feature of each target, including:

[0120] Compare the confidence score of each target belonging to the second category label with a preset threshold, where the preset threshold is determined according to the number of preset detection categories corresponding to the target detection model;

[0121] When the confidence score is less than or equal to a preset threshold, the image area within the second detection frame of each target is used as the second instance feature of each target.

[0122] Due to the domain offset between the source domain and the target domain, the target detection results contain noise samples, such as negative samples. In order to filter out negative samples, we filter them by confidence score:

[0123]

[0124] Where C is the number of preset detection categories corresponding to the target detection model. When performing target detection, the target detection model outputs the confidence score that the target belongs to each preset detection category, and takes the preset detection category with the highest confidence score as the category label of the target.

[0125] According to the target detection result after filtering out the negative samples, the second instance feature of the target is determined, and the target detection result after filtering out the negative samples is further corrected according to the second instance feature of the target.

[0126] Based on the above embodiment, in this embodiment, each image of the target domain data set is used as a sample, and the pseudo label of each image is used as a label to train the student model, including:

[0127] Based on the student model, a third category label, a third detection box, and a confidence score that each target belongs to the third category label are detected from each image of the target domain dataset;

[0128] Using the image area within the third detection frame of each target as the third instance feature of each target;

[0129] Determine a first loss for each target according to a loss between a third category label of each target in each image of the target domain dataset and a corrected second category label, and a loss between a third detection frame and a second detection frame;

[0130] Determine the second loss of each target according to the similarity between the second instance feature, the third instance feature of each target and multiple feature prototypes of each type of target;

[0131] Determine the third loss of each target based on the confidence score of each target belonging to the third category label and the corrected confidence score;

[0132] The student model is trained based on the first loss, the second loss, and the third loss.

[0133] For the consistency learning strategy of object detection, the object detection model reduces the sensitivity to domain changes by maintaining the consistency between the original image and the style perturbation image. Existing studies apply consistency regularization at a single prediction level, which has limited performance improvement, or introduce auxiliary branches to construct consistency regularization, which increases the number of model parameters.

[0134] This embodiment designs multi-level consistency regularization, including prototype-based consistency regularization and prediction consistency regularization, which further improves the performance of consistency learning in alleviating the domain shift problem and introduces fewer additional model parameters.

[0135] The pseudo labels of each image in the target domain dataset are used as the supervision information of the student model to construct the self-training loss, i.e. the first loss. The self-training loss function is constructed as:

[0136]

[0137] in, and They represent the classification loss and the detection box regression loss of the target in each image. The classification loss is obtained based on the third category label of the target predicted by the student model and the corrected second category label in the pseudo label. The detection box regression loss is obtained based on the third detection box of the target predicted by the student model and the second detection box in the pseudo label.

[0138] By utilizing the more accurate pseudo labels generated by multiple prototypes as supervision signals for the student model in the unlabeled target domain, it helps to improve the detection performance of the object detector in the target domain.

[0139] For prototype-based consistency regularization, it can be achieved by using multi-category prototypes to calculate the category probability distribution of instance features. Specifically, the category probability distribution of the second instance feature can be determined based on the similarity between the second instance feature extracted by the teacher model and multiple feature prototypes of various targets. The category probability distribution of the third instance feature can be determined based on the similarity between the third instance feature extracted by the student model and multiple feature prototypes of various targets. Based on the category probability distribution of the second instance feature and the category probability distribution of the third instance feature, a prototype-based consistency loss is constructed. That is the second loss.

[0140] Training according to the second loss can minimize the difference between the category probability distribution of instance features extracted by the teacher model and the student model, effectively reducing the sensitivity of the target detection model to changes in the data domain.

[0141] The confidence scores predicted by the teacher model and the student model are used to construct the prediction consistency regularization loss, i.e., the third loss. For each image in the target domain dataset, keeping the predictions of weakly enhanced images and strongly enhanced images consistent helps the object detection model learn better transferable features.

[0142] The confidence scores predicted by the teacher model and the student model are represented as P stu and P stu , and define the prediction consistency regularization loss as:

[0143]

[0144] Use the constructed first loss, second loss, and third loss to supervise the student model training. Update the student model θ through the objective function shown below stu Parameters:

[0145]

[0146] in, is the self-training loss of the student model supervised by pseudo-labels, is the prototype-based consistency regularization loss, is the prediction consistency regularization loss.

[0147] On the basis of the above embodiment, in this embodiment, the second loss of each target is determined according to the similarity between the second instance feature and the third instance feature of each target and multiple feature prototypes of each type of target, including:

[0148] Determine a first maximum value among similarities between a second instance feature of each target and a plurality of feature prototypes of each class of targets;

[0149] Determine the second maximum value of the similarities between the third instance feature of each target and the plurality of feature prototypes of each class of targets;

[0150] A second loss for each target is determined based on the first maximum value and the second maximum value.

[0151] The second instance feature f extracted by the teacher model can be determined tThe first maximum value among the similarities between multiple feature prototypes of each class of targets is used as the similarity between the second instance feature and the feature prototypes of each class of targets. The sum of the first maximum values ​​corresponding to all class targets is determined, and the ratio between the first maximum value corresponding to each class of targets and the sum of the first maximum values ​​corresponding to all class targets is used as the category probability distribution Z of the second instance feature. tea .

[0152]

[0153] The third instance feature extracted by the student model can be determined The second maximum value among the similarities between the multiple feature prototypes of each class of targets is used as the similarity between the third instance feature and the feature prototypes of each class of targets. The sum of the second maximum values ​​corresponding to all class targets is determined, and the ratio between the second maximum values ​​corresponding to each class of targets and the sum of the second maximum values ​​corresponding to all class targets is used as the category probability distribution Z of the third instance feature. stu , the formula is as follows:

[0154]

[0155] Among them, sim is a similarity function, which can be a cosine distance.

[0156] By minimizing the prototype-based consistency regularization loss, i.e., the second loss To force Z stu and Z twa Consistency between:

[0157]

[0158] in, is the Kullback-Leibler divergence, which measures the degree of difference between the probability distributions of two classes.

[0159] On the basis of the above embodiment, in this embodiment, while taking each image of the target domain data set as a sample and taking the pseudo label of each image as a label to train the student model, the following is also included:

[0160] Determine new cluster centers of each type of target according to the second instance features of each target newly generated at each preset number of iterations during the training process;

[0161] Select the feature prototype that is most similar to the new cluster center of each type of target from the feature prototypes of each type of target;

[0162] The new cluster centers of each class of targets are used to update the feature prototypes of each class of targets selected.

[0163] The feature prototypes of various types of targets are dynamically updated according to the second instance features extracted by the teacher model. The second instance features extracted by the teacher model can be stored in a memory bank.

[0164] During the training of the student model, the teacher model extracts the second instance features of an image in each iteration to generate a pseudo label. For each preset number of iterations, such as 100 iterations, the teacher model generates the second instance features of the targets in 100 images. The average value of the second instance features of each type of target is used as the new cluster center of each type of target. C represents the number of target categories and clears the memory bank.

[0165] Select the new cluster center v from the feature prototype of the same type of target i Most similar prototype Prototypes can be updated with momentum strategies

[0166]

[0167] Where α is the momentum coefficient and can be set to 0.99.

[0168] The passive domain adaptive target detection device provided by the present invention is described below. The passive domain adaptive target detection device described below and the passive domain adaptive target detection method described above can be referred to each other.

[0169] like Figure 3 As shown, the device includes a construction module 301, a generation module 302 and a training module 303, wherein:

[0170] The construction module 301 is used to construct multiple feature prototypes of various types of targets based on the first instance features of various types of targets extracted by the teacher model from the partial images of the target domain data set;

[0171] The generation module 302 is used to correct the target detection results of each image in the target domain data set obtained by the teacher model according to multiple feature prototypes of various types of targets, and obtain pseudo labels for each image;

[0172] The training module 303 is used to use each image of the target domain data set as a sample, use the pseudo label of each image as a label to train the student model, and use the trained student model to detect the target in the image to be detected;

[0173] The teacher model and the student model are obtained by pre-training the object detection model using the source domain dataset.

[0174] This embodiment constructs multiple feature prototypes of each type of target by using the first instance features of each type of target extracted by the teacher model from some images of the target domain dataset, thereby providing more representative category information for the target domain. After the target detection results of each image in the target domain dataset predicted by the teacher model are corrected by the multiple feature prototypes of each type of target, more accurate pseudo-labels are obtained as supervision information for student model training, thereby improving the accuracy of target detection.

[0175] Figure 4 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 4 As shown, the electronic device may include: a processor 410, a communication interface 420, a memory 430 and a communication bus 440, wherein the processor 410, the communication interface 420 and the memory 430 communicate with each other through the communication bus 440. The processor 410 may call the logic instructions in the memory 430 to execute the passive domain adaptation target detection method, which includes: constructing multiple feature prototypes of each type of target based on the first instance features of each type of target extracted from part of the images of the target domain data set by the teacher model; correcting the target detection results of each image in the target domain data set obtained by the teacher model according to the multiple feature prototypes of each type of target, and obtaining the pseudo labels of each image; using each image of the target domain data set as a sample, using the pseudo labels of each image as a label to train the student model, and using the trained student model to detect the target in the image to be detected; the teacher model and the student model are obtained by pre-training the target detection model using the source domain data set.

[0176] In addition, the logic instructions in the above-mentioned memory 430 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods of various embodiments of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.

[0177] On the other hand, the present invention also provides a computer program product, which includes a computer program. The computer program can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the passive domain adaptive target detection method provided by the above methods, which includes: constructing multiple feature prototypes of each type of target based on the first instance features of each type of target extracted by a teacher model from part of the images of a target domain data set; correcting the target detection results of each image in the target domain data set obtained by the teacher model according to the multiple feature prototypes of each type of target, and obtaining a pseudo label for each image; using each image of the target domain data set as a sample, and using the pseudo label of each image as a label to train a student model, and using the trained student model to detect targets in the image to be detected; the teacher model and the student model are obtained by pre-training the target detection model using the source domain data set.

[0178] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to execute the passive domain adaptive target detection method provided by the above-mentioned methods, the method comprising: constructing multiple feature prototypes of each type of target based on the first instance features of each type of target extracted by a teacher model from part of the images of a target domain data set; correcting the target detection results of each image in the target domain data set obtained by the teacher model according to the multiple feature prototypes of each type of target, and obtaining a pseudo label for each image; using each image of the target domain data set as a sample and the pseudo label of each image as a label to train a student model, and using the trained student model to detect targets in the image to be detected; the teacher model and the student model are obtained by pre-training the target detection model using the source domain data set.

[0179] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, i.e., they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Those of ordinary skill in the art may understand and implement it without creative effort.

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

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

Claims

1. A passive domain adaptive target detection method, characterized in that: include: Based on the first instance features of various types of targets extracted by the teacher model from some images of the target domain dataset, multiple feature prototypes of the various types of targets are constructed; According to the multiple feature prototypes of the various types of targets, the target detection results of each image in the target domain dataset obtained by the teacher model are corrected to obtain pseudo labels of each image; Using each image of the target domain data set as a sample, using the pseudo label of each image as a label to train the student model, and using the trained student model to detect the target in the image to be detected; The teacher model and the student model are obtained by pre-training the target detection model using the source domain dataset; The first instance features of various types of targets extracted from the partial images of the target domain data set based on the teacher model, and constructing multiple feature prototypes of the various types of targets, include: Randomly extracting some images from the target domain dataset; Detecting a first category label and a first detection frame of each target in the partial image based on the teacher model, and using an image area within the first detection frame of the target as the first instance feature; Determining objects in the partial image that belong to the same category according to the first category labels of the objects; According to the first instance features of each type of target, a plurality of feature prototypes of each type of target are constructed; the plurality of feature prototypes are used to represent the features of each type of target.

2. The passive domain adaptive target detection method according to claim 1, characterized in that: The step of constructing a plurality of feature prototypes of each type of target according to the first instance feature of each type of target comprises: Clustering the first instance features of the various types of targets multiple times, with the number of clusters in each clustering being different; The silhouette score of each clustering is determined, and the cluster center of each cluster in the cluster corresponding to the largest silhouette score is used as the feature prototype of each type of target.

3. The passive domain adaptive target detection method according to claim 1, characterized in that: The method of correcting the target detection result of each image in the target domain dataset obtained by the teacher model according to the multiple feature prototypes of the various types of targets to obtain a pseudo label of each image includes: Detecting a second category label, a second detection frame, and a confidence score that each target belongs to the second category label of each target from each image of the target domain dataset based on the teacher model; Using the image area within the second detection frame of each target as the second instance feature of each target; Correcting the second category label of each target and the confidence score that each target belongs to the second category label according to the similarity between the second instance feature of each target and the plurality of feature prototypes of each type of target; Determine a pseudo label for each target according to the second detection box, the corrected second category label, and the corrected confidence score of each target.

4. The passive domain adaptive target detection method according to claim 3, characterized in that: The correcting the second category label of each target and the confidence score that each target belongs to the second category label according to the similarity between the second instance feature of each target and the multiple feature prototypes of each type of target includes: Determine a first maximum value among similarities between the second instance feature of each target and a plurality of feature prototypes of each type of target; According to the first category label corresponding to the maximum value among the first maximum values ​​corresponding to all categories of targets, as the corrected second category label of each target; The maximum value among the first maximum values ​​corresponding to all categories of targets is used as the corrected confidence score of each target.

5. The passive domain adaptive target detection method according to claim 3, characterized in that: The taking the image area within the second detection frame of each target as the second instance feature of each target comprises: Comparing the confidence score of each target belonging to the second category label with a preset threshold, where the preset threshold is determined according to the number of preset detection categories corresponding to the target detection model; When the confidence score is less than or equal to the preset threshold, the image area within the second detection frame of each target is used as the second instance feature of each target.

6. The passive domain adaptive target detection method according to claim 3, characterized in that: The method of using each image of the target domain data set as a sample and using the pseudo label of each image as a label to train the student model includes: Detecting a third category label, a third detection frame, and a confidence score that each target belongs to the third category label of each target from each image of the target domain dataset based on the student model; Using the image area within the third detection frame of each target as the third instance feature of each target; Determine a first loss for each target according to a loss between a third category label of each target in each image of the target domain dataset and the corrected second category label, and a loss between a third detection frame and a second detection frame; Determine the second loss of each target according to the similarity between the second instance feature, the third instance feature of each target and the plurality of feature prototypes of each type of target; Determining a third loss for each target according to the confidence score that each target belongs to the third category label and the corrected confidence score; The student model is trained according to the first loss, the second loss and the third loss.

7. The passive domain adaptive target detection method according to claim 6, characterized in that: The determining the second loss of each target according to the similarity between the second instance feature and the third instance feature of each target and the plurality of feature prototypes of each type of target comprises: Determine a first maximum value among similarities between the second instance feature of each target and a plurality of feature prototypes of each type of target; Determine a second maximum value of similarities between the third instance feature of each target and a plurality of feature prototypes of each type of target; A second loss of each of the targets is determined according to the first maximum value and the second maximum value.

8. The passive domain adaptive target detection method according to claim 3, characterized in that: While taking each image of the target domain data set as a sample and taking the pseudo label of each image as a label to train the student model, it also includes: Determining new cluster centers of each class of targets according to the second instance features of each target newly generated in each preset number of iterations during the training process; Selecting the feature prototypes that are most similar to the new cluster centers of the various types of targets from the feature prototypes of the various types of targets; The new cluster centers of the various types of targets are used to update the selected feature prototypes of the various types of targets.

9. A passive domain adaptive target detection device, characterized in that: include: A construction module, configured to construct a plurality of feature prototypes of each type of target based on first instance features of each type of target extracted by the teacher model from a portion of images of the target domain dataset; A generation module, configured to correct the target detection result of each image in the target domain data set obtained by the teacher model according to the multiple feature prototypes of the various types of targets, so as to obtain a pseudo label of each image; A training module, used to use each image of the target domain data set as a sample, use the pseudo label of each image as a label to train the student model, and use the trained student model to detect the target in the image to be detected; The teacher model and the student model are obtained by pre-training the target detection model using the source domain dataset; The building blocks are specifically used for: Randomly extracting some images from the target domain dataset; Detecting a first category label and a first detection frame of each target in the partial image based on the teacher model, and using an image area within the first detection frame of the target as the first instance feature; Determining objects in the partial image that belong to the same category according to the first category labels of the objects; According to the first instance features of each type of target, a plurality of feature prototypes of each type of target are constructed; the plurality of feature prototypes are used to represent the features of each type of target.

Citation Information

Patent Citations

  • Passive field adaptive target detection method

    CN112861616A

  • Cross-domain adaptive semantic segmentation method and system

    CN113221903A

  • Semi-supervised learning method suitable for monocular 3D target detection task

    CN114581350A

  • Unsupervised domain adaptive remote sensing image semantic segmentation method based on course learning

    CN114943965A

  • Pseudo tag generation method, target detection model training method and device

    CN115082757A