A monocular 3D target detection method and device incorporating attention mechanism
By incorporating an attention mechanism into a monocular 3D target detection method, this approach utilizes a 3D gated attention module and a spatial channel reconstruction module to process feature maps. By combining ResNet101 and FPN networks, it addresses the issue of low accuracy in monocular 3D target detection and achieves higher target recognition precision.
Patent Information
- Application Number
- CN202411456549.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-18
- Publication Date
- 2025-11-14
- Estimated Expiration
- 2044-10-18
AI Technical Summary
Existing technologies for monocular 3D target detection have low accuracy, especially when processing large-size image inputs, which leads to reduced precision and real-time performance.
A monocular 3D object detection method with fusion attention mechanism is proposed. The feature map is processed by a 3D gated attention module and a spatial channel reconstruction attention module. By combining ResNet101 network and FPN network, the focus of attention of feature map is enhanced and redundant information interference is reduced.
It improves the accuracy of monocular 3D target detection by focusing on important features and reducing interference from unimportant information, thereby enhancing the precision of target recognition.
Smart Images

Figure CN118968043B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer vision technology, and in particular to a monocular 3D target detection method and apparatus that incorporates an attention mechanism. Background Technology
[0002] Accurate detection of 3D objects in various scenarios has wide applications in autonomous driving, virtual reality, and robotics. To achieve accurate perception of 3D information, many 3D object detection methods rely on depth sensors (such as LiDAR). However, while effective, the use of depth sensors often faces obstacles such as high cost and relatively sparse data. In contrast, monocular 3D object detection has attracted increasing attention due to its use of a monocular RGB camera, which offers a simpler and cheaper deployment setup.
[0003] However, with the rapid development of 3D object detection technology, many problems have emerged. Due to the large image input size in practical applications, considering all input information during training inevitably leads to a decrease in accuracy and real-time performance. Therefore, existing technologies suffer from low accuracy in 3D object detection. Summary of the Invention
[0004] In view of this, the purpose of the present invention is to provide a monocular 3D target detection method and apparatus that integrates attention mechanisms, aiming to solve the problem of low accuracy in identifying monocular 3D targets in the prior art.
[0005] One object of the present invention is to provide a monocular 3D target detection method that incorporates an attention mechanism, the method comprising:
[0006] Acquire the detection image of the target to be detected;
[0007] The target detection image is input into a target detection model trained by a neural network containing a 3D gated attention module to obtain target detection information in the target detection image;
[0008] The 3D gated attention module includes a 3D attention module and a spatial channel reconstruction attention module. The 3D attention module is used to highlight important features of the received feature map, and the spatial channel reconstruction attention module is used to generate a feature map with more information from the received feature map. The 3D gated attention module is used to combine the feature maps processed by the 3D attention module and the spatial channel reconstruction attention module in parallel.
[0009] Furthermore, in the above-mentioned monocular 3D target detection method incorporating an attention mechanism, the 3D attention module includes a channel attention module and a spatial attention module. The processing formula for the received feature map by the channel attention module is as follows:
[0010] ;
[0011] Where X is the feature map received by the channel attention module, and X comes from a convolutional layer with a fixed kernel size. W, H, and C represent the width, height, and channel size of the feature map, respectively; swish and ReLU are activation functions; T1 and T2 are two one-dimensional convolutions with a kernel size of 3; Z... c It is the output after squeezing the c-th channel.
[0012] Furthermore, in the above-mentioned monocular 3D target detection method incorporating an attention mechanism, the processing formula for the received feature map by the spatial attention module is as follows:
[0013] ;
[0014] in, Here, is the normalization factor, i is the index of the output position where the response is calculated, j is the index of all possible positions, and the pairwise function f is used to calculate the relationship between i and all j, employing dot product similarity. To represent, P n (X) i ) represents the feature at position i. This represents the feature at position j. , g represents a 1×1 convolution operation, and T is the weight matrix.
[0015] Furthermore, in the above-mentioned monocular 3D target detection method incorporating an attention mechanism, the spatial channel reconstruction attention module includes a spatial reconstruction unit module and a channel reconstruction unit module. The processing formula for the received feature map by the spatial reconstruction unit is as follows:
[0016] ;
[0017] ;
[0018] Where W1 and W2 represent weighting matrices for different features, and Swish is the activation function. The normalized correlation weights represent the importance of different feature maps, and X represents the input feature map. and These are features with more information and features with less information, X. 11 X 22 These represent the characteristics of X1 and X2 in different channels, respectively. 21 and X 12 These represent the characteristics of X1 and X2 being integrated. It is element-wise multiplication. It's element-wise addition. It is to find the union. This is a spatially refined feature map obtained through the spatial reconstruction unit module.
[0019] Furthermore, in the aforementioned monocular 3D target detection method incorporating an attention mechanism, the channel reconstruction unit module is used to refine the input spatial features. Compression was performed using a 1×1 convolution kernel to obtain the features. and characteristics ;
[0020] Features The features are used as input, and GWC and PWC operations are performed on them respectively. Then they are summed to obtain the output. , will feature As a supplement to the features, a PwC operation is performed, yielding results that are consistent with the features. Taking the union yields ;
[0021] Global average pooling is used to combine global spatial information and channel information to obtain pooled features. and characteristics ;
[0022] Features and characteristics SoftMax is used to obtain the feature weight vector. and According to characteristics and characteristics and feature weight vector and Obtain the output feature Y;
[0023] in, .
[0024] Furthermore, in the above-mentioned monocular 3D target detection method with fused attention mechanism, the step of the 3D gating attention module combining the feature maps processed by the 3D attention module and the spatial channel reconstruction attention module in parallel includes:
[0025] The feature maps processed by the 3D attention module and the spatial channel reconstruction attention module are then compared with a balancing gate that adaptively adjusts the model's representational capabilities. They merged together;
[0026] Among them, X Z =λ t X 3D +(1-λ t )X 空,in, This represents the final refined output. Where λ is a learnable training parameter, and the sigmoid function is used to project λ onto the range [0,1]. X 3D and X 空 These are the feature maps after processing by the 3D attention module and the spatial channel reconstruction attention module, respectively.
[0027] Furthermore, in the above-mentioned monocular 3D object detection method that integrates attention mechanisms, the neural network further includes a ResNet101 network with residual connections and an FPN network that generates multi-level predictions. The ResNet101 network is used to receive the object detection image, and the FPN network is used to receive the features output by the ResNet101 network to generate the corresponding feature map.
[0028] Another object of the present invention is to provide a monocular 3D target detection device that incorporates an attention mechanism, the device comprising:
[0029] The acquisition module is used to acquire the detection image of the target to be detected;
[0030] The detection module is used to input the target detection image into a target detection model trained by a neural network including a 3D gated attention module, so as to obtain target detection information in the target detection image;
[0031] The 3D gated attention module includes a 3D attention module and a spatial channel reconstruction attention module. The 3D attention module is used to highlight important features of the received feature map, and the spatial channel reconstruction attention module is used to generate a feature map with more information from the received feature map. The 3D gated attention module is used to combine the feature maps processed by the 3D attention module and the spatial channel reconstruction attention module in parallel.
[0032] Another object of the present invention is to provide a readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of any of the methods described above.
[0033] Another object of the present invention is to provide an electronic device including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the program, implements the steps of the method described above.
[0034] This invention acquires a target detection image and inputs it into a target detection model trained on a neural network containing a 3D gated attention module to obtain target detection information. The 3D gated attention module includes a 3D attention module and a spatial channel reconstruction attention module. The 3D attention module highlights important features of the received feature map, while the spatial channel reconstruction attention module generates a more informative feature map from the received feature map. The 3D gated attention module combines the feature maps processed by the 3D attention module and the spatial channel reconstruction attention module in parallel. By introducing the 3D gated attention module, the feature relationships between spatial domains and channels are considered, and spatial and channel redundancy between features in the convolutional neural network is reduced. This provides an effective focus for feature maps and reduces interference from unimportant information, thereby improving the accuracy of target recognition. This solves the problem of low accuracy in recognizing monocular 3D targets in existing technologies. Attached Figure Description
[0035] Figure 1 A flowchart of monocular 3D target detection using a fusion attention mechanism is provided in an embodiment of the present invention;
[0036] Figure 2 This is a structural block diagram of a monocular 3D target detection device that incorporates an attention mechanism in the third embodiment of the present invention.
[0037] The following detailed description, in conjunction with the accompanying drawings, will further illustrate the present invention. Detailed Implementation
[0038] To facilitate understanding of the present invention, a more complete description will be given below with reference to the accompanying drawings. Several embodiments of the invention are illustrated in the drawings. However, the invention can be implemented in many different forms and is not limited to the embodiments described herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete.
[0039] It should be noted that when a component is said to be "fixed to" another component, it can be directly on the other component or there may be an intervening component. When a component is said to be "connected to" another component, it can be directly connected to the other component or there may be an intervening component. The terms "vertical," "horizontal," "left," "right," and similar expressions used in this document are for illustrative purposes only.
[0040] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains. The terminology used herein in the description of the invention is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. The term "and / or" as used herein includes any and all combinations of one or more of the associated listed items.
[0041] The following will describe in detail how to improve the accuracy of 3D target detection, with reference to specific embodiments and accompanying drawings.
[0042] Example 1
[0043] Please see Figure 1 The figure shows a monocular 3D target detection method with fused attention mechanism in the first embodiment of the present invention, the method including steps S10 to S11.
[0044] Step S10: Obtain the detection image of the target to be detected.
[0045] The target detection image is a monocular image containing 3D targets; specifically, it is obtained by acquiring RGB images.
[0046] Step S11: Input the target detection image into the target detection model trained by a neural network containing a 3D gated attention module to obtain target detection information in the target detection image.
[0047] The object detection information includes the object's category, depth distance, 2D bounding box, and 3D bounding box. Specifically, a neural network is constructed to train the model. The neural network includes a ResNet101 network with residual connections, an FPN network that generates multi-level predictions, and a 3D gated attention module. The ResNet101 network is used to receive the object detection image, the FPN network is used to receive the features output by the ResNet101 network to generate the corresponding feature map, and the 3D gated attention module includes a 3D attention module and a spatial channel reconstruction attention module.
[0048] Specifically, the 3D gated attention module adaptively combines 3D attention branches and spatial channel reconstruction attention branches in parallel. It learns which branch to focus on using a single parameter, and then integrates the results for output. In practice, the feature map generated by the FPN network serves as input to the 3D attention module, which consists of an improved channel attention module and a spatial domain attention module. Simultaneously, the feature map generated by the FPN network serves as input to the spatial channel reconstruction attention module. After adaptive fusion by these two attention modules, a new feature map is obtained.
[0049] More specifically, after constructing the neural network, the model is trained using a dataset. For example, the KITTI object detection dataset is chosen. This dataset consists of 7481 images forming the training and validation sets, and 7518 images forming the test set, totaling 80256 labeled objects. The main categories are cars, bicycles, pedestrians, and trucks. Based on the object's height, occlusion level, and truncation level, the detection results are categorized into three levels: easy, medium, and difficult. The training images are divided into a 3712-image training set and a 3769-image validation set. The model is trained using this dataset to learn the corresponding network parameters, enabling it to grasp the logic of 3D object recognition.
[0050] For example, in the specific training process, eight heads were used for all attention modules. Multi-head attention enables the model to capture and process information in different subspaces, thereby enhancing the model's ability to express input data. The number of queries, N, was set to 50, meaning the model would perform 50 query operations for each input, which enhances the model's ability to capture details. The dimension of the latent features for both the channels and the FFN-based and MLP-based detection heads was set to 256. Training was conducted for 48 epochs on a single GeForce RTX 4090 GPU with a learning rate set to... Weight decay was adopted The SGD optimizer was set with a momentum factor of 0.9, a weight decay coefficient of 0.0001, 500 warm-up iterations, a warm-up ratio of 0.33, and the learning rates at iterations 32 and 44 were adjusted to the set learning rate values. The loss function formula is as follows: Classification loss It is the FocalLoss loss function, which is the geometric center point offset loss. It is the SmoothL1Loss loss function, size loss. It is the SmoothL1Loss loss function, rotational loss. It is the SmoothL1Loss loss function, velocity loss. It is the SmoothL1Loss loss function, depth loss. It is the SmoothL1Loss loss function.
[0051] In summary, the monocular 3D target detection method with fused attention mechanism in the above embodiments of the present invention acquires a target detection image to be detected; inputs the target detection image into a target detection model trained by a neural network including a 3D gated attention module to obtain target detection information in the target detection image; wherein, the 3D gated attention module includes a 3D attention module and a spatial channel reconstruction attention module. The 3D attention module is used to highlight important features of the received feature map, and the spatial channel reconstruction attention module is used to generate a feature map with more information from the received feature map. The 3D gated attention module is used to combine the feature maps processed by the 3D attention module and the spatial channel reconstruction attention module in parallel. By introducing the 3D gated attention module, the feature relationship between the spatial domain and the channel is considered, and the spatial and channel redundancy between features in the convolutional neural network is reduced, providing an effective focus for the feature map and reducing interference from unimportant information, thereby improving the accuracy of target recognition. This solves the problem of low accuracy in identifying monocular 3D targets in the prior art.
[0052] Example 2
[0053] This embodiment also proposes a monocular 3D target detection method that incorporates an attention mechanism. The difference between the monocular 3D target detection method in this embodiment and the monocular 3D target detection method in Embodiment 1 is as follows:
[0054] The 3D attention module includes a channel attention module and a spatial attention module. The processing formula for the received feature map by the channel attention module is as follows:
[0055] ;
[0056] Where X is the feature map received by the channel attention module, and X comes from a convolutional layer with a fixed kernel size. W, H, and C represent the width, height, and channel size of the feature map, respectively; swish and ReLU are activation functions; T1 and T2 are two one-dimensional convolutions with a kernel size of 3; Z... c It is the output after squeezing the c-th channel. The squeezing operation makes it possible to collect global information.
[0057] Specifically, the formula for the extrusion operation is:
[0058] ;
[0059] Among them, X c (i, j) represents the value of the c-th channel of the input feature map in space (i, j), where i and j are indices in the spatial dimension, representing the height and width of the feature map, respectively, and H and W represent the height and width of the input feature map.
[0060] The formula for processing the received feature map by the spatial attention module is as follows:
[0061] ;
[0062] in, Here, is the normalization factor, i is the index of the output position where the response is calculated, j is the index of all possible positions, and the pairwise function f is used to calculate the relationship between i and all j, employing dot product similarity. To represent, P n (X) i ) represents the feature at position i. This represents the feature at position j. , g represents a 1×1 convolution operation, and T is the weight matrix.
[0063] The spatial channel reconstruction attention module includes a spatial reconstruction unit module and a channel reconstruction unit module. The processing formula for the received feature map by the spatial reconstruction unit is as follows:
[0064] ;
[0065] ;
[0066] Where W1 and W2 represent weighting matrices for different features, and Swish is the activation function. The normalized correlation weights represent the importance of different feature maps, and X represents the input feature map. and These are features with more information and features with less information, X. 11 X 22 These represent the characteristics of X1 and X2 in different channels, respectively. 21 and X 12 These represent the characteristics of X1 and X2 being integrated. It is element-wise multiplication. It's element-wise addition. It is to find the union. This is a spatially refined feature map obtained through the spatial reconstruction unit module.
[0067] In addition, the channel reconstruction unit module is used to refine the spatial features of the input. Compression was performed using a 1×1 convolution kernel to obtain the features. and characteristics ;
[0068] Features The features are used as input, and GWC and PWC operations are performed on them respectively. Then they are summed to obtain the output. , will feature As a supplement to the features, a PwC operation is performed, yielding results that are consistent with the features. Taking the union yields ;
[0069] Global average pooling is used to combine global spatial information and channel information to obtain pooled features. and characteristics ;
[0070] Features and characteristics SoftMax is used to obtain the feature weight vector. and According to characteristics and characteristics and feature weight vector and Obtain the output feature Y;
[0071] in, .
[0072] Furthermore, the step of the 3D gating attention module combining the feature maps processed by the 3D attention module and the spatial channel reconstruction attention module in parallel includes:
[0073] The feature maps processed by the 3D attention module and the spatial channel reconstruction attention module are then compared with a balancing gate that adaptively adjusts the model's representational capabilities. They merged together;
[0074] Among them, X Z =λ t X 3D +(1-λ t )X 空 ,in, This represents the final refined output. Where λ is a learnable training parameter, and the sigmoid function is used to project λ onto the range [0,1]. X 3D and X 空 These are the feature maps after processing by the 3D attention module and the spatial channel reconstruction attention module, respectively.
[0075] In summary, the monocular 3D target detection method with fused attention mechanism in the above embodiments of the present invention acquires a target detection image to be detected; inputs the target detection image into a target detection model trained by a neural network including a 3D gated attention module to obtain target detection information in the target detection image; wherein, the 3D gated attention module includes a 3D attention module and a spatial channel reconstruction attention module. The 3D attention module is used to highlight important features of the received feature map, and the spatial channel reconstruction attention module is used to generate a feature map with more information from the received feature map. The 3D gated attention module is used to combine the feature maps processed by the 3D attention module and the spatial channel reconstruction attention module in parallel. By introducing the 3D gated attention module, the feature relationship between the spatial domain and the channel is considered, and the spatial and channel redundancy between features in the convolutional neural network is reduced, providing an effective focus for the feature map and reducing interference from unimportant information, thereby improving the accuracy of target recognition. This solves the problem of low accuracy in identifying monocular 3D targets in the prior art.
[0076] Example 3
[0077] Please see Figure 2 The image shows a monocular 3D target detection device with a fused attention mechanism proposed in the third embodiment of the present invention. The device includes:
[0078] The acquisition module 100 is used to acquire the detection image of the target to be detected;
[0079] The detection module 200 is used to input the target detection image into a target detection model trained by a neural network including a 3D gated attention module, so as to obtain target detection information in the target detection image;
[0080] The 3D gated attention module includes a 3D attention module and a spatial channel reconstruction attention module. The 3D attention module is used to highlight important features of the received feature map, and the spatial channel reconstruction attention module is used to generate a feature map with more information from the received feature map. The 3D gated attention module is used to combine the feature maps processed by the 3D attention module and the spatial channel reconstruction attention module in parallel.
[0081] Furthermore, in the aforementioned monocular 3D target detection device with integrated attention mechanism, the 3D attention module includes a channel attention module and a spatial attention module. The processing formula for the received feature map by the channel attention module is as follows:
[0082] ;
[0083] Where X is the feature map received by the channel attention module, and X comes from a convolutional layer with a fixed kernel size. W, H, and C represent the width, height, and channel size of the feature map, respectively; swish and ReLU are activation functions; T1 and T2 are two one-dimensional convolutions with a kernel size of 3; Z... c It is the output after squeezing the c-th channel.
[0084] Furthermore, in the aforementioned monocular 3D target detection device with integrated attention mechanism, the spatial attention module processes the received feature map using the following formula:
[0085] ;
[0086] in, Here, is the normalization factor, i is the index of the output position where the response is calculated, j is the index of all possible positions, and the pairwise function f is used to calculate the relationship between i and all j, employing dot product similarity. To represent, P n (X) i ) represents the feature at position i. This represents the feature at position j. , g represents a 1×1 convolution operation, and T is the weight matrix.
[0087] Furthermore, in the aforementioned monocular 3D target detection device with integrated attention mechanism, the spatial channel reconstruction attention module includes a spatial reconstruction unit module and a channel reconstruction unit module. The processing formula for the received feature map by the spatial reconstruction unit is as follows:
[0088] ;
[0089] ;
[0090] Where W1 and W2 represent weighting matrices for different features, and Swish is the activation function. The normalized correlation weights represent the importance of different feature maps, and X represents the input feature map. and These are features with more information and features with less information, X. 11 X 22 These represent the characteristics of X1 and X2 in different channels, respectively. 21 and X 12 These represent the characteristics of X1 and X2 being integrated. It is element-wise multiplication. It's element-wise addition. It is to find the union. This is a spatially refined feature map obtained through the spatial reconstruction unit module.
[0091] Furthermore, in the aforementioned monocular 3D target detection device incorporating an attention mechanism, the channel reconstruction unit module is used to refine the input spatial features. Compression was performed using a 1×1 convolution kernel to obtain the features. and characteristics ;
[0092] Features The features are used as input, and GWC and PWC operations are performed on them respectively. Then they are summed to obtain the output. , will feature As a supplement to the features, a PwC operation is performed, yielding results that are consistent with the features. Taking the union yields ;
[0093] Global average pooling is used to combine global spatial information and channel information to obtain pooled features. and characteristics ;
[0094] Features and characteristics SoftMax is used to obtain the feature weight vector. and According to characteristics and characteristics and feature weight vector and Obtain the output feature Y;
[0095] in, .
[0096] Furthermore, in the aforementioned monocular 3D target detection device with fused attention mechanism, the step of the 3D gating attention module combining the feature maps processed by the 3D attention module and the spatial channel reconstruction attention module in parallel includes:
[0097] The feature maps processed by the 3D attention module and the spatial channel reconstruction attention module are then compared with a balancing gate that adaptively adjusts the model's representational capabilities. They merged together;
[0098] Among them, X Z =λ t X 3D +(1-λ t )X 空 ,in, This represents the final refined output. Where λ is a learnable training parameter, and the sigmoid function is used to project λ onto the range [0,1]. X 3D and X 空 These are the feature maps after processing by the 3D attention module and the spatial channel reconstruction attention module, respectively.
[0099] Furthermore, in the above-mentioned monocular 3D target detection device that integrates the attention mechanism, the neural network further includes a ResNet101 network with residual connections and an FPN network for generating multi-level predictions. The ResNet101 network is used to receive the target detection image, and the FPN network is used to receive the features output by the ResNet101 network to generate the corresponding feature map.
[0100] The functions or operation steps implemented by the above modules are largely the same as those in the above method embodiments, and will not be repeated here.
[0101] Example 4
[0102] In another aspect, the present invention provides a readable storage medium having a computer program stored thereon, wherein the program, when executed by a processor, implements the steps of the method described in any one of Embodiments 1 to 2 above.
[0103] Example 5
[0104] In another aspect, the present invention provides an electronic device, the electronic device including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the steps of any one of the methods described in Embodiments 1 to 2 above.
[0105] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0106] Those skilled in the art will understand that the logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a sequential list of executable instructions for implementing logical functions, and can be embodied in any computer-readable storage medium for use by, or in conjunction with, an instruction execution system, apparatus, or device (such as a computer-based system, a processor-included system, or other system that can fetch and execute instructions from, an instruction execution system, apparatus, or device). For the purposes of this specification, "computer-readable storage medium" can mean any means that can contain, store, communicate, propagate, or transmit programs for use by, or in conjunction with, an instruction execution system, apparatus, or device.
[0107] More specific examples (a non-exhaustive list) of computer-readable storage media include: electrical connections (electronic devices) having one or more wires, portable computer disk drives (magnetic devices), random access memory (RAM), read-only memory (ROM), erasable and editable read-only memory (EPROM or flash memory), fiber optic devices, and portable optical disc read-only memory (CDROM). Furthermore, computer-readable storage media can even be paper or other suitable media on which the program can be printed, since the program can be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, interpreting, or otherwise processing as necessary, and then stored in computer memory.
[0108] It should be understood that various parts of the present invention can be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, it can be implemented using any one or a combination of the following techniques known in the art: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc.
[0109] In the description of this specification, references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of the 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.
[0110] The embodiments described above are merely illustrative of several implementations of the present invention, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of the present invention. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of the present invention, and these modifications and improvements all fall within the scope of protection of the present invention. Therefore, the scope of protection of this patent should be determined by the appended claims.
Claims
1. A monocular 3D target detection method incorporating an attention mechanism, characterized in that, The method includes: Acquire the detection image of the target to be detected; The target detection image is input into a target detection model trained by a neural network containing a 3D gated attention module to obtain target detection information in the target detection image; The 3D gated attention module includes a 3D attention module and a spatial channel reconstruction attention module. The 3D attention module is used to highlight important features of the received feature map, and the spatial channel reconstruction attention module is used to generate a feature map with more information from the received feature map. The 3D gated attention module is used to combine the feature maps processed by the 3D attention module and the spatial channel reconstruction attention module in parallel. The step of combining the feature maps processed by the 3D attention module and the spatial channel reconstruction attention module in parallel includes: The feature maps processed by the 3D attention module and the spatial channel reconstruction attention module are then compared with a balancing gate that adaptively adjusts the model's representational capabilities. They merged together; Among them, X Z =λ t X 3D +(1-λ t )X 空 ,in, This represents the final refined output. Where λ is a learnable training parameter, and the sigmoid function is used to project λ onto the range [0,1]. X 3D and X 空 These are the feature maps processed by the 3D attention module and the spatial channel reconstruction attention module, respectively. The 3D attention module includes a channel attention module and a spatial attention module; The formula for processing the received feature map by the spatial attention module is as follows: ; in, is the normalization factor, i is the index of the output position for calculating its response, j is the index for enumerating all possible positions, and the pairwise function f uses dot product similarity. To represent, P n (X) i ) represents the feature at position i. This represents the feature at position j. , g represents a 1×1 convolution operation; The spatial channel reconstruction attention module includes a spatial reconstruction unit module and a channel reconstruction unit module. The processing formula for the received feature map by the spatial reconstruction unit is as follows: ; ; Where W1 and W2 represent weighting matrices for different features, and Swish is the activation function. The normalized correlation weights represent the importance of different feature maps, and X represents the input feature map. and These are features with more information and features with less information, respectively. It is element-wise multiplication. It's element-wise addition. It is to find the union. This is a spatially refined feature map obtained through the spatial reconstruction unit module; The channel reconstruction unit module is used to refine the input spatial features. Compression was performed using a 1×1 convolution kernel to obtain the features. and characteristics ; Features The features are used as input, and GWC and PWC operations are performed on them respectively. Then they are summed to obtain the output. , will feature As a supplement to the features, a PwC operation is performed, yielding results that are consistent with the features. Taking the union yields ; Global average pooling is used to combine global spatial information and channel information to obtain pooled features. and characteristics ; Features and characteristics SoftMax is used to obtain the feature weight vector. and According to the feature weight vector and The output feature Y is obtained; in, .
2. The monocular 3D target detection method with fused attention mechanism as described in claim 1, characterized in that, The neural network also includes a ResNet101 network with residual connections and an FPN network for generating multi-level predictions. The ResNet101 network is used to receive the target detection image, and the FPN network is used to receive the features output by the ResNet101 network to generate the corresponding feature map.
3. A monocular 3D target detection device incorporating an attention mechanism, characterized in that, A monocular 3D target detection method for implementing the fusion attention mechanism according to any one of claims 1 to 2, the apparatus comprising: The acquisition module is used to acquire the detection image of the target to be detected; The detection module is used to input the target detection image into a target detection model trained by a neural network including a 3D gated attention module, so as to obtain target detection information in the target detection image; The 3D gated attention module includes a 3D attention module and a spatial channel reconstruction attention module. The 3D attention module is used to highlight important features of the received feature map, and the spatial channel reconstruction attention module is used to generate a feature map with more information from the received feature map. The 3D gated attention module is used to combine the feature maps processed by the 3D attention module and the spatial channel reconstruction attention module in parallel.
4. A readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the steps of the method as described in any one of claims 1 to 2.
5. An electronic device, characterized in that, The method includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the program, implements the steps of the method as described in any one of claims 1 to 2.
Citation Information
Patent Citations
Image segmentation method and system in multi-task learning network
JP2024143991A
Data processing method and apparatus, neural network model, device, and medium
WO2024032585A1