A vehicle target detection method based on deep learning
By constructing bipartite graphs and graph neural network feature enhancement, combined with dynamic contrastive denoising training and joint loss functions, the problems of false detection and false negative detection of vehicle targets in occluded scenarios are solved, achieving higher detection accuracy and robustness.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- XIAN UNIV OF SCI & TECH
- Filing Date
- 2026-01-15
- Publication Date
- 2026-04-17
AI Technical Summary
Existing vehicle target detection methods are prone to false positives and false negatives in occluded scenarios, and the lack of adaptability and consistency between localization and classification during model training leads to insufficient detection accuracy.
A bipartite graph is constructed and a graph neural network is used to enhance the features of unmatched predicted bounding boxes and unmatched ground truth bounding boxes. The graph neural network and dynamic contrastive denoising training are combined, and the model performance is optimized by a joint loss function to improve the global spatial relationship and adaptability of matching decisions.
It significantly improves vehicle detection accuracy and recall in occluded scenarios, reduces false positive and false negative rates, and enhances the robustness and detection quality of the model in complex scenarios.
Smart Images

Figure CN121544874B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of vehicle target detection technology, specifically relating to a vehicle target detection method based on deep learning. Background Technology
[0002] With the rapid development of autonomous driving and intelligent transportation systems, high-precision vehicle target detection technology has become crucial.
[0003] Currently, common vehicle target detection methods include: using a CNN backbone network (such as ResNet-50) to extract multi-scale local features of the image; performing global context modeling through a Transformer encoder; using learnable query vectors to interact with image features in the decoder to generate predicted bounding boxes and classification confidence; and using the Hungarian matching algorithm for label assignment, while introducing a contrastive denoising training strategy to improve the robustness of the model.
[0004] However, this method is still insufficient in dealing with the common vehicle occlusion problem in real road scenarios, and is prone to high false detection and false negative rates. Summary of the Invention
[0005] The purpose of this invention is to provide a vehicle target detection method based on deep learning. By constructing a bipartite graph and using a graph neural network to enhance the contextual features and perform secondary matching on unmatched predicted bounding boxes and unmatched real bounding boxes, the matching decision is integrated with the global spatial relationship, thereby solving the problem of missed and false detection of vehicles caused by occlusion.
[0006] The present invention adopts the following technical solution:
[0007] A deep learning-based vehicle target detection method utilizes the DINO model to generate predicted bounding boxes for vehicle targets in the input image; the training method for the DINO model includes:
[0008] Step 1: Perform preliminary matching between predicted bounding boxes and ground truth bounding boxes, and filter out effective matching relationships that match the confidence level and positioning accuracy to obtain the first matching pair, the set of unmatched predicted bounding boxes, and the set of unmatched ground truth bounding boxes; the set of unmatched predicted bounding boxes includes several unmatched predicted bounding boxes, and the set of unmatched ground truth bounding boxes includes several unmatched ground truth bounding boxes.
[0009] Step 2: Construct a bipartite graph using unmatched predicted bounding boxes and unmatched ground truth bounding boxes as nodes;
[0010] Step 3: Input the bipartite graph into the graph neural network, perform feature enhancement on the unmatched predicted bounding boxes and the unmatched ground truth bounding boxes, and obtain the feature-enhanced unmatched predicted bounding boxes and the feature-enhanced unmatched ground truth bounding boxes;
[0011] Step 4: Perform a second matching between the feature-enhanced unmatched predicted bounding boxes and the feature-enhanced unmatched ground truth bounding boxes to obtain a second matching pair;
[0012] Step 5: Merge the first and second matching pairs to form the final matching result;
[0013] Step 6: Train the DINO model based on the final matching results to optimize its detection performance in occluded scenarios;
[0014] In step 2, constructing a bipartite graph using unmatched predicted bounding boxes and unmatched ground truth bounding boxes as nodes includes:
[0015] Each unmatched predicted bounding box in the set of unmatched predicted bounding boxes is defined as a prediction node, and each unmatched true bounding box in the set of unmatched true bounding boxes is defined as a true node.
[0016] Node features are constructed for each node, including the geometric information and semantic features of the unmatched bounding box corresponding to the node; the node is either a predicted node or a ground truth node, and the unmatched bounding box is either an unmatched predicted bounding box or an unmatched ground truth bounding box.
[0017] Establish an edge between any two nodes;
[0018] For each edge, an edge feature is constructed. The edge feature is used to characterize the spatial relationship between the unmatched bounding boxes corresponding to the two nodes connected by the edge, resulting in a bipartite graph.
[0019] The beneficial effects of this invention are as follows: By constructing a bipartite graph and utilizing a graph neural network to enhance the features of unmatched predicted bounding boxes and unmatched ground truth bounding boxes, this invention enables each unmatched bounding box to integrate the contextual information of other unmatched bounding boxes to form enhanced features, thereby increasing its discriminative power. Based on the enhanced features, a secondary matching is performed on the unmatched bounding boxes. This makes the matching decision not only depend on the features of the unmatched bounding boxes themselves, but also considers the potential relationships between global unmatched bounding boxes, thereby more accurately handling difficult situations such as blurring and occlusion, significantly reducing missed detections and false detections in complex scenes, and improving the average detection accuracy. Attached Figure Description
[0020] Figure 1 The image shows the detection results of the DINO model trained using the Hungarian matching algorithm for vehicles in scene 1.
[0021] Figure 2 The image shows the detection results of the DINO model trained using the graph neural network matching method of this invention for the vehicles in scenario 1.
[0022] Figure 3The image shows the detection results of the DINO model trained using the Hungarian matching algorithm for vehicles in scene 2.
[0023] Figure 4 The image shows the detection results of the DINO model trained using the graph neural network matching method of this invention for the vehicles in scenario 2.
[0024] Figure 5 The image shows the vehicle detection results of the DINO model trained using the focus loss function.
[0025] Figure 6 The image shows the vehicle detection results of the DINO model trained using the joint loss function in this invention.
[0026] Figure 7 A visualization of the detection results of the Faster R-CNN object detection algorithm in the existing technology;
[0027] Figure 8 This is a visualization of the detection results of the YOLO11 object detection algorithm in the existing technology;
[0028] Figure 9 A visualization of the detection results of the existing Deformable DETR object detection algorithm;
[0029] Figure 10 A visualization of the detection results of the existing DAB-DETR target detection algorithm;
[0030] Figure 11 This is a visualization of the detection results of the DINO-4scale target detection algorithm in the existing technology;
[0031] Figure 12 This is a visualization of the detection results of the DINO model obtained by the training method in this invention. Detailed Implementation
[0032] The present invention will now be described in detail with reference to the accompanying drawings and embodiments.
[0033] This invention is an improvement on the DINO model (ZHANG H, LI F, LIU S, et al. DINO: DETR with improved denoising anchor boxes for end-to-end object detection[C]. International Conference on Learning Representations, 2022.).
[0034] The method for vehicle detection using the DINO model is as follows:
[0035] (1) Feature extraction: The input image is directly fed into a pre-trained CNN backbone network to extract multi-scale local features of the image;
[0036] (2) Global context modeling: The above-mentioned local image features are combined with position encoding and input into a Transformer encoder consisting of a multi-layer self-attention mechanism and a feedforward network to obtain features containing global semantic information;
[0037] (3) Query decoding and prediction: At the decoder end, a set of learnable query vectors interact with the encoded image features through a cross-attention mechanism, and finally output the coordinates of the predicted bounding box and the classification confidence through the prediction head;
[0038] (4) Label matching and training:
[0039] Matching strategy: The Hungarian matching algorithm is used, whose cost matrix is calculated only based on the classification confidence of each predicted bounding box and the regression error of the predicted bounding box, and an optimal predicted bounding box is assigned to each true bounding box.
[0040] Denoising training: During the training process, a contrastive denoising strategy with a fixed intensity upper limit is adopted, that is, bounded random noise is added to the real bounding boxes to generate negative sample anchor boxes and assist the denoising task.
[0041] (5) Loss function: Standard classification loss functions such as focus loss function are usually used, combined with L1 loss and GloU loss (Generalized Intersection over Union Loss) to predict bounding box regression.
[0042] The structure and relationships of the DINO model can be summarized as follows: a CNN backbone network is connected to a Transformer encoder-decoder, and the back end is connected to the prediction head.
[0043] However, the DINO model has the following problems in the process of vehicle detection:
[0044] (1) High false positive / false negative rates in occluded scenarios: The Hungarian matching algorithm relied upon during DINO model training has a matching cost matrix based only on the local features of the predicted bounding box itself (such as classification score and regression error of the predicted bounding box), while ignoring the spatial topological relationship and geometric constraints between different targets. In severe occlusion scenarios, the appearance features of the occluded target are incomplete, resulting in high similarity between it and the background or other targets in local features. This matching strategy that relies only on local similarity cannot perform effective contextual reasoning, which is very easy to generate incorrect matching associations, and ultimately manifests as a significant increase in false positive and false negative rates.
[0045] (2) The denoising training strategy uses a fixed noise intensity, which limits the discrimination ability of the DINO model: The contrast denoising strategy used during DINO model training uses a fixed upper limit of noise perturbation. This static hyperparameter setting cannot adapt to the dynamic changes in the model's discrimination ability at different training stages: In the early stage of training, the model's ability is weak, and the fixed intensity of noise may be too difficult, leading to unstable learning; In the later stage of training, the model's ability is enhanced, and the fixed intensity of noise may be too simple, failing to provide an effective discrimination signal. This limits the model's ability to further improve, especially the ability to distinguish "hard negative samples" that are similar to the background color and have blurred edges.
[0046] (3) Inconsistent localization and classification confidence, resulting in low quality of predicted bounding boxes: When training the DINO model, standard classification loss functions such as focus loss function are usually used. The optimization objective is not directly related to the localization accuracy of the predicted bounding boxes. This may result in the model outputting some predicted bounding boxes with high classification confidence but inaccurate localization, or predicted bounding boxes with high localization but low classification confidence. This inconsistency restricts the output of high-precision predicted bounding boxes and affects the overall detection quality.
[0047] To address the aforementioned shortcomings, the technical problem this invention aims to solve is:
[0048] (1) Improve the matching accuracy and recall rate of vehicle target detection in occluded scenarios and reduce false detection and missed detection. Among them, occlusion mainly refers to the phenomenon that vehicles are partially or completely covered by other vehicles, buildings, vegetation, etc. in road scenarios, resulting in incomplete appearance features.
[0049] (2) Design an adaptive denoising training mechanism to dynamically match the training process of the model and improve the ability to distinguish difficult negative samples;
[0050] (3) Make the classification confidence and localization accuracy of the model more consistent, thereby increasing the output ratio of high-quality predicted bounding boxes.
[0051] The specific method of this invention is as follows:
[0052] This invention provides a deep learning-based vehicle target detection method, which utilizes the DINO model to generate predicted bounding boxes of vehicle targets in an input image; the training method of the DINO model includes:
[0053] Step 1: Perform preliminary matching between predicted bounding boxes and ground truth bounding boxes, and filter out effective matching relationships that match the confidence level and positioning accuracy to obtain the first matching pair, the set of unmatched predicted bounding boxes, and the set of unmatched ground truth bounding boxes. The set of unmatched predicted bounding boxes includes several unmatched predicted bounding boxes, and the set of unmatched ground truth bounding boxes includes several unmatched ground truth bounding boxes.
[0054] Specifically, the preliminary matching cost between the ground truth bounding box and the predicted bounding box is calculated to obtain the preliminary matching cost matrix. The preliminary matching cost reflects the degree of difference between the ground truth bounding box and the predicted bounding box. Based on the preliminary matching cost matrix, the Hungarian matching algorithm is used to solve the problem, and the ground truth bounding box with the minimum total cost is selected as the first matching pair for each predicted bounding box.
[0055] Step 2: Construct a bipartite graph using unmatched predicted bounding boxes and unmatched ground truth bounding boxes as nodes.
[0056] Specifically, the process involves: defining each unmatched predicted bounding box in the set of unmatched predicted bounding boxes as a predicted node, and defining each unmatched true bounding box in the set of unmatched true bounding boxes as a true node; constructing node features for each node, which include the geometric information and semantic features of the unmatched bounding box corresponding to that node; defining a node as either a predicted node or a true node, and an unmatched bounding box as either an unmatched predicted bounding box or an unmatched true bounding box; establishing an edge between any two nodes; and constructing edge features for each edge, which characterize the spatial relationship between the unmatched bounding boxes corresponding to the two nodes connected by the edge, thus obtaining a bipartite graph.
[0057] The geometric information includes the center coordinates, width, and height of the unmatched bounding boxes; the spatial relationships include relative distance and intersection-union ratio.
[0058] Relative distance represents the Euclidean geometric distance between the center points of two unmatched bounding boxes connected by an edge.
[0059] In this invention, the geometric information, semantic features, and spatial relationships of unmatched bounding boxes are organically combined, providing sufficient structured information for graph neural networks.
[0060] Step 3: Input the bipartite graph into the graph neural network, perform feature enhancement on the unmatched predicted bounding boxes and the unmatched ground truth bounding boxes, and obtain the feature-enhanced unmatched predicted bounding boxes and the feature-enhanced unmatched ground truth bounding boxes.
[0061] Specifically, the bipartite graph is input into the first attention layer of the graph neural network. Through a multi-head attention mechanism, the information of the neighboring nodes of each node under different representation subspaces is aggregated to generate high-dimensional intermediate features of each node. The high-dimensional intermediate features of each node are input into the second attention layer of the graph neural network. Through a single-head attention mechanism, the high-dimensional intermediate features of each node are fused and dimensionality reduced to generate enhanced features of each node.
[0062] In this invention, the graph neural network employs a graph attention network, which has a two-layer structure: the first attention layer uses a four-head attention mechanism to obtain high-dimensional intermediate features by aggregating information from unmatched bounding boxes in different representation subspaces, thereby significantly enhancing the feature representation and discriminative power of each unmatched bounding box; the second attention layer uses a single-head attention mechanism to fuse and reduce the dimensionality of the high-dimensional intermediate features output by the first attention layer, thereby obtaining highly condensed enhanced features for each unmatched bounding box used for the final matching decision.
[0063] Step 4: Perform a second matching between the feature-enhanced unmatched predicted bounding boxes and the feature-enhanced unmatched ground truth bounding boxes to obtain a second matching pair.
[0064] Specifically, the process involves: calculating the secondary matching cost between the feature-enhanced unmatched predicted bounding boxes and the feature-enhanced unmatched ground truth bounding boxes to obtain the secondary matching cost matrix; the secondary matching cost reflects the difference between the feature-enhanced unmatched predicted bounding boxes and the feature-enhanced unmatched ground truth bounding boxes; based on the secondary matching cost matrix, the Hungarian matching algorithm is used to solve the problem, and the ground truth bounding box with the minimum total cost for each predicted bounding box is selected as the second matching pair.
[0065] This invention innovatively improves the training method of the DINO model and proposes a graph neural network matching method. It transforms the core evidence relied upon for matching decisions from unreliable individual visual features to reliable group spatial relationships. Under severe occlusion, the visual features of occluded vehicles are severely incomplete or distorted, causing matching algorithms based solely on their appearance (such as the Hungarian matching algorithm) to fail to accurately detect occluded vehicles.
[0066] The breakthrough of this invention lies in constructing a bipartite graph spatial relationship network by combining all the unmatched predicted bounding boxes and unmatched real bounding boxes left after the initial matching. In this network, the unmatched real bounding boxes not only provide a reliable positional reference for the entire matching process and clarify which locations contain vehicles that need to be detected, but also intertwine with the unmatched predicted bounding boxes, whose positions may be slightly off, to form a comprehensive "spatial relationship network".
[0067] Graph neural networks do not rely on any "perfect nodes." Instead, they enable these nodes with ambiguous features to communicate with each other and extract hidden geometric constraints from the relational network they form. Unmatched real bounding boxes, as precise "spatial landmarks," transmit their positions to connected unmatched predicted bounding boxes. At the same time, stable spatial relationships between nodes (such as layouts that conform to following or side-by-side) are strengthened and shared in the information exchange, forming a collective consensus on the scene structure. This process allows the enhanced features of each unmatched bounding box to incorporate the "scene structure" information implied by the entire unmatched group.
[0068] Therefore, in the secondary matching, the matching decision no longer depends on the incomplete appearance of a single unmatched bounding box, but is based on the reasonable position of the target in the relational network that conforms to the spatial consensus of the group. The true bounding box of an occluded vehicle can be correctly associated and detected through the spatial logical evidence carried by its enhanced features.
[0069] The following compares the detection results of the DINO model trained using the Hungarian matching algorithm and the DINO model trained using the graph neural network matching method of this invention:
[0070] Figure 1 The image shows the vehicle detection results in Scene 1 using the DINO model trained with the Hungarian matching algorithm. Figure 2 The image shows the detection results of vehicles in scenario 1 using the DINO model trained by the graph neural network matching method of this invention. Figure 3 The image shows the detection results of vehicles in Scene 2 using the DINO model trained with the Hungarian matching algorithm. Figure 4 The image shows the detection results of the DINO model trained using the graph neural network matching method of this invention for vehicles in scene 2; scene 1 is a well-lit road scene, and scene 2 is a dimly lit road scene. The numbers in the image represent the classification confidence.
[0071] As can be seen from the diagram, in scenario 1, Figure 1 The car that was obscured by the green belt on the left side of the road was not detected; Figure 2 Cars obscured by green belts on the left side of the road were detected; thus, it can be seen that the DINO model trained using the graph neural network matching method of the present invention can effectively detect vehicles obscured by other objects.
[0072] In scenario 2, Figure 3 There are 3 predicted bounding boxes. Figure 4 There are 5 predicted bounding boxes; therefore, it can be seen that the number of vehicles detected by the DINO model trained by the graph neural network matching method of the present invention is greater than the number of vehicles detected by the DINO model trained by the Hungarian matching algorithm, and the more detected vehicles are those occluded by other objects.
[0073] Therefore, the graph neural network matching method of the present invention enhances the contextual features and performs secondary matching on the unmatched predicted bounding boxes and the unmatched real bounding boxes, so as to integrate the global spatial relationship in the matching decision and thus accurately solve the problem of vehicle missed detection and false detection caused by occlusion.
[0074] In this invention, a bipartite graph is constructed and a graph neural network is used to enhance the features of unmatched predicted bounding boxes and unmatched ground truth bounding boxes. This allows each unmatched bounding box to integrate the contextual information of other unmatched bounding boxes to form enhanced features, thus making it more discriminative. Based on the enhanced features, a secondary matching is performed on the unmatched bounding boxes. This makes the matching decision not only depend on the features of the unmatched bounding boxes themselves, but also consider the potential relationships between global unmatched bounding boxes, thereby more accurately handling difficult situations such as blurring and occlusion.
[0075] The loss function used in the training process of this invention is the joint loss function.
[0076] Specifically, the joint loss function includes a first loss function for mining difficult samples and a second loss function for achieving quality awareness in classification and localization.
[0077] In this invention, difficult samples mainly include two categories: (1) samples that are difficult to classify, such as background areas similar to the features of the target vehicle, or vehicles that are severely occluded and have incomplete features; (2) samples that are difficult to locate, i.e., samples with a low intersection of the predicted bounding box and the ground box.
[0078] The first loss function is the focal loss function; the second loss function is the variable focal loss function.
[0079] The joint loss function is a weighted sum of the focal loss function and the variable focal loss function, expressed as:
[0080] ,
[0081] in, For the joint loss function, For focus loss function, For variable focus loss function, These are the weighting coefficients of the focus loss function. These are the weighting coefficients of the variable focus loss function.
[0082] and The value is set manually based on experience. The value range is 0.5-0.7. The value range is 0.3-0.5.
[0083] In a preferred embodiment, the weighting coefficients are respectively set as follows: =0.6, =0.4, to balance the contributions of the two items.
[0084] Specifically, the core function of the focus loss function is to mine difficult samples. By using a modulation factor to reduce the weight of easily classified samples in the total loss, the model can concentrate on learning difficult-to-classify samples. The core function of the variable focus loss function is to achieve quality perception of classification and localization.
[0085] The following compares the detection results of the DINO model trained using the focus loss function and the DINO model trained using the joint loss function in this invention:
[0086] Figure 5 The image shows the vehicle detection results of the DINO model trained using the focus loss function. Figure 6 The image shows the vehicle detection results of the DINO model trained using the joint loss function in this invention; the numbers in the image represent classification confidence.
[0087] As can be seen from the figure, under the same scenario, Figure 5 and Figure 6 The same trucks were detected in all of them. Figure 5 The classification confidence score was 0.92, but the predicted bounding boxes did not completely cover the detected trucks. Figure 6 The classification confidence score was 0.99, and the predicted bounding box completely covered the detected trucks.
[0088] Therefore, by using the joint supervision of the joint loss function in this invention, the classification confidence and the localization accuracy of the predicted bounding box are driven to be highly consistent, effectively balancing the influence of semantics and localization quality on the classification confidence, thereby directly improving the output ratio of high-quality predicted bounding boxes.
[0089] The training process of the DINO model also includes dynamic contrastive denoising training, which includes:
[0090] Construct positive and negative sample queries based on real bounding boxes.
[0091] Positive sample queries are generated by adding fixed noise of a preset intensity or no noise to the real bounding boxes; negative sample queries are generated by adding dynamically decaying noise to the real bounding boxes so that the difficulty of negative samples changes adaptively with the training process.
[0092] The positive and negative sample queries are input into the decoder of the DINO model to generate positive and negative sample prediction boxes.
[0093] The contrast loss is calculated based on the predicted boxes of positive and negative samples and their corresponding ground truth bounding boxes, so that the DINO model can learn to distinguish between positive and negative samples.
[0094] The DINO model is trained using contrastive loss and the final matching results.
[0095] Specifically, during the forward propagation of the DINO model, in addition to the regular queries used for standard detection tasks, the system constructs two additional sets of dedicated query vectors: positive sample queries and negative sample queries.
[0096] These two sets of queries are input into the Transformer decoder in parallel with the regular query. After decoding, the regular query generates predicted bounding boxes, the positive sample query generates positive sample predicted boxes, and the negative sample query generates negative sample predicted boxes.
[0097] In this method, a square region is defined with each real bounding box as the center. The region inside the real bounding box is defined as the positive sample region, and the region between the real bounding box and the boundary of the square region is defined as the negative sample region.
[0098] Add a fixed noise of a preset intensity or no noise to the center coordinates and dimensions of the true bounding box to generate positive sample queries within the positive sample region; in one embodiment of the present invention, the intensity coefficient of the fixed noise is set to 1.0, which means that a small fixed perturbation is applied to the center coordinates and dimensions of the true bounding box to ensure that the generated positive samples are highly consistent with the original target in semantics and location, thereby enhancing the robustness of the model to natural changes in the target.
[0099] Dynamically attenuated noise is added to the center coordinates and dimensions of the true bounding box to generate negative sample queries within the negative sample region.
[0100] Since the relationship between positive and negative sample queries and the true bounding boxes is pre-constructed, it does not participate in the graph neural network matching process. After obtaining the positive and negative sample prediction boxes, the contrastive loss is calculated directly.
[0101] The dynamic contrast denoising training method proposed in this invention effectively improves the ability to distinguish "difficult negative samples" by defining positive and negative sample regions and dynamically attenuating noise injection strategies, thereby enhancing the robustness of the detection system in complex backgrounds. "Difficult negative samples" refer to negative samples that are generated with minimal noise in the later stages of training and are extremely similar to positive samples.
[0102] Among them, the upper limit of the perturbation of the dynamically decaying noise monotonically decreases with the increase of the training cycle. The upper limit of the perturbation of the dynamically decaying noise is not a fixed value, but a function that decays linearly with the training cycle, expressed as:
[0103] ,
[0104] in, For the current training cycle, This represents the upper limit of the dynamic decay noise perturbation during the current training cycle. For the total training cycle, This represents the maximum value of the upper limit of the disturbance for dynamically attenuating noise. This is the minimum value of the upper limit of the disturbance for dynamically attenuating noise.
[0105] Specifically, in the early stages of training Smaller Larger negative samples, generating more noise and higher difficulty, force the model to learn more robust features to distinguish these obviously erroneous targets; in the later stages of training... near , Smaller negative samples generate less noise and are easier to generate, allowing for fine-tuning of decision boundaries and focusing on easily confused negative samples that are very close to the real target.
[0106] During the dynamic contrastive denoising training process, the trained DINO model simultaneously receives positive sample queries (ground bounding boxes with slight noise or no noise) and the dynamically generated negative sample queries mentioned above. By contrasting the learning objectives, it learns to correctly associate positive samples with image features while rejecting negative samples.
[0107] In the dynamic contrast denoising training process of this invention, the upper limit of the disturbance of the dynamic decay noise of negative samples is set as a function that decays linearly with the training cycle. This mechanism realizes the adaptive adjustment of the difficulty of negative samples, so that the training process matches the dynamic learning ability and effectively enhances the discrimination power of "difficult negative samples".
[0108] Alternatively, the graph attention network can be replaced with a graph convolutional network, a graph sampling and aggregation network, or other types of message-passing neural networks.
[0109] Although graph attention networks can adaptively learn the weights of neighboring nodes using attention mechanisms and may achieve optimal performance, alternative models such as graph convolutional networks also have the ability to aggregate neighborhood information on the graph, can achieve basic contextual relationship modeling, and can still solve the matching ambiguity problem caused by occlusion to a certain extent.
[0110] Optionally, the linear decay function in the expression for the upper limit of the disturbance of the dynamically decaying noise. It can be replaced by other monotonically decreasing functions such as cosine annealing decay, polynomial decay, or exponential decay.
[0111] Although linear decay functions are simple and stable to implement, nonlinear decay strategies such as cosine annealing may maintain a higher noise level for a longer period of time in the early stages of training and decrease faster in the later stages. Although they adjust the change rate of negative sample difficulty in different ways, their core purpose is the same as linear decay, that is, to achieve a dynamic decrease in negative sample difficulty as the training process progresses.
[0112] Optionally, the fixed weight coefficients in the joint loss function ( =0.6, =0.4) can be adjusted to other values depending on the specific task dataset, or set as a learnable parameter.
[0113] The variable focus loss function can be replaced by a loss function related to positioning quality, such as the generalized cross-union loss or the distance cross-union loss.
[0114] While adjusting the weights can flexibly balance the focus of classification and localization tasks, replacing them with other localization quality losses can also play the role of linking classification confidence with localization accuracy. The core idea is to improve the consistency of classification and localization through joint supervision.
[0115] The present invention also provides a vehicle target detection device based on deep learning, including a memory, a processor, and a computer program stored in the memory and running on the processor, wherein the processor executes the computer program to implement any of the above methods.
[0116] The invention will now be described in detail with reference to simulation experiments.
[0117] (1) Technical effect verification data: The present invention has been fully experimentally verified on the public dataset TJ4DRadSet. The TJ4DRadSet dataset is an autonomous driving dataset containing various lighting and occlusion scenarios, which proves the applicability of the present invention in real complex scenarios. The key quantitative effect comparison is as follows.
[0118] (2) Module ablation experiment: The specific ablation experiment results are detailed in Table 1. In the table, AP50 is the average precision, AP50~95 is the overall average precision, and AR is the average recall rate.
[0119] The results in Table 1 show that the graph neural network matching method of the present invention significantly improves AR, and after using the dynamic contrast denoising training method and joint loss function of the present invention, both AP50 and AP50~95 indicators are significantly improved.
[0120] Table 1 Ablation Experiment
[0121]
[0122] Ablation experiments confirm that the graph-based Hungarian Matching (G-HM), Dynamic Contrast Denoising (DCDN), and Focal-Varifocal Loss (FVFLoss) methods proposed in this invention all make independent and cumulative contributions to performance improvement.
[0123] (3) Comparison with mainstream object detection algorithms: The specific comparison results are shown in Table 2. In the table, AP50 is the average precision, AP50~95 is the comprehensive average precision, AR is the average recall, GFLOPs is the floating-point operation required for a single forward inference of the model, which is used to measure the computational complexity; Params represents the total number of learnable parameters of the model, which reflects the model size; FPS represents the number of image frames that can be processed per second, which is used to evaluate the inference speed.
[0124] As shown in Table 2, in comparison with mainstream object detection algorithms such as Faster R-CNN, YOLOv5 / v8 / v11, DETR and its various variants, the present invention achieved the best performance in the three core metrics of AP50, AP50~95 and AR.
[0125] (4) Comparison with the baseline model: The DINO-4scale algorithm was selected as the baseline model. As shown in Table 2, the method of the present invention (DINO-GVD) has improved in key evaluation indicators compared with the DINO-4scale algorithm. Among them, AP50 was improved by 4.8%, AP50~95 by 3.4%, and AR by 6.7%, which directly proves the effectiveness of the present invention.
[0126] Table 2 Comparison of detection results of different object detection algorithms
[0127]
[0128] The results in Table 2 show that the present invention outperforms other mainstream object detection algorithms in terms of AP50, AP50-95, and AR, and performs better in terms of overall detection accuracy. Specifically, the present invention achieves the best results in the three key accuracy indicators of AP50, AP50-95, and AR, reaching 89.0%, 53.9%, and 69.1%, respectively, which are significantly better than traditional object detection algorithms such as the single-stage YOLO series and the two-stage Faster R-CNN. Moreover, compared with the baseline model, the present invention achieves a significant improvement in detection accuracy with only a slight loss in detection speed while maintaining GFLOPs and Params unchanged.
[0129] The following is a comparison of the detection visualization results of different object detection algorithms:
[0130] Figure 7 A visualization of the detection results of the Faster R-CNN object detection algorithm in the existing technology; Figure 8 This is a visualization of the detection results of the YOLO11 object detection algorithm in the existing technology; Figure 9 A visualization of the detection results of the existing Deformable DETR object detection algorithm; Figure 10A visualization of the detection results of the existing DAB-DETR target detection algorithm; Figure 11 This is a visualization of the detection results of the DINO-4scale target detection algorithm in the existing technology; Figure 12 This is a visualization of the detection results of the DINO model obtained by the training method in this invention; the numbers in the figure represent the classification confidence.
[0131] As can be seen from the figure, Figure 7 The predicted bounding box for medium-sized trucks does not completely cover the trucks. Figure 12 The predicted bounding box of the truck completely covers the truck.
[0132] Figure 8 The classification confidence level for medium-sized trucks is 0.65. Figure 12 The classification confidence level for medium-sized trucks is 0.96. Figure 8 The classification confidence level of medium-sized trucks is lower than Figure 12 Classification confidence of medium-sized trucks.
[0133] Figure 9 , Figure 10 and Figure 11 In both cases, only two predicted bounding boxes were generated, and no distant, occluded cars were detected. Figure 12 There are 3 predicted bounding boxes in the middle, and the car that is occluded in the distance is also covered by the predicted bounding box.
[0134] Therefore, in the same scenario, this invention can detect occluded vehicles more accurately than other target detection algorithms, and the predicted bounding box is accurately located, with the predicted classification confidence level being highly consistent with the predicted bounding box location accuracy.
[0135] In summary, this invention first constructs a bipartite graph and utilizes a graph neural network to enhance the features of unmatched predicted bounding boxes and unmatched ground truth bounding boxes. This allows each unmatched bounding box to integrate contextual information from other unmatched bounding boxes to form enhanced features, thereby increasing its discriminative power and significantly improving the recall and matching accuracy of vehicle detection in severely occluded scenarios, greatly reducing false positives and false negatives caused by occlusion. Second, the dynamic contrastive denoising training method adaptively adjusts the difficulty of negative samples, enabling the invention to obtain effective supervision signals at different training stages, significantly enhancing its discriminative ability against "difficult negative samples" such as complex backgrounds and blurred edges. Finally, the joint loss function proposed in this invention collaboratively optimizes classification accuracy and localization quality, ensuring that the output classification confidence is highly consistent with the localization accuracy of the predicted bounding boxes, thereby directly increasing the output ratio of high-quality predicted bounding boxes. Therefore, this invention provides a complete and effective solution to the challenge of vehicle detection in occluded scenarios and has significant application value in intelligent transportation and autonomous driving systems.
Claims
1. A deep learning-based vehicle target detection method, characterized in that, The DINO model is used to generate predicted bounding boxes for vehicle targets in the input image. The training method for the DINO model includes: Step 1: Perform preliminary matching between the predicted bounding boxes and the ground truth bounding boxes, and filter out the effective matching relationships that match the confidence level and positioning accuracy to obtain the first matching pair, the set of unmatched predicted bounding boxes, and the set of unmatched ground truth bounding boxes; the set of unmatched predicted bounding boxes includes several unmatched predicted bounding boxes, and the set of unmatched ground truth bounding boxes includes several unmatched ground truth bounding boxes. Step 2: Construct a bipartite graph using the unmatched predicted bounding boxes and the unmatched ground truth bounding boxes as nodes; Step 3: Input the bipartite graph into the graph neural network to enhance the features of the unmatched predicted bounding boxes and the unmatched ground truth bounding boxes. Specifically, the bipartite graph is input into the first attention layer of the graph neural network. Through a multi-head attention mechanism, the information of the neighboring nodes of each node under different representation subspaces is aggregated to generate high-dimensional intermediate features for each node. The high-dimensional intermediate features of each node are input into the second attention layer of the graph neural network. Through a single-head attention mechanism, the high-dimensional intermediate features of each node are fused and dimensionality reduced to generate enhanced features for each node, resulting in feature-enhanced unmatched predicted bounding boxes and feature-enhanced unmatched ground truth bounding boxes. The graph neural network is a graph attention network, and the multi-head attention mechanism is a four-head attention mechanism. Step 4: Perform a second matching between the feature-enhanced unmatched predicted bounding boxes and the feature-enhanced unmatched ground truth bounding boxes to obtain a second matching pair; Step 5: Merge the first and second matching pairs to form the final matching result; Step 6: Train the DINO model based on the final matching results to optimize the detection performance of the DINO model in occluded scenes; In step 2, constructing a bipartite graph using the unmatched predicted bounding boxes and the unmatched ground truth bounding boxes as nodes includes: Each unmatched predicted bounding box in the set of unmatched predicted bounding boxes is defined as a predicted node, and each unmatched real bounding box in the set of unmatched real bounding boxes is defined as a real node. For each node, a node feature is constructed, which includes the geometric information and semantic features of the unmatched bounding box corresponding to the node; the node is a predicted node or a ground truth node, and the unmatched bounding box is an unmatched predicted bounding box or an unmatched ground truth bounding box. Establish an edge between any two of the nodes; An edge feature is constructed for each edge, and the edge feature is used to characterize the spatial relationship between the unmatched bounding boxes corresponding to the two nodes connected by the edge, resulting in a bipartite graph. 2.The deep learning-based vehicle target detection method of claim 1, wherein, Step 1, the preliminary matching of the predicted bounding box and the ground truth bounding box includes: Calculate the initial matching cost between the ground truth bounding box and the predicted bounding box to obtain the initial matching cost matrix; the initial matching cost reflects the degree of difference between the ground truth bounding box and the predicted bounding box. Based on the preliminary matching cost matrix, the Hungarian matching algorithm is used to solve the problem, and the true bounding box with the minimum total cost is selected for each predicted bounding box as the first matching pair.
3. The vehicle target detection method based on deep learning according to claim 2, characterized in that, Step 4 involves a secondary matching process between the feature-enhanced unmatched predicted bounding boxes and the feature-enhanced unmatched ground truth bounding boxes, including: The quadratic matching cost is calculated between the feature-enhanced unmatched predicted bounding boxes and the feature-enhanced unmatched ground truth bounding boxes to obtain the quadratic matching cost matrix; the quadratic matching cost reflects the degree of difference between the feature-enhanced unmatched predicted bounding boxes and the feature-enhanced unmatched ground truth bounding boxes. Based on the quadratic matching cost matrix, the Hungarian matching algorithm is used to solve the problem, and the true bounding box with the minimum total cost is selected for each predicted bounding box as the second matching pair.
4. The vehicle target detection method based on deep learning according to claim 3, characterized in that, The geometric information includes the center coordinates, width, and height of the unmatched bounding boxes; the spatial relationships include relative distances and intersection-over-union ratios. The relative distance represents the Euclidean geometric distance between the center points of the two unmatched bounding boxes connected by the edge.
5. The vehicle target detection method based on deep learning according to claim 1, characterized in that, The training process of the DINO model also includes dynamic contrastive denoising training, which includes: Construct positive and negative sample queries based on the actual bounding boxes; The positive sample query is generated by adding fixed noise of a preset intensity or no noise to the real bounding box; The negative sample query is generated by adding dynamically decaying noise to the true bounding box so that the difficulty of the negative sample changes adaptively with the training process. The positive and negative sample queries are input into the decoder of the DINO model to generate positive and negative sample prediction boxes. The contrast loss is calculated based on the positive sample prediction box, the negative sample prediction box and the corresponding ground truth bounding box, so that the DINO model can learn to distinguish between positive samples and negative samples. The DINO model is trained using the contrastive loss and the final matching results.
6. The vehicle target detection method based on deep learning according to claim 5, characterized in that, The upper limit of the disturbance of the dynamically decaying noise decreases monotonically with the increase of the training period, as expressed as: , in, For the current training cycle, This represents the upper limit of the dynamic decay noise perturbation during the current training cycle. For the total training cycle, This represents the maximum value of the upper limit of the disturbance for dynamically attenuating noise. This is the minimum value of the upper limit of the disturbance for dynamically attenuating noise.
7. The vehicle target detection method based on deep learning according to claim 1, characterized in that, The loss function used during training is the joint loss function; The joint loss function includes a first loss function for mining difficult samples and a second loss function for achieving quality perception of classification and localization.
8. The vehicle target detection method based on deep learning according to claim 7, characterized in that, The first loss function is a focus loss function; the second loss function is a variable focus loss function.
9. The vehicle target detection method based on deep learning according to claim 8, characterized in that, The joint loss function is a weighted sum of the focal loss function and the variable focal loss function, expressed as: , in, For the joint loss function, For focus loss function, For variable focus loss function, These are the weighting coefficients of the focus loss function. These are the weighting coefficients of the variable focus loss function.
Citation Information
Patent Citations
Unmanned target detection method based on Transform network
CN120411919A
System and method of open-world semi-supervised satellite object detection
US20240395015A1