A target detection method, device and storage medium

By filtering and probability transformation of anchor point boxes, a detection box is generated and non-maximum suppression is solved, and the calculation time is long in the feature map decoding process is improved, and the speed of target detection is improved.

CN111860287BActive Publication Date: 2024-12-27GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202010685749.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-07-16
Publication Date
2024-12-27
Estimated Expiration
2040-07-16

AI Technical Summary

Technical Problem

In the existing object detection methods, the processing and calculation of the anchor box during feature map decoding is long, which affects the object detection speed.

Method used

In the object detection method, by filtering the anchor box with preset probability, selecting an anchor box that meets the specific probability conditions, and using the preset convolutional neural network to transform it into category probability and coordinates, generating a detection box, and then performing a Non-maximum suppression filters to determine the target box.

Benefits of technology

By filtering the anchor box, the subsequent calculation amount is reduced and the speed of target detection is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN111860287B_ABST
    Figure CN111860287B_ABST
Patent Text Reader

Abstract

The embodiments of the present application disclose a target detection method and device, and a storage medium. The method includes: using a preset convolutional neural network to extract features from a detection image to obtain a feature map; obtaining an anchor box of each unit in the feature map, and the effective target probability of each anchor box containing a detection target predicted by the preset convolutional neural network, to obtain multiple anchor boxes and multiple effective target probabilities; using the multiple effective target probabilities, selecting an anchor box that meets a preset probability condition from the multiple anchor boxes; when at least one anchor box is selected from the multiple anchor boxes, using the at least one anchor box to determine a target box containing the detection target.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of image processing technology, and in particular to a target detection method and device, and a storage medium. Background Art

[0002] Object detection, that is, finding all objects of interest from an image, includes two parts: object localization and object classification. It can simultaneously determine the category and location of objects in an image.

[0003] YOLOv3 is a solution based on convolutional neural networks and is widely used in target detection. The entire target detection process can be divided into two parts: the first part is to output three feature maps based on the convolutional neural network, and the second part is to decode the feature maps output by the first part, thereby outputting the position coordinates of the target detection box and the target category to complete the target detection task.

[0004] However, in the above target detection scheme, the decoding process of the second part of the feature map needs to process all the anchor boxes provided by the feature map, and its calculation process is relatively time-consuming, which has a certain impact on the speed of target detection. Summary of the invention

[0005] The embodiments of the present application provide a target detection method and device, and a storage medium, which improve the speed of target detection.

[0006] The technical solution of the embodiment of the present application is implemented as follows:

[0007] The present application provides a target detection method, the method comprising:

[0008] Use the preset convolutional neural network to extract features from the detection image and obtain a feature map;

[0009] Obtaining an anchor box of each unit in the feature map and a valid target probability of containing a detection target predicted by the preset convolutional neural network for each anchor box, to obtain a plurality of anchor boxes and a plurality of valid target probabilities;

[0010] Using the multiple valid target probabilities, selecting an anchor point frame that meets a preset probability condition from the multiple anchor point frames;

[0011] When at least one anchor point frame is selected from the plurality of anchor point frames, a target frame including the detection target is determined using the at least one anchor point frame.

[0012] In the above method, the step of selecting an anchor point frame that meets a preset probability condition from the multiple anchor point frames by using the multiple valid target probabilities includes:

[0013] From the multiple valid target probabilities, select a valid target probability that is greater than a first preset probability;

[0014] In the case of selecting at least one valid target probability from the multiple valid target probabilities, an anchor point frame corresponding to each valid target probability in the at least one valid target probability is selected from the multiple anchor point frames.

[0015] In the above method, before selecting a valid target probability greater than a first preset probability from the multiple valid target probabilities, the method further includes:

[0016] Get the preset screening probability;

[0017] The first preset probability is determined using the preset screening probability.

[0018] In the above method, using the at least one anchor point frame to determine a target frame containing the detected target includes:

[0019] Obtaining a set of category probabilities and a set of coordinate transformation information predicted by the preset convolutional neural network for each anchor point frame in the at least one anchor point frame, to obtain at least one set of category probabilities and at least one set of coordinate transformation information;

[0020] For each anchor point frame in the at least one anchor point frame, transform the corresponding valid target probability in the multiple valid target probabilities into a first type probability to obtain at least one first type probability;

[0021] For each anchor point frame in the at least one anchor point frame, transform the maximum probability included in a corresponding set of category probabilities in the at least one set of category probabilities into a second type probability to obtain at least one second type probability;

[0022] Performing coordinate transformation on each anchor point frame in the at least one anchor point frame by using a corresponding set of coordinate transformation information in the at least one set of coordinate transformation information to obtain at least one detection frame;

[0023] The target frame is selected from the at least one detection frame by using the at least one first type probability and the at least one second type probability.

[0024] In the above method, the selecting the target frame from the at least one detection frame by using the at least one first type probability and the at least one second type probability includes:

[0025] For each detection frame in the at least one detection frame, determine a comprehensive probability according to corresponding probabilities in the at least one first type probability and the at least one second type probability to obtain at least one comprehensive probability;

[0026] Determine at least one candidate frame from the at least one detection frame using the at least one comprehensive probability;

[0027] Non-maximum suppression screening is performed on the at least one candidate box, and each screened candidate box is determined as the target box.

[0028] In the above method, for each detection box in the at least one detection box, determining a comprehensive probability according to corresponding probabilities in the at least one first type probability and the at least one second type probability to obtain at least one comprehensive probability includes:

[0029] For each detection frame in the at least one detection frame, determine the product of a first type probability corresponding to the at least one first type probability and a second type probability corresponding to the at least one second type probability to obtain at least one product probability;

[0030] Each product probability in the at least one product probability is determined as a comprehensive probability to obtain the at least one comprehensive probability.

[0031] In the above method, the using the at least one comprehensive probability to determine at least one candidate frame from the at least one detection frame includes:

[0032] From the at least one detection frame, select a detection frame whose corresponding comprehensive probability is greater than a second preset probability in the at least one comprehensive probability;

[0033] Each selected detection frame is determined as a candidate frame to obtain the at least one candidate frame.

[0034] The present application provides a target detection device, the device comprising:

[0035] An image processing module is used to extract features from the detection image using a preset convolutional neural network to obtain a feature map;

[0036] An information acquisition module, used to obtain the anchor box of each unit in the feature map, and the valid target probability of each anchor box containing the detection target predicted by the preset convolutional neural network, to obtain multiple anchor boxes and multiple valid target probabilities;

[0037] A frame selection module, used to select an anchor point frame that meets a preset probability condition from the multiple anchor point frames using the multiple valid target probabilities;

[0038] The target determination module is used to determine a target frame containing the detection target by using at least one anchor point frame selected by the frame selection module from the multiple anchor point frames.

[0039] In the above-mentioned device, the border selection module is specifically used to select a valid target probability greater than a first preset probability from the multiple valid target probabilities; when at least one valid target probability is selected from the multiple valid target probabilities, an anchor point frame corresponding to each valid target probability in the at least one valid target probability is selected from the multiple anchor point frames.

[0040] In the above device, the border selection module is also used to obtain a preset screening probability; and use the preset screening probability to determine the first preset probability.

[0041] In the above-mentioned device, the target determination module is specifically used to obtain a group of category probabilities and a group of coordinate transformation information predicted by the preset convolutional neural network for each anchor box in the at least one anchor box, and obtain at least one group of category probabilities and at least one group of coordinate transformation information; for each anchor box in the at least one anchor box, the corresponding valid target probability in the multiple valid target probabilities is transformed into a first type probability to obtain at least one first type probability; for each anchor box in the at least one anchor box, the maximum probability contained in a group of category probabilities corresponding to the at least one group of category probabilities is transformed into a second type probability to obtain at least one second type probability; for each anchor box in the at least one anchor box, the corresponding group of coordinate transformation information in the at least one group of coordinate transformation information is used to perform coordinate transformation on each anchor box in the at least one anchor box, and obtain at least one detection box; and the target box is selected from the at least one detection box using the at least one first type probability and the at least one second type probability.

[0042] In the above-mentioned device, the target determination module is specifically used to determine a comprehensive probability for each detection frame in the at least one detection frame according to the corresponding probabilities of the at least one first type probability and the at least one second type probability, so as to obtain at least one comprehensive probability; use the at least one comprehensive probability to determine at least one candidate frame from the at least one detection frame; perform non-maximum suppression screening on the at least one candidate frame, and determine each screened candidate frame as the target frame.

[0043] In the above-mentioned device, the target determination module is specifically used to determine, for each detection frame in the at least one detection frame, the product of the first type probability corresponding to the at least one first type probability and the second type probability corresponding to the at least one second type probability, to obtain at least one product probability; and determine each product probability in the at least one product probability as a comprehensive probability to obtain the at least one comprehensive probability.

[0044] In the above device, the target determination module is specifically used to select, from the at least one detection frame, a detection frame whose corresponding comprehensive probability is greater than a second preset probability in the at least one comprehensive probability; determine each selected detection frame as a candidate frame, and obtain the at least one candidate frame

[0045] An embodiment of the present application provides a target detection device, the device comprising a processor, a memory and a communication bus;

[0046] The communication bus is used to realize the communication connection between the processor and the memory;

[0047] The processor is used to execute the target detection program stored in the memory to implement the above target detection method.

[0048] An embodiment of the present application provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the above-mentioned target detection method is implemented.

[0049] The embodiment of the present application provides a target detection method and device, and a storage medium, the method comprising: using a preset convolutional neural network to extract features from a detection image to obtain a feature map; obtaining the anchor box of each unit in the feature map, and the effective target probability of each anchor box predicted by the preset convolutional neural network to contain the detection target, to obtain multiple anchor boxes and multiple effective target probabilities; using multiple effective target probabilities, selecting an anchor box that meets the preset probability conditions from multiple anchor boxes; when at least one anchor box is selected from multiple anchor boxes, using at least one anchor box to determine a target box containing the detection target. The target detection method provided in the embodiment of the present application screens the anchor boxes before performing a large amount of computation on the anchor boxes, thereby reducing the subsequent computation amount and improving the speed of target detection. BRIEF DESCRIPTION OF THE DRAWINGS

[0050] Figure 1 A schematic diagram of a process flow of a target detection method provided in an embodiment of the present application;

[0051] Figure 2 A schematic diagram of the structure of an exemplary characteristic graph provided in an embodiment of the present application;

[0052] Figure 3 A schematic diagram of a process for determining a target frame provided in an embodiment of the present application;

[0053] Figure 4 A schematic diagram of an exemplary transformation of an anchor point frame into a detection frame provided in an embodiment of the present application;

[0054] Figure 5 A schematic diagram of a target detection device provided in an embodiment of the present application Figure 1 ;

[0055] Figure 6 A schematic diagram of a target detection device provided in an embodiment of the present application Figure 2 . DETAILED DESCRIPTION

[0056] The following will be combined with the accompanying drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. It is understood that the specific embodiments described herein are only used to explain the related applications, rather than to limit the applications. It should also be noted that, for the convenience of description, only the parts related to the related applications are shown in the accompanying drawings.

[0057] The present application embodiment provides a target detection method, which is implemented by a target detection device, wherein the device may be an electronic device such as a mobile phone or a tablet computer, and the present application embodiment does not limit this. Figure 1 A target detection method is provided in an embodiment of the present application. Figure 1 As shown, the target detection method mainly includes the following steps:

[0058] S101, using a preset convolutional neural network to extract features of the detection image to obtain a feature map.

[0059] In an embodiment of the present application, the target detection device can use a preset convolutional neural network to extract features from the detection image to obtain a feature map.

[0060] It should be noted that in the embodiments of the present application, the detection image is an image containing a detection target such as a person or an object. The target detection device may include an image acquisition module to autonomously acquire the detection image. Of course, the detection image may also be acquired by other electronic devices and transmitted to the target detection device. The specific detection image and the source of the detection image are not limited in the embodiments of the present application.

[0061] It should be noted that, in the embodiments of the present application, a preset convolutional neural network is stored in the target detection device. The preset convolutional neural network can specifically be a pre-trained convolutional neural network. The target detection device inputs the detection image into the preset convolutional neural network to perform feature extraction processing, thereby outputting a feature map. The preset convolutional neural network can be the backbone classification network of the convolutional neural network in the target detection method YOLOv3. The specific preset convolutional neural network is not limited in the embodiments of the present application.

[0062] It should be noted that in the embodiments of the present application, the preset convolutional neural network can perform feature extraction of a scale on the detection image to obtain a feature map. Of course, the preset convolutional neural network can also perform feature extraction of multiple scales on the detection image to obtain multiple feature maps. The specific number of feature maps is actually determined according to the structure of the preset convolutional neural network, and the embodiments of the present application are not limited thereto.

[0063] Exemplarily, in an embodiment of the present application, the preset convolutional neural network can perform feature extraction of three different scales on the detection image, and accordingly, three feature maps are obtained. The shapes of the three feature maps are specifically: [1, 255, 13, 13], [1, 255, 26, 26], and [1, 255, 52, 52].

[0064] Figure 2 This is a schematic diagram of an exemplary characteristic graph provided in an embodiment of the present application. Figure 2 As shown in the figure, the shape of the feature map is [1, 255, 13, 13], where the two 13s represent the height and width of the feature map respectively. 255 is the number of channels contained in the feature map, 255 = B × (4 + 1 + 80), where B = 3, which means that each unit in the feature map contains 3 anchor boxes of different scales, and 4 represents a set of coordinate transformation information from an anchor box to a detection box, which contains 4 pieces of information t x ,t y ,t w ,t h , that is, the transformation information of the center point coordinates and width and height of the anchor box to the detection box, 1 represents the effective target probability P o , 80 represents a set of category probabilities p1, p2, ..., p corresponding to an anchor box 80 , corresponding to the probabilities of 80 categories.

[0065] It should be noted that in the embodiments of the present application, a small feature map, such as Figure 2 The feature map shown can be used to detect large targets, and a large feature map, such as a feature map of shape [1, 255, 52, 52] with a height and width of 52, can be used to detect small targets.

[0066] It should be noted that in the embodiments of the present application, the number and size of the anchor boxes for each unit in the feature map, and the number of anchor box prediction categories of the preset convolutional neural network are optional, and the embodiments of the present application do not limit them. In addition, for the same feature map, the size of the anchor box of each unit is the same.

[0067] It should be noted that in the embodiment of the present application, when multiple feature maps are obtained, the target detection device independently detects the target for each feature map, and the detection steps performed by each feature map are exactly the same.

[0068] S102, obtaining an anchor box of each unit in the feature map, and a valid target probability of containing a detection target predicted by a preset convolutional neural network for each anchor box, to obtain multiple anchor boxes and multiple valid target probabilities.

[0069] In an embodiment of the present application, after obtaining the feature map, the target detection device can obtain the anchor point box of each unit in the feature map, as well as the effective target probability of each anchor point box containing the detected target predicted by the preset convolutional neural network, thereby obtaining multiple anchor point boxes and multiple effective target probabilities.

[0070] It should be noted that in the embodiments of the present application, the detection target is a person or object in the detection image. The specific detection target and the number of detection targets can be determined according to actual needs and are not limited in the embodiments of the present application.

[0071] It can be understood that in an embodiment of the present application, as described in step S101, the feature map includes 255 channels, which includes a preset convolutional neural network for the anchor box of each unit of the feature map, and predicts the effective target probability of the detection target. Therefore, the target detection device can directly obtain the effective target probability of each anchor box, and obtain multiple anchor boxes and multiple effective probabilities, wherein the multiple anchor boxes correspond one-to-one to the multiple effective target probabilities.

[0072] S103 . Selecting an anchor point frame that meets a preset probability condition from multiple anchor point frames using multiple valid target probabilities.

[0073] In an embodiment of the present application, after obtaining multiple anchor frames and multiple valid target probabilities corresponding to the multiple anchor frames, the target detection device can use the multiple valid target probabilities to select an anchor frame that meets a preset probability condition from the multiple anchor frames.

[0074] Specifically, in an embodiment of the present application, a target detection device uses multiple valid target probabilities to select an anchor point frame that meets a preset probability condition from multiple anchor point frames, including: selecting an effective target probability greater than a first preset probability from multiple valid target probabilities; when at least one valid target probability is selected from multiple valid target probabilities, selecting an anchor point frame corresponding to each valid target probability in at least one valid target probability from multiple anchor point frames.

[0075] It can be understood that in an embodiment of the present application, the target detection device can compare each of the multiple valid target probabilities with the first preset probability, so as to select the valid target probability greater than the first preset probability. Thereafter, when at least one valid target probability is selected, at least one anchor point frame corresponding to the at least one valid target probability can be selected from the multiple anchor point frames, and the at least one selected anchor point frame is the anchor point frame that meets the preset probability condition.

[0076] It should be noted that in an embodiment of the present application, before the target detection device selects an effective target probability of a first preset probability from multiple effective target probabilities, in order to determine the first preset probability, it also performs the following steps: obtaining a preset screening probability; and determining the first preset probability using the preset screening probability.

[0077] Specifically, in an embodiment of the present application, the preset screening probability is C, and the target detection device uses the preset screening probability C to determine the first preset probability as: Accordingly, the condition for selecting at least one valid target probability can be expressed as the following formula (1):

[0078]

[0079] Among them, P o is the valid target probability corresponding to the anchor box, that is, each valid target probability satisfying formula (1) is selected from multiple valid target probabilities, so as to select each corresponding anchor box.

[0080] It should be noted that, in the embodiments of the present application, the first preset probability and the preset screening probability may also be determined based on actual experience or other algorithms, and the embodiments of the present application are not limited thereto.

[0081] It should be noted that in an embodiment of the present application, among multiple valid target probabilities, each valid target probability may not be greater than the first preset probability. Therefore, the target detection device cannot select an anchor point frame that meets the preset probability conditions from multiple anchor point frames. In fact, it indicates that the detection image does not contain the target to be detected, such as an object or a person, and the target detection device can end the target detection.

[0082] S104: When at least one anchor point frame is selected from the multiple anchor point frames, determine a target frame including the detection target using the at least one anchor point frame.

[0083] In an embodiment of the present application, when the target detection apparatus selects at least one anchor point frame from a plurality of anchor point frames, the target detection apparatus may use the at least one anchor point frame to determine a target frame including the detection target.

[0084] Figure 3 A flow chart of determining a target frame provided in an embodiment of the present application. Figure 3 As shown, the target detection device uses at least one anchor point frame to determine a target frame containing a detection target, mainly comprising the following steps:

[0085] S301, obtaining a set of category probabilities and a set of coordinate transformation information predicted by a preset convolutional neural network for each anchor point frame in at least one anchor point frame, and obtaining at least one set of category probabilities and at least one set of coordinate transformation information.

[0086] In the embodiment of the present application, as described in step S101 above, the feature map includes 255 channels, which include the probability of the detection target included in 80 categories predicted by the preset convolutional neural network for each anchor box, and also predicts a set of coordinate transformation information of an anchor box transformed into a detection box including 4 information t x ,t y ,t w ,t h , that is, the coordinate transformation information of the center point coordinates and the width and height of the anchor point frame transformed to the detection frame. Therefore, the target detection device can directly obtain a set of category probabilities and a set of coordinate transformation information corresponding to each anchor point frame in at least one selected anchor point frame, and obtain at least one set of category probabilities and at least one set of coordinate transformation information.

[0087] S302. For each anchor point frame in at least one anchor point frame, transform a corresponding valid target probability among a plurality of valid target probabilities into a first type probability to obtain at least one first type probability.

[0088] In an embodiment of the present application, the target detection device may use the following formula (2) to perform probability transformation on the effective target probability of each anchor point frame in at least one anchor point frame, thereby obtaining the corresponding first type probability:

[0089] P1=δ(P o ) (2)

[0090] Among them, P o is the effective target probability, and P1 is the first type probability.

[0091] S303. For each anchor point box in the at least one anchor point box, transform the maximum probability included in a corresponding set of category probabilities in the at least one set of category probabilities into a second type probability to obtain at least one second type probability.

[0092] In an embodiment of the present application, the target detection device may use the following formula (3) to perform probability transformation on a set of category probabilities for each anchor point frame in at least one anchor point frame, thereby obtaining a corresponding second type probability:

[0093] P2=δ(max(p1,p2,…,p 80 )) (3)

[0094] Among them, p1, p2, …, p 80 is the predicted probability of 80 categories contained in a set of category probabilities corresponding to the anchor box, and P2 is the second type probability. It should be noted that, as shown in formula (3), because the S (Sigmoid) type function used in formula (3) is a monotonic function, it actually selects the largest category probability from a set of category probabilities first, and then performs the S-type function transformation.

[0095] S304: Perform coordinate transformation on each anchor point frame in the at least one anchor point frame by using a corresponding set of coordinate transformation information in the at least one set of coordinate transformation information to obtain at least one detection frame.

[0096] In the embodiment of the present application, the target detection device uses a corresponding set of coordinate transformation information (t x ,t y ,t w ,t h ) can use the following formulas (4) to (7) to perform coordinate transformation, so that the transformed anchor point box is determined as the detection box:

[0097]

[0098]

[0099]

[0100]

[0101] Among them, t x is the transformation information of the horizontal coordinate of the center point coordinate of the anchor box, t y is the transformation information of the ordinate of the center point of the anchor box, t w is the transformation information of the anchor box width, t h is the transformation information of the anchor box height, w is the width of the feature map, h is the height of the feature map, and C x is the horizontal coordinate of the unit corresponding to the anchor box in the feature map, C y It is the ordinate of the unit corresponding to the anchor box in the feature map. Mask, bias and anchor_scale are all preset parameters, which are used to normalize the width and height of the detection box.

[0102] It should be noted that, in the embodiments of the present application, n and f are determined according to the scale of the feature map and the size of the anchor box, n, f∈[0,3). For example, three feature maps are actually obtained, and three anchor boxes of different sizes are provided for each anchor box of each feature map. Different n values ​​are selected for different feature maps, and different f values ​​are selected for anchor boxes of different sizes. The embodiments of the present application do not limit this.

[0103] Figure 4 The following is a schematic diagram of an exemplary transformation of an anchor point frame into a detection frame provided in an embodiment of the present application. Figure 4 As shown, the target detection device adopts the above-mentioned coordinate transformation method to transform each anchor point frame in the at least one selected anchor point frame into a detection frame, thereby obtaining at least one detection frame.

[0104] S305: Select a target box from at least one detection box using at least one first type probability and at least one second type probability.

[0105] In an embodiment of the present application, a target detection device selects a target frame from at least one detection frame using at least one first type probability and at least one second type probability, including: for each detection frame in the at least one detection frame, determining a comprehensive probability according to the corresponding probabilities of at least one first type probability and at least one second type probability to obtain at least one comprehensive probability; using at least one comprehensive probability to determine at least one candidate frame from the at least one detection frame; performing non-maximum suppression screening on at least one candidate frame, and determining each screened candidate frame as a target frame.

[0106] Specifically, in an embodiment of the present application, the target detection device determines a comprehensive probability for each detection frame in at least one detection frame according to the corresponding probability of at least one first type probability and at least one second type probability, and obtains at least one comprehensive probability, including: for each detection frame in at least one detection frame, determining the product of the corresponding first type probability in at least one first type probability and the corresponding second type probability in at least one second type probability, to obtain at least one product probability; and determining each product probability in the at least one product probability as a comprehensive probability, to obtain at least one comprehensive probability.

[0107] Specifically, in an embodiment of the present application, the target detection device uses at least one comprehensive probability to determine at least one candidate frame from at least one detection frame, including: selecting, from at least one detection frame, a detection frame whose corresponding comprehensive probability is greater than a second preset probability in at least one comprehensive probability; determining each selected detection frame as a candidate frame to obtain at least one candidate frame.

[0108] It should be noted that, in the embodiment of the present application, the object detection device may determine at least one candidate box according to the following formula (8):

[0109] P1×P2>conf_threshold (8)

[0110] Among them, conf_threshold is the second preset probability.

[0111] It should be noted that, in the embodiment of the present application, in step S103, the preset screening probability used to determine the first preset probability may be equal to the second preset probability, because:

[0112] At present, in the process of using YOLOv3 for target detection, after the coordinate transformation of the anchor box is performed to generate the detection box, the condition for screening the detection box is consistent with the above formula (8). Formula (8) is expanded as a function and can be expressed as the following formula (9):

[0113]

[0114] P max is max(p1,p2,…,p 80 ),remember From the characteristics of the exponential function, we know that B∈(0,1), so satisfying the following formula (11) must satisfy formula (10):

[0115]

[0116] If C in formula (1) is determined as conf_threshold, and since the S-type function has a monotonic characteristic, formula (10) can be equivalent to the above formula (1).

[0117] Specifically, in an embodiment of the present application, all candidate frames need to be sorted from high to low based on P2 before non-maximum suppression screening. The target detection device performs non-maximum suppression screening on at least one candidate frame, and determines each screened candidate frame as a target frame, including: after sorting, iterating each candidate frame from high to low based on P2, calculating the intersection and union (IOU) of the current frame and all other candidate frames behind, filtering out all candidate frames that meet the condition of IOU>nms_threshold, and after the iteration is completed, the remaining candidate frames are the final output target frames, and each target frame contains a detection target. Among them, nms_threshold is a preset parameter, which is not limited in the embodiment of the present application.

[0118] It should be noted that in the embodiments of the present application, the category of the detected target contained in the target box is actually the anchor box from which the target box originates, and the category corresponding to the maximum probability in a set of category probabilities corresponding to it, which may be a person, an object, etc., and is not limited in the embodiments of the present application.

[0119] It can be understood that in the embodiments of the present application, the target detection device screens the anchor point boxes before performing the probability transformation and coordinate transformation, thereby effectively filtering out most of the anchor point boxes, and then performing subsequent probability transformation, coordinate transformation and related calculations, which can greatly reduce the amount of calculation.

[0120] Exemplarily, a preset convolutional neural network is used to extract features of the detection image, and three feature maps are obtained, namely: [1, 255, 13, 13], [1, 255, 26, 26], and [1, 255, 52, 52]. Each feature map is matched with three anchor boxes of different scales, that is, each unit of each feature map corresponds to three anchor boxes of different scales. If all the anchor boxes are directly used for subsequent probability transformation and other processing, the number of anchor boxes that need to be processed is (13×13+26×26+52×52)×3=10647. If the effective target probability is used for screening provided by the embodiment of the present application, the anchor boxes that need to be processed subsequently can be reduced to about 100.

[0121] The embodiment of the present application provides a target detection method, including: using a preset convolutional neural network to extract features from a detection image to obtain a feature map; obtaining an anchor box of each unit in the feature map, and the effective target probability of each anchor box predicted by the preset convolutional neural network to contain the detection target, to obtain multiple anchor boxes and multiple effective target probabilities; using multiple effective target probabilities, selecting an anchor box that meets the preset probability conditions from multiple anchor boxes; when at least one anchor box is selected from multiple anchor boxes, using at least one anchor box to determine a target box containing the detection target. The target detection method provided in the embodiment of the present application screens the anchor boxes before performing a large amount of computation on the anchor boxes, thereby reducing the subsequent computation and improving the speed of target detection.

[0122] An embodiment of the present application provides a target detection device. Figure 5 A schematic diagram of a target detection device provided in an embodiment of the present application Figure 1 .like Figure 5 As shown, the target detection device includes:

[0123] The image processing module 501 is used to extract features from the detection image using a preset convolutional neural network to obtain a feature map;

[0124] An information acquisition module 502 is used to acquire an anchor box of each unit in the feature map, and a valid target probability of containing a detection target predicted by the preset convolutional neural network for each anchor box, to obtain multiple anchor boxes and multiple valid target probabilities;

[0125] A frame selection module 503 is used to select an anchor point frame that meets a preset probability condition from the multiple anchor point frames using the multiple valid target probabilities;

[0126] The target determination module 504 is configured to determine a target frame including the detection target by using at least one anchor frame selected from the plurality of anchor frames by the bounding box selection module 503 .

[0127] In one embodiment of the present application, the border selection module 503 is specifically used to select a valid target probability greater than a first preset probability from the multiple valid target probabilities; when at least one valid target probability is selected from the multiple valid target probabilities, an anchor point frame corresponding to each valid target probability in the at least one valid target probability is selected from the multiple anchor point frames.

[0128] In an embodiment of the present application, the border selection module 503 is further used to obtain a preset screening probability; and use the preset screening probability to determine the first preset probability.

[0129] In one embodiment of the present application, the target determination module 504 is specifically used to obtain a set of category probabilities and a set of coordinate transformation information predicted by the preset convolutional neural network for each anchor box in the at least one anchor box, and obtain at least one set of category probabilities and at least one set of coordinate transformation information; for each anchor box in the at least one anchor box, the corresponding valid target probability in the multiple valid target probabilities is transformed into a first type probability to obtain at least one first type probability; for each anchor box in the at least one anchor box, the maximum probability contained in a set of category probabilities corresponding to the at least one set of category probabilities is transformed into a second type probability to obtain at least one second type probability; for each anchor box in the at least one anchor box, the corresponding set of coordinate transformation information in the at least one set of coordinate transformation information is used to perform coordinate transformation on each anchor box in the at least one anchor box, to obtain at least one detection box; and the target box is selected from the at least one detection box using the at least one first type probability and the at least one second type probability.

[0130] In one embodiment of the present application, the target determination module 504 is specifically used to determine a comprehensive probability for each detection frame in the at least one detection frame according to the corresponding probabilities of the at least one first type probability and the at least one second type probability, to obtain at least one comprehensive probability; using the at least one comprehensive probability, determine at least one candidate frame from the at least one detection frame; perform non-maximum suppression screening on the at least one candidate frame, and determine each screened candidate frame as the target frame.

[0131] In one embodiment of the present application, the target determination module 504 is specifically used to determine, for each detection box in the at least one detection box, the product of the first type probability corresponding to the at least one first type probability and the second type probability corresponding to the at least one second type probability, to obtain at least one product probability; and determine each product probability in the at least one product probability as a comprehensive probability to obtain the at least one comprehensive probability.

[0132] In one embodiment of the present application, the target determination module 504 is specifically used to select, from the at least one detection frame, a detection frame whose corresponding comprehensive probability is greater than a second preset probability from the at least one comprehensive probability; and determine each selected detection frame as a candidate frame to obtain the at least one candidate frame.

[0133] Figure 6 A schematic diagram of a target detection device provided in an embodiment of the present application Figure 2 .like Figure 6 As shown, the target detection device includes a processor 601, a memory 602 and a communication bus 603;

[0134] The communication bus 603 is used to realize the communication connection between the processor 601 and the memory 602;

[0135] The processor 601 is used to execute the target detection program stored in the memory 602 to implement the above target detection method.

[0136] The embodiment of the present application provides a target detection device, which uses a preset convolutional neural network to extract features from a detection image to obtain a feature map; obtains the anchor box of each unit in the feature map, and the effective target probability of each anchor box predicted by the preset convolutional neural network to contain the detection target, to obtain multiple anchor boxes and multiple effective target probabilities; uses the multiple effective target probabilities to select an anchor box that meets the preset probability conditions from the multiple anchor boxes; when at least one anchor box is selected from the multiple anchor boxes, uses the at least one anchor box to determine the target box containing the detection target. The target detection device provided in the embodiment of the present application screens the anchor boxes before performing a large amount of computation on the anchor boxes, thereby reducing the subsequent computation and improving the speed of target detection.

[0137] The embodiment of the present application also provides a computer-readable storage medium, on which a computer program is stored, and the computer program is executed by a processor to implement the above-mentioned target detection method. The computer-readable storage medium can be a volatile memory (volatile memory), such as a random access memory (Random-Access Memory, RAM); or a non-volatile memory (non-volatile memory), such as a read-only memory (Read-Only Memory, ROM), a flash memory (flash memory), a hard disk (Hard Disk Drive, HDD) or a solid-state drive (Solid-State Drive, SSD); or it can be a respective device including one or any combination of the above memories, such as a mobile phone, a computer, a tablet device, a personal digital assistant, etc.

[0138] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of hardware embodiments, software embodiments, or embodiments in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage and optical storage, etc.) that contain computer-usable program code.

[0139] The present application is described with reference to implementation flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the process in the flowchart. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0140] These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device, which is implemented in the implementation flow diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0141] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operation steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for executing the steps in the flowchart. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0142] The above are only specific implementations of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions that can be easily thought of by any technician familiar with the technical field within the technical scope disclosed in the utility model should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A target detection method, characterized in that: The method comprises: Use the preset convolutional neural network to extract features from the detection image and obtain a feature map; Obtaining an anchor box of each unit in the feature map and a valid target probability of containing a detection target predicted by the preset convolutional neural network for each anchor box, to obtain a plurality of anchor boxes and a plurality of valid target probabilities; Using the multiple valid target probabilities, selecting an anchor point frame that meets a preset probability condition from the multiple anchor point frames; When at least one anchor point frame is selected from the plurality of anchor point frames, determining a target frame including the detection target by using the at least one anchor point frame; The selecting, from the plurality of anchor point frames, an anchor point frame that satisfies a preset probability condition by using the plurality of valid target probabilities comprises: From the multiple valid target probabilities, select a valid target probability that is greater than a first preset probability; In the case of selecting at least one valid target probability from the multiple valid target probabilities, an anchor point frame corresponding to each valid target probability in the at least one valid target probability is selected from the multiple anchor point frames.

2. The method according to claim 1, characterized in that Before selecting a valid target probability greater than a first preset probability from the multiple valid target probabilities, the method further includes: Get the preset screening probability; The first preset probability is determined using the preset screening probability.

3. The method according to claim 1, characterized in that Determining a target frame containing the detected target by using the at least one anchor point frame includes: Obtaining a set of category probabilities and a set of coordinate transformation information predicted by the preset convolutional neural network for each anchor point frame in the at least one anchor point frame, to obtain at least one set of category probabilities and at least one set of coordinate transformation information; For each anchor point frame in the at least one anchor point frame, transform the corresponding valid target probability in the multiple valid target probabilities into a first type probability to obtain at least one first type probability; For each anchor point frame in the at least one anchor point frame, transform the maximum probability included in a corresponding set of category probabilities in the at least one set of category probabilities into a second type probability to obtain at least one second type probability; Performing coordinate transformation on each anchor point frame in the at least one anchor point frame by using a corresponding set of coordinate transformation information in the at least one set of coordinate transformation information to obtain at least one detection frame; The target frame is selected from the at least one detection frame by using the at least one first type probability and the at least one second type probability.

4. The method according to claim 3, characterized in that The selecting the target frame from the at least one detection frame by using the at least one first type probability and the at least one second type probability includes: For each detection frame in the at least one detection frame, determine a comprehensive probability according to corresponding probabilities in the at least one first type probability and the at least one second type probability to obtain at least one comprehensive probability; Determine at least one candidate frame from the at least one detection frame using the at least one comprehensive probability; Non-maximum suppression screening is performed on the at least one candidate box, and each screened candidate box is determined as the target box.

5. The method according to claim 4, characterized in that For each detection box in the at least one detection box, determining a comprehensive probability according to corresponding probabilities in the at least one first type probability and the at least one second type probability, to obtain at least one comprehensive probability, including: For each detection frame in the at least one detection frame, determine the product of a first type probability corresponding to the at least one first type probability and a second type probability corresponding to the at least one second type probability to obtain at least one product probability; Each product probability in the at least one product probability is determined as a comprehensive probability to obtain the at least one comprehensive probability.

6. The method according to claim 4, characterized in that The using the at least one comprehensive probability to determine at least one candidate frame from the at least one detection frame comprises: From the at least one detection frame, select a detection frame whose corresponding comprehensive probability is greater than a second preset probability in the at least one comprehensive probability; Each selected detection frame is determined as a candidate frame to obtain the at least one candidate frame.

7. A target detection device, characterized in that: The device comprises: An image processing module is used to extract features from the detection image using a preset convolutional neural network to obtain a feature map; An information acquisition module, used to obtain the anchor box of each unit in the feature map, and the valid target probability of each anchor box containing the detection target predicted by the preset convolutional neural network, to obtain multiple anchor boxes and multiple valid target probabilities; A frame selection module, used to select an anchor point frame that meets a preset probability condition from the multiple anchor point frames using the multiple valid target probabilities; A target determination module, configured to determine a target frame containing the detection target by using at least one anchor point frame selected by the bounding box selection module from the plurality of anchor point frames; The border selection module is used to select a valid target probability greater than a first preset probability from the multiple valid target probabilities; when at least one valid target probability is selected from the multiple valid target probabilities, an anchor point frame corresponding to each valid target probability in the at least one valid target probability is selected from the multiple anchor point frames.

8. A target detection device, characterized in that: The device includes a processor, a memory, and a communication bus; The communication bus is used to realize the communication connection between the processor and the memory; The processor is used to execute the target detection program stored in the memory to implement the target detection method according to any one of claims 1 to 6.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the target detection method according to any one of claims 1 to 6 is implemented.

Citation Information

Cited By

  • Lane detection method integratedly using image enhancement and deep convolutional neural network

    US12380544B2

  • Lane detection method integratedly using image enhancement and deep convolutional neural network

    US20230186439A1