An unsupervised domain adaptive object detection method based on self-training

Through the method of dynamically interchange the threshold and memory pool, the problem of domain offset and pseudo-label quality measurement in unsupervised domain adaptive target detection is solved, and the detection accuracy and pseudo-label robustness of the model in the target domain are improved, thus achieving the realization of the model in the target domain. Improved the effectiveness of the confrontation training.

CN114818912BActive Publication Date: 2024-11-08TSINGHUA SHENZHEN INTERNATIONAL GRADUATE SCHOOL
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210429718.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-04-22
Publication Date
2024-11-08
Estimated Expiration
2042-04-22

AI Technical Summary

Technical Problem

In unsupervised domain adaptive object detection, the prior art is difficult to effectively eliminate domain offsets and measure pseudo-label quality, resulting in poor training of the model in the target domain, and the degree of attention to positive and negative samples in the adversarial training cannot be dynamically adjusted. The pseudo-label is noisy.

Method used

Adversarial training based on dynamic interchange threshold and self-training method based on memory pool are used to dynamically adjust the hyperparameters and pseudo-label quality, and improve the effectiveness of model adversarial training and pseudo-label robustness by calculating interchange threshold and memory pool integration. .

Benefits of technology

The detection accuracy and pseudo-label quality of the model in the target domain are improved, the attention level of positive and negative samples is dynamically adjusted, the pseudo-label noise is reduced, and the detection quality is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114818912B_ABST
    Figure CN114818912B_ABST
Patent Text Reader

Abstract

A self-training-based unsupervised domain adaptive target detection method includes the following steps: using adversarial training based on dynamic IoU threshold and self-training method based on memory pool, so that the model continuously adjusts hyperparameters according to statistical information in the training process. Through adversarial training based on dynamic IoU threshold, the positive sample threshold that meets the current training stage can be adaptively selected, thereby continuously improving the effect of the model. The self-training method based on memory pool can slow down the distribution change of pseudo-labels, improve the robustness of pseudo-labels, reduce the noise in pseudo-labels, and further improve the detection quality.
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 and image processing, and in particular to an unsupervised domain adaptive target detection method based on self-training. Background Art

[0002] In the unsupervised domain adaptive object detection task, the source domain data and labels are often used as prior knowledge for model training, while the target domain usually only has unlabeled data. The core of the domain adaptive model is to make the model trained in the source domain also have high accuracy in the target domain. The key issue is how to eliminate domain offset. Usually, adversarial training methods are used to align the source domain and the target domain. Among them, the Strong-Weak model proposes to align local and global features simultaneously to eliminate domain offset, and Diversify-And-Match uses the encoder-decoder network to transfer the style of the source domain to the target domain to complete the alignment between the two domains at the "pixel" level. In addition, category information is also used to improve the effect. For example, Categorical-Regularization uses a multi-label classifier to regularize the features, and the MCAR model proposes that using a multi-label classifier on a domain classifier can bring better results. Inspired by the conditional adversarial network, they use multi-label probability prediction to complete the conditional alignment of global features. MEGA-CDA proposes to use memory-guided feature maps to assist in the generation of target domain category information, so as to better align the category features between the two domains. Adversarial training is the most common method for feature alignment. A small number of other methods use contrastive loss. For example, GPA proposes to use geometry-based prototype construction and contrastive loss to learn domain-independent features. Coarse-to-Fine proposes a hybrid model. They use adversarial training at the image level and minimize the L2 distance of specific prototypes of each category between different domains at the instance level to achieve feature alignment. However, different areas of the entire image or even an object should have different levels of attention, and thus have different weights in adversarial training. Although some existing methods have proposed targeted feature alignment methods from the perspective of the object category itself, they still cannot dynamically adjust the different contributions of positive and negative samples to the loss in adversarial training.

[0003] In addition, adaptive training of the model in the target domain is also an effective way to improve the generalization ability of the model. This type of method usually first uses the source domain data and labels to train a model, then uses the model to generate pseudo labels for the target domain, and then retrains the model with the pseudo labels, and iterates until the training converges. The key issue is how to measure the quality of pseudo labels. Since the target domain lacks data labels, a reasonable mechanism needs to be developed for measurement during training evaluation. Confidence-Regularized proposes label regularization terms and model regularization terms to make the category distribution of pseudo labels flatter and avoid outputting extremely wrong labels. After each retraining of these methods, the results of the previous round cannot be used anymore, which may cause the model to develop drastically in different directions and eventually fail to converge.

[0004] It should be noted that the information disclosed in the above background technology section is only used for understanding the background of the present application, and therefore may include information that does not constitute prior art known to ordinary technicians in the field. Summary of the invention

[0005] The main purpose of the present invention is to overcome the defects of the above-mentioned background technology and provide an unsupervised domain adaptive target detection method based on self-training.

[0006] To achieve the above object, the present invention adopts the following technical solutions:

[0007] An unsupervised domain adaptive target detection method based on self-training includes the following steps: using adversarial training based on dynamic intersection-over-union threshold and a self-training method based on a memory pool, so that the model continuously adjusts hyperparameters according to statistical information in the training process.

[0008] Furthermore, in the adversarial training based on the dynamic IoU threshold, in the adversarial training, the dynamic IoU threshold is obtained by calculating the statistical characteristics of the candidate box over a period of time. The calculated IoU threshold increases as the IoU between the candidate box and the true label increases, so as to adaptively select the positive sample threshold that meets the current training stage, and use the dynamic IoU threshold as the weight of the positive sample in the domain classifier to participate in the adversarial training.

[0009] Furthermore, the method of enabling the model to continuously adjust hyperparameters according to statistical information during the training process includes:

[0010] During the model training process, the following formula is used to dynamically calculate the intersection-over-union ratio threshold based on statistical information:

[0011] IOU i =IOU init +γ×MovingAverage(topk[(i-IterNum):i])

[0012] Among them, IOU init It represents the initial intersection-over-union ratio threshold, MovingAverage represents the moving average function, topk represents the kth maximum value of the current IOU calculated at each iteration, IterNum represents the window size of the iteration to be selected, and γ represents the coefficient.

[0013] Furthermore, when performing instance-level feature alignment, the domain classifier uses a dynamic IoU threshold as a weight on the positive samples, thereby dynamically adjusting the degree of attention paid to the alignment of positive and negative samples during training.

[0014] Furthermore, the memory pool-based self-training method improves the pseudo-labels generated in each iteration of self-training with the pseudo-labels in the memory pool, and then updates the memory pool, integrating the pseudo-labels in multiple iterations through the memory pool, thereby improving the robustness of the pseudo-labels.

[0015] Furthermore, when the new pseudo-label is improved with the pseudo-label in the memory pool, MissCnt is used to record the number of times each candidate box is not matched, and when the number is greater than a set number, the candidate box is removed from the memory pool.

[0016] Furthermore, with Faster RCNN as the basic framework, feature alignment between the source domain and the target domain is performed at the image level and instance level respectively, which is achieved by using domain classifiers.

[0017] Let D i represents the domain label of the i-th training sample, when it comes from the source domain, D i = 0, when it comes from the target domain i =1, let the feature map of the i-th sample output by the backbone network model be f i , It represents the feature of the i-th sample at position (u, v), let is the output of the domain classifier for the i-th sample at position (u, v), then the adversarial loss at the image level is for

[0018]

[0019] Add a Gradient Reversal Layer (GRL) before the domain classifier so that the domain classifier minimizes the loss and the backbone network maximizes the loss;

[0020] For instance-level alignment, let p i,j represents the output of the domain classifier corresponding to the j-th proposal output by the i-th sample after the detection head, then the adversarial loss at the instance level is for

[0021]

[0022] Similarly, a Gradient Reversal Layer (GRL) is added before the domain classifier, so that the domain classifier minimizes the loss, while the backbone network and the detection head maximize the loss, and finally the features output by the backbone network and the detection head are as domain-independent as possible.

[0023] Furthermore, a self-attention mechanism is added to the two DomainClassifiers, where the self-attention weight calculated by the global feature map is set to W img , the self-attention weight calculated by the instance feature map is W ins , then the modified adversarial loss as follows:

[0024]

[0025]

[0026] Let the model parameters of the backbone network be θ backbone , the model parameters of the detection head are θ det , the model parameters of the domain classifiers at the image and instance levels are and Let the bounding box output by the detection head and the loss corresponding to the category be The whole model solves the following optimization problem:

[0027]

[0028] Where λ is a coefficient;

[0029] According to the IOU dynamic threshold function, the model calculates a better threshold from the statistical information of the training process. The specific calculation formula is as follows:

[0030] IOU i =IOU init +γ×MovingAverage(topk[(i-IterNum):i])

[0031] Among them, IOU init represents the initial intersection-over-union ratio threshold, MovingAverage represents the moving average function, topk represents the kth maximum value of the current IOU calculated at each iteration, IterNum represents the window size of the iteration to be selected, and γ represents the coefficient;

[0032] When performing instance-level feature alignment, the dynamic IoU threshold is used as the weight of positive samples in instance-level feature alignment, so that the model can automatically adjust the degree of attention paid to foreground and background candidate boxes.

[0033] Furthermore, the self-training method based on the memory pool adopts a multiple scoring mechanism. A memory pool is maintained in each round of pseudo-labeling. In the next round of pseudo-labeling, the prediction result is compared with the current memory pool and the current memory pool is updated. Specifically, let the pseudo-label generated in the kth round be in That is, the pseudo label corresponding to the i-th sample in the k-th round, and the memory pool of the k-1-th round is Then the memory pool after the kth round of update is:

[0034]

[0035] UpdateFunction updates the memory pool by the number of times the pseudo-label is not matched;

[0036] For sample i, the pseudo label of the kth iteration is predicted First, by calculating and The IOU between them is the matrix Secondly, for The j-th bounding box in is matched by finding its maximum value:

[0037]

[0038] in this way, The jth bounding box in The The bounding boxes are matched, and the two are weighted or the larger prediction score is taken to obtain the memory pool

[0039] for For the unmatched bounding box in the memory, let MissCnt represent the number of unmatched times, and increase MissCnt by one; when MissCnt is greater than the set threshold, the bounding box is no longer a valid pseudo-label and is removed from the memory pool;

[0040] for The unmatched bounding boxes in the memory pool are also placed in the memory pool. And initialize MissCnt to 0;

[0041] Perform the above operations on all samples, and finally get the memory pool [M t ] k, use the memory pool as a pseudo-label to retrain the model, and then start the next iteration until the results converge.

[0042] A computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method described is implemented.

[0043] The present invention has the following beneficial effects:

[0044] The present invention provides an unsupervised domain adaptive target detection method based on self-training, which uses adversarial training based on a dynamic intersection-over-union threshold and a self-training method based on a memory pool, so that the model can continuously adjust hyperparameters according to statistical information in the training process, thereby improving the effect.

[0045] Through adversarial training based on dynamic intersection-over-union threshold, the positive sample threshold that meets the current training stage can be adaptively selected, thereby continuously improving the model effect.

[0046] The memory pool-based method proposed in the present invention can slow down the distribution change of pseudo labels, and a novel merging process is used between different iterative results to continuously improve the quality of pseudo labels in the memory pool.

[0047] Due to the use of a memory pool-based self-training method, the pseudo-labels generated in each iteration of self-training are improved with the pseudo-labels in the memory pool, and then the memory pool is updated, thereby improving the robustness of the pseudo-labels in the memory pool.

[0048] In the memory pool-based self-training method, the pseudo-labels in multiple iterations are integrated through the memory pool, so as to improve the robustness of the pseudo-labels, reduce the noise in the pseudo-labels, and further improve the detection quality. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] Figure 1 It is a flow chart of an unsupervised domain adaptive target detection algorithm based on self-training according to an embodiment of the present invention. DETAILED DESCRIPTION

[0050] The following is a detailed description of the embodiments of the present invention. It should be emphasized that the following description is only exemplary and is not intended to limit the scope and application of the present invention.

[0051] In view of the problems in the existing methods, the present invention proposes two modules to solve them respectively: adversarial training based on dynamic intersection-over-union ratio threshold and a self-training method based on a memory pool.

[0052] The inventors observed that the traditional method uses a fixed intersection-over-union ratio threshold throughout the training process, and as the training process progresses, the quality of the candidate boxes will become higher and higher, resulting in a large number of candidate boxes being classified as positive samples in the later stage, and the quality of these selected positive samples does not gradually improve as the training process progresses. In adversarial training based on a dynamic intersection-over-union ratio threshold, the embodiment of the present invention obtains this dynamic intersection-over-union ratio threshold by calculating the statistical characteristics of the candidate boxes over a period of time, which can achieve the following effects:

[0053] When the IoU ratio between the candidate box and the true label is generally high, the calculated IoU threshold will also be higher, so that the positive sample threshold that meets the current training stage can be adaptively selected, thereby continuously improving the model effect.

[0054] In addition, at different stages of training, the domain classifier pays different attention to positive and negative samples at the instance level. Since the model is ultimately used to identify positive samples, the domain classifier should be slightly biased towards positive samples in the later stages of training. In the overall training process, the attention paid to positive and negative samples should not remain unchanged, but needs to be dynamically adjusted. Since the dynamic intersection-over-union threshold itself can reflect the accuracy of the current positive sample, the dynamic intersection-over-union threshold will be used as the weight of the positive sample in the domain classifier to participate in adversarial training.

[0055] In the self-training method based on the memory pool, the embodiment of the present invention integrates the pseudo-labels in multiple iterations through the memory pool, thereby improving the robustness of the pseudo-labels, reducing the noise in the pseudo-labels, and further improving the detection quality.

[0056] Figure 1 The flowchart of the unsupervised domain adaptive target detection algorithm based on self-training in an embodiment of the present invention is shown.

[0057] Specific embodiments of the present invention are further described below.

[0058] For domain adaptive object detection, the source domain is defined as During training, we can get images and labels from the source domain and define the target domain as During training, only images of the target domain are available. in represents the i-th sample of the source domain image, Indicates the label corresponding to the sample, including the coordinates and category of each bounding box in the image, N s is the number of samples of the source domain image. in Represents the i-th sample of the target domain image. For the target domain, this sample has no label during training.

[0059] Using Faster RCNN as the basic framework, the feature alignment between the source domain and the target domain is performed at the image level and the instance level. This is achieved by using the domain classifier. Let D i represents the domain label of the i-th training sample, when it comes from the source domain, D i = 0, when it comes from the target domain i =1, let the feature map of the i-th sample output by the backbone network model be f i , It represents the feature of the i-th sample at position (u, v), let is the output of the Domain Classifier for the i-th sample at position (u, v), then the adversarial loss at the picture level is for

[0060]

[0061] Add a Gradient Reversal Layer (GRL) before the Domain Classifier so that the Domain Classifier minimizes the loss and the backbone network maximizes the loss. During adversarial training, some network parameters are updated to increase the loss, while others are updated to decrease the loss. Similarly, for instance-level alignment, let p i,j represents the output of the Domain Classifier corresponding to the j-th proposal output by the i-th sample after the detection head, then the adversarial loss at the instance level is for

[0062]

[0063] Similarly, a Gradient Reversal Layer (GRL) is added before the Domain Classifier, so that the Domain Classifier minimizes the loss, and the backbone network and the detection head maximize the loss, and finally the features output by the backbone network and the detection head are as domain-independent as possible. In order to capture the relationship between different regions within an image and different regions within an object, we add a self-attention mechanism to the two DomainClassifiers, so that different regions have different weights in the adversarial training. Let the self-attention weight calculated by the global feature map be W img , the self-attention weight calculated by the instance feature map is W ins , then the modified adversarial loss as follows:

[0064]

[0065]

[0066] Let the model parameters of the backbone network be θ backbone , the model parameter of the detection head is θ det , the model parameters of the Domain Classifier at the image and instance levels are and Let the bounding box output by the detection head and the loss corresponding to the category be The optimization problem that the entire model needs to solve is as follows (where λ is a coefficient):

[0067]

[0068] During the self-training process, it is difficult to continuously improve the accuracy. The fixed IOU threshold is an important factor leading to this phenomenon. In the initial stage of training, positive and negative samples are selected according to the IOU threshold, so that the proposal and groundtruth are matched to calculate the loss. In the early stage, due to the limited capabilities of the model itself, the quality of the extracted proposal is not high. At this time, the initial fixed IOU threshold can avoid too few positive samples. As the training progresses, the model's expressive ability becomes better and better, which will lead to an increase in the proportion of positive samples, and it will be impossible to pick out more refined detection boxes, making it impossible to further improve the accuracy.

[0069] In this regard, the present invention adopts a dynamic IOU method to solve this problem. In order to effectively perceive the stage of training during the training process, the embodiment of the present invention designs an IOU dynamic threshold function so that the model can calculate a better threshold from the statistical information of the training process. The specific calculation formula is as follows:

[0070] IOU i =IOU init +γ×MovingAverage(topk[(i-IterNum):i])

[0071] Where represents the initial IOU threshold, topk represents the kth maximum value of the current IOU calculated at each iteration, selects the kth maximum value of the intersection-over-union ratio of all candidate boxes and the true label in each iteration from iteration (i-IterNum) to iteration i, IterNum represents the iteration window size to be considered, MovingAverage represents the moving average of the topk obtained each time with IterNum as the window size, and γ is a coefficient. In addition, when performing instance-level feature alignment, the above dynamic intersection-over-union ratio threshold will be used as the weight of the positive sample in the instance-level feature alignment, so that the model can automatically adjust the degree of attention to the foreground and background candidate boxes.

[0072] In order to solve the problem of excessive pseudo-label noise in traditional self-training methods, the embodiment of the present invention designs a self-training method based on a memory pool, adopts a multiple scoring mechanism, maintains a memory pool in each round of pseudo-labeling, and compares the prediction result with the current memory pool in the next round of pseudo-labeling and updates the current memory pool. Specifically, let the pseudo-label generated in the kth round be in That is, the pseudo label corresponding to the i-th sample in the k-th round, and the memory pool of the k-1-th round is Then the memory pool after the kth round of update is:

[0073]

[0074] UpdateFunction updates the memory pool by the number of times the pseudo-label is not matched. For sample i, the pseudo-label of the kth iteration is predicted. First, by calculating and The IOU between them is the matrix Secondly, for The j-th bounding box in is matched by finding its maximum value:

[0075]

[0076] in this way, The jth bounding box in The The bounding boxes are matched, and the two are ensembled (weighted or taking the larger prediction score) to get the memory pool

[0077] for Let MissCnt represent the number of unmatched bounding boxes in the memory pool, and add 1 to MissCnt. When MissCnt is greater than the set threshold, the bounding box is no longer a valid pseudo-label and is removed from the memory pool.

[0078] for The unmatched bounding boxes in the memory pool cannot be discarded directly because they may contain True Positive. The unmatched bounding boxes are also put into the memory pool. And initialize MissCnt to 0. For False Positive, as the iteration proceeds, the increase of MissCnt will remove them from the memory pool.

[0079] Perform the above operations on all samples, and finally get the memory pool [M t ] k , use the memory pool as a pseudo-label to retrain the model, and then start the next iteration until the results converge.

[0080] Table 1 shows the migration results of the method of the present invention on Cityscapes to FoggyCityscapes, where the source domain image is Cityscapes, which mainly includes street scenes taken by a car camera while traveling through the city, and the target domain image is FoggyCityscapes, which is a composite image of the source domain image with fog added. mAP represents the average precision of the model detection result. It can be seen from the table that the present invention has an improvement of 2.5%, which illustrates the effectiveness of the present invention.

[0081] Table 1

[0082] method person rider car truck bus train motor bike mAP Original invention 29.9 42.3 43.5 24.5 36.2 32.6 30.0 35.3 34.3 The present invention 43.6 37.0 44.9 31.6 32.4 47.0 28.5 29.1 36.8

[0083] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0084] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1A device that provides the functions specified in a block or multiple blocks.

[0085] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0086] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable device. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0087] The background section of the present invention may contain background information about the problem or environment of the present invention, but does not necessarily describe the prior art. Therefore, the content included in the background section is not an admission by the applicant that the prior art is available.

[0088] The above content is a further detailed description of the present invention in combination with specific / preferred embodiments, and it cannot be determined that the specific implementation of the present invention is limited to these descriptions. For ordinary technicians in the technical field to which the present invention belongs, without departing from the concept of the present invention, it can also make several substitutions or modifications to these described embodiments, and these substitutions or modifications should be regarded as belonging to the protection scope of the present invention. In the description of this specification, the description of the reference terms "an embodiment", "some embodiments", "preferred embodiments", "examples", "specific examples", or "some examples" means that the specific features, structures, materials or characteristics described in combination with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily target the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner. In the absence of mutual contradiction, those skilled in the art can combine and combine the different embodiments or examples described in this specification and the features of different embodiments or examples. Although the embodiments of the present invention and their advantages have been described in detail, it should be understood that various changes, substitutions and modifications can be made herein without departing from the scope of protection of the patent application.

Claims

1. A self-training based unsupervised domain adaptive target detection method, characterized in that: include: Using adversarial training based on dynamic intersection-over-union threshold and self-training method based on memory pool, the model continuously adjusts hyperparameters according to statistical information during training; The adversarial training based on the dynamic IoU threshold, in the adversarial training, the dynamic IoU threshold is obtained by calculating the statistical characteristics of the candidate box within a period of time, and the calculated IoU threshold increases as the IoU between the candidate box and the true label increases, so as to adaptively select the positive sample threshold that meets the current training stage, and use the dynamic IoU threshold as the weight of the positive sample in the domain classifier to participate in the adversarial training; The model continuously adjusts hyperparameters based on statistical information during training, including: During the model training process, the following formula is used to dynamically calculate the intersection-over-union ratio threshold based on statistical information: IOU i =IOU init +γ×MovingAverage(topk[(i-IterNum):i]) Among them, IOU init represents the initial intersection-over-union ratio threshold, MovingAverage represents the moving average function, topk represents the kth maximum value of the current IOU calculated at each iteration, IterNum represents the window size of the iteration to be selected, and γ represents the coefficient; When performing instance-level feature alignment, the domain classifier uses a dynamic IoU threshold as a weight on the positive samples, thereby dynamically adjusting the degree of attention paid to the alignment of positive and negative samples during training; The memory pool-based self-training method improves the pseudo-labels generated in each iteration of self-training with the pseudo-labels in the memory pool, and then updates the memory pool. The memory pool is used to integrate the pseudo-labels in multiple iterations, thereby improving the robustness of the pseudo-labels.

2. The unsupervised domain adaptive target detection method according to claim 1, characterized in that: When the new pseudo-label is improved with the pseudo-label in the memory pool, MissCnt is used to record the number of times each candidate box is not matched. When the number is greater than a set number, the candidate box is removed from the memory pool.

3. The unsupervised domain adaptive target detection method according to claim 1, characterized in that: Using Faster RCNN as the basic framework, feature alignment between the source domain and the target domain is performed at the image level and instance level respectively, which is achieved by using domain classifiers. Let D i represents the domain label of the i-th training sample, when it comes from the source domain, D i = 0, when it comes from the target domain i =1, let the feature map of the i-th sample output by the backbone network model be f i , It represents the feature of the i-th sample at position (u, v), let is the output of the domain classifier for the i-th sample at position (u, v), then the adversarial loss at the image level is for Add a Gradient Reversal Layer (GRL) before the domain classifier so that the domain classifier minimizes the loss and the backbone network maximizes the loss; For instance-level alignment, let p i,j represents the output of the domain classifier corresponding to the j-th proposal output by the i-th sample after the detection head, then the adversarial loss at the instance level is for Similarly, a Gradient Reversal Layer is added before the domain classifier, so that the domain classifier minimizes the loss, while the backbone network and the detection head maximize the loss, ultimately making the features output by the backbone network and the detection head as domain-independent as possible.

4. The unsupervised domain adaptive target detection method according to claim 3, characterized in that: Add a self-attention mechanism to the two DomainClassifiers, where the self-attention weight calculated by the global feature map is set to W img , the self-attention weight calculated by the instance feature map is W ins , then the modified adversarial loss as follows: Let the model parameters of the backbone network be θ backbone , the model parameter of the detection head is θ det , the model parameters of the domain classifiers at the image and instance levels are and Let the bounding box output by the detection head and the loss corresponding to the category be The whole model solves the following optimization problem: Where λ is the coefficient; According to the IOU dynamic threshold function, the model calculates a better threshold from the statistical information of the training process. The specific calculation formula is as follows: IOU i =IOU init +γ×MovingAverage(topk[(i-IterNum):i]) where IOU init represents the initial intersection-over-union ratio threshold, MovingAverage represents the moving average function, topk represents the kth maximum value of the current IOU calculated at each iteration, IterNum represents the window size of the iteration to be selected, and γ represents the coefficient; When performing instance-level feature alignment, the dynamic IoU threshold is used as the weight of positive samples in instance-level feature alignment, so that the model can automatically adjust the degree of attention paid to foreground and background candidate boxes.

5. The unsupervised domain adaptive target detection method according to claim 1, characterized in that: The self-training method based on the memory pool adopts a multiple scoring mechanism. A memory pool is maintained in each round of pseudo-labeling. In the next round of pseudo-labeling, the prediction result is compared with the current memory pool and the current memory pool is updated; Specifically, let the pseudo-label generated in the kth round be in That is, the pseudo label corresponding to the i-th sample in the k-th round, and the memory pool of the k-1-th round is Then the memory pool after the kth round of update is: UpdateFunction updates the memory pool by the number of times the pseudo-label is not matched; For sample i, the pseudo label of the kth iteration is predicted First, by calculating and The IOU between them is the matrix Secondly, for The j-th bounding box in is matched by finding its maximum value: in this way, The jth bounding box in The The bounding boxes are matched, and the two are weighted or the larger prediction score is taken to obtain the memory pool for For the unmatched bounding box in the memory, let MissCnt represent the number of unmatched times, and increase MissCnt by one; when MissCnt is greater than the set threshold, the bounding box is no longer a valid pseudo-label and is removed from the memory pool; for The unmatched bounding boxes in the memory pool are also placed in the memory pool. And initialize MissCnt to 0; Perform the above operations on all samples, and finally get the memory pool [M t ] k , use the memory pool as a pseudo-label to retrain the model, and then start the next iteration until the results converge.

6. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 5 is implemented.