High-level object detection method based on YOLOv3 model
By using high-pass filters and low-pass filters to extract features in the YOLOv3 model, and performing high-order calculations at the feature layer, combined with Haar wavelet transform, the problems of long target detection time and low accuracy of large target recognition are solved, and a better High detection accuracy and shorter detection time.
Patent Information
- Application Number
- CN202111387117.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-22
- Publication Date
- 2024-10-22
- Estimated Expiration
- 2041-11-22
AI Technical Summary
The existing technology has problems such as long target detection time and low accuracy of large target recognition. Especially in complex backgrounds, it is difficult to extract significant objects with a single feature, resulting in low recognition accuracy.
A high-order target detection method based on the YOLOv3 model is used to extract high-frequency and low-frequency features of the image through high-pass filters and low-pass filters, and perform high-order calculations before upsampling the feature layer, including splitting to obtain sub-tensors for layer Product and addition operations, activation functions and regularization are added, combined with Haar wavelet transform to enhance feature extraction and network expression capabilities.
The image resolution is improved, the loss of spatial details of the target object is compensated, the detection precision and accuracy are improved, and the detection time is shortened.
Smart Images

Figure FT_1 
Figure FT_2 
Figure FT_3
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of deep learning target detection, and in particular to a high-order target detection method based on a YOLOv3 model. Background Art
[0002] The main purpose of target detection is to detect and locate multiple specific targets from an image. The core issue of target detection is to locate and classify the content to be detected. It is necessary to determine the shape, size and position of the target in the image according to the influence of different lighting and masking conditions on the detected object, and ensure higher accuracy and shorter detection time. Traditional target detection methods are based on traditional manual feature annotation methods, such as Hog feature + SVM algorithm, Hear feature + Adaboost algorithm and DPM algorithm. These target detection algorithms use sliding windows to select regions and obtain features by manual extraction. However, such extraction methods are complicated. If the feature extraction is not good, the training results will be biased, and the portability of this method is poor. The algorithm needs to be redesigned according to different specific tasks. In recent years, convolutional neural networks have surpassed traditional pattern recognition and machine learning algorithms in more and more fields, and have achieved top performance and accuracy. The subsequent improved feature extraction method based on convolutional neural networks has significantly improved the target detection performance. Therefore, it has gradually become a hot topic for discussion and analysis in theoretical research and practical applications in recent years, and second-order detection models and first-order detection models have appeared one after another.
[0003] The second-order model extracts features by generating possible regions (Region Propasal) and convolutional neural networks, and then puts the features into the classifier and corrects the position. For example, in 2014, Girshick proposed the target detection method of the R-CNN model, which borrowed the idea of sliding windows, used convolutional neural networks to extract fixed-length feature vectors in the candidate regions, and then put the extracted features into the classifier for classification. The target detection test results of PASCAL VOC showed that mAP can be increased to 62.4%, which is nearly 20% higher than the traditional algorithm. The subsequently improved Faster R-CNN increased the test speed by hundreds of times while improving the accuracy. Although this type of detection model has basically achieved real-time monitoring, it still has the problems of long detection time and many training parameters. The main reason is that it has not completely gotten rid of the idea of traditional target detection.
[0004] The first-order detection model completely abandons the detection method of region selection and classifier classification inherent in the two-stage model, converting a classification problem into a regression problem. Its advantage is that the detection time is greatly shortened. The YOLO target detection model designed by Facebook's artificial intelligence laboratory has only one training network, and the test speed on a single Titan X reaches 45 frames per second, which is 9 times that of Faster R-CNN. Following the YOLO and YOLOv2 target detection networks, the YOLOv3 target detection network proposed by Joseph Redmon and Ali Farhadi can complete the detection of 320x320 images within 22 milliseconds, and the detection accuracy reaches 57.9% in the Titan X environment. Although the detection speed of the YOLO series target detection network has been improved, natural images contain various complex backgrounds, and a single feature is often difficult to extract significant objects from complex backgrounds. There is still a lot of room for improvement in large target recognition and accuracy. Summary of the invention
[0005] The present invention provides a high-order target detection method based on the YOLOv3 model to solve the problems of long detection time and low accuracy of large target recognition in the prior art.
[0006] The present invention provides a high-order target detection method based on the YOLOv3 model, comprising the following steps:
[0007] Step 1: Preset image dataset;
[0008] Step 2: Design a high-discriminative feature extraction method: extract the horizontal, vertical and diagonal features of the pre-input image through high-pass and low-pass filters;
[0009] Step 3: Design a high-order target detection method: Add high-order calculations before upsampling the feature layer, split the input image into sub-tensors, perform layer multiplication and addition operations on the sub-tensors, and then add activation functions and regularize;
[0010] Step 4: Adjust the convolutional neural network parameters;
[0011] Step 5: Use the high-discriminative feature extraction method to extract the high-discriminative features of the image data set, import the acquired features of the image data set into the deep learning network that integrates the high-order target detection method, and complete the fitting of the image data set.
[0012] Furthermore, the step 2 includes the following process:
[0013] Step 2.1: Obtain the vector space V according to Haar's scaling function i :
[0014] V i =s j / 2 φ(s j xk)|i,k∈Z
[0015] where s j is a scale variable, the change of j will shrink or expand the space, k is a translation variable, the change of k will affect the position of the space on the x-axis;
[0016] Step 2.2: Obtain the vector space W based on Haar's wavelet function i for:
[0017] W i =S j / 2 Ψ(s j xk)|i,k∈Z
[0018] Where W i represents the vector space formed by the i-th level wavelet function, s j is a scale variable, and changes in j will shrink or expand the space. k is a translation variable, and changes in k will affect the position of the space on the x-axis.
[0019] Step 2.3: Through the vector space W i Denotes the vector space V i :
[0020]
[0021] Step 2.4: Extract the horizontal, vertical and diagonal features of the pre-input image using formula (1) obtained in step 2.3.
[0022] Furthermore, step 3 includes the following process:
[0023] Step 3.1: Element-by-element multiplication of feature matrices: After three downsamplings, the Darknet53 backbone network outputs three shape features. Half of them are cut and copied three times before upsampling the first two features. The three feature matrices are element-by-element multiplied through continuous layer multiplication operations, as shown in the following formula:
[0024]
[0025] where w r represents the rth eigenvector, x is the local feature of the corresponding vector, It is the r-order self-outer product of x, which can represent the interaction of high-order features;
[0026] Step 3.2: Nonlinear activation of feature layer: Activate f(x) using sigmoid function and output the processed features through residual unit:
[0027] F(x)=sigmoid(f(x))+x
[0028] F(x) is the result of the high-order calculation and is passed to the next layer of the convolutional neural network.
[0029] Furthermore, the three shapes in step 3.1 are (13, 13, 1024), (26, 26, 768) and (52, 52, 128).
[0030] Further, the step 4 includes: prior frame setting: according to the clustering algorithm, select (10x13), (16x30), (33x23), (30x61), (62x45), (59x119), (116x90), (156x198), (373x326), 9 prior frames of different sizes, use smaller prior frames (10x13), (16x30), (33x23) on the 52*52 feature map, use medium prior frames (30x61), (62x45), (59x119) on the 26*26 feature map, and use large prior frames (116x90), (156x198), (373x326) on the 13*13 feature map.
[0031] Furthermore, step 4 also includes: other parameter settings: gpu utilization is set to 0.7, not fully occupying the video memory, allocating on demand, using the BFC algorithm, batch_size is set to 8, the learning rate is 1e-4, and 500 batches are trained.
[0032] Beneficial effects of the present invention:
[0033] (1) Use Haar wavelet to preprocess the image. Use high-pass and low-pass filters to peel off the original image layer by layer to obtain the high-frequency and low-frequency features of the image at different resolutions. These features are integrated into the training data set, which greatly improves the feature extraction.
[0034] (2) Add high-order calculations before upsampling the feature layer, split the input image into sub-tensors, perform layer multiplication and addition operations on the sub-tensors, add activation functions and regularize after each layer to improve the overall expression ability of the network. Through the interaction of high-order information, high-order calculations further improve the resolution of the image and make up for the loss of spatial details of the target object in the original target detection network.
[0035] (3) The combination of Haar wavelet transform and high-order computing complement each other. The high-frequency and low-frequency features obtained by wavelet transform at different resolutions can be amplified with the help of high-order computing, and more attention can be paid to these detailed features during the training process. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] The features and advantages of the present invention will be more clearly understood by referring to the accompanying drawings, which are schematic and should not be construed as limiting the present invention in any way. In the accompanying drawings:
[0037] Figure 1A It is a flow chart of wavelet decomposition in a specific embodiment of the present invention;
[0038] Figure 1B This is a sample diagram of wavelet decomposition in a specific embodiment of the present invention;
[0039] Figure 2 A schematic diagram of the convolutional neural network structure incorporating a high-order target detection calculation method and wavelet transform in the present invention;
[0040] Figure 3 It is an actual detection diagram of a specific embodiment of the present invention;
[0041] Figure 4 Polar pie chart showing the accuracy of each model on each category in the dataset. DETAILED DESCRIPTION
[0042] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0043] The embodiment of the present invention provides a high-order target detection method based on the YOLOv3 model, comprising the following steps:
[0044] Step 1: Dataset preparation: The datasets used in this invention are VOC2007 and VOC2012. The VOC datasets are divided into four categories: vehicle, household, animal, and person. Each category is subdivided into 20 subcategories.
[0045] Step 1.1: Select training and validation data sets: The data sets used for training and validation are the trainval data sets of PASCAL VOC2007 and PASCAL VOC2012, 90% of which are used for training and 10% for testing. The data sets have a total of 16,551 images (5,011 for VOC2007 and 11,540 for VOC2012) and 40,058 detection objects (12,608 for VOC2007 and 27,450 for VOC2012).
[0046] Step 1.2: Select the test data set: The test data set selects the VOC2007 test data set, which has a total of 4952 images and 12032 detection objects.
[0047] like Figure 1A , Figure 1B As shown;
[0048] Step 2: Design of high-discriminative feature extraction method: Extract the horizontal, vertical and diagonal features of the pre-input image through high-pass filters and low-pass filters to make up for the problem that most of the low-frequency and high-frequency information will be lost when directly putting the pictures in the dataset into the deep learning network for training.
[0049] Step 2.1: Haar wavelet has a strong multi-resolution decomposition capability. The idea is to use scaling function and wavelet function to accurately represent the original signal. The Haar scaling function is expressed as:
[0050]
[0051] The vector space V formed by the scaling function when decomposing layer by layer i for:
[0052] V i =s j / 2 φ(s j xk)|i,k∈Z (2)
[0053] where s j is a scale variable, and changes in j will shrink or expand the space. k is a translation variable, and changes in k will affect the position of the space on the x-axis.
[0054] Step 2.2: Determine the vector space W i : The Haar wavelet function is expressed as:
[0055] Ψ(x)=φ(2x)-φ(2x-1) (3)
[0056] The vector space W formed by the wavelet function when decomposing layer by layer i for:
[0057] W i =S j / 2 Ψ(s j xk)|i,k∈Z (4)
[0058] Where W i represents the vector space formed by the i-th level wavelet function, s j is a scale variable, and changes in j will shrink or expand the space. k is a translation variable, and changes in k will affect the position of the space on the x-axis.
[0059] Step 2.3: Vector Space V i and vector space W i Orthogonal expression of different resolution feature information of images: V i and W i is orthogonal, the vector space W i It can represent the vector space V i The part that cannot be expressed in the above formula can be recursively expanded to obtain:
[0060]
[0061] It can be seen that the higher the decomposition level, the more information it contains. In the data preprocessing of Mul-YOLO, in order to fully extract the high-frequency and low-frequency information of each image, the Haar wavelet peels off the image information layer by layer through low-pass and high-pass filters. After decomposition, the parameters of the original image feature parameters transformed at different wavelet scales can be obtained, thereby obtaining the low-frequency features of an image and the high-frequency features in the horizontal, vertical and diagonal directions.
[0062] Step 3: Design of high-order target detection method: Add high-order calculations before upsampling the feature layer, split the input image to obtain sub-tensors, perform layer product operations and addition operations on the sub-tensors, add activation functions and regularize after each layer to improve the overall expression ability of the network. Through the interaction of high-order information, high-order calculations further improve the resolution of the image and make up for the loss of spatial details of the target object in the original target detection network.
[0063] Step 3.1: Multiply the feature matrix element by element: Mul-YOLO mainly improves the image resolution. Adding high-order calculations to the original model structure can effectively increase the global resolution. After three downsamplings, the Darknet53 backbone network outputs three features with shapes of (13, 13, 1024), (26, 26, 768) and (52, 52, 128). The first two features are cut in half and copied three times before upsampling. The three feature matrices are multiplied element by element through continuous layer multiplication operations, as shown in the following formula:
[0064]
[0065] where w r represents the rth eigenvector, x is the local feature of the corresponding vector, It is the r-order self-outer product of x, which can represent the interaction of high-order features.
[0066] Step 3.2: Nonlinear activation of feature layer: Activate f(x) using the sigmoid function and output the processed features through the residual unit.
[0067] F(x)=sigmoid(f(x))+x (7)
[0068] F(x) is the result of the high-order calculation and is passed to the next layer of the convolutional neural network.
[0069] The entire high-order calculation process undergoes three layer multiplications and one layer addition operation to amplify each pixel of the feature matrix.
[0070] The output features of the original YOLOv3 model are upsampled and concatenated with the upper-level features after several continuous convolutions. The high-order spatial information and position details of the image will be lost, which will greatly affect the accuracy of the final detection results. To address this problem, high-order calculations are used before feature upsampling. With the interaction of high-order features, each upsampling and convolution operation can effectively obtain contextual information in advance, greatly reducing the negative impact of information loss.
[0071] Figure 2 As shown in the figure, Darknet-53 is used as the backbone network. Darknet-53 includes 52 convolutional layers and 1 fully connected layer for the main network. The 52 convolutional layers are composed of 1 convolutional layer with 32 channels and 5 repeated residual units. Each of the 5 residual units has 1 independent convolutional layer and a set of repeated convolutional layers. The number of repetitions is 1, 2, 8, 8, and 4, respectively. The repeated convolutional layer includes a 1*1 convolution (the number of channels is halved) and a 3*3 convolution (the number of channels is restored). The input size of the image is 416*416. Since the stride of the first independent convolutional layer of each residual unit is 2, the three feature layers it outputs are downsampled three times, 8 times, 16 times, and 32 times respectively. The size of the image input is changed from 416*416 to 52*52, 26*26, and 13*13 respectively. Before upsampling the feature layers of 13*13 and 26*26 sizes, a high-order object detection method is added to fuse the multi-scale features of image information.
[0072] Step 4: Adjust the parameters of the convolutional neural network: Before training, set appropriate hyperparameters based on factors such as data volume, data distribution characteristics, and hardware equipment conditions, and record necessary data during the training process.
[0073] Step 4.1: Prior box setting: According to the clustering algorithm, select 9 prior boxes of different sizes: (10x13), (16x30), (33x23), (30x61), (62x45), (59x119), (116x90), (156x198), (373x326). Since the smaller the feature map, the larger the receptive field, the principle of using a larger prior box on a small feature map is followed. On the 52*52 feature map, a smaller prior box (10x13), (16x30), (33x23) is used, on the 26*26 feature map, a medium prior box (30x61), (62x45), (59x119) is used, and on the 13*13 feature map, a larger prior box (116x90), (156x198), (373x326) is used.
[0074] Step 4.2: Other parameter settings: gpu utilization is set to 0.7, not fully occupying the video memory, allocating on demand, using the BFC algorithm. Batch_size is set to 8, the learning rate is 1e-4, and 500 batches are trained.
[0075] Step 5: Use Haar wavelet processing to preprocess the image to obtain its low-frequency information and high-frequency information in the horizontal, vertical and diagonal directions. Put the processed data set into a deep learning network that incorporates high-order target detection methods to learn the feature information of images at different resolutions to enhance the generalization ability of the detection model and improve the accuracy of target detection.
[0076] Figure 3 As shown, it can be seen that it has good classification and positioning functions.
[0077] Figure 4 Polar pie chart of the detection accuracy of the high-level target detection method based on the YOLOv3 model proposed in this invention and other 6 existing target detection methods for 20 categories of objects in 4952 images of the PASCAL VOC2007test dataset. The minimum value from the center point to the outside is 0, the maximum value is 100, and the interval is 10 percentage points. It can be seen that the blue area covered by Mul-YOLO is larger than that of other models, and the overall effect is better.
[0078] The Mul-YOLO proposed in the present invention is superior to the existing technology in detection accuracy and jiance efficiency, as shown in Table 1 below. Table 1 compares Mul-YOLO with several other models in mAP and FPS. Although it is 2ms slower than the original YOLOv3 in detection speed, it still has advantages over other models, and the mAP is improved more, so Mul-YOLO has better performance in accuracy and speed.
[0079]
[0080] Table 1
[0081] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations are all within the scope defined by the appended claims.
Claims
1. A high-order target detection method based on the YOLOv3 model, characterized in that: The steps include: Step 1: Preset image dataset; Step 2: Design a high-discriminative feature extraction method: Use high-pass filters and low-pass filters to extract the horizontal, vertical, and diagonal features of the pre-input image. The specific process is as follows: Step 2.1: Obtain the vector space V according to Haar's scaling function i : V i =s j / 2 φ(s j x-k)|i,k∈Z where s j is a scale variable, the change of j will shrink or expand the space, k is a translation variable, the change of k will affect the position of the space on the x-axis; Step 2.2: Obtain the vector space W based on Haar's wavelet function i for: W i =s j / 2 Ψ(s j x-k)|i,k∈Z Where W i represents the vector space formed by the i-th level wavelet function, s j is a scale variable, the change of j will shrink or expand the space, k is a translation variable, the change of k will affect the position of the space on the x-axis; Step 2.3: Through the vector space W i Denotes the vector space V i : Step 2.4: Extract the horizontal, vertical and diagonal features of the pre-input image using formula (1) obtained in step 2.3; Step 3: Design a high-order target detection method: Add high-order calculations before upsampling the feature layer, split the input image to obtain sub-tensors, perform layer multiplication and addition operations on the sub-tensors, and then add activation functions and regularize. The specific process is as follows: Step 3.1: Element-by-element multiplication of feature matrices: After three downsamplings, the Darknet53 backbone network outputs three shape features. Half of them are cut and copied three times before upsampling the first two features. The three feature matrices are element-by-element multiplied through continuous layer multiplication operations, as shown in the following formula: where w r represents the rth eigenvector, x is the local feature of the corresponding vector, It is the r-order self-outer product of x, which can represent the interaction of high-order features; Step 3.2: Nonlinear activation of feature layer: Activate f(x) using sigmoid function and output the processed features through residual unit: F(x)=sigmoid(f(x))+x F(x) is the result of the high-order calculation and is passed to the next layer of the convolutional neural network; Step 4: Adjust the convolutional neural network parameters; Step 5: Use the high-discriminative feature extraction method to extract the high-discriminative features of the image data set, import the acquired features of the image data set into the deep learning network that integrates the high-order target detection method, and complete the fitting of the image data set.
2. The high-order target detection method based on the YOLOv3 model as claimed in claim 1, characterized in that The three shapes in step 3.1 are (13, 13, 1024), (26, 26, 768) and (52, 52, 128).
3. The high-order target detection method based on the YOLOv3 model as claimed in claim 1, characterized in that The step 4 includes: prior frame setting: according to the clustering algorithm, 9 prior frames of different sizes are selected, namely (10x13), (16x30), (33x23), (30x61), (62x45), (59x119), (116x90), (156x198), and (373x326); smaller prior frames (10x13), (16x30), and (33x23) are used on the 52*52 feature map; medium prior frames (30x61), (62x45), and (59x119) are used on the 26*26 feature map; and large prior frames (116x90), (156x198), and (373x326) are used on the 13*13 feature map.
4. The high-order target detection method based on the YOLOv3 model as claimed in claim 3, characterized in that The step 4 also includes: other parameter settings: gpu utilization is set to 0.7, the video memory is not fully occupied, it is allocated on demand, the BFC algorithm is used, the batch size is set to 8, the learning rate is 1e-4, and 500 batches are trained.
