Target detection domain adaptation method and device, storage medium and computer program product

By constructing a simulation environment in the object detection domain adaptation task and using the average teacher adversarial domain adaptation baseline model to process data, combined with target category comparison learning, the problems of data imbalance and fuzzy classification boundaries are solved, and better object detection domain adaptation effect is achieved.

CN119559375AActive Publication Date: 2025-03-04SHENZHEN UNIV

Patent Information

Application Number
CN202411532282.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-30
Publication Date
2025-03-04
Estimated Expiration
2044-10-30

AI Technical Summary

Technical Problem

In the object detection domain adaptation task, it is difficult for the prior art to effectively avoid data imbalance and fuzzy classification boundaries, resulting in misclassification and inability to classify normally.

Method used

By constructing a simulation environment, automatically labeling and collecting source domain data, and combining the target domain data in the real environment, input the pre-constructed average teacher's adversity domain adaptation baseline model for processing, and obtain image-level features and target domain pseudo-labels. Then, domain adaptation is performed using target category comparison learning, including contrast loss and imbalance comparison loss in four directions.

Benefits of technology

It effectively avoids data imbalance and fuzzy classification boundaries, improves the adaptive effect of the target detection domain, and ensures the good classification performance of the model on the target domain.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119559375A_ABST
    Figure CN119559375A_ABST
Patent Text Reader

Abstract

The invention discloses a target detection domain adaptation method and device, a storage medium and a computer program product, and relates to the technical field of computer vision, and the method comprises the steps: building a simulation environment according to a pre-built engine; automatically marking and collecting source domain data from the simulation environment according to a specific data collection algorithm; obtaining target domain data collected from a real environment; inputting the source domain data and the target domain data into a pre-constructed average teacher adversarial domain adaptive baseline model for processing to obtain image-level features and target domain pseudo labels; and carrying out target detection domain adaptation on the image-level features and the target domain pseudo labels by using target category contrast learning. Through target category comparative learning, data imbalance and generation of a fuzzy classification boundary are avoided, and target detection domain adaptation is better carried out.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer vision technology, and in particular to a method, device, storage medium, and computer program product for target detection domain adaptation. Background Art

[0002] The unsupervised target detection domain adaptation task is to adapt the source domain trained model to the target domain directly without relying on the labeled data of the target domain when there is a significant difference in data distribution between the source domain and the target domain. Target detection domain adaptation is achieved by aligning the data features between the source domain and the target domain to make the features between the source domain and the target domain more similar. However, aligning the image-level and instance-level features between the source domain and the target domain by adversarial training of the discriminator and forcibly bringing the features of the source domain and the target domain close will produce blurred classification boundaries, leading to incorrect classification. In extreme cases, it may also make all instance features indistinguishable, resulting in failure to classify normally. In addition, aligning the image-level and instance-level features between the source domain and the target domain by adversarial training of the discriminator to achieve target detection domain adaptation is also affected by the data imbalance between the source domain and the target domain, which will seriously affect the adaptation process of the target detection domain.

[0003] Therefore, how to avoid data imbalance and fuzzy classification boundaries and better perform target detection domain adaptation has become an urgent problem to be solved in this application.

[0004] The above contents are only used to assist in understanding the technical solution of the present application and do not constitute an admission that the above contents are prior art. Summary of the invention

[0005] The main purpose of this application is to provide a target detection domain adaptation method, device, storage medium and computer program product, aiming to solve the technical problem of how to avoid data imbalance and generate fuzzy classification boundaries and better perform target detection domain adaptation.

[0006] To achieve the above objectives, the present application proposes a target detection domain adaptation method, the method comprising:

[0007] Build simulation environments based on pre-built engines;

[0008] automatically annotating and collecting source domain data from the simulation environment according to a specific data collection algorithm;

[0009] Obtain target domain data collected from real environments;

[0010] Inputting the source domain data and the target domain data into a pre-built average teacher adversarial domain adaptation baseline model for processing to obtain image-level features and target domain pseudo labels;

[0011] Object detection domain adaptation is performed using object category contrastive learning on the image-level features and the target domain pseudo-labels.

[0012] In one embodiment, the step of inputting the source domain data and the target domain data into a pre-built average teacher adversarial domain adaptation baseline model for processing to obtain image-level features and target domain pseudo labels also includes:

[0013] Get the student model and the teacher model;

[0014] Weights are shared between the student models, and weights are shared between the teacher models;

[0015] The average teacher adversarial domain adaptation baseline model is constructed through a weight-shared student model and a weight-shared teacher model.

[0016] In one embodiment, the average teacher adversarial domain adaptation baseline model includes one or more of a first teacher model, a second teacher model, a first student model, and a second student model. The source domain data and the target domain data are input into a pre-built average teacher adversarial domain adaptation baseline model for processing, and the step of obtaining image-level features and target domain pseudo labels includes:

[0017] Performing weak enhancement processing and strong enhancement processing on the source domain data respectively;

[0018] Inputting the weakly enhanced source domain data into the first teacher model to obtain first source domain image-level features and source domain labels;

[0019] Inputting the source domain data after strong enhancement processing into the first student model to obtain a second source domain image-level feature;

[0020] Performing weak enhancement processing and strong enhancement processing on the target domain data respectively;

[0021] The target domain data after weak enhancement processing is input into the second teacher model to obtain the first target domain image-level features and the target domain pseudo-label;

[0022] Inputting the target domain data after strong enhancement processing into the second student model to obtain the second target domain image-level features;

[0023] An image-level feature is constructed based on the first source domain image-level feature, the second source domain image-level feature, the first target domain image-level feature, and the second target domain image-level feature.

[0024] In one embodiment, the step of inputting the source domain data and the target domain data into a pre-built average teacher adversarial domain adaptation baseline model for processing to obtain image-level features and target domain pseudo labels further includes:

[0025] Performing feature alignment on the image-level features using a domain discriminator;

[0026] Using the target domain pseudo label as a supervision signal for supervising the second student model;

[0027] Using the source domain label as a supervision signal for supervising the first student model;

[0028] The detector loss is minimized by the supervisory signal of the second student model, the supervisory signal of the first student model, and the image-level features after feature alignment.

[0029] In one embodiment, the target category contrast learning includes: intra-domain and inter-domain contrast loss and imbalance contrast loss. The step of using the target category contrast learning to perform target detection domain adaptation on the image-level features and the target domain pseudo-labels includes:

[0030] Extracting target region features based on the image-level features and the target domain pseudo-labels;

[0031] Projecting the target region features into the classification contrast learning latent space, performing inter-domain and intra-domain contrast loss, and obtaining a contrast loss value;

[0032] calculating an unbalanced contrast loss value based on the contrast loss value;

[0033] In one embodiment, the target region features include: one or more of a strongly enhanced source domain, a weakly enhanced source domain, a weakly enhanced target domain, and a strongly enhanced target domain, and the step of projecting the target region features into a classification contrast learning latent space and performing inter-domain and intra-domain contrast loss to obtain a contrast loss value includes:

[0034] Projecting the target region features into a classification contrastive learning latent space;

[0035] The strongly enhanced source domain and the strongly enhanced target domain are defined as query samples;

[0036] The weakly enhanced source domain and the weakly enhanced target domain are defined as key samples;

[0037] Storing the key samples in a class-balanced momentum dictionary;

[0038] Taking the query sample as an anchor point, the target region features are subjected to intra-domain and inter-domain contrast loss in combination with the class-balanced momentum dictionary.

[0039] In one embodiment, the step of calculating the unbalanced contrast loss value based on the contrast loss value comprises:

[0040] Counting the number of instances in the domain class pair to which the anchor point belongs;

[0041] Introducing a class imbalance coefficient and a domain imbalance coefficient based on the number of instances;

[0042] The contrast loss value is re-weighted and calculated according to the category imbalance coefficient and the domain imbalance coefficient to obtain an imbalance contrast loss value.

[0043] In addition, to achieve the above-mentioned objectives, the present application also proposes a target detection domain adaptation device, which includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, and the computer program is configured to implement the steps of the target detection domain adaptation method described above.

[0044] In addition, to achieve the above-mentioned purpose, the present application also proposes a storage medium, which is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the target detection domain adaptation method described above are implemented.

[0045] In addition, to achieve the above-mentioned purpose, the present application also provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, it implements the steps of the target detection domain adaptation method as described above.

[0046] One or more technical solutions proposed in this application have at least the following technical effects:

[0047] Use the pre-built construction engine to build a simulation environment for a specific scenario, and collect a large amount of labeled source domain data from the simulation environment according to a specific data collection algorithm. After collecting a large amount of labeled source domain data through the simulation environment, a certain amount of unlabeled target domain data is collected from the real environment. The adversarial training method is adopted to input the source domain data and the target domain data into the pre-built average teacher adversarial domain adaptation baseline model for processing to obtain image-level features and target domain pseudo-labels. Target category contrast learning includes contrast losses in four directions and imbalanced contrast losses proposed for data imbalance. By performing target category contrast learning on image-level features and target domain pseudo-labels, the problem of fuzzy classification boundaries generated in the adversarial domain adaptation process is solved on the basis of data imbalance, avoiding data imbalance and fuzzy classification boundaries, thereby better realizing target detection domain adaptation. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0049] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0050] Figure 1 A schematic diagram of a flow chart provided for the first embodiment of the object detection domain adaptation method of the present application;

[0051] Figure 2 This is a schematic diagram of the elevator simulation environment built using Unity3D;

[0052] Figure 3 This is a pseudo code diagram of a specific data collection algorithm in the elevator button detection task case;

[0053] Figure 4 This is a flowchart of the second embodiment of the target detection domain adaptation method of this application;

[0054] Figure 5 This is an overall overview of the target detection domain adaptation method of this application;

[0055] Figure 6 This is a flowchart of the fourth embodiment of the target detection domain adaptation method of the present application;

[0056] Figure 7 This is a schematic diagram of the module structure of the target detection domain adaptation device according to an embodiment of the present application;

[0057] Figure 8 Schematic diagram of the device structure of the hardware operating environment involved in the target detection domain adaptation method in the embodiment of the present application.

[0058] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0059] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.

[0060] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.

[0061] The embodiment of the present application takes into account that: since the unsupervised target detection domain adaptation task is to directly adapt the source domain trained model to the target domain without relying on the labeled data of the target domain when there is an obvious data distribution difference between the source domain (SourceDomain) and the target domain (TargetDomain). The target detection domain adaptation task is completed by aligning the image-level and instance-level features between the source domain and the target domain in an adversarial training discriminator, but directly aligning the image-level and instance-level features between the source domain and the target domain and forcibly bringing the features of the source domain and the target domain close together will produce fuzzy classification boundaries, leading to incorrect classification. In extreme cases, it may also make all instance features indistinguishable, resulting in failure to classify normally. In addition, since there is often a large data imbalance between the source domain data and the target domain data, the process of aligning the image-level and instance-level features between the source domain and the target domain to achieve target detection domain adaptation is affected by data imbalance, which seriously affects the adaptation process of the target detection domain.

[0062] Therefore, the present application provides a solution, using a preset building engine to build a simulation environment for a specific scenario, and collecting a large amount of labeled source domain data from the simulation environment according to a specific data collection algorithm. After collecting a large amount of labeled source domain data through the simulation environment, a certain amount of unlabeled target domain data is collected from the real environment. The adversarial training method adopted is to input the source domain data and the target domain data into a pre-built average teacher adversarial domain adaptation baseline model for processing, and to learn cross-domain invariant features by aligning the image-level features between the source domain and the target domain of the student model in the average teacher adversarial domain adaptation baseline model. After processing by the pre-built average teacher adversarial domain adaptation baseline model, image-level features and target domain pseudo-labels are obtained. Target category contrast learning includes contrast losses in four directions and unbalanced contrast losses proposed for data imbalance. By performing target category contrast learning on image-level features and target domain pseudo-labels, the problem of fuzzy classification boundaries generated in the adversarial domain adaptation process is solved on the basis of data imbalance, thereby achieving target detection domain adaptation.

[0063] It should be noted that the execution subject of this embodiment can be a computing service device with data processing, network communication and program running functions, such as a tablet computer, a personal computer, a mobile phone, etc., or an electronic device capable of realizing the above functions, etc. This application takes the elevator button detection task in the elevator mobile robot project in the real world as an example to explain in detail the implementation process of target detection domain adaptation according to the target detection domain adaptation method proposed in this application.

[0064] Based on this, the embodiment of the present application provides a target detection domain adaptation method, referring to Figure 1 , Figure 1 This is a flowchart of the first embodiment of the object detection domain adaptation method of the present application.

[0065] In this embodiment, the target detection domain adaptation method includes steps S10 to S50:

[0066] Step S10, constructing a simulation environment according to the pre-built engine;

[0067] The pre-built engine is Unity3D. As the current mainstream game development engine, Unity3D is also widely used in the development of virtual reality and augmented reality applications due to its powerful virtual simulation capabilities. Unity3D is developed using the C# language and has powerful and realistic virtual scenes and interactive experience tools and functions that can help developers build simulation environments.

[0068] Use Unity3D's terrain editor to create terrain and build a basic simulation environment. Further use Unity3D to add environmental elements to the basic simulation environment and simulate the real environment. Add rigid bodies (Rigidbody) and colliders (such as Box Collider and Mesh Collider) to the elements in the simulation environment to simulate physical interactions and achieve the purpose of highly simulating the real environment.

[0069] Step S20, automatically labeling and collecting source domain data from the simulation environment according to a specific data collection algorithm;

[0070] Take the elevator button detection task in the real-world elevator mobile robot project as an example. Figure 2 As shown, Figure 2 This is a schematic diagram of the elevator simulation environment built using Unity3D. According to the layout of the elevator panel and the button style in the real environment, Unity3D can easily build a simulation panel corresponding to the real environment. Each button in the panel is an independent control, and the position of the button can be obtained in real time to achieve automatic labeling. The camera can capture each frame of the image to form the collected data.

[0071] like Figure 3 As shown, Figure 3 This is a pseudo code diagram of a specific data collection algorithm in the elevator button detection task case. The camera position is moved according to the specific data collection algorithm. Taking the elevator button detection task in the real-world elevator mobile robot project as an example, the camera moves in a Z shape in the XOY plane, and the camera height is randomly changed within a certain range, and the camera is randomly rotated to ensure that the elevator panel images at various angles can be captured. The lighting system can provide different lighting conditions. In addition, the digital style and color of the button can be randomly changed to generate more diverse data.

[0072] In addition, since the C# language is used to automate the processes of building a simulation environment and automatically labeling and collecting source domain data from the simulation environment according to a specific data acquisition algorithm, different types of simulation environments can be quickly built by modifying the configuration files in the Unity3D engine, as well as automatically labeling and collecting source domain data from different simulation environments according to a specific data acquisition algorithm.

[0073] Step S30, obtaining target domain data collected from a real environment;

[0074] Source domain data is large-scale labeled data, while target domain data is small-scale unlabeled target domain data. You can use cameras, depth cameras, infrared sensors and other devices to directly collect target domain data from real environments. In addition, you can also use public data sets on the Internet, such as Image Net, COCO, Kitt, etc. to obtain target domain data that meets the requirements.

[0075] Step S40, inputting the source domain data and the target domain data into a pre-built average teacher adversarial domain adaptation baseline model for processing to obtain image-level features and target domain pseudo labels;

[0076] The Average Teacher Adversarial Domain Adaptation Baseline Model is a deep learning model for solving the domain adaptation problem. The Average Teacher Adversarial Domain Adaptation Baseline Model combines the ideas of adversarial training and consistency regularization to improve the generalization ability of the model on the target domain, complete the unsupervised object detection domain adaptation task, and achieve the adaptation of the object detection domain.

[0077] The average teacher adversarial domain adaptation baseline model extracts features from the source domain and target domain data respectively, uses the pre-discriminator to perform adversarial training to obtain image-level features and target domain pseudo-labels, and minimizes the feature distribution difference between the source domain and the target domain based on the obtained image-level features and target domain pseudo-labels, so that even when the target domain data is unlabeled, the model in the source domain can have good classification performance on the target domain.

[0078] Step S50, performing target detection domain adaptation on the image-level features and the target domain pseudo-labels using target category contrastive learning.

[0079] Target category contrastive learning includes contrastive losses in four directions and an improved imbalanced contrastive loss designed for the problem of data imbalance. In-domain and inter-domain target category contrastive learning are designed in target category contrastive learning to solve the problem of fuzzy classification boundaries in the process of adversarial domain adaptation. At the same time, in order to solve the problem of data imbalance, an imbalanced contrastive loss is proposed. During the training process, the number of instances of each category in the source domain and the target domain is used to dynamically weight the contrastive loss, so that the model in the source domain can also adapt well to the target domain in the case of data imbalance.

[0080] By performing target category comparative learning on image-level features and target domain pseudo-labels, the relevant models in the source domain can maintain good detection performance in the target domain, thus completing the adaptation of the target detection domain.

[0081] This embodiment provides a method for target detection domain adaptation, which uses a preset building engine to build a simulation environment in a specific scenario, and collects a large amount of labeled source domain data from the simulation environment according to a specific data collection algorithm. After collecting a large amount of labeled source domain data through the simulation environment, a certain amount of unlabeled target domain data is collected from the real environment. The adversarial training method is adopted, and the source domain data and the target domain data are input into the pre-built average teacher adversarial domain adaptation baseline model for processing to obtain image-level features and target domain pseudo-labels. Target category contrast learning includes contrast losses in four directions and unbalanced contrast losses proposed for data imbalance. By performing target category contrast learning on image-level features and target domain pseudo-labels, the fuzzy classification boundary problem generated in the adversarial domain adaptation process is solved on the basis of data imbalance, thereby achieving target detection domain adaptation.

[0082] Based on the first embodiment of the present application, the second embodiment of the present application is proposed. In the second embodiment of the present application, the same or similar contents as those of the above-mentioned embodiment 1 can be referred to the above introduction, and will not be repeated in the following.

[0083] On this basis, please refer to Figure 4 , Figure 4 This is a flowchart of the second embodiment of the target detection domain adaptation method of the present application.

[0084] In this embodiment, the source domain data and the target domain data are input into a pre-built average teacher adversarial domain adaptation baseline model for processing, and steps S341 to S343 are also included before step S40 of obtaining image-level features and target domain pseudo labels:

[0085] Step S341, obtaining a student model and a teacher model;

[0086] The student model and the teacher model are the existing trained models, and the weights and architectures of the teacher model and the student model are saved, such as Figure 5 As shown, Figure 5 This is an overall overview of the target detection domain adaptation method of this application. The overall structure of the average teacher adversarial domain adaptation baseline model used in this application includes two weight-sharing student models and two weight-sharing teacher models, and the two weight-sharing student models or teacher models are used to extract features of the source domain and the target domain respectively.

[0087] Step S342, weight sharing is performed between the student models, and weight sharing is performed between the teacher models;

[0088] The weights of the two obtained student models are shared, and the weights of the two teacher models are shared. The student and teacher models have the same model structure but different weight parameters. The student model focuses on the exploration ability of the model and uses gradient descent to update the model parameters to minimize the detector loss. The teacher model is slowly updated using momentum updates based on the parameters of the student model to obtain a more stable and robust model.

[0089] Step S343, constructing an average teacher adversarial domain adaptation baseline model through a weight-shared student model and a weight-shared teacher model.

[0090] The student model is used to explore and learn the feature representation of diverse data, and the teacher model focuses more on stability and applicability to generate reliable pseudo labels for the target domain. Therefore, the average teacher adversarial domain adaptation baseline model proposed in this application includes two weight-sharing student models and two weight-sharing teacher models. The two weight-sharing student models or teacher models are used to extract features from the source domain and the target domain, respectively.

[0091] In this embodiment, an average teacher adversarial domain adaptation baseline model is constructed by two weight-sharing student models and two weight-sharing teacher models. Among them, the student model focuses on the exploration ability of the model, and updates the model parameters using gradient descent to minimize the detector loss. The teacher model is slowly updated using momentum updates based on the parameters of the student model, thereby obtaining a more stable and robust model, so that the average teacher adversarial domain adaptation baseline model can generate target domain pseudo labels with stable test performance, and can align the image-level features between the source domain and the target domain of the student network to learn cross-domain invariant features, while minimizing the boundary blur problem generated during the target detection domain adaptation process.

[0092] Based on the first embodiment and / or the second embodiment of the present application, the third embodiment of the present application is proposed. In the third embodiment of the present application, the same or similar contents as those of the above-mentioned first and second embodiments can be referred to the above introduction, and will not be repeated in the following.

[0093] In this embodiment, the Figure 5 , taking the elevator button detection task in the elevator mobile robot project in the real world as an example, the source domain data and the target domain data are input into the pre-built average teacher adversarial domain adaptation baseline model for processing, and the step S40 of obtaining image-level features and target domain pseudo labels may include steps S401 to S407:

[0094] Step S401, performing weak enhancement processing and strong enhancement processing on the source domain data respectively;

[0095] Since the student model is used to explore and learn the feature representation of diverse data, the teacher model pays more attention to stability and applicability to produce reliable pseudo labels for the target domain. In order to maximize the performance of the average teacher against the domain adaptation baseline model, such as Figure 5 As shown, the source domain data is subjected to weak enhancement and strong enhancement respectively, and the target domain data is subjected to weak enhancement and strong enhancement respectively, wherein the strong enhancement includes image blurring and random erasing, etc., and the weak enhancement includes image flipping, color change, etc.

[0096] Step S402, inputting the source domain data after weak enhancement processing into the first teacher model to obtain first source domain image-level features and source domain labels;

[0097] Input the weakly enhanced source domain data into the first teacher model First Teacher Model The features of the source domain data are extracted to obtain the source domain label and the image-level features of the source domain data after weak enhancement processing.

[0098] Step S403, inputting the source domain data after strong enhancement processing into the first student model to obtain second source domain image-level features;

[0099] The source domain data after strong enhancement processing is input into the first student model f, and the first student model f learns the diversified feature representation ability of the source domain data after strong enhancement processing to obtain the second source domain image-level features.

[0100] Step S404, performing weak enhancement processing and strong enhancement processing on the target domain data respectively;

[0101] The target domain data is subjected to weak enhancement and strong enhancement respectively, wherein the strong enhancement includes image enhancement operations such as image blurring and random erasing, and the weak enhancement includes image enhancement operations such as image flipping and color change.

[0102] Step S405, inputting the target domain data after weak enhancement processing into the second teacher model to obtain the first target domain image-level features and the target domain pseudo-label;

[0103] like Figure 5 As shown in Figure 2, the target domain data after weak enhancement is input into the second teacher model. Second teacher model It receives weakly enhanced images as input to obtain stable testing performance and generate target domain pseudo labels as well as first target domain image-level features.

[0104] Step S406, inputting the target domain data after strong enhancement processing into the second student model to obtain the second target domain image-level features;

[0105] The target domain data after strong enhancement processing is input into the second student model f, and the second student model f learns the diversified feature representation ability of the target domain data after strong enhancement processing to obtain the second target domain image-level features.

[0106] Step S407: constructing an image-level feature based on the first source domain image-level feature, the second source domain image-level feature, the first target domain image-level feature, and the second target domain image-level feature.

[0107] An image-level feature is constructed according to the first source domain image-level feature, the second source domain image-level feature, the first target domain image-level feature, and the second target domain image-level feature.

[0108] In this embodiment, the student model receives strongly enhanced images as input to learn the feature representation ability of data diversity, and the teacher model receives weakly enhanced images as input to obtain stable test performance and generate target domain pseudo labels. The adversarial training method is adopted to learn cross-domain invariant features by averaging the image-level features between the source domain and the target domain of the student network of the teacher adversarial domain adaptation baseline model.

[0109] Based on the above-mentioned embodiments of the present application, a fourth embodiment of the present application is proposed. In the fourth embodiment of the present application, the same or similar contents as those of the above-mentioned embodiments can be referred to the above introduction and will not be repeated later.

[0110] On this basis, please refer to Figure 6 , Figure 6 A flowchart of the fourth embodiment of the target detection domain adaptation method proposed in the present application.

[0111] In this embodiment, the source domain data and the target domain data are input into a pre-built average teacher adversarial domain adaptation baseline model for processing, and step S40 of obtaining image-level features and target domain pseudo labels further includes steps S1 to S4:

[0112] Step S1, using a domain discriminator to perform feature alignment on the image-level features;

[0113] The domain discriminator distinguishes whether the features extracted by the feature extractor are from the source domain or the target domain. In the process of adversarial training against the domain adaptation baseline model using the average teacher, the output of the domain discriminator is used to guide the feature extractor to learn domain-invariant features.

[0114] The domain discriminator distinguishes the image-level features extracted from the source domain data and the target domain data. The domain discriminator prompts the feature extractor to generate features that are difficult to distinguish between the source domain and the target domain, thereby achieving feature alignment.

[0115] Step S2, using the target domain pseudo label as a supervision signal for supervising the second student model;

[0116] Since the weight-sharing student model or teacher model is used to extract features from the source domain and target domain respectively, the student and teacher models have the same model structure but different weight parameters. The student model focuses on the exploration ability of the model, while the teacher model is slowly updated using momentum updates based on the parameters of the student model to obtain a more stable and robust model. Therefore, the target domain pseudo labels and source domain labels generated by the more stable teacher model can be used as supervisory signals to supervise the student model.

[0117] like Figure 5 As shown, the target domain pseudo-label is used as a supervision signal to supervise the second student model.

[0118] Step S3, using the source domain label as a supervision signal for supervising the first student model;

[0119] like Figure 5 As shown, the source domain label, i.e. Figure 5 The ground truth data shown serves as the supervision signal for supervising the first student model.

[0120] It should be noted that in the field of Virtual-to-Real Transfer, the term "Ground Truth" refers to accurate and reliable data or information in the target domain (usually the real world). Ground truth data is used as a reference standard to measure model performance and is considered to be the data closest to the real situation and is indispensable.

[0121] Step S4, minimizing the detector loss by using the supervisory signal of the second student model, the supervisory signal of the first student model, and the image-level features after feature alignment.

[0122] The student model and the teacher model have the same model structure but different weight parameters. The student model focuses on the exploration ability of the model. The student model uses gradient descent to update the model parameters to minimize the detector loss. The teacher model uses momentum update to slowly update the parameters of the student model to obtain a more stable and robust model.

[0123] The student model updates the model parameters using gradient descent to minimize the detector loss, and further minimizes the detector loss by combining the supervisory signal and the image-level features after feature alignment.

[0124] In this embodiment, a domain discriminator is used to align image-level features to minimize the data difference between source domain data and target domain data, so that the model in the source domain can adapt well to the target domain; the detector loss is minimized based on the supervisory signal and the image-level features after feature alignment, thereby improving the performance of the model in the source domain in the unsupervised object detection domain adaptation task.

[0125] Based on the above embodiments of the present application, a fifth embodiment of the present application is proposed. The same or similar contents as the above embodiments can be referred to the above introduction, and will not be described in detail later.

[0126] In this embodiment, step S50 of using target category contrastive learning to perform target detection domain adaptation on the image-level features and the target domain pseudo-labels may include steps S501 to S504:

[0127] Step S501, extracting target region features based on the image-level features and the target domain pseudo-labels; obtaining four image-level features from two student models and two teacher models, and using ROI Align, respectively extracting ROI features of the source domain and the target domain using the source domain labels and the target domain pseudo-labels generated by the teacher models, the ROI features being the target region features, and aligning the ROI features to a uniform size, and obtaining four types of ROI features: strongly enhanced source domain, weakly enhanced source domain, weakly enhanced target domain, and strongly enhanced target domain.

[0128] Step S502, projecting the target region features into the classification contrast learning latent space, performing inter-domain and intra-domain contrast loss, and obtaining a contrast loss value;

[0129] By calculating the inter-domain and intra-domain contrast loss, the problem of blurred classification boundaries generated during adversarial domain adaptation is solved. The ROI features are projected into the latent space for target classification contrast learning using the MLP projection layer, and inter-domain and intra-domain contrast losses are performed based on the target region features. The contrast loss between the strongly enhanced source domain and the weakly enhanced source domain, the contrast loss between the weakly enhanced target domain and the strongly enhanced target domain, the contrast loss between the strongly enhanced source domain and the strongly enhanced target domain, and the contrast loss between the weakly enhanced source domain and the weakly enhanced target domain are calculated.

[0130] It should be noted that MLP is a nonlinear projection layer, which is composed of two fully connected layers and nonlinear activation functions. Both the MLP layer and the backbone network are updated using the average teacher paradigm.

[0131] Specifically, in a feasible implementation manner, by projecting the target region feature into the classification contrast learning latent space and performing inter-domain and intra-domain contrast loss, step S502 of obtaining the contrast loss value may include steps A1 to A5:

[0132] Step A1, projecting the target region features into a classification contrast learning latent space;

[0133] An MLP projection layer is used to project the ROI features into a latent space for contrastive learning of object classification.

[0134] Step A2, defining the strong enhancement source domain and the strong enhancement target domain as query samples;

[0135] To construct the contrast pair, the strongly enhanced latent features of the source and target domains are defined as the query sample q.

[0136] Step A3, defining the weakly enhanced source domain and the weakly enhanced target domain as key samples;

[0137] The weakly enhanced latent features of the source and target domains are defined as key samples k.

[0138] Step A4, storing the key samples in a class-balanced momentum dictionary;

[0139] A class-balanced momentum dictionary is proposed to store historical key samples to construct a large number of contrast pairs without relying on the size of the mini-batch, similar to the momentum queue in unsupervised contrastive learning MOCO.

[0140] Step A5, taking the query sample as an anchor point and combining the class-balanced momentum dictionary to perform intra-domain and inter-domain contrast loss on the target region features;

[0141] In target category contrastive learning, the query sample is regarded as an anchor point. The goal of target category contrastive learning is to bring the anchor point closer to the key samples of the same category (positive samples) and away from the key samples of different categories (negative samples).

[0142] For each category, the momentum dictionary maintains a queue of equal size, where key samples are stored according to the first-in, first-out rule. The momentum dictionary not only provides rich negative samples, but also enriches the set of positive samples.

[0143] like Figure 5As shown in the figure, target category contrastive learning considers different combinations of anchor points and momentum dictionaries, including four contrastive losses within and between domains: the intra-domain includes source to source and target to target, and the inter-domain includes source to target and target to source, namely, the contrastive loss between the strongly enhanced source domain and the weakly enhanced source domain, the contrastive loss between the weakly enhanced target domain and the strongly enhanced target domain, the contrastive loss between the strongly enhanced source domain and the strongly enhanced target domain, and the contrastive loss between the weakly enhanced source domain and the weakly enhanced target domain.

[0144] The contrast loss L from source domain to target domain is c st As an example, the specific calculation process of contrast loss is described in detail. The contrast loss L from the source domain to the target domain c st The calculation formula is as follows:

[0145]

[0146] where q i represents a specific query sample in a mini-batch as an anchor point in contrastive learning, and Represents the unbalanced momentum dictionary M t About anchor point q i positive and negative samples. sim is a distance metric function, and this application uses the method of calculating the inner product (i.e., cosine similarity) for calculation. tau is a temperature coefficient, i.e., the symbol T in the formula, the numerator represents the exponential similarity between the anchor point and the positive sample, and the denominator represents the sum of the exponential similarities between the anchor point and the positive sample and all negative samples. tau guides the anchor point to be closer to the positive sample and away from all negative samples.

[0147] For the contrast loss calculation in other directions, refer to the contrast loss L from the source domain to the target domain c st The calculation formula is: replace q in the formula s and M t Replacing with the subscript of the corresponding domain can complete the calculation of the contrast loss in the remaining directions.

[0148] In this embodiment, target category contrastive learning considers different combinations of anchor points and momentum dictionaries, including four contrastive losses within and between domains: within the domain, including source to source and target to target, and between domains, including source to target and target to source. Intra-domain and inter-domain target category contrastive learning is performed to solve the problem of fuzzy classification boundaries generated in the adversarial domain adaptation process.

[0149] The above is only a feasible implementation of step S502 provided in this embodiment, and this embodiment does not specifically limit the specific implementation of step S502.

[0150] Step S503, calculating an unbalanced contrast loss value based on the contrast loss value;

[0151] Virtual-to-real migration tasks and real-world object detection datasets often suffer from serious data imbalance problems, including imbalance in categories and domains. In object category contrastive learning, ROI features are extracted based on actual labels or pseudo labels, so the data distribution in the source and target domains directly affects the distribution of ROI features, which in turn affects the contrast loss.

[0152] In order to solve the imbalanced contrast loss, consider the imbalance of categories and domains, and also to better count the number of instances of each category in each domain, the concept of domain-class pairs is proposed. Domain-class pairs can be written as a two-dimensional tuple (domain, class), which represents the set of all samples from the same domain and the same category. Each query sample and key sample can find a unique (domain, class) pair, and n(.) is used to represent the number of instances of the domain-class pair of the specified query sample or key sample.

[0153] Specifically, in a feasible implementation manner, the step S503 of calculating the unbalanced contrast loss based on the contrast loss value to adapt to the target detection domain may include steps A6 to A8:

[0154] Step A6, counting the number of instances in the domain class pair to which the anchor point belongs;

[0155] Since data imbalance includes category imbalance and domain imbalance, in order to perform target detection domain adaptation tasks based on data imbalance, the problems of category imbalance and domain imbalance need to be solved.

[0156] It should be noted that category imbalance refers to the different category distributions within a single domain. This category imbalance is very common in real-world datasets. For example, in the training set of the public dataset Cityscapes, there are 17,994 instances in the "person" category, while there are only 171 instances in the "train" category. This will cause the model to tend to learn category features with more instances and ignore categories with fewer instances. Therefore, this application weights the contrast loss of each anchor point in the target category contrast learning by counting the number of instances in the (domain, class) pair to which the anchor point belongs, so that the model pays more attention to the migration of a small number of categories during the learning process, thereby solving the category imbalance.

[0157] In addition, it should be noted that domain imbalance refers to the large difference in the amount of data between the source domain and the target domain. In the virtual-to-real domain adaptation task, there is usually a large amount of labeled virtual data, and considering the data collection and annotation costs, there is only a small amount of real data and it is not labeled. For example, in the public BDD100k dataset, the source domain "daytime" contains 36,728 images, while the target domain "dawn / dusk" has only 5027 images. In fact, many domain adaptation tasks in the real world are adaptations from large-scale datasets to small-scale datasets. This domain imbalance will seriously affect the performance of the model. Due to the uncertainty of pseudo-labels, the number of (domain, class) pairs in the target domain changes dynamically. Therefore, this application weights the contrast loss of a single anchor point by dynamically calculating the ratio between the number of positive samples of the anchor point and the number of domain class pairs where the anchor point itself is located, so that when the model performs category semantic alignment, it focuses more on the knowledge transfer from domains with a small number of categories to domains with a large number of categories, thereby solving domain imbalance.

[0158] Step A7, introducing a class imbalance coefficient and a domain imbalance coefficient based on the number of instances;

[0159] According to the number of instances, a class imbalance coefficient is introduced and recorded as w c , used to re-weight the contrast loss, specifically expressed as follows:

[0160]

[0161] Among them, ε(=0.999) is a hyperparameter. n(q i ) represents the anchor point q i The number of instances of the (domain, class) pair to which this belongs. c Assign larger weights to the minority class to alleviate the class imbalance problem.

[0162] According to the number of instances, a domain imbalance coefficient is introduced, and w d It is used to re-weight the contrast loss, which is expressed as follows:

[0163]

[0164] The domain imbalance coefficient is applied to the target class contrast loss between domains. and Because the query anchor q i and its positive sample From different domains. When applied to intra-domain contrast loss and When q i and The categories are the same and the domains they belong to are also the same, that is, they come from the same (domain, category) pair. In this case, w dDegenerates and its value is equal to 1.

[0165] Step A8: re-weighting the contrast loss value according to the class imbalance coefficient and the domain imbalance coefficient to adapt to the target detection domain.

[0166] After introducing the category imbalance coefficient and domain imbalance coefficient, the contrast loss L from the source domain to the target domain is used. c st For example, the contrast loss L from the source domain to the target domain c st The calculation formula is converted into the following form:

[0167]

[0168] Among them, w c is the class imbalance coefficient, w d is the domain imbalance coefficient, S represents the sum of the exponential similarities of all negative samples, and sim is the original L c st The distance metric function in the calculation formula, q i represents a specific query sample in a mini-batch as an anchor point in contrastive learning, and Represent the momentum dictionary M t About anchor point q i positive and negative samples, tau is a temperature coefficient, that is, the symbol T in the formula, its numerator represents the exponential similarity between the anchor point and the positive sample, and its denominator represents the sum of the exponential similarities between the anchor point and the positive sample and all negative samples.

[0169] In this embodiment, the contrast loss of each anchor point is weighted by counting the number of instances in the (domain, class) pair to which each anchor point belongs in the target category contrast learning, and a category imbalance coefficient is introduced, so that the model pays more attention to the migration of categories with a small number during the learning process, thereby solving the category imbalance. By dynamically calculating the ratio between the number of positive samples of the anchor point and the number of domain class pairs to which the anchor point itself belongs, a domain imbalance coefficient is introduced to weight the contrast loss of a single anchor point, so that when the model performs category semantic alignment, it pays more attention to the knowledge transfer from the domain with a small number of categories to the domain with a large number of categories, thereby solving the domain imbalance.

[0170] The above is only a feasible implementation of step S503 provided in this embodiment, and this embodiment does not specifically limit the specific implementation of step S503.

[0171] Step S504, performing target detection domain adaptation in combination with the contrast loss value and the imbalance contrast loss value;

[0172] The contrast loss value is re-weighted by the category imbalance coefficient and the domain imbalance coefficient. The contrast loss value solves the problem of blurred classification boundaries generated in the detection domain adaptation process, while the introduced imbalance coefficient solves the problem of huge data differences and data imbalance between the source domain data and the target domain data.

[0173] In this embodiment, target category contrast learning includes intra-domain and inter-domain contrast loss and unbalanced contrast loss. The intra-domain and inter-domain contrast loss solves the problem of fuzzy classification boundaries that occur in the target domain adaptation process. The unbalanced contrast loss is performed on the basis of the intra-domain and inter-domain contrast loss to solve the problem of data imbalance in the source domain and the target domain. It is to achieve target detection domain adaptation under the premise that the source domain and the target domain data are very different and the data is unbalanced, and at the same time prevent the problem of fuzzy classification boundaries in the target detection domain adaptation process, achieve zero labeling cost, and effectively improve the detection accuracy.

[0174] It should be noted that the above examples are only used to understand the present application and do not constitute a limitation on the target detection domain adaptation method of the present application. More simple transformations based on this technical concept are all within the protection scope of the present application.

[0175] This application also provides a target detection domain adaptation device, please refer to Figure 7 , the target detection domain adaptation device comprises:

[0176] A simulation environment building module 10 is used to build a simulation environment according to a pre-built engine;

[0177] Use Unity3D's terrain editor to create terrain and build a basic simulation environment. Further use Unity3D to add environmental elements to the basic simulation environment and simulate the real environment.

[0178] A source domain data acquisition module 20, configured to automatically annotate and acquire source domain data from the simulation environment according to a specific data acquisition algorithm;

[0179] By modifying the configuration files in the Unity3D engine, you can quickly build different types of simulation environments, and automatically annotate and collect source domain data from different simulation environments based on specific data collection algorithms.

[0180] The target domain data acquisition module 30 is used to acquire the target domain data collected from the real environment;

[0181] Use cameras, depth cameras, infrared sensors and other devices to directly collect target domain data from the real environment.

[0182] The target detection domain adaptation module 40 is used to input the source domain data and the target domain data into a pre-built average teacher adversarial domain adaptation baseline model for processing, obtain image-level features and target domain pseudo-labels, and use target category contrast learning to perform target detection domain adaptation on the image-level features and the target domain pseudo-labels.

[0183] The average teacher adversarial domain adaptation baseline model extracts features from the source domain and target domain data respectively, uses the pre-discriminator to perform adversarial training to obtain image-level features and target domain pseudo-labels, and minimizes the feature distribution difference between the source domain and the target domain based on the obtained image-level features and target domain pseudo-labels, so that even when the target domain data is unlabeled, the model in the source domain can have good classification performance on the target domain.

[0184] Target category contrastive learning includes contrastive losses in four directions and an improved imbalanced contrastive loss designed for the problem of data imbalance. In-domain and inter-domain target category contrastive learning are designed in target category contrastive learning to solve the problem of fuzzy classification boundaries in the process of adversarial domain adaptation. At the same time, in order to solve the problem of data imbalance, an imbalanced contrastive loss is proposed. During the training process, the number of instances of each category in the source domain and the target domain is used to dynamically weight the contrastive loss, so that the model in the source domain can also adapt well to the target domain in the case of data imbalance.

[0185] The target detection domain adaptation device provided by the present application adopts the target detection domain adaptation method in the above embodiment, which can solve the technical problem of target detection domain adaptation. Compared with the prior art, the beneficial effects of the target detection domain adaptation device provided by the present application are the same as the beneficial effects of the target detection domain adaptation method provided by the above embodiment, and the other technical features in the target detection domain adaptation device are the same as the features disclosed in the above embodiment method, which will not be repeated here.

[0186] The present application provides a target detection domain adaptation device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the target detection domain adaptation method in the above-mentioned embodiment one.

[0187] Reference below Figure 8, which shows a schematic diagram of the structure of a target detection domain adaptation device suitable for implementing the embodiment of the present application. The target detection domain adaptation device in the embodiment of the present application may include but is not limited to mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 8 The target detection domain adaptation device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0188] like Figure 8 As shown, the target detection domain adaptation device may include a processing device 1001 (e.g., a central processing unit, a graphics processor, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM: Read Only Memory) 1002 or a program loaded from a storage device 1003 to a random access memory (RAM: Random Access Memory) 1004. In RAM1004, various programs and data required for the operation of the target detection domain adaptation device are also stored. The processing device 1001, ROM1002, and RAM1004 are connected to each other via a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Typically, the following systems can be connected to the I / O interface 1006: an input device 1007 including, for example, a touch screen, a touchpad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output device 1008 including, for example, a liquid crystal display (LCD: Liquid Crystal Display), a speaker, a vibrator, etc.; a storage device 1003 including, for example, a tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 can allow the target detection domain adaptation device to communicate with other devices wirelessly or by wire to exchange data. Although the target detection domain adaptation device with various systems is shown in the figure, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems can be implemented or have alternatively.

[0189] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.

[0190] The target detection domain adaptation device provided by the present application adopts the target detection domain adaptation method in the above embodiment, which can solve the technical problem of target detection domain adaptation. Compared with the prior art, the beneficial effects of the target detection domain adaptation device provided by the present application are the same as the beneficial effects of the target detection domain adaptation method provided by the above embodiment, and the other technical features in the target detection domain adaptation device are the same as the features disclosed in the method of the previous embodiment, which will not be repeated here.

[0191] It should be understood that the various parts disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.

[0192] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

[0193] The present application provides a computer-readable storage medium having computer-readable program instructions (ie, computer programs) stored thereon, the computer-readable program instructions being used to execute the object detection domain adaptation method in the above-mentioned embodiment.

[0194] The computer-readable storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination of the above.

[0195] The computer-readable storage medium may be included in the target detection domain adaptation device; or may exist independently without being assembled into the target detection domain adaptation device.

[0196] The above-mentioned computer-readable storage medium carries one or more programs. When the above-mentioned one or more programs are executed by the target detection domain adaptation device, the target detection domain adaptation device: builds a simulation environment according to a pre-built engine; automatically labels and collects source domain data from the simulation environment according to a specific data acquisition algorithm; obtains target domain data collected from a real environment; inputs the source domain data and the target domain data into a pre-built average teacher adversarial domain adaptation baseline model for processing to obtain image-level features and target domain pseudo-labels; uses target category contrast learning for the image-level features and the target domain pseudo-labels to perform target detection domain adaptation.

[0197] Computer program code for performing the operations of the present application may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as an independent software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0198] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0199] The modules involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.

[0200] The readable storage medium provided in this application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned target detection domain adaptation method, and can solve the technical problem of target detection domain adaptation. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in this application are the same as the beneficial effects of the target detection domain adaptation method provided in the above-mentioned embodiment, and will not be repeated here.

[0201] The present application also provides a computer program product, including a computer program, which implements the steps of the above-mentioned target detection domain adaptation method when executed by a processor.

[0202] The computer program product provided in this application can solve the technical problem of target detection domain adaptation. Compared with the prior art, the beneficial effects of the computer program product provided in this application are the same as the beneficial effects of the target detection domain adaptation method provided in the above embodiment, which will not be repeated here.

[0203] The above descriptions are only some embodiments of the present application, and are not intended to limit the patent scope of the present application. All equivalent structural changes made using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect applications in other related technical fields are included in the patent protection scope of the present application.

Claims

1. A target detection domain adaptation method, characterized in that: The method comprises: Build simulation environments based on pre-built engines; automatically annotating and collecting source domain data from the simulation environment according to a specific data collection algorithm; Obtain target domain data collected from real environments; Inputting the source domain data and the target domain data into a pre-built average teacher adversarial domain adaptation baseline model for processing to obtain image-level features and target domain pseudo labels; Object detection domain adaptation is performed using object category contrastive learning on the image-level features and the target domain pseudo-labels.

2. The method according to claim 1, characterized in that Before the step of inputting the source domain data and the target domain data into a pre-built average teacher adversarial domain adaptation baseline model for processing to obtain image-level features and target domain pseudo labels, the step further includes: Get the student model and the teacher model; Weights are shared between the student models, and weights are shared between the teacher models; The average teacher adversarial domain adaptation baseline model is constructed through a weight-shared student model and a weight-shared teacher model.

3. The method according to claim 2, characterized in that The average teacher adversarial domain adaptation baseline model includes one or more of a first teacher model, a second teacher model, a first student model, and a second student model. The source domain data and the target domain data are input into the pre-built average teacher adversarial domain adaptation baseline model for processing, and the step of obtaining image-level features and target domain pseudo labels includes: Performing weak enhancement processing and strong enhancement processing on the source domain data respectively; Inputting the weakly enhanced source domain data into the first teacher model to obtain first source domain image-level features and source domain labels; Inputting the source domain data after strong enhancement processing into the first student model to obtain a second source domain image-level feature; Performing weak enhancement processing and strong enhancement processing on the target domain data respectively; The target domain data after weak enhancement processing is input into the second teacher model to obtain the first target domain image-level features and the target domain pseudo-label; Inputting the target domain data after strong enhancement processing into the second student model to obtain the second target domain image-level features; An image-level feature is constructed based on the first source domain image-level feature, the second source domain image-level feature, the first target domain image-level feature, and the second target domain image-level feature.

4. The method according to claim 3, characterized in that After the step of inputting the source domain data and the target domain data into a pre-built average teacher adversarial domain adaptation baseline model for processing to obtain image-level features and target domain pseudo labels, the following step further includes: Performing feature alignment on the image-level features using a domain discriminator; Using the target domain pseudo label as a supervision signal for supervising the second student model; Using the source domain label as a supervision signal for supervising the first student model; The detector loss is minimized by the supervisory signal of the second student model, the supervisory signal of the first student model, and the image-level features after feature alignment.

5. The method according to claim 1, characterized in that The target category contrast learning includes: intra-domain and inter-domain contrast loss and imbalance contrast loss. The step of using the target category contrast learning to perform target detection domain adaptation on the image-level features and the target domain pseudo-labels includes: Extracting target region features based on the image-level features and the target domain pseudo-labels; Projecting the target region features into the classification contrast learning latent space, performing inter-domain and intra-domain contrast loss, and obtaining a contrast loss value; calculating an unbalanced contrast loss value based on the contrast loss value; The contrast loss value and the imbalance contrast loss value are combined to perform object detection domain adaptation.

6. The method according to claim 5, characterized in that The target region features include: one or more of a strongly enhanced source domain, a weakly enhanced source domain, a weakly enhanced target domain, and a strongly enhanced target domain. The step of projecting the target region features into a classification contrast learning latent space and performing inter-domain and intra-domain contrast loss to obtain a contrast loss value includes: Projecting the target region features into a classification contrastive learning latent space; The strongly enhanced source domain and the strongly enhanced target domain are defined as query samples; The weakly enhanced source domain and the weakly enhanced target domain are defined as key samples; Storing the key samples in a class-balanced momentum dictionary; Taking the query sample as an anchor point, the target region features are subjected to intra-domain and inter-domain contrast loss in combination with the class-balanced momentum dictionary.

7. The method according to claim 5, characterized in that The step of calculating the unbalanced contrast loss value based on the contrast loss value comprises: Counting the number of instances in the domain class pair to which the anchor point belongs; Introducing a class imbalance coefficient and a domain imbalance coefficient based on the number of instances; The contrast loss value is re-weighted and calculated according to the category imbalance coefficient and the domain imbalance coefficient to obtain an imbalance contrast loss value.

8. A target detection domain adaptation device, characterized in that: The device comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the target detection domain adaptation method according to any one of claims 1 to 7.

9. A storage medium, characterized in that: The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the target detection domain adaptation method according to any one of claims 1 to 7 are implemented.

10. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the steps of the object detection domain adaptation method according to any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Teacher consensus aggregation learning method based on random response differential privacy technology

    CN112885468A

  • Cross-domain small sample classification method, system and device and storage medium

    CN116452897A

  • Unsupervised cross-domain target detection method for aligning mean teachers based on pseudo label confidence

    CN118823456A

Cited By

  • Vital sign signal regression model construction method based on fuzzy set

    CN120449118A

  • A method for constructing a vital sign signal regression model based on a fuzzy set

    CN120449118B