Feature reconstruction-based traffic video cross-domain target detection method, system, device and medium
By introducing a feature reconstruction mechanism into the teacher-student object detection framework, the problems of pseudo-label noise accumulation and semantic drift in intelligent traffic video surveillance are solved, achieving stable object detection in complex traffic scenarios, reducing adaptation costs, and improving the robustness and detection accuracy of the model.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- GUANGDONG UNIV OF TECH
- Filing Date
- 2026-02-12
- Publication Date
- 2026-07-03
AI Technical Summary
Existing unsupervised cross-domain target detection methods in intelligent traffic video surveillance suffer from problems such as pseudo-label noise accumulation, semantic feature drift, unsatisfactory detection of small targets, and high-cost annotation, making it difficult to maintain stability and applicability in complex traffic scenarios.
In the teacher-student object detection framework, a feature reconstruction mechanism is introduced. Through the semantic feature reconstruction module (SAB) and the instance feature reconstruction module (IMB), prediction-reconstruction constraints are implemented in the backbone semantic feature layer and the instance feature layer, respectively, forming a dual-path stabilization mechanism of pseudo-label supervision and feature level, reducing the impact of pseudo-label noise and stabilizing cross-domain feature representation.
It improves the stability and applicability of target detection, reduces the cost of adapting to traffic scenarios, enhances the detection performance of the model in complex environments, reduces false detections and false negatives, and is suitable for the long-term stable operation of intelligent transportation systems.
Smart Images

Figure CN121686385B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of video detection technology, specifically to a method, system, device, and medium for cross-domain target detection in traffic videos based on feature reconstruction. Background Technology
[0002] Intelligent traffic video surveillance systems are an important infrastructure for smart cities and traffic management. They are widely used in scenarios such as road operation monitoring, traffic flow statistics, violation identification, and traffic safety early warning. These systems typically use road surveillance cameras to continuously collect road scene images or video data and use target detection algorithms to automatically identify and locate traffic targets such as vehicles, pedestrians, and non-motorized vehicles, thereby providing data support for subsequent traffic management and decision-making.
[0003] In practical engineering applications, object detection models are typically trained on a large amount of manually labeled road image data and deployed in real-world road monitoring environments. However, intelligent transportation scenarios are highly complex and dynamically changing. Different roads, cities, and monitoring devices exhibit significant differences in imaging conditions, shooting angles, resolutions, and lighting conditions. Furthermore, the road environment is also affected by weather changes (such as fog, rain, and low nighttime illumination) and seasonal variations, leading to a significant difference between the data distribution used in the model training phase and the data distribution in the actual deployment environment—a phenomenon known as "domain offset."
[0004] When the domain offset is significant, the detection performance of the target domain road monitoring scenario trained based on the source domain labeled data will significantly decrease, specifically manifested as an increased false detection rate, more missed detections, and inaccurate detection box localization. To address these issues, engineering practice typically requires the re-collection and manual labeling of large amounts of target domain data for new road environments or new camera equipment in order to retrain or fine-tune the detection model. However, road monitoring video data is massive in scale, manual labeling is costly and time-consuming, and it is difficult to implement frequently during the long-term operation of the traffic system, severely restricting the deployment efficiency and maintenance costs of intelligent transportation systems.
[0005] To address the aforementioned issues, unsupervised cross-domain object detection techniques have been proposed in recent years. These techniques typically utilize jointly trained data from the source domain and unlabeled data from the target domain to reduce reliance on manual annotation of the target domain. Among these, unsupervised cross-domain object detection methods based on teacher-student or mean-teacher architectures are common in intelligent transportation research. These methods construct teacher and student models, with the teacher model generating pseudo-labels on unlabeled data from the target domain. These pseudo-labels are then used to train the student model, thereby achieving adaptive model distribution towards the target domain.
[0006] However, existing unsupervised cross-domain target detection methods based on teacher-student or average teacher ratios still have significant shortcomings in practical applications of intelligent traffic video surveillance, mainly in the following aspects:
[0007] (1) In foggy, nighttime or low-resolution road monitoring scenarios, the pseudo-labels generated by the teacher model often have problems such as missed detection, false detection and positioning deviation. After the student model is updated under the supervision of the noise pseudo-label, it affects the teacher model in reverse through the parameter smoothing mechanism, which causes the error information to accumulate continuously in the model iteration process, making it difficult to meet the requirements of the road monitoring system for long-term stable operation.
[0008] (2) The mean teacher method usually smooths the model parameters through exponential moving average, but this mechanism mainly acts on the model parameter level and cannot directly constrain the semantic consistency of intermediate feature representations under different road environments and weather conditions. In intelligent transportation scenarios, when there is fog, insufficient light at night, or changes in camera perspective, intermediate semantic features are prone to drift, which in turn affects the reliability of the detection results.
[0009] (3) In road monitoring scenarios, vehicles and pedestrians often appear at long distances and in small sizes, and the appearance of the targets is highly similar. Existing unsupervised cross-domain detection methods mostly focus on the consistency constraints of global features or detection output layers, but lack stable and fine-grained constraint mechanisms for the features of detection instance layers, resulting in unsatisfactory detection performance for small and dense targets in complex traffic scenarios.
[0010] (4) When faced with changes in road environment, equipment conditions or weather, existing technologies still require high-quality pseudo-labels or additional manual intervention, making it difficult to achieve continuous adaptation and stable operation of the model without increasing labeling costs. Summary of the Invention
[0011] The purpose of this invention is to overcome the above-mentioned problems and provide a method, system, device and medium for cross-domain target detection in traffic videos based on feature reconstruction. By introducing a feature reconstruction mechanism into the teacher-student target detection framework, the impact of accumulated pseudo-label noise is reduced and the cross-domain feature representation is stabilized, thereby improving the stability and applicability of target detection in road monitoring scenarios.
[0012] The objective of this invention is achieved through the following technical solution:
[0013] A cross-domain target detection method for traffic videos based on feature reconstruction includes the following steps:
[0014] (1) Construct student and teacher models based on the same target detection network structure;
[0015] (2) Acquire labeled image data of source domain road traffic scene on the training side, input source domain images into student model, calculate source domain detection loss based on real labels, the detection loss includes target classification loss and bounding box regression loss, to ensure that the model has basic traffic target detection capability;
[0016] (3) Extract image frames from the video stream collected by the road monitoring camera on the target domain side to form unlabeled data of the target domain; input the target domain image into the teacher model to generate target domain pseudo-labels; input the target domain image and its corresponding pseudo-labels into the student model, calculate the target domain pseudo-label detection loss, and use it to guide the student model to adapt to the target domain road scene distribution;
[0017] (4) A semantic feature reconstruction module is set between the target detection backbone network and the detection head to perform prediction-reconstruction constraints on the intermediate semantic features of the teacher model and the student model on the road samples in the target domain, so as to stabilize the semantic representation of the road scene in the cross-domain training process;
[0018] (5) Set up an instance feature reconstruction module in the instance feature layer or the output end of the detection head of the detection network to perform prediction-reconstruction constraints on the detection instance features of the teacher model and the student model on the road samples in the target domain;
[0019] (6) The source domain detection loss, target domain pseudo-label detection loss, semantic feature reconstruction loss and instance feature reconstruction loss are weighted and summed to form the overall training objective function; the student model parameters are updated through backpropagation and the teacher model parameters are updated through EMA until the model converges;
[0020] (7) After training, the model is deployed to the edge computing device or server of the intelligent traffic video surveillance system to perform online inference on the road video stream and output the detection results. When the camera equipment is replaced or the road environment changes over a long period of time, the unlabeled data of the target domain can be collected periodically and steps (3)-(6) can be repeated to achieve continuous adaptation.
[0021] In a preferred embodiment of the present invention, step (4) includes the following operations:
[0022] Multi-scale semantic feature extraction and channel alignment: Semantic feature maps output from the first scale layer are obtained from the backbone networks of the teacher model and the student model, respectively, where the teacher-side features are denoted as... Student-related characteristics are denoted as The channel projection unit maps multi-scale features to the same channel dimension. The 1×1 convolution operator is used to uniformly map features from different scale layers to the same channel dimension.
[0023] Spatial resolution alignment: based on a preset baseline spatial resolution. H × WTo achieve this, the spatial size of the multi-scale feature map after channel alignment is adjusted, and interpolation operators are used to upsample or downsample the feature map so that features of different scales are aligned in spatial position, thereby obtaining spatially aligned multi-scale semantic features.
[0024] Multi-receptive-field semantic modeling and feature fusion: Spatially aligned multi-scale semantic features are input into a multi-branch semantic modeling unit. Each branch uses convolution operators with different receptive fields to extract contextual semantic information of different ranges. The features output by each branch are concatenated in the channel dimension and fused through a linear mapping unit to generate a unified semantic feature representation for subsequent reconstruction constraints.
[0025] Based on the consistency constraint of prediction-reconstruction: the teacher model receives the target domain road image after weak data augmentation and outputs the teacher-side semantic feature representation; the student model receives the corresponding strong data augmentation image and outputs the student-side semantic feature representation; the student-side semantic features are mapped by the prediction mapping unit so that they are in the same feature space as the teacher-side semantic features, and the teacher-side semantic features are used as the reconstruction target. The reconstruction error between the student-side predicted features and the teacher-side target features is calculated, and a semantic feature reconstruction loss function is constructed.
[0026] Furthermore, the semantic feature reconstruction loss is used to constrain the update of student model parameters, while the teacher model parameters do not participate in the backpropagation update of this loss.
[0027] In a preferred embodiment of the present invention, step (5) includes the following operations:
[0028] Instance-level feature extraction and embedding mapping: Instance feature vectors for corresponding detected instances are extracted from the detection networks of the teacher and student models, respectively, where the teacher-side instance features are denoted as... h t Student-side instance features are denoted as h s The instance features are derived from the candidate region feature layer inside the detection head or the instance feature representation at the output end of the detection head; the instance features on the teacher side and the student side are linearly projected through the instance feature mapping unit so that the two are mapped to the embedding feature space of the same dimension.
[0029] Student instance feature prediction and channel grouping: An instance feature prediction unit is set in the student model branch to perform nonlinear prediction transformation on the mapped student instance features to generate student-side predicted instance features; the teacher-side instance features and student-side predicted instance features are divided into a preset number of channel subgroups along the channel dimension, and each channel subgroup corresponds to a sub-representation in the instance feature space.
[0030] Instance reconstruction constraints based on channel grouping: For each channel subgroup, the similarity error between the predicted instance features on the student side and the target instance features on the teacher side is calculated, and the instance feature reconstruction loss function is constructed using the cosine similarity metric. The reconstruction errors of all channel subgroups are summed to obtain the instance feature reconstruction loss, which is used to constrain the instance feature prediction results of the student model on the road samples in the target domain to be consistent with the output of the teacher model.
[0031] Furthermore, the instance feature reconstruction loss only participates in the backpropagation update of the student model parameters, while the instance features output by the teacher model serve as stable reconstruction targets and do not participate in the gradient update of this loss.
[0032] A cross-domain target detection system for traffic videos based on feature reconstruction includes:
[0033] The road video acquisition module is used to acquire traffic scene video streams through road monitoring cameras and extract image frames as unlabeled data for the target domain.
[0034] The data storage and management module is used to store labeled data in the source domain, unlabeled data in the target domain, pseudo-labels, and model parameter files.
[0035] The student detection module is used to extract features and predict targets from the input image, and to update the model parameters through backpropagation during the training phase.
[0036] The teacher detection module has the same network structure as the student detection module. It is used to generate pseudo-labels in the target domain and provide a reference representation for feature reconstruction. Its parameters are obtained by updating the parameters of the student detection module using EMA.
[0037] The semantic feature reconstruction module (SAB) is deployed between the backbone network and the detection head, and includes at least: a channel projection unit, a spatial alignment unit, a multi-branch semantic modeling unit, and a feature fusion unit, which are used to perform alignment and reconstruction constraints on multi-scale semantic features.
[0038] The instance feature reconstruction module (IMB) is connected to the instance feature layer or the output of the detection head of the detection network. It includes at least: an instance feature extraction unit, a linear projection unit, an instance prediction unit, and a channel grouping and loss calculation unit, which are used to perform fine-grained reconstruction constraints on the detected instance features.
[0039] The loss calculation and model update module is used to comprehensively calculate the source domain detection loss, target domain pseudo-label detection loss, semantic reconstruction loss and instance reconstruction loss, and to complete the EMA smoothing update of student model parameters and teacher model parameters.
[0040] The inference deployment module is used to deploy the trained model to edge computing devices or servers to perform online detection of road video streams and output the detection results.
[0041] An electronic device includes a central processing unit and a memory, characterized in that the central processing unit is used to invoke and run a computer program stored in the memory to perform the steps of the feature reconstruction-based traffic video cross-domain target detection method.
[0042] A computer-readable storage medium is characterized in that it stores, in the form of computer-readable instructions, a computer program implemented according to a feature-reconstructed traffic video cross-domain target detection method, which, when called by a computer, executes the steps included in the corresponding method.
[0043] Compared with the prior art, the present invention has the following advantages:
[0044] 1. From the perspective of structural features and functional relationships, this invention forms a dual-path stabilization mechanism of "pseudo-label supervision + feature reconstruction constraints". Based on the teacher-student target detection framework, this invention, in addition to retaining pseudo-label detection supervision in the target domain, further sets up a semantic feature reconstruction module (SAB) and an instance feature reconstruction module (IMB). Prediction-reconstruction constraints are introduced into the backbone semantic feature layer and the instance feature layer, respectively. This makes model training no longer solely dependent on the quality of pseudo-labels in the detection output layer, but rather forms an auxiliary supervision path parallel to pseudo-labels through stabilization constraints at the feature level. Structurally, this reduces the impact of pseudo-label noise on model parameter updates, making it more suitable for long-term operation scenarios of intelligent transportation systems.
[0045] 2. From a theoretical perspective, directly constraining cross-domain intermediate feature representations suppresses semantic drift and instance degradation in traffic scenarios. This invention establishes a prediction-reconstruction relationship between teacher and student features in the feature space: SAB implements alignment and reconstruction constraints on multi-scale semantic features between the backbone and the detection head, which helps stabilize the global semantic representation of the road scene; IMB implements fine-grained reconstruction constraints on detected instances at the instance feature layer, which helps maintain the discriminative structure of instance features and reduces the risk of representation degradation for small targets, distant targets, and dense traffic targets. Therefore, this invention can alleviate the cross-domain training instability problem caused by "pseudo-label noise loop" from a mechanistic perspective.
[0046] 3. From an engineering perspective, this invention reduces the cost of adapting to traffic scenarios and improves the robustness of cross-device / cross-weather deployment. It eliminates the need for manual annotation of road monitoring data in the target domain, enabling cross-domain adaptation training using unlabeled video frames from the target domain. This significantly reduces the maintenance and adaptation costs of intelligent transportation systems when changing camera models, adjusting installation angles, relocating across intersections, or encountering weather / lighting changes. Simultaneously, feature reconstruction constraints provide stable training anchors for the model, making its detection output more stable in complex road environments and reducing business risks caused by false positives and false negatives.
[0047] 4. Experimental results demonstrate the effectiveness and stability of this invention on a typical traffic scenario cross-domain target detection benchmark. Under cross-domain data conditions involving differences in imaging between sunny and foggy days in simulated traffic scenarios such as Cityscapes→Foggy Cityscapes, compared to teacher-student cross-domain target detection schemes without feature reconstruction constraints, this invention achieves significant improvements in detection performance stability and training convergence. Experimental results show that introducing semantic feature reconstruction and instance feature reconstruction mechanisms at the feature level can effectively alleviate the problems of feature distribution shift and pseudo-label noise accumulation caused by weather changes in traffic scenarios, thereby improving the robustness of the model in complex road monitoring environments. The above experimental conclusions are highly consistent with common cross-weather and cross-imaging condition domain shifts in intelligent traffic video surveillance systems, further verifying the applicability and engineering value of this invention in practical traffic monitoring applications.
[0048] 5. The invention can be combined with two-stage or single-stage target detection networks. The semantic feature reconstruction module and the instance feature reconstruction module can be integrated into the existing training process as pluggable modules. Training can be completed in the cloud / server, and inference can be deployed on edge computing devices or servers to realize cloud-edge collaborative road monitoring target detection. It has strong engineering feasibility and promotion value. Attached Figure Description
[0049] Figure 1 This is a flowchart of the cross-domain target detection method for traffic videos based on feature reconstruction according to the present invention.
[0050] Figure 2 This is a schematic diagram of the semantic feature reconstruction module SAB of the present invention.
[0051] Figure 3 This is a schematic diagram of the IMB, an example feature reconstruction module of the present invention.
[0052] Figure 4 This is a schematic diagram of the traffic video cross-domain target detection system based on feature reconstruction according to the present invention. Detailed Implementation
[0053] To enable those skilled in the art to fully understand the technical solutions of the present invention, the present invention will be further described below in conjunction with embodiments and accompanying drawings, but the embodiments of the present invention are not limited thereto.
[0054] Combination Figure 1 The feature-reconstruction-based cross-domain target detection method for traffic videos in this embodiment includes the following steps:
[0055] First, the input image is simultaneously fed into the Teacher Backbone and the Student Backbone for feature extraction. The parameters of the Teacher Backbone are updated by the parameters of the Student Backbone through the exponential moving average (EMA) method, and the parameters of the Student Backbone are updated through backpropagation.
[0056] On the training side, labeled image data of the source domain road traffic scene is acquired, the source domain images are input into the student model, and the source domain detection loss is calculated based on the real labels.
[0057] The teacher model backbone network and the student model backbone network each output intermediate feature representations at multiple scales, specifically including multi-layer features such as C3, C4, and C5. These multi-scale features are concatenated in their respective branches and then fed into the feature fusion unit to obtain a unified semantic feature representation.
[0058] The fused semantic features are input into the semantic feature reconstruction module SAB. By constructing a semantic-level reconstruction loss based on the prediction-reconstruction constraints between the semantic features of the teacher branch and the student branch, it is used to stabilize the intermediate semantic representation under cross-domain conditions.
[0059] Meanwhile, the Teacher Head and Student Head respectively perform target detection prediction on the features output by the backbone network. The detection results output by the Teacher Head are used to generate pseudo-labels for the target domain, and pseudo-label supervision is applied to the Student Head through the pseudo-label path, forming a pseudo-label detection loss.
[0060] The instance-level features output by the teacher model detection head and the student model detection head are further input into the instance feature reconstruction module IMB, which performs prediction-reconstruction constraints on the detection instance features of the teacher branch and the student branch at the instance level, and constructs the instance-level reconstruction loss.
[0061] Finally, the source domain detection loss, pseudo-label detection loss, semantic feature reconstruction loss, and instance feature reconstruction loss are weighted and summed to form the overall training objective function. The student model parameters are updated through backpropagation, and the teacher model parameters are updated synchronously through the EMA mechanism, thereby achieving stable training of the unsupervised cross-domain object detection model.
[0062] Combination Figure 2 The semantic feature reconstruction module SAB takes the semantic feature maps output by the teacher model and the student model in the backbone network stage as input, and constructs teacher branches and student branches respectively, which are used to apply prediction-reconstruction constraints to cross-domain semantic representations at the feature level.
[0063] In the teacher branch, the teacher semantic feature map is transformed and mapped through a 3×3 convolution operator (Conv3×3) and a 1×1 convolution operator (Conv1×1) in sequence. Then, the non-linear expressive power is introduced through the ReLU activation function, and another 1×1 convolution operator is used to generate the teacher-side target semantic feature representation. This feature serves as a stable reference target in the reconstruction constraint and does not participate in the backward gradient update.
[0064] In the student branch, the student semantic feature map is also sequentially processed by a 3×3 convolution operator, a 1×1 convolution operator, and a ReLU activation function for feature mapping and nonlinear transformation. Then, the first layer of 1×1 convolution operator generates the student-side semantic representation, and further constructs a prediction mapping unit through an additional 1×1 convolution operator to output the student-side predicted semantic features.
[0065] The target semantic features output by the teacher branch and the predicted semantic features output by the student branch are aligned in the feature space, and the difference between them is calculated using a reconstruction loss function to form the semantic feature reconstruction loss. This semantic feature reconstruction loss is only used to update the student model parameters, while the teacher model parameters are updated using an exponential moving average, thereby stabilizing the intermediate semantic feature representation during cross-domain training.
[0066] Combination Figure 3 The instance feature reconstruction module IMB takes the instance-level features output by the teacher model and the student model in the detection head stage as input, and constructs teacher branches and student branches respectively, which are used to apply prediction-reconstruction constraints to cross-domain instance representations at the instance detection level.
[0067] In the teacher branch, the instance features output by the teacher detection head are first channel-mapped using a 1×1 convolution operator (Conv1×1), then non-linearly transformed using a ReLU activation function, and finally generated as teacher-side instance embedding features using another 1×1 convolution operator. These instance embedding features are divided into a predetermined number of G channel subgroups along the channel dimension, as follows: Each channel subgroup corresponds to a sub-representation in the instance feature space. The grouped instance features output by the teacher branch serve as a stable reconstruction target and do not participate in the backward gradient update.
[0068] In the student branch, the instance features output by the student detection head are also sequentially processed through a 1×1 convolution operator, a ReLU activation function, and another 1×1 convolution operator to obtain the student-side instance embedding features. Subsequently, the student-side instance embedding features are divided into G channel subgroups along the channel dimension, the same number as in the teacher branch, as shown below: The grouped instance features are used to perform group-by-group matching with the corresponding teacher-side instance feature subgroups.
[0069] For each channel subgroup, the reconstruction error between the student-side group instance features and the corresponding teacher-side group instance features is calculated separately. The reconstruction errors of all channel subgroups are then summarized to form the instance feature reconstruction loss. This instance feature reconstruction loss is only used to constrain the parameter updates of the student model. The teacher model parameters are updated using an exponential moving average method, thereby improving the stability and discriminative power of instance feature detection under cross-domain conditions.
[0070] Furthermore, the overall training objective function is:
[0071] ;
[0072] in For source domain detection loss, For the target domain pseudo-label detection loss, and The values are semantic and instance feature reconstruction losses, respectively. α can be 0.8 or other values depending on the actual needs, β can be 0.3 or other values depending on the actual needs, and γ can be 0.5 or other values depending on the actual needs.
[0073] Combination Figure 4 The feature-reconstruction-based cross-domain target detection system for traffic videos in this embodiment mainly includes:
[0074] Edge computing device 101, road monitoring camera 102, and road monitoring scene 103.
[0075] The road monitoring camera 102 is installed above or on the side of the road to continuously collect video data from a road monitoring scene 103, which includes information such as vehicles, road markings, and traffic conditions. The road monitoring camera 102 is connected to the edge computing device 101 via wired or wireless means, transmitting the collected road video data to the edge computing device 101 in real time or periodically.
[0076] The edge computing device 101 includes a processor, a computer-readable storage medium, a memory, and a network interface connected via a system bus. The computer-readable storage medium stores an operating system, a database, and computer-readable instructions. The database stores control information sequences. When executed by the processor, the computer-readable instructions enable the processor to implement a feature-reconstruction-based cross-domain target detection method for traffic videos. The processor of the edge computing device 101 provides computing and control capabilities to support the operation of the entire edge computing device 101. The memory of the edge computing device 101 stores computer-readable instructions. When executed by the processor, these instructions enable the processor to execute the feature-reconstruction-based cross-domain target detection method for traffic videos of this application. The network interface of the edge computing device 101 is used for communication with a terminal. Specifically, the structure of the edge computing device 101 can refer to existing technologies. The edge computing device 101 internally deploys a target detection model and a corresponding data processing module for parsing, feature extraction, and target detection inference of received road monitoring videos. During the model training or update phase, the edge computing device 101 can also use the collected unlabeled road image data of the target domain for training or adaptive updating of the unsupervised cross-domain target detection model, so as to improve the detection stability and applicability of the model under different road environments, different camera devices and different weather conditions.
[0077] Through the above structural configuration, unsupervised cross-domain adaptation of road monitoring data collection, processing, and target detection models is achieved, which is suitable for the long-term deployment and operation of intelligent traffic video surveillance systems.
[0078] The above are preferred embodiments of the present invention, but the embodiments of the present invention are not limited to the above content. Any changes, modifications, substitutions, combinations, or simplifications made without departing from the spirit and principle of the present invention shall be considered equivalent substitutions and shall be included within the protection scope of the present invention.
Claims
1. A cross-domain target detection method for traffic videos based on feature reconstruction, characterized in that, Includes the following steps: (1) Construct student and teacher models based on the same target detection network structure; (2) Acquire labeled image data of the source domain road traffic scene on the training side, input the source domain images into the student model, and calculate the source domain detection loss based on the real labels; (3) Extract image frames from the video stream collected by the road monitoring camera on the target domain side to form unlabeled data for the target domain; The target domain image is input into the teacher model to generate target domain pseudo-labels; the target domain image and its corresponding pseudo-labels are input into the student model to calculate the target domain pseudo-label detection loss, which is used to guide the student model to adapt to the target domain road scene distribution. (4) A semantic feature reconstruction module is set between the target detection backbone network and the detection head to perform prediction-reconstruction constraints on the intermediate semantic features of the teacher model and the student model on the road samples in the target domain; wherein, the semantic feature reconstruction module obtains the semantic feature reconstruction loss in the following way: extract the multi-scale semantic feature maps output by the backbone networks of the teacher model and the student model respectively, and after channel projection and spatial alignment processing, perform feature fusion through multi-receptive field convolution branches to generate a unified semantic feature representation, and map the semantic features of the student side by the prediction mapping unit, and calculate the reconstruction error with the semantic features of the teacher side as the reconstruction target to obtain the semantic feature reconstruction loss; (5) An instance feature reconstruction module is set in the instance feature layer or the output end of the detection head of the detection network to perform prediction-reconstruction constraints on the detection instance features of the teacher model and the student model on the road samples in the target domain; wherein, the instance feature reconstruction module obtains the instance feature reconstruction loss in the following way: extract the instance feature vectors of the teacher model and the student model respectively, map them to the unified embedding space by linear projection, perform nonlinear prediction transformation on the instance features of the student side and group them along the channel dimension, calculate the similarity error between the predicted instance features and the instance features of the teacher side in each group, and accumulate them to obtain the instance feature reconstruction loss; (6) The source domain detection loss, target domain pseudo-label detection loss, semantic feature reconstruction loss and instance feature reconstruction loss are weighted and summed to form the overall training objective function; the student model parameters are updated through backpropagation and the teacher model parameters are updated through EMA until the model converges; (7) After training, the model is deployed to the edge computing device or server of the intelligent traffic video surveillance system to perform online inference on the road video stream and output the detection results.
2. The method for cross-domain target detection in traffic videos based on feature reconstruction according to claim 1, characterized in that, Step (4) includes the following operations: Multi-scale semantic feature extraction and channel alignment: Semantic feature maps output from the first scale layer are obtained from the backbone networks of the teacher model and the student model, respectively, where the teacher-side features are denoted as... Student-related characteristics are denoted as The channel projection unit maps multi-scale features to the same channel dimension. The 1×1 convolution operator is used to uniformly map features from different scale layers to the same channel dimension. Spatial resolution alignment: based on a preset baseline spatial resolution. H × W To achieve this, the spatial size of the multi-scale feature map after channel alignment is adjusted, and interpolation operators are used to upsample or downsample the feature map so that features of different scales are aligned in spatial position, thereby obtaining spatially aligned multi-scale semantic features. Multi-receptive-field semantic modeling and feature fusion: Spatially aligned multi-scale semantic features are input into a multi-branch semantic modeling unit. Each branch uses convolution operators with different receptive fields to extract contextual semantic information of different ranges. The features output by each branch are concatenated in the channel dimension and fused through a linear mapping unit to generate a unified semantic feature representation for subsequent reconstruction constraints. Based on the consistency constraint of prediction-reconstruction: the teacher model receives the target domain road image after weak data augmentation and outputs the teacher-side semantic feature representation; the student model receives the corresponding strong data augmentation image and outputs the student-side semantic feature representation; the student-side semantic features are mapped by the prediction mapping unit so that they are in the same feature space as the teacher-side semantic features, and the teacher-side semantic features are used as the reconstruction target. The reconstruction error between the student-side predicted features and the teacher-side target features is calculated, and a semantic feature reconstruction loss function is constructed.
3. The method for cross-domain target detection in traffic videos based on feature reconstruction according to claim 2, characterized in that, The semantic feature reconstruction loss is used to constrain the updating of student model parameters, while the teacher model parameters do not participate in the backpropagation update of this loss.
4. The method for cross-domain target detection in traffic videos based on feature reconstruction according to claim 1, characterized in that, Step (5) includes the following operations: Instance-level feature extraction and embedding mapping: Instance feature vectors for corresponding detected instances are extracted from the detection networks of the teacher and student models, respectively, where the teacher-side instance features are denoted as... Student-side instance features are denoted as h s The instance features are derived from the candidate region feature layer inside the detection head or the instance feature representation at the output end of the detection head; the instance features on the teacher side and the student side are linearly projected through the instance feature mapping unit so that the two are mapped to the embedding feature space of the same dimension. Student instance feature prediction and channel grouping: An instance feature prediction unit is set in the student model branch to perform nonlinear prediction transformation on the mapped student instance features to generate student-side predicted instance features; the teacher-side instance features and student-side predicted instance features are divided into a preset number of channel subgroups along the channel dimension, and each channel subgroup corresponds to a sub-representation in the instance feature space. Instance reconstruction constraints based on channel grouping: For each channel subgroup, the similarity error between the predicted instance features on the student side and the target instance features on the teacher side is calculated, and the instance feature reconstruction loss function is constructed using the cosine similarity metric. The reconstruction errors of all channel subgroups are summed to obtain the instance feature reconstruction loss, which is used to constrain the instance feature prediction results of the student model on the road samples in the target domain to be consistent with the output of the teacher model.
5. The cross-domain target detection method for traffic videos based on feature reconstruction according to claim 4, characterized in that, The instance feature reconstruction loss only participates in the backpropagation update of the student model parameters. The instance features output by the teacher model serve as stable reconstruction targets and do not participate in the gradient update of this loss.
6. A detection system applying the feature reconstruction-based cross-domain target detection method for traffic videos according to any one of claims 1-5, characterized in that, include: The road video acquisition module is used to acquire traffic scene video streams through road monitoring cameras and extract image frames as unlabeled data for the target domain. The data storage and management module is used to store labeled data in the source domain, unlabeled data in the target domain, pseudo-labels, and model parameter files. The student detection module is used to extract features and predict targets from the input image, and to update the model parameters through backpropagation during the training phase. The teacher detection module has the same network structure as the student detection module. It is used to generate pseudo-labels in the target domain and provide a reference representation for feature reconstruction. Its parameters are obtained by updating the parameters of the student detection module using EMA. The semantic feature reconstruction module (SAB) is deployed between the backbone network and the detection head, and includes at least: a channel projection unit, a spatial alignment unit, a multi-branch semantic modeling unit, and a feature fusion unit, which are used to perform alignment and reconstruction constraints on multi-scale semantic features. The instance feature reconstruction module (IMB) is connected to the instance feature layer or the output of the detection head of the detection network. It includes at least: an instance feature extraction unit, a linear projection unit, an instance prediction unit, and a channel grouping and loss calculation unit, which are used to perform fine-grained reconstruction constraints on the detected instance features. The loss calculation and model update module is used to comprehensively calculate the source domain detection loss, target domain pseudo-label detection loss, semantic reconstruction loss and instance reconstruction loss, and to complete the EMA smoothing update of student model parameters and teacher model parameters. The inference deployment module is used to deploy the trained model to edge computing devices or servers to perform online detection of road video streams and output the detection results.
7. An electronic device, characterized in that, It includes a central processing unit and a memory, wherein the central processing unit is used to invoke and run a computer program stored in the memory to perform the steps of the feature reconstruction-based cross-domain target detection method for traffic videos according to any one of claims 1-5.
8. A computer-readable storage medium, characterized in that, It stores, in the form of computer-readable instructions, a computer program implementing the traffic video cross-domain target detection method based on feature reconstruction as described in any one of claims 1-5, which, when called by a computer, executes the steps included in the corresponding method.
Citation Information
Patent Citations
Model training method, cross-domain target detection method and electronic equipment
CN118038163A
Image target detection method and device and storage medium
CN121305259A