2D object detection method based on bidirectional interaction transformer
Patent Information
- Application Number
- CN202410793090.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-19
- Publication Date
- 2026-09-18
- Estimated Expiration
- 2044-06-19
AI Technical Summary
[0009]本发明目的是为了解决基于传统深度学习的目标检测方法进行目标检测时,存在无法提取全局特征、提取特征能力差的问题;本发明提供了一种基于双向交互Transformer的2D目标检测方法
[0047] This invention proposes a 2D target detection method based on a bidirectional interactive Transformer, which can fully utilize the integration potential of multi-level features to distinguish similar image patches. The invention aims to effectively handle the interaction of local and global information from multi-level features, thereby identifying unique targets, outputting position and region size parameters, and completing target detection. Its specific advantages are as follows:
Smart Images

Figure CN118823306B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of object detection applied to deep learning. Background Technology
[0002] Object detection is a key task in deep learning and computer vision, aiming to locate and identify target objects in images or videos. For the output, object detection not only needs to determine whether a certain type of object exists in an image, but also needs to return the bounding box of each object and its class label.
[0003] The development of object detection methods can be broadly divided into two periods: the era of traditional manual detection algorithms and the era of deep learning-based detection algorithms. Before the rise of deep learning, traditional object detection methods were the primary image processing techniques. These methods relied on manually designed feature extraction and classic machine learning algorithms, typically including the following steps: First, image preprocessing, i.e., standardizing the input image. Next, candidate region generation, usually achieved through the sliding window method, involves sliding a window across the image at a certain step size and scale to generate a large number of candidate regions, with each image patch within the window serving as a potential object detection region. After the candidate regions are determined, feature extraction is performed, aiming to extract features that describe the target object from the image patches. After feature extraction, a machine learning classifier is used to classify these features to determine whether the candidate region contains the target object. Common classifiers include AdaBoost, SVM, and Random Forest. Among these, the combination of Haar features and AdaBoost was widely used in early face detection, while the combination of HOG features and SVM is commonly used for pedestrian detection. The final step is post-processing to improve the accuracy and robustness of the detection results. Common post-processing techniques include Non-Maximum Suppression (NMS), used to remove overlapping detection boxes and retain the highest-confidence boxes, and bounding box refining, used to further refine the position and size of bounding boxes. The sliding window method is a simple and direct approach that detects targets by sliding windows of different sizes and scales across the image. While easy to implement, it is computationally intensive and inefficient. Haar features + Adaboost utilizes Haar features for fast feature extraction and combines them with the Adaboost algorithm to build a cascaded classifier, suitable for real-time face detection, but with poor robustness to changes in illumination and pose. The HOG features + SVM method uses HOG features to describe local gradient directions and then uses SVM for classification, widely used in pedestrian and vehicle detection. While it offers high detection accuracy, it has high computational complexity. DPM (Deformable Part Model) decomposes the target object into multiple deformable parts, each described by HOG features, and detects them using optimization techniques. It is suitable for target detection in complex scenes, but the model is complex and computationally expensive. Although traditional object detection methods have achieved some success in specific applications, they also have problems such as high computational complexity and insufficient robustness to complex scenes.
[0004] Deep learning-based object detection algorithms have made significant progress in recent years, mainly thanks to the development of CNNs. These algorithms typically achieve high accuracy and efficiency in object detection on complex image data.
[0005] First, R-CNN is an early deep learning object detection method. Its basic process includes: first, using a selective search algorithm to generate candidate regions, which may contain target objects; then, cropping and resizing each candidate region to a fixed size, inputting it into a pre-trained convolutional neural network to extract features; finally, using an SVM to classify the extracted features, determining whether the candidate regions contain target objects, and using a regressor to adjust the bounding boxes. Fast R-CNN is an improved version of R-CNN, significantly improving detection efficiency by inputting the entire image into a convolutional neural network to generate feature maps. In Fast R-CNN, features are first extracted from the entire image, then candidate regions are generated on the feature maps. Each candidate region is mapped to a fixed size using RoI pooling layers, followed by classification and bounding box regression. This method combines candidate region generation and feature extraction, reducing redundant computation and improving detection speed. Faster R-CNN further improves upon Fast R-CNN by introducing a Region Proposal Network (RPN). First, image feature maps are extracted using a convolutional neural network. Then, a sliding window is used to generate anchor boxes on the feature maps, and each anchor box undergoes binary classification (foreground or background) and bounding box regression. After generating candidate regions, they are resized to a fixed size using RoI pooling, and finally, object classification and bounding box regression are performed. Faster R-CNN achieves end-to-end training through RPN, significantly improving detection speed and accuracy.
[0006] In addition, YOLO is a single-stage object detection method characterized by its speed and real-time performance. YOLO's single-pass processing method significantly improves detection speed, making it suitable for real-time applications. SSD is also a single-stage detection method, similar to YOLO, but differs in its multi-scale feature extraction. SSD utilizes multi-scale feature maps to process targets of different sizes, improving detection accuracy. RetinaNet introduces FPN and Focal Loss to enhance the detection capability for small and difficult-to-detect targets, achieving a significant improvement in detection accuracy.
[0007] Deep learning-based object detection algorithms extract features through convolutional neural networks and combine them with candidate region generation, bounding box regression, and object classification to achieve efficient and high-precision object detection. The R-CNN series of methods improves detection efficiency and accuracy by progressively optimizing the candidate region generation and feature extraction processes. YOLO and SSD achieve real-time object detection through single-stage detection methods. RetinaNet further enhances its ability to detect small and difficult-to-detect targets by introducing multi-scale feature pyramids and FocalLoss. With continuous technological advancements, these deep learning methods have increasingly broad application prospects in object detection. However, traditional object detection methods have significant shortcomings in extracting global features. Traditional convolutional neural networks (CNNs) rely on local receptive fields. Although stacking multiple convolutions can expand the receptive field, it is still limited in capturing global features. This limitation is particularly pronounced when dealing with large targets or scenarios requiring global consistency. Pooling layers reduce the size of feature maps through downsampling operations, but also lose some spatial information and detailed features. Multiple pooling operations cause features to be gradually diluted, affecting the ability to capture global information. In addition, traditional attention mechanisms weight data locally, lacking the integration of global contextual information. This means that each bounding box is typically classified and located based only on local features, failing to comprehensively assess global information. Recently, the exceptional ability of visual Transformers to recognize global contextual information has attracted significant research interest, making their application in object detection a new and popular research direction. Ordinary Transformers use query and key vectors to calculate attention matrices, then use these matrices to summarize information from value vectors. While Transformer models have achieved great success in natural language processing tasks, their application in object detection remains relatively limited.
[0008] Therefore, when using traditional deep learning-based object detection methods for object detection, there are problems such as the inability to extract global features and poor feature extraction capabilities. These problems urgently need to be solved. Summary of the Invention
[0009] The purpose of this invention is to address the problems of traditional deep learning-based object detection methods, such as the inability to extract global features and poor feature extraction capabilities. This invention provides a 2D object detection method based on a bidirectional interactive Transformer.
[0010] A 2D object detection method based on bidirectional interactive Transformer, which includes the following steps:
[0011] The constructed 2D object detection network is used to perform object detection on the RGB image to be detected, and the bounding box P = [x, y, w, h] marked with the target region is obtained; where x and y represent the horizontal and vertical directions of the center point of the target region obtained by object detection, respectively, and w and h represent the offsets of the length direction boundary and the width direction boundary of the target region obtained by object detection from the center point, respectively.
[0012] The constructed 2D object detection network includes a backbone network, two bidirectional interactive Transformer modules, two feedforward networks, a fusion module, and a regression head module;
[0013] The Backbone network is used to extract features at different scales from the RGB image to be detected, resulting in three different scale features F1 to F3.
[0014] Features F1 and F2 are sent to the first bidirectional interactive Transformer module for local and global feature interaction, generating a fused feature F. bim1 After being fed into the first feedforward network for feature enhancement, features are generated.
[0015] Features F2 and F3 are sent to the second bidirectional interactive Transformer module for local and global feature interaction, generating a fused feature F. bim2 After being fed into a second feedforward network for feature enhancement, features are generated.
[0016] The fusion module is used for feature... and characteristics After feature fusion, the data is sent to the regression head module to regress the bounding box P.
[0017] Preferably, each bidirectional interactive Transformer module includes a position encoding unit, a self-modulating convolutional unit, and a bidirectional interactive unit (BIM).
[0018] The two features received by each bidirectional interactive Transformer module are defined as U and R, respectively.
[0019] The position encoding unit is used to perform position encoding on the received feature U to obtain the encoded feature.
[0020] The self-modulated convolutional unit receives the encoded features. After performing convolution operations sequentially through convolutional layers with strides of 2 and 1, a weighting factor ω1 is calculated using the Sigmoid activation function to generate local features F. l ;
[0021] Two-way interactive unit BIM is used based on coded features Extract the global features of feature R to obtain the global features F. g ; Obtain global features F g Weighting factor ω g Using weighting factor ω g For local features F l Weighted generation of local features F lg For global features F g and local features F lg Two-way information exchange is performed to obtain the post-interaction feature F. b , and the interactive features F b Integrate into feature U to generate fused feature F bim =F b +Conv(U); Conv(·) is a single convolution operation.
[0022] Preferably,
[0023] Where Sig(·) represents the Sigmoid activation function, and Conv(·) is a single convolution operation. This indicates element-wise multiplication.
[0024] Preferably, the global feature F is obtained. g The implementation methods include:
[0025] Encoded features Mapping to a downsampling space to generate features H1 represents the downsampling space; where C represents the number of channels and H1 represents... The spatial height, W1 represents Spatial width;
[0026] Features Flatten into a sequence Then the features Mapped to query vector Q; Represents the sequence space; where N1 represents Spatial length;
[0027] Map the features R to another downsampling space to generate features. feature The spatial height and spatial width are n times the spatial height and spatial width of feature R; n is an integer;
[0028] Utilizing features We obtain a key vector K and a value vector V;
[0029] Construct the attention matrix based on Q and K. According to the attention matrix Extract the global information sequence M from V;
[0030] Based on the global information sequence M, the global feature F is obtained. g .
[0031] Preferably, ω g =Sig(Conv(F g ));
[0032] Sig(·) represents the Sigmoid activation function, and Conv(·) represents a single convolution operation.
[0033] Preferably,
[0034] Sig(·) represents the Sigmoid activation function, and Conv(·) represents a single convolution operation. This indicates element-wise multiplication.
[0035] Preferably,
[0036] Cony(·) represents a single convolution operation. This indicates element-wise multiplication.
[0037] Preferably,
[0038] F g =UP(S2I(M));
[0039] DW(·) represents depthwise separable convolution, I2S(·) represents converting an image into a sequence, Softmax(·) represents a normalized exponential function, UP(·) represents an upsampling operation implemented by bilinear interpolation, and S2I(·) represents converting a sequence into an image.
[0040] Preferably, the implementation methods for feature enhancement using feedforward networks include:
[0041] FFN(F bim )=MLP(I2S(GELU(DW(S2I(MLP(I2S(F bim ))))))+F bim
[0042] FFN(F bim ) indicates that the feedforward network responds to the input features F bim Perform feature enhancement operations, F bim =F bim1 or F bim =F bim2MLP(·) represents multilayer perceptron operation, S2I(·) represents converting a sequence into an image, GELUI(·) represents the GELU activation function, DW(·) represents depthwise separable convolution, and I2S(·) represents converting an image into a sequence.
[0043] Preferably, the cross-entropy loss function Loss of the 2D object detection network is expressed as:
[0044]
[0045] Where P represents the total number of categories, y i Represents the label of the i-th actual category, i = 1, 2, ..., P; S i This indicates that the 2D object detection network is for y i The predicted probability, Let be the cross-entropy loss function for the j-th target, and N represent the total number of targets.
[0046] The beneficial effects of this invention are:
[0047] This invention proposes a 2D target detection method based on a bidirectional interactive Transformer, which can fully utilize the integration potential of multi-level features to distinguish similar image patches. The invention aims to effectively handle the interaction of local and global information from multi-level features, thereby identifying unique targets, outputting position and region size parameters, and completing target detection. Its specific advantages are as follows:
[0048] (1) A 2D object detection method based on bidirectional interactive Transformer is proposed. This method is implemented through a 2D object detection network, namely BFTF-OD network, which is a network based on bidirectional interactive Transformer module. It makes full use of the integration potential of multi-level features to distinguish similar image patches.
[0049] (2) This invention introduces a bidirectional interactive Transformer module (BFormer), which can effectively handle the interaction of local and global information of multi-level features, thereby identifying unique features to regress the accurate bounding box P = [x, y, w, h] of the target region, improving the accuracy and efficiency of target detection. Attached Figure Description
[0050] Figure 1 This is a schematic diagram of the principle of a 2D object detection network; where C1 to C3 are the number of channels F1 to F3 respectively, H / 2 is the spatial height of F1 to F3, and W / 2, W / 4 and W / 8 are the spatial widths of F1 to F3 respectively;
[0051] Figure 2This is a schematic diagram illustrating the principles of the bidirectional interactive Transformer module and the feedforward network. Detailed Implementation
[0052] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0053] It should be noted that, unless otherwise specified, the embodiments and features described in the present invention can be combined with each other.
[0054] Example 1:
[0055] See Figure 1 This embodiment describes a 2D object detection method based on a bidirectional interactive Transformer, which includes the following steps:
[0056] The constructed 2D object detection network is used to perform object detection on the RGB image to be detected, and the bounding box P = [x, y, w, h] marked with the target region is obtained; where x and y represent the horizontal and vertical directions of the center point of the target region obtained by object detection, respectively, and w and h represent the offsets of the length direction boundary and the width direction boundary of the target region obtained by object detection from the center point, respectively.
[0057] The constructed 2D object detection network includes a backbone network, two bidirectional interactive Transformer modules, two feedforward networks, a fusion module, and a regression head module;
[0058] The Backbone network is used to extract features at different scales from the RGB image to be detected, resulting in three different scale features F1 to F3.
[0059] Features F1 and F2 are sent to the first bidirectional interactive Transformer module for local and global feature interaction, generating a fused feature F. bim1 After being fed into the first feedforward network for feature enhancement, features are generated.
[0060] Features F2 and F3 are sent to the second bidirectional interactive Transformer module for local and global feature interaction, generating a fused feature F. bim2 After being fed into a second feedforward network for feature enhancement, features are generated.
[0061] The fusion module is used for feature... and characteristics After feature fusion, the data is sent to the regression head module to regress the bounding box P.
[0062] In this embodiment, the bidirectional interactive Transformer module performs local and global feature interaction at multiple levels. The bidirectional interactive Transformer module calculates the correlation between local and global features and performs bidirectional information interaction based on this to enhance the interaction between local and global representations, thereby identifying unique features to regress the accurate bounding box P of the target region.
[0063] Fusing low-level geometric details and high-level semantic information helps improve the distinguishability of similar image patches. Furthermore, the global context information encoded by the Transformer captures the relationship between similar image patches and their surrounding objects, further facilitating the differentiation of similar image patches. The bidirectional interactive Transformer module designed in this invention achieves comprehensive interaction between local and global information of multi-level features.
[0064] (I) Two-way interactive Transformer module
[0065] See Figure 2 Each bidirectional interactive Transformer module includes a position encoding unit, a self-modulating convolutional unit, and a bidirectional interactive unit (BIM).
[0066] (1) Position encoding unit:
[0067] The two features received by each bidirectional interactive Transformer module are defined as U and R, respectively.
[0068] The position encoding unit is used to perform position encoding on the received feature U to obtain the encoded feature.
[0069] (2) Self-modulated convolutional unit:
[0070] The self-modulated convolutional unit receives the encoded features. After performing convolution operations sequentially through convolutional layers with strides of 2 and 1, a weighting factor ω1 is calculated using the Sigmoid activation function to generate local features F. l ;
[0071]
[0072] Where Sig(·) represents the Sigmoid activation function, and Conv(·) is a single convolution operation. This indicates element-wise multiplication.
[0073] (3) Two-way interactive unit BIM:
[0074] Two-way interactive unit BIM is used based on coded features Extract the global features of feature R to obtain the global features F. g ; Obtain global features F g Weighting factor ω g Using weighting factor ω g For local features F l Weighted generation of local features F lg For global features F g and local features F lg Two-way information exchange is performed to obtain the post-interaction feature F. b , and the interactive features F b Integrate into feature U to generate fused feature F bim =F b +Conv(U); Conv(·) is a single convolution operation.
[0075] Furthermore, see Figure 2 The global feature F is obtained. g The implementation methods include:
[0076] Encoded features Mapping to a downsampling space to generate features H1 represents the downsampling space; where C represents the number of channels and H1 represents... The spatial height, W1 represents Spatial width;
[0077] Features Flatten into a sequence Then the features Mapped to query vector Q; Represents the sequence space; where N1 represents Spatial length;
[0078] Map the features R to another downsampling space to generate features. feature The spatial height and spatial width are n times the spatial height and spatial width of feature R; n is an integer;
[0079] Utilizing features We obtain a key vector K and a value vector V;
[0080] Construct the attention matrix based on Q and K. According to the attention matrix Extract the global information sequence M from V;
[0081] Based on the global information sequence M, the global feature F is obtained. g .
[0082] Furthermore, to establish the correlation between local and global features, the bidirectional interactive unit (BIM) first utilizes a convolutional layer and a sigmoid function to process F. g To obtain the weighting factor ω g =Sig(Conv(F g ));
[0083] Sig(·) represents the Sigmoid activation function, and Conv(·) represents a single convolution operation.
[0084] Furthermore, using the weighting factor ω g For local features F l Weighted generation of local features F lg , specifically
[0085]
[0086] Sig(·) represents the Sigmoid activation function, and Conv(·) represents a single convolution operation. This indicates element-wise multiplication.
[0087] Therefore, features F1 and F2 are sent as U and R to the first bidirectional interactive Transformer module, and the first bidirectional interactive Transformer module outputs the fused feature F. bim1 Features F2 and F3 are fed as U and R to the second bidirectional interactive Transformer module, respectively. The second bidirectional interactive Transformer module outputs the fused feature F. bim2 .
[0088] Furthermore, the two-way interactive unit BIM provides global feature F g and local features F lg Element-wise multiplication is performed to achieve bidirectional information exchange between local and global features, resulting in the interacted feature F. b Specifically,
[0089] Conv(·) represents a single convolution operation. This indicates element-wise multiplication.
[0090] Furthermore, the bidirectional interactive unit BIM utilizes two convolutional layers for processing. To extract features and H2 represents the feature space. The spatial height, W2 represents The spatial width. Finally, the two-way interactive unit BIM will... and Flattening the vector into a sequence yields a key vector K and a value vector V. This process can be described as follows:
[0091]
[0092] DW(·) represents depthwise separable convolution, and I2S(·) represents converting an image into a sequence;
[0093] Furthermore, based on the fundamental attention mechanism, the bidirectional interactive unit BIM is based on a sequence of global information extracted from the value vector V. Represents the sequence space, N2 represents Given the space length, an attention matrix is calculated using the query vector Q and the key vector K. The sequence M is converted into an image, and bilinear interpolation is used to increase the resolution to obtain the global features F. g Specifically,
[0094]
[0095] Softmax(·) represents the normalized exponential function, UP(·) represents the upsampling operation implemented by bilinear interpolation, and S2I(·) represents converting the sequence into an image.
[0096] (II) Feedforward Network (FFN):
[0097] Feedforward network FFN will F bim The sequence is converted to one dimension, and then an MLP is used to identify intermediate features. Subsequently, the FFN reshapes the one-dimensional sequence into a two-dimensional feature map to recover the geometric relationships between pixels, and then uses depthwise separable convolution and the GELU activation function to identify local structural information of the image. Afterwards, the feedforward network FFN converts the two-dimensional feature map back into a one-dimensional sequence and uses an MLP to generate enhanced features. Finally, a fast connection architecture is designed to integrate the FFN with the MLP. bim Merge into the enhanced features.
[0098] Therefore, see Figure 2 The methods for implementing feature enhancement using feedforward networks include:
[0099] FFN(F bim )=MLP(I2S(GELU(DW(S2I(MLP(I2S(F bim ))))))+F bim ;
[0100] FFN(F bim ) indicates that the feedforward network responds to the input features F bim Perform feature enhancement operations, F bim =F bim1 or Fbim =F bim2 MLP(·) represents multilayer perceptron operation, S2I(·) represents converting a sequence into an image, GELUI(·) represents the GELU activation function, DWI(·) represents depthwise separable convolution, and I2S(·) represents converting an image into a sequence.
[0101] (III) Regression Head Module:
[0102] The feature with the smallest scale among the three features output by the Backbone base network is used as the high-level feature. Figure 1 The F3 scale is the smallest compared to F1 and F2, so F3 is taken as a high-level feature. Considering the high-level feature F3 and the fused features... and They need to be connected along the channel dimension. Then, regression is performed by designing a regression head module, which can be implemented using existing technologies.
[0103] Specifically, the regression head module can use five MLPs to regress the bounding box P of the target region, i.e., P = [x, y, w, h]. More specifically, the regression head module uses three MLPs to extract intermediate features step-by-step, and then uses two MLPs to predict the center point coordinates and offset of the target region step-by-step.
[0104] (iv) Loss Function:
[0105] Following basic object detection techniques, this invention utilizes the cross-entropy loss function to maximize the probability distribution of predicting the coordinates of the center point and the internal offset of the target scene. The cross-entropy loss function for an image containing any one target can be expressed as:
[0106]
[0107] Where P represents the total number of categories, y i Represents the label of the i-th actual category, i = 1, 2, ..., P; S i This indicates that the 2D object detection network is for y i The predicted probability.
[0108] However, in practical object detection tasks, there are usually multiple samples (i.e., multiple objects in the image), so the overall cross-entropy loss is the average of the cross-entropy losses of all samples. The cross-entropy loss function Loss of a 2D object detection network can be expressed as:
[0109]
[0110] Where N represents the total number of samples (targets), Let represent the cross-entropy loss function for the j-th sample (target).
[0111] Principle Analysis:
[0112] First, in the bidirectional interactive Transformer module, of the two features received, the smaller-scale feature is designated as a low-level feature, and the other as a high-level feature. The bidirectional interactive unit (BIM) within the BIM module utilizes the low-level feature to generate a query vector and the high-level feature to generate key and value vectors, which are treated as input. Therefore, the geometric details captured by the low-level features and the semantic information provided by the high-level features are effectively utilized to distinguish similar image patches. Subsequently, the BIM maps the query, key, and value vectors to a downsampling space and performs an attention mechanism between them to extract global features, effectively reducing computational costs. Then, the BIM module designs self-modulating convolutional units to identify local features. Next, the BIM computes the correlation between local and global features and performs bidirectional information exchange based on this to enhance the interaction between local and global representations. Finally, a feedforward network (FFN) is executed after the BIM to extract unique features. This invention applies to multiple sets of features, ensuring that geometric details and semantic information are fully coordinated. It can effectively handle the interaction of local and global information of multi-level features, thereby identifying unique features to regress the accurate bounding box P = [x,y,w,h] of the target region.
[0113] While the invention has been described herein with reference to specific embodiments, it should be understood that these embodiments are merely examples of the principles and applications of the invention. Therefore, it should be understood that many modifications can be made to the exemplary embodiments, and other arrangements can be designed without departing from the spirit and scope of the invention as defined by the appended claims. It should be understood that different dependent claims and features described herein can be combined in ways different from those described in the original claims. It is also understood that features described in conjunction with individual embodiments can be used in other described embodiments.
Claims
1. A 2D target detection method based on bidirectional interactive Transformer, characterized in that, The method includes the following steps: The constructed 2D object detection network is used to perform object detection on the RGB image to be detected, and the bounding box P = [x,y,w,h] marked with the target region is obtained; where x and y represent the horizontal and vertical directions of the center point of the target region obtained by object detection, respectively, and w and h represent the offsets of the length direction boundary and the width direction boundary of the target region obtained by object detection from the center point, respectively. The constructed 2D object detection network includes a backbone network, two bidirectional interactive Transformer modules, two feedforward networks, a fusion module, and a regression head module; The Backbone network is used to extract features at different scales from the RGB image to be detected, resulting in three different scale features F1 to F3. Features F1 and F2 are sent to the first bidirectional interactive Transformer module for local and global feature interaction, generating fused features. After being fed into the first feedforward network for feature enhancement, features are generated. ; Features F2 and F3 are sent to the second bidirectional interactive Transformer module for local and global feature interaction, generating fused features. After being fed into a second feedforward network for feature enhancement, features are generated. ; The fusion module is used for feature... and characteristics After feature fusion, the data is sent to the regression head module to regress the bounding box P.
2. The 2D target detection method based on bidirectional interactive Transformer according to claim 1, characterized in that, Each bidirectional interactive Transformer module includes a position encoding unit, a self-modulating convolutional unit, and a bidirectional interactive unit (BIM). The two features received by each bidirectional interactive Transformer module are defined as U and R, respectively. The position encoding unit is used to perform position encoding on the received feature U to obtain the encoded feature. ; The self-modulated convolutional unit receives the encoded features. After performing convolution operations through convolutional layers with strides of 2 and 1 respectively, the weighting factor is calculated using the Sigmoid activation function. This generates local features. ; Two-way interactive unit BIM is used based on coded features Extract the global features of feature R to obtain the global features. ; Obtain global features Weighting factor Using weighting factors For local features Weighted generation of local features For global features and local features Two-way information exchange yields post-interaction features , interactive features Integrate into feature U to generate fused features ; .
3. The 2D target detection method based on bidirectional interactive Transformer according to claim 2, characterized in that, ; in, express Activation function This indicates element-wise multiplication.
4. The 2D target detection method based on bidirectional interactive Transformer according to claim 2, characterized in that, Obtain global features The implementation methods include: Encoded features Mapping to a downsampling space to generate features ∈ ; H1 represents the downsampling space; where C represents the number of channels and H1 represents... The spatial height, W1 represents Spatial width; Features Flatten into a sequence ∈ Then the features Mapping to query vector ; Represents the sequence space; where N1 represents Spatial length; Features Mapped to another downsampling space to generate features ,feature Features of spatial height and spatial width The space height and space width are n times each; n is an integer. Utilizing features This yields a key vector. and a value vector ; according to and Constructing the attention matrix According to the attention matrix from Extracting global information sequences ; Based on the global information sequence To obtain global features .
5. The 2D target detection method based on bidirectional interactive Transformer according to claim 2, characterized in that, = ; express Activation function 6. The 2D target detection method based on bidirectional interactive Transformer according to claim 2, characterized in that, ; express Activation function This indicates element-wise multiplication.
7. The 2D target detection method based on bidirectional interactive Transformer according to claim 2, characterized in that, ; This indicates element-wise multiplication.
8. The 2D target detection method based on bidirectional interactive Transformer according to claim 4, characterized in that, , ; , ; This represents depthwise separable convolution. , Normalized exponential function, This indicates an upsampling operation implemented by bilinear interpolation. This indicates that the sequence will be converted into an image.
9. The 2D target detection method based on bidirectional interactive Transformer according to claim 1, characterized in that, The methods for implementing feature enhancement using feedforward networks include: ; This indicates that the feedforward network responds to the input features Perform feature enhancement operations. = or = , This indicates the operation of a multilayer sensor. This indicates that the sequence will be converted into an image. express Activation function This represents depthwise separable convolution.
10. The 2D target detection method based on bidirectional interactive Transformer according to claim 1, characterized in that, Cross-entropy loss function of 2D object detection network The expression is as follows: ; ; in, Indicates the total number of categories. Indicates the first The actual category label, Indicates 2D object detection network for The predicted probability, For the first The cross-entropy loss function for each target. This indicates the total number of targets.
Citation Information
Patent Citations
Anti-occlusion deep neural network target detection method based on spatial perception
CN117893726A
Contextual visual-based SAR target detection method and apparatus, and storage medium
US20230184927A1