Cross-domain target detection method based on high-frequency signal and semantic regularization
By introducing high-frequency signals and semantic regularization into the cross-domain target detection method, the problem of detection accuracy under environmental changes in cross-domain target detection is solved, and the model achieves high efficiency and robustness in complex environments.
Patent Information
- Application Number
- CN202511789583.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-01
- Publication Date
- 2026-02-06
AI Technical Summary
Existing cross-domain object detection technologies struggle to effectively capture target instances when faced with changes in the external environment, especially image blurring caused by changes in lighting conditions, weather differences, and seasonal changes. Furthermore, the models are overburdened and cannot simultaneously perform the tasks of object detection and inter-domain feature alignment.
A cross-domain target detection method based on high-frequency signals and semantic regularization is adopted. By constructing a cross-domain target detection model, inter-domain alignment branches and regularization branches are introduced. High-frequency features are extracted using the Sobel operator. Combined with gradient flipping layers and multi-label classifiers, the loss function is optimized to achieve domain adaptive detection of the model.
It significantly improves the detection accuracy of the model in cross-domain environments, reduces the difficulty of model parameter learning, enhances the semantic nature of features, and strengthens the adaptability and robustness of the detector, especially performing well in complex environments.
Smart Images

Figure CN121482369A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application belongs to the field of domain adaptive object detection, relates to the technical field of computer vision and deep learning, and particularly relates to a cross-domain object detection method based on high-frequency signals and semantic regularization. BACKGROUND
[0002] As a key task in computer vision, object detection aims to identify and locate target instances in image or video data, which has become a basic task in intelligent vision applications in the current industry. In recent years, with the continuous development of deep learning technology, object detection methods have evolved from two-stage detectors focusing on detection performance to single-stage detectors considering both performance and timeliness. The mainstream single-stage detector represented by YOLO has been widely used in various real detection scenarios. However, in the process of real industrial application, it often faces the challenge of image differentiation caused by external environment changes. For example, in the scenarios of security monitoring and autonomous driving, changes in lighting conditions (day and night), weather differences (sunny, rainy, and foggy), and seasonal changes will all cause significant differences in the presentation of camera data, resulting in phenomena such as image blur, brightness difference, or color diversity, making it difficult for the detector to capture target instances in the corresponding scene.
[0003] The main reason why the detection model cannot adapt to external environment changes is that the image diversity changes caused by external factors will cause the image data to deviate from its original data distribution, causing the "domain shift" phenomenon. That is, in the actual deployment stage, the real-time detection image faced by the detector is inconsistent with the training image it relies on in terms of data distribution. To this end, cross-domain object detection technology has become an important research topic in the current detection field. In this context, unsupervised domain adaptive methods have gradually become a "mainstream domain" adaptive framework. Among them, the most representative is the feature-level distribution alignment scheme proposed for two-stage detectors, which relies on the adversarial domain adaptation framework in the classification task to achieve multi-level feature alignment in the detector. Subsequent research has drawn on and extended it to the detection field, gradually promoting the domain generalization ability of the detector. However, in scenarios with significant domain differences, the domain generalization performance of existing methods still cannot meet the actual industrialization needs.
[0004] The main goal of domain adaptive object detection technology is to improve the adaptability of the detector to other unknown domains simply by using real-time collected unlabeled (other domain) data, which can greatly save the workload of data labeling and model training. Formally, given the labeled source domain data and the unlabeled data in the other domain , the domain adaptive method can be divided into two parallel functions, described as follows: 1) according to the labeled source domain data 1) Construct a detection loss to achieve the detection function; 2) Based on the collected unlabeled data It performs feature alignment of source domain data with data from other domains in terms of data distribution patterns, thereby improving the detector's adaptability to other unknown domains.
[0005] The main challenges of this research are: 1) Image blurring: Data from other domains often suffers from insufficient illumination, image blurring, and style shifts. Under these challenges, even with feature distribution alignment, it is difficult to effectively capture target instances in blurred images. 2) Model burden: Under domain-adaptive settings, the detector bears the dual burden of target detection and inter-domain feature alignment. Specifically, the model not only needs to classify and locate target instances but also ensure the consistency of feature distributions across domains. Summary of the Invention
[0006] Purpose of the invention: This invention provides a cross-domain target detection method based on high-frequency signals and semantic regularization, which promotes the adaptability of the detection model to complex changes in the external environment and improves the detection accuracy of the detector for domain-offset images.
[0007] Technical solution: The present invention provides a cross-domain target detection method based on high-frequency signals and semantic regularization, comprising the following steps:
[0008] (1) Construct training, testing, and validation sets including source and target domain data; and perform data preprocessing;
[0009] (2) Extract the features of high-frequency signals from the original RGB image data in the training set and validation set, and perform channel-based splicing on the two types of data to obtain four-channel image data;
[0010] (3) Construct a cross-domain target detection model training architecture, introduce inter-domain alignment branches and regularization branches to assist in the training of the detection model, so that the parameter values learned by the detection model have domain adaptive detection function;
[0011] (4) Design a loss function and train a cross-domain target detection model;
[0012] (5) After training is completed, save the detection model weights and execute the model deployment for actual detection.
[0013] Furthermore, the implementation process of step (1) is as follows:
[0014] The source domain is selected from daytime traffic scenes, and the target domain is selected from foggy traffic scenes. Both are stored in the algorithm directory in a unified format. The source domain data is provided with corresponding annotation files, while the target domain data is not provided with annotation files. Both the validation set and the test set are composed of target domain data. The image data in the training and validation sets are normalized and adjusted to a unified input space size.
[0015] Furthermore, the implementation process of step (2) is as follows:
[0016] The Sobel operator is selected as the spatial gradient filter in this method. The gradients are calculated in the horizontal and vertical directions of the input image, respectively, using the following formulas:
[0017]
[0018] in, and These represent the gradient convolution kernels in the horizontal and vertical directions, respectively.
[0019] For the input image After convolution calculation, its high-frequency signal is:
[0020]
[0021] in, This represents the convolution operation. This refers to the extracted high-frequency feature map;
[0022] The obtained high-frequency feature map is then used as the fourth channel of the original RGB image and concatenated with the original image channel by channel to form a new four-channel input; the concatenation process is as follows:
[0023]
[0024] in, This refers to the image input data after data refinement.
[0025] Furthermore, the implementation process of step (3) is as follows:
[0026] Given a cross-domain object detection model It is divided into backbone networks. and subsequent detection modules ;in These are the parameter sets for the preceding and following modules, respectively; given an input... The entire detection function Decomposed into a three-step forward mapping form The training architecture consists of three branches:
[0027] Main target detection function branch: for labeled source domain data Obtain the model's predicted output. Among them, the test results Used to calculate the detection loss function In order to perform parameter updates;
[0028] Inter-domain feature alignment branch: for two types of data Get module After the feature output is obtained, it is fed into the domain classifier. Obtain prediction results for distinguishing domain categories; this branch is expressed as follows: Among them, the domain classification results Used for constructing domain classification loss In order to perform parameter updates;
[0029] Semantic regularization branch: targeting data Get module After the feature output is obtained, it is fed into a multi-label classifier. This yields prediction results used to distinguish target semantics; this branch is expressed as follows: Among them, the classification results of internal targets Used to construct multi-label classification loss This is to enable parameter updates.
[0030] Furthermore, the loss function in step (4) is:
[0031]
[0032] in, For target detection loss, For inter-domain feature alignment loss, For multi-label classification loss, and Used to adjust the gradient contribution of various losses to the optimization of pre-parameters.
[0033] Furthermore, the process of training the cross-domain target detection model in step (4) is as follows:
[0034] Randomly sample a quantitative batch of data from the training and validation sets, and perform forward computation and backward parameter update respectively;
[0035] Forward computation: Perform forward propagation according to the defined training architecture to obtain data from the labeled source domain. Test results For two types of data Domain classification results and multi-label classification results for targets inside the source domain image The above prediction results are then fed into the pre-set loss function;
[0036] Inverse parameter update: Based on the calculation results of each loss function, the parameters of each module within the model are updated; the formulas for updating each parameter are as follows: , , and .
[0037] Furthermore, the specific implementation process of the inter-domain feature alignment branch is as follows:
[0038] The features of the source and target domains output by the backbone network are used as input. First, a gradient flipping layer is passed through the layer. This layer does not change the input features during the forward propagation stage, but multiplies the gradient by a scaling factor during the backward propagation to achieve the gradient flipping effect.
[0039] The features are then input into the domain classifier module. The domain classifier structure is as follows: First, a 1×1 convolutional layer is used to perform channel transformation and dimensionality reduction on the input features, reducing the number of channels from 256 to 128 to compress the feature dimension and extract compact domain discriminative information. After the first convolutional layer, a non-linear activation function ReLU is applied to enhance the non-linear expressive power of the features and improve the classification performance. Then, a second 1×1 convolutional layer is used to further reduce the dimensionality of the feature channels, reducing the number of channels from 128 to 64, obtaining more representative low-dimensional domain features. Next, an adaptive average pooling layer is used to perform global average pooling on the feature map, fixing the spatial size to 1×1, resulting in a global domain feature vector of size 64×1×1. Finally, the 64-dimensional global features are input into a fully connected layer for linear transformation, outputting a single-dimensional domain classification prediction. This is used to represent the probability that the input feature belongs to the target domain; prediction is based on domain classification. Constructing domain classification loss Optimize the domain classifier to improve classification capabilities;
[0040] During the backpropagation phase, the gradient is multiplied by a factor when it passes through the initial GRL layer. The scaling factor is then passed to the backbone network, thereby reversing the gradient propagation direction; the specific gradient relationship is expressed by the chain rule as follows:
[0041]
[0042] This mechanism causes the backbone network to tend to extract features during training that make it difficult for the domain classifier to distinguish between the source and target domains, thereby achieving alignment of the feature distributions of the source and target domains at the feature level.
[0043] Furthermore, the specific implementation process of the semantic regularization branch is as follows:
[0044] The global feature map output from the backbone network is extracted and input into the semantic regularization branch. The multi-label classifier structure is as follows: It receives the feature output from the backbone network as the branch input, first passing through a convolutional layer to reduce the dimensionality of the features, decreasing the number of feature channels from 256 to 64; then, it undergoes global average pooling through an average pooling layer, fixing the spatial size to 1x1, resulting in a global feature vector of size 64×1×1; finally, this 64×1×1 global feature vector is input into a fully connected layer for linear transformation, outputting... Multi-label category prediction in multiple dimensions The number of categories contained in the target domain data;
[0045] Based on multi-label classification prediction Its true global category label Constructing classification loss .
[0046] Furthermore, the inter-domain feature alignment loss By adding a domain classifier after the backbone network and combining it with a gradient flipping layer, the goal is to reduce the distribution difference between the source and target domains. The loss is defined as:
[0047]
[0048] in, For domain labels, the source domain is denoted as The target domain is denoted as , The predicted output of the domain classifier.
[0049] Furthermore, the multi-label classification loss Specifically, adaptive soft-label loss is adopted as the optimization objective to adaptively adjust the gradient contributions of positive and negative samples during training, mitigating the adverse effects of class imbalance. The loss is defined as follows:
[0050]
[0051] in, The actual label of the target instance, Adjust the parameters to reflect the actual prediction results of the classifier. and These are used to control the degree of attention given to difficult positive samples and difficult negative samples, respectively. Used to suppress the contribution of easily classified negative samples to the loss.
[0052] Beneficial effects: Compared with the prior art, the beneficial effects of the present invention are as follows:
[0053] 1. Reduced difficulty in model parameter learning: This invention utilizes high-frequency signals in images to effectively reduce inter-domain gaps during the input stage, thereby reducing the difficulty of model domain adaptation and providing a more stable and reliable input foundation for subsequent cross-domain feature alignment.
[0054] 2. Improved semantic features: This invention introduces an inter-domain feature alignment branch in the detector to reduce the distribution difference between the source and target domains at the feature level; on this basis, a semantic regularization branch is further proposed to provide semantic supervision for the model during training; this branch can guide the model to pay more attention to key instance regions in the image and effectively suppress the interference of irrelevant background noise, thereby improving the overall cross-domain detection performance of the model.
[0055] 3. Performance advantages: Experiments in two cross-domain scenarios, from natural to animated and from daytime to foggy, show that the present invention has better detection performance compared with other mainstream domain adaptive object detection algorithms. Attached Figure Description
[0056] Figure 1 This is a training architecture diagram for the domain adaptive object detection proposed in this invention;
[0057] Figure 2 This is a schematic diagram of high-frequency signal extraction based on the Sobe1 operator;
[0058] Figure 3 A schematic diagram of channel-level image feature enhancement for high-frequency signals;
[0059] Figure 4 This is a schematic diagram of the functional structure in the inter-domain feature alignment branch;
[0060] Figure 5 This is a schematic diagram of the functional structure in the semantic-level regularization branch;
[0061] Figure 6 Example images showing the comparison of detection results. Detailed Implementation
[0062] The present invention will now be described in further detail with reference to the accompanying drawings.
[0063] This invention proposes a cross-domain target detection method based on high-frequency signals and semantic regularization, such as... Figure 1 As shown, the specific steps include the following:
[0064] Step 1: Data preparation and data preprocessing.
[0065] Data preparation: The source domain is the daytime traffic scene dataset Cityscapes, and the target domain is the foggy traffic scene dataset Foggy Cityscapes. Data is stored in the algorithm directory according to a unified format, with image files stored in the image / folder (.jpg format) and annotation files stored in the label / folder (.txt format). The training set contains a total of 5950 images (2975 from the source domain and 2975 from the target domain). Annotation files are provided for the source domain data, but not for the target domain data. The validation and test sets consist of 500 images from the target domain.
[0066] Data preprocessing: processing image data in the training and validation sets. Perform data normalization and size adjustment operations to linearly normalize the pixel values from [0, 255] to the range of [0, 1] and adjust them to a uniform input space size (640x640).
[0067] Step 2, Input-level data refinement: This operation mainly performs high-frequency signal extraction and multi-signal data merging operations on the image data. First, for the original RGB image data... Perform feature extraction operations on high-frequency signals; use a Sobel spatial gradient filter. Acquiring high-frequency characteristic signals Secondly, the two types of data are concatenated using a channel-based method to obtain four-channel image data. ; Figure 1 The upper left side illustrates how this step works.
[0068] The high-frequency feature enhancement method based on the Sobel operator is implemented as follows:
[0069] like Figure 2 As shown, the Sobel operator is selected as the spatial gradient filter in this method. The gradients are calculated in the horizontal and vertical directions of the input image, respectively, using the following formulas:
[0070]
[0071] in, and These represent the gradient convolution kernels in the horizontal and vertical directions, respectively.
[0072] For the input image After convolution calculation, its high-frequency signal can be represented as:
[0073]
[0074] in, This represents the convolution operation. This refers to the extracted high-frequency feature map.
[0075] like Figure 3 As shown, the obtained high-frequency feature map is then used as the fourth channel of the original RGB image and concatenated with the original image channel by channel to form a new four-channel input. The concatenation process is as follows:
[0076]
[0077] in, This refers to the image input data after data refinement.
[0078] Step 3: Build the detector training architecture: Given a YOLOv9 detector They were divided into backbone networks. and subsequent detection modules .in These are the parameter sets for the preceding and following modules, respectively. For example... Figure 1 As shown, given an input The entire detection function It can be decomposed into a three-step forward mapping form. Under this configuration, the training architecture constructed in this embodiment includes the following three branches:
[0079] 1) Main target detection function branch: targeting labeled source domain data Obtain the model's predicted output. Among them, the test results Used to calculate the detection loss function This is to enable parameter updates. This branch of the main branch detection function corresponds to... Figure 1 The blue area at the bottom.
[0080] 2) Inter-domain feature alignment branch: for two types of data Get module The feature output is then fed into the domain classifier. Obtain prediction results for distinguishing domain categories. This branch can be expressed as a whole as follows: Among them, the domain classification results Used for constructing domain classification loss This is to enable parameter updates. The domain feature alignment branch corresponds to... Figure 1 The central area on the right.
[0081] like Figure 4 As shown, the inter-domain feature alignment branch is implemented as follows:
[0082] The source and target domain features output from the backbone network are used as input, and the feature map size is 256x20x20. First, a gradient flip layer (GRL) is passed through. This layer does not change the input features during forward propagation, but multiplies the gradient by a scaling factor during backpropagation. This achieves the gradient flipping effect.
[0083] The features are then input into the domain classifier module, which has the following structure: First, a 1×1 convolutional layer performs channel transformation and dimensionality reduction on the input features, reducing the number of channels from 256 to 128 to compress the feature dimension and extract compact domain discriminative information. A non-linear activation function, ReLU, is applied after the first convolutional layer to enhance the non-linear expressive power of the features and improve classification performance. A second 1×1 convolutional layer further reduces the feature channels, decreasing the number of channels from 128 to 64, thus obtaining more representative low-dimensional domain features. Next, an adaptive average pooling layer performs global average pooling on the feature map, fixing the spatial size to 1×1, resulting in a global domain feature vector of size 64×1×1. Finally, the 64-dimensional global features are input into a fully connected layer for linear transformation, outputting a single-dimensional domain classification prediction. This represents the probability that the input feature belongs to the target domain. Domain classification prediction. Constructing domain classification loss Optimize the domain classifier to improve classification capabilities.
[0084] During the backpropagation phase, the gradient is multiplied by a factor when it passes through the initial GRL layer. The scaling factor is then passed to the backbone network, thereby reversing the gradient propagation direction. In this embodiment, Setting it to -0.1, the specific gradient relationship can be expressed by the chain rule as follows:
[0085] .
[0086] This mechanism causes the backbone network to tend to extract features during training that make it difficult for the domain classifier to distinguish between the source and target domains, thereby achieving alignment of the feature distributions of the source and target domains at the feature level.
[0087] 3) Semantic regularization branch: targeting data... Get module After the feature output is obtained, it is fed into a multi-label classifier. This yields prediction results used to distinguish target semantics. This branch can be expressed as a whole as follows: Among them, the classification results of internal targets Used to construct multi-label classification loss This is to enable parameter updates. The semantic regularization branch for this domain corresponds to... Figure 1 The upper right area.
[0088] like Figure 5 As shown, the specific implementation process of semantic regularization branches is as follows:
[0089] The global feature map (256x20x20) output from the backbone network is extracted and input into the semantic regularization branch. The multi-label classifier structure is shown below: It receives the feature output from the backbone network as the branch input, first passing through a convolutional layer to reduce the dimensionality of the features, decreasing the number of feature channels from 256 to 64. Then, a global average pooling layer is used to perform global average pooling on the feature map, fixing the spatial size to 1x1, resulting in a global feature vector of size 64×1×1. Finally, the 64×1×1 global feature vector is input into a fully connected layer for linear transformation, outputting... Multi-label category prediction in multiple dimensions This represents the number of categories contained in the target domain data. (Based on multi-label classification prediction) Its true global category label Constructing classification loss .
[0090] Step 4: Set the loss function: The loss function used for model training consists of three parts: object detection loss. Inter-domain feature alignment loss and multi-label classification loss Under this setting, the total loss Can be described as ;in, and This is used to adjust the gradient contribution of each loss to the optimization of the pre-parameters. Set to 1, Set it to 0.1. Figure 1 The right side indicates the functional branches corresponding to each loss.
[0091] Target detection loss Using the mainstream loss function of the YOLO series, the loss is derived from bounding box regression. Classification loss and target confidence loss Composition, the overall form is:
[0092]
[0093] Inter-domain feature alignment loss By adding a domain classifier after the backbone network and combining it with a gradient flipping layer, the goal is to reduce the distribution difference between the source and target domains. The loss is defined as:
[0094]
[0095] in, For domain labels, the source domain is denoted as The target domain is denoted as , The predicted output of the domain classifier.
[0096] Multi-label classification loss Specifically, an adaptive soft-label loss is adopted as the optimization objective to adaptively adjust the gradient contributions of positive and negative samples during training, thereby mitigating the adverse effects of class imbalance. The loss is defined as follows:
[0097]
[0098] in, The actual label of the target instance, Adjust the parameters to reflect the actual prediction results of the classifier. and These are used to control the degree of attention given to difficult positive samples and difficult negative samples, respectively. Used to suppress the contribution of easily classified negative samples to the loss.
[0099] Step 5: Training Parameter Settings: Parameter updates use the SGD (Stochastic Gradient Descent) optimizer. The total number of training epochs is set to 200. The initial learning rate is 0.01, and the OneCycle learning rate scheduling strategy is used to dynamically change the learning rate during training, eventually decaying to approximately 1×10⁻⁻⁻⁶. 4 To suppress overfitting, the weight decay coefficient was set to 5 × 10⁻ 4 Based on this, the four-channel image is used as the model input to formally begin the training process of the domain adaptive model.
[0100] Step 6: Perform model training: Randomly select a quantitative batch of data from the two types of data, and perform forward calculation and backward parameter update respectively.
[0101] Forward computation: Perform forward propagation according to the defined training architecture to obtain data from the labeled source domain. Test results For two types of data Domain classification results and multi-label classification results for targets inside the source domain image The prediction results will then be fed into the pre-set loss function.
[0102] Reverse parameter update: Based on the calculation results of each loss function, the parameters of each module within the model are updated. The formulas for each parameter update are as follows: , , and .
[0103] Step 7, Model Deployment: After training is complete, save the detector model weights. The model is deployed for actual detection. The inter-domain feature alignment branch and semantic regularization branch are solely for assisting detector training; these two branches are discarded during model application or testing.
[0104] To verify the effectiveness of this invention, it was conducted using the open-source framework PyTorch (1.13). The hardware configuration was as follows: Intel i7-10700K CPU, 32GB RAM, and a single NVIDIA RTX3090 (24GB) GPU. The software configuration was: Windows 10 Professional 21H2, CUDA version 11.10, CuDNN version 8.0.4, and Python version 3.9.
[0105] This invention focuses on addressing the impact of domain offset in practical applications, particularly the performance degradation caused by weather and lighting changes in traffic scenarios. Typical cross-domain traffic scenario datasets, Cityscapes (sunny daytime scene) and CityFogscapes (foggy daytime scene), are selected as experimental datasets. The former serves as the labeled source domain, and the latter as the unlabeled target domain, to construct a representative cross-domain detection task.
[0106] The method of this invention is compared with current mainstream domain adaptive object detection algorithms, including the UMT and CMT methods based on the mean teacher model, and the DM method based on image style transfer. The experimental results of each method are shown in Table 1, which presents the detection accuracy (mAP) and overall mAP50 of different methods in each category, so as to comprehensively evaluate the performance advantages of the algorithm of this invention in cross-domain object detection tasks.
[0107] Table 1 shows the performance comparison on the Foggy Cityscapes dataset.
[0108]
[0109] As shown in Table 1, in cross-domain traffic scenarios from daytime to foggy weather, the method of this invention achieves a mAP50 of 51.2% on the Foggy Cityscapes dataset, significantly outperforming various comparative methods. Compared with the latest CMT method based on the mean teacher architecture and achieving cross-domain feature alignment through feature consistency constraints, this invention improves performance by approximately 1 percentage point. The results demonstrate that this invention also exhibits strong robustness and cross-domain detection capability in scenarios with domain shifts caused by weather conditions.
[0110] To further verify the performance of the domain adaptation algorithm of this invention, extended experiments were conducted in real-world to animation scenes where domain differences are more significant. These scenes exhibit obvious style differences and morphological shifts, placing higher demands on the feature generalization ability of the domain adaptation model, which existing methods generally struggle to achieve ideal results in such tasks. The PASCALVOC dataset was selected as the source domain, and the Clipart1k dataset as the target domain in the experiments to evaluate the model's effectiveness in scenarios with significant domain shifts. The experimental results are shown in Table 2.
[0111] Table 2 shows the performance comparison on the Clipart1k dataset.
[0112]
[0113] As shown in Table 2, in the cross-domain detection experiment on the Clipart1k dataset, the present invention achieved a mAP of 54.5%. Compared with the recently proposed CAT method, the detection performance of the present invention is improved by approximately 4 percentage points, achieving higher detection accuracy across multiple categories. The results demonstrate that the present invention maintains stable detection performance even in real-world to animated scenes with significant style differences and morphological shifts.
[0114] In this embodiment, the proposed model is deployed on two typical cross-domain scene images for detection applications. The comparison objects include: a basic detection model, a model with only inter-domain feature alignment branches added, and the complete method of this invention. To facilitate evaluation of the detection performance, the experimental results are accompanied by annotation information for reference, and false positives and false negatives are specifically marked in the results. Figure 6 As shown, the first row displays the detection performance on the foggy dataset, while the second and third rows display the detection performance on the animation dataset. This allows for a direct comparison of the detection performance and error rates of different methods in cross-domain environments.
[0115] The implementation results demonstrate that the method of this invention can significantly reduce false positives and false negatives in various cross-domain scenarios, and the detection results are closer to the actual labeled information. Compared with basic detection models and models that only use inter-domain feature alignment, the complete method of this invention can more accurately identify target instances and maintain stable detection performance in complex backgrounds or environments with significant style differences, thus verifying the effectiveness and superiority of this invention in cross-domain target detection tasks.
[0116] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A cross-domain target detection method based on high-frequency signals and semantic regularization, characterized in that, Includes the following steps: (1) Construct training, testing, and validation sets including source and target domain data; and perform data preprocessing; (2) Extract the features of high-frequency signals from the original RGB image data in the training set and validation set, and perform channel-based splicing on the two types of data to obtain four-channel image data; (3) Construct a cross-domain target detection model training architecture, introduce inter-domain alignment branches and semantic regularization branches to assist in the training of the detection model, so that the parameter values learned by the detection model have domain adaptive detection function; (4) Design a loss function and train a cross-domain target detection model; (5) After training is completed, save the detection model weights and execute the model deployment for actual detection.
2. The cross-domain target detection method based on high-frequency signals and semantic regularization according to claim 1, characterized in that, The implementation process of step (1) is as follows: The source domain is selected from daytime traffic scenarios, and the target domain is selected from foggy traffic scenarios. Both are stored in the algorithm directory in a unified format. The source domain data is provided with corresponding annotation files, while the target domain data is not provided with annotation files. Both the validation and test sets consist of target domain data; the image data in the training and validation sets are normalized and adjusted to a uniform input space size.
3. The cross-domain target detection method based on high-frequency signals and semantic regularization according to claim 1, characterized in that, The implementation process of step (2) is as follows: Choosing the Sobel operator as the spatial gradient filter The gradients are calculated in the horizontal and vertical directions of the input image, respectively, using the following formulas: in, and These represent the gradient convolution kernels in the horizontal and vertical directions, respectively. For the input image After convolution calculation, its high-frequency signal is: in, This represents the convolution operation. This refers to the extracted high-frequency feature map; The obtained high-frequency feature map is then used as the fourth channel of the original RGB image and concatenated with the original image channel by channel to form a new four-channel input; the concatenation process is as follows: in, This refers to the image input data after data refinement.
4. The cross-domain target detection method based on high-frequency signals and semantic regularization according to claim 1, characterized in that, The implementation process of step (3) is as follows: Given a cross-domain object detection model It is divided into backbone networks. and subsequent detection modules ;in These are the parameter sets for the preceding and following modules, respectively; given an input... The entire detection function Decomposed into a three-step forward mapping form ; The training architecture consists of three branches: Main target detection function branch: for labeled source domain data Obtain the model's predicted output. Among them, the test results Used to calculate the detection loss function In order to perform parameter updates; Inter-domain feature alignment branch: for two types of data Get Module After the feature output is obtained, it is fed into the domain classifier. Obtain prediction results for distinguishing domain categories; this branch is expressed as follows: Among them, the domain classification results Used to construct domain classification loss In order to perform parameter updates; Semantic regularization branch: targeting data Get Module After the feature output is obtained, it is fed into a multi-label classifier. This yields prediction results used to distinguish target semantics; this branch is expressed as follows: Among them, the classification results of internal targets Used to construct multi-label classification loss This is to enable parameter updates.
5. The cross-domain target detection method based on high-frequency signals and semantic regularization according to claim 1, characterized in that, The loss function described in step (4) is: in, For target detection loss, For inter-domain feature alignment loss, For multi-label classification loss, and Used to adjust the gradient contribution of various losses to the optimization of pre-parameters.
6. The cross-domain target detection method based on high-frequency signals and semantic regularization according to claim 1, characterized in that, The process of training the cross-domain object detection model in step (4) is as follows: Randomly sample a quantitative batch of data from the training and validation sets, and perform forward computation and backward parameter update respectively; Forward computation: Perform forward propagation according to the defined training architecture to obtain data from the labeled source domain. Test results For two types of data Domain classification results and multi-label classification results for targets inside the source domain image The above prediction results are then fed into the pre-set loss function; Inverse parameter update: Based on the calculation results of each loss function, the parameters of each module within the model are updated; the formulas for updating each parameter are as follows: , , and .
7. The cross-domain target detection method based on high-frequency signals and semantic regularization according to claim 1, characterized in that, The specific implementation process of the inter-domain feature alignment branch is as follows: The features of the source and target domains output by the backbone network are used as input. First, a gradient flipping layer is passed through the layer. This layer does not change the input features during the forward propagation stage, but multiplies the gradient by a scaling factor during the backward propagation to achieve the gradient flipping effect. The features are then input into the domain classifier module. The domain classifier structure is as follows: First, a 1×1 convolutional layer is used to transform and reduce the channel number of the input features from 256 to 128, so as to compress the feature dimension and extract compact domain discrimination information. After the first convolutional layer, a non-linear activation function ReLU is applied to enhance the non-linear expressive power of the features and improve the classification and discrimination effect. Then, a second 1×1 convolutional layer is used to further reduce the dimensionality of the feature channels, reducing the number of channels from 128 to 64, so as to obtain more representative low-dimensional domain features. Then, an adaptive average pooling layer is used to perform global average pooling on the feature map, fixing the spatial size to 1×1, resulting in a global domain feature vector of size 64×1×1. Finally, the 64-dimensional global feature is input into a fully connected layer for linear transformation, outputting a single-dimensional domain classification prediction. , which is used to represent the probability that the input feature belongs to the target domain; Prediction based on domain classification Constructing domain classification loss Optimize the domain classifier to improve classification capabilities; During the backpropagation phase, the gradient is multiplied by a factor when it passes through the initial GRL layer. The scaling factor is then passed to the backbone network, thereby reversing the gradient propagation direction; the specific gradient relationship is expressed by the chain rule as follows: This mechanism causes the backbone network to tend to extract features during training that make it difficult for the domain classifier to distinguish between the source and target domains, thereby achieving alignment of the feature distributions of the source and target domains at the feature level.
8. The cross-domain target detection method based on high-frequency signals and semantic regularization according to claim 1, characterized in that, The specific implementation process of the semantic regularization branch is as follows: The global feature map output from the backbone network is extracted and input into the semantic regularization branch. The multi-label classifier structure is as follows: It receives the feature output from the backbone network as the branch input, first passing through a convolutional layer to reduce the dimensionality of the features, decreasing the number of feature channels from 256 to 64; then, it undergoes global average pooling through an average pooling layer, fixing the spatial size to 1x1, resulting in a global feature vector of size 64×1×1; finally, this 64×1×1 global feature vector is input into a fully connected layer for linear transformation, outputting... Multi-label category prediction in multiple dimensions The number of categories contained in the target domain data; prediction based on multi-label classification. Its true global category label Constructing classification loss .
9. The cross-domain target detection method based on high-frequency signals and semantic regularization according to claim 5, characterized in that, The inter-domain feature alignment loss By adding a domain classifier after the backbone network and combining it with a gradient flipping layer, the goal is to reduce the distribution difference between the source and target domains. The loss is defined as: in, For domain labels, the source domain is denoted as The target domain is denoted as , The predicted output of the domain classifier.
10. The cross-domain target detection method based on high-frequency signals and semantic regularization according to claim 5, characterized in that, The multi-label classification loss Specifically, adaptive soft-label loss is adopted as the optimization objective to adaptively adjust the gradient contributions of positive and negative samples during training, mitigating the adverse effects of class imbalance. The loss is defined as follows: in, The actual label of the target instance, Adjust the parameters to reflect the actual prediction results of the classifier. and These are used to control the degree of attention given to difficult positive samples and difficult negative samples, respectively. Used to suppress the contribution of easily classified negative samples to the loss.
