A target detection method, device, equipment and storage medium
By introducing a multi-scale feature fusion sub-model into the YOLOv3 model, standard convolution and atrous convolution structures are used to process different levels of feature maps, which solves the problem in the YOLOv3 model that the feature downsampling multiple is too high and FPN cannot increase the receptive field of deep features. , improving the accuracy of target detection.
Patent Information
- Application Number
- CN202111246534.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-10-26
- Publication Date
- 2024-10-29
- Estimated Expiration
- 2041-10-26
AI Technical Summary
The downsampling multiple of the deepest features in the existing YOLOv3 model is too high, resulting in the inability to cover the entire image, and the bilinear interpolation method in FPN cannot increase the receptive field of deep features, affecting the accuracy of large target detection and increasing The receptive field of large shallow features will reduce the detection accuracy of small targets.
Using a preset multi-scale detection network model, through the feature extraction sub-model, the first feature fusion sub-model, the second feature fusion sub-model and the third feature fusion sub-model, the standard convolution structure and the dilated convolution structure are used to detect different preset Feature maps with downsampling multiples are processed for feature deepening and fusion to increase the receptive fields of deep and mid-level features and avoid increasing the receptive fields of shallow features.
It improves the accuracy of target detection of different sizes, enhances the detection capabilities of large, medium and small targets, and improves the overall target detection accuracy.
Smart Images

Figure CN113989616B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to computer technology, and in particular to a target detection method, device, equipment and storage medium. Background Art
[0002] With the rapid development of computer technology and deep learning technology, target detection network models can be used to automatically detect and identify target objects in images.
[0003] At present, the third version of the YOLO (You Only Look Once) model, the YOLOv3 model, is usually used for multi-scale target detection to improve the accuracy of target detection.
[0004] However, in the process of implementing the present invention, the inventors found that there are at least the following problems in the prior art:
[0005] The deepest feature downsampling multiple in the existing YOLOv3 model is too high, which results in the receptive field on the original image not being able to cover the entire image, and the target object that is too large in size cannot be accurately detected. In addition, the bilinear interpolation method used by the FPN (Feature Pyramid Networks) in the existing YOLOv3 model will not increase the receptive field of the deep features. In other words, the fusion of deep features and shallow features in FPN will only increase the receptive field of shallow features, not the receptive field of deep features. In addition, the increase in the receptive field of shallow features will also reduce the detection accuracy of small targets, so the existing YOLOv3 model needs to be further improved to improve the accuracy of detecting targets of different sizes. Summary of the invention
[0006] Embodiments of the present invention provide a target detection method, apparatus, device and storage medium to improve the accuracy of detecting targets of different sizes.
[0007] In a first aspect, an embodiment of the present invention provides a target detection method, including:
[0008] Acquire the image to be detected;
[0009] The image to be detected is input into a preset multi-scale detection network model to detect the target object. The preset multi-scale detection network model includes: a feature extraction sub-model, a first feature fusion sub-model, a second feature fusion sub-model, a third feature fusion sub-model and a target detection sub-model, wherein the first feature fusion sub-model and the second feature fusion sub-model both include a standard convolution structure and a hole convolution structure, and the third feature fusion sub-model includes a standard convolution structure; the first feature fusion sub-model is used to perform feature deepening fusion processing on a first feature map output by a first residual module corresponding to a first preset downsampling multiple in the feature extraction sub-model, the second feature fusion sub-model is used to perform feature deepening fusion processing on a second feature map output by a second residual module corresponding to a second preset downsampling multiple in the feature extraction sub-model, and the third feature fusion sub-model is used to perform feature deepening fusion processing on a third feature map output by a third residual module corresponding to a third preset downsampling multiple in the feature extraction sub-model; the first preset downsampling multiple is greater than the second preset downsampling multiple, and the second preset downsampling multiple is greater than the third preset downsampling multiple;
[0010] According to the output of the preset multi-scale detection network model, an object detection result corresponding to the image to be detected is obtained.
[0011] In a second aspect, an embodiment of the present invention further provides a target detection device, including:
[0012] An image acquisition module to be detected is used to acquire the image to be detected;
[0013] A target object detection module, used for inputting the image to be detected into a preset multi-scale detection network model to detect the target object, wherein the preset multi-scale detection network model includes: a feature extraction sub-model, a first feature fusion sub-model, a second feature fusion sub-model, a third feature fusion sub-model and a target detection sub-model, wherein the first feature fusion sub-model and the second feature fusion sub-model both include a standard convolution structure and a hole convolution structure, and the third feature fusion sub-model includes a standard convolution structure; the first feature fusion sub-model is used for performing feature deepening fusion processing on a first feature map output by a first residual module corresponding to a first preset downsampling multiple in the feature extraction sub-model, the second feature fusion sub-model is used for performing feature deepening fusion processing on a second feature map output by a second residual module corresponding to a second preset downsampling multiple in the feature extraction sub-model, and the third feature fusion sub-model is used for performing feature deepening fusion processing on a third feature map output by a third residual module corresponding to a third preset downsampling multiple in the feature extraction sub-model; the first preset downsampling multiple is greater than the second preset downsampling multiple, and the second preset downsampling multiple is greater than the third preset downsampling multiple;
[0014] The target detection result acquisition module is used to obtain the target detection result corresponding to the image to be detected according to the output of the preset multi-scale detection network model.
[0015] In a third aspect, an embodiment of the present invention further provides an electronic device, the electronic device comprising:
[0016] one or more processors;
[0017] A memory for storing one or more programs;
[0018] When the one or more programs are executed by the one or more processors, the one or more processors implement the target detection method provided by any embodiment of the present invention.
[0019] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements a target detection method as provided in any embodiment of the present invention.
[0020] The embodiments of the above invention have the following advantages or beneficial effects:
[0021] By replacing the FPN network in the existing YOLOv3 model with three feature fusion sub-models, an improved preset multi-scale detection network model is obtained. The first feature fusion sub-model in the preset multi-scale detection network model can use the standard convolution structure and the hole convolution structure to perform feature deepening fusion processing on the first feature map output by the first residual module corresponding to the first preset downsampling multiple in the feature extraction sub-model, thereby increasing the receptive field of deep features and improving the accuracy of large target detection. The second feature fusion sub-model can use the standard convolution structure and the hole convolution structure to perform feature deepening fusion processing on the second feature map output by the second residual module corresponding to the second preset downsampling multiple in the feature extraction sub-model, thereby increasing the receptive field of middle-layer features and improving the accuracy of middle target detection. The third feature fusion sub-model only needs to use the standard convolution structure to perform feature deepening fusion processing on the third feature map output by the third residual module corresponding to the third preset downsampling multiple in the feature extraction sub-model, so as to avoid increasing the receptive field of shallow features and improve the accuracy of small target detection. By using the preset multi-scale detection network model, the accuracy of detection of targets of different sizes in the image to be detected can be improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] Figure 1 is a flow chart of a target detection method provided by Embodiment 1 of the present invention;
[0023] Figure 2 This is a structural example of a preset multi-scale detection network model involved in the first embodiment of the present invention;
[0024] Figure 3 is a flow chart of a target detection method provided by Embodiment 2 of the present invention;
[0025] Figure 4 This is a structural example of a first feature fusion sub-model involved in the second embodiment of the present invention;
[0026] Figure 5 This is a structural example of a second feature fusion sub-model involved in the second embodiment of the present invention;
[0027] Figure 6 This is a structural example of a third feature fusion sub-model involved in the second embodiment of the present invention;
[0028] Figure 7 is a schematic diagram of the structure of a target detection device provided in Embodiment 3 of the present invention;
[0029] Figure 8 It is a structural schematic diagram of an electronic device provided in Embodiment 4 of the present invention. DETAILED DESCRIPTION
[0030] The present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the present invention, rather than to limit the present invention. It should also be noted that, for ease of description, only parts related to the present invention, rather than all structures, are shown in the accompanying drawings.
[0031] Embodiment 1
[0032] Figure 1 This is a flow chart of a target detection method provided in the first embodiment of the present invention. This embodiment can be applied to the case of detecting target objects in images, and in particular, can be applied to the case of detecting specific target objects in network images. The method can be executed by a virtual gift display device, which can be implemented by software and / or hardware and integrated into an electronic device. Figure 1 As shown, the method specifically comprises the following steps:
[0033] S110: Acquire an image to be detected.
[0034] The image to be detected may refer to any image that needs to detect and identify a target object. For example, the image to be detected may refer to a network image collected from the network.
[0035] S120, input the image to be detected into a preset multi-scale detection network model to detect the target object, the preset multi-scale detection network model includes: a feature extraction sub-model, a first feature fusion sub-model, a second feature fusion sub-model, a third feature fusion sub-model and a target detection sub-model, wherein the first feature fusion sub-model and the second feature fusion sub-model both include a standard convolution structure and a hole convolution structure, and the third feature fusion sub-model includes a standard convolution structure; the first feature fusion sub-model is used to perform feature deepening fusion processing on the first feature map output by the first residual module corresponding to the first preset downsampling multiple in the feature extraction sub-model, the second feature fusion sub-model is used to perform feature deepening fusion processing on the second feature map output by the second residual module corresponding to the second preset downsampling multiple in the feature extraction sub-model, and the third feature fusion sub-model is used to perform feature deepening fusion processing on the third feature map output by the third residual module corresponding to the third preset downsampling multiple in the feature extraction sub-model; the first preset downsampling multiple is greater than the second preset downsampling multiple, and the second preset downsampling multiple is greater than the third preset downsampling multiple.
[0036] Among them, the target object may refer to a pre-set detection object. For example, for the detection of network images, knives, guns, fireworks, pornographic sensitive parts, etc. may be used as detection objects, i.e., target objects. The preset multi-scale detection network model may be a pre-set network model for detecting targets of different sizes by using feature maps of different scales. For example, the preset multi-scale detection network model in this embodiment may be an improved YOLOv3 model obtained by replacing the FPN network in the existing YOLOv3 model with three feature fusion sub-models. The feature extraction sub-model may be a network model that uses a convolution structure and a residual module (i.e., a module composed of a residual structure) to downsample the input image to be detected to extract features. For example, Darknet-53 in the existing YOLOv3 model may be used as a feature extraction sub-model. Downsampling in this embodiment may refer to downsampling the height and width of the image to be detected. The first preset downsampling multiple may refer to the maximum downsampling multiple in the feature extraction sub-model. The second preset downsampling multiple may refer to the second to last largest downsampling multiple in the feature extraction sub-model. The third preset downsampling multiple may refer to the third to last largest downsampling multiple in the feature extraction sub-model. Exemplarily, the first preset downsampling multiple may be 32 times, the second preset downsampling multiple may be 16 times, and the third preset downsampling multiple may be 8 times. The first feature map may refer to a feature map obtained after downsampling the image to be detected by the first preset downsampling multiple. The second feature map may refer to a feature map obtained after downsampling the image to be detected by the second preset downsampling multiple. The third feature map may refer to a feature map obtained after downsampling the image to be detected by the third preset downsampling multiple.
[0037] Among them, the first feature fusion sub-model, the second feature fusion sub-model and the third feature fusion sub-model are three independent feature fusion sub-models arranged in parallel. The standard convolution structure may refer to a convolution operation with a hole rate Rate of 1. The hole convolution structure may refer to a convolution operation with a hole rate Rate of 2 or greater than 2. The hole convolution structure can increase the receptive field, and can also capture multi-scale contextual information by setting different hole rates Rate, thereby obtaining multi-scale information to improve the accuracy of object detection of different sizes.
[0038] Specifically, Figure 2 A structural example of a preset multi-scale detection network model is given. Figure 2 As shown, the image to be detected with a size of 416×416×3 can be input into the pre-trained preset multi-scale detection network model to detect the target object. Inside the preset multi-scale detection network model, the image to be detected 410×416×3 is first input into the feature extraction sub-model, and the image to be detected is gradually downsampled by using the residual module and the convolution structure, and the first feature map 13×13×1024 output by the first residual module corresponding to the first preset downsampling multiple (i.e., 32 times) is input into the first feature fusion sub-model for feature deepening fusion processing, the second feature map 26×26×512 output by the second residual module corresponding to the second preset downsampling multiple (i.e., 16 times) is input into the second feature fusion sub-model for feature deepening fusion processing, and the third feature map 52×52×256 output by the third residual module corresponding to the third preset downsampling multiple (i.e., 8 times) is input into the third feature fusion sub-model for feature deepening fusion processing.
[0039] The first feature fusion sub-model can use multiple independent branch networks composed of standard convolution structures and dilated convolution structures to perform feature deepening fusion processing on the first feature map 13×13×1024, thereby increasing the receptive field of deep features and improving the ability to extract large-scale features, thereby improving the accuracy of large target detection. The second feature fusion sub-model can use multiple independent branch networks composed of standard convolution structures and dilated convolution structures to perform feature deepening fusion processing on the second feature map 26×26×512, thereby increasing the receptive field of mid-level features and improving the ability to extract mid-scale features, thereby improving the accuracy of mid-level target detection. The third feature fusion sub-model can use multiple independent branch networks composed of only standard convolution structures to perform feature deepening fusion processing on the third feature map 52×52×256. Since the receptive field corresponding to the third feature map input to the third feature fusion sub-model is large enough, there is no need to use the dilated convolution structure, thereby avoiding increasing the receptive field of shallow features and improving the ability to extract small-scale features, thereby improving the accuracy of small target detection. This embodiment can improve the ability to extract features of different scales by utilizing the first feature fusion sub-model, the second feature fusion sub-model, and the third feature fusion sub-model to cope with the problems caused by the scale changes of shallow, middle, and deep features, thereby making full use of the characteristics of different levels of features for detecting targets of different sizes, and further improving the accuracy of detecting targets of different sizes.
[0040] The first feature fusion sub-model can input the fourth feature map 13×13×1024 obtained after fusion into the target detection sub-model for large target detection. The target detection sub-model can use the first detection branch structure to perform convolution processing and other operations on the input fourth feature map to obtain a first detection result. The second feature fusion sub-model can input the fifth feature map 26×26×512 obtained after fusion into the target detection sub-model for medium target detection. The target detection sub-model can use the second detection branch structure to perform convolution processing and other operations on the input fifth feature map to obtain a second detection result. The third feature fusion sub-model can input the sixth feature map 52×52×256 obtained after fusion into the target detection sub-model for small target detection. The target detection sub-model can use the third detection branch structure to perform convolution processing and other operations on the input sixth feature map to obtain a third detection result. The target detection sub-model can process the first detection result, the second detection result, and the third detection result to obtain the final target detection result. For example, for each target, the detection result with the highest confidence can be selected, and the detection result with the highest confidence can be screened using non-maximum suppression (NMS) to obtain the final target detection result, and the target detection result can be output.
[0041] S130. Obtaining a target detection result corresponding to the image to be detected according to the output of the preset multi-scale detection network model.
[0042] Specifically, based on the output of the preset multi-scale detection network model, the target detection result corresponding to the image to be detected can be obtained, that is, each target object detected, the confidence level corresponding to each target object, and the rectangular box position information of each target object. The rectangular box position information may include the center point coordinates (x, y), height h, and width w.
[0043] The technical solution of this embodiment is to obtain an improved preset multi-scale detection network model by replacing the FPN network in the existing YOLOv3 model with three feature fusion sub-models. The first feature fusion sub-model in the preset multi-scale detection network model can use the standard convolution structure and the hole convolution structure to perform feature deepening fusion processing on the first feature map output by the first residual module corresponding to the first preset downsampling multiple in the feature extraction sub-model, thereby increasing the receptive field of deep features and improving the accuracy of large target detection. The second feature fusion sub-model can use the standard convolution structure and the hole convolution structure to perform feature deepening fusion processing on the second feature map output by the second residual module corresponding to the second preset downsampling multiple in the feature extraction sub-model, thereby increasing the receptive field of middle-layer features and improving the accuracy of middle target detection. The third feature fusion sub-model only needs to use the standard convolution structure to perform feature deepening fusion processing on the third feature map output by the third residual module corresponding to the third preset downsampling multiple in the feature extraction sub-model, so as to avoid increasing the receptive field of shallow features and improve the accuracy of small target detection. By utilizing the preset multi-scale detection network model, the accuracy of detecting objects of different sizes in the image to be detected can be improved.
[0044] On the basis of the above technical solution, before using the preset multi-scale detection network model, the preset multi-scale detection network model is also trained. In this embodiment, the preset multi-scale detection network model can be trained by using a gradient descent method and the learning rate can be trained by using a cosine decay method to improve the training effect and training efficiency. For example, the training process of the preset multi-scale detection network model can include the following steps S121-S123:
[0045] S121. Obtain a sample image and sample target label information corresponding to the sample image.
[0046] Among them, the sample images can be related images corresponding to each target object collected from the Internet and production practice. In this embodiment, the sample images of each category can be manually or automatically annotated in advance to obtain the sample target label information corresponding to the sample image. In this embodiment, the sample images can also be manually or automatically verified after annotation to ensure the accuracy of the annotation. For example, each type can use carefully annotated images to train a small model (Tiny-YOLO), and use the trained small model to automatically verify all the annotated sample images, determine the incorrectly annotated sample images and modify them, so as to ensure the accuracy of the annotation, and then ensure the training effect of the preset multi-scale detection network model.
[0047] Specifically, more sample images can be obtained by performing image enhancement on a small number of sample images. For example, the sample images can be enhanced by inverting them, or by random splicing, such as cropping different categories of objects from the image along the annotation box, scaling the images, and pasting the scaled images onto images of other categories.
[0048] It should be noted that the sample images used to train the preset multi-scale detection network model can be multi-scale images. For example, sample images of sizes 352×352, 384×384, 416×416, 448×448, and 480×480 can be used for training to support detection of images of different sizes and improve the training effect.
[0049] S122: Input the sample image into a preset multi-scale detection network model to detect the target object, and obtain a sample target detection result corresponding to the sample image according to the output of the preset multi-scale detection network model.
[0050] Specifically, the network structure of the preset multi-scale detection network model to be trained can be as follows: Figure 2 As shown. The sample image is input into the preset multi-scale detection network model to be trained to detect the target object, and the sample target detection result output by the preset multi-scale detection network model is obtained, that is, each target object contained in the sample image, the confidence level of each target object prediction, and the rectangular box position information of each target object.
[0051] S123. Based on a preset loss function, according to the sample target detection results and the sample target label information, determine the training error, and back-propagate the training error to the preset multi-scale detection network model, adjust the network parameters in the preset multi-scale detection network model, and terminate the training when the preset convergence condition is reached.
[0052] Specifically, the confidence error, category prediction error and rectangular box coordinate error can be determined based on the sample target detection result and the sample target label information. For example, the confidence error can be determined based on the following confidence loss function: :
[0053] in, It refers to whether the jth predicted rectangle in the i-th grid contains the target object. If so, then is 1, if not, then is 0. The predicted rectangular box with the largest GIoU value with the real rectangular box of the target object contains the target object. refers to the prediction confidence corresponding to the i-th grid, It refers to the true confidence corresponding to the i-th grid.
[0054] The category prediction error can be determined based on the following category prediction loss function :
[0055]
[0056] in, refers to the predicted probability corresponding to the i-th grid, It refers to the true probability corresponding to the i-th grid.
[0057] The coordinate error of the rectangular box can be determined based on the following coordinate prediction loss function: :
[0058] L 3 = ∑ i ∑ j I ij obj (2* w ̂ i * h ̂ i )[ ( x i - x ̂ i ) 2 + ( y i - y ̂ i ) 2 + ( w i - w ̂ i ) 2 + ( h i - h ̂ i ) 2 ]
[0059] in,( , ) refers to the predicted coordinates of the center point corresponding to the i-th grid; It refers to the predicted height corresponding to the i-th grid; ; ( , ) refers to the real coordinates of the center point corresponding to the i-th grid; It refers to the real height corresponding to the i-th grid; .
[0060] The confidence error , category prediction error and the coordinate error of the rectangular frame The sum is added, and the obtained addition result is used as the training error. The training error is back-propagated to the preset multi-scale detection network model, and the network parameters in the preset multi-scale detection network model are adjusted until the training ends when the preset convergence condition is reached. For example, when the training error is less than the preset error or the error variation range tends to be stable, or when the number of iterative training times is equal to the preset number, it indicates that the training of the preset multi-scale detection network model is completed. At this time, the preset multi-scale detection network model that has completed the training can more accurately detect target objects of different sizes.
[0061] Embodiment 2
[0062] Figure 3 This is a flow chart of a target detection method provided in Embodiment 2 of the present invention. Based on the above embodiments, this embodiment describes in detail the specific detection process of the preset multi-scale detection network model. The explanations of the terms that are the same or corresponding to the above embodiments are not repeated here.
[0063] See also Figure 3 The target detection method provided in this embodiment specifically includes the following steps:
[0064] S310: Acquire an image to be detected.
[0065] S320. Input the image to be detected into the feature extraction submodel for feature extraction, and obtain a first feature map output by the first residual module corresponding to the first preset downsampling multiple, a second feature map output by the second residual module corresponding to the second preset downsampling multiple, and a third feature map output by the third residual module corresponding to the third preset downsampling multiple.
[0066] S330: Input the first feature map into the first feature fusion sub-model for feature deepening and fusion processing to obtain a fourth feature map for detecting large-size target objects.
[0067] The large-sized target object may refer to a target object that occupies a large area in the image to be detected. Exemplarily, the first feature fusion sub-model may include: a first standard convolution layer, three first hole convolution layers, and a first feature fusion layer.
[0068] Specifically, a first standard convolution layer and three first hole convolution layers arranged in parallel can be used to perform feature deepening processing on the first feature map, and the four feature maps after feature deepening can be fused using the first feature fusion layer, thereby increasing the receptive field of the deep features and improving the accuracy of large target detection.
[0069] Exemplarily, S330 may include: inputting the first feature map into the first standard convolution layer and the three first hole convolution layers for convolution operations, respectively, to obtain the first sub-feature map, the second sub-feature map, the third sub-feature map and the fourth sub-feature map output by the first standard convolution layer and the three first hole convolution layers, respectively; inputting the first sub-feature map, the second sub-feature map, the third sub-feature map and the fourth sub-feature map into the first feature fusion layer for dimensional splicing processing, to obtain a fourth feature map for detecting large-scale target objects.
[0070] For example, Figure 4 A structural example of the first feature fusion sub-model is given. Figure 4 As shown, the first standard convolution layer may include: a two-dimensional convolution with a convolution kernel size of 1×1 and a two-dimensional convolution with a convolution kernel size of 3×3; the first first dilated convolution layer may include: a two-dimensional convolution with a convolution kernel size of 1×1 and a two-dimensional convolution with a dilation rate Rate of 2 and a convolution kernel size of 3×3; the second first dilated convolution layer may include: a two-dimensional convolution with a convolution kernel size of 1×1, a two-dimensional convolution with a convolution kernel size of 3×3, and a two-dimensional convolution with a dilation rate Rate of 3 and a convolution kernel size of 3×3; the third first dilated convolution layer may include: a two-dimensional convolution with a convolution kernel size of 1×1, a two-dimensional convolution with a convolution kernel size of 5×5, and a two-dimensional convolution with a dilation rate Rate of 5 and a convolution kernel size of 3×3.
[0071] Specifically, Figure 4 As shown, the first feature map 13×13×1024 can be input into the first standard convolution layer and the three first hole convolution layers for convolution operation, and the first sub-feature map 13×13×256, the second sub-feature map 13×13×256, the third sub-feature map 13×13×256 and the fourth sub-feature map 13×13×256 output by the first standard convolution layer and the three first hole convolution layers are obtained; the first sub-feature map 13×13×256, the second sub-feature map 13×13×256, the third sub-feature map 13×13×256 and the fourth sub-feature map 13×13×256 are input into the first feature fusion layer for dimensional splicing processing, and the fourth feature map 13×13×1024 for detecting large-scale target objects is obtained, so that the hole convolution operation can increase the receptive field of deep features, improve the ability to extract large-scale features, and thus improve the accuracy of large target detection.
[0072] It should be noted that the first feature fusion layer can also include a two-dimensional convolution with a convolution kernel size of 1×1, so as to further fuse the features of the fourth feature map 13×13×1024 through the 1×1 two-dimensional convolution to obtain the re-fused fourth feature map 13×13×1024, thereby further improving the accuracy of large target detection.
[0073] S340: Input the second feature map into the second feature fusion sub-model for feature deepening and fusion processing to obtain a fifth feature map for detecting medium-sized target objects.
[0074] The medium-sized target object may refer to a target object that occupies a moderate area in the image to be detected. Exemplarily, the second feature fusion sub-model may include: two second standard convolution layers, two second hole convolution layers, and one second feature fusion layer.
[0075] Specifically, two second standard convolutional layers and two second hole convolutional layers arranged in parallel can be used to perform feature deepening processing on the second feature map, and the four feature maps after feature deepening can be fused using the second feature fusion layer, thereby increasing the receptive field of the middle-layer features and improving the accuracy of target detection in the center.
[0076] Exemplarily, S340 may include: inputting the second feature map into two second standard convolutional layers and two second hole convolutional layers for convolution operations, respectively, to obtain the fifth sub-feature map, the sixth sub-feature map, the seventh sub-feature map and the eighth sub-feature map output by the two second standard convolutional layers and the two second hole convolutional layers, respectively; inputting the fifth sub-feature map, the sixth sub-feature map, the seventh sub-feature map and the eighth sub-feature map into the second feature fusion layer for dimensional splicing processing, to obtain the fifth feature map for detecting medium-sized target objects.
[0077] For example, Figure 5 A structural example of the second feature fusion sub-model is given. Figure 5 As shown, the two second standard convolution layers can each include: a two-dimensional convolution with a convolution kernel size of 1×1 and a two-dimensional convolution with a convolution kernel size of 3×3; the first second dilated convolution layer can include: a two-dimensional convolution with a convolution kernel size of 1×1, a two-dimensional convolution with a convolution kernel size of 3×3, and a two-dimensional convolution with a dilation rate of 2 and a convolution kernel size of 3×3; the second second dilated convolution layer can include: a two-dimensional convolution with a convolution kernel size of 1×1, a two-dimensional convolution with a convolution kernel size of 3×3, and a two-dimensional convolution with a dilation rate of 3 and a convolution kernel size of 3×3.
[0078] Specifically, Figure 5As shown, the second feature map 26×26×512 can be respectively input into two second standard convolutional layers and two second hole convolutional layers for convolution operation to obtain the fifth sub-feature map 26×26×128, the sixth sub-feature map 26×26×128, the seventh sub-feature map 26×26×128 and the eighth sub-feature map 26×26×128 output by the two second standard convolutional layers and the two second hole convolutional layers respectively; the fifth sub-feature map 26×26×128, the sixth sub-feature map 26×26×128, the seventh sub-feature map 26×26×128 and the eighth sub-feature map 26×26×128 are input into the second feature fusion layer for dimensional splicing processing to obtain the fifth feature map 26×26×512 for detecting medium-sized target objects, so that the hole convolution operation can increase the receptive field of the middle-layer features, improve the ability to extract medium-scale features, and thus improve the accuracy of medium-sized target detection.
[0079] It should be noted that the second feature fusion layer can also include a two-dimensional convolution with a convolution kernel size of 1×1, so as to further fuse the features of the fifth feature map 26×26×512 through the 1×1 two-dimensional convolution to obtain the re-fused fifth feature map 26×26×512, thereby further improving the accuracy of target detection.
[0080] S350: Input the third feature map into the third feature fusion sub-model for feature deepening and fusion processing to obtain a sixth feature map for detecting small-sized target objects.
[0081] The small-sized target object may refer to a target object that occupies a relatively small area in the image to be detected. Exemplarily, the third feature fusion sub-model may include: four third standard convolutional layers and one third feature fusion layer.
[0082] Specifically, four third standard convolutional layers arranged in parallel can be used to perform feature deepening processing on the third feature map, and the four feature maps after feature deepening can be fused using the third feature fusion layer, thereby avoiding increasing the receptive field of shallow features and thereby improving the accuracy of small target detection.
[0083] Exemplarily, S350 may include: inputting the third feature map into four third standard convolutional layers for convolution operations, respectively, to obtain a ninth sub-feature map, a tenth sub-feature map, an eleventh sub-feature map, and a twelfth sub-feature map output by the four third standard convolutional layers, respectively; inputting the ninth sub-feature map, the tenth sub-feature map, the eleventh sub-feature map, and the twelfth sub-feature map into the third feature fusion layer for dimensional splicing processing, to obtain a sixth feature map for detecting small-sized target objects.
[0084] For example, Figure 6 A structural example of the third feature fusion sub-model is given. Figure 6 As shown, the first third standard convolution layer, the second third standard convolution layer, and the third third standard convolution layer can each include: a two-dimensional convolution with a convolution kernel size of 1×1 and a two-dimensional convolution with a convolution kernel size of 3×3; the fourth third standard convolution layer can include: a two-dimensional convolution with a convolution kernel size of 1×1 and two two-dimensional convolutions with a convolution kernel size of 3×3.
[0085] Specifically, Figure 6 As shown, the third feature map 52×52×256 can be respectively input into four third standard convolutional layers for convolution operation to obtain the ninth sub-feature map 52×52×64, the tenth sub-feature map 52×52×64, the eleventh sub-feature map 52×52×64 and the twelfth sub-feature map 52×52×64 output by the four third standard convolutional layers respectively; the ninth sub-feature map 52×52×64, the tenth sub-feature map 52×52×64, the eleventh sub-feature map 52×52×64 and the twelfth sub-feature map 52×52×64 are input into the third feature fusion layer for dimensional splicing processing to obtain the sixth feature map 52×52×256 for detecting small-sized target objects, so that only using the standard convolution structure can avoid increasing the receptive field of shallow features, and also improve the ability to extract small-scale features, thereby improving the accuracy of small target detection.
[0086] It should be noted that the third feature fusion layer can also include a two-dimensional convolution with a convolution kernel size of 1×1, so as to further fuse the features of the sixth feature map 52×52×256 through the 1×1 two-dimensional convolution to obtain the re-fused sixth feature map 52×52×256, thereby further improving the accuracy of target detection.
[0087] S360: Input the fourth feature map, the fifth feature map and the sixth feature map into the target detection sub-model to detect the target object, determine the target detection result and output it.
[0088] Specifically, the target detection submodel can first use the first detection branch structure to perform convolution processing and other operations on the input fourth feature map to obtain a first detection result; use the second detection branch structure to perform convolution processing and other operations on the input fifth feature map to obtain a second detection result; use the third detection branch structure to perform convolution processing and other operations on the input sixth feature map to obtain a third detection result. Then, the first detection result, the second detection result, and the third detection result are processed to obtain the final target detection result. For example, for each target, the detection result with the highest confidence can be selected, and the detection result with the highest confidence can be screened using non-maximum suppression NMS to obtain the final target detection result, and the target detection result is output.
[0089] S370: Obtain a target detection result corresponding to the image to be detected according to the output of the preset multi-scale detection network model.
[0090] The technical solution of this embodiment obtains a fourth feature map for detecting large-sized target objects by inputting the first feature map into the first feature fusion submodel for feature deepening fusion processing, thereby increasing the receptive field of deep features and improving the accuracy of large target detection. The fifth feature map for detecting medium-sized target objects is obtained by inputting the second feature map into the second feature fusion submodel for feature deepening fusion processing, thereby increasing the receptive field of medium-layer features and improving the accuracy of medium target detection. The sixth feature map for detecting small-sized target objects is obtained by inputting the third feature map into the third feature fusion submodel for feature deepening fusion processing, thereby avoiding increasing the receptive field of shallow features and improving the accuracy of small target detection. The accuracy of detecting targets of different sizes in the image to be detected can be improved by using a preset multi-scale detection network model.
[0091] The following is an embodiment of a target detection device provided by an embodiment of the present invention. The device and the target detection methods of the above-mentioned embodiments belong to the same inventive concept. For details not described in detail in the embodiment of the target detection device, reference can be made to the embodiment of the above-mentioned target detection method.
[0092] Embodiment 3
[0093] Figure 7 This is a schematic diagram of the structure of a target detection device provided by the third embodiment of the present invention. This embodiment is applicable to the case of detecting target objects in images, and in particular, it is applicable to the case of detecting specific target objects in network images. Figure 7 As shown, the device specifically includes: a to-be-detected image acquisition module 710, a target object detection module 720 and a target detection result acquisition module 730.
[0094] Among them, the image acquisition module 710 to be detected is used to acquire the image to be detected; the target object detection module 720 is used to input the image to be detected into a preset multi-scale detection network model to detect the target object, and the preset multi-scale detection network model includes: a feature extraction sub-model, a first feature fusion sub-model, a second feature fusion sub-model, a third feature fusion sub-model and a target detection sub-model, wherein the first feature fusion sub-model and the second feature fusion sub-model both include a standard convolution structure and a hole convolution structure, and the third feature fusion sub-model includes a standard convolution structure; the first feature fusion sub-model is used to perform a first residual model corresponding to a first preset downsampling multiple in the feature extraction sub-model. The first feature map output by the block is subjected to feature deepening fusion processing, the second feature fusion sub-model is used to perform feature deepening fusion processing on the second feature map output by the second residual module corresponding to the second preset downsampling multiple in the feature extraction sub-model, and the third feature fusion sub-model is used to perform feature deepening fusion processing on the third feature map output by the third residual module corresponding to the third preset downsampling multiple in the feature extraction sub-model; the first preset downsampling multiple is greater than the second preset downsampling multiple, and the second preset downsampling multiple is greater than the third preset downsampling multiple; the target detection result acquisition module 730 is used to obtain the target detection result corresponding to the image to be detected according to the output of the preset multi-scale detection network model.
[0095] Optionally, the target object detection module 720 includes:
[0096] An image input unit to be detected is used to input the image to be detected into a feature extraction submodel for feature extraction, and obtain a first feature map output by a first residual module corresponding to a first preset downsampling multiple, a second feature map output by a second residual module corresponding to a second preset downsampling multiple, and a third feature map output by a third residual module corresponding to a third preset downsampling multiple;
[0097] A first feature map input unit is used to input the first feature map into the first feature fusion sub-model to perform feature deepening fusion processing to obtain a fourth feature map for detecting large-size target objects;
[0098] A second feature map input unit is used to input the second feature map into the second feature fusion sub-model to perform feature deepening fusion processing to obtain a fifth feature map for detecting medium-sized target objects;
[0099] A third feature map input unit is used to input the third feature map into the third feature fusion sub-model for feature deepening and fusion processing to obtain a sixth feature map for detecting small-sized target objects;
[0100] The target object detection unit is used to input the fourth feature map, the fifth feature map and the sixth feature map into the target detection sub-model to detect the target object, determine the target detection result and output it.
[0101] Optionally, the first feature fusion sub-model includes: a first standard convolution layer, three first hole convolution layers and a first feature fusion layer; a first feature map input unit, specifically used to: input the first feature map into the first standard convolution layer and the three first hole convolution layers for convolution operation, respectively, to obtain the first sub-feature map, the second sub-feature map, the third sub-feature map and the fourth sub-feature map output by the first standard convolution layer and the three first hole convolution layers respectively; input the first sub-feature map, the second sub-feature map, the third sub-feature map and the fourth sub-feature map into the first feature fusion layer for dimensional splicing processing, to obtain the fourth feature map for detecting large-scale target objects.
[0102] Optionally, the first standard convolution layer includes: a two-dimensional convolution with a convolution kernel size of 1×1 and a two-dimensional convolution with a convolution kernel size of 3×3; the first first dilated convolution layer includes: a two-dimensional convolution with a convolution kernel size of 1×1 and a two-dimensional convolution with a dilation rate of 2 and a convolution kernel size of 3×3; the second first dilated convolution layer includes: a two-dimensional convolution with a convolution kernel size of 1×1, a two-dimensional convolution with a convolution kernel size of 3×3, and a two-dimensional convolution with a dilation rate of 3 and a convolution kernel size of 3×3; the third first dilated convolution layer includes: a two-dimensional convolution with a convolution kernel size of 1×1, a two-dimensional convolution with a convolution kernel size of 5×5, and a two-dimensional convolution with a dilation rate of 5 and a convolution kernel size of 3×3.
[0103] Optionally, the second feature fusion sub-model includes: two second standard convolution layers, two second hole convolution layers and a second feature fusion layer; a second feature map input unit, specifically used to: input the second feature map into the two second standard convolution layers and the two second hole convolution layers for convolution operation, respectively, to obtain the fifth sub-feature map, the sixth sub-feature map, the seventh sub-feature map and the eighth sub-feature map output by the two second standard convolution layers and the two second hole convolution layers respectively; input the fifth sub-feature map, the sixth sub-feature map, the seventh sub-feature map and the eighth sub-feature map into the second feature fusion layer for dimensional splicing processing, to obtain the fifth feature map for detecting medium-sized target objects.
[0104] Optionally, both second standard convolution layers include: a two-dimensional convolution with a convolution kernel size of 1×1 and a two-dimensional convolution with a convolution kernel size of 3×3; the first second dilated convolution layer includes: a two-dimensional convolution with a convolution kernel size of 1×1, a two-dimensional convolution with a convolution kernel size of 3×3, and a two-dimensional convolution with a dilation rate of 2 and a convolution kernel size of 3×3; the second second dilated convolution layer includes: a two-dimensional convolution with a convolution kernel size of 1×1, a two-dimensional convolution with a convolution kernel size of 3×3, and a two-dimensional convolution with a dilation rate of 3 and a convolution kernel size of 3×3.
[0105] Optionally, the third feature fusion sub-model includes: four third standard convolutional layers and one third feature fusion layer; a third feature map input unit, specifically used to: input the third feature map into the four third standard convolutional layers for convolution operation, and obtain the ninth sub-feature map, the tenth sub-feature map, the eleventh sub-feature map and the twelfth sub-feature map output by the four third standard convolutional layers respectively; input the ninth sub-feature map, the tenth sub-feature map, the eleventh sub-feature map and the twelfth sub-feature map into the third feature fusion layer for dimensional splicing processing, and obtain the sixth feature map for detecting small-sized target objects.
[0106] Optionally, the first third standard convolution layer, the second third standard convolution layer, and the third third standard convolution layer each include: a two-dimensional convolution with a convolution kernel size of 1×1 and a two-dimensional convolution with a convolution kernel size of 3×3; the fourth third standard convolution layer includes: a two-dimensional convolution with a convolution kernel size of 1×1 and two two-dimensional convolutions with a convolution kernel size of 3×3.
[0107] Optionally, the first preset downsampling multiple is 32 times, the second preset downsampling multiple is 16 times, and the third preset downsampling multiple is 8 times.
[0108] The target detection device provided in the embodiment of the present invention can execute the target detection method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects for executing the target detection method.
[0109] It is worth noting that in the embodiment of the above-mentioned target detection device, the various units and modules included are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of the present invention.
[0110] Embodiment 4
[0111] Figure 8 A schematic diagram of the structure of an electronic device provided in Embodiment 4 of the present invention. Figure 8 A block diagram of an exemplary electronic device 12 suitable for use in implementing embodiments of the present invention is shown. Figure 8 The electronic device 12 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.
[0112] like Figure 8 As shown, the electronic device 12 is in the form of a general purpose computing device. The components of the electronic device 12 may include, but are not limited to: one or more processors or processing units 16, a system memory 28, and a bus 18 that connects various system components (including the system memory 28 and the processing unit 16).
[0113] Bus 18 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor or a local bus using any of a variety of bus architectures. By way of example, these architectures include, but are not limited to, an Industry Standard Architecture (ISA) bus, a Micro Channel Architecture (MAC) bus, an Enhanced ISA bus, a Video Electronics Standards Association (VESA) local bus, and a Peripheral Component Interconnect (PCI) bus.
[0114] The electronic device 12 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by the electronic device 12, including volatile and non-volatile media, removable and non-removable media.
[0115] The system memory 28 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 30 and / or cache memory 32. The electronic device 12 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, the storage system 34 may be used to read and write non-removable, non-volatile magnetic media ( Figure 8 not shown, usually called a "hard drive"). Although Figure 8 Not shown in the figure, a disk drive for reading and writing to a removable non-volatile disk (e.g., a "floppy disk"), and an optical disk drive for reading and writing to a removable non-volatile optical disk (e.g., a CD-ROM, a DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to the bus 18 via one or more data medium interfaces. The system memory 28 may include at least one program product having a set (e.g., at least one) of program modules that are configured to perform the functions of the various embodiments of the present invention.
[0116] A program / utility 40 having a set (at least one) of program modules 42 may be stored, for example, in system memory 28, such program modules 42 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment. Program modules 42 generally perform the functions and / or methods of the embodiments described herein.
[0117] The electronic device 12 may also communicate with one or more external devices 14 (e.g., keyboards, pointing devices, displays 24, etc.), may communicate with one or more devices that enable a user to interact with the electronic device 12, and / or may communicate with any device that enables the electronic device 12 to communicate with one or more other computing devices (e.g., network cards, modems, etc.). This communication may be performed via an input / output (I / O) interface 22. In addition, the electronic device 12 may also communicate with one or more networks (e.g., local area networks (LANs), wide area networks (WANs), and / or public networks, such as the Internet) via a network adapter 20. As shown, the network adapter 20 communicates with other modules of the electronic device 12 via a bus 18. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 12, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, etc.
[0118] The processing unit 16 executes various functional applications and data processing by running the program stored in the system memory 28, for example, implementing a target detection method provided by the embodiment of the present invention, the method comprising:
[0119] Acquire the image to be detected;
[0120] The image to be detected is input into a preset multi-scale detection network model to detect the target object. The preset multi-scale detection network model includes: a feature extraction sub-model, a first feature fusion sub-model, a second feature fusion sub-model, a third feature fusion sub-model and a target detection sub-model, wherein the first feature fusion sub-model and the second feature fusion sub-model both include a standard convolution structure and a hole convolution structure, and the third feature fusion sub-model includes a standard convolution structure; the first feature fusion sub-model is used to perform feature deepening fusion processing on the first feature map output by the first residual module corresponding to the first preset downsampling multiple in the feature extraction sub-model, the second feature fusion sub-model is used to perform feature deepening fusion processing on the second feature map output by the second residual module corresponding to the second preset downsampling multiple in the feature extraction sub-model, and the third feature fusion sub-model is used to perform feature deepening fusion processing on the third feature map output by the third residual module corresponding to the third preset downsampling multiple in the feature extraction sub-model; the first preset downsampling multiple is greater than the second preset downsampling multiple, and the second preset downsampling multiple is greater than the third preset downsampling multiple;
[0121] According to the output of the preset multi-scale detection network model, the target detection result corresponding to the image to be detected is obtained.
[0122] Of course, those skilled in the art can understand that the processor can also implement the technical solution of the target detection method provided by any embodiment of the present invention.
[0123] Embodiment 5
[0124] This embodiment provides a computer-readable storage medium having a computer program stored thereon. When the program is executed by a processor, the target detection method steps provided in any embodiment of the present invention are implemented. The method includes:
[0125] Acquire the image to be detected;
[0126] The image to be detected is input into a preset multi-scale detection network model to detect the target object. The preset multi-scale detection network model includes: a feature extraction sub-model, a first feature fusion sub-model, a second feature fusion sub-model, a third feature fusion sub-model and a target detection sub-model, wherein the first feature fusion sub-model and the second feature fusion sub-model both include a standard convolution structure and a hole convolution structure, and the third feature fusion sub-model includes a standard convolution structure; the first feature fusion sub-model is used to perform feature deepening fusion processing on the first feature map output by the first residual module corresponding to the first preset downsampling multiple in the feature extraction sub-model, the second feature fusion sub-model is used to perform feature deepening fusion processing on the second feature map output by the second residual module corresponding to the second preset downsampling multiple in the feature extraction sub-model, and the third feature fusion sub-model is used to perform feature deepening fusion processing on the third feature map output by the third residual module corresponding to the third preset downsampling multiple in the feature extraction sub-model; the first preset downsampling multiple is greater than the second preset downsampling multiple, and the second preset downsampling multiple is greater than the third preset downsampling multiple;
[0127] According to the output of the preset multi-scale detection network model, the target detection result corresponding to the image to be detected is obtained.
[0128] The computer storage medium of the embodiment of the present invention can adopt any combination of one or more computer-readable media. The computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium can be, for example, but not limited to: an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples (non-exhaustive list) of computer-readable storage media include: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this document, a computer-readable storage medium can be any tangible medium containing or storing a program, which can be used by an instruction execution system, device or device or used in combination with it.
[0129] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, which carry computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0130] The program code embodied on the computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
[0131] Computer program code for performing the operation of the present invention may be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0132] It should be understood by those skilled in the art that the modules or steps of the present invention described above can be implemented by a general-purpose computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, optionally, they can be implemented by a program code executable by a computer device, so that they can be stored in a storage device and executed by the computing device, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present invention is not limited to any specific combination of hardware and software.
[0133] Note that the above are only preferred embodiments of the present invention and the technical principles used. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in more detail through the above embodiments, the present invention is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present invention, and the scope of the present invention is determined by the scope of the appended claims.
Claims
1. A target detection method, It is characterized in that include: Acquire the image to be detected; The image to be detected is input into a preset multi-scale detection network model to detect the target object. The preset multi-scale detection network model includes: a feature extraction sub-model, a first feature fusion sub-model, a second feature fusion sub-model, a third feature fusion sub-model and a target detection sub-model, wherein the first feature fusion sub-model and the second feature fusion sub-model both include a standard convolution structure and a hole convolution structure, and the third feature fusion sub-model includes a standard convolution structure; the first feature fusion sub-model includes: a first standard convolution layer, three first hole convolution layers and a first feature fusion layer; the second feature fusion sub-model includes: two second standard convolution layers, two second hole convolution layers and a second feature fusion layer; the third feature fusion sub-model includes: four third standard convolution layers and a third feature fusion layer; the first feature fusion submodel is used to perform feature deepening fusion processing on the first feature map output by the first residual module corresponding to the first preset downsampling multiple in the feature extraction submodel, the second feature fusion submodel is used to perform feature deepening fusion processing on the second feature map output by the second residual module corresponding to the second preset downsampling multiple in the feature extraction submodel, and the third feature fusion submodel is used to perform feature deepening fusion processing on the third feature map output by the third residual module corresponding to the third preset downsampling multiple in the feature extraction submodel; the first preset downsampling multiple is greater than the second preset downsampling multiple, and the second preset downsampling multiple is greater than the third preset downsampling multiple; the first preset downsampling multiple is 32 times, the second preset downsampling multiple is 16 times, and the third preset downsampling multiple is 8 times; According to the output of the preset multi-scale detection network model, an object detection result corresponding to the image to be detected is obtained.
2. The method according to claim 1, It is characterized in that The step of inputting the image to be detected into a preset multi-scale detection network model to detect the target object includes: Input the image to be detected into the feature extraction submodel for feature extraction, and obtain a first feature map output by a first residual module corresponding to a first preset downsampling multiple, a second feature map output by a second residual module corresponding to a second preset downsampling multiple, and a third feature map output by a third residual module corresponding to a third preset downsampling multiple; Inputting the first feature map into the first feature fusion sub-model to perform feature deepening fusion processing to obtain a fourth feature map for detecting large-size target objects; Inputting the second feature map into the second feature fusion sub-model to perform feature deepening fusion processing to obtain a fifth feature map for detecting medium-sized target objects; Inputting the third feature map into the third feature fusion sub-model to perform feature deepening fusion processing to obtain a sixth feature map for detecting small-sized target objects; The fourth feature map, the fifth feature map and the sixth feature map are input into the target detection sub-model to detect the target object, and the target detection result is determined and output.
3. The method according to claim 2, It is characterized in that The step of inputting the first feature map into the first feature fusion sub-model to perform feature deepening and widening processing to obtain a fourth feature map for detecting large-scale target objects includes: Inputting the first feature map to the first standard convolution layer and the three first hole convolution layers for convolution operations, respectively, to obtain a first sub-feature map, a second sub-feature map, a third sub-feature map, and a fourth sub-feature map outputted by the first standard convolution layer and the three first hole convolution layers respectively; The first sub-feature map, the second sub-feature map, the third sub-feature map and the fourth sub-feature map are input into the first feature fusion layer for dimensional splicing processing to obtain a fourth feature map for detecting large-scale target objects.
4. The method according to claim 3, It is characterized in that The first standard convolution layer includes: a two-dimensional convolution with a convolution kernel size of 1×1 and a two-dimensional convolution with a convolution kernel size of 3×3; the first first hole convolution layer includes: a two-dimensional convolution with a convolution kernel size of 1×1 and a two-dimensional convolution with a dilation rate of 2 and a convolution kernel size of 3×3; the second first hole convolution layer includes: a two-dimensional convolution with a convolution kernel size of 1×1, a two-dimensional convolution with a convolution kernel size of 3×3, and a two-dimensional convolution with a dilation rate of 3 and a convolution kernel size of 3×3; the third first hole convolution layer includes: a two-dimensional convolution with a convolution kernel size of 1×1, a two-dimensional convolution with a convolution kernel size of 5×5, and a two-dimensional convolution with a dilation rate of 5 and a convolution kernel size of 3×3.
5. The method according to claim 2, It is characterized in that The step of inputting the second feature map into the second feature fusion sub-model to perform feature deepening fusion processing to obtain a fifth feature map for detecting medium-sized target objects includes: Inputting the second feature map into two second standard convolutional layers and two second hole convolutional layers for convolution operation respectively, to obtain a fifth sub-feature map, a sixth sub-feature map, a seventh sub-feature map and an eighth sub-feature map respectively output by the two second standard convolutional layers and the two second hole convolutional layers; The fifth sub-feature map, the sixth sub-feature map, the seventh sub-feature map and the eighth sub-feature map are input into the second feature fusion layer for dimensional splicing processing to obtain a fifth feature map for detecting medium-sized target objects.
6. The method according to claim 5, It is characterized in that Both of the second standard convolution layers include: a two-dimensional convolution with a convolution kernel size of 1×1 and a two-dimensional convolution with a convolution kernel size of 3×3; the first of the second dilated convolution layers includes: a two-dimensional convolution with a convolution kernel size of 1×1, a two-dimensional convolution with a convolution kernel size of 3×3, and a two-dimensional convolution with a dilation rate of 2 and a convolution kernel size of 3×3; the second of the second dilated convolution layers includes: a two-dimensional convolution with a convolution kernel size of 1×1, a two-dimensional convolution with a convolution kernel size of 3×3, and a two-dimensional convolution with a dilation rate of 3 and a convolution kernel size of 3×3.
7. The method according to claim 2, It is characterized in that The step of inputting the third feature map into the third feature fusion sub-model for feature deepening and fusion processing to obtain a sixth feature map for detecting small-sized target objects includes: Inputting the third feature map to the four third standard convolutional layers for convolution operations respectively, to obtain a ninth sub-feature map, a tenth sub-feature map, an eleventh sub-feature map and a twelfth sub-feature map respectively output by the four third standard convolutional layers; The ninth sub-feature map, the tenth sub-feature map, the eleventh sub-feature map and the twelfth sub-feature map are input into the third feature fusion layer for dimensional splicing processing to obtain a sixth feature map for detecting small-sized target objects.
8. The method according to claim 7, It is characterized in that The first third standard convolution layer, the second third standard convolution layer and the third third standard convolution layer all include: a two-dimensional convolution with a convolution kernel size of 1×1 and a two-dimensional convolution with a convolution kernel size of 3×3; the fourth third standard convolution layer includes: a two-dimensional convolution with a convolution kernel size of 1×1 and two two-dimensional convolutions with a convolution kernel size of 3×3.
9. A target detection device, It is characterized in that include: An image acquisition module to be detected is used to acquire the image to be detected; A target object detection module is used to input the image to be detected into a preset multi-scale detection network model to detect the target object. The preset multi-scale detection network model includes: a feature extraction sub-model, a first feature fusion sub-model, a second feature fusion sub-model, a third feature fusion sub-model and a target detection sub-model, wherein the first feature fusion sub-model and the second feature fusion sub-model both include a standard convolution structure and a hole convolution structure, and the third feature fusion sub-model includes a standard convolution structure; the first feature fusion sub-model includes: a first standard convolution layer, three first hole convolution layers and a first feature fusion layer; the second feature fusion sub-model includes: two second standard convolution layers, two second hole convolution layers and a second feature fusion layer; the third feature fusion sub-model includes: four third standard convolution layers and a The third feature fusion layer; the first feature fusion sub-model is used to perform feature deepening fusion processing on the first feature map output by the first residual module corresponding to the first preset downsampling multiple in the feature extraction sub-model, the second feature fusion sub-model is used to perform feature deepening fusion processing on the second feature map output by the second residual module corresponding to the second preset downsampling multiple in the feature extraction sub-model, and the third feature fusion sub-model is used to perform feature deepening fusion processing on the third feature map output by the third residual module corresponding to the third preset downsampling multiple in the feature extraction sub-model; the first preset downsampling multiple is greater than the second preset downsampling multiple, and the second preset downsampling multiple is greater than the third preset downsampling multiple; the first preset downsampling multiple is 32 times, the second preset downsampling multiple is 16 times, and the third preset downsampling multiple is 8 times; The target detection result acquisition module is used to obtain the target detection result corresponding to the image to be detected according to the output of the preset multi-scale detection network model.
10. An electronic device, It is characterized in that The electronic device comprises: one or more processors; A memory for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the target detection method as described in any one of claims 1-8.
11. A computer-readable storage medium having a computer program stored thereon, It is characterized in that When the program is executed by a processor, the target detection method as described in any one of claims 1 to 8 is implemented.
Citation Information
Patent Citations
Signal lamp detection and identification method and system based on multi-scale feature fusion
CN113269156A
Three-dimensional target detection method based on sparse multi-scale voxel feature fusion
CN113379709A
