Target detection method based on cascade query optimization

By combining cascading query optimization and joint loss function, the cascading error and the contradiction between category score and positioning accuracy in complex scenarios of existing target detection algorithms are resolved, achieving higher detection accuracy and stability.

CN120164015BActive Publication Date: 2025-11-21HANGZHOU DIANZI UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510190349.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-02-20
Publication Date
2025-11-21
Estimated Expiration
2045-02-20

AI Technical Summary

Technical Problem

Existing target detection algorithms suffer from cascading errors and discrepancies between category scores and positioning accuracy when dealing with complex scenes, resulting in unstable detection results. In particular, it is difficult to balance accuracy and speed in complex backgrounds and real-time scenarios.

Method used

A target detection method based on cascading query optimization is adopted. By selecting and aggregating intermediate queries and designing a joint loss function, the negative impact of cascading errors is mitigated, and the intrinsic correlation between category scores and positioning accuracy is enhanced.

Benefits of technology

It significantly improves the detection accuracy and stability of the model, enhancing the overall performance of target detection, especially in complex scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120164015B_ABST
    Figure CN120164015B_ABST
Patent Text Reader

Abstract

The present application belongs to the technical field of computer vision target detection algorithm, and particularly relates to a target detection method based on cascade query optimization, comprising the following steps: S1, obtaining a target detection data set and extracting a training set and a test set, pre-processing images of the training set and the test set to obtain respective corresponding standardized images; S2, inputting the standardized images corresponding to the training set into a cascade query optimized target detection model to perform training, and obtaining a trained target detection model; S3, inputting the standardized images corresponding to the test set into the trained target detection model to obtain target classification and positioning coordinates in a to-be-predicted image, drawing a target frame in the image through the positioning coordinates, and labeling a target category. The target detection method based on cascade query optimization effectively reduces the negative influence caused by cascade errors by selecting and aggregating intermediate queries, thereby significantly improving the accuracy of model prediction.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of computer vision target detection algorithm technology, specifically relating to a target detection method based on cascading query optimization. Background Technology

[0002] With the rapid development of deep learning, object detection, as a core task of computer vision, has been widely applied in fields such as autonomous driving, security monitoring, and medical imaging, achieving significant breakthroughs. Object detection algorithms are mainly divided into two categories: two-stage methods and one-stage methods. Two-stage methods (such as Faster R-CNN) generate candidate regions for fine-grained classification and regression. Although they have high accuracy, they have high computational overhead and limited efficiency, especially in complex backgrounds and real-time scenarios where it is difficult to balance accuracy and speed.

[0003] YOLO (You Only Look Once), as a one-stage method, improves detection speed by directly predicting the target's location and category, but it is still limited by anchor point design, resulting in inferior accuracy in complex scenes. FCOS, on the other hand, proposes an anchor-free architecture, simplifying the detection process, improving accuracy, and reducing computational complexity.

[0004] While one-stage and two-stage methods have improved accuracy and efficiency, convolutional neural networks (CNNs) still have limitations in extracting global contextual information, especially when dealing with distant context and small objects. To address these limitations, Feature Pyramid Networks (FPNs) and Deformable Convolutions have improved global perception capabilities through multi-scale information fusion and dynamic kernel adjustment, but they still do not completely solve the problem.

[0005] To further enhance global perception capabilities, the Facebook AI team proposed DETR (DEtectionTRansformer). DETR models the global context through a multi-head self-attention mechanism, enabling it to capture global information in images and driving research progress in the field of object detection. However, DETR still faces the following challenges in practical applications: First, its multi-stage decoding process is prone to cascading errors (such as...). Figure 1 As shown in the figure, the contradiction between category score and positioning accuracy weakens the stability of detection results; secondly, DETR has insufficient detection accuracy in some complex scenarios, which further limits its performance in these scenarios. Summary of the Invention

[0006] The purpose of this invention is to overcome the shortcomings of existing technologies and propose a target detection method based on cascading query optimization. This method effectively mitigates the negative impact of cascading errors by selectively aggregating intermediate queries, thereby significantly improving the overall detection accuracy of the model. Furthermore, this invention proposes an innovative joint loss function that combines classification and regression losses to alleviate the contradiction between category scores and localization accuracy, further enhancing the performance of target detection.

[0007] To achieve the above-mentioned objectives, the present invention adopts the following technical solution:

[0008] A target detection method based on cascading query optimization includes the following steps:

[0009] S1. Obtain the object detection dataset and extract the training set and test set. Preprocess the images in the training set and test set to obtain their respective standardized images.

[0010] S2. Input the standardized images corresponding to the training set into the cascaded query optimization target detection model for training, and obtain the trained target detection model.

[0011] The target detection model optimized by cascading queries includes a spatial feature extraction module, a global feature extraction module, and a cascading query optimization module.

[0012] The training process in step S2 includes the following steps:

[0013] S21. The standardized image input spatial feature extraction module performs deep feature extraction to generate spatial features of dimension (B, C, H, W) and embeds the position code into the spatial features; where B, C, H, and W are the number, height, width, and number of channels of the spatial features, respectively.

[0014] S22. Input the spatial features with location encoding into the global feature extraction module, flatten them, and then input them into the Transformer encoder to generate global features with context awareness.

[0015] S23. The process of inputting global features into the cascaded query optimization module for processing includes: First, constructing a query set, which is dynamically updated and generated by the query vector q in the multi-head self-attention mechanism during the decoding process; then, calculating the score of each query vector in the query set through the query scoring module to form the corresponding query score set S; next, selecting the K highest-scoring indices from the query score set S, filtering the query set according to the index, concatenating the selected queries into a tensor, and inputting it into the decoder layer along with the global features to generate query results; then, decoupling the query results generated by the decoder layer and feeding them back to the query set; after the last decoding stage, processing all queries in the query set through the classification head and regression head to generate prediction results;

[0016] S24. Design the joint loss function of the object detection model and optimize it using gradient descent. During training, continuously adjust the model parameters to minimize the loss function to obtain a well-trained object detection model.

[0017] S3. Input the standardized image corresponding to the test set into the trained target detection model to obtain the target classification and location coordinates in the image to be predicted. Draw the target box in the image using the location coordinates and label the target category.

[0018] Compared with the prior art, the present invention has the following beneficial effects:

[0019] (1) The target detection method based on cascading query optimization of the present invention effectively reduces the negative impact of cascading errors by selecting and aggregating intermediate queries, thereby significantly improving the accuracy of model prediction.

[0020] (2) The target detection model of the present invention uses a joint loss function, which combines class loss and regression loss to enhance the intrinsic correlation between class score and positioning accuracy, and further improves the accuracy of target detection. Attached Figure Description

[0021] Figure 1 This is a schematic diagram of a cascading error in the prior art;

[0022] Figure 2 This is a flowchart of the target detection method according to an embodiment of the present invention;

[0023] Figure 3 This is a diagram of the global feature extraction module in an embodiment of the present invention;

[0024] Figure 4 This is a diagram of the cascading query optimization module according to an embodiment of the present invention;

[0025] Figure 5 This is a diagram of the query scoring module according to an embodiment of the present invention;

[0026] Figure 6 This is a comparison chart of the average accuracy changes during the training process of the target detection model and the DAB-DETR model in this embodiment of the invention;

[0027] Figure 7 This is a comparison chart showing the performance of the target detection model (right side) and the DAB-DETR model (left side) in detecting test set images according to an embodiment of the present invention. Detailed Implementation

[0028] To more clearly illustrate the embodiments of the present invention, specific implementation methods will be described below with reference to the accompanying drawings. Obviously, the drawings described below are merely some embodiments of the present invention. For those skilled in the art, other drawings and other implementation methods can be obtained based on these drawings without any creative effort.

[0029] like Figure 2 As shown, the target detection method based on cascading query optimization in this embodiment of the invention includes steps T1 to T6:

[0030] Step T1 involves obtaining the experimental training and test sets, and the specific steps are as follows:

[0031] T1.1 Download publicly available object detection datasets from the Internet and extract training and test set images and corresponding annotation files (including basic image attributes, object categories, and ground truth bounding box information, etc.);

[0032] T1.2. Randomly flip the images in the training and test sets horizontally, then randomly crop them into sub-images of different sizes and aspect ratios, and then scale the cropped images to one of the set sizes;

[0033] T1.3. Normalize the scaled image according to the given mean and standard deviation to obtain a standardized image.

[0034] The target detection model optimized by cascading queries in this embodiment of the invention includes a spatial feature extraction module, a global feature extraction module, and a cascading query optimization module.

[0035] Step T2 involves using a spatial feature extraction module to extract spatial features from the image and embedding location codes into these features to provide spatial location information. The specific steps are as follows:

[0036] T2.1 Select ResNet50 as the spatial feature extraction module. By performing convolution calculations, pooling operations and activation functions layer by layer, high-dimensional and multi-level spatial features are generated to capture details in the image.

[0037] T2.2. Perform position encoding embedding processing on spatial features; the specific method is to add the position encoding to the spatial features pixel by pixel to enhance the model's ability to perceive the spatial location information of the target.

[0038] Step T3, construct a global feature extraction module, such as Figure 3 As shown, the flattened spatial features are input into the Transformer encoder to generate global features. The specific steps are as follows:

[0039] T3.1 First, the spatial features are flattened into a sequence representation. This sequence is then input into a Transformer encoder, where multi-head self-attention captures the correlation between sequence elements, and positional encoding is used to enhance the global context awareness of the features. Next, after processing by a feedforward neural network, the feature points are mapped to a higher-level representation, further improving the expressive power of the features and helping the model learn complex feature patterns more effectively.

[0040] T3.2 By stacking multiple Transformer encoder layers, global context information is gradually enhanced, ultimately generating global features with global context awareness, providing richer representations for subsequent tasks.

[0041] In step T4, a cascading query optimization module is constructed, such as... Figure 4 As shown, the specific steps are as follows:

[0042] T4.1 First, construct a query set, and then calculate the score for each query vector in the set using the query scoring module, thereby obtaining a query score set. The structure of the query scoring module is as follows: Figure 5 As shown.

[0043] T4.1.1 Calculate the query score S for all queries in the query set, using the following formula:

[0044] S j =Score(q) j )

[0045] S={S 0 ,S 1 ,S 2 ,…}

[0046] Where, q j Let S represent the j-th query vector. j This represents the score of the j-th query. `Score(.)` is the score header module; specifically, the core of this module is a linear layer used to weight the feature representations of all queries. For each query vector `q`... j The data is processed sequentially through linear layers to generate a set of mapped feature vectors y. jThe formula is as follows:

[0047] y j =W j q j +b j

[0048] Among them, W j Let b be the weight matrix. j The bias matrix is ​​used; then, the mapped eigenvector y is... j The eigenvector is processed by the Sigmoid function to restrict all values ​​in the eigenvector to between 0 and 1, resulting in the processed eigenvector z. j The formula is as follows:

[0049]

[0050] Subsequently, these feature values ​​are summed one by one to obtain the overall score S of the query. j The formula is as follows:

[0051]

[0052] Where M is the number of eigenvalues. For the eigenvector z j The i-th feature value in the query is used; the comprehensive score effectively reflects the overall quality of the query and its relevance to the potential target. The query scoring module enables unified modeling and scoring of queries, providing clear quantitative indicators for subsequent screening tasks.

[0053] T4.2 First, select the K highest-scoring indices from the query score set. Then, filter queries from the query set according to their indices and concatenate them into a tensor. Next, input this tensor along with global features into the Transformer decoder to obtain the query results. Finally, decouple the query results and feed them back into the query set for use in the next stage. The specific steps are as follows:

[0054] T4.2.1 First, select the K highest-scoring indices from the score set S, using the following formula:

[0055] topk = Topk(S,K)

[0056] Here, Topk refers to selecting the K highest-scoring indices from the score set S, where topk is the selected K highest-scoring indices;

[0057] T4.2.2. Select K queries from the query set according to topk, and then concatenate the selected K queries to generate a tensor, as shown in the following formula:

[0058] Qt =gather(q t (topk)

[0059] query t =concat(Q t )

[0060] in, It is the query set in the t-th layer decoding stage. The gather operation refers to the operation of gathering data from the query set q. t The corresponding query is retrieved according to the topk index, and concat is the concatenation operation; then the key and value are repeated K times, where the key is the global feature after embedding position encoding, and the value is the global feature; after processing, the three are fed into a multi-head attention mechanism for calculation, as shown in the following formula:

[0061] key t = repeat(key, K)

[0062] value t = repeat(value, K)

[0063] Next, the processed query needs to be... t key t and value t The input is then fed into the decoder for attention calculation, using the following formula:

[0064] output=multihead_attention(query t ,key t ,value t )

[0065] Here, multihead_attention() is the multihead attention computation, and output is the output of the attention mechanism.

[0066] T4.2.3 The output results need to be separated and added to the query set for use in the next stage; after the last decoding stage, all queries in the query set are processed by the classification head and regression head to generate prediction results.

[0067] In step T5, a target detection model based on cascading query optimization is trained. The specific steps are as follows:

[0068] T5.1 First, based on the model's prediction results and the ground truth, construct a cost matrix and calculate the matching cost (e.g., IoU) between the predicted and ground truth boxes. Then, apply the Hungarian algorithm to optimize the cost matrix and find the optimal one-to-one match between each predicted and ground truth box.

[0069]

[0070]

[0071] Where σ(i) is the index of the predicted box that matches the i-th ground truth box. To combine classification loss and regression loss The pairwise matching loss;

[0072] T5.2. Set the joint loss as the total loss of the model. The joint loss calculation process is as follows: First, define t as the weighted arithmetic mean of the confidence score s and the IoU score u, as shown in the following formula:

[0073] t=γ·s+(1-γ)·u

[0074] Here, γ is a hyperparameter used to control the ratio of confidence score to IoU score; if γ = 0, then t = u, and the loss target will depend entirely on the IoU score; if γ = 1, then t = s, and the loss target will depend entirely on the confidence score; then, based on a set of predicted t i Sort the values ​​from largest to smallest to get the sorted position r. i Then according to r i Calculate the weight w of the positive sample i The formula is as follows:

[0075] w i =exp(-r i / τ)

[0076] Where τ is a hyperparameter, w i The purpose of this is to assign a weight to each positive sample to reflect its importance in the learning process; subsequently, t is used i and w i The classification loss has been improved by assigning different weights to positive and negative samples, as shown in the following formula:

[0077]

[0078] Where, N pos N is the number of positive samples. neg The number of negative samples is t, and BCE() is the binary cross-entropy loss. i was w i The factor reduces the weights, and it generates a weaker target for negative samples. For negative samples, loss weights are used. This is to focus on background samples that the model misclassifies as positive. For consistency, the regression loss is also adjusted by w. iThe weights have been reduced, and the formula is as follows:

[0079]

[0080]

[0081] in, For application to predict bounding boxes and the true bounding box b i IoU loss function For L1 loss, λ iou , λ L1 These are hyperparameters used to balance the loss; the total loss of the model is:

[0082]

[0083] Where, N gt λ represents the number of real objects. cls This is a hyperparameter.

[0084] T5.3. Train the target detection model based on cascading query optimization using the training set; configure the training parameters as follows: total batch size is set to N.

[0085] T5.4 First, the images in the training set are input into the spatial feature extraction module to obtain the spatial features required for the model's prediction results and the corresponding set of real targets. Next, the extracted spatial features are input into the global feature extraction module to obtain global features. Then, these global features are fed into the cascaded query optimization module to generate prediction results. Finally, the loss value between the prediction results and the corresponding real labels is calculated using a joint loss function.

[0086] T5.5. The Adam optimizer is used to calculate the gradient of the loss function and update the model parameters using these gradients to minimize the loss and accelerate model convergence. By setting an appropriate learning rate (lr), the optimizer can control the step size of each parameter update, thereby accelerating convergence in the early stages of training and preventing excessively large update steps from causing training instability in the later stages. Ultimately, the optimizer improves the prediction accuracy of the object detection model by continuously updating the model parameters.

[0087] T5.6 Determine if the current model has converged. If yes, obtain the trained object detection model and execute T6; otherwise, continue training and return to T5.4.

[0088] Step T6: Use the trained object detection model to perform object detection on the input image.

[0089] First, the data is input into the spatial feature extraction module to obtain the spatial features required for the model's prediction results and the corresponding set of real targets. Next, the extracted spatial features are input into the global feature extraction module to obtain global features. Then, these global features are fed into the cascaded query optimization module to generate prediction results. Based on the prediction results, target boxes are drawn in the image and the target categories are labeled.

[0090] The detection effectiveness of the target detection method described in this embodiment of the invention can be further verified through the following experiments:

[0091] I. Experimental Conditions

[0092] The computing hardware utilizes an Intel Xeon Silver 4210R processor and four NVIDIA GeForce RTX 3090 graphics cards; the operating system is Ubuntu 18.04. The deep learning framework used is PyTorch 2.0.1, and the computational acceleration frameworks are CUDA 11.8 and cuDNN 8.6.0. Furthermore, this invention uses DAB-DETR as a baseline model for improvement and optimization.

[0093] II. Experiment Content

[0094] Experiment 1: The object detection model and DAB-DETR model in this invention were trained using the COCO 2017 training dataset, and their average accuracy during the training process was recorded. The average accuracy during the training process is as follows: Figure 6 As shown, with the increase of the number of iterations, the AP of the target detection model (red line) in this invention gradually increases and stabilizes at 44.6%, while DAB-DETR (green line) can only reach 42.2%, which is lower than the accuracy of this invention.

[0095] Depend on Figure 6 As can be seen from the curve comparison, with the increase of training iterations, the target detection model in this invention effectively reduces the negative impact of cascading errors through cascading query optimization, and alleviates the contradiction between class score and positioning accuracy through joint loss function, thus the AP gradually improves.

[0096] Table 1 shows the comparison results of various performance indicators for the two models. 50 This represents the average accuracy calculated when IoU is 0.50. AP 75 This represents the average accuracy calculated when IoU is 0.75. AP S AP M and AP L The detection performance was evaluated for small, medium and large objects respectively.

[0097] Table 1 Comparison of various performance indicators of the two models

[0098] Model Training rounds AP <![CDATA[AP 50 ]]> <![CDATA[AP 75 ]]> <![CDATA[AP S ]]> <![CDATA[AP M ]]> <![CDATA[AP L ]]> DAB-DETR 50 42.2 63.1 44.7 21.5 45.7 60.3 The model of the present invention 50 44.6(+2.4) 64.5 47.8 25.1 48.7 62.1

[0099] As shown in Table 1, the target detection model of the present invention outperforms DAB-DETR in all different metrics, indicating that its performance in the target detection task has been comprehensively improved.

[0100] Experiment 2: Randomly select 3 images from the above test dataset and input them into the object detection model and DAB-DETR model of this invention for object detection. The detection results are as follows: Figure 7 As shown.

[0101] from Figure 7 As can be seen, the target detection model of the present invention can identify more objects and has a higher confidence level compared with the DAB-DETR model.

[0102] The target detection method based on cascading query optimization of this invention reduces the negative impact of cascading errors and improves the accuracy of model prediction by selecting and aggregating intermediate queries. Furthermore, this invention proposes a joint loss function that combines class loss and regression loss to enhance the correlation between class scores and localization accuracy, further improving detection accuracy.

[0103] The above description is merely a detailed explanation of preferred embodiments and principles of the present invention. For those skilled in the art, there may be changes in specific implementation methods based on the ideas provided by the present invention, and these changes should also be considered within the scope of protection of the present invention.

Claims

1. A target detection method based on cascading query optimization, characterized in that, Includes the following steps: S1. Obtain the object detection dataset and extract the training set and test set. Preprocess the images in the training set and test set to obtain their respective standardized images. S2. Input the standardized images corresponding to the training set into the cascaded query optimization target detection model for training, and obtain the trained target detection model. The target detection model optimized by cascading queries includes a spatial feature extraction module, a global feature extraction module, and a cascading query optimization module. The training process in step S2 includes the following steps: S21. The standardized image input spatial feature extraction module performs deep feature extraction to generate spatial features of dimension (B, C, H, W) and embeds the position code into the spatial features; where B, C, H, and W are the number, height, width, and number of channels of the spatial features, respectively. S22. Input the spatial features with location encoding into the global feature extraction module, flatten them, and then input them into the Transformer encoder to generate global features with context awareness. S23. The process of inputting global features into the cascaded query optimization module for processing includes: First, constructing a query set, which consists of query vectors from the multi-head self-attention mechanism during the decoding process. The query scores are dynamically updated and generated; subsequently, the score for each query vector in the query set is calculated by the query scoring module to form the corresponding query score set. Next, from the query score set The system selects the K highest-scoring indices from the query set, filters them according to their indices, concatenates the selected queries into a tensor, and inputs it into the decoder layer along with the global features to generate query results. Then, the query results generated by the decoder layer are decoupled and fed back to the query set. After the final decoding stage, all queries in the query set are processed by the classification head and regression head to generate prediction results. S24. Design the joint loss function of the object detection model and optimize it using gradient descent. During training, continuously adjust the model parameters to minimize the loss function to obtain a well-trained object detection model. S3. Input the standardized image corresponding to the test set into the trained target detection model to obtain the target classification and location coordinates in the image to be predicted. Draw the target box in the image using the location coordinates and label the target category.

2. The target detection method according to claim 1, characterized in that, Step S1 specifically includes the following steps: S11. Download the publicly available object detection dataset from the Internet, and extract the training set and test set images and their corresponding annotation files. The annotation files include basic image attributes, object categories, and ground truth bounding box information. S12. Randomly flip the images in the training set and test set horizontally, then randomly crop them into sub-images of different sizes and aspect ratios, and then scale the cropped images to one of the set multiple sizes; S13. Normalize the scaled image according to the given mean and standard deviation to obtain a standardized image.

3. The target detection method according to claim 1, characterized in that, The spatial feature extraction module is ResNet50.

4. The target detection method according to claim 1, characterized in that, The location encoding embeds spatial features by adding the location encoding and spatial features pixel by pixel.

5. The target detection method according to claim 1, characterized in that, Step S22 specifically includes: The spatial features are flattened into a sequence representation, and then the sequence is input into the Transformer encoder. The correlation between sequence elements is captured through a multi-head self-attention mechanism, and positional encoding is combined to enhance the global context awareness of the features. Then, after processing by a feedforward neural network, the feature points are mapped to a higher-level representation. By stacking multiple Transformer encoder layers, global context information is gradually enhanced, ultimately generating global features with global context awareness.

6. The target detection method according to claim 1, characterized in that, In step S23, the score set S is queried using the following formula: ; ; in, Indicates the first A query vector, Indicates the first The score of each query vector. The scoring head module is a linear layer used to weight the feature representations of all query vectors; for each query vector... The data is processed sequentially through linear layers to generate a set of mapped feature vectors. The formula is as follows: ; in, This is the weight matrix. The bias matrix is ​​used; then, the mapped eigenvectors are... The eigenvector is processed using the Sigmoid function to restrict all values ​​in the eigenvector to between 0 and 1, resulting in the processed eigenvector. The formula is as follows: ; Subsequently, the feature values ​​are summed one by one to obtain the overall score of the query. The formula is as follows: ; in, The number of eigenvalues. For feature vectors The first in Each feature value.

7. The target detection method according to claim 6, characterized in that, In step S23, the query score set is... The formula for selecting the K highest-scoring indices is as follows: ; in, This refers to the set of scores. Select the K indexes with the highest scores. These are the K highest-scoring indexes selected. according to Select K queries from the query set, and then concatenate the selected K queries to generate a tensor, as shown in the following formula: ; ; in, It is a query set. Operation refers to the query set According to Retrieve the corresponding query from the index. For the splicing operation; then and Repeated K times, where, For global features after embedding position encoding, These are global features; after processing, they are then fed into a multi-head attention mechanism for calculation, as shown in the following formula: ; ; Next, process the query. , and The input is then fed into the decoder for attention calculation, using the following formula: ; in, It is multi-head attention computing. It is the output of the attention mechanism.

8. The target detection method according to claim 7, characterized in that, In step S24, a cost matrix is ​​constructed based on the prediction results of the target detection model and the real target, and the matching cost IoU between the predicted box and the real box is calculated. Then, the Hungarian algorithm is applied to optimize the cost matrix to find the optimal one-to-one match between each predicted box and the real box. : ; ; in, Is with the first Index of predicted bounding boxes matching the actual bounding boxes To combine classification loss and regression loss The pairwise matching loss; The joint loss is set as the total loss of the model. The calculation process for the joint loss is as follows: First, ... Defined as confidence score And IoU score The weighted arithmetic mean is calculated using the following formula: ; in, This is a hyperparameter used to control the proportion of confidence scores and IoU obtained; if we let ,but The target of the loss will depend entirely on the IoU obtained; if let ,but The loss target will depend entirely on the confidence score; then, based on a set of predictions... Sort the values ​​from largest to smallest to obtain the sort order. Then according to Calculate the weights of positive samples The formula is as follows: ; in, For hyperparameters, The purpose is to assign a weight to each positive sample to reflect its importance in the learning process; subsequently, using and The classification loss is improved by assigning different weights to positive and negative samples, as shown in the following formula: ; in, The number of positive samples. The number of negative samples. For binary cross-entropy loss, For loss weights; ; ; in, For application to predict bounding boxes and the true bounding box IoU loss function For L1 loss, , These are hyperparameters used to balance the loss; the total loss of the model is: ; in, The number of real objects, This is a hyperparameter.

9. The target detection method according to claim 8, characterized in that, In step S24, during the training process, the target detection model based on cascading query optimization is trained using the training set, and the training parameters are configured with the total batch size set to E. First, the images in the training set are input into the spatial feature extraction module to obtain the spatial features required for the model prediction results and the corresponding real target set; next, the extracted spatial features are input into the global feature extraction module to obtain global features. Then, the global features are input into the cascaded query optimization module to generate prediction results; finally, the loss value between the prediction results and the corresponding true labels is calculated through the joint loss function. The Adam optimizer is used to calculate the gradient of the loss function, and the gradient is used to update the model parameters in order to minimize the loss value and accelerate the convergence of the model. Determine if the current model has converged; if yes, obtain the trained object detection model; otherwise, continue training.

Citation Information

Patent Citations

  • Three-dimensional target detection method and device, electronic equipment and storage medium

    CN118298418A

  • Remote sensing target detection method and system based on dynamic adaptive query

    CN119152191A