A target detection method based on a transformer architecture

By introducing the RILDFM module and the perception selection module into the transformer architecture to filter tokens, and combining them with the deformable attention mechanism, the real-time performance and computational complexity issues of the transformer detector are resolved, achieving efficient target detection.

CN117315223BActive Publication Date: 2026-03-03NANKAI UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-09-07
Publication Date
2026-03-03

AI Technical Summary

Technical Problem

Existing object detectors based on the transformer architecture have bottlenecks in real-time performance and computational complexity. In particular, due to the computational complexity of the attention mechanism and the use of NMS, it is difficult to achieve efficient end-to-end detection.

Method used

A novel fusion module (RILDFM) was designed to adjust the weights of different feature layers. A perceptual selection module was used to filter high-quality tokens and remove useless tokens. The decoder was optimized by combining a deformable attention mechanism and a positive and negative sample denoising training method was adopted to reduce the computational loss of cross-attention processing.

Benefits of technology

It effectively reduces computational overhead, improves the real-time performance and detection accuracy of the target detector, and achieves more efficient end-to-end detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117315223B_ABST
    Figure CN117315223B_ABST
Patent Text Reader

Abstract

The application relates to the technical field of computer vision, and provides a target detection method based on a transformer architecture. The method comprises the following steps: assembling a training set to pre-train a backbone network; creating a fusion module to refine a low-layer feature map and fuse the low-layer feature map and a high-layer feature map processed by an encoder; creating a perception selection module to select high-quality tokens and initialize object queries for a decoder; creating the perception selection module to remove useless tokens in a memory feature layer to optimize the decoder; adding different scale noises to real target detection boxes to obtain positive and negative sample denoising groups; performing cross-attention operation on multiple groups of positive and negative sample denoising groups, object queries and the memory feature layer to obtain training loss; and training an overall network to obtain a target detector to obtain a detection result. The application can improve the accuracy and recognition speed of an interest target detection, thereby improving the automation and intelligent level of a target detection task.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer vision technology, and in particular to a target detection method based on the transformer architecture. Background Technology

[0002] Object detection has always been a fundamental yet crucial task in the field of computer vision. Its purpose is to predict the bounding box of an object of interest in an image and its corresponding category. It has been widely applied in various fields such as video surveillance, disease detection, crime early warning, and shipwreck search.

[0003] Currently, detectors in the field of object detection are mainly divided into two major architectures: object detectors based on convolutional neural network architecture (CNN-based) and object detectors based on transformer architecture (Transformer-based).

[0004] CNN-based detectors still require Non-Maximum Suppression (NMS) to filter out a large number of redundant boxes during post-processing, leading to computational bottlenecks. Furthermore, the hyperparameters of NMS significantly impact the accuracy and speed of the detector. Therefore, CNN-based algorithms cannot be considered true end-to-end detectors, and due to the unavoidable use of NMS, further improvements in their real-time performance face insurmountable challenges.

[0005] Compared to CNN-based object detectors, DETR (Deep Transformer Detection and Redirection) achieves true end-to-end object detection by eliminating manual elements such as pre-selection and NMS (Non-Maximum Suppression). While various DETR methods have achieved certain results, their real-time performance remains a significant challenge due to the computational complexity bottleneck of the transformer attention mechanism. Furthermore, simply reducing the number of feature layers executing the attention mechanism to decrease computational overhead without considering adjustments to the attention mechanism's implementation further hinders its real-time performance improvement. Summary of the Invention

[0006] This invention aims to address at least one of the technical problems existing in related technologies. To this end, this invention provides a target detection method based on a transformer architecture.

[0007] A target detection method based on transformer architecture includes:

[0008] S1: Construct a training set for object detection based on the existing dataset;

[0009] S2: Select the backbone network, select the target detection and recognition set to pre-train the backbone network to obtain the pre-trained network, and create a fusion module, a perception selection module and a detection head network to build an overall network with the pre-trained network;

[0010] S3: The fusion module refines the low-level feature map and fuses the refined low-level feature map with the high-level feature map processed by the encoder in the overall network.

[0011] S4: Using the perception selection module, a token is selected with bounding box information and category information as targets to obtain the token selection result. The token selection result is used to initialize object query for the decoder in the overall network.

[0012] S5: Remove useless tokens from the memory feature layer of the overall network through the perception selection module, and optimize the decoder by removing the memory feature layer after removing useless tokens;

[0013] S6: Add positive sample noise and negative sample noise to the real target detection boxes used to train the overall network to obtain positive and negative sample denoising groups. Perform cross-attention operation on multiple pairs of positive and negative sample denoising groups, the object query and the memory feature layer in the decoder. Convert the cross-attention output into detection results through the detection head network. Process the detection results through the loss function to obtain the training loss.

[0014] S7: Train the overall network using the training loss to obtain a target detector, and use the target detector to detect the target detection training set to obtain detection results.

[0015] According to the target detection method based on transformer architecture provided by the present invention, the fusion module in step S2 includes multiple upsampling units and multiple downsampling units. The upsampling units are implemented by the bilinear interpolation method, and the downsampling units are implemented by the max pooling method.

[0016] According to the target detection method based on transformer architecture provided by the present invention, step S4 includes:

[0017] S41: Send the memory feature layer into the perception selection module to obtain the category score corresponding to each token in the memory feature layer;

[0018] S42: Select the high-scoring token based on the category rating as the content query;

[0019] S43: Obtain the bounding box prediction result by predicting the high-scoring token, and encode the bounding box prediction result as a location query;

[0020] S44: Add the content query and the location query to obtain the initialized object query.

[0021] According to the target detection method based on transformer architecture provided by the present invention, the useless token in step S5 is a token that does not contain feature information of the target of interest.

[0022] According to the object detection method based on transformer architecture provided by the present invention, the object detector in step S7 includes multiple decoders, wherein each decoder in the object detector includes a first processing mode and a second processing mode. The first processing mode is self-attention processing of the object query, and the second processing mode is cross-attention processing of the interaction between the object query, the positive and negative sample denoising group, and the memory feature layer after removing useless tokens.

[0023] According to the object detection method based on transformer architecture provided by the present invention, the second processing method is a deformable attention mechanism.

[0024] According to the target detection method based on transformer architecture provided by the present invention, step S3 further includes:

[0025] The fusion module outputs a fusion result of the refined low-level feature map and the high-level feature map processed by the encoder in the overall network, and adjusts the fusion result into the form required by the perception selection module.

[0026] According to the target detection method based on transformer architecture provided by the present invention, step S7 further includes:

[0027] An object detection validation set is constructed from the existing dataset, and the object detector is validated using the object detection validation set.

[0028] This invention provides a target detection method based on a transformer architecture. After analyzing the Neck part of RT-DETR, a new fusion module (ReduceInformationLevelDifferences and Feature-Fusion modules; RILDFM) is designed to adjust the weights of different feature layers when performing feature fusion processing on the PAN part. The processed feature layers are then fused to reduce the negative impact of information level differences between different feature layers. This also lays the foundation for subsequent technical improvements. In addition, a perceptual selection module is designed to initialize the object query in the decoder layer. The perceptual selection module is also used to find and discard useless tokens with lower scores or even close to 0, reducing the number of tokens in K and V when performing cross-attention processing. This effectively reduces the computational cost of cross-attention processing in the decoder and improves the real-time performance of the target detector.

[0029] Additional aspects and advantages of the invention will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. Attached Figure Description

[0030] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0031] Figure 1 This is a flowchart of a target detection method based on the transformer architecture provided in an embodiment of the present invention. Detailed Implementation

[0032] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention. The following embodiments are used to illustrate this invention but should not be used to limit the scope of this invention.

[0033] In the description of the embodiments of the present invention, it should be noted that the terms "center," "longitudinal," "lateral," "upper," "lower," "front," "rear," "left," "right," "vertical," "horizontal," "top," "bottom," "inner," and "outer," etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are only for the convenience of describing the embodiments of the present invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on the embodiments of the present invention. In addition, the terms "first," "second," and "third" are used for descriptive purposes only and should not be construed as indicating or implying relative importance.

[0034] In the description of the embodiments of the present invention, it should be noted that, unless otherwise explicitly specified and limited, the terms "connected" and "linked" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium. Those skilled in the art can understand the specific meaning of the above terms in the embodiments of the present invention based on the specific circumstances.

[0035] In embodiments of the present invention, unless otherwise explicitly specified and limited, "above" or "below" the second feature can mean that the first feature is in direct contact with the second feature, or that the first feature is in indirect contact with the second feature through an intermediate medium. Furthermore, "above," "on top of," and "over" the second feature can mean that the first feature is directly above or diagonally above the second feature, or simply that the first feature is at a higher horizontal level than the second feature. "Below," "below," and "under" the second feature can mean that the first feature is directly below or diagonally below the second feature, or simply that the first feature is at a lower horizontal level than the second feature.

[0036] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., refer to specific features, structures, materials, or characteristics described in connection with that embodiment or example, which are included in at least one embodiment or example of the present invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of different embodiments or examples.

[0037] The following is combined Figure 1 Embodiments of the present invention are described.

[0038] This invention provides a target detection method based on the transformer architecture, comprising:

[0039] S1: Construct a training set for object detection based on the existing dataset;

[0040] S2: Select the backbone network, select the target detection and recognition set to pre-train the backbone network to obtain the pre-trained network, and create a fusion module perception, selection module and detection head network to build an overall network with the pre-trained network;

[0041] Furthermore, in this invention, ResNet-50 is selected as the backbone network and pre-trained on the ImageNet object recognition dataset. The image size input to the backbone network is... Next, the output feature layers S3, S4, and S5 are selected for the next step. The dimensions of feature layers S3, S4, and S5 are respectively... , , .

[0042] Based on the analysis of the Neck network part of RT-DETR, this invention believes that processing only the S5 feature layer in the encoder part will increase the difference in information feature level between it and the S3 and S4 feature layers. Directly fusing them will have a negative impact on the final result. Therefore, a fusion module was designed.

[0043] S3: The fusion module refines the low-level feature map and fuses the refined low-level feature map with the high-level feature map processed by the encoder in the overall network.

[0044] Furthermore, the Neck network contains two parts: an encoder and a fusion module (RILDFM module). In this invention, only the S5 feature map is fed into the encoder for self-attention processing, and then the S3 and S4 feature layers and the feature layers obtained after encoder processing are fed into the RILDFM module for fusion processing. The processed feature map is then adjusted to a form that the perceptual selection module can process.

[0045] In step S2, the fusion module includes multiple upsampling units and multiple downsampling units. The upsampling units are implemented using the bilinear interpolation method, and the downsampling units are implemented using the max pooling method.

[0046] Furthermore, the RILDFM module contains multiple upsampling and downsampling modules, implemented using bilinear interpolation and max pooling methods respectively. The aim is to maintain scale consistency during feature map fusion. Before each fusion, the low-level feature maps are refined by a Refinement Module (RRM) to reduce the information hierarchy differences between them and higher-level feature maps. Each RRM module contains one SE module and multiple... Convolutional layer.

[0047] Step S3 further includes:

[0048] The fusion module outputs a fusion result of the refined low-level feature map and the high-level feature map processed by the encoder in the overall network, and adjusts the fusion result into the form required by the perception selection module.

[0049] Furthermore, the PAN structure network ultimately outputs feature maps at three different scales, with specific dimensions as follows: , , , put them in H Expanding along the W-axis and concatenating the images, each image can be obtained... The feature map of dimension 1 is used as the output of the Neck network part.

[0050] S4: Using the perception selection module, a token is selected with bounding box information and category information as targets to obtain the token selection result. The token selection result is used to initialize object query for the decoder in the overall network.

[0051] Furthermore, the perception selection module is an IOU perception query selection module. The perception selection module mainly has two purposes: first, to select and initialize suitable high-quality object queries for the decoder, reducing the difficulty of query optimization; second, to filter and remove redundant low-quality tokens through cross-attention processing, reducing the computational loss in the decoder and improving the real-time performance of the detector.

[0052] Step S4 includes:

[0053] S41: Send the memory feature layer into the perception selection module to obtain the category score corresponding to each token in the memory feature layer;

[0054] S42: Select the high-scoring token based on the category rating as the content query;

[0055] S43: Obtain the bounding box prediction result by predicting the high-scoring token, and encode the bounding box prediction result as a location query;

[0056] S44: Add the content query and the location query to obtain the initialized object query.

[0057] Furthermore, since the target information is contained in the memory feature map output by the Neck network, and the object query required by the decoder contains bounding box information and semantic information about the target of interest in the image, it is reasonable to select high-quality tokens from the memory to initialize the object query.

[0058] Furthermore, the above method is specifically implemented as follows: the memory feature layer obtains the category score corresponding to each token through the IOU perception unit in the perception selection module, selects the 300 tokens with the highest scores as content queries based on the category scores, obtains the corresponding bounding box prediction results through the bounding box prediction module for these tokens, encodes them as location queries, and finally adds the content query and the location query to obtain the initialized object query.

[0059] The object queries obtained using this method contain higher quality target bounding box and category information, making them easier to optimize during model training and accelerating model convergence.

[0060] S5: Remove useless tokens from the memory feature layer of the overall network through the perception selection module, and optimize the decoder by removing the memory feature layer after removing useless tokens;

[0061] In step S5, the useless token is a token that does not contain feature information of the target of interest.

[0062] Furthermore, for tokens corresponding to low class scores, we believe that they are very likely to correspond to foreground information in the image, containing little or no feature information of the target of interest. Therefore, they provide almost no positive benefit for the prediction of the final bounding box, but consume a lot of computational resources when performing cross-attention processing, thus affecting the real-time performance of the detector.

[0063] Furthermore, to address this issue, this invention filters out 1000 tokens with low scores and discards them. The new memory obtained after discarding low-scoring tokens is then fed into the decoder for cross-attention processing to reduce the computational cost of the decoder, break through the computational cost bottleneck of the transformer attention mechanism, and effectively improve the real-time performance of the detector.

[0064] S6: Add positive sample noise and negative sample noise to the real target detection boxes used to train the overall network to obtain positive and negative sample denoising groups. Perform cross-attention operation on multiple pairs of positive and negative sample denoising groups, the object query and the memory feature layer in the decoder. Convert the cross-attention output into detection results through the detection head network. Process the detection results through the loss function to obtain the training loss.

[0065] Furthermore, regarding the optimization problem of the bipartite graph matching part, this invention adopts a positive and negative sample denoising training method. That is, for each image, ten pairs of positive and negative sample denoising groups are designed to participate in the cross-attention operation of the decoder part. After the detection head predicts, the positive and negative sample denoising groups do not participate in the bipartite graph matching process of 300 object queries. Instead, another matching group is designed for them and the prediction loss is calculated separately.

[0066] Furthermore, the settings for positive and negative sample denoising groups are mainly reflected in the size of the noise added to the ground truth bounding boxes. Generally, a smaller noise scale is added to the positive sample denoising group to make the ground truth bounding boxes more likely to "accept" it; a relatively larger noise scale is added to the negative sample denoising group to make the ground truth bounding boxes more likely to "reject" it. However, it should be noted that the noise scale added to the negative samples should also be within a certain range to ensure that the denoising training is not affected by the distant bounding boxes.

[0067] S7: Train the overall network using the training loss to obtain a target detector, and use the target detector to detect the target detection training set to obtain detection results.

[0068] Step S7 further includes:

[0069] The target detector is validated using the target detection validation set, which is a component of the existing dataset.

[0070] In step S7, the target detector includes multiple decoders, and each decoder in the target detector includes a first processing method and a second processing method. The first processing method is the self-attention processing of the object query, and the second processing method is the cross-attention processing of the object query, the positive and negative sample denoising group, and the memory feature layer after removing useless tokens.

[0071] The second processing method is a deformable attention mechanism.

[0072] Furthermore, the object detector in this invention contains 6 decoders, each with a corresponding detection head to output detection results. Each decoder includes a self-attention process for object query and a cross-attention process for object query interaction with the memory feature layer. The implementation of the self-attention process is consistent with that in the encoder, which is a classic self-attention implementation method. The implementation of the cross-attention process adopts a deformable attention mechanism to further reduce the required computational loss and accelerate model convergence.

[0073] Furthermore, after obtaining the prediction results through the detection head, the denoised group prediction results need to be bipartitely matched with the prediction results of 300 object queries. The loss function for the denoised group uses the classic loss function, that is, calculating the corresponding loss for the category prediction score and the detection box separately. The loss calculation function for the positive and negative sample denoised group is as follows:

[0074]

[0075] in, The loss calculation function for the denoised groups of positive and negative samples is... For binary cross-entropy loss, To compare the losses, For the target true category, This is the actual detection frame. To predict the target category, To predict the detection box, The set of target true categories and true bounding boxes. This is used to predict the target category and the set of predicted detection boxes.

[0076] The loss calculation function for 300 object queries needs to incorporate the IOU loss into the category loss calculation to ensure that the perceptual selection module can comprehensively consider the IOU loss and category loss between the detection box and the ground truth box when filtering tokens. The intersection-union loss is mainly used to determine the similarity between two sets, so that the finally selected tokens have both high category scores and detection box scores. The loss calculation function for object queries is as follows:

[0077]

[0078] in, This is the loss calculation function for the object query.

[0079] Furthermore, regarding the design of the loss function, we considered the global network and also incorporated the perceptual selection module. We added the cross-entropy ratio loss to the binary cross-entropy loss function. Without affecting the global result, we adjusted the perceptual selection module to make it more inclined to select tokens with both high classification scores and high cross-entropy ratios to initialize object queries in the decoder. This also ensured that the tokens that were filtered out had both low classification scores and low cross-entropy ratios, thus making it easier to accelerate model convergence.

[0080] In some embodiments, a general object detection training set and validation set are first constructed: For model training, this invention selects the COCO 2017 object detection dataset. The COCO 2017 dataset includes a training set (118,287 images), a validation set (5,000 images), and a test set (40,670 images), and provides various high-quality annotations. The objects of interest within the images contain a total of 80 subclasses, with non-contiguous class IDs, the maximum being 90. The proposed object detector is trained on the COCO2017 training set and validated on the COCO2017 validation set. The evaluation metric uses the standard COCO AP metric, with a single scale image as input.

[0081] Secondly, model training was performed: training was conducted based on the Baidu PaddlePaddle deep learning framework, with the following hyperparameter settings: 72 training epochs, batch size of 8 input images per epoch, initial learning rate of 0.0001, poly training method, learning rate decay of 0.9, weight decay of 0.0005, input image resolution of 640×640, AdamW optimizer selected, momentum of 0.9, and data augmentation methods including random color changes, random expansion, random cropping, random flipping, random size changes, and mosaic enhancement.

[0082] Next, input the COCO 2017 test set and obtain the results: After training, input the COCO 2017 test set into the network to obtain the target detection results of the images. The test set does not require the setting of positive and negative sample denoising groups, bipartite graph matching and calculation of function loss, etc. The detection and recognition results of each image can be obtained directly, and the real-time performance of the detector can be evaluated by how many images are processed per second.

[0083] The overall framework of the PAF-DETR network architecture designed in this invention includes a backbone network, a Neck network (containing an encoder and a RILDFM module), a perception selection module (IOU perception query selection module), six decoders and their respective corresponding detection head modules.

[0084] The backbone network uses ResNet-50, which has been pre-trained on ImageNet, as the main network. It is responsible for initially extracting features from the input image, and the S3, S4 and S5 feature layers output by ResNet will be used for further processing.

[0085] The neck section includes an encoder and a RILDFM module. In this invention, only the S5 feature layer is fed into the encoder for self-attention processing to refine its features. The S5 feature layer processed by the encoder will be referred to below as... Considering that feature layers S3 and S4 are both "raw images" output by the backbone network, therefore, they are similar to... The feature layers have differences in information hierarchy, and directly fusing them will negatively affect the final result. Therefore, this invention uses the RILDFM module to fuse S3, S4, and... The RILDFM module processes and fuses the feature layers. It first processes the S3 and S4 feature layers through an SE module to reduce their size. The information hierarchy differences between feature layers are then fused through a PAN network module, and the final output is sent to the perception selection module for further processing.

[0086] The perceptual selection module transforms the output of the Neck section into category prediction scores. In this invention, the 300 tokens corresponding to the highest scores are used to initialize the object query in the decoder, while the 1000 tokens corresponding to the lowest scores are discarded. The simplified feature map is used as K (key vector at all time steps) and V (value vector at all time steps) in the cross-attention processing within the decoder. This effectively reduces the computational cost of cross-attention processing in the decoder with almost no impact on detection accuracy, improving the real-time performance of the detector. In each decoder, the initialized query is first subjected to self-attention processing, then cross-attention processing is performed between it and the filtered and simplified output feature map. Finally, the resulting query is processed by the detection head to obtain the output result. In training mode, a bipartite graph matching method is further used to match the predicted result with the real object detection box, and the model parameters are adjusted by gradient backpropagation using the loss function. This invention follows the DINO method, adding forward and reverse denoising groups in the decoder to optimize the bipartite graph matching part, further accelerating model convergence and improving measurement accuracy.

[0087] This invention provides a target detection method based on a transformer architecture, proposing a novel convolutional neural network structure, the RILDFM module, and an IOU-aware query filtering and elimination strategy. The RILDFM module utilizes an SE module and multiple... Convolutional layers are used to reduce the information hierarchy differences between feature maps of different sizes to be fused, thereby improving the detection performance of the detector. The IOU-aware query filtering and elimination strategy can filter and eliminate low-scoring useless tokens in the memory of the Neck output, reduce the computational cost of the cross-attention mechanism in the decoder, and improve the real-time performance of the detector. Through the target detection method and network model provided by this invention, the accuracy and recognition speed of the detection of targets of interest in the image can be improved, thereby improving the automation and intelligence level of the target detection and recognition task.

[0088] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A target detection method based on transformer architecture, characterized in that, include: S1: Construct a training set for object detection based on the existing dataset; S2: Select a backbone network, select a target recognition dataset to pre-train the backbone network to obtain a pre-trained network, and create a fusion module, a perception selection module, and a detection head network to build an overall network with the pre-trained network; the backbone network is used to extract features from the input image. S3: The fusion module refines the low-level feature map and fuses the refined low-level feature map with the high-level feature map processed by the encoder in the overall network. S4: Using the perception selection module, a token is selected with bounding box information and category information as targets to obtain the token selection result. The token selection result is used to initialize object query for the decoder in the overall network. S5: Remove useless tokens from the memory feature layer of the overall network through the perception selection module, and optimize the decoder by removing the memory feature layer after removing useless tokens; S6: Add positive sample noise and negative sample noise to the real target detection boxes used to train the overall network to obtain positive and negative sample denoising groups. Perform cross-attention operation on multiple pairs of positive and negative sample denoising groups, the object query and the memory feature layer in the decoder. Convert the cross-attention output into detection results through the detection head network. Process the detection results through the loss function to obtain the training loss. S7: Train the overall network using the training loss to obtain a target detector, and use the target detector to detect targets on the test set to obtain detection results.

2. The target detection method based on transformer architecture according to claim 1, characterized in that, The fusion module in step S2 includes multiple upsampling units and multiple downsampling units. The upsampling units are implemented using the bilinear interpolation method, and the downsampling units are implemented using the max pooling method.

3. The target detection method based on transformer architecture according to claim 1, characterized in that, Step S4 includes: S41: Send the memory feature layer into the perception selection module to obtain the category score corresponding to each token in the memory feature layer; S42: Select the 300 tokens with the highest scores based on the category ratings for content queries; S43: Obtain the bounding box prediction result by predicting the high-scoring token, and encode the bounding box prediction result as a location query; S44: Add the content query and the location query to obtain the initialized object query.

4. The target detection method based on transformer architecture according to claim 1, characterized in that, The useless token in step S5 is a token that does not contain feature information of the target of interest.

5. The target detection method based on transformer architecture according to claim 1, characterized in that, The target detector in step S7 includes multiple decoders, wherein each decoder in the target detector includes a first processing method and a second processing method. The first processing method is the self-attention processing of the object query, and the second processing method is the cross-attention processing of the object query, the positive and negative sample denoising group, and the memory feature layer after removing useless tokens.

6. The target detection method based on transformer architecture according to claim 5, characterized in that, The second processing method is a deformable attention mechanism.

7. The target detection method based on transformer architecture according to claim 1, characterized in that, Step S3 also includes: The fusion module outputs a fusion result of the refined low-level feature map and the high-level feature map processed by the encoder in the overall network, and adjusts the fusion result into the form required by the perception selection module.

8. The target detection method based on transformer architecture according to claim 1, characterized in that, Step S7 also includes: An object detection validation set is constructed from the existing dataset, and the object detector is validated using the object detection validation set.

Citation Information

Patent Citations

  • Target detection model training method and related device

    CN114332479A

  • Target detection method and system based on Transform and fusion attention mechanism

    CN115908772A