Target Instance Detection Method Based on Target Scene Discriminative Consistency
By screening source domain samples through target scene discrimination consistency assessment, generating stable pseudo-labels and updating the teacher model, the problems of negative transfer and pseudo-label quality in cross-domain target detection are solved, and the detection accuracy and stability are improved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- NORTHEASTERN UNIV CHINA
- Filing Date
- 2026-04-08
- Publication Date
- 2026-06-30
Smart Images

Figure CN121982673B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of cross-scene target detection, specifically a target instance detection method based on the consistency of target scene discrimination. Background Technology
[0002] In cross-scene deployments, object detection models often experience performance degradation due to differences between the source and target domains in imaging conditions, background textures, and target appearances. This type of problem is typically categorized under the research scope of cross-domain / cross-scene object detection (DAOD). Existing DAOD methods mainly include feature alignment, adversarial learning, reconstruction methods, and distillation / self-training techniques.
[0003] Among them, teacher-student self-training (pseudo-labels) is a commonly used technical solution in recent years. This type of method usually generates pseudo-labels in the target domain by the teacher model to supervise the training of the student model, and combines weak / strong data augmentation, alignment loss and EMA update mechanism to alleviate pseudo-label noise caused by domain offset. For example, Cross-Domain Adaptive Teacher (Adaptive Teacher) organizes the cross-domain detection training process with the teacher-student structure as the core.
[0004] To address the issue of pseudo-label quality, some methods have further introduced more granular quality modeling and learning signals. For example, Harmonious Teacher points out that relying solely on classification confidence is insufficient to characterize the reliability of pseudo-labels, and it is necessary to incorporate the coordination between classification and localization information into pseudo-label quality modeling. Contrastive Mean Teacher combines mean-teacher self-training with contrastive learning to alleviate training instability caused by noisy pseudo-labels.
[0005] At the engineering implementation level, most of the relevant patent solutions adopt a combination of "teacher-student structure + EMA update + pseudo-label filtering or evaluation". For example, CN116091886A measures and filters pseudo-labels through a strong and weak dual-branch structure, and CN118038163A calculates the loss separately for the source domain and target domain detection heads and introduces a multi-scale mask adversarial alignment module. In addition, in the field of source-free target detection, there are also solutions that correct teacher predictions and improve pseudo-label quality by constructing target domain category prototypes, such as CN117636086A.
[0006] While the aforementioned technologies have improved cross-domain target detection performance to some extent, they still have significant shortcomings. First, existing DAOD processes generally lack explicit and quantifiable evaluation and screening mechanisms for whether source domain samples or instances generate positive migration to the target domain, which can easily lead to negative migration risks when the source and target domains differ significantly.
[0007] Secondly, in the pseudo-label self-training route, the quality evaluation of pseudo-labels still relies heavily on a single indicator or empirical threshold, which is prone to mismatch between classification and localization information and leads to error accumulation. Although auxiliary filtering can be performed through structures such as strong and weak branches (e.g., CN116091886A), it also brings engineering problems such as structural complexity and increased threshold sensitivity.
[0008] Furthermore, in the joint optimization process where the source domain is fully labeled but the target domain is unlabeled, the model is prone to over-reliance on supervised signals in the source domain, which weakens the optimization effect in the target domain. This leads to a decrease in the quality of pseudo-labels generated by teachers and a decrease in detection accuracy. This problem has been clearly pointed out in the background of CN118038163A.
[0009] Meanwhile, many DAOD methods still rely on target domain validation or test sets for model selection during model training and evaluation. In real-world deployment scenarios where the target domain is unlabeled, there is a lack of feasible unsupervised model selection and training termination mechanisms.
[0010] In addition, existing self-training paradigms often focus on learning driven by foreground pseudo-labels, ignoring the discriminative information that may be contained in the background or difficult regions, and noisy pseudo-labels can easily lead to error accumulation. Summary of the Invention
[0011] To address the shortcomings of existing technologies, the present invention aims to propose a target instance detection method based on the consistency of target scene discrimination, comprising:
[0012] In autonomous driving scenarios, multiple target road scene images are collected by vehicle-mounted cameras to form a target domain image set.
[0013] The detection bounding boxes are labeled for target instances of preset categories within the target road scene image. The target domain labeling dataset is composed of all target road scene images, corresponding detection bounding boxes and category information.
[0014] Based on the target domain labeled dataset, the target detection network is trained to obtain initial parameters. Two target detection networks with the same structure are then initialized with these initial parameters and used as initial student models. and the initial teacher model ;
[0015] Statistical analysis is performed on the target road scene images in the target domain image set to obtain target scene statistical information and target feature statistical information.
[0016] Acquire multiple source domain road scene images and form a source domain image set;
[0017] based on , Based on the target scene statistics and target feature statistics, calculate the total inconsistency score for each source domain road scene image in the source domain image set. ,according to Source domain road scene images in the source domain image set are filtered to construct a source domain pseudo-label dataset, thereby determining the final teacher model and the final student model;
[0018] The image to be detected is acquired and input into the final teacher model or the final student model to obtain the detection box and category information of the target instance in the image to be detected.
[0019] Optionally, statistical analysis is performed on the target road scene images in the target domain image set to obtain target scene statistical information and target feature statistical information, including:
[0020] Pixel-level processing is performed on each target road scene image in the target domain image set, and the pixel-level processed data corresponding to the target domain image set is statistically analyzed to obtain target scene statistical information; the target scene statistical information includes at least color statistical range, illumination statistical range, blur intensity distribution and noise intensity distribution.
[0021] Feature-level processing is performed on each target road scene image in the target domain image set, and the data after feature-level processing corresponding to the target domain image set are statistically analyzed to obtain target feature statistics.
[0022] Optionally, pixel-level processing is performed on each target road scene image in the target domain image set, and the pixel-level processed data corresponding to the target domain image set is statistically analyzed to obtain target scene statistical information, including:
[0023] target road scene images from the target domain image set Convert to RGB color space to obtain an RGB color space image; normalize each pixel value in the RGB color space image to obtain a normalized image. ;calculate The mean values of the R, G, and B channels in the spatial dimension with standard deviation ;
[0024] Based on all target road scene images in the target domain image set Calculate the quantile statistics to obtain the quantile statistical range of the RGB mean; based on all target road scene images in the target domain image set... Calculate the quantile statistics to obtain the quantile statistical range of the RGB variance; the quantile statistical range of the RGB mean and the quantile statistical range of the RGB variance constitute the color statistical range;
[0025] The target road scene image is converted from the RGB color space to the HSV color space to obtain an HSV color space image. The V channel is then extracted as the luminance component from the HSV color space image, and the luminance component is normalized to obtain the normalized luminance component. ,calculate Mean in spatial dimension and standard deviation ;
[0026] Based on all target road scene images in the target domain image set Calculate quantile statistics to obtain the quantile statistical range of the mean brightness; based on all target road scene images in the target domain image set... Quantile statistics are calculated to obtain the quantile statistical range of the luminance variance; the quantile statistical range of the luminance mean and the quantile statistical range of the luminance variance constitute the illumination statistical range;
[0027] Convert the target road scene image to grayscale. ,right Applying the Laplacian operator yields the response graph. ,calculate The variance and its use as an ambiguity index ;
[0028] Based on all target road scene images in the target domain image set Quantile statistics are calculated to obtain the fuzzy intensity distribution;
[0029] Applying small-scale Gaussian blur to grayscale images The high-frequency residuals are obtained through processing. ;
[0030] Calculate based on Sobel operator respectively The gradient components in the horizontal and vertical directions are used to calculate the gradient magnitude. Pixel regions with gradient magnitudes less than a preset gradient threshold are considered flat regions. ;
[0031] In flat areas Inside, calculation The standard deviation and its use as a proxy for noise intensity ;
[0032] Based on all target road scene images in the target domain image set The noise intensity distribution is obtained by calculating quantile statistics.
[0033] Optionally, feature-level processing is performed on each target road scene image in the target domain image set, and the feature-level processed data corresponding to the target domain image set is statistically analyzed to obtain target feature statistics, including:
[0034] Input the target domain image set The first intermediate semantic features of each target road scene image are obtained through the feature extraction backbone network and feature fusion module. Based on the first intermediate semantic features of all target road scene images, the average value of the first intermediate semantic features is calculated. with standard deviation , and Statistical information on the characteristics of the target.
[0035] Optional, based on , Based on the target scene statistics and target feature statistics, calculate the total inconsistency score for each source domain road scene image in the source domain image set. Construct a source domain pseudo-label dataset to determine the final teacher model and the final student model, including:
[0036] Set the initial iteration count m=0, and use the initial iteration count as the current iteration count. As the teacher model at the current iteration number ,Will As the student model at the current iteration number ;
[0037] Based on the statistical information of the target scenario and the statistical information of the target features, the teacher model at the current iteration number is adopted. Constructing baseline prediction results for source domain road scene images and a set of target disturbance prediction results; the set of target disturbance prediction results includes multiple disturbance prediction results. ;
[0038] based on and Calculate the total inconsistency score for each source domain road scene image. ;
[0039] Based on the total inconsistency score of the source domain road scene image ,according to Source domain road scene images are filtered from the source domain image set to construct a source domain pseudo-label dataset. Source domain pseudo-label batches are then sampled from the source domain pseudo-label dataset. Batch of target domain samples were obtained by sampling from the target domain labeled dataset. ;
[0040] based on and The parameters of the student model and the teacher model are updated. The updated student model... and the updated teacher model ;
[0041] Calculate the updated student model Validation set of the target domain labeled dataset Target domain performance index value ;
[0042] Set the allowable performance fluctuation threshold ,judge Compared with the target domain performance index value under the previous iteration number m-1 Whether the positive migration criteria are met, in When the representation satisfies the positive migration criterion, in When the representation does not meet the positive migration criteria;
[0043] Set the termination condition; determine if the current iteration meets the termination condition:
[0044] A. If the termination condition is met, then... As the final student model, As the ultimate teacher model;
[0045] B. If the termination condition is not met but the forward transition condition is met, increment the current iteration count by 1. As the student model for the new iteration number, As the teacher model for the new iteration, the execution is returned: based on... and Calculate the total inconsistency score for each source domain road scene image. ;
[0046] C. If neither the termination condition nor the forward transition condition is met, increment the current iteration count by 1. As the student model for the new iteration number, As the teacher model for the new iteration, the execution is returned: based on... and Calculate the total inconsistency score for each source domain road scene image. ;
[0047] The termination condition is set as follows: the current iteration count reaches the preset maximum number of rounds, or the consecutive preset number of rounds does not meet the forward migration judgment condition.
[0048] Optionally, based on the target scenario statistics and target feature statistics, the teacher model at the current iteration number can be adopted. Constructing baseline prediction results for source domain road scene images The set of target perturbation prediction results includes:
[0049] Source domain road scene image Input the teacher model at the current iteration number The baseline prediction results were obtained. , is represented as: ,in, The number of instances in the baseline prediction results; For the first The detection bounding box for each instance; For the first The probability distribution of the class prediction for each instance; For the first Confidence scores for each instance;
[0050] By analyzing the color statistical range and the illumination statistical range Perturbation is performed to obtain a color lighting perturbation view. Specifically, this is achieved through the following formula:
[0051] ;
[0052] in, Perturbation operators representing color and brightness; This represents the set of target domain pixel statistical parameters sampled from the color statistical range and the illumination statistical range;
[0053] Through fuzzy intensity distribution Perturbation is performed to obtain a blurred perturbation view. Specifically, this is achieved through the following formula:
[0054] ;
[0055] in, A perturbation operator representing the fuzzy intensity distribution; The fuzzy intensity parameters are obtained by sampling from the fuzzy intensity distribution;
[0056] Through noise intensity distribution Perform a perturbation to obtain a noise perturbation view. Specifically, this is achieved through the following formula:
[0057] ;
[0058] in, Perturbation operators representing the noise intensity distribution These are noise intensity parameters obtained by sampling from the noise intensity distribution;
[0059] Will , and Input the teacher model for the current iteration number. The color illumination perturbation prediction results were obtained. Fuzzy perturbation prediction results and noise disturbance prediction results ;
[0060] Input the source domain image set into the teacher model at the current iteration number. The second intermediate semantic features of each source domain road scene image are obtained through the feature extraction backbone network and the feature fusion module.
[0061] Calculate the average value of the second intermediate semantic features based on the second intermediate semantic features of all source domain road scene images. with standard deviation , and Statistical results of the distribution of source domain characteristics;
[0062] right and and and Perform channel-level recalibration to obtain the recalibrated features. Specifically, this is achieved through the following formula:
[0063] ;
[0064] in, This represents the second intermediate semantic feature. To prevent the stable term from being divided by zero;
[0065] Recalibrated features Input the teacher model at the current iteration number The detection head obtains the feature-level perturbation prediction results. ;
[0066] In the baseline prediction results Obtain the collection of detection boxes ,against Within each detection box, a sub-region is randomly erased from the internal image region to obtain the occlusion perturbation image. ,Will Input the teacher model at the current iteration number The occlusion disturbance prediction results were obtained. ;
[0067] right An affine transformation is performed on the internal image region of each detection box to obtain a scale-perturbed image. ,Will Input the teacher model at the current iteration number Scale perturbation prediction results were obtained. ;
[0068] , , , , , The target disturbance prediction result set is formed, and any disturbance prediction result in the target disturbance prediction result set is represented as: , ,in, for The number of instances in; For the first The detection bounding box for each instance; For the first The probability distribution of the class prediction for each instance; For the first The confidence score of each instance.
[0069] Optional, based on and Calculate the total inconsistency score for each source domain road scene image. ,include:
[0070] based on and Construct a set of matching pairs First detection box set Second detection box set ;
[0071] Based on a preset confidence threshold and IoU threshold The Non-Maximum Suppression (NMS) algorithm is used to respectively target... With any perturbation prediction result in the target perturbation prediction result set The data is processed to obtain the processed baseline prediction results. and the processed disturbance prediction results , is represented as:
[0072] ;
[0073] ;
[0074] in, The processed baseline prediction results, for The number of instances in; For the first The detection bounding box for each instance; For the first The probability distribution of the class prediction for each instance; For the first Confidence scores for each instance; The processed disturbance prediction results. for The number of instances in; For the first The detection bounding box for each instance; For the first The probability distribution of the class prediction for each instance; For the first Confidence scores for each instance;
[0075] calculate and The intersection and union ratio of IoU;
[0076] exist and Among all the IoU values of the detection boxes, obtain the value greater than the threshold. The detection bounding boxes are used as candidate detection bounding boxes, and the detection bounding box corresponding to the maximum IoU value among the candidate detection bounding boxes is selected as the target detection bounding box. The target detection bounding box and the detection bounding box are then compared. The Middle i The detection boxes of each instance form matching pairs, thus obtaining a set of matching pairs. ,as well as China failed to cooperate with The first set of matching detection boxes ,as well as China failed to cooperate with The set of matching second detection boxes ;
[0077] according to , , Calculate the total inconsistency score for each source domain road scene image. ;
[0078] against For the matching pairs (α, β) in the matching pair, a classification difference metric is calculated based on the class prediction probability distribution of the detection boxes in the matching pair. Specifically, this is achieved through the following formula:
[0079] ;
[0080] in, express The number of matching pairs in the middle, express The Middle The predicted probability distribution of the categories corresponding to each detection box express The Middle The predicted probability distribution of the categories corresponding to each detection box express and The Jensen-Shannon divergence;
[0081] Calculate location difference measurement Specifically, this is achieved through the following formula:
[0082] ;
[0083] in, express The Middle One detection box, express The Middle One detection box, express and The intersection and union ratio;
[0084] Calculate missed detections or new difference measures Specifically, this is achieved through the following formula:
[0085] ;
[0086] in, express The number of detection boxes in the middle, express The number of detection boxes in the middle, express The number of detection boxes in the middle, express The number of detection boxes in the middle, To prevent the stable term from being divided by zero;
[0087] Calculate single-view inconsistency Specifically, this is achieved through the following formula:
[0088] ;
[0089] in, Indicates the loss weight;
[0090] Inconsistency of single view Weighted summation yields the total inconsistency score for each source domain road scene image. Specifically, this is achieved through the following formula:
[0091] ;
[0092] Where K represents the number of perturbation prediction results, Indicates view weight.
[0093] Optionally, based on the total inconsistency score of the source domain road scene images. ,according to Source domain road scene images are filtered from the source domain image set to construct a source domain pseudo-label dataset, including:
[0094] Sort all source domain road scene images by their total inconsistency scores in ascending order, and select the top N source domain road scene images as target images to form a high-value source domain subset. ;
[0095] high-value source domain subsets target image in Input the teacher model at the current iteration number The first prediction result was obtained. , is represented as: ; , express The number of instances in for The first in q The detection bounding box for each instance; For the first q The probability distribution of the class prediction for each instance; For the first q Confidence scores for each instance;
[0096] against For each bounding box in the dataset, the category corresponding to the maximum value in the predicted probability distribution of the category is taken as the pseudo-label of the bounding box.
[0097] for For each detection box in the dataset, a confidence score is assigned, and the confidence score is set below a preset confidence threshold. Instance removal yields the second prediction result;
[0098] Based on a preset confidence threshold and IoU threshold The non-maximum suppression (NMS) algorithm is used to process the detection boxes belonging to the same category in the second prediction result to obtain the third prediction result.
[0099] Within all detection frames of the third prediction result, obtain the result with... The intersection-union ratio of the detection boxes is greater than or equal to a preset threshold. And with Detection boxes matching the category of the bounding boxes are used as the final detection boxes. The final detection box and its corresponding pseudo-label constitute the complete set of detection boxes. The final set of pseudo-tags multiple and This constitutes the source domain pseudo-label dataset.
[0100] Optional, based on and The parameters of the student model and the teacher model are updated. The updated student model... and the updated teacher model ,include:
[0101] At the current iteration number, based on and For the student model parameters at the current iteration number Perform joint optimization to make the objective function Minimize to obtain the optimized student model parameters. This leads to the updated student model. ;
[0102] Wherein, objective function Represented as:
[0103] ;
[0104] in, Indicates the batch size of the target domain samples. For the detection bounding box and category of the target road scene image, The target detection loss function includes classification loss, regression loss, and confidence loss. These are the training weight coefficients for the source domain pseudo-labels. Indicates the batch size of the source domain pseudo-label;
[0105] Using the exponential moving average (EMA) method, based on The following formula is used to... parameters The updated teacher model parameters are obtained by performing an update. This leads to an updated teacher model. ;
[0106] ;
[0107] in, EMA is the momentum coefficient.
[0108] The beneficial effects of adopting the above technical solution are as follows:
[0109] This invention evaluates the discriminative consistency of source scene samples using a target scene model, effectively screening source scene samples with positive transfer value during training and avoiding invalid or harmful samples from participating in model training. By combining a teacher model to generate stable pseudo-labels, it reduces noise interference during training. This effectively suppresses negative transfer in cross-scene training, improves the detection accuracy and training stability of the model in the target scene, and has good engineering application value. Attached Figure Description
[0110] Figure 1 This is one of the flowcharts illustrating the target instance detection method based on target scene discrimination consistency in this embodiment of the invention;
[0111] Figure 2 This is the second flowchart illustrating the target instance detection method based on target scene discrimination consistency in this embodiment of the invention.
[0112] Figure 3 This is a schematic diagram of the source domain filtering process in an embodiment of the present invention. Detailed Implementation
[0113] The specific embodiments of the present invention will be described in further detail below with reference to the accompanying drawings and examples. The following examples are for illustrative purposes only and are not intended to limit the scope of the invention.
[0114] To address the problems of existing technologies, this invention aims to propose a target instance detection method based on the consistency of target scene discrimination. Addressing the situation during cross-scene model training where "the target domain has labels but limited data volume, while the source domain is unlabeled and its sources are mixed," this invention focuses on the target scene discrimination capability and quantifies and filters the transfer value of source scene samples. While ensuring controlled target scene performance, it effectively introduces source scene samples that have a positive transfer effect on the target scene, thereby suppressing negative transfer and improving the model's detection performance and generalization ability in the target scene.
[0115] The target instance detection method based on target scene discrimination consistency provided by this invention is applicable to the training process of cross-scene target detection models. In this invention, the target domain data is labeled but the amount of data is limited, while the source domain data is unlabeled and comes from diverse sources. This invention uses target scene discrimination consistency as a benchmark to quantitatively evaluate and screen the transfer value of source domain samples, thereby introducing source domain samples that have a benefit to the target scene and suppressing negative transfer while ensuring that the performance of the target domain is controlled.
[0116] In the specific implementation process, the target detection model is first trained under supervision using labeled samples from the target domain to obtain an initial student model. Then, the parameters of the student model are copied and used as the initial parameters of the teacher model, enabling the teacher model to possess basic discrimination capabilities for the target scene. In subsequent iterations, the teacher model is updated by the student model using an exponential moving average method to improve prediction stability and is used for consistency evaluation and pseudo-label generation.
[0117] After model initialization is completed, target scene statistics are constructed based on the target domain image: on the one hand, the distribution of color, illumination, blur degree and noise intensity of the target domain in pixel space is used to constrain the sampling range of pixel-level perturbation parameters; on the other hand, forward inference is performed on the target domain image through the initialized model to extract intermediate features before the detection head and calculate its channel mean and standard deviation to form target domain feature statistics, which are used for subsequent feature-level target style perturbation.
[0118] Subsequently, source domain samples to be evaluated are selected from the source domain sample set, and benchmark prediction results are generated using the teacher model as the discrimination subject. For the same source domain sample, this invention further generates multiple "single perturbation views" (each view preferably applies only one perturbation; multiple perturbations can also be superimposed according to preset rules) to ensure that the source of inconsistency is attributable and explainable. The single perturbation views described in the example include: pixel-level perturbation views (color / illumination perturbation, blur perturbation, noise perturbation), feature-level perturbation views (target style feature alignment / reparameterization based on target domain feature statistics), and target-level perturbation views (target occlusion perturbation and target scale perturbation based on the benchmark prediction candidate box).
[0119] The baseline view and each individual perturbation view of the source domain samples are input into the teacher model to obtain multiple sets of prediction results. By comparing the differences between the baseline prediction and each perturbation prediction, the stability score of the source domain samples under the target scene discrimination perspective is calculated. The score can consist of classification difference, localization difference, and missed detection difference, and the total score is obtained by summing the differences of each individual perturbation view. This invention uses the criterion that "the smaller the total score, the more stable the prediction and the closer the sample is to the target scene" to sort and filter the source domain samples, and select the source domain samples with smaller scores to form a high-value source domain subset for subsequent training.
[0120] For the selected high-value source domain sample subset, corresponding pseudo-labels are generated using the teacher model. The "target domain image and its ground truth annotation" and the "source domain image and its pseudo-label" are then used together to jointly train the student model, enabling controlled cross-scene knowledge introduction. After the student model is updated, the teacher model parameters are updated synchronously using an exponential moving average method.
[0121] To avoid negative transfer during the selection and introduction process, this invention evaluates the model performance on labeled data in the target domain or its validation subset after each round of joint training, and makes a positive transfer determination accordingly: if the target domain performance of the updated model is not lower than the performance of the previous round (or the decrease does not exceed a preset threshold), the selection and training results of this round are accepted and the next iteration begins; otherwise, the model is rolled back and the source domain selection threshold or introduction ratio is adjusted before re-executing the selection and training steps. Through the above closed-loop iteration, this invention gradually improves the model's detection performance and generalization ability in the target scene.
[0122] Based on this, combined Figure 1 and Figure 2 The present invention may include the following steps:
[0123] Step 1: In autonomous driving scenarios, multiple target road scene images are acquired using onboard cameras to form a target domain image set. ;
[0124] The target domain is an autonomous driving application scenario. In this invention, the target domain adopts the Foggy Cityscapes dataset. The target road scene image includes at least one or more of the following: road, vehicle, pedestrian, cyclist, traffic sign or traffic light. The image format can be JPG / PNG / BMP, etc.
[0125] Step 2: Complete the bounding box annotation for target instances of preset categories within the target road scene image. The target domain annotation dataset is composed of all target road scene images, corresponding bounding boxes, and category information.
[0126] Examples of the preset categories include, but are not limited to, vehicles, pedestrians, cyclists, and road traffic facilities.
[0127] Step 3: Train the object detection network based on the target domain labeled dataset to obtain initial parameters. Initialize two object detection networks with the same structure using these initial parameters, and use them as the initial student models. and the initial teacher model Teacher model With student model During the initialization phase, the network structure and parameter values are the same, and the teacher model is used to generate prediction results for the source domain samples in the subsequent stage.
[0128] The target detection network includes a feature extraction backbone network, a feature fusion module, and a detection head, which are used to output the target category prediction results and the detection box regression results.
[0129] Step 4: Perform statistical analysis on the target road scene images in the target domain image set to obtain target scene statistical information and target feature statistical information;
[0130] Step 4.1: Perform pixel-level processing on each target road scene image in the target domain image set, and statistically analyze the pixel-level processed data corresponding to the target domain image set to obtain target scene statistics (target_pixel_stats.json); the target scene statistics include at least color statistics range, illumination statistics range, blur intensity distribution, and noise intensity distribution;
[0131] Step 4.1.1: Extract the target road scene image from the target domain image set. Convert to RGB color space to obtain an RGB color space image; normalize each pixel value in the RGB color space image to [0,1] to obtain the normalized image. ;calculate The R, G, and B channels in the spatial dimension mean with standard deviation Specifically, this is achieved through the following formula:
[0132] ;
[0133] ;
[0134] Where, mean(•) represents the mean of the pixel values of each channel over the image spatial dimension H×W, where H represents the height and W represents the width, and std(•) represents the standard deviation of the pixel values of each channel over the same spatial dimension; mean with standard deviation All are vectors of length 3 (corresponding to) Three channels).
[0135] Based on all target road scene images in the target domain image set Calculate quantile statistics (preferred) ), to obtain the quantile statistical range of the RGB mean; based on all target road scene images in the target domain image set. Calculate the quantile statistics (preferably p10 / p50 / p90) to obtain the quantile statistical range of the RGB variance; the quantile statistical range of the RGB mean and the quantile statistical range of the RGB variance constitute the color statistical range.
[0136] Wherein, P10, P50, and P90 represent the 10th, 50th, and 90th percentiles of the statistical indicator in the target domain image set, respectively, reflecting the low, median, and high levels of the indicator in the target scene. Specifically: P10 indicates that approximately 10% of the sample statistical values are below this value, representing a low or mild level of the indicator in the target scene; P50 represents the median of the indicator, representing a typical or common level of the indicator in the target scene; and P90 indicates that approximately 90% of the sample statistical values are below this value, representing a high or severe level of the indicator in the target scene.
[0137] Step 4.1.2: Convert the target road scene image from RGB color space to HSV color space to obtain an HSV color space image. Obtain the V channel as the luminance component from the HSV color space image, and normalize the luminance component to [0,1] to obtain the normalized luminance component. ,calculate Mean in spatial dimension and standard deviation Specifically, it is expressed by the following formula:
[0138] ;
[0139] ;
[0140] Based on all target road scene images in the target domain image set Calculate quantile statistics (preferred) ), to obtain the quantile statistical range of the mean brightness; based on all target road scene images in the target domain image set. Calculate the quantile statistics (preferably p10 / p50 / p90) to obtain the quantile statistical range of the luminance variance; the quantile statistical range of the luminance mean and the quantile statistical range of the luminance variance constitute the illumination statistical range;
[0141] In this invention, the V channel of HSV is used for brightness statistics, but the L channel of LAB can also be used.
[0142] Step 4.1.3: Convert the target road scene image into a grayscale image. ,in, uint8 Grayscale pixels are represented using 8-bit unsigned integers, with pixel values ranging from 0 to 255. Applying the Laplacian operator yields the response graph. ,calculate The variance and its use as an ambiguity index Specifically, this is achieved through the following formula:
[0143] ;
[0144] in, This indicates that on the image space dimension H×W, for The variance of the pixel values is calculated; where A larger value indicates a clearer image, while a smaller value indicates a blurrier image.
[0145] Based on all target road scene images in the target domain image set Calculate quantile statistics (preferably p10 / p50 / p90) to obtain the fuzzy intensity distribution;
[0146] Step 4.1.4: Apply small-scale Gaussian blur to the grayscale image The high-frequency residuals are obtained through processing. Specifically, this is achieved through the following formula:
[0147] ;
[0148] in, The "high-frequency residual" represents the difference between the grayscale image and the small-scale Gaussian blur, which mainly represents the high-frequency components. In flat areas, the high-frequency components are mainly contributed by imaging noise, so they can be used as a surrogate estimate of noise intensity.
[0149] To avoid interference from texture / edges in noise estimation, calculations are performed separately based on the Sobel operator. The gradient components in the horizontal and vertical directions are used to calculate the gradient magnitude. Pixel regions with gradient magnitudes less than a preset gradient threshold are considered flat regions. Specifically, it is expressed by the following formula:
[0150] ;
[0151] in, This represents the pixel coordinate position in the image space dimension of a grayscale image. This represents the gradient vector of the grayscale image at that pixel location. express The gradient magnitude is used to characterize the intensity of the local gray-level change at that location. This is a preset gradient threshold parameter;
[0152] In flat areas Inside, calculation The standard deviation and its use as a proxy for noise intensity Specifically, this is achieved through the following formula:
[0153] ;
[0154] If the number of pixels in the flat region is too small (e.g., less than 10% of the total image pixels), it degenerates into applying the residual to the entire image. Calculate the standard deviation to ensure statistical stability of the noise.
[0155] Based on all target road scene images in the target domain image set Calculate the quantile statistics (preferably p10 / p50 / p90) to obtain the noise intensity distribution;
[0156] In addition to the above statistics, other statistics that can characterize the imaging quality or environmental features of the target scene, such as contrast, saturation, and color cast (color temperature), can also be calculated according to application requirements, and their quantile ranges can be saved.
[0157] Step 4.2: Perform feature-level processing on each target road scene image in the target domain image set, and statistically analyze the feature-level processed data corresponding to the target domain image set to obtain target feature statistics (target_feature_stats.json).
[0158] Among them, the target feature statistics are calculated only once during the initialization phase based on the target domain image set, and are used to characterize the overall style and noise distribution of the target scene as a priori. They remain fixed during subsequent source domain sample selection and model iteration to avoid introducing source domain information that could cause the target scene statistics to shift.
[0159] Input the target domain image set The first intermediate semantic features of each target road scene image are obtained through the feature extraction backbone network and feature fusion module. Based on the first intermediate semantic features of all target road scene images, the average value of the first intermediate semantic features is calculated. with standard deviation , and The target feature statistics are used to describe the typical value level and range of variation of the feature in the target domain. After completing the statistics for all target domain images, the statistical results of the target domain feature distribution are obtained, and the statistical results are saved as the target domain feature prior.
[0160] Step 5: Acquire multiple source domain road scene images and form a source domain image set;
[0161] The acquisition of source road scene images and target road scene images differ in imaging conditions, environmental conditions, or sensor parameters, such as (but not limited to) differences in illumination intensity, contrast, color shift, visibility degradation, imaging noise level, and blur degree. This results in different distributions of similar targets in appearance and background texture. In this invention, the source domain uses the Cityscapes dataset.
[0162] Step 6: Based on , Based on the target scene statistics and target feature statistics, calculate the total inconsistency score for each source domain road scene image in the source domain image set. ,according to Source domain road scene images in the source domain image set are filtered to construct a source domain pseudo-label dataset, and then the final teacher model and the final student model are determined.
[0163] Step 6.1: Set the initial iteration count m=0, and use the initial iteration count as the current iteration count. As the teacher model at the current iteration number ,Will As the student model at the current iteration number ;
[0164] Step 6.2: Based on the target scene statistics and target feature statistics, adopt the teacher model for the current iteration number. Constructing baseline prediction results for source domain road scene images and a set of target disturbance prediction results; the set of target disturbance prediction results includes multiple disturbance prediction results. ;
[0165] Source domain road scene image Input the teacher model at the current iteration number The baseline prediction results were obtained. , is represented as: ,in, The number of instances in the baseline prediction results; For the first The detection bounding box for each instance; For the first The probability distribution of the class prediction for each instance; For the first Confidence scores for each instance;
[0166] For source domain samples At least one perturbation is applied, which can be a single perturbation or multiple perturbations superimposed according to preset rules / random strategies. In a preferred implementation, only one perturbation is applied to each view to facilitate consistent attribution and interpretability.
[0167] Next, combine Figure 3 Pixel-level perturbation is performed, and the color statistical range and illumination statistical range are used to... Perturbation is performed to obtain a color lighting perturbation view. Specifically, this is achieved through the following formula:
[0168] ;
[0169] in, Perturbation operators representing color and brightness; This represents the set of target domain pixel statistical parameters sampled from the color statistical range and the illumination statistical range;
[0170] Through fuzzy intensity distribution Perturbation is performed to obtain a blurred perturbation view. Specifically, this is achieved through the following formula:
[0171] ;
[0172] in, The perturbation operator representing the fuzzy intensity distribution, The fuzzy intensity parameters are obtained by sampling from the fuzzy intensity distribution;
[0173] Through noise intensity distribution Perform a perturbation to obtain a noise perturbation view. Specifically, this is achieved through the following formula:
[0174] ;
[0175] in, Perturbation operators representing the noise intensity distribution These are noise intensity parameters obtained by sampling from the noise intensity distribution;
[0176] Will , and Input the teacher model for the current iteration number. The color illumination perturbation prediction results were obtained. Fuzzy perturbation prediction results and noise disturbance prediction results ;
[0177] Next, feature-level perturbation is performed. Feature-level perturbation does not directly modify image pixels, but recalibrates the features of the source domain samples in the intermediate feature layer of the teacher model so that their statistics are consistent with the feature statistics of the target domain.
[0178] Input the set of source domain images into the teacher model at the current iteration number. The second intermediate semantic features of each source domain road scene image are obtained through the feature extraction backbone network and feature fusion module, specifically through the following formula:
[0179] ;
[0180] in, express The "intermediate feature extraction part before the detection head" in the middle.
[0181] Calculate the average value of the second intermediate semantic features based on the second intermediate semantic features of all source domain road scene images. with standard deviation , and Statistical results of the distribution of source domain characteristics;
[0182] right and and and Perform channel-level recalibration to obtain the recalibrated features. Specifically, this is achieved through the following formula:
[0183] ;
[0184] in, This represents the second intermediate semantic feature. To prevent the stable term from being divided by zero;
[0185] Recalibrated features Input the teacher model at the current iteration number The detection head obtains the feature-level perturbation prediction results. Specifically, it is expressed by the following formula:
[0186] ;
[0187] in, Indicates the detection head;
[0188] It should be noted that the statistics of source domain sample features are calculated in real time for a single sample, while the statistics of target domain features are obtained based on the overall statistics of the target domain image set. The statistical ranges of the two are different.
[0189] To further simulate local occlusion and scale changes in the target domain, baseline prediction can be performed. A target-level perturbation view is constructed based on the candidate boxes.
[0190] In the baseline prediction results Obtain the collection of detection boxes ,against Within each detection box, a rectangular sub-region is randomly erased from the internal image region to obtain the occlusion perturbation image. ,Will Input the teacher model at the current iteration number The occlusion disturbance prediction results were obtained. Specifically, it is expressed by the following formula:
[0191] ;
[0192] right An affine transformation is performed on the internal image region of each detection box to obtain a scale-perturbed image. ,Will Input the teacher model at the current iteration number Scale perturbation prediction results were obtained. Specifically, it is expressed by the following formula:
[0193] ;
[0194] , , , , , The target disturbance prediction result set is formed, and any disturbance prediction result in the target disturbance prediction result set is represented as: , ,in, for The number of instances in; For the first The detection bounding box for each instance; For the first The probability distribution of the class prediction for each instance; For the first Confidence scores for each instance;
[0195] Step 6.3: Based on and Calculate the total inconsistency score for each source domain road scene image. ;
[0196] This step measures the consistency of teacher predictions for the same source domain sample under the "baseline view" and the "perturbation view". If the prediction remains stable under different perturbations, it indicates that the source domain sample better matches the representation of the target scene; conversely, if the prediction changes significantly with perturbations, it indicates that the sample is unstable or unreliable in its transfer to the target scene. Therefore, a prediction inconsistency index is defined, and the inconsistencies of multiple perturbation views are weighted and summarized to obtain the total inconsistency score for the source domain sample. .
[0197] Step 6.3.1: Based on and Construct a set of matching pairs First detection box set Second detection box set ;
[0198] Based on a preset confidence threshold and IoU threshold The Non-Maximum Suppression (NMS) algorithm is used to respectively target... With any perturbation prediction result in the target perturbation prediction result set The data is processed to obtain the processed baseline prediction results. and the processed disturbance prediction results , is represented as:
[0199] ;
[0200] ;
[0201] in, The processed baseline prediction results, for The number of instances in; For the first The detection bounding box for each instance; For the first The probability distribution of the class prediction for each instance; For the first Confidence scores for each instance The processed disturbance prediction results are shown below. for The number of instances in; For the first The detection bounding box for each instance; For the first The probability distribution of the class prediction for each instance; For the first Confidence scores for each instance;
[0202] calculate and The Intersection over Union (IoU) is specifically achieved using the following formula:
[0203] ;
[0204] in, express and The area of the overlapping region; express and The area of the union region;
[0205] exist and Among all the IoU values of the detection boxes, obtain the value greater than the threshold. All detection boxes are selected as candidate detection boxes, and the detection box corresponding to the maximum IoU value among the candidate detection boxes is selected as the target detection box. The target detection box and... The Middle i The detection boxes of each instance form matching pairs, thus obtaining a set of matching pairs. ,as well as China failed to cooperate with The first set of matching detection boxes ,as well as China failed to cooperate with The set of matching second detection boxes ;
[0206] in, This reflects "detections that disappear under disturbance" (which can be understood as a tendency to miss detections). This reflects "newly added detections after the disturbance" (which can be understood as new false detections or unstable detections).
[0207] Step 6.3.2: According to , , Calculate the total inconsistency score for each source domain road scene image. ;
[0208] against For the matching pairs (α, β) in the matching pair, a classification difference metric is calculated based on the class prediction probability distribution of the detection boxes in the matching pair. Specifically, this is achieved through the following formula:
[0209] ;
[0210] in, express The number of matching pairs in the middle, express The Middle The predicted probability distribution of the categories corresponding to each detection box express The Middle The predicted probability distribution of the categories corresponding to each detection box express and The Jensen-Shannon divergence is also known as the Jensen-Shannon divergence.
[0211] Calculate location difference measurement Specifically, this is achieved through the following formula:
[0212] ;
[0213] in, express The Middle One detection box, express The Middle One detection box, express and The intersection and union ratio;
[0214] Calculate missed detections or new difference measures Specifically, this is achieved through the following formula:
[0215] ;
[0216] in, express The number of detection boxes in the middle, express The number of detection boxes in the middle, express The number of detection boxes in the middle, express The number of detection boxes in the middle, To prevent the stable term from being divided by zero;
[0217] Calculate single-view inconsistency Specifically, this is achieved through the following formula:
[0218] ;
[0219] in, Indicates the loss weight. and ;
[0220] like (If no matching pair exists), then let , At this point, the inconsistency of a single view is mainly due to Characterization;
[0221] like (If there are no detection boxes in either view), then let And can make .
[0222] Inconsistency of single view Weighted summation yields the total inconsistency score for each source domain road scene image. Specifically, this is achieved through the following formula:
[0223] ;
[0224] Where K represents the number of perturbation prediction results, Indicates view weight, and ; The smaller the score, the more stable the prediction is and the closer it is to the target scenario (more suitable for transfer / more reliable).
[0225] Step 6.4: Score the total inconsistency based on the source domain road scene image. ,according to Source domain road scene images are filtered from the source domain image set to construct a source domain pseudo-label dataset. Source domain pseudo-label batches are then sampled from the source domain pseudo-label dataset. Batch of target domain samples were obtained by sampling from the target domain labeled dataset. ;
[0226] Sort all source domain road scene images by their total inconsistency scores in ascending order, and select the top N source domain road scene images as target images to form a high-value source domain subset. , recorded as ;
[0227] high-value source domain subsets target image in Input the teacher model at the current iteration number The first prediction result was obtained. , is represented as: ; , express The number of instances in for The first in q The detection bounding box for each instance; For the first q The probability distribution of the class prediction for each instance; For the first q Confidence scores for each instance;
[0228] against For each bounding box in the dataset, the category corresponding to the maximum value in the predicted probability distribution is taken as the pseudo-label of that bounding box, specifically expressed by the following formula:
[0229] ;
[0230] for For each detection box in the dataset, a confidence score is assigned, and the confidence score is set below a preset confidence threshold. Instance removal yields the second prediction result;
[0231] Based on a preset confidence threshold and IoU threshold The non-maximum suppression (NMS) algorithm is used to process the detection boxes belonging to the same category in the second prediction result to obtain the third prediction result; NMS is used to retain only the detection boxes with high confidence and small spatial overlap within the same category.
[0232] Within all detection frames of the third prediction result, obtain the result with... The intersection-union ratio of the detection boxes is greater than or equal to a preset threshold. And with Detection boxes matching the category of the bounding boxes are used as the final detection boxes. The final detection box and its corresponding pseudo-label constitute the complete set of detection boxes. The final set of pseudo-tags multiple and This constitutes the source domain pseudo-label dataset;
[0233] Target domain batches were obtained by sampling from the target domain labeled dataset. Source domain pseudo-label batches were obtained by sampling from the source domain pseudo-label dataset. ;
[0234] Step 6.5: Based on and The parameters of the student model and the teacher model are updated. The updated student model... and the updated teacher model ;
[0235] At the current iteration number, based on and For the student model parameters at the current iteration number Perform joint optimization to minimize the objective function, and obtain the optimized student model parameters. This leads to the updated student model. ;
[0236] Wherein, objective function Represented as:
[0237] ;
[0238] in, Indicates the batch size of the target domain samples. For the detection bounding box and category of the target road scene image, The target detection loss function includes classification loss, regression loss, and confidence loss. These are the training weight coefficients for the source domain pseudo-labels. Indicates the batch size of the source domain pseudo-label;
[0239] Using the exponential moving average (EMA) method, based on The following formula is used to... parameters The parameters of the updated teacher model are then obtained through updating, leading to the final updated teacher model. ;
[0240] ;
[0241] in, EMA momentum coefficient;
[0242] Among them, EMA (Exponential Moving Average) is a commonly used method for updating teacher models. It can smooth out parameter changes in student models and make teacher predictions more stable.
[0243] After completing joint training based on selected source domain samples, the updated student model is evaluated for object detection performance using labeled data from the target domain or a pre-divided target domain validation dataset, in order to quantify the model's detection effectiveness in the target domain scenario.
[0244] Step 6.6: Calculate the updated student model Validation set of the target domain labeled dataset Target domain performance index value Specifically, it is expressed by the following formula:
[0245] ;
[0246] in, This represents a performance evaluation function for object detection, used to compare the differences between the model's prediction results and the ground truth annotations in the object domain; the performance index... To reflect the overall detection accuracy of the model in the target domain, the mean average precision (mAP) is preferred. For example, mAP@IoU=0.5:0.95 is calculated under multiple cross-union ratio (IoU) thresholds. Here, @ indicates that the mAP is an evaluation index calculated under specific IoU threshold conditions. mAP@IoU=0.5:0.95 represents the mAP index calculated under the set of conditions where the cross-union ratio (IoU) thresholds are from 0.5 to 0.95.
[0247] Set the allowable performance fluctuation threshold ,judge Compared with the target domain performance index value under the previous iteration number m-1 Whether the positive migration criteria are met, in When the representation satisfies the positive migration criterion, in When the representation does not meet the positive migration criteria;
[0248] Set the termination condition; determine if the current iteration meets the termination condition:
[0249] A. If the termination condition is met, then... As the final student model, As the ultimate teacher model;
[0250] B. If the termination condition is not met but the forward transition condition is met, increment the current iteration count by 1. As the student model for the new iteration number, As the teacher model for the new iteration, the execution is returned: based on... and Calculate the total inconsistency score for each source domain road scene image. ;
[0251] C. If neither the termination condition nor the forward transition condition is met, increment the current iteration count by 1. As the student model for the new iteration number, As the teacher model for the new iteration, the execution is returned: based on... and Calculate the total inconsistency score for each source domain road scene image. ;
[0252] The termination condition is set as follows: the current iteration count reaches the preset maximum number of rounds, or the consecutive preset number of rounds does not meet the forward migration judgment condition.
[0253] Step 7: Obtain the image to be detected, input the image to be detected into the final teacher model or the final student model, and obtain the detection box and category information of the target instance in the image to be detected.
[0254] Compared with the prior art, the present invention has at least the following key technical points:
[0255] (1) Source scene sample selection mechanism based on target scene as the criterion
[0256] This invention no longer assumes that the source scene samples as a whole have transfer value. Instead, it focuses on the target scene discrimination ability and uses a teacher model to evaluate the prediction consistency of the source scene samples under target-oriented perturbation, thereby achieving a refined screening of the transfer value of the source scene samples.
[0257] (2) Goal-oriented multi-level perturbation consistency assessment
[0258] For samples from the same source scene, this invention constructs multiple single perturbation views, including pixel-level perturbation, feature-level perturbation, and target-level perturbation, and calculates the consistency of prediction results before and after perturbation, thereby comprehensively evaluating the stability of the sample under the target scene assumption, rather than relying on a single prediction or confidence threshold.
[0259] (3) A consistent judgment and training framework with clear division of labor between teachers and students
[0260] The teacher model, as a time-smoothed version of the student model, is used only for consistency judgment of source scene samples and pseudo-label generation, while the student model is used only for parameter update training. This avoids model fluctuations interfering with the screening results and improves the stability of screening and pseudo-label generation.
[0261] (4) Introduce a closed-loop control mechanism for positive migration determination
[0262] This invention determines the transfer effect by evaluating the target scene performance after each round of source scene sample introduction and joint training. When the positive transfer conditions are not met, the selection strategy is adjusted or rolled back, forming a controlled and iterative training closed loop.
[0263] (5) Perturbation parameter constraint mechanism driven by target scene statistical information
[0264] By statistically modeling the pixel characteristics and feature distribution of the target scene, the generated perturbation parameters are constrained by the real distribution of the target scene, avoiding the introduction of unreasonable perturbations and improving the discriminative significance of consistency assessment.
[0265] This invention evaluates the discriminative consistency of source scene samples using a target scene model, effectively screening source scene samples with positive transfer value during training and avoiding invalid or harmful samples from participating in model training. By combining a teacher model to generate stable pseudo-labels, it reduces noise interference during training. This effectively suppresses negative transfer in cross-scene training, improves the detection accuracy and training stability of the model in the target scene, and has good engineering application value.
[0266] The above description is merely a preferred embodiment of this disclosure and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of the invention involved in the embodiments of this disclosure is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the above-described inventive concept. For example, technical solutions formed by substituting the above-described features with (but not limited to) technical features with similar functions disclosed in the embodiments of this disclosure.
Claims
1. A target instance detection method based on the consistency of target scene discrimination, characterized in that, include: In autonomous driving scenarios, multiple target road scene images are collected by vehicle-mounted cameras to form a target domain image set. The detection bounding boxes are labeled for target instances of preset categories within the target road scene image. The target domain labeling dataset is composed of all target road scene images, corresponding detection bounding boxes and category information. Based on the target domain labeled dataset, the target detection network is trained to obtain initial parameters. Two target detection networks with the same structure are then initialized with these initial parameters and used as initial student models. and the initial teacher model ; Statistical analysis is performed on the target road scene images in the target domain image set to obtain target scene statistical information and target feature statistical information. Acquire multiple source domain road scene images and form a source domain image set; based on , Based on the target scene statistics and target feature statistics, calculate the total inconsistency score for each source domain road scene image in the source domain image set. ,according to Source domain road scene images in the source domain image set are filtered to construct a source domain pseudo-label dataset, thereby determining the final teacher model and the final student model; Specifically, set the initial iteration count m=0, and use the initial iteration count as the current iteration count. As the teacher model at the current iteration number ,Will As the student model at the current iteration number ; Based on the statistical information of the target scenario and the statistical information of the target features, the teacher model at the current iteration number is adopted. Constructing baseline prediction results for source domain road scene images and a set of target disturbance prediction results; the set of target disturbance prediction results includes multiple disturbance prediction results. ; based on and Calculate the total inconsistency score for each source domain road scene image. ; Based on the total inconsistency score of the source domain road scene image ,according to Source domain road scene images are filtered from the source domain image set to construct a source domain pseudo-label dataset. Source domain pseudo-label batches are then sampled from the source domain pseudo-label dataset. Batch of target domain samples were obtained by sampling from the target domain labeled dataset. ; based on and The parameters of the student model and the teacher model are updated. The updated student model... and the updated teacher model ; Calculate the updated student model Validation set of the target domain labeled dataset Target domain performance index value ; Set the allowable performance fluctuation threshold ,judge Compared with the target domain performance index value under the previous iteration number m-1 Whether the positive migration criteria are met, in When the representation satisfies the positive migration criterion, in When the representation does not meet the positive migration criteria; Set the termination condition; determine if the current iteration meets the termination condition: A. If the termination condition is met, then... As the final student model, As the ultimate teacher model; B. If the termination condition is not met but the forward transition condition is met, increment the current iteration count by 1. As the student model for the new iteration number, As the teacher model for the new iteration, the execution is returned: based on... and Calculate the total inconsistency score for each source domain road scene image. ; C. If neither the termination condition nor the forward transition condition is met, increment the current iteration count by 1. As the student model for the new iteration number, As the teacher model for the new iteration, the execution is returned: based on... and Calculate the total inconsistency score for each source domain road scene image. ; The termination condition is set as follows: the current iteration count reaches the preset maximum number of rounds, or the consecutive preset number of rounds does not meet the forward migration judgment condition; The image to be detected is acquired and input into the final teacher model or the final student model to obtain the detection box and category information of the target instance in the image to be detected.
2. The target instance detection method based on target scene discrimination consistency according to claim 1, characterized in that, Statistical analysis is performed on target road scene images in the target domain image set to obtain target scene statistical information and target feature statistical information, including: Pixel-level processing is performed on each target road scene image in the target domain image set, and the pixel-level processed data corresponding to the target domain image set is statistically analyzed to obtain target scene statistical information; the target scene statistical information includes at least color statistical range, illumination statistical range, blur intensity distribution, and noise intensity distribution. Feature-level processing is performed on each target road scene image in the target domain image set, and the data after feature-level processing corresponding to the target domain image set are statistically analyzed to obtain target feature statistics.
3. The target instance detection method based on target scene discrimination consistency according to claim 2, characterized in that, Pixel-level processing is performed on each target road scene image in the target domain image set. The processed pixel-level data corresponding to this target domain image set is then statistically analyzed to obtain target scene statistical information, including: target road scene images from the target domain image set Convert to RGB color space to obtain an RGB color space image; normalize each pixel value in the RGB color space image to obtain a normalized image. ;calculate The mean values of the R, G, and B channels in the spatial dimension with standard deviation ; Based on all target road scene images in the target domain image set Calculate the quantile statistics to obtain the quantile statistical range of the RGB mean; based on all target road scene images in the target domain image set... Calculate the quantile statistics to obtain the quantile statistical range of the RGB variance; the quantile statistical range of the RGB mean and the quantile statistical range of the RGB variance constitute the color statistical range; The target road scene image is converted from the RGB color space to the HSV color space to obtain an HSV color space image. The V channel is then extracted as the luminance component from the HSV color space image, and the luminance component is normalized to obtain the normalized luminance component. ,calculate Mean in spatial dimension and standard deviation ; Based on all target road scene images in the target domain image set Calculate quantile statistics to obtain the quantile statistical range of the mean brightness; based on all target road scene images in the target domain image set... Quantile statistics are calculated to obtain the quantile statistical range of the luminance variance; the quantile statistical range of the luminance mean and the quantile statistical range of the luminance variance constitute the illumination statistical range; Convert the target road scene image to grayscale. ,right Applying the Laplacian operator yields the response graph. ,calculate The variance and its use as an ambiguity index ; Based on all target road scene images in the target domain image set Quantile statistics are calculated to obtain the fuzzy intensity distribution; Applying small-scale Gaussian blur to grayscale images The high-frequency residuals are obtained through processing. ; Calculate based on Sobel operator respectively The gradient components in the horizontal and vertical directions are used to calculate the gradient magnitude. Pixel regions with gradient magnitudes less than a preset gradient threshold are considered flat regions. ; In flat areas Inside, calculation The standard deviation and its use as a proxy for noise intensity ; Based on all target road scene images in the target domain image set The noise intensity distribution is obtained by calculating quantile statistics.
4. The target instance detection method based on target scene discrimination consistency according to claim 2, characterized in that, Feature-level processing is performed on each target road scene image in the target domain image set. The processed data corresponding to this target domain image set are then statistically analyzed to obtain target feature statistics, including: Input the target domain image set The first intermediate semantic features of each target road scene image are obtained through the feature extraction backbone network and feature fusion module. Based on the first intermediate semantic features of all target road scene images, the average value of the first intermediate semantic features is calculated. with standard deviation , and Statistical information on the characteristics of the target.
5. The target instance detection method based on target scene discrimination consistency according to claim 1, characterized in that, Based on the statistical information of the target scenario and the statistical information of the target features, the teacher model at the current iteration number is adopted. Constructing baseline prediction results for source domain road scene images The set of target perturbation prediction results includes: Source domain road scene image Input the teacher model at the current iteration number The baseline prediction results were obtained. , represented as: ,in, The number of instances in the baseline prediction results; For the first The detection bounding box for each instance; For the first The probability distribution of class prediction for each instance; For the first Confidence scores for each instance; By analyzing the color statistical range and the illumination statistical range Perturbation is performed to obtain a color lighting perturbation view. Specifically, this is achieved through the following formula: ; in, Perturbation operators representing color and brightness; This represents the set of target domain pixel statistical parameters sampled from the color statistical range and the illumination statistical range; Through fuzzy intensity distribution Perturbation is performed to obtain a blurred perturbation view. Specifically, this is achieved through the following formula: ; in, A perturbation operator representing the fuzzy intensity distribution; The fuzzy intensity parameters are obtained by sampling from the fuzzy intensity distribution; Through noise intensity distribution Perform a perturbation to obtain a noise perturbation view. Specifically, this is achieved through the following formula: ; in, Perturbation operators representing the noise intensity distribution These are noise intensity parameters obtained by sampling from the noise intensity distribution; Will , and Input the teacher model for the current iteration number. The color illumination perturbation prediction results were obtained. Fuzzy perturbation prediction results and noise disturbance prediction results ; Input the source domain image set into the teacher model at the current iteration number. The second intermediate semantic features of each source domain road scene image are obtained through the feature extraction backbone network and the feature fusion module. Calculate the average value of the second intermediate semantic features based on the second intermediate semantic features of all source domain road scene images. with standard deviation , and Statistical results of the distribution of source domain characteristics; right and and and Perform channel-level recalibration to obtain the recalibrated features. Specifically, this is achieved through the following formula: ; in, This represents the second intermediate semantic feature. To prevent the stable term from being divided by zero; Recalibrated features Input the teacher model at the current iteration number The detection head obtains the feature-level perturbation prediction results. ; In the baseline prediction results Obtain the collection of detection boxes ,against Within each detection box, a sub-region is randomly erased from the internal image region to obtain the occlusion perturbation image. ,Will Input the teacher model at the current iteration number The occlusion disturbance prediction results were obtained. ; right An affine transformation is performed on the internal image region of each detection box to obtain a scale-perturbed image. ,Will Input the teacher model at the current iteration number Scale perturbation prediction results were obtained. ; , , , , , The target disturbance prediction result set is formed, and any disturbance prediction result in the target disturbance prediction result set is represented as: , ,in, for The number of instances in; For the first The detection bounding box for each instance; For the first The probability distribution of class prediction for each instance; For the first The confidence score of each instance.
6. The target instance detection method based on target scene discrimination consistency according to claim 1, characterized in that, based on and Calculate the total inconsistency score for each source domain road scene image. ,include: based on and Construct a set of matching pairs First detection box set Second detection box set ; Based on a preset confidence threshold and IoU threshold The Non-Maximum Suppression (NMS) algorithm is used to respectively target... With any perturbation prediction result in the target perturbation prediction result set The data is processed to obtain the processed baseline prediction results. and the processed perturbation prediction results , represented as: ; ; in, The processed baseline prediction results, for The number of instances in; For the first The detection bounding box for each instance; For the first The probability distribution of class prediction for each instance; For the first Confidence scores for each instance; The processed disturbance prediction results. for The number of instances in; For the first The detection bounding box for each instance; For the first The probability distribution of class prediction for each instance; For the first Confidence scores for each instance; calculate and The intersection and union ratio of IoU; exist and Among all the IoU values of the detection boxes, obtain the value greater than the threshold. The detection bounding boxes are used as candidate detection bounding boxes, and the detection bounding box corresponding to the maximum IoU value among the candidate detection bounding boxes is selected as the target detection bounding box. The target detection bounding box and the detection bounding box are then compared. The detection boxes of the i-th instance form a matching pair, thus obtaining the set of matching pairs. ,as well as China failed to cooperate with The first set of matching detection boxes ,as well as China failed to cooperate with The set of matching second detection boxes ; according to , , Calculate the total inconsistency score for each source domain road scene image. ; against For the matching pairs (α, β) in the matching pair, a classification difference metric is calculated based on the class prediction probability distribution of the detection boxes in the matching pair. Specifically, this is achieved through the following formula: ; in, express The number of matching pairs in the middle, express The Middle The predicted probability distribution of the categories corresponding to each detection box express The Middle The predicted probability distribution of the categories corresponding to each detection box express and The Jensen-Shannon divergence; Calculate location difference measurement Specifically, this is achieved through the following formula: ; in, express The Middle One detection box, express The Middle One detection box, express and The intersection and union ratio; Calculate missed detections or new difference measures Specifically, this is achieved through the following formula: ; in, express The number of detection boxes in the middle, express The number of detection boxes in the middle, express The number of detection boxes in the middle, express The number of detection boxes in the middle, To prevent the stable term from being divided by zero; Calculate single-view inconsistency Specifically, this is achieved through the following formula: ; in, Indicates the loss weight; Inconsistency of single view Weighted summation yields the total inconsistency score for each source domain road scene image. Specifically, this is achieved through the following formula: ; Where K represents the number of perturbation prediction results, Indicates view weight.
7. The target instance detection method based on target scene discrimination consistency according to claim 1, characterized in that, Based on the total inconsistency score of the source domain road scene image ,according to Source domain road scene images are filtered from the source domain image set to construct a source domain pseudo-label dataset, including: Sort all source domain road scene images by their total inconsistency scores in ascending order, and select the top N source domain road scene images as target images to form a high-value source domain subset. ; high-value source domain subsets target image in Input the teacher model at the current iteration number The first prediction result was obtained. , represented as: ; , express The number of instances in for The detection box of the q-th instance in the array; Predict the probability distribution for the category of the q-th instance; Let be the confidence score of the q-th instance; against For each bounding box in the dataset, the category corresponding to the maximum value in the category prediction probability distribution is taken as the pseudo-label of the bounding box. for For each detection box in the dataset, a confidence score is assigned, and the confidence score is set below a preset confidence threshold. Instance removal yields the second prediction result; Based on a preset confidence threshold and IoU threshold The non-maximum suppression (NMS) algorithm is used to process the detection boxes belonging to the same category in the second prediction result to obtain the third prediction result. Within all detection frames of the third prediction result, obtain the result with... The intersection-union ratio of the detection boxes is greater than or equal to a preset threshold. And with Detection boxes matching the category of the bounding boxes are used as the final detection boxes. The final detection box and its corresponding pseudo-label constitute the complete set of detection boxes. The final set of pseudo-tags multiple and This constitutes the source domain pseudo-label dataset.
8. The target instance detection method based on target scene discrimination consistency according to claim 1, characterized in that, based on and The parameters of the student model and the teacher model are updated. The updated student model... and the updated teacher model ,include: At the current iteration number, based on and For the student model parameters at the current iteration number Perform joint optimization to make the objective function Minimize to obtain the optimized student model parameters. This leads to the updated student model. ; Wherein, objective function Represented as: ; in, Indicates the batch size of the target domain samples. For the detection bounding box and category of the target road scene image, The target detection loss function includes classification loss, regression loss, and confidence loss. These are the training weight coefficients for the source domain pseudo-labels. Indicates the batch size of the source domain pseudo-label; Using the exponential moving average (EMA) method, based on The following formula is used to... parameters The updated teacher model parameters are obtained by performing an update. This leads to an updated teacher model. ; ; in, EMA is the momentum coefficient.
Citation Information
Patent Citations
Semi-supervised target detection method and system based on teacher and student models and strong and weak branches
CN116091886A
Passive domain adaptive target detection method and device
CN117636086A
Model training method, cross-domain target detection method and electronic equipment
CN118038163A
Cross-domain target detection method and system based on semi-supervised learning in extreme weather
CN119863615A
Multi-source fusion spectrum cross-domain high-precision prediction method and system based on transfer learning
CN121170510A