A device and method for image-level domain adaptive object detection for complex roads

CN123016398APending Publication Date: 2026-10-30HERUN TIANXIA (GUANGZHOU) ARTIFICIAL INTELLIGENCE TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611216769.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-11
Publication Date
2026-10-30

AI Technical Summary

Technical Problem

[0004]目标检测任务高度依赖物体准确的物理轮廓与空间几何特征,而上述常规的图像转换方法通常缺乏对实例结构的严格约束,在跨域生成过程中易导致车辆、行人等关键目标的边缘模糊或内部细节失真,使转换后的图像引入特征噪声,进而限制检测模型在未知复杂道路场景下的检测精度与鲁棒性

Benefits of technology

(1)本申请通过在图像转换生成器的特征转换阶段嵌入空间非局部感知单元,计算输入特征的全局空间相关性并对局部特征进行加权聚合,融合图像全局上下文信息生成类目标域图像,实现了提升全局环境变化场景下的图像渲染连贯性,消除跨域转换过程中局部失真与块状伪影的效果。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123016398A_ABST
    Figure CN123016398A_ABST
Patent Text Reader

Abstract

The application relates to the technical field of computer vision, and provides an image-level domain adaptive target detection device and method for complex roads. The device comprises a data acquisition module, a cross-domain image generation module, a structural feature constraint module, a cross-domain detection joint training module and a target domain inference detection module. The cross-domain image generation module is internally provided with an image conversion generator embedded with a space non-local perception unit and an adversarial discriminator adopting a multi-scale discrimination architecture. A dynamic soft label smoothing strategy is adopted in an adversarial loss calculation process. The structural feature constraint module can extract multi-level semantic feature responses and construct a deep feature perception loss to constrain the target geometric structure before and after image conversion. The application can achieve the purposes of improving target detection accuracy and robustness in complex road scenes and reducing target scene data labeling costs. In addition, the application also provides a method applied to the image-level domain adaptive target detection device for complex roads.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer vision technology, and in particular to an image-level domain adaptive target detection device and method for complex roads. Background Technology

[0002] Object detection, a fundamental task in computer vision, is a crucial prerequisite for environmental perception, obstacle warning, and safety decision-making in systems such as autonomous driving and intelligent transportation. In recent years, deep learning object detection models have performed exceptionally well in ideal scenarios. However, in open road environments, weather changes such as dense fog, rain, and snow, as well as varying lighting conditions like low illumination at night, can cause the visual features of acquired images to deviate from the pre-trained data distribution, leading to domain shift and a decline in model detection performance. To address the domain shift problem while controlling data annotation costs, unsupervised domain adaptive object detection techniques have been widely applied and researched, currently mainly including three technical approaches: feature-level alignment, self-training, and image-level alignment.

[0003] Image-level domain adaptation eliminates the visual appearance differences between source and target domain images at the input, enabling the detector to directly process images with uniform style, thereby avoiding noise interference in the deep feature alignment process. The current common approach to achieving image-level domain adaptation is to introduce a general unpaired image transformation model to synthesize images of the target domain. These image transformation models aim to improve the realism of the overall visual style of the generated images, learning the image style mapping relationships between different domains through adversarial training.

[0004] Object detection tasks rely heavily on the accurate physical contours and spatial geometric features of objects. However, conventional image conversion methods often lack strict constraints on instance structure. During cross-domain generation, they can easily lead to blurred edges or distorted internal details of key targets such as vehicles and pedestrians, introducing feature noise into the converted image. This limits the detection accuracy and robustness of the detection model in unknown and complex road scenarios. Summary of the Invention

[0005] In view of this, this application aims to propose an image-level domain adaptive target detection device and method for complex roads to solve the above-mentioned technical problems.

[0006] To achieve the above objectives, the technical solution of this application is implemented as follows: Firstly, this application proposes an image-level domain adaptive target detection device for complex roads, comprising: The data acquisition module is used to acquire source domain road image sets with real target bounding box labels, and target domain road image sets without labels; A cross-domain image generation module incorporates an image transformation generator and an adversarial discriminator. The image transformation generator's feature transformation stage embeds a spatial non-local perceptual unit (SNP) for calculating the global spatial correlation of input features, weighted aggregation of local features, constraining the target's geometric structure before and after image transformation, and outputting a target-domain image fused with global context information. The adversarial discriminator employs a multi-scale discriminative architecture and uses a dynamic soft-label smoothing strategy during adversarial loss calculation. The cross-domain image generation module is used to construct a joint loss function by weighted summation of deep feature perceptual loss, adversarial loss, and cycle consistency loss, and iteratively trains the image transformation generator and adversarial discriminator based on this joint loss function until convergence, resulting in a trained image transformation generator. The structural feature constraint module is used to extract the multi-level semantic feature responses of the source domain road image and its corresponding target domain generated image in the pre-trained feature extraction network during the training process of the cross-domain image generation module, calculate the absolute error and perceptual distance between the semantic features and perform weighting, construct the deep feature perception loss, and input the deep feature perception loss into the cross-domain image generation module. The cross-domain detection joint training module is used to use the trained image conversion generator to batch convert the source domain road image set into a target domain image set, retaining the corresponding source domain real target bounding box labels; the source domain road image set and the target domain image set are mixed to construct a cross-domain training dataset, and the target detection network is jointly trained using a supervised learning method to obtain a final target detection model with cross-domain adaptability; The target domain inference and detection module is used to input the target domain image of the complex road scene to be detected into the final target detection model and output the detection result containing the target category and location coordinates.

[0007] Furthermore, the spatial nonlocal perception unit is used to linearly project the encoded input feature map into three independent feature subspaces: a query matrix, a key matrix, and a value matrix; the query matrix and the transposed key matrix are operated on and normalized by the Softmax function to obtain a global spatial correlation map used to quantify the correlation between any two spatial pixels; the correlation map and the value matrix are operated on, and the operation result is added to the original features by residual through a learnable scaling parameter to output aggregated features.

[0008] Furthermore, the structural feature constraint module selects a convolutional neural network pre-trained on a large image dataset with frozen network weights as a feature extractor to extract feature maps of the source domain image and its corresponding class target domain image at multiple convolutional layers of a set depth; calculates the norm absolute error for the feature maps at different levels and performs weighted summation to obtain multi-level perceptual loss; and combines the perceptual image patch similarity calculated in the feature channel dimension to jointly constitute the deep feature perceptual loss.

[0009] Furthermore, the multi-scale discriminative architecture includes a discriminative branch for processing the original resolution target domain image and a cascaded branch for processing the downsampled image; the two branches correspond to different receptive field sizes, which are used to guide the image conversion generator to reconstruct local texture details while taking into account the rationality of the global scene layout.

[0010] Furthermore, the dynamic soft label smoothing strategy is implemented as follows: in each training batch, the average of the predicted probabilities of the adversarial discriminator for the real target domain image and the generated image of the class target domain is independently calculated as the confidence level; when the confidence level exceeds a set threshold, the soft label smoothing intensity parameter of the corresponding target is adaptively increased to reduce the absoluteness of the target label; when the confidence level is lower than the set threshold, the soft label smoothing intensity parameter is decreased.

[0011] Secondly, this application proposes a method for the aforementioned image-level domain adaptive target detection device for complex roads, comprising the following steps: S1, Data Acquisition: Acquire a set of source domain road images with labels of real target bounding boxes, and a set of unlabeled target domain road images; S2, construct a cross-domain feature alignment network including an image transformation generator and an adversarial discriminator, and input the source domain road image set and the target domain road image set into the cross-domain feature alignment network; embed a spatial non-local perception module in the feature transformation stage of the image transformation generator, calculate the global spatial correlation of the input features through the spatial non-local perception module, perform weighted aggregation of local features, constrain the target geometric structure before and after image transformation, and output a target domain image fused with global context information; the adversarial discriminator adopts a multi-scale discriminative architecture and uses a dynamic soft label smoothing strategy in the adversarial loss calculation process; S3, calculate the deep feature perception loss. During the training process of the cross-domain feature alignment network, extract the multi-level semantic feature responses of the source domain road image and its corresponding target domain generated image in the pre-trained feature extraction network, calculate the absolute error and perception distance between the semantic features and perform weighting, and construct the deep feature perception loss for constraining the target geometry. S4, Joint optimization training of the network: The deep feature perception loss is weighted and summed with the adversarial loss and cycle consistency loss of the image conversion basis to construct a joint loss function; The cross-domain feature alignment network is iteratively trained using the joint loss function until the network converges to obtain the trained image conversion generator; S5, Cross-domain detection joint training: Using the trained image conversion generator, the source domain road image set is converted into a target domain image set in batches, and the corresponding source domain real target bounding box labels are retained; The source domain road image set and the target domain image set are mixed to construct a cross-domain training dataset, and a supervised learning method is used to jointly train the preset target detection network to obtain a final target detection model with cross-domain adaptability; S6, Target Domain Inference and Detection: Input the target domain image of the complex road scene to be detected into the final target detection model, and output the detection result containing the target category and location coordinates.

[0012] Furthermore, in step S2, the processing flow of the spatial nonlocal sensing module specifically includes: The encoded input feature map is linearly projected into three independent feature subspaces: the query matrix, the key matrix, and the value matrix. The query matrix and the transposed key matrix are multiplied by matrix multiplication and normalized by the Softmax function to obtain a global spatial correlation map for quantifying the correlation between any two spatial pixels. The correlation map and the value matrix are multiplied by matrix multiplication. The result is then added to the original features using a learnable scaling parameter to output aggregated features.

[0013] Furthermore, step S3 specifically includes: A convolutional neural network pre-trained on a large image dataset with frozen network weights was selected as the feature extractor to extract the feature maps of the source domain image and its corresponding class target domain image in multiple convolutional layers of a set depth. The first-norm absolute error is calculated for feature mappings at different levels, and then weighted summation is performed to obtain the multi-level perceptual loss. The deep feature perception loss is formed by combining the similarity of perceived image patches calculated in the feature channel dimension, in order to constrain the physical geometry of traffic targets in a multi-dimensional semantic space.

[0014] Furthermore, in step S4, the original resolution target domain image and the downsampled image are respectively input into cascaded discriminators with different receptive field sizes, guiding the image conversion generator to reconstruct local texture details while taking into account the rationality of the global scene layout.

[0015] Furthermore, in step S4, a dynamic soft-label smoothing strategy is introduced when calculating the adversarial loss, specifically including: In each training batch, the average of the predicted probabilities of the adversarial discriminator for real target domain images and generated images of class target domains is independently calculated as the confidence level. When the confidence level exceeds a set threshold, the soft label smoothing strength parameter of the corresponding target is adaptively increased to reduce the absoluteness of the target label; otherwise, the soft label smoothing strength parameter is decreased.

[0016] Compared with existing technologies, the image-level domain adaptive target detection device and method proposed in this application for complex roads has the following advantages: (1) This application embeds a spatial nonlocal perception unit in the feature conversion stage of the image conversion generator, calculates the global spatial correlation of the input features and performs weighted aggregation of local features, and fuses the global context information of the image to generate a target domain image, thereby improving the image rendering coherence in the scenario of global environmental change and eliminating local distortion and block artifacts in the cross-domain conversion process.

[0017] (2) This application extracts the source domain road image and its corresponding target domain generated image in the pre-trained feature extraction network, calculates the absolute error and perceptual distance between semantic features and weights them to construct a deep feature perception loss, constrains the target geometric structure before and after image conversion, and achieves the effect of avoiding the blurring of target instance edges and internal deformation in cross-domain conversion, and preventing the detection model from learning incorrect semantic noise.

[0018] (3) This application adopts an adversarial discriminator with a multi-scale discriminative architecture and combines it with a dynamic soft label smoothing strategy to carry out adversarial training. It constructs a joint loss function by weighted summation of adversarial loss, cycle consistency loss and deep feature perception loss to complete the iterative training of the image conversion generator. Then, it mixes source domain road image set and target domain image set to jointly train the target detection network, thereby improving the training stability of the image conversion network. It can enhance the detection accuracy and robustness of the detection model in complex road scenarios without the need for manual labeling of the target domain, and can flexibly adapt to the effects of various mainstream detection networks. Attached Figure Description

[0019] The accompanying drawings, which form part of this application, are used to provide a further understanding of this application. The illustrative embodiments and descriptions of this application are used to explain this application and do not constitute an undue limitation of this application. In the drawings: Figure 1 This is a schematic diagram of the image-level domain adaptive target detection device for complex roads as described in an embodiment of this application; Figure 2This is a flowchart illustrating the image-level domain adaptive target detection method for complex roads as described in an embodiment of this application. Figure 3 This is a diagram illustrating the overall architecture of the cross-domain feature alignment network described in the embodiments of this application. Figure 4 This is a data processing flowchart of the spatial nonlocal sensing module described in an embodiment of this application; Figure 5 This is a schematic diagram illustrating the calculation principle of deep feature perception loss as described in the embodiments of this application. Detailed Implementation

[0020] To make the technical solution and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0021] It should be noted that, unless otherwise specified, the embodiments and features described in this application can be combined with each other.

[0022] Furthermore, it should be noted that in the description of this application, if terms such as "upper," "lower," "inner," or "outer" appear, indicating orientation or positional relationship, these are based on the orientation or positional relationship shown in the accompanying drawings and are only for the convenience of describing this application and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation on this application. In addition, if terms such as "first" or "second" appear, they are also used for descriptive purposes only and should not be construed as indicating or implying relative importance.

[0023] Furthermore, in the description of this application, unless otherwise expressly defined, the terms "installation," "connection," "joining," and "connector" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; and they can refer to the internal connection between two components. Those skilled in the art can understand the specific meaning of the above terms in this application in light of the specific circumstances.

[0024] In this application, the terms "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., refer to a specific feature, structure, material, or characteristic described in connection with that embodiment or example, which is included in at least one embodiment or example of this application. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.

[0025] The present application will now be described in detail through exemplary embodiments. However, it should be understood that, without further description, elements, structures, and features in one embodiment may be advantageously incorporated into other embodiments.

[0026] Reference Figure 1 The image-level domain adaptive target detection device for complex roads provided in this embodiment includes a data acquisition module, a cross-domain image generation module, a structural feature constraint module, a cross-domain detection joint training module, and a target domain inference detection module.

[0027] The data acquisition module is used to acquire a set of source domain road images with real target bounding box labels, as well as a set of unlabeled target domain road images, providing a data foundation for subsequent cross-domain alignment and detection training.

[0028] The cross-domain image generation module integrates an image transformation generator and an adversarial discriminator. The image transformation generator is built on a deep residual network and includes a feature encoder, a feature transformation stage, and a feature decoder. The feature transformation stage embeds a spatial nonlocal perceptron to calculate the global spatial correlation of input features, perform weighted aggregation of local features, constrain the target geometry before and after image transformation, and output a target-domain image that incorporates global contextual information. The adversarial discriminator adopts a multi-scale discriminative architecture and employs a dynamic soft label smoothing strategy during adversarial loss calculation.

[0029] The cross-domain image generation module is used to construct a joint loss function by weighted summation of deep feature perception loss, adversarial loss, and cycle consistency loss. Based on the joint loss function, the image conversion generator and adversarial discriminator are iteratively trained until convergence, resulting in a trained image conversion generator.

[0030] The structural feature constraint module is used to extract the multi-level semantic feature responses of the source domain road image and its corresponding target domain generated image in the pre-trained feature extraction network during the training process of the cross-domain image generation module. It calculates the absolute error and perceptual distance between semantic features and weights them to construct a deep feature perception loss, and inputs the deep feature perception loss into the cross-domain image generation module.

[0031] The cross-domain detection joint training module is used to use the trained image conversion generator to batch convert source domain road image sets into target domain image sets. The corresponding source domain real target bounding box labels are retained, and the source domain road image sets and target domain image sets are mixed to construct a cross-domain training dataset. The object detection network is jointly trained using a supervised learning method to obtain a final object detection model with cross-domain adaptability, which can be adapted to various mainstream detection networks.

[0032] The target domain inference and detection module takes the target domain image of the complex road scene to be detected and inputs it into the final target detection model, outputting detection results that include the target category and location coordinates. This overall architecture decouples cross-domain image generation from detector training, enabling model transfer without manual annotation of target domain data, and facilitating deployment.

[0033] To achieve effective aggregation and coherent rendering of global spatial information, the spatial non-local perception unit in this embodiment is configured with a multi-branch projection and weighted aggregation structure. The specific processing flow is as follows: Figure 4 The spatial nonlocal perceptual unit (SNP) first linearly projects the encoded input feature map into three independent feature subspaces: a query matrix, a key matrix, and a value matrix. Then, it performs operations on the query matrix and the transposed key matrix, followed by Softmax normalization to obtain a global spatial correlation map used to quantify the correlation between any two spatial pixels. Subsequently, it performs operations on the correlation map and the value matrix, and adds the result to the original features using a learnable scaling parameter, outputting the aggregated feature. This structure breaks the local field-of-view limitations of traditional convolution. When dealing with global environmental changes such as heavy fog or nighttime, it can combine the contextual information of the entire image for coherent rendering, effectively eliminating common local distortions and blocky artifacts in cross-domain transformations. The computational process here can be described by corresponding mathematical relationships, including convolution operations, instance normalization operations, and output convolution weights. The learnable scaling parameter controls the degree of influence of the global aggregated feature on the original feature, avoiding excessive modification of the semantic information of the original feature and ensuring the stability of the target structure.

[0034] Based on the invention's objective of constraining the target's geometric structure before and after image transformation, in this embodiment, the structural feature constraint module constructs loss constraints using pre-trained feature extraction, and its calculation principle is as follows: Figure 5 The structural feature constraint module uses a convolutional neural network pre-trained on a large image dataset with frozen network weights as the feature extractor. It extracts feature maps of the source domain image and its corresponding target domain image across multiple convolutional layers of a set depth. For each level of feature map, the norm absolute error is calculated and weighted summed to obtain a multi-level perceptual loss. This loss is then combined with the perceptual image patch similarity calculated along the feature channel dimension to form the deep feature perceptual loss. The reason for choosing multi-level features for constraint is that shallow features correspond to the edge texture details of the image, while deep features correspond to the overall semantic structure of the target. Multi-level weighting can simultaneously constrain the target's contour and internal details, avoiding the one-sidedness of a single-level constraint. This loss can lock the physical geometric contour of traffic targets in a multi-dimensional semantic space, preventing edge blurring and internal deformation of target instances during cross-domain transformation, and avoiding subsequent detectors learning incorrect semantic noise.

[0035] To improve the training stability of the image conversion network in high-resolution road scenes, the adversarial discriminator in this embodiment is configured as a multi-scale discriminative architecture, and its overall network architecture refers to... Figure 3 The multi-scale discriminative architecture comprises a discriminative branch that processes the original resolution target domain image, and a cascaded branch that processes the downsampled image. These two branches correspond to different receptive field sizes. The original resolution branch has a smaller receptive field, focusing on capturing local texture details, while the downsampled branch has a larger receptive field, focusing on controlling the global scene layout. Together, these two branches determine the realism of the generated image, guiding the image transformation generator to maintain the rationality of the global scene layout while reconstructing local texture details, thus avoiding problems such as local texture distortion or global structural disorder that occur during high-resolution image training.

[0036] To mitigate the mode collapse problem in adversarial training, this embodiment employs a dynamic soft-label smoothing strategy in the cross-domain image generation module when calculating the adversarial loss. In each training batch, the average predicted probability of the adversarial discriminator for the real target domain image and the generated image of the target-like domain is independently calculated as the confidence level. When the confidence level exceeds a set threshold, the soft-label smoothing strength parameter for the corresponding target is adaptively increased to reduce the absoluteness of the target label; when the confidence level is below the set threshold, the soft-label smoothing strength parameter is decreased. By using a dynamically adjusted smoothing strategy instead of fixed smoothing parameters, the constraint strength can be adaptively adjusted according to the real-time training state of the discriminator. When the discriminator is overconfident, the generalization constraint is strengthened; when the discriminator's discriminative ability is insufficient, the constraint is reduced to ensure training efficiency. This effectively prevents mode collapse in the early stages of adversarial training and improves the convergence speed and stability of network training.

[0037] Example 2 This embodiment also provides an image-level domain adaptive target detection method for complex roads, the process of which is as follows: Figure 2 This includes the following steps.

[0038] The first step is data acquisition, which involves acquiring a set of source domain road images with labels of real target bounding boxes, and a set of unlabeled target domain road images.

[0039] The second step is to construct a cross-domain feature alignment network, which includes an image transformation generator and an adversarial discriminator. The source domain road image set and the target domain road image set are input into the cross-domain feature alignment network. A spatial non-local perception module is embedded in the feature transformation stage of the image transformation generator. The global spatial correlation of the input features is calculated through the spatial non-local perception module, and local features are weighted and aggregated to constrain the target geometric structure before and after image transformation. The output is a target domain image that integrates global context information. The adversarial discriminator adopts a multi-scale discriminative architecture and uses a dynamic soft label smoothing strategy in the adversarial loss calculation process.

[0040] Specifically, in combination Figure 3 and Figure 4 As shown, the image conversion generator is built based on a deep residual network and mainly includes a feature encoder, a feature conversion stage consisting of multiple residual blocks and a spatial nonlocal perception module, and a feature decoder. To eliminate visual artifacts caused by limited local receptive fields, the internal computer processing flow of the spatial nonlocal perception module is as follows: First, the encoded input feature map The linear projection is divided into three independent feature subspaces, each of which is used to construct a query matrix. Key matrix AND-value matrix .

[0041] Secondly, the query matrix With the transposed key matrix Perform matrix multiplication and normalize the results using the Softmax function to obtain the global spatial correlation map. It is used to quantify the correlation between any two spatial pixels.

[0042] Finally, the correlation plot AND-value matrix Perform matrix multiplication and scale the result through a learnable scaling parameter. With original features Perform residual summation and output aggregated features. The calculation formula is as follows:

[0043] In the formula, This indicates a convolution operation, and IN represents instance normalization, which is the output convolution weights. This mechanism allows the network to reference the global context information of the entire road image when rendering global attributes such as fog or nighttime lighting.

[0044] The third step is to calculate the deep feature perception loss. During the training of the cross-domain feature alignment network, the source domain road image and its corresponding target domain generated image are extracted from the multi-level semantic feature responses in the pre-trained feature extraction network. The absolute error and perceptual distance between the semantic features are calculated and weighted to construct the deep feature perception loss used to constrain the geometric structure of the target.

[0045] Specifically, in combination Figure 4 As shown, traditional conversion algorithms often result in blurred outlines of vehicles and pedestrians. Therefore, this embodiment introduces a deep feature perception loss. The specific calculation process is as follows: a convolutional neural network pre-trained on a large image dataset with frozen network weights is selected as the feature extractor to extract features from the source domain images. Its generated class target domain image Feature mappings are performed across multiple convolutional layers of a defined depth. The norm-1 absolute error is calculated for the feature mappings at different levels, and then weighted and summed to obtain the multi-level perceptual loss. :

[0046] In the formula, Indicates the first in the pre-trained network Activation features of the layer These are the preset weight parameters for the corresponding level. This loss, together with the perceptual image patch similarity calculated in the feature channel dimension, constitutes the deep feature perceptual loss, which constrains the physical geometric structure of traffic targets in a multi-dimensional semantic space.

[0047] The fourth step is joint optimization training of the network. The deep feature perception loss is weighted and summed with the adversarial loss and cycle consistency loss based on image conversion to construct a joint loss function. The cross-domain feature alignment network is iteratively trained using the joint loss function until the network converges, and the trained image conversion generator is obtained.

[0048] The fifth step is cross-domain joint training for detection. Using the trained image conversion generator, the source domain road image set is converted into a batch of target domain image sets. The corresponding source domain real target bounding box labels are used to construct a cross-domain training dataset by mixing the source domain road image set and the target domain image set. The preset target detection network is jointly trained using supervised learning to obtain a final target detection model with cross-domain adaptability.

[0049] The sixth step is target domain inference and detection, which involves inputting the target domain image of the complex road scene to be detected into the final target detection model and outputting the detection results containing the target category and location coordinates.

[0050] To achieve effective aggregation of global contextual information, the spatial non-local perception module in this embodiment employs a multi-stage processing approach. First, the encoded input feature map is linearly projected into three independent feature subspaces: a query matrix, a key matrix, and a value matrix. Then, the query matrix is ​​multiplied by the transposed key matrix, and normalized using the Softmax function to obtain a global spatial correlation map used to quantify the correlation between any two spatial pixels. Finally, the correlation map is multiplied by the value matrix, and the result is added to the original features using a learnable scaling parameter to output the aggregated features. This process establishes the association between any pixels in the image, ensuring that global environmental features are uniformly applied across the entire image and avoiding inconsistent rendering in local areas.

[0051] Based on the invention's objective of effectively constraining the target's geometric structure, this embodiment divides the calculation process of deep feature perception loss into two stages: multi-level feature extraction and multi-dimensional loss fusion. First, a convolutional neural network pre-trained on a large image dataset with frozen network weights is selected as the feature extractor. Feature maps of the source domain image and its corresponding target domain image are extracted from multiple convolutional layers of a set depth. Then, the norm absolute error is calculated for the feature maps at different levels, and a weighted sum is obtained to obtain the multi-level perception loss. Finally, this is combined with the perceptual image patch similarity calculated in the feature channel dimension to constitute the deep feature perception loss, thereby constraining the physical geometric structure of the traffic target in a multi-dimensional semantic space. The use of multi-dimensional loss fusion can simultaneously constrain feature consistency from both spatial location and feature channel dimensions, further improving the fidelity of the target structure.

[0052] To improve the training stability of high-resolution road images, the adversarial discriminator in this embodiment employs a multi-scale discriminative architecture for training. The original resolution target domain image and the downsampled image are input into cascaded discriminators with different receptive field sizes. The discriminators at different scales output their respective scale-specific discrimination results, which collectively participate in the calculation of the adversarial loss. This guides the image transformation generator to maintain the rationality of the global scene layout while reconstructing local texture details. The multi-scale discrimination mechanism can simultaneously cover both image details and global features, avoiding discrimination bias caused by the receptive field limitations of a single adversarial discriminator.

[0053] To improve the convergence stability of adversarial training, this embodiment introduces a dynamic soft-label smoothing strategy for calculating the adversarial loss. In each training batch, the average predicted probability of the adversarial discriminator for the real target domain image and the generated image of the target class domain is independently calculated as the confidence level. When the confidence level exceeds a set threshold, the soft-label smoothing intensity parameter for the corresponding target is adaptively increased to reduce the absoluteness of the target label; conversely, the soft-label smoothing intensity parameter is decreased. This strategy can dynamically adjust the smoothness of the labels according to the training progress, avoiding the problem of insufficient adaptability of fixed smoothing parameters at different training stages, and ensuring the smooth progress of adversarial training.

[0054] Specifically, in each training batch, the expected value (i.e., confidence level) of the adversarial discriminator's output probability for both the real target domain image and the class target domain image is calculated. An adversarial balance threshold is set; when the discriminator's confidence level for the real image exceeds this threshold, it indicates that the discriminator has an overconfidence tendency. In this case, the computer program adaptively increases the smoothing intensity parameter of the real label. absolute tags Smoothing This forces the discriminator to improve its generalization ability; conversely, it reduces the smoothing parameter. This strategy effectively prevents pattern collapse in the early stages of adversarial training.

[0055] The above descriptions are merely some embodiments of this application and are not intended to limit this application. The technical features or structures in the foregoing different embodiments can be arbitrarily combined to form other specific technical solutions as needed. For those skilled in the art, this application can have various modifications and variations. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of protection of the claims of this application.

Claims

1. An image-level domain adaptive target detection device for complex roads, characterized in that, include: The data acquisition module is used to acquire source domain road image sets with real target bounding box labels, and target domain road image sets without labels; A cross-domain image generation module incorporates an image transformation generator and an adversarial discriminator. The image transformation generator's feature transformation stage embeds a spatial non-local perceptual unit (SNP) for calculating the global spatial correlation of input features, weighted aggregation of local features, constraining the target's geometric structure before and after image transformation, and outputting a target-domain image fused with global context information. The adversarial discriminator employs a multi-scale discriminative architecture and uses a dynamic soft-label smoothing strategy during adversarial loss calculation. The cross-domain image generation module is used to construct a joint loss function by weighted summation of deep feature perceptual loss, adversarial loss, and cycle consistency loss, and iteratively trains the image transformation generator and adversarial discriminator based on this joint loss function until convergence, resulting in a trained image transformation generator. The structural feature constraint module is used to extract the multi-level semantic feature responses of the source domain road image and its corresponding target domain generated image in the pre-trained feature extraction network during the training process of the cross-domain image generation module, calculate the absolute error and perceptual distance between the semantic features and perform weighting, construct the deep feature perception loss, and input the deep feature perception loss into the cross-domain image generation module. The cross-domain detection joint training module is used to use the trained image conversion generator to batch convert the source domain road image set into a target domain image set, retaining the corresponding source domain real target bounding box labels; the source domain road image set and the target domain image set are mixed to construct a cross-domain training dataset, and the target detection network is jointly trained using a supervised learning method to obtain a final target detection model with cross-domain adaptability; The target domain inference and detection module is used to input the target domain image of the complex road scene to be detected into the final target detection model and output the detection result containing the target category and location coordinates.

2. The image-level domain adaptive target detection device for complex roads according to claim 1, characterized in that, The spatial nonlocal sensing unit is used to linearly project the encoded input feature map into three independent feature subspaces: a query matrix, a key matrix, and a value matrix. The query matrix and the transposed key matrix are operated on and normalized by the Softmax function to obtain a global spatial correlation map for quantifying the correlation between any two spatial pixels. The correlation map is then operated on with the value matrix, and the result is added to the original features using a learnable scaling parameter to output aggregated features.

3. The image-level domain adaptive target detection device for complex roads according to claim 1, characterized in that, The structural feature constraint module uses a convolutional neural network pre-trained on a large image dataset with frozen network weights as a feature extractor to extract feature maps of the source domain image and its corresponding class target domain image at multiple convolutional layers of a set depth. The first-norm absolute error is calculated for the feature maps at different levels and then weighted and summed to obtain a multi-level perceptual loss. Combined with the perceptual image patch similarity calculated in the feature channel dimension, the deep feature perceptual loss is formed.

4. The image-level domain adaptive target detection device for complex roads according to claim 1, characterized in that, The multi-scale discriminative architecture includes a discriminative branch for processing the original resolution target domain image and a cascaded branch for processing the downsampled image; the two branches correspond to different receptive field sizes, which are used to guide the image conversion generator to reconstruct local texture details while taking into account the rationality of the global scene layout.

5. The image-level domain adaptive target detection device for complex roads according to claim 1, characterized in that, The dynamic soft label smoothing strategy is implemented as follows: in each training batch, the average probability of the adversarial discriminator predicting the real target domain image and the generated image of the target domain is independently calculated as the confidence level; when the confidence level exceeds a set threshold, the soft label smoothing intensity parameter of the corresponding target is adaptively increased to reduce the absoluteness of the target label; when the confidence level is lower than the set threshold, the soft label smoothing intensity parameter is decreased.

6. An image-level domain adaptive target detection method for complex roads, applied to the image-level domain adaptive target detection device for complex roads as described in any one of claims 1-5, characterized in that, Includes the following steps: S1, Data Acquisition: Acquire a set of source domain road images with labels of real target bounding boxes, and a set of unlabeled target domain road images; S2, construct a cross-domain feature alignment network including an image transformation generator and an adversarial discriminator, and input the source domain road image set and the target domain road image set into the cross-domain feature alignment network; embed a spatial non-local perception module in the feature transformation stage of the image transformation generator, calculate the global spatial correlation of the input features through the spatial non-local perception module, perform weighted aggregation of local features, constrain the target geometric structure before and after image transformation, and output a target domain image fused with global context information; the adversarial discriminator adopts a multi-scale discriminative architecture and uses a dynamic soft label smoothing strategy in the adversarial loss calculation process; S3, calculate the deep feature perception loss. During the training process of the cross-domain feature alignment network, extract the multi-level semantic feature responses of the source domain road image and its corresponding target domain generated image in the pre-trained feature extraction network, calculate the absolute error and perception distance between the semantic features and perform weighting, and construct the deep feature perception loss for constraining the target geometry. S4, Joint optimization training of the network: The deep feature perception loss is weighted and summed with the adversarial loss and cycle consistency loss of the image conversion basis to construct a joint loss function; The cross-domain feature alignment network is iteratively trained using the joint loss function until the network converges to obtain the trained image conversion generator; S5, Cross-domain detection joint training: Using the trained image conversion generator, the source domain road image set is converted into a target domain image set in batches, and the corresponding source domain real target bounding box labels are retained; The source domain road image set and the target domain image set are mixed to construct a cross-domain training dataset, and a supervised learning method is used to jointly train the preset target detection network to obtain a final target detection model with cross-domain adaptability; S6, Target Domain Inference and Detection: Input the target domain image of the complex road scene to be detected into the final target detection model, and output the detection result containing the target category and location coordinates.

7. The image-level domain adaptive target detection method for complex roads according to claim 6, characterized in that, In step S2, the processing flow of the spatial non-local sensing module specifically includes: The encoded input feature map is linearly projected into three independent feature subspaces: the query matrix, the key matrix, and the value matrix. The query matrix and the transposed key matrix are multiplied by matrix multiplication and normalized by the Softmax function to obtain a global spatial correlation map for quantifying the correlation between any two spatial pixels. The correlation map and the value matrix are multiplied by matrix multiplication. The result is then added to the original features using a learnable scaling parameter to output aggregated features.

8. The image-level domain adaptive target detection method for complex roads according to claim 6, characterized in that, Step S3 specifically includes: A convolutional neural network pre-trained on a large image dataset with frozen network weights was selected as the feature extractor to extract the feature maps of the source domain image and its corresponding class target domain image in multiple convolutional layers of a set depth. The first-norm absolute error is calculated for feature mappings at different levels, and then weighted summation is performed to obtain the multi-level perceptual loss. The deep feature perception loss is formed by combining the similarity of perceived image patches calculated in the feature channel dimension, in order to constrain the physical geometry of traffic targets in a multi-dimensional semantic space.

9. The image-level domain adaptive target detection method for complex roads according to claim 6, characterized in that, In step S4, the original resolution target domain image and the downsampled image are respectively input into cascaded discriminators with different receptive field sizes, guiding the image conversion generator to reconstruct local texture details while taking into account the rationality of the global scene layout.

10. The image-level domain adaptive target detection method for complex roads according to claim 6, characterized in that, In step S4, a dynamic soft-label smoothing strategy is introduced when calculating the adversarial loss, specifically including: In each training batch, the average of the predicted probabilities of the adversarial discriminator for real target domain images and generated images of class target domains is independently calculated as the confidence level. When the confidence level exceeds a set threshold, the soft label smoothing strength parameter of the corresponding target is adaptively increased to reduce the absoluteness of the target label; otherwise, the soft label smoothing strength parameter is decreased.