Target detection method and electronic device

By defining anchor box templates and building a depth perception neural network, the noise problem caused by the dependence of 3D target detection technology on external networks is solved, the accuracy of 3D target detection is improved, and more accurate target detection is achieved.

CN113903028BInactive Publication Date: 2024-10-29WUHAN UNIV
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202111045058.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-09-07
Publication Date
2024-10-29
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Existing 3D target detection technology relies too much on external networks to obtain depth information, which leads to noise problems and affects detection accuracy.

Method used

Define the anchor box template, build a target detection neural network based on semantic information extraction and ring strip segmentation depth perception, extract the center position coordinates of the two-dimensional and three-dimensional bounding boxes through the training network, and adjust the viewing angle through L1loss to eliminate external noise interference .

Benefits of technology

It improves the accuracy of three-dimensional target detection in monocular images, fully considers the semantic information and target resolution of the image, and effectively eliminates external noise interference.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113903028B_ABST
    Figure CN113903028B_ABST
Patent Text Reader

Abstract

The present application discloses a target detection method and electronic device, and relates to the field of computer vision technology. The method includes: defining an anchor frame template; constructing a target detection neural network and training it, and using the trained target detection neural network to extract the anchor point parameters and target category of the target in the input image; obtaining a two-dimensional bounding box, a three-dimensional bounding box, and the center position coordinates of the three-dimensional bounding box; back-projecting the center position coordinates according to the reverse calculation of the encoding to obtain the camera coordinates; obtaining the projected two-dimensional frame obtained after the three-dimensional bounding box is projected, and performing an L1loss function on the projected two-dimensional frame and the two-dimensional bounding box, adjusting the observation angle until the adjustment step of the observation angle is less than the preset termination parameter, and obtaining the adjusted three-dimensional bounding box; outputting the target category, two-dimensional bounding box, camera coordinates, and adjusted three-dimensional bounding box of the target. The present application effectively eliminates external noise interference and improves the detection accuracy of three-dimensional targets in monocular images.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer vision technology, and in particular to a target detection method and electronic equipment. Background Art

[0002] At present, in practical application scenarios such as autonomous driving, information such as the coordinate position, three-dimensional size, and deflection angle of the target is essential for the vehicle perception system. Most three-dimensional target detection technologies are designed based on two-dimensional target detection technologies. Since the design concept of two-dimensional detection does not consider depth information, the three-dimensional information of the target object cannot be directly obtained.

[0003] In the related technology, the three-dimensional target detection technology based on monocular images can obtain the three-dimensional information of the target object with the help of prior fusion information, geometric feature information, three-dimensional model matching or depth estimation model.

[0004] However, solving 3D coordinates using geometric constraints requires reliance on some external state-of-the-art sub-networks, which introduces continuous noise and prevents the network performance from breaking through its inherent upper limit. Summary of the invention

[0005] In view of one of the defects existing in the prior art, the purpose of the present application is to provide a target detection method and electronic device to solve the problem that the three-dimensional target detection technology in the related art relies too much on an external network to obtain additional depth information, resulting in the introduction of continuous noise.

[0006] The first aspect of the present application provides a target detection method, which comprises the steps of:

[0007] Define the anchor box template, including two-dimensional parameters [w,h] 2D , three-dimensional parameters [w,h,l,θ] 3D and depth information parameters; w, h and l represent the given values ​​of the width, height and length of the target respectively, and θ represents the viewing angle of the camera to the target;

[0008] Construct and train an object detection neural network based on semantic information extraction and annular strip segmentation depth perception, and use the trained object detection neural network to extract the anchor point parameters and object category of the object in the input image;

[0009] The above anchor point parameters are transformed and calculated with the corresponding anchor frame template to obtain the two-dimensional bounding box, the three-dimensional bounding box and the center position coordinates of the three-dimensional bounding box;

[0010] The center position coordinates are back-projected according to the reverse calculation of the encoding to obtain the camera coordinates;

[0011] Obtain a projected two-dimensional frame obtained after projecting the three-dimensional bounding box, and perform an L1loss function on the projected two-dimensional frame and the two-dimensional bounding box, adjust the viewing angle until the adjustment step of the viewing angle is less than a preset termination parameter, and obtain an adjusted three-dimensional bounding box;

[0012] Output the target category, 2D bounding box, camera coordinates, and adjusted 3D bounding box of the above target.

[0013] In some embodiments, after defining the anchor frame template, the following steps are further included:

[0014] Specify the shared center pixel position and encode the above depth information parameters.

[0015] In some embodiments, encoding the above-mentioned depth information parameters specifically includes:

[0016] To specify the shared center pixel position as [x,y] P , the 3D center position [x,y,z] in the camera coordinate system 3D Project it into the image with the given projection matrix P and get the projection coordinates [x, y, z] P ;

[0017] Based on the above projection coordinates, the depth information Z P The information parameters are encoded to obtain

[0018]

[0019] Where P is the given projection matrix.

[0020] In some embodiments, extracting anchor point parameters and target categories of targets in input images using a trained target detection neural network specifically includes:

[0021] The trained object detection neural network is used to obtain the semantic information feature map of the input image, and the global feature extraction and the local feature extraction based on the depth perception of the ring strip segmentation are performed on the semantic information feature map;

[0022] The output parameters of the global feature extraction and the output parameters of the local feature extraction are weighted to obtain the above-mentioned anchor point parameters;

[0023] The prediction categories extracted by global features and the prediction categories extracted by local features are optimized by self-knowledge distillation to obtain the above target categories.

[0024] In some embodiments, the semantic information feature map is subjected to global feature extraction and local feature extraction based on annular strip segmentation depth perception, specifically including:

[0025] When global features are extracted through conventional convolution, the global feature F is introduced into the conventional convolution process. global , the above global feature F global In the example, a 3×3 convolutional layer with a padding of 1 is introduced, and a Relu function is used for nonlinear activation to generate 512 feature maps.

[0026] The global feature F global The 12 prediction networks are inputted respectively. The structure of each prediction network is a 1×1 convolution layer with a padding of 1. After convolution, the global output sequence O is extracted. global ;

[0027] When local features are extracted through depth-aware convolution, annular strip segmentation is introduced in the depth-aware convolution process to segment the above semantic information feature map into r different strips, and different convolution kernels are used to act on different strips;

[0028] Introducing local features F local , the above local feature F local In the example, 512 feature maps are generated by depth-aware convolution based on ring-shaped strip segmentation and nonlinear activation by ReLU function;

[0029] The local feature F local The 12 prediction networks are inputted respectively. The structure of each prediction network is r convolutional layers with 1×1 padding and 1 ring-shaped strip segmentation. After convolution, the local output sequence O is extracted. local .

[0030] In some embodiments, the predicted category extracted by global features and the predicted category extracted by local features are optimized by self-knowledge distillation to obtain the above target category, which specifically includes:

[0031] The global output sequence O global The category parameter c_ls and the local output sequence O in local The category parameter c_loc in the distillation neural network is input and the teacher category c_ls of the global output is output teacher and student category c_ls student , and the local output teacher category c_loc teacher and student category c_loc student ;

[0032] Introduce the weighted number α learned by the neural network teacher and α student , and obtain the optimized teacher categories c_ls teacher ' and student category c_ls student'for

[0033] c_ls teacher '=c_ls teacher ×α teacher +c_loc teacher ×(1-α teacher )

[0034] c_ls student '=c_ls student ×α student +c_loc student ×(1-α student );

[0035] By student category cls student ' as the optimized target category.

[0036] In some embodiments, the projected two-dimensional box [x min ,y min ,x max ,y max The projection formula of ] is:

[0037]

[0038]

[0039] Υ P =P·Y 3D ,Υ 2D =Y P / Υ P [φ z ]

[0040] x min =min(Υ 2D [φ x ]),y min =min(Υ 2D [φ y ])

[0041] x max =max(Υ 2D [φ x ]),y max =max(Υ 2D [φ y ])

[0042] Among them, φ x ,φ y ,φ z Respectively represent the index of the axis [x,y,z], [w,h,l,θ]' 3D is a three-dimensional bounding box, [x,y,z]' Pis the center coordinate of the three-dimensional bounding box, and P is the given projection matrix.

[0043] In some embodiments, training the target detection neural network specifically includes:

[0044] Construct a multi-task network loss function for target detection and perform back propagation on the training samples to obtain the weight parameters of the optimized neural network;

[0045] The above network loss functions include classification loss function, distillation loss function, 2D box regression loss function and 3D box regression loss function.

[0046] In some embodiments, the above classification loss function is:

[0047]

[0048] The above 2D box regression loss function is:

[0049] The above 3D box regression loss function is:

[0050]

[0051] The above distillation loss function is:

[0052] L distill =(c_ls teacher '-c_ls student ') 2 +(prob teacher -prob student ) 2

[0053] The above multi-task network loss function is obtained as:

[0054]

[0055] Among them, c τ is the predicted value of the τth true target category, c i is the predicted value of the i-th target category, n c is the total number of target categories, IOU is the intersection-over-union ratio, b' 2D is a two-dimensional bounding box, is the true value two-dimensional box, b' 3D is a three-dimensional bounding box, is the true value 3D box, SmoothL1 is the L1 function after smoothing, and prob teacher is the teacher category probability, prob studentis the student category possibility, λ1 is the weight coefficient of 2D box regression loss, λ2 is the weight coefficient of 3D box regression loss, and λ3 is the weight coefficient of distillation loss.

[0056] A second aspect of the present application provides an electronic device for target detection, including a processor and a memory, wherein the processor executes a code in the memory to implement the method.

[0057] The beneficial effects of the technical solution provided by this application include:

[0058] The target detection method and electronic device of the present application, after defining the anchor frame template, construct and train a target detection neural network based on semantic information extraction and annular strip segmentation depth perception, so as to use the trained target detection neural network to extract the anchor point parameters and target category of the target in the input image, and transform and calculate the anchor point parameters with the corresponding anchor frame template to obtain the two-dimensional bounding box, the three-dimensional bounding box and the center position coordinates of the three-dimensional bounding box; then the center position coordinates are back-projected according to the reverse calculation of the encoding to obtain the camera coordinates; finally, the projected two-dimensional frame obtained after the projection of the three-dimensional bounding box is obtained, and the projected two-dimensional frame and the two-dimensional bounding box are subjected to the L1loss function, and the observation angle is adjusted until the adjustment step of the observation angle is less than the preset termination parameter, and the adjusted three-dimensional bounding box is obtained, and the target category, two-dimensional bounding box, camera coordinates, and adjusted three-dimensional bounding box of the target can be output as the detection result of the target; therefore, the semantic information of the image and the different target resolutions at different positions of the image are fully considered, and the external noise interference is effectively eliminated, so as to improve the detection accuracy of the three-dimensional target of the monocular image. BRIEF DESCRIPTION OF THE DRAWINGS

[0059] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0060] Figure 1 This is a flow chart of the target detection method package in the embodiment of this application;

[0061] Figure 2 This is a diagram of the target detection neural network structure in the embodiment of the present application;

[0062] Figure 3 This is a DNet network architecture diagram in an embodiment of the present application;

[0063] Figure 4 This is a schematic diagram of a ring-shaped strip segmentation depth perception network in an embodiment of the present application. DETAILED DESCRIPTION

[0064] In order to make the purpose, technical solutions and advantages of the present application clearer, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention. In addition, the technical features involved in each embodiment of the present invention described below can be combined with each other as long as they do not conflict with each other.

[0065] The embodiments of the present application provide a target detection method and an electronic device, which can solve the problem in the related art that the three-dimensional target detection technology is overly dependent on an external network to obtain additional depth information, resulting in the introduction of continuous noise.

[0066] like Figure 1 As shown, the target detection method of the embodiment of the present application includes the following steps:

[0067] S1. Define the anchor box template, including two-dimensional parameters [w,h] 2D , three-dimensional parameters [w,h,l,θ] 3D and depth information parameters to define anchor templates in their respective dimensional spaces, thereby achieving simultaneous prediction of 2D and 3D bounding boxes.

[0068] Among them, w, h and l represent the given values ​​of the width, height and length of the target, that is, the given values ​​in the detection camera coordinate system, and θ represents the viewing angle of the camera to the target. Since 3D targets are different from 2D targets and have rotation properties, θ represents the viewing angle of the camera to the target, which is equivalent to the camera rotating around the Y axis of its camera coordinate system.

[0069] S2. Construct and train a target detection neural network based on semantic information extraction and annular strip segmentation depth perception, use the trained target detection neural network to perform calculations and predictions on the input image, and extract the anchor point parameters and target category of the target in the input image.

[0070] S3. Transform and calculate the above anchor point parameters and the corresponding anchor box template to obtain a two-dimensional bounding box, a three-dimensional bounding box and the center position coordinates of the three-dimensional bounding box.

[0071] S4. Back-project the above center position coordinates according to the reverse calculation of the encoding to obtain the camera coordinates.

[0072] S5. Obtain the projected two-dimensional frame obtained after projecting the above three-dimensional bounding box, and perform L1loss function on the above projected two-dimensional frame and the two-dimensional bounding box, adjust the observation angle until the adjustment step of the observation angle is less than the preset termination parameter, and obtain the adjusted three-dimensional bounding box.

[0073] S6. Output the target category, two-dimensional bounding box, camera coordinates, and adjusted three-dimensional bounding box of the target.

[0074] In the target detection method of the present embodiment, after defining the anchor frame template, a target detection neural network based on semantic information extraction and annular strip segmentation depth perception is constructed and trained, so as to extract the anchor point parameters and target category of the target in the input image by using the trained target detection neural network, and transform and calculate the anchor point parameters with the corresponding anchor frame template to obtain the two-dimensional bounding box, the three-dimensional bounding box and the center position coordinates of the three-dimensional bounding box; then the center position coordinates are back-projected according to the reverse calculation of the encoding to obtain the camera coordinates; finally, the projected two-dimensional frame obtained after the three-dimensional bounding box is projected is obtained, and the projected two-dimensional frame and the two-dimensional bounding box are subjected to the L1loss function, and the observation angle is adjusted until the adjustment step of the observation angle is less than the preset termination parameter, and the adjusted three-dimensional bounding box is obtained, and the target category, two-dimensional bounding box, camera coordinates, and adjusted three-dimensional bounding box of the target can be output as the detection result of the target; therefore, the semantic information of the image and the different target resolutions at different positions of the image are fully considered, external noise interference is effectively eliminated, and the detection accuracy of the three-dimensional target of the monocular image is improved.

[0075] Furthermore, in the above step S1, before defining the anchor frame template, the step also includes: pre-defining hyper parameters H, W and A based on the size and resolution of the above input image.

[0076] Wherein, H and W represent the height and width of the input image respectively, and A represents the number of anchor box templates to be generated for each anchor point; the number of anchor points of the above input image is H×W.

[0077] In this embodiment, taking a 3-channel monocular image of 572×572 size as an example, H can be set to 388, W to 388, and A to 36, that is, 388×388 anchor points are selected, and each anchor point generates 36 anchor frame templates of different sizes. Then, one input image can obtain 388×388×36 anchor frame templates.

[0078] Preferably, in the above step S1, after defining the anchor frame template, the following steps are further included: specifying the shared central pixel position, and encoding the above depth information parameters.

[0079] In this embodiment, to place an anchor point and define a complete 2D bounding box or 3D bounding box, the shared center pixel position [x, y] must be specified. P , where the parameters of the 2D representation are expressed in pixel coordinates.

[0080] For the above depth information parameter Z P Encoding includes the following steps:

[0081] First, specify the shared center pixel position [x,y] P , the 3D center position [x,y,z] in the camera coordinate system 3D Project it into the image with the given projection matrix P and get the projection coordinates [x, y, z] P .

[0082] Then, based on the above projection coordinates, the depth information parameter Z P Encode and get

[0083]

[0084] Where P is the given projection matrix.

[0085] In this embodiment, θ 3D Represents the viewing angle, that is, rotation around the Y axis in the camera coordinate system, θ 3D The anchor box mechanism calculates the depth information parameter Z for each anchor point separately through mean statistics. P and three-dimensional parameters [w, h, l, θ] 3D , and then act as strong prior information to reduce the difficulty of three-dimensional parameter estimation calculation.

[0086] like Figure 2 As shown, preferably, in the above step S2, the anchor point parameters and target categories of the target in the input image are extracted using the trained target detection neural network, which specifically includes the following steps:

[0087] First, after using the trained object detection neural network to obtain the semantic information feature map of the input image, global feature extraction and local feature extraction based on annular strip segmentation depth perception, namely global convolution and local annular segmentation convolution, are performed on the above semantic information feature map.

[0088] Then, the output parameters of the global feature extraction and the output parameters of the local feature extraction are weighted to obtain the above-mentioned anchor point parameters to achieve joint feature extraction.

[0089] Finally, the prediction categories extracted from the global features and the prediction categories extracted from the local features are optimized by self-knowledge distillation to obtain the above target categories. In this embodiment, the neural network generation parameters PA-GEN use the "student" and "teacher" parameters in self-knowledge distillation.

[0090] In this embodiment, the above-mentioned target detection neural network includes a DNet module, a joint feature extraction module and a self-knowledge distillation module, that is, when performing semantic information feature extraction, DNet (a convolutional neural network with a deeper number of layers) is used as the basic semantic information extractor to obtain a semantic information feature map of H×W dimensions, that is, using DNet as the backbone network, a semantic information feature map is extracted for the input monocular image.

[0091] like Figure 3 As shown in the figure, specifically, DNet includes the encoding block on the left side of the figure, the decoding block on the right side of the figure, and the intermediate block in the middle of the figure. For the input 3-channel image, it is first input into the encoding block C1, which includes two 3×3 convolution operations and convolution layers with ReLU activation functions. The output of C1 is copied into two copies, one is downsampled through a 2×2 maximum pooling operation and enters the encoding block C2 with a similar structure to C1, and the other is input into the intermediate block M1 with only one 3×3 convolution layer.

[0092] Correspondingly, the output of C2 is downsampled into the encoding block C3 and copied into the intermediate block M2; the output of C3 passes through the intermediate block M3, and then the output of M3 cuts out the middle part and enters the decoding block D3. The output of D3 is upsampled through a 2×2 convolution layer, and is spliced ​​with the output of M2 after being cropped to the same size and input into the decoding block D2. The output of D2 is upsampled through a 2×2 convolution layer and spliced ​​with the output of M1 cropped to the same size and input into the decoding layer D1. The output of the decoding layer D1 generates a pixel-level semantic information feature map of size H×W after passing through a 1×1 convolution layer.

[0093] Furthermore, when performing global feature extraction and local feature extraction based on annular strip segmentation depth perception on the above semantic information feature map, the obtained semantic information feature map is sent to two branches, one for global feature extraction and the other for local feature extraction, which specifically includes the following steps:

[0094] A1. When global features are extracted through conventional convolution, the global feature F is introduced into the conventional convolution process. global , the above global feature F global In the example, a 3×3 convolutional layer with a padding number of 1 is introduced, and a Relu (Rectified Linear Unit) function is used for nonlinear activation to generate 512 feature maps. Among them, the global feature extraction adopts conventional convolution, and its convolution kernel acts in the entire space, which is the global convolution.

[0095] A2. The global feature F globalThe 12 prediction networks are inputted respectively. The structure of each prediction network is a 1×1 convolution layer with a padding of 1. After convolution, the global output sequence O is extracted. global ;

[0096] The global output sequence O global is: c,[t x ,t y ,t w ,t h ] 2D , [t x ,t y ,t z ] P ,[t w ,t h ,t l ,t θ ] 3D There are 12 outputs in total. Among them, c represents the category, [t x ,t y ,t w ,t h ] 2D Represents the 2D anchor box related parameters predicted by global feature extraction, [t x ,t y ,t z ] P represents the projection center, [t w ,t h ,t l ,t θ ] 3D Indicates size and direction.

[0097] A3. When local features are extracted through depth-aware convolution, annular strip segmentation is introduced in the depth-aware convolution process to segment the above semantic information feature map into r different strips, and different convolution kernels are used on different strips; Among them, local feature extraction adopts depth-aware convolution, which is local convolution.

[0098] Optionally, r is a value preset according to actual conditions such as camera resolution, the location of the camera mounted on the autonomous driving vehicle, etc.

[0099] A4. Introducing local features F local , the above local feature F local In the example, 512 feature maps are generated by depth-aware convolution based on ring-shaped strip segmentation and nonlinear activation by ReLU function;

[0100] A5. The above local feature F localThe 12 prediction networks are inputted respectively. The structure of each prediction network is r convolutional layers with 1×1 padding and 1 ring-shaped strip segmentation. After convolution, the global output sequence O is extracted. global Similar local output sequence O local , that is, using annular strip segmentation to process local features of different areas of the image separately.

[0101] like Figure 4 As shown in the figure, for a semantic information feature map of size H×W, the feature map is extracted using r different convolutional layers to obtain r different depth feature maps. For each depth feature map, different annular strip segmentation is used to cut it out, and then the cut r strip areas are spliced ​​into a new depth feature map of size H×W.

[0102] Preferably, in order to facilitate operation, the method of directly covering the outer strip with the inner strip can be adopted, and the specific steps are as follows:

[0103] i∈(0,r) is the index subscript of the stripe segmentation, where i=0 represents the index corresponding to the innermost stripe segmentation, and i=r represents the index corresponding to the outermost stripe segmentation. i Represents the feature map extracted by the convolution kernel corresponding to the i index, and its corresponding strip ring i The size of the outer edge is (i×h / r)×(i×w / r);

[0104] Then, the feature area is cut out from the outer edge of the strip in E0 and overlaid on E1. And so on, each E i Ring i Cut along the outer edge and cover E i+1 On, finally in E r The above will include all the depth feature strips.

[0105] In this embodiment, the output parameters of the global feature extraction and the output parameters of the local feature extraction are weighted to obtain the above anchor point parameters, which specifically includes the following steps:

[0106] The weighted number α learned by the neural network is introduced, and the spatial invariance of the convolutional neural network is used as the index of the 2nd to 12th outputs. The specific output function is as follows:

[0107] O k =O global k α k +O local k ·(1-α k )

[0108] Among them, O global k is the global output sequence O global The kth output in O local k is the local output sequence O local The kth output in k is the kth output weight, that is, k∈(2,12).

[0109] Furthermore, the prediction categories extracted by global features and the prediction categories extracted by local features are optimized by self-knowledge distillation to obtain the above target categories, which specifically includes the following steps:

[0110] First, the above global output sequence O global The category parameter c_ls and the local output sequence O in local The category parameter c_loc in the distillation neural network is input and the teacher category c_ls of the global output is output teacher and student category c_ls studen , and the local output teacher category c_loc teacher and student category c_loc student ;

[0111] At this point, the softmax function can also be used to process the "teacher" classification and the "student" classification respectively to generate the possibility prob of the teacher category. teacher and the probability of the student category prob student .

[0112] Then, the weighted number α learned by the distilled neural network is introduced teacher and α student , and obtain the optimized teacher categories c_ls teacher ' and student category c_ls student 'for

[0113] c_ls teacher '=c_ls teacher ×α teacher +c_loc teacher ×(1-α teacher )

[0114] c_ls student '=c_ls student ×α student +c_loc student ×(1-α student );

[0115] Finally, with the student category c_ls student 'as the optimized target category c'.

[0116] Specifically, the global output category parameter c_ls is input into a 1×1 convolutional layer to generate the global output teacher category c_ls teacher and student category c_ls student , input the local output category parameter c_loc into a 1×1 convolution layer to generate the local output teacher category c_loc teacher and student class cls_loc student .

[0117] Preferably, the anchor point parameters are transformed and calculated with the corresponding anchor frame template to obtain the 2D bounding box, 3D bounding box and the center position coordinates of the 3D bounding box, that is, [t x ,t y ,t w ,t h ]' 2D , [t x ,t y ,t z ]' P ,[t w ,t h ,t l ,t θ ]' 3D Transform the relative coordinates to the absolute coordinates of the detection target bounding box [x, y, w, h]' 2D , [x,y,z]' P ,[w,h,l,θ]' 3D .

[0118] In this embodiment, the above step S3 specifically includes the following steps:

[0119] First, use [w,h] 2D Perform a two-dimensional transformation to obtain a two-dimensional bounding box [x, y, w, h]' 2D , denoted as b' 2D :

[0120]

[0121]

[0122]

[0123]

[0124] In this embodiment, the center pixel position of each frame is [x, y] P That is, the spatial center position of each box, similar to the two-dimensional transformation, using [w,h] 2D , ZP , [w,h,l,θ] 3D Perform a three-dimensional transformation to obtain a three-dimensional bounding box [w,h,l,θ]' 3D and its center position coordinates [x,y,z]' P , denoted as b' 3D :

[0125]

[0126]

[0127]

[0128]

[0129] Then, the three-dimensional center of the projection is estimated, that is, the center position coordinates are back-projected from the image space according to the inverse calculation of the encoding to obtain the camera coordinates [x, y, z]' 3D .

[0130] Furthermore, in the above step S5, the adjustment step size σ of the viewing angle, the decay coefficient γ and the preset termination parameter β need to be preset. Then, the two-dimensional bounding box, the three-dimensional bounding box and its center position coordinates, the adjustment step size, the decay coefficient and the preset termination parameter are used as the input for the viewing angle optimization, and the projected two-dimensional box obtained after the three-dimensional bounding box is projected, and the L1loss function is performed on the two-dimensional bounding box, and the viewing angle is continuously adjusted to realize the projection of 3D information to 2D information and forward optimization processing.

[0131] Specifically, in the above step S5, the projected two-dimensional frame [x min ,y min ,x max ,y max ], denoted as ρ, and its projection formula is:

[0132]

[0133]

[0134] Υ P =P·Y 3D ,Υ 2D =Y P / Υ P [φ z ]

[0135] x min =min(Υ 2D [φ x ]),y min =min(Υ2D [φ y ])

[0136] x max =max(Υ 2D [φ x ]),y max =max(Υ 2D [φ y ])

[0137] Among them, Υ0, Υ 3D , Υ P , Υ 2D They are respectively half of the length, width and height of the target 3D bounding box, the position of the half-size in 3D space, the position after the half-size projection transformation, and the position of the half-size transformed into 2D. The whole process is to transform the 3D bounding box into a projected 2D box; φ x ,φ y ,φ z Respectively represent the index of the axis [x,y,z], [w,h,l,θ]' 3D is a 3D bounding box, [x,y,z]' P is the center position coordinate of the three-dimensional bounding box, and P is the projection matrix given by the camera coordinate system.

[0138] In this embodiment, the projected two-dimensional frame [x min ,y min ,x max ,y max ] and the two-dimensional bounding box b' 2D Compute the loss to optimize the viewing angle.

[0139] When the loss is not updated within the range of θ±σ, the decay coefficient γ is used to change the step size σ. When σ>β, the above operation is repeatedly performed until σ<β.

[0140] At this time, c',[x,y,w,h]' 2D , [x,y,z]' 3D , and the optimized [w,h,l,θ]' 3D A total of 12 parameters are output, which are the results of target detection.

[0141] Optionally, in the above step S2, training the target detection neural network specifically includes the following steps:

[0142] Construct a multi-task network loss function for target detection and perform back propagation on the training samples to obtain the weight parameters of the optimized neural network. That is, in the training phase of the neural network, it is necessary to calculate the loss function and perform back propagation on the neural network to obtain the weight parameters of the trained target detection neural network.

[0143] The above network loss functions include classification loss function, distillation loss function, 2D box regression loss function and 3D box regression loss function.

[0144] In this embodiment, for the classification loss, a multinomial logistic loss function based on softmax is used, that is, the above classification loss function is:

[0145]

[0146] For the 2D bounding box regression loss, in the 2D bounding box b' 2D and the matching ground truth 2D box The negative logistic loss function is used on the IOU, that is, the 2D box regression loss function is:

[0147]

[0148] For 3D bounding box regression loss, 3D bounding box transformation and true transformation Each parameter of is optimized using SmoothL1 regression loss. That is, the above 3D box regression loss function is:

[0149]

[0150]

[0151] Among them, SmoothL1 refers to the L1 loss function after smoothing. Using SmoothL1 to set the piecewise function can avoid the problem of instability caused by the inflection points of the function curve of the L1 loss function being not smooth enough.

[0152] Due to the introduction of the distillation neural network, the target type recognition prediction can be optimized through the teacher-student network. The distillation neural network predicts the teacher category and the possibility of the teacher category, as well as the student category and the possibility of the student category. The student category is the optimized target category, and the above distillation loss function is obtained as follows:

[0153] L distill =(c_ls teacher '-c_ls student ') 2 +(prob teacher -prob student ) 2

[0154] The overall multi-task network loss function is obtained as:

[0155]

[0156] Among them, c τ is the predicted value of the τth true target category, c i is the predicted value of the i-th category, n c is the total number of categories, IOU is the intersection-union ratio between the predicted box and the real box, b' 3D is a three-dimensional bounding box, is the true value 3D box, SmoothL1 is the L1 function after smoothing, and prob teacher is the teacher category probability, prob student is the student category possibility, λ1 is the weight coefficient of 2D box regression loss, λ2 is the weight coefficient of 3D box regression loss, and λ3 is the weight coefficient of distillation loss.

[0157] In this embodiment, the anchor point parameters and target categories of the training output targets are input into the multi-task network loss function together with the label parameters of the training data set, and the total loss L of the multi-task network loss function is back-propagated back to the target detection neural network through the back propagation of the neural network to optimize the weight parameters of the neural network until the training is completed. When the training is completed, the weight parameters of the target detection neural network are saved for application in actual scenarios.

[0158] The method of this embodiment can be used for three-dimensional target detection based on monocular images. It uses the pinhole imaging principle of a monocular camera, fully considers the different resolutions of the target at different positions and depths in the image during pinhole imaging of the monocular camera, processes the depth information of the detected target by region, and preprocesses the monocular image through a semantic information extraction backbone network, and uses self-knowledge distillation to optimize target classification, thereby effectively eliminating external noise interference and improving the accuracy of three-dimensional target detection in monocular images.

[0159] The electronic device for target detection in the embodiment of the present application includes a processor and a memory, and the processor executes the code in the memory to implement the following target detection method:

[0160] Define the anchor box template, including two-dimensional parameters [w,h] 2D , three-dimensional parameters [w,h,l,θ] 3D and depth information parameters; w, h and l represent the given values ​​of the width, height and length of the target respectively, and θ represents the viewing angle of the camera to the target;

[0161] Construct and train an object detection neural network based on semantic information extraction and annular strip segmentation depth perception, and use the trained object detection neural network to extract the anchor point parameters and object category of the object in the input image;

[0162] The above anchor point parameters are transformed and calculated with the corresponding anchor frame template to obtain the two-dimensional bounding box, the three-dimensional bounding box and the center position coordinates of the three-dimensional bounding box;

[0163] The center position coordinates are back-projected according to the reverse calculation of the encoding to obtain the camera coordinates;

[0164] Obtain a projected two-dimensional frame obtained after projecting the three-dimensional bounding box, and perform an L1loss function on the projected two-dimensional frame and the two-dimensional bounding box, adjust the viewing angle until the adjustment step of the viewing angle is less than a preset termination parameter, and obtain an adjusted three-dimensional bounding box;

[0165] Output the target category, 2D bounding box, camera coordinates, and adjusted 3D bounding box of the above target.

[0166] Optionally, the processor executes the code in the memory to implement the following target detection method:

[0167] The shared center pixel position is specified, and the depth information parameters are encoded.

[0168] Optionally, the processor executes the code in the memory to implement the following target detection method:

[0169] The trained object detection neural network is used to obtain the semantic information feature map of the input image, and the global feature extraction and the local feature extraction based on the depth perception of the ring strip segmentation are performed on the semantic information feature map;

[0170] The output parameters of the global feature extraction and the output parameters of the local feature extraction are weighted to obtain the above-mentioned anchor point parameters;

[0171] The prediction categories extracted by global features and the prediction categories extracted by local features are optimized by self-knowledge distillation to obtain the above target categories.

[0172] Preferably, the processor executes the code in the memory to implement other steps in the target detection method.

[0173] The present application is not limited to the above-mentioned embodiments. For ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention, and these improvements and modifications are also considered to be within the scope of protection of the present invention. The contents not described in detail in this specification belong to the prior art known to professional and technical personnel in this field.

Claims

1. A target detection method, It is characterized in that It includes the steps of: Define the anchor box template, including two-dimensional parameters [w,h] 2D , three-dimensional parameters [w,h,l,θ] 3D and depth information parameters; w, h and l represent the given values ​​of the width, height and length of the target respectively, and θ represents the viewing angle of the camera to the target; Construct and train an object detection neural network based on semantic information extraction and annular strip segmentation depth perception, and use the trained object detection neural network to extract the anchor point parameters and object category of the object in the input image; Transform and calculate the anchor point parameters and the corresponding anchor frame template to obtain a two-dimensional bounding box, a three-dimensional bounding box, and the center position coordinates of the three-dimensional bounding box; The center position coordinates are back-projected according to the inverse calculation of the encoding to obtain the camera coordinates; Obtain a projected two-dimensional frame obtained by projecting the three-dimensional bounding box, and perform L on the projected two-dimensional frame and the two-dimensional bounding box. 1 loss function, adjusting the viewing angle until the adjustment step of the viewing angle is less than the preset termination parameter, and obtaining the adjusted three-dimensional bounding box; Outputting an object category, a two-dimensional bounding box, camera coordinates, and an adjusted three-dimensional bounding box of the object; The projected two-dimensional box [x min ,y min ,x max ,y max The projection formula of ] is: Y P =P·γ 3D ,c 2D =c P / c P [f z ] x min =min(Y 2D [f x ]),y min =min(Y 2D [f y ]) x max =max(γ 2D [f x ]),y max =max(Y 2D [f y ]) Among them, φ x ,φ y ,φ z Respectively represent the index of the axis [x,y,z], [w,h,l,θ]' 3D is a three-dimensional bounding box, [x,y,z]' P is the center coordinate of the three-dimensional bounding box, and P is the given projection matrix.

2. The target detection method according to claim 1, It is characterized in that After defining the anchor frame template, the following step is also included: The shared center pixel position is specified, and the depth information parameters are encoded.

3. The target detection method according to claim 2, It is characterized in that Encoding the depth information parameter specifically includes: To specify the shared center pixel position as [x,y] P , the 3D center position [x,y,z] in the camera coordinate system 3D Project it into the image with the given projection matrix P and get the projection coordinates [x, y, z] P ; Based on the projection coordinates, the depth information Z P The information parameters are encoded to obtain Where P is the given projection matrix.

4. The target detection method according to claim 1, It is characterized in that The trained target detection neural network is used to extract the anchor point parameters and target categories of the targets in the input image, including: Using the trained object detection neural network to obtain a semantic information feature map of the input image, and performing global feature extraction and local feature extraction based on annular strip segmentation depth perception on the semantic information feature map; Performing weighted processing on the output parameters of global feature extraction and the output parameters of local feature extraction to obtain the anchor point parameters; The predicted category extracted by global features and the predicted category extracted by local features are optimized by self-knowledge distillation to obtain the target category.

5. The target detection method according to claim 4, It is characterized in that The semantic information feature map is subjected to global feature extraction and local feature extraction based on annular strip segmentation depth perception, specifically including: When global features are extracted through conventional convolution, the global feature F is introduced into the conventional convolution process. global , the global feature F global In the example, a 3×3 convolutional layer with a padding of 1 is introduced, and a Relu function is used for nonlinear activation to generate 512 feature maps. The global feature F global The 12 prediction networks are inputted respectively. The structure of each prediction network is a 1×1 convolution layer with a padding of 1. After convolution, the global output sequence O is extracted. global ; When local features are extracted through depth-aware convolution, annular strip segmentation is introduced in the depth-aware convolution process to segment the semantic information feature map into r different strips, and different convolution kernels are used to act on different strips; Introducing local features F local , the local feature F local In the example, 512 feature maps are generated by depth-aware convolution based on ring-shaped strip segmentation and nonlinear activation by ReLU function; The local feature F local The 12 prediction networks are inputted respectively. The structure of each prediction network is r convolutional layers with 1×1 padding and 1 ring-shaped strip segmentation. After convolution, the local output sequence O is extracted. local .

6. The target detection method according to claim 5, It is characterized in that The prediction category extracted by global features and the prediction category extracted by local features are optimized by self-knowledge distillation to obtain the target category, which specifically includes: The global output sequence O global The category parameter c_ls and the local output sequence O in local The category parameter c_loc in the distillation neural network is input and the teacher category c_ls of the global output is output teacher and student category c_ls student , and the local output teacher category c_loc teacher and student category c_loc student ; Introduce the weighted number α learned by the neural network teacher and α student , and obtain the optimized teacher categories c_ls teacher ' and student category c_ls student 'for c_ls teacher '=c_ls teacher ×α teacher +c_loc teacher ×(1−α teacher ) c_ls student '=c_ls student ×α student +c_loc student ×(1−α student ): By student category cls student ' as the optimized target category.

7. The target detection method according to claim 6, It is characterized in that Training the target detection neural network includes: Construct a multi-task network loss function for target detection and perform back propagation on the training samples to obtain the weight parameters of the optimized neural network; The network loss function includes a classification loss function, a distillation loss function, a 2D box regression loss function and a 3D box regression loss function.

8. The target detection method according to claim 7, It is characterized in that The classification loss function is: The 2D box regression loss function is: The 3D box regression loss function is: The distillation loss function is: L distill =(c_ls teacher '-c_ls student ') 2 +(prob teacher -prob student ) 2 The multi-task network loss function is obtained as: Among them, c τ is the predicted value of the τth true target category, c i is the predicted value of the i-th target category, n c is the total number of target categories, IOU is the intersection-over-union ratio, b' 2D is a two-dimensional bounding box, is the true value two-dimensional box, b 3 ' D is a three-dimensional bounding box, is the true value 3D box, SmoothL 1 L after smoothing 1 Function, prob teacher is the teacher category probability, prob student is the student category probability, λ 1 is the weight coefficient of 2D box regression loss, λ 2 is the weight coefficient of 3D box regression loss, λ 3 is the weight coefficient of distillation loss.

9. An electronic device for target detection, It is characterized in that The method comprises a processor and a memory, wherein the processor executes a code in the memory to implement the method according to any one of claims 1 to 8.

Citation Information

Patent Citations

  • Three-dimensional target detection system and method based on binocular vision

    CN111563415A

  • Vehicle identification and detection method based on deep learning

    CN112016449A

  • 3D automatic marking with structural and physical constraints

    CN112800822A