An image target detection method based on improved YOLOv4
By introducing clustering algorithms and pyramid pooling modules in YOLOv4, the feature extraction capability is enhanced, and the problem of missing small targets in the YOLO series network in complex backgrounds is solved, significantly improving the detection accuracy.
Patent Information
- Application Number
- CN202210330773.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-30
- Publication Date
- 2024-12-06
- Estimated Expiration
- 2042-03-30
AI Technical Summary
The YOLO series networks are prone to miss detection of small targets in complex contexts, and each grid can only predict one category, so the detection accuracy is insufficient.
A method of image object detection based on improved YOLOv4 was designed, and a priori box size was obtained through preset clustering algorithm, detection layer was added and pyramid pooling module was introduced, feature extraction and multi-scale pooling capabilities were enhanced, and convolution processing was combined with Interpolation processing improves detection accuracy.
On the PASCALVOC2007 and VOC2012 datasets, the accuracy of object detection was increased by 2.03% and 1.94%, respectively, significantly improving the accuracy of image target detection.
Smart Images

Figure CN114818872B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to an image target detection method based on improved YOLOv4, and belongs to the technical field of target recognition. Background Art
[0002] The YOLO series of networks are used for one-stage target detection methods, and have the characteristics of fast target detection speed and high accuracy. When an image is input into the YOLO series of networks, it is divided into an S×S grid. As long as the center point of the object falls on a certain grid, the grid is used to detect the target, and a rectangular box is generated to locate the position and determine the category. The YOLO network proposed by Redmon can detect the target in just one time, with a very fast detection speed, and can detect 45 pictures per second.
[0003] YOLO transforms the target detection problem into a regression problem, borrowing the core idea of GoogleNet, and realizing target detection feature extraction through a single neural network, and combining the fully connected layer to help obtain the detection results, predicting the bounding boxes and probabilities of multiple regions at one time, and outputting the prediction results of the box with the highest intersection over union (IoU), with high real-time performance. In the application, it divides the image into multiple regions and predicts the bounding box and probability of each region. Multiple grids are equivalent to candidate regions in the two-stage target detector, and no longer need to be generated by the RPN network. However, each grid can only predict one category, and each grid only generates two bounding boxes. The performance needs to be improved for some complex backgrounds, and it is easy to miss small targets. Summary of the invention
[0004] The technical problem to be solved by the present invention is to provide an image target detection method based on improved YOLOv4, which introduces an improved target YOLOv4 network and can effectively improve the accuracy of image target detection.
[0005] In order to solve the above technical problems, the present invention adopts the following technical solutions: the present invention designs an image target detection method based on improved YOLOv4, based on sample images whose target type object positions in the images are respectively known, a target recognition model is obtained according to the following steps A to C; then, for an image to be recognized of the same type of scene as the sample image, the target recognition model is applied to obtain the target type object position in the image to be recognized, and image target detection is completed;
[0006] Step A: using a preset clustering algorithm to process the image set composed of each sample image, obtain a preset number M of prior frame sizes corresponding to the image set, and then proceed to step B;
[0007] Step B. Based on a target YOLOv4 network based on a YOLOv4 network and including a preset number of N detection layers, the result of M / N is an integer greater than 0, and each detection layer corresponds to M / N priori boxes respectively. For each priori box sorted from small to large in size, the order corresponds to each detection layer sorted from large to small in scale, and the input end of the target YOLOv4 network receives the image, and each detection layer outputs a feature map corresponding to the image based on each priori box corresponding to it, and then enters step C;
[0008] Step C. Based on the target YOLOv4 network, the recognition model to be trained is composed of the output ends of each detection layer connected to the same image integration module, and each sample image, with the sample image as input and the sample image that identifies the position of the target type object as output, and the recognition model to be trained is trained to obtain the target recognition model.
[0009] As a preferred technical solution of the present invention: in the step A, a K-means clustering algorithm is used to process the image set composed of each sample image to obtain a preset number M of prior frame sizes corresponding to the image set.
[0010] As a preferred technical solution of the present invention: the target YOLOv4 network is based on the YOLOv4 network and includes 4 detection layers, each of which includes a darknet convolution module DBL and a convolution module conv. In each detection layer, the input end of the darknet convolution module DBL constitutes the input end of the detection layer, the output end of the darknet convolution module DBL is connected to the input end of the corresponding convolution module conv, and the output end of the convolution module conv constitutes the output end of the detection layer; each detection layer is sorted from large to small according to its scale to form a detection layer sorting;
[0011] The target YOLOv4 network also includes a pre-enhanced feature extraction network, a first sub-enhanced feature extraction network, a second sub-enhanced feature extraction network, a third sub-enhanced feature extraction network, and a first pre-detection module, a second pre-detection module, and a third pre-detection module; the pre-enhanced feature extraction network includes a darknet convolution module DBL, an upsampling parallel module SPP, and a darknet convolution module DBL connected in series in sequence, wherein the input end of the first darknet convolution module DBL constitutes the input end of the pre-enhanced feature extraction network, and the output end of the second darknet convolution module DBL constitutes the output end of the pre-enhanced feature extraction network; each sub-enhanced feature extraction network includes an upsampling module upsample, a connection module concat, and three darknet convolution modules DBL, in each sub-enhanced feature extraction network, the input end of the first darknet convolution module DBL constitutes the first input end of the sub-enhanced feature extraction network, the input end of the second darknet convolution module DBL constitutes the second input end of the sub-enhanced feature extraction network, and the output end of the second darknet convolution module DBL constitutes the output end of the pre-enhanced feature extraction network. The output end of a darknet convolution module DBL is connected to the input end of the upsampling module upsample, the output end of the upsampling module upsample and the output end of the second darknet convolution module DBL are connected to the input end of the connection module concat, the output end of the connection module concat is connected to the input end of the third darknet convolution module DBL, and the output end of the third darknet convolution module DBL constitutes the output end of the sub-enhanced feature extraction network; the first pre-detection module, the second pre-detection module, and the third pre-detection module respectively include a connection module concat and two darknet convolution modules DBL, in each pre-detection module, the input end of the first darknet convolution module DBL constitutes the first input end of the pre-detection module, the output end of the first darknet convolution module DBL is connected to one of the input ends of the connection module concat, the other input end of the connection module concat constitutes the second input end of the pre-detection module, and the output end of the connection module concat constitutes the output end of the pre-detection module;
[0012] In the structure of the target YOLOv4 network, the input end of the backbone feature extraction network in the YOLOv4 network constitutes the input end of the target YOLOv4 network, the output end of the backbone feature extraction network is connected to the input end of the pre-enhanced feature extraction network, the output end of the pre-enhanced feature extraction network is connected to the first input end of the first sub-enhanced feature extraction network, the output end of the backbone feature extraction network is connected to the second input end of the first sub-enhanced feature extraction network; the output end of the first sub-enhanced feature extraction network is connected to the first input end of the second sub-enhanced feature extraction network, the output end of the second branch in sequence on the backbone feature extraction network is connected to the second input end of the second sub-enhanced feature extraction network; the output end of the second sub-enhanced feature extraction network is connected to the first input end of the third sub-enhanced feature extraction network, the output end of the first branch in sequence on the backbone feature extraction network is connected to the second input end of the third sub-enhanced feature extraction network; the output end of the third sub-enhanced feature extraction network is connected to the first branch in sequence in the detection layer The output end of the connection module concat in the third sub-enhanced feature extraction network is connected to the first input end of the first pre-detection module, the output end of the second sub-enhanced feature extraction network is connected to the second input end of the first pre-detection module, and the output end of the first pre-detection module is connected to the input end of the second detection layer in the detection layer sorting; the output end of the connection module concat in the first pre-detection module is connected to the first input end of the second pre-detection module, the output end of the first sub-enhanced feature extraction network is connected to the second input end of the second pre-detection module, and the output end of the second pre-detection module is connected to the input end of the third detection layer in the detection layer sorting; the output end of the connection module concat in the second pre-detection module is connected to the first input end of the third pre-detection module, the output end of the pre-enhanced feature extraction network is connected to the second input end of the third pre-detection module, and the output end of the third pre-detection module is connected to the input end of the fourth detection layer in the detection layer sorting.
[0013] As a preferred technical solution of the present invention: the target YOLOv4 network also includes a pyramid pooling module, the pyramid pooling module includes a convolution module, a bilinear interpolation module, and a preset number of pooling modules with different pooling kernel sizes, wherein the input end of each pooling module constitutes the input end of the pyramid pooling module, the output end of each pooling module is connected to the input end of the convolution module, the output end of the convolution module is connected to the input end of the bilinear interpolation module, the output end of the bilinear interpolation module constitutes the output end of the pyramid pooling module, and the input ends of the pyramid pooling module are simultaneously connected to the output end of the pyramid pooling module; the output end of the backbone feature extraction network is connected to the input ends of the pyramid pooling module, and the output end of the pyramid pooling module is connected to the input end of the pre-enhanced feature extraction network.
[0014] As a preferred technical solution of the present invention: the number of pooling modules in the pyramid pooling module is 4, namely, a pooling module with a pooling core size of 6×6, a pooling module with a pooling core size of 3×3, a pooling module with a pooling core size of 2×2, and a pooling module with a pooling core size of 1×1, and the convolution kernel size of the convolution module in the pyramid pooling module is 1×1.
[0015] As a preferred technical solution of the present invention: each of the darknet convolution modules DBL includes a convolution module conv, a normalization module BN, and an activation module connected in sequence, wherein the input end of the convolution module conv constitutes the input end of the darknet convolution module DBL, and the output end of the activation module constitutes the output end of the darknet convolution module DBL.
[0016] As a preferred technical solution of the present invention: the upsampling parallel module SPP includes a connection module concat and three maximum pooling modules maxpool. In the upsampling parallel module SPP, the input ends of each maximum pooling module maxpool are connected and constitute the input end of the upsampling parallel module SPP, the output ends of each maximum pooling module maxpool and the input end of the upsampling parallel module SPP are connected to the input end of the connection module concat, and the output end of the connection module concat constitutes the output end of the upsampling parallel module SPP.
[0017] As a preferred technical solution of the present invention: the scale corresponding to the first detection layer in the detection layer sorting is 104×104, the scale corresponding to the second detection layer is 52×52, the scale corresponding to the third detection layer is 26×26, and the scale corresponding to the fourth detection layer is 13×13.
[0018] The image target detection method based on improved YOLOv4 described in the present invention adopts the above technical solution compared with the prior art, and has the following technical effects:
[0019] The image target detection method designed by the present invention is based on the improved YOLOv4, and is improved based on the existing YOLOv4 path enhancement network. By increasing the design of the detection layer, the effect of shallow feature fusion is enhanced, and the sizes of each priori frame corresponding to the image set are obtained under the combination of a clustering method, so as to realize high-precision feature extraction of each detection layer, and introduce a multi-scale pooling module parallel structure and a pyramid pooling module combining convolution processing and interpolation processing to further improve the detection accuracy of the feature layer, thereby effectively improving the accuracy of detecting the target object in the picture. In actual simulation experiments, the design method of the present invention shows excellent target detection accuracy, and the mAP on two data sets of PASCAL VOC 2007 and VOC 2012 is respectively improved by 2.03% and 1.94%. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] Figure 1 It is a flow chart of an image target detection method designed by the present invention based on improved YOLOv4;
[0021] Figure 2 It is a schematic diagram of the structure of an embodiment of the target YOLOv4 network in the design of the present invention;
[0022] Figure 3 It is the visual comparison result between the design method of the present invention and other target detection methods. DETAILED DESCRIPTION
[0023] The specific implementation modes of the present invention will be further described in detail below in conjunction with the accompanying drawings.
[0024] The present invention designs an image target detection method based on improved YOLOv4. In practical applications, such as Figure 1 As shown, based on each sample image in which the position of the target type object in the image is known, the target recognition model is obtained by following steps A to C.
[0025] Step A: Use the K-means clustering algorithm to process the image set composed of each sample image, obtain a preset number M of prior frame sizes corresponding to the image set, and then proceed to step B.
[0026] In practical applications, 12 prior box sizes corresponding to the image set are obtained, such as (14, 22), (16, 47), (26, 82), (38, 35), (44, 126), (66, 66), (76, 163), (116, 251), (134, 113), (202, 321), (257, 180), and (361, 343).
[0027] Step B. Based on a target YOLOv4 network based on a YOLOv4 network and including a preset number of N detection layers, the result of M / N is an integer greater than 0, and each detection layer corresponds to M / N priori boxes respectively. For each priori box sorted from small to large, the order corresponds to each detection layer sorted from large to small in scale. Based on the input end of the target YOLOv4 network receiving the image, each detection layer outputs a feature map corresponding to the image based on the corresponding priori boxes, and then enters step C.
[0028] In practical applications, such as Figure 2As shown in the figure, the target YOLOv4 network designed here is based on the YOLOv4 network and includes 4 detection layers. Each detection layer includes a darknet convolution module DBL and a convolution module conv. In each detection layer, the input end of the darknet convolution module DBL constitutes the input end of the detection layer, and the output end of the darknet convolution module DBL is connected to the input end of the corresponding convolution module conv, and the output end of the convolution module conv constitutes the output end of the detection layer; each detection layer is sorted from large to small according to its scale to form a detection layer sorting.
[0029] like Figure 2 As shown, the target YOLOv4 network also includes a pre-enhanced feature extraction network, a first sub-enhanced feature extraction network, a second sub-enhanced feature extraction network, a third sub-enhanced feature extraction network, and a first pre-detection module, a second pre-detection module, and a third pre-detection module; the pre-enhanced feature extraction network includes a darknet convolution module DBL, an upsampling parallel module SPP, and a darknet convolution module DBL connected in series in sequence, wherein the input end of the first darknet convolution module DBL constitutes the input end of the pre-enhanced feature extraction network, and the output end of the second darknet convolution module DBL constitutes the output end of the pre-enhanced feature extraction network; each sub-enhanced feature extraction network includes an upsampling module upsample, a connection module concat, and three darknet convolution modules DBL, and in each sub-enhanced feature extraction network, the input end of the first darknet convolution module DBL constitutes the first input end of the sub-enhanced feature extraction network, and the input end of the second darknet convolution module DBL constitutes the second input end of the sub-enhanced feature extraction network, The output end of the first darknet convolution module DBL is connected to the input end of the upsampling module upsample, the output end of the upsampling module upsample and the output end of the second darknet convolution module DBL are connected to the input end of the connection module concat, the output end of the connection module concat is connected to the input end of the third darknet convolution module DBL, and the output end of the third darknet convolution module DBL constitutes the output end of the sub-enhanced feature extraction network; the first pre-detection module, the second pre-detection module, and the third pre-detection module respectively include a connection module concat and two darknet convolution modules DBL, in each pre-detection module, the input end of the first darknet convolution module DBL constitutes the first input end of the pre-detection module, the output end of the first darknet convolution module DBL is connected to one of the input ends of the connection module concat, the other input end of the connection module concat constitutes the second input end of the pre-detection module, and the output end of the connection module concat constitutes the output end of the pre-detection module.
[0030] like Figure 2 As shown, in the structure of the target YOLOv4 network, the input end of the backbone feature extraction network in the YOLOv4 network constitutes the input end of the target YOLOv4 network, the output end of the backbone feature extraction network is connected to the input end of the pre-enhanced feature extraction network, the output end of the pre-enhanced feature extraction network is connected to the first input end of the first sub-enhanced feature extraction network, and the output end of the backbone feature extraction network is connected to the second input end of the first sub-enhanced feature extraction network; the output end of the first sub-enhanced feature extraction network is connected to the first input end of the second sub-enhanced feature extraction network, and the output end of the sequential second branch on the backbone feature extraction network is connected to the second input end of the second sub-enhanced feature extraction network; the output end of the second sub-enhanced feature extraction network is connected to the first input end of the third sub-enhanced feature extraction network, and the output end of the sequential first branch on the backbone feature extraction network is connected to the second input end of the third sub-enhanced feature extraction network; the output end of the third sub-enhanced feature extraction network is connected to the first input end of the detection layer sorting. The output end of the connection module concat in the third sub-enhanced feature extraction network is connected to the first input end of the first pre-detection module, the output end of the second sub-enhanced feature extraction network is connected to the second input end of the first pre-detection module, and the output end of the first pre-detection module is connected to the input end of the second detection layer in the detection layer sorting; the output end of the connection module concat in the first pre-detection module is connected to the first input end of the second pre-detection module, the output end of the first sub-enhanced feature extraction network is connected to the second input end of the second pre-detection module, and the output end of the second pre-detection module is connected to the input end of the third detection layer in the detection layer sorting; the output end of the connection module concat in the second pre-detection module is connected to the first input end of the third pre-detection module, the output end of the pre-enhanced feature extraction network is connected to the second input end of the third pre-detection module, and the output end of the third pre-detection module is connected to the input end of the fourth detection layer in the detection layer sorting.
[0031] The network features are extracted through the backbone feature extraction network in the target YOLOv4 network. However, as the network becomes deeper, the receptive field becomes smaller, the feature extraction capability is limited, and the context information is not fully combined. In order to perform feature fusion of global information, Figure 2As shown, in actual application, for the above-mentioned designed target YOLOv4 network, a pyramid pooling module is further designed and added, and the pyramid pooling module includes a convolution module, a bilinear interpolation module, and a preset number of pooling modules with different pooling kernel sizes, wherein the input end of each pooling module constitutes the input end of the pyramid pooling module, the output end of each pooling module is connected to the input end of the convolution module, the output end of the convolution module is connected to the input end of the bilinear interpolation module, the output end of the bilinear interpolation module constitutes the output end of the pyramid pooling module, and the input ends of the pyramid pooling module are simultaneously connected to the output end of the pyramid pooling module; the output end of the backbone feature extraction network is connected to the pyramid pooling module. The input ends of the pyramid pooling module and the output end of the pyramid pooling module are connected to the input end of the front-end enhanced feature extraction network; and in the specific application, the number of pooling modules in the pyramid pooling module is specifically designed to be 4, namely, a pooling module with a pooling kernel size of 6×6, a pooling module with a pooling kernel size of 3×3, a pooling module with a pooling kernel size of 2×2, and a pooling module with a pooling kernel size of 1×1, and the convolution kernel size of the convolution module in the pyramid pooling module is 1×1; in the application, the feature map is input into the pyramid pooling module and divided into two branches, one of which is not modified, and the other branch first performs pooling of these four scales respectively to obtain four feature maps of different sizes. Then, the channel is adjusted by convolution with a convolution kernel size of 1×1, and the number of channels is adjusted to the original 1 / N', N' represents the number of layers of the pyramid pooling module, and then the size of the feature map is restored to the original size by bilinear interpolation, and combined with the original branch that is not modified. The number of channels after the combination is twice the original, and then reduced to the original size by convolution. This pyramid structure can transform images into feature maps of different scales, which can then be connected together, solving the fixed constraints of convolutional neural networks on images. It also aggregates features from multiple receptive fields. Compared with single-scale pooling, it fuses semantic information of multiple scales extracted from the network, enhancing the network's ability to extract features from global information.
[0032] And about the above designed target YOLOv4 network, such as Figure 2As shown, the design wherein each darknet convolution module DBL comprises a convolution module conv, a normalization module BN, and an activation module connected in sequence, wherein the input end of the convolution module conv constitutes the input end of the darknet convolution module DBL, and the output end of the activation module constitutes the output end of the darknet convolution module DBL; in addition, for the above-mentioned target, the upsampling parallel module SPP in the YOLOv4 network comprises a connection module concat, and three maximum pooling modules maxpool, in the upsampling parallel module SPP, the input end of each maximum pooling module maxpool is connected and constitutes the input end of the upsampling parallel module SPP, the output end of each maximum pooling module maxpool, and the input end of the upsampling parallel module SPP are connected to the input end of the connection module concat, and the output end of the connection module concat constitutes the output end of the upsampling parallel module SPP.
[0033] In practical applications, for the four detection layers specifically designed in the target YOLOv4 network, the scale of the first detection layer in the design detection layer order is 104×104, the scale of the second detection layer is 52×52, the scale of the third detection layer is 26×26, and the scale of the fourth detection layer is 13×13. In such a design, in practical applications, when the path enhancement network is upsampled and stacked to a 52×52 feature layer size, it continues to be upsampled and stacked with the result of the second residual block output, a feature layer of size 104×104, and then downsampled layer by layer in turn. Finally, the feature layers obtained by the four detection layers of different scales are deeply fused, which retains the shallow position information as much as possible and enhances the feature extraction capability.
[0034] Step C. Based on the target YOLOv4 network, the recognition model to be trained is composed of the output ends of each detection layer connected to the same image integration module, and each sample image, with the sample image as input and the sample image that identifies the position of the target type object as output, and the recognition model to be trained is trained to obtain the target recognition model.
[0035] In fact, in the training process of the recognition model to be trained, since the design of step A introduces the acquisition of the prior frame size, the convergence speed of the model can be accelerated during the training process here, thereby improving the work efficiency of the model training.
[0036] Based on the target recognition model obtained in the above steps, in practical applications, such as Figure 1 As shown, for the image to be identified of the same type of scene as the sample image, the target recognition model is applied to obtain the position of the target type object in the image to be identified, and the image target detection is completed.
[0037] The image target detection method based on the improved YOLOv4 designed by the present invention is applied in practice, such as Figure 3 As described above, through visual comparison with other target detection methods, it is verified that the design method of the present invention has the best effect, and the quantitative comparison results between the design method of the present invention and other target detection methods as shown in subscript 1 below also verify that the design method of the present invention has the best effect.
[0038] Table 1
[0039]
[0040] The image target detection method based on improved YOLOv4 designed by the above technical scheme is improved based on the existing YOLOv4 path enhancement network. By increasing the design of the detection layer, the effect of shallow feature fusion is enhanced, and the sizes of the prior frames corresponding to the image set are obtained under the clustering method, so as to realize high-precision feature extraction of each detection layer, and introduce a multi-scale pooling module parallel structure and a pyramid pooling module combining convolution processing and interpolation processing to further improve the detection accuracy of the feature layer, thereby effectively improving the accuracy of image target detection. In actual simulation experiments, the design method of the present invention shows excellent target detection accuracy, and the mAP on the PASCAL VOC 2007 and VOC 2012 data sets is increased by 2.03% and 1.94% respectively.
[0041] The embodiments of the present invention are described in detail above with reference to the accompanying drawings, but the present invention is not limited to the above embodiments, and various changes can be made within the knowledge scope of ordinary technicians in this field without departing from the purpose of the present invention.
Claims
1. An image target detection method based on improved YOLOv4, characterized in that: Based on each sample image whose position of the target type object in the image is known, the target recognition model is obtained according to the following steps A to C; then, for the image to be recognized of the same type of scene as the sample image, the target recognition model is applied to obtain the position of the target type object in the image to be recognized, and the image target detection is completed; Step A: using a preset clustering algorithm to process the image set composed of each sample image, obtain a preset number M of prior frame sizes corresponding to the image set, and then proceed to step B; Step B. Based on a target YOLOv4 network based on a YOLOv4 network and including a preset number of N detection layers, the result of M / N is an integer greater than 0, and each detection layer corresponds to M / N priori boxes respectively. For each priori box sorted from small to large in size, the order corresponds to each detection layer sorted from large to small in scale, and the input end of the target YOLOv4 network receives the image, and each detection layer outputs a feature map corresponding to the image based on each priori box corresponding to it, and then enters step C; Among them, the target YOLOv4 network is based on the YOLOv4 network and includes 4 detection layers. Each detection layer includes a darknet convolution module DBL and a convolution module conv. In each detection layer, the input end of the darknet convolution module DBL constitutes the input end of the detection layer, and the output end of the darknet convolution module DBL is connected to the input end of the corresponding convolution module conv, and the output end of the convolution module conv constitutes the output end of the detection layer; each detection layer is sorted from large to small according to its scale to form a detection layer sorting; The target YOLOv4 network also includes a pre-enhanced feature extraction network, a first sub-enhanced feature extraction network, a second sub-enhanced feature extraction network, a third sub-enhanced feature extraction network, and a first pre-detection module, a second pre-detection module, and a third pre-detection module; the pre-enhanced feature extraction network includes a darknet convolution module DBL, an upsampling parallel module SPP, and a darknet convolution module DBL connected in series in sequence, wherein the input end of the first darknet convolution module DBL constitutes the input end of the pre-enhanced feature extraction network, and the output end of the second darknet convolution module DBL constitutes the output end of the pre-enhanced feature extraction network; each sub-enhanced feature extraction network includes an upsampling module upsample, a connection module concat, and three darknet convolution modules DBL, in each sub-enhanced feature extraction network, the input end of the first darknet convolution module DBL constitutes the first input end of the sub-enhanced feature extraction network, the input end of the second darknet convolution module DBL constitutes the second input end of the sub-enhanced feature extraction network, and the output end of the second darknet convolution module DBL constitutes the output end of the pre-enhanced feature extraction network. The output end of a darknet convolution module DBL is connected to the input end of the upsampling module upsample, the output end of the upsampling module upsample and the output end of the second darknet convolution module DBL are connected to the input end of the connection module concat, the output end of the connection module concat is connected to the input end of the third darknet convolution module DBL, and the output end of the third darknet convolution module DBL constitutes the output end of the sub-enhanced feature extraction network; the first pre-detection module, the second pre-detection module, and the third pre-detection module respectively include a connection module concat and two darknet convolution modules DBL, in each pre-detection module, the input end of the first darknet convolution module DBL constitutes the first input end of the pre-detection module, the output end of the first darknet convolution module DBL is connected to one of the input ends of the connection module concat, the other input end of the connection module concat constitutes the second input end of the pre-detection module, and the output end of the connection module concat constitutes the output end of the pre-detection module; In the structure of the target YOLOv4 network, the input end of the backbone feature extraction network in the YOLOv4 network constitutes the input end of the target YOLOv4 network, the output end of the backbone feature extraction network is connected to the input end of the pre-enhanced feature extraction network, the output end of the pre-enhanced feature extraction network is connected to the first input end of the first sub-enhanced feature extraction network, the output end of the backbone feature extraction network is connected to the second input end of the first sub-enhanced feature extraction network; the output end of the first sub-enhanced feature extraction network is connected to the first input end of the second sub-enhanced feature extraction network, the output end of the second branch in sequence on the backbone feature extraction network is connected to the second input end of the second sub-enhanced feature extraction network; the output end of the second sub-enhanced feature extraction network is connected to the first input end of the third sub-enhanced feature extraction network, the output end of the first branch in sequence on the backbone feature extraction network is connected to the second input end of the third sub-enhanced feature extraction network; the output end of the third sub-enhanced feature extraction network is connected to the first branch in sequence in the detection layer The output end of the connection module concat in the third sub-enhanced feature extraction network is connected to the first input end of the first front detection module, the output end of the second sub-enhanced feature extraction network is connected to the second input end of the first front detection module, and the output end of the first front detection module is connected to the input end of the second detection layer in the detection layer sorting; the output end of the connection module concat in the first front detection module is connected to the first input end of the second front detection module, the output end of the first sub-enhanced feature extraction network is connected to the second input end of the second front detection module, and the output end of the second front detection module is connected to the input end of the third detection layer in the detection layer sorting; the output end of the connection module concat in the second front detection module is connected to the first input end of the third front detection module, the output end of the front-enhanced feature extraction network is connected to the second input end of the third front detection module, and the output end of the third front detection module is connected to the input end of the fourth detection layer in the detection layer sorting; The target YOLOv4 network also includes a pyramid pooling module, which includes a convolution module, a bilinear interpolation module, and a preset number of pooling modules with different pooling kernel sizes, wherein the input end of each pooling module constitutes the input end of the pyramid pooling module, the output end of each pooling module is connected to the input end of the convolution module, the output end of the convolution module is connected to the input end of the bilinear interpolation module, the output end of the bilinear interpolation module constitutes the output end of the pyramid pooling module, and the input ends of the pyramid pooling module are simultaneously connected to the output end of the pyramid pooling module; the output end of the backbone feature extraction network is connected to the input ends of the pyramid pooling module, and the output end of the pyramid pooling module is connected to the input end of the pre-enhanced feature extraction network; Step C. Based on the target YOLOv4 network, the recognition model to be trained is composed of the output ends of each detection layer connected to the same image integration module, and each sample image, with the sample image as input and the sample image that identifies the position of the target type object as output, and the recognition model to be trained is trained to obtain the target recognition model.
2. According to claim 1, an image target detection method based on improved YOLOv4 is characterized in that: In the step A, a K-means clustering algorithm is used to process an image set composed of each sample image to obtain a preset number M of prior frame sizes corresponding to the image set.
3. According to claim 1, an image target detection method based on improved YOLOv4 is characterized in that: The number of pooling modules in the pyramid pooling module is 4, namely, a pooling module with a pooling core size of 6×6, a pooling module with a pooling core size of 3×3, a pooling module with a pooling core size of 2×2, and a pooling module with a pooling core size of 1×1. The convolution kernel size of the convolution module in the pyramid pooling module is 1×1.
4. According to claim 1, an image target detection method based on improved YOLOv4 is characterized in that: Each of the darknet convolution modules DBL comprises a convolution module conv, a normalization module BN, and an activation module connected in sequence, wherein the input end of the convolution module conv constitutes the input end of the darknet convolution module DBL, and the output end of the activation module constitutes the output end of the darknet convolution module DBL.
5. According to claim 1, an image target detection method based on improved YOLOv4 is characterized in that: The upsampling parallel module SPP includes a connection module concat and three maximum pooling modules maxpool. In the upsampling parallel module SPP, the input ends of each maximum pooling module maxpool are connected and constitute the input end of the upsampling parallel module SPP, the output ends of each maximum pooling module maxpool and the input end of the upsampling parallel module SPP are connected to the input end of the connection module concat, and the output end of the connection module concat constitutes the output end of the upsampling parallel module SPP.
6. According to claim 1, an image target detection method based on improved YOLOv4 is characterized in that: In the detection layer ranking, the scale corresponding to the first detection layer is 104×104, the scale corresponding to the second detection layer is 52×52, the scale corresponding to the third detection layer is 26×26, and the scale corresponding to the fourth detection layer is 13×13.
