A target detection domain adaptation method based on stochastic context consistency reasoning

By using a stochastic context-consistent inference network combined with a teacher-student model framework, the performance degradation of object detectors in domain adaptation is addressed, enhancing the capture of specific domain features and cross-domain adaptation capabilities, thereby improving detection performance and robustness.

CN119313866BActive Publication Date: 2025-10-31HANGZHOU DIANZI UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411159473.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-22
Publication Date
2025-10-31
Estimated Expiration
2044-08-22

AI Technical Summary

Technical Problem

Existing object detectors suffer from domain shift issues when transferring knowledge from labeled source domain datasets to unlabeled target domains, leading to performance degradation. Furthermore, existing methods ignore the contextual relevance between objects and the background, as well as domain-specific features.

Method used

A stochastic context-consistent reasoning network is adopted, which combines a stochastic complementary masking module, an internal context-consistent reasoning module, and an external context-consistent reasoning module with a teacher-student model framework, and utilizes self-supervised learning and pseudo-labels to enhance cross-domain adaptability.

Benefits of technology

It improves the detection performance of the object detector in the target domain, enhances the ability to capture features in specific domains and the ability to adapt across domains, and improves the robustness and generalization ability of the model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119313866B_ABST
    Figure CN119313866B_ABST
Patent Text Reader

Abstract

This invention discloses a target detection domain adaptation method based on stochastic contextual consistency inference. It employs a semi-supervised learning teacher-student model framework, using an exponential moving average of the teacher model for slow updates, allowing the model to acquire information from the student model's primary knowledge, thus achieving self-supervision. A stochastic complementary masking module is introduced to mask some heavily relied-upon local visual features, encouraging the network to utilize other visual cues within the context. Furthermore, an internal contextual consistency inference module avoids the heavy reliance on pseudo-labels found in most self-training frameworks, improving the student model's contextual reasoning ability by constructing a self-supervised training paradigm. Finally, an external contextual consistency inference module constructs a self-training framework based on the teacher-student model, using pseudo-labels with global prior knowledge from the teacher model to encourage the student model to make correct predictions for masked regions.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of domain-adaptive target detection and image processing, and specifically relates to a domain-adaptive target detection method based on random contextual consistency reasoning. Background Technology

[0002] In the field of computer vision, object detection plays a crucial role in applications such as autonomous driving, intelligent monitoring, and industrial automation. However, detectors trained on labeled source domain datasets experience severe performance degradation in real-world applications due to domain shift caused by differences in appearance and texture between objects and the background. To address this issue, researchers have turned their attention to object detection domain adaptation techniques, hoping to design a detector capable of transferring knowledge learned from labeled source domain data to the unlabeled target domain.

[0003] Unlike traditional object detection, the key challenge of object detection prefitting lies in learning domain-invariant features to bridge the domain gap while preserving domain-specific features of the target domain to facilitate detection. Mainstream methods attempt to adjust the feature distribution between the source and target domains through pixel-level, instance-level, and image-level adversarial learning. Other methods attempt to mitigate domain bias by using prototype modeling as class centers and leveraging graph matching theory to minimize each distance. However, these methods focus on extracting domain-invariant features, which may lead to the neglect of domain-specific features that reflect discriminative information about objects in the target domain. Furthermore, they ignore contextual correlations between objects and between objects and the background, which can provide strong discriminative cues for object detection, especially when there is a significant domain gap.

[0004] Recently, some object detection pre-adaptation methods have introduced self-training frameworks and achieved significant performance improvements. The teacher model predicts unlabeled target images to obtain pseudo-labels, thereby guiding the student model to generate predictions close to the pseudo-labels, achieving a consistency constraint relationship between the teacher and student models (e.g., ...). Figure 1 (as shown in (a)). However, the pseudo-labels generated by the teacher model are usually of poor quality, and this single constraint limits the domain adaptability of the student model, resulting in unsatisfactory learning outcomes. Summary of the Invention

[0005] To address the shortcomings of existing technologies, this invention provides a target detection domain adaptation method based on stochastic context-consistent reasoning. This invention proposes a stochastic context-consistent reasoning network that learns context-related knowledge of the target domain (such as...) through multi-view context consistency. Figure 1(As shown in (b)). First, we introduce a random complementary masking module to generate a pair of complementary masked views by randomly occluding some local visual features, thereby encouraging the student model to utilize discriminative visual cues in the context. Second, we design an internal contextual consistency inference module to model the contextual consistency of the student model's predictions between a pair of complementary masked views, thereby supervising the student model's learning of complementary context-related knowledge in the target domain. Furthermore, we design an external contextual consistency inference module to establish contextual consistency between the pseudo-labels generated by the teacher model and the student's predictions, allowing the student model to learn the semantic and spatial information of the context.

[0006] This invention proposes using a teacher-student model framework commonly used in semi-supervised learning for cross-domain adaptation tasks. The teacher model is slowly updated using an exponential moving average of the student models. The update coefficient α determines the rate at which the teacher model updates knowledge about the student models. The teacher model serves as a robust set of the student models, capturing the main knowledge learned by the student models. Therefore, the predictions output by the teacher model can be used as pseudo-labels for the student models, achieving a self-supervised effect. During the training phase, training is performed simultaneously on source and target domain data. Half of the source domain data (I...) in a batch... s ,y s ), half of the target domain data (I t ,y t In this model, source domain data is trained using built-in labels, while target domain data is trained using pseudo-labels obtained from the output of the teacher model after confidence filtering. Unsupervised training is performed in this way. This invention proposes a stochastic context-consistent inference network suitable for object detection pre-adaptation techniques, consisting of a stochastic complementary mask module, an internal context-consistent inference module, and an external context-consistent inference module, such as... Figure 2 As shown.

[0007] Specifically, the random complementary masking module generates a pair of complementary masked views {V1, V2} by randomly masking some local visual features in the target image. Then, the internal context-consistent inference module is designed to perform consistent inference between the two views predicted by the student model, thereby learning context-sensitive knowledge specific to the domain. Simultaneously, in the external context-consistent inference module, the teacher model generates pseudo-labels from the original view V0 (the target domain image) with complete contextual information and supervises the student model to infer from the complementary masked views {V1, V2} with incomplete contextual information. Therefore, the student model can learn contextual inference capabilities within the target domain.

[0008] A target detection domain adaptation method based on stochastic context consistency reasoning, the specific steps of which are as follows:

[0009] Step 1: Use ResNet50 pre-trained on ImageNet as the backbone network for both the student and teacher models to extract image features. The detector is Faster-RCNN. At the start of training, the student model is copied to the teacher model.

[0010] Step 2: Combine the labeled source domain data (I) from the training set. s ,y s Input the student model and output the detection result y' s With tag y s Calculate the supervised loss L sup Supervised training is performed; simultaneously, unlabeled target domain data (I) is used. t Inputting (none) into the teacher model and judging the output results: if the predicted result contains a target with a confidence level greater than δ, it is selected as a pseudo-label. Proceed to step 3; otherwise, continue to step 2.

[0011] Step 3: Perform random context-consistent inference: The random complementary masking module first generates a mask matrix M sampled from a uniform distribution, and then subtracts M from an all-one matrix to obtain the complementary mask matrix. By comparing with the input target image I t Calculate the Damask product to obtain a pair of complementary mask images, i.e., generate a pair of complementary mask views {V1,V2}.

[0012] Step 4: Guide the student model to infer context-related information from complementary and asymmetric complementary masked views {V1, V2} via the internal context consistency inference module, including classification and regression consistency inference. Specifically, first, input the complementary masked views {V1, V2} into the student model trained in Step 2 to generate corresponding predictions. Subsequently, calculate the internal context consistency inference loss on the predictions of the complementary masked views. Specifically, it is divided into: Classification Consistency Reasoning Loss Consistent inference loss during regression To avoid inconsistent inference due to mismatches, we set a relatively large IoU matching threshold τ = 0.75.

[0013] Step 5: The external context-consistent reasoning module utilizes pseudo-labels generated by the teacher model. The external context consistency inference loss is calculated by comparing the student model's predictions for complementary masked views {V1,V2}. Specifically, we use the pseudo-labels generated by the teacher model to calculate the classification consistency inference loss. Consistent inference loss during regression

[0014] Step 6: Iteratively train and update the student and teacher models by combining supervised loss, internal context-consistent reasoning loss, and external context-consistent reasoning loss to improve the cross-domain adaptability of the teacher and student models.

[0015] Steps 2 through 5 complete one iteration of training. Repeat the iterative training until the set number of iterations is reached. In each iteration, L is calculated... sup , as well as Gradient backpropagation is used to update the student model, followed by exponential moving average to update the teacher model. Supervised loss L... sup This enhances the benchmark capability of student models in the source domain; A self-supervised paradigm was constructed using a student model, which effectively reduced the model's dependence on pseudo-labels; By using pseudo-labels from the teacher model to encourage the student model to predict masked regions, the student model's ability to capture specific details in the target domain is enhanced, along with its feature representation capabilities, thereby improving the expression of domain-specific features. These loss functions work together to fully represent domain-specific features in the target domain while enhancing the extraction of domain-invariant features, thus improving the cross-domain adaptability of both teacher and student models.

[0016] The beneficial effects of this invention are as follows:

[0017] This invention innovatively proposes a teacher-student model network with stochastic context-consistent reasoning to address the adaptation problem in the target detection domain. This method employs a semi-supervised learning framework for the teacher-student model, using an exponential moving average of the teacher model for slow updates. This allows the teacher model to acquire information from the primary knowledge learned by the student model, thus achieving self-supervision. By introducing a stochastic complementary masking module, some heavily relied-upon local visual features are masked, encouraging the network to utilize other visual cues within the context. Furthermore, the internal context-consistent reasoning module effectively avoids the heavy reliance on pseudo-labels found in most self-training frameworks, improving the student model's contextual reasoning ability by constructing a self-supervised training paradigm. Finally, the external context-consistent reasoning module effectively constructs a self-training framework based on the teacher-student model, using pseudo-labels with global prior knowledge from the teacher model to encourage the student model to make correct predictions for masked regions. Through these three modules, the network possesses excellent cross-domain adaptability. Attached Figure Description

[0018] Figure 1 This is a schematic diagram of a random context-consistent reasoning strategy;

[0019] Figure 2 This is an overall framework diagram of an embodiment of the present invention;

[0020] Figure 3 It is a comparative experiment of the performance convergence curves of different methods;

[0021] Figure 4 This is a visualization of the detection results in an embodiment of the present invention. Detailed Implementation

[0022] The technical solution of the present invention will be further described below with reference to the accompanying drawings and embodiments.

[0023] First, let me explain the specific details of the implementation of this embodiment:

[0024] In this embodiment of the invention, we employ an unsupervised domain adaptation criterion. The training data is divided into two parts: source domain training data, which provides images and their labels (bounding boxes and instance classes), and target domain training data, which contains only unlabeled images. The adjusted model is tested on a test set with the same data distribution as the target domain training data. In all experiments, we use mean average precision (mAP) as the primary evaluation metric, with a threshold of 0.5.

[0025] The teacher-student model of this invention is isomorphic. It uses ResNet-50 as the backbone network and employs FPN to divide features into different scales. All training and testing images are resized so that the shorter side is 800 pixels long to fit the GPU memory. The teacher-student model is initialized using weights pre-trained on ImageNet. Each batch contains one source domain image and one target domain image. The model is trained for 60,000 iterations with an initial learning rate of 0.0025 and weight decay of 0.0001. Exponential moving average (EMA) weights α = 0.9 are used for color enhancement (brightness, contrast, saturation, hue, and blur). The output confidence threshold for the pseudo-label boxes is set to δ = 0.8, and the experiments are conducted on an RTX 4080Ti.

[0026] Next, let's introduce the required dataset:

[0027] This invention evaluates domain differences by studying weather conditions. Weather is a significant source of domain differences because scenes visually differ as weather conditions change. The reliable operation of a detection system under varying weather conditions is crucial for the safety of autonomous driving systems. The experiment uses Cityscapes as the source domain, where images were primarily captured on sunny days. In this experiment, the true bounding boxes are obtained by finding the tightest rectangle around the corresponding instance mask.

[0028] For the target domain, we used the Foggy Cityscapes dataset. Foggy Cityscapes is a synthetic fog dataset that simulates fog in real-world scenes. The foggy images were created using the original clear-sky images from Cityscapes and depth maps. The semantic annotations and data splitting of Foggy Cityscapes are inherited from Cityscapes, making it ideal for studying domain differences caused by visibility variations. Foggy Cityscapes includes multiple versions, each with a fixed fog density level; however, in this experiment, we chose the version with the most challenging fog density level corresponding to a visibility distance of 150 meters. Therefore, we ultimately used the Cityscapes training set as the (labeled) source domain training set and the Foggy Cityscapes training set as the (unlabeled) target domain training set.

[0029] The following are the specific implementation steps:

[0030] Step 1: Perform supervised training: Use labeled source domain images I s Input the student model, and output the detection results y' from the student model. s With tag y s The supervised loss is calculated as follows:

[0031] L sup =L cla (C' S C s )+L reg (B' S B s )

[0032] Where L cla and L reg Let y' represent the classification loss and regression loss of Faster-CRNN, respectively, and the detection result y' s Includes the predicted bounding box location B' s And target box type C' s B s C s It is the label y s The bounding box position and category.

[0033] Simultaneously, the unlabeled target domain image I t Input the teacher model, and select detection boxes with a classification confidence score δ higher than δ>0.8 to serve as pseudo-labels based on the classification confidence score δ output by the teacher model.

[0034]

[0035] Step 2: The random complementary masking module first creates an all-zero matrix, then samples regions greater than r from a uniform distribution and sets them to 1, thus obtaining a mask matrix M:

[0036]

[0037] Where u is sampled from a uniform distribution U(0,1), b is the size of the mask block, and r is the mask ratio in (0,1). Here is the table below the mask block, where H and W are the height and width of the input image.

[0038] Then, subtract M from the all-one matrix to obtain the complementary mask matrix.

[0039]

[0040] Where 1 represents a one matrix with the same dimensions as M, and the Karl datum product between the mask matrix and the target domain image is used to obtain a pair of complementary mask views {V1, V2}:

[0041] V1=M⊙I t

[0042]

[0043] Step 3: After obtaining a pair of complementary masked views {V1, V2}, the student model is guided by the internal context consistency inference module to infer context-related information from the complementary and asymmetric target views, including classification and regression consistency inference. To avoid mismatched consistency inference, we set the IoU matching threshold τ = 0.75. Specifically, the complementary masked views {V1, V2} are input into the student model to generate corresponding predictions. The student model then makes predictions based on the obtained complementary masked views {V1, V2}, resulting in a set of predicted bounding boxes. calculate and The IoU matrix of the two bounding boxes is calculated, and the maximum value on the longest side is selected as their matching score. If this score exceeds a preset value τ, the two bounding boxes are considered to have matched successfully.

[0044] To reduce the class probability vector p of the complementary mask view M and The category distributions diverge between the categories, therefore the classification consistency inference loss is calculated:

[0045]

[0046] Where K represents and The number of bounding boxes matched between them. yes The class probability vector of the i-th bounding box, and w represents the corresponding category prediction. i This represents the confidence level of the prediction within the range (0,1). For the regression consistency loss, we use the Huber loss to calculate the deviation loss of the matched predicted bounding boxes in {V1,V2}:

[0047]

[0048] in, It is a set of bounding boxes A single bounding box in the text.

[0049] Huber lost H σ The definition of is:

[0050]

[0051] Here, x represents the difference in bounding box coordinates, and σ represents the inflection point. Huber loss reduces the model's sensitivity to outliers during initial training and adaptively increases the penalty for student models.

[0052] The total loss of the internal context-consistent reasoning module is:

[0053]

[0054] Step 4: The external context-consistent reasoning module utilizes pseudo-labels generated by the teacher model. The external context consistency inference loss is calculated by comparing the student model's predictions for complementary masked views {V1,V2}. First, the student model is optimized using classification consistency inference loss to infer contextual semantic information in the occluded view:

[0055]

[0056] Where N and M represent the number of matches between the bounding box sets in the complementary masked views {V1,V2} inferred by the student model and the bounding box sets in the pseudo-labels. express The class probability vector of the i-th bounding box. Let represent the corresponding target category in the pseudo-label, and λ and μ be the weights balancing the number of targets in the two views. The regression consistency loss is:

[0057]

[0058] in These are the sets of bounding boxes predicted by the student model for complementary masked views {V1, V2}. It is the i-th bounding box.

[0059] The total loss of the external context-consistent inference module is:

[0060]

[0061] Step 5: In this step, we first use the calculated supervised loss L sup Internal context consistency reasoning loss and external context consistent reasoning loss The gradient backpropagation operation is performed to update the parameters of the student model. This process is a crucial part of deep learning training; through gradient backpropagation, the model is continuously optimized in each iteration, gradually improving its detection performance.

[0062] Next, we introduce an exponential moving average to update the teacher model.

[0063] Instead of gradient backpropagation for parameter updates, the teacher model uses a smooth approach. By applying an exponential moving average to the student model's parameters, the teacher model gradually accumulates knowledge from multiple iterations. This knowledge accumulation makes the teacher model a robust set of the student models, incorporating the key knowledge learned by the student models, further improving the stability and robustness of the teacher model's cross-domain adaptation. The formula for each iteration update is as follows:

[0064]

[0065] in The parameters representing the teacher model, The parameters represent the student model. α is the weighted weight value, which represents the update rate of the model. This invention uses a default value of 0.9996.

[0066] After a series of operations from steps 1 to 5, one iteration is completed. As verified by the embodiments, the present invention uses 60,000 iterations.

[0067] Through training with internal and external context-consistent reasoning modules, the student model can learn a powerful feature representation capability, which is reflected not only in the extraction of domain-invariant features between different domains, but also in the representation of domain-specific features of the target domain, thereby acquiring a powerful cross-domain adaptability.

[0068]

[0069]

[0070] Table 1. Cross-domain adaptation experiment of Cityscapes → Foggy Cityscapes (visible at 150 meters).

[0071] Table 1 shows the cross-domain quantitative experiments conducted on the Cityscapes and Foggy Cityscapes datasets of the embodiments of the present invention, where Cityscapes is the source domain and Foggy Cityscapes is the target domain. This embodiment uses mean average precision (mAP) as the primary evaluation metric, with a threshold of 0.5. It can be observed that the performance of the present invention outperforms other state-of-the-art methods, thus demonstrating the effectiveness of stochastic context-consistent inference networks.

[0072] Figure 3 The comparative experiment of performance convergence curves between different methods shows that the embodiments of the present invention can converge rapidly and continuously improve performance. Figure 4 The visualization of the detection results of the embodiment shows that the present invention can accurately identify easily confused categories, and the positioning is accurate with good recognition effect.

[0073] Object detection is an indispensable core component of autonomous driving technology. In autonomous driving systems, driverless cars must acquire real-time information about the road and traffic environment through visual sensors (such as cameras and LiDAR) in order to make correct driving decisions. The main task of object detection technology is to identify and track various traffic elements during driving, such as traffic signs, other vehicles, pedestrians, and bicycles, to assist autonomous vehicles in making accurate driving decisions.

[0074] However, in real-world road environments, many factors (such as weather and road conditions) can affect image quality and feature distribution, potentially leading to discrepancies between the captured images and the dataset used during model training. This discrepancy causes object detection models to perform worse in real-world scenarios than on standard datasets; this is known as the domain adaptation problem.

[0075] Our proposed method aims to enhance the robustness and generalization ability of autonomous driving systems. This method utilizes unlabeled target domain data for domain adaptation and improves the robustness of cross-domain detection through deep learning model training, enabling the model to be effectively applied to real-world scenarios with limited training data.

[0076] The above description, in conjunction with specific / preferred embodiments, provides a further detailed explanation of the present invention. It should not be construed that the specific implementation of the present invention is limited to these descriptions. Those skilled in the art can make various substitutions or modifications to these described embodiments without departing from the inventive concept, and all such substitutions or modifications should be considered within the scope of protection of the present invention.

[0077] The parts of this invention not described in detail are well-known to those skilled in the art.

Claims

1. A target detection domain adaptation method based on stochastic contextual consistency reasoning, characterized in that, The specific steps are as follows: Step 1: Use ResNet50 pre-trained on ImageNet as the backbone network of the student model and the teacher model to extract image features. The detector is Faster-RCNN. At the beginning of training, the student model is copied to the teacher model. Step 2: Combine the labeled source domain data (I) from the training set. s ,y s Input the student model and output the detection result y' s With tag y s Calculate the supervised loss L sup Supervised training is performed; simultaneously, unlabeled target domain data (I) is used. t Inputting (none) into the teacher model and judging the output results: if the predicted result contains a target with a confidence level greater than δ, it is selected as a pseudo-label. Proceed to step 3; otherwise, continue to step 2. Step 3: Perform random context-consistent inference: The random complementary masking module first generates a mask matrix M sampled from a uniform distribution, and then subtracts M from an all-one matrix to obtain the complementary mask matrix. By comparing with the input target image I t Calculate the Damask product to obtain a pair of complementary mask images, i.e. generate a pair of complementary mask views {V1,V2}. Step 4: Guide the student model to infer context-related information from complementary and asymmetric complementary masked views {V1,V2} through the internal context consistency inference module, including classification and regression consistency inference; specifically, first, input the complementary masked views {V1,V2} into the student model trained in Step 2 to generate corresponding predictions; then, calculate the internal context consistency inference loss on the predictions of the complementary masked views. Specifically, it is divided into: Classification Consistency Reasoning Loss Consistent inference loss during regression Step 5: The external context-consistent reasoning module utilizes pseudo-labels generated by the teacher model. The external context consistency inference loss is calculated by comparing the student model's predictions for complementary masked views {V1,V2}. Specifically, the classification consistency inference loss is calculated using pseudo-labels generated by the teacher model. Consistent inference loss during regression Step 6: Iteratively train and update the student model and teacher model by combining supervised loss, internal context consistency reasoning loss and external context consistency reasoning loss to improve the cross-domain adaptability of the teacher and student models; Steps 2 through 5 complete one iteration of training. Repeat the iterative training until the set number of iterations is reached. In each iteration, I is calculated. sup , as well as Gradient backpropagation is used to update the student model, followed by exponential moving average to update the teacher model; supervised loss L... sup This enhances the benchmark capability of student models in the source domain; A self-supervised paradigm was constructed using a student model, which effectively reduced the model's dependence on pseudo-labels; By using pseudo-labels from the teacher model to encourage the student model to predict masked regions, the student model's ability to capture specific details in the target domain is enhanced, as is its feature representation ability, thereby improving the expression of domain-specific features. These loss functions work together to fully represent domain-specific features in the target domain while enhancing the extraction of domain-invariant features, thus improving the cross-domain adaptability of both teacher and student models.

2. The target detection domain adaptation method based on stochastic contextual consistency reasoning according to claim 1, characterized in that, In step 4, the IoU matching threshold τ = 0.75 is set.

3. The target detection domain adaptation method based on stochastic contextual consistency reasoning according to claim 1, characterized in that, The specific method for step 2 is as follows: Supervised training: Using labeled source domain images I s Input the student model, and output the detection results y' from the student model. s With tag y s The supervised loss is calculated as follows: L sup =L cla (C' S ,C s )+L reg (B' S ,B s ) Where L cla and L reg Let y' represent the classification loss and regression loss of Faster-CRNN, respectively, and the detection result y' s Includes the predicted bounding box location B' s And target box type C' s B s C s It is the label y s The bounding box position and category in the text; Simultaneously, the unlabeled target domain image I t Input the teacher model, and select detection boxes with a classification confidence score δ higher than δ>0.8 to serve as pseudo-labels based on the classification confidence score δ output by the teacher model.

4. A target detection domain adaptation method based on stochastic context consistency reasoning according to any one of claims 1-3, characterized in that, The specific method for step 3 is as follows: The random complementary masking module first creates an all-zero matrix, then samples regions greater than r from a uniform distribution and sets them to 1, thereby obtaining a mask matrix M: Where u is sampled from a uniform distribution U(0,1), b is the size of the mask block, and r is the mask ratio in (0,1). This is the lower table of the mask blocks, where H and W are the height and width of the input image; Then, subtract M from the all-one matrix to obtain the complementary mask matrix. Where 1 represents a one matrix with the same dimensions as M, and the Karl datum product between the mask matrix and the target domain image is used to obtain a pair of complementary mask views {V1, V2}: V1=M⊙I t 5. The target detection domain adaptation method based on stochastic contextual consistency reasoning according to claim 4, characterized in that, The specific method for step 4 is as follows: After obtaining a pair of complementary masked views {V1, V2}, the student model is guided by an internal context-consistent inference module to infer context-related information from the complementary and asymmetric target views, including classification and regression consistency inference. To avoid mismatched consistency inference, an IoU matching threshold τ = 0.75 is set. Specifically, the complementary masked views {V1, V2} are input into the student model to generate corresponding predictions. The student model then makes predictions based on the obtained complementary masked views {V1, V2}, resulting in a set of predicted bounding boxes. calculate and The IoU matrix of the bounding boxes is calculated, and the maximum value on the longest side is selected as their matching score; if the score exceeds a preset value τ, the two bounding boxes are considered to be successfully matched. To reduce the class probability vector p of the complementary mask view M and The category distributions diverge between the categories, therefore the classification consistency inference loss is calculated: Where K represents and The number of bounding boxes matched between them. yes The class probability vector of the i-th bounding box, and w represents the corresponding category prediction. i This is the confidence level of the prediction between (0,1); for the regression consistency loss, the deviation loss of the matched predicted bounding boxes in {V1,V2} is calculated using the Huber loss: in, It is a set of bounding boxes A single bounding box in; Huber lost H σ The definition of is: Where x represents the difference in bounding box coordinates and σ represents the inflection point; The total loss of the internal context-consistent reasoning module is:

6. The target detection domain adaptation method based on stochastic contextual consistency reasoning according to claim 5, characterized in that, Step 5 is explained in detail below: The external context-consistent reasoning module utilizes pseudo-labels generated by the teacher model. The external context consistency inference loss is calculated by comparing the student model's predictions for complementary masked views {V1,V2}. First, the student model is optimized using classification consistency inference loss to infer contextual semantic information in the occluded view: Where N and M represent the number of matches between the bounding box sets in the complementary masked views {V1,V2} inferred by the student model and the bounding box sets in the pseudo-labels. express The class probability vector of the i-th bounding box. Let represent the corresponding target category in the pseudo-label, and λ and μ be the weights balancing the number of targets in the two views. The regression consistency loss is: in These are the sets of bounding boxes predicted by the student model for complementary masked views {V1, V2}. It is the i-th bounding box; The total loss of the external context-consistent inference module is:

7. The target detection domain adaptation method based on stochastic contextual consistency reasoning according to claim 6, characterized in that, The specific method for introducing exponential moving average to update the teacher model is as follows: The teacher model uses a smooth parameter update method. By applying an exponential moving average of the student model's parameters, the teacher model gradually accumulates knowledge from multiple iterations. The formula for each iteration update is as follows: in The parameters representing the teacher model, The parameters represent the student model, where α is the weighted weight value.

Citation Information

Patent Citations

  • Feature and instance joint transfer learning method in semi-supervised scene

    CN110533193A

  • Target detection domain adaptation method based on background and foreground cutting and interchanging

    CN118196371A