A multi-scale fusion prediction method based on YoLov3 algorithm

Through the multi-scale fusion prediction method based on the YoLov3 algorithm, combined with the Darknet-53 feature extraction network and multi-scale prediction network, the shortcomings of the traditional RRT algorithm in small target detection are solved and higher detection accuracy and efficiency are achieved.

CN118334360BActive Publication Date: 2024-10-18WUXI RUIYING TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410312539.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-03-19
Publication Date
2024-10-18
Estimated Expiration
2044-03-19

AI Technical Summary

Technical Problem

The traditional RRT algorithm has obvious shortcomings in small target detection, and does not have high requirements for path optimality, making it difficult to meet the dual requirements of time and accuracy.

Method used

A multi-scale fusion prediction method based on the YoLov3 algorithm is used to extract image classification feature information and positioning information, and detect it on feature images of different resolutions. The Darknet-53 feature extraction network is combined with the multi-scale prediction network, and the residual The structure and convolution blocks perform feature map scale transformation to achieve multi-scale target detection.

Benefits of technology

It improves the accuracy and efficiency of small target detection, makes up for the shortcomings of the RRT algorithm in small target detection, and achieves higher detection accuracy and path optimization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure SMS_1
    Figure SMS_1
  • Figure SMS_2
    Figure SMS_2
  • Figure SMS_3
    Figure SMS_3
Patent Text Reader

Abstract

The invention discloses a multi-scale fusion prediction method based on YoLov3 algorithm, which specifically includes the following steps: S1: extracting image classification feature information; S2: extracting positioning information in the target image; S3: using multi-scale features to divide the resolution; S4: detecting targets of different sizes on feature images of different resolutions. The basic structure of YOLOv3 is obtained by combining different types of convolutional layers, and a batch normalization layer and a LeakyReLU activation layer are added after each convolutional layer to form a basic convolutional block. The convolutional block is taken as a unit, and each unit performs unit mapping and adds the output of the previous unit to form a residual structure. In order to realize multi-scale detection, YOLOv3 adopts a method of changing the convolution kernel step size to transform the feature map scale, and then the residual structure and the convolution block are combined to obtain 5 residual blocks to realize multi-scale feature map sampling. YOLOv3 combines the strengths of hundreds of schools and makes up for the shortcomings in small target detection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of target detection technology, and in particular to a multi-scale fusion prediction method based on YoLov3 algorithm. Background Art

[0002] With the development of science and technology, people receive a large amount of image and video data in their daily lives, and computer vision is an effective way to process this data. Nowadays, object detection is now a basic task of computer vision and is widely used in face recognition, target tracking, autonomous driving, and medical image analysis.

[0003] The traditional RRT algorithm stands for Rapidly Expanding Random Tree, which is widely used in the field of robotics as a common path planning algorithm. Compared with traditional path planning algorithms such as artificial potential field method, fuzzy rule method, genetic algorithm, neural network, simulated annealing algorithm, ant colony optimization algorithm, etc., its biggest feature is that it does not need to model obstacles in a certain space, and quickly searches for blank areas. It explores the entire space through function iteration without the need to sample the workspace in advance, and can find a planned path from the starting point to the target point. However, due to its randomness, it is suitable for occasions with high time requirements but low requirements for path optimality, and it has obvious deficiencies in the detection of small targets. Summary of the invention

[0004] The purpose of this section is to summarize some aspects of embodiments of the present invention and briefly introduce some preferred embodiments. Some simplifications or omissions may be made in this section and the specification abstract and the invention title of this application to avoid blurring the purpose of this section, the specification abstract and the invention title, and such simplifications or omissions cannot be used to limit the scope of the present invention.

[0005] In view of the problems of the above-mentioned multi-scale fusion prediction method based on YoLov3 algorithm, the present invention is proposed.

[0006] Therefore, the purpose of the present invention is to provide a multi-scale fusion prediction method based on YoLov3 algorithm, which is used to solve the problems raised in the background technology.

[0007] In order to solve the above technical problems, the present invention provides the following technical solutions: a multi-scale fusion prediction method based on YoLov3 algorithm, the method specifically comprises the following steps:

[0008] S1: Extract image classification feature information;

[0009] S2: extract positioning information from the target image;

[0010] S3: Use multi-scale features to divide the resolution;

[0011] S4: Detect objects of different sizes on feature images of different resolutions.

[0012] As a preferred solution of the multi-scale fusion prediction method based on the YoLov3 algorithm described in the present invention, the YoLov3 network structure in this method includes a feature extraction network Darknet-53 and a multi-scale prediction network, the feature extraction network Darknet-53 acts in S1 and S2, and the multi-scale prediction network acts in S3 and S4.

[0013] As a preferred solution of the multi-scale fusion prediction method based on the YoLov3 algorithm described in the present invention, wherein: the basic structure of the YOLOv3 is obtained by combining different types of convolutional layers, and a batch normalization layer and a LeakyReLU activation layer are added after each convolutional layer to form a basic convolutional block;

[0014] Taking the convolution block as a unit, each unit performs unit mapping and adds the output of the previous unit to form a residual structure;

[0015] The scale of the feature map is transformed by changing the convolution kernel step size, and the residual structure and the convolution block are combined to obtain the residual block.

[0016] As a preferred solution of the multi-scale fusion prediction method based on the YoLov3 algorithm described in the present invention, wherein: in S4, YOLOv3 splices the sampling results obtained by multiple groups of convolution blocks of the deep network respectively, and then performs multi-scale prediction on the spliced ​​results.

[0017] As a preferred solution of the multi-scale fusion prediction method based on YoLov3 algorithm described in the present invention, the output of the multi-scale prediction mechanism is composed of feature maps of three different scales.

[0018] For feature images from convolutional layers with large receptive fields, they are used to predict objects of larger size;

[0019] For medium-scale target prediction, YOLOv3 samples the feature map obtained by deeper convolution and fuses it with the previous feature map to obtain a fine-grained feature map for prediction.

[0020] For the feature maps of the deeper back-end convolutional layers, the above sampling operation is also performed to retain and fuse small-scale features and obtain a smaller receptive field.

[0021] As a preferred solution of the multi-scale fusion prediction method based on the YoLov3 algorithm described in the present invention, the mechanism of YOLOv3 prediction is:

[0022]

[0023] Where (t x , t y , t w ) is the predicted output of the model, (c x , c y ) is the coordinate offset of the cell, (p w , p h ) is the side length of the preset Anchorbox. The widths and heights of n Anchorboxes are clustered according to the data set, and they are evenly distributed to different scales as the prior knowledge for prediction. Each feature output layer has n / 3 Anchorboxes. Each cell on the feature layer performs target box regression according to the Anchorboxes at different scales. For multiple prediction boxes, non-maximum suppression is used to calculate the final output.

[0024] As a preferred solution of the multi-scale fusion prediction method based on YoLov3 algorithm described in the present invention, the loss function of YoLov3 is:

[0025] loss = λ coord ∑ i = 0 s 2 ∑ j = 0 B I ij obj [( x i − <m> x i < / m> ) 2 + ( y i − <m> y i < / m> ) 2 ] + λ coord ∑ i = 0 s 2 ∑ j = 0 B I ij obj [( w i − <m> w i < / m> ) 2 + ( h i − <m> h i < / m> ) 2 ] − ∑ i = 0 s 2 ∑ j = 0 B I ij obj [ <m> C < / m> i log( C i ) + ( 1 − <m> <m> C < / m> i )log( 1 − C i ) < / m> ] − λ noobj ∑ i = 0 s 2 ∑ j = 0 B I ij noobj [ <m> C < / m> i log( C i ) + ( 1 − <m> <m> C < / m> i )log( 1 − C i ) < / m> ] − ∑ i = 0 s 2 I ij obj ∑ c ∈ c cseses B [ <m> p < / m> i ( c )log( p i ( c )) + ( 1 − <m> <m> p < / m> i ( c ))log( 1 − p i ( c )) < / m> ]

[0026] As a preferred solution of the multi-scale fusion prediction method based on the YoLov3 algorithm described in the present invention, the second term of the YoLov3 loss function represents the size loss of the predicted target box. When a prediction box of the i-th grid predicts the object, the size difference between the prediction box and the true target box is calculated and recorded as the center coordinate loss.

[0027] As a preferred solution of the multi-scale fusion prediction method based on the YoLov3 algorithm described in the present invention, the third and fourth terms of the YoLov3 loss function represent the confidence error of the target prediction. The third term represents the confidence error of the target object in the drawn target box, and the fourth term represents the confidence error of the target object.

[0028] As a preferred solution of the multi-scale fusion prediction method based on the YoLov3 algorithm described in the present invention, the fifth item of the loss function of YoLov3 is the object classification loss, which is used to update the target classification information in the predicted target bounding box.

[0029] The beneficial effects of the present invention are as follows: the basic structure of YOLOv3 is obtained by combining different types of convolutional layers, and a batch normalization layer and a LeakyReLU activation layer are added after each convolutional layer to form a basic convolutional block. The convolutional block is taken as a unit, and each unit performs unit mapping and adds the output of the previous unit to form a residual structure. In order to realize multi-scale detection, YOLOv3 adopts a method of changing the convolution kernel step size to transform the feature map scale, and then the residual structure and the convolutional block are combined to obtain 5 residual blocks to realize multi-scale feature map sampling. YOLOv3 combines the strengths of various schools and makes up for the shortcomings in small target detection. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for describing the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative labor. Among them:

[0031] Figure 1 It is a schematic diagram of the YOLOv3 network structure in the present invention.

[0032] Figure 2 This is a schematic diagram comparing the outputs of YOLOv2 and YOLOv3 in the present invention.

[0033] Figure 3 It is a schematic diagram of the multi-scale fusion prediction structure in the present invention.

[0034] Figure 4 Schematic diagram of the Anchor prediction mechanism in the present invention. DETAILED DESCRIPTION

[0035] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are described in detail below in conjunction with the accompanying drawings.

[0036] In the following description, many specific details are set forth to facilitate a full understanding of the present invention, but the present invention may also be implemented in other ways different from those described herein, and those skilled in the art may make similar generalizations without violating the connotation of the present invention. Therefore, the present invention is not limited to the specific embodiments disclosed below.

[0037] Secondly, the term "one embodiment" or "embodiment" as used herein refers to a specific feature, structure, or characteristic that may be included in at least one implementation of the present invention. The term "in one embodiment" that appears in different places in this specification does not necessarily refer to the same embodiment, nor does it refer to a separate or selective embodiment that is mutually exclusive with other embodiments.

[0038] Secondly, the present invention is described in detail with reference to the schematic diagram. When describing the embodiments of the present invention in detail, for the sake of convenience, the cross-sectional diagrams showing the device structure will not be partially enlarged according to the general scale, and the schematic diagrams are only examples, which should not limit the scope of protection of the present invention. In addition, in actual production, the three-dimensional dimensions of length, width and depth should be included.

[0039] Reference Figure 1 - Figure 4 , is an embodiment of the present invention, and provides a multi-scale fusion prediction method based on YoLov3 algorithm, the method specifically comprising the following steps:

[0040] S1: Extract image classification feature information;

[0041] S2: extract positioning information from the target image;

[0042] S3: Use multi-scale features to divide the resolution;

[0043] S4: Detect objects of different sizes on feature images of different resolutions.

[0044] Among them, the YoLov3 network structure in this method includes the feature extraction network Darknet-53 and the multi-scale prediction network, such as Figure 1 As shown in Figure a, the feature extraction network Darknet-53 acts on S1 and S2, and the multi-scale prediction network acts on S3 and S4; the basic structure of YOLOv3 is obtained by combining different types of convolutional layers, and a batch normalization layer (BatchNormalize, BN) and a LeakyReLU activation layer are added after each convolutional layer to form a basic convolutional block, as shown in Figure 1 As shown in Figure b, the convolution block is taken as a unit, and each unit performs unit mapping and adds the output of the previous unit to form a residual structure, as shown in Figure 1 As shown in Figure c; in order to achieve multi-scale detection, YOLOv3 adopts the method of changing the convolution kernel step size to transform the feature map scale, and then combines the residual structure and the convolution block to obtain 5 residual blocks to achieve multi-scale feature map sampling, as shown in Figure 1 As shown in Figure d, YOLOv3 combines the strengths of various algorithms to make up for its shortcomings in small target detection.

[0045] YOLOv3's feature extraction network Darknet-53 has powerful performance. The comparison test results with other feature extraction networks on public data sets show that Darknet-53 has better overall performance, whether it is for single-category target classification or multi-category target classification. As shown in Table 1, Darknet-53 has a significant speed advantage over the residual network ResNet series, and its accuracy is also higher than the same series network Darknet-19.

[0046]

[0047] Table 1 Performance comparison of Darknet-53 on ImageNet dataset

[0048] The design of DarkNet-53 is inspired by ResNet. As shown in Table 2, it is composed of a series of convolution blocks consisting of point convolution, 3×3 convolution, BN layer and LeakyReLU activation layer. There are 53 convolution layers in the network, but only one pooling layer is used. DarkNet-53 has a deeper network layer and stronger learning ability. However, the prediction speed and accuracy are not affected by the deepening of the network structure due to the addition of multi-scale prediction, but have higher efficiency.

[0049]

[0050] Table 2 Feature extraction network Darknet-53

[0051] In YOLOv2, there is a pass-through layer, which is similar to a residual structure. It can stack low-level network features with high-level semantic features, and the learned features are richer. YOLOv3 proposes a multi-scale fusion prediction structure based on the image pyramid idea, such as Figure 2 As shown in the figure, the left side is the bottom-up feature extraction process, and the right side is the top-down prediction process. YOLOv3 combines high-level semantics with low-level semantic information, makes predictions at different scales, uses multi-scale features to achieve resolution division, and detects objects of different sizes on feature maps of different resolutions.

[0052] In addition, in S4, YOLOv3 concatenates the sampling results obtained by multiple groups of convolution blocks in the deep network, and then performs multi-scale prediction on the concatenated results. The output of the multi-scale prediction mechanism consists of three feature maps of different scales, such as Figure 3As shown in the figure, the depths are all 255, and the sizes of the feature maps are 13×13, 26×26, and 52×52. For the convolutional layer with a large receptive field, the feature image is used to predict larger targets; for medium-scale target prediction, YOLOv3 samples the feature map obtained by a deeper convolution and fuses it with the previous feature map to obtain a fine-grained feature map, and then predicts it; for the feature map of the deeper back-end convolutional layer, the above sampling operation is also performed to retain and fuse small-scale features and obtain a smaller receptive field.

[0053] The mechanism of YOLOv3 prediction is:

[0054]

[0055] YOLOv3 retains the Anchor mechanism and applies it to feature maps of different scales. The Anchor prediction mechanism is as follows: Figure 4 To improve prediction accuracy, YOLOv3 uses the method of directly predicting relative positions to set the prior frame. For an anchor at a certain point on the feature spectrum, the number of channels of the output feature spectrum is coord (coordinate) + class (category) + confidence (confidence), which is determined by relative position coordinates. In the above formula (t x , t y , t w ) is the predicted output of the model, (c x , c y ) is the coordinate offset of the cell, (p w , p h ) is the side length of the preset Anchorbox. The widths and heights of n Anchorboxes are clustered according to the data set, and they are evenly distributed to different scales as the prior knowledge for prediction. Each feature output layer has n / 3 Anchorboxes. Each cell on the feature layer performs target box regression according to the Anchorboxes at different scales. For multiple prediction boxes, non-maximum suppression is used to calculate the final output.

[0056] In the target detection problem of the YOLO series, the loss function mainly focuses on the following core parameters: (x, y), (w, h), class, confidenee

[0057] According to the characteristics of the above parameters, the loss function can be divided into four categories, focusing on location information (x, y), Bounding box size information (w, h), target category class and confidence information confidence. The loss function in YOLOv1 is composed of simple variance addition, while in YOLOv2, the loss of the width and height of the prediction box is improved. YOLOv3 replaces the classification and confidence loss of YOLOv2 with binary cross entropy, the formula is as follows:

[0058] g(p, q)=-plog(q)-(1-p)log(1-q)

[0059] By adjusting the weights of the relevant functions to solve the problem of imbalanced sample data between target boxes and non-target boxes during model training, the final loss function of YOLOv3 is as follows:

[0060] loss = λ coord ∑ i = 0 s 2 ∑ j = 0 B I ij obj [( x i − <m> x i < / m> ) 2 + ( y i − <m> y i < / m> ) 2 ] + λ coord ∑ i = 0 s 2 ∑ j = 0 B I ij obj [( w i − <m> w i < / m> ) 2 + ( h i − <m> h i < / m> ) 2 ] − ∑ i = 0 s 2 ∑ j = 0 B I ij obj [ <m> C < / m> i log( C i ) + ( 1 − <m> <m> C < / m> i )log( 1 − C i ) < / m> ] − λ noobj ∑ i = 0 s 2 ∑ j = 0 B I ij noobj [ <m> C < / m> i log( C i ) + ( 1 − <m> <m> C < / m> i )log( 1 − C i ) < / m> ] − ∑ i = 0 s 2 I ij obj ∑ c ∈ c cseses B [ <m> p < / m> i ( c )log( p i ( c )) + ( 1 − <m> <m> p < / m> i ( c ))log( 1 − p i ( c )) < / m> ]

[0061] The second term of YoLov3's loss function represents the size loss of the predicted target box. When a certain prediction box of the i-th grid predicts the object, the size difference between the prediction box and the true target box is calculated, which is recorded as the center coordinate loss; the third and fourth terms of YoLov3's loss function represent the confidence error of the target prediction. The third term represents the confidence error of the target object in the drawn target box, and the fourth term represents the confidence error of the target object; the fifth term of YoLov3's loss function is the object classification loss, which is used to update the target classification information in the predicted target frame.

[0062] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the present invention may be modified or replaced by equivalents without departing from the spirit and scope of the technical solutions of the present invention, which should all be included in the scope of the claims of the present invention.

Claims

1. A multi-scale fusion prediction method based on YoLov3 algorithm, characterized in that: The method specifically comprises the following steps: S1: Extract image classification feature information; S2: extract positioning information from the target image; S3: Use multi-scale features to divide the resolution; S4: Detect objects of different sizes on feature images of different resolutions; The YoLov3 network structure in this method includes a feature extraction network Darknet-53 and a multi-scale prediction network, wherein the feature extraction network Darknet-53 acts on S1 and S2, and the multi-scale prediction network acts on S3 and S4; The basic structure of YOLOv3 is obtained by combining different types of convolutional layers. A batch normalization layer and a LeakyReLU activation layer are added after each convolutional layer to form a basic convolutional block. The convolutional block is taken as a unit, and each unit performs unit mapping and adds the output of the previous unit to form a residual structure. The feature map scale is transformed by changing the convolution kernel step size, and the residual structure and the convolutional block are combined to obtain the residual block. In S4, YOLOv3 concatenates the sampling results obtained by multiple groups of convolution blocks in the deep network, and then performs multi-scale prediction on the concatenated results; the output of the multi-scale prediction mechanism consists of three feature maps of different scales. For the feature image from the convolution layer with a large receptive field, it is used to predict larger targets; for medium-scale target prediction, YOLOv3 samples the feature map obtained by a deeper convolution, and fuses it with the previous feature map to obtain a fine-grained feature map, and then predicts it; for the feature map of the deeper back-end convolution layer, the above sampling operation is also performed to retain and fuse small-scale features and obtain a smaller receptive field; The mechanism of YOLOv3 prediction is: in( , , ) is the predicted output of the model, ( , ) is the coordinate offset of the cell, ( , ) is the side length of the preset Anchor box. The width and height of n Anchor boxes are clustered according to the data set, and they are evenly distributed to different scales as the prior knowledge for prediction. Each feature output layer has n / 3 Anchor boxes. Each cell on the feature layer performs target box regression according to the Anchor boxes at different scales. For multiple prediction boxes, non-maximum suppression is used to calculate the final output. The loss function of YoLov3 is: The second term of YoLov3's loss function represents the size loss of the predicted target box; when a prediction box of the i-th grid predicts the object, the size difference between the prediction box and the true target box is calculated, which is recorded as the center coordinate loss; the third and fourth terms of YoLov3's loss function represent the confidence error of the target prediction; the third term represents the confidence error that there is a target object in the drawn target box, and the fourth term represents the confidence error that there is no target object; the fifth term of YoLov3's loss function is the object classification loss, which is used to update the target classification information in the predicted target bounding box.

Citation Information

Patent Citations

  • Vehicle target detection method of unmanned aerial vehicle visual angle image based on deep learning

    CN113298032A

  • Pedestrian and vehicle target detection method and system based on improved YOLOv3

    CN115565150A