A multi-scale road target detection method based on region focusing
By improving the k-means-GIOU algorithm and the YOLOv3-focus model, and combining the feature map cropping module and channel attention, the problem of multi-scale and small target detection in road target detection is solved, improving detection accuracy and efficiency, and is suitable for safe driving of intelligent vehicles.
Patent Information
- Application Number
- CN202211391669.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-08
- Publication Date
- 2025-10-28
- Estimated Expiration
- 2042-11-08
AI Technical Summary
Existing road target detection algorithms suffer from issues such as missed detections and inaccurate localization when dealing with multi-scale targets. They are particularly difficult to meet real-time requirements in complex scenarios and have insufficient small target detection capabilities.
A multi-scale road target detection method based on region focusing is adopted. Prior anchor boxes are generated by the improved k-means-GIOU algorithm, and a YOLOv3-focus model is constructed. A feature map cropping module and a channel and spatial attention module are added. The model is trained by combining a dynamic allocation algorithm and optimizing the loss function to improve detection accuracy and efficiency.
It achieves excellent cross-scale detection capabilities in complex scenarios, improves attention to major road areas, enhances the detection capability of objects at various scales, and ensures the safe driving of intelligent vehicles.
Smart Images

Figure CN115690714B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of road target detection technology, and in particular to a multi-scale road target detection method based on region focusing. Background Technology
[0002] Road target detection, as a key technology for ensuring safe driving of intelligent vehicles, is widely used in autonomous driving systems and vehicle collision avoidance systems. The scenarios encountered during autonomous driving are complex, with targets such as pedestrians and vehicles varying greatly in size, and the distances between these targets and the detection cameras also differing. Therefore, road targets often exhibit characteristics of varying scales, easily leading to missed detections and inaccurate localization, posing a significant challenge to road target detection algorithms. Thus, improving the multi-scale detection capabilities of detection algorithms is of great importance for the safe driving of intelligent vehicles.
[0003] Cars operate in complex environments, requiring accurate identification of background and main road targets to avoid collisions and more serious accidents. Road targets are prone to excessive overlap, and they are difficult to detect when far from the camera. This can lead to delayed system response, especially at high speeds, increasing the risk of accidents.
[0004] Currently, road target detection mainly utilizes the feature extraction capabilities of convolutional neural networks to fully extract features from road images, resulting in feature maps containing high-dimensional information. Further information extraction from these features is then performed to ultimately locate various targets. This process can be summarized into two steps: feature extraction and target localization. With the rapid development of hardware technology and datasets, deep convolutional neural networks are widely used in various target classification networks, capable of fully learning the feature information in images. In subsequent target localization, there are generally two approaches: setting up a separate network for target detection and adding a detection head after the feature extraction network. Because road target detection has high real-time requirements, end-to-end models are generally adopted. These models balance detection accuracy and efficiency, but suffer from insufficient ability to detect small targets and are unsuitable for complex scene detection tasks. Therefore, improving the cross-scale detection capability of fast detection algorithms is currently a research hotspot. Summary of the Invention
[0005] To address the aforementioned problems and technical requirements, the inventors have proposed a multi-scale road target detection method based on region focusing. The technical solution of this invention is as follows:
[0006] A multi-scale road target detection method based on region focusing includes the following steps:
[0007] Step 1: Acquire road images in different scenarios using a camera fixed to the front of the smart car, scale all road images to a uniform size of 512*512, and normalize the pixel values to create a dataset.
[0008] Step 2: Divide the dataset into training and test sets in a 4:1 ratio. Apply the improved k-means-GIOU algorithm to the samples in the training set, performing k-means clustering on all ground truth bounding boxes to iteratively generate 12 prior anchor boxes. The improved k-means-GIOU algorithm adds a term to the original IOU to obtain the GIOU distance as the clustering distance, expressed as:
[0009] (1)
[0010] Where, A and B These represent the areas of the ground truth bounding box and the predicted bounding box, respectively. This represents the area of the intersection of the two frames. This represents the area of the union of the two frames. C This represents the area of the smallest closed region formed by the two frames;
[0011] Step 3: Construct the YOLOv3-focus model, which includes a feature extraction network, a feature fusion network, and a detection head; where:
[0012] The feature extraction network uses the Darknet53 network, which contains 53 convolutional layers and uses residual connections to overcome the gradient vanishing problem; the feature fusion network uses a feature pyramid network to fully fuse high- and low-dimensional features.
[0013] The YOLOv3-focus model contains four detection heads. First, to enhance the network's cross-scale detection capability, detection is performed on feature maps scaled down by 4, 8, 16, and 32 times, respectively. In the detection branch that detects feature maps scaled down by 4 times, channel and spatial attention modules and a feature map cropping module are added, which helps the network focus on targets in major road areas and improves the detection capability for these targets. The feature map cropping module is used to selectively crop feature maps for certain regions; the cropping condition expression is:
[0014] (2)
[0015] Where, h , w Represents the width and height of the image. and Representatives and operations or Represents or operates; with the top left corner of the image as the vertex of the coordinate axis, vertically downwards is... xThe positive direction of the axis is horizontal to the right. y In the positive direction of the axis, then Let the coordinates be the coordinates of a certain position on the feature map; if the coordinates of a certain position meet the following conditions... x If so, the feature map at that position in all channels will be filled with 0;
[0016] Secondly, three prior anchor boxes are used for regression output in each detection head. For each anchor box, the confidence score, predicted bounding box location information, and score of each category are output respectively. Finally, the predicted bounding boxes are scaled back to the original image size according to the feature map size reduction, and then all predicted bounding boxes are processed by non-maximum suppression to obtain the final prediction result.
[0017] Step 4: Input the training set samples into the YOLOv3-focus model for training, including:
[0018] 1) Load the pre-trained weights of the feature extraction network, fix the weights of darknet53, initialize the parameters of the feature fusion network and the detection head, and then input the training set samples into the YOLOv3-focus model in batches;
[0019] 2) Assign the prior anchor boxes generated by k-means clustering to the corresponding detection heads, divide the feature maps of each detection head into cells, determine whether each cell contains the target, and then perform regression prediction on each cell based on the size of the prior anchor boxes.
[0020] 3) Scale the predicted bounding boxes output by regression prediction proportionally, and then use a dynamic allocation algorithm to allocate the corresponding number of positive samples to each ground truth bounding box;
[0021] 4) with The loss function value is calculated and the weights of the unfrozen network part are updated. To improve the network training efficiency, cosine annealing learning rate is used for training. The learning rate value increases linearly from the final learning rate value to the initial learning rate value between batches during the first training process. After that, it changes according to the number of training sessions. The learning rate no longer changes between batches within the same number of training sessions. The learning rate changes smoothly according to the cosine curve with the total number of training sessions as half a cycle.
[0022] 5) Repeat steps 1) to 4) until the set number of iterations is reached;
[0023] Step 5: Output the trained network model for road object detection, including:
[0024] The training set is trained according to the training method in step four; after training, the test set is used to test and obtain indicators such as average accuracy, recall, and number of detections per second, ultimately achieving cross-scale detection of road targets.
[0025] Its further technical solution is that the loss function of the YOLOv3-focus model consists of three parts, namely, localization loss. Confidence loss and classification loss Each item has a balance coefficient. , and The expression is:
[0026] (3)
[0027] Location loss Only positive samples are counted. The parameters representing network predictions, The parameters representing the true bounding box include four specific parameters: the center point of the box, and offset factors for width and height. , Locating loss The expression is:
[0028] (4)
[0029] Where, , , , , Represents the total number of positive samples. This represents the coordinates of the top-left corner of the cell after the feature map has been divided into cells. Represents the width and height of the prior anchor frame. CIOU The calculation formula is as follows:
[0030] (5)
[0031] Where, IOU This represents the ratio of the intersection area to the union area of the two frames. gt Represents the true frame. The Euclidean distance between the center points of the predicted bounding box and the ground truth bounding box is... This represents the diagonal distance of the smallest closure region that can simultaneously contain both the predicted and ground truth boxes. , ;
[0032] Target confidence is the probability that a target exists within the predicted bounding box output by the network. It is calculated using the binary cross-entropy loss function, and the confidence loss is... The expression is:
[0033] (6)
[0034] (7)
[0035] Where, Representing the One predicted bounding box, {0, 1}, A value of 1 indicates the presence of a real target within the predicted bounding box, while a value of 0 indicates the absence of a real target. It is the confidence score output by the network;
[0036] The YOLOv3 network outputs a probability for each category. The loss is calculated using the binary cross-entropy loss function, but only for positive samples. (Classification loss) The expression is:
[0037] (8)
[0038] (9)
[0039] Where, Representing the One predicted bounding box, O ij {0, 1}, O ij An equal value of 1 indicates that the prediction box contains the first... A class target equal to 0 indicates that there is no real target. It is the first output of the network The probability of the class existing.
[0040] A further technical solution involves employing a dynamic allocation algorithm to assign a corresponding number of positive samples to each ground truth bounding box, including:
[0041] ① Place a 5*5 square box in the center area of all ground truth boxes, and take positive samples whose center point falls into the box or the ground truth box as candidate positive samples;
[0042] ② Calculate the cost function between all candidate positive samples and each ground truth bounding box, expressed as:
[0043] (10)
[0044] Where, Represents positioning loss, The loss represents the category loss. If the center point of a candidate positive sample falls within a 5x5 square frame, a penalty term is set. punish It is 0 if it is not 1 otherwise;
[0045] ③ Next, calculate the IOU value between all candidate positive samples and each ground truth bounding box, sum the IOU values between each ground truth bounding box and all candidate positive samples, and round down to obtain the result. N That is, the first i Each real-world frame corresponds to one N i ;
[0046] ④ Finally, sort the cost function values from smallest to largest, starting with the min(10, ...) values. ) positive samples are assigned to the first i There are 5*5 square boxes, so samples falling within the 5*5 square box are often assigned preferentially; if the same candidate positive sample is assigned to multiple square boxes at the same time, it will only be assigned to the square box with the smallest corresponding cost function value.
[0047] The beneficial technical effects of this invention are:
[0048] 1) The road target detection method based on the YOLOv3-focus model proposed in this application, combined with the prior method based on GIOU distance and the improvement of the original YOLOv3 network, can handle road images in multiple scenarios well, and has good cross-scale detection capability and high detection efficiency.
[0049] 2) In the YOLOv3-focus model, by adding an additional detection branch and incorporating a feature map cropping module and a channel and spatial attention module into this branch, the network's attention to the main road area is improved, enhancing the network's ability to detect targets on the main road. This improves the network's ability to perceive objects at various scales, balancing detection efficiency and accuracy, and ensuring the safe driving of intelligent vehicles.
[0050] 3) This application can directly input road images, automatically learn low-level features by constructing a suitable detection structure, and gradually form a more abstract high-level representation. Finally, it directly outputs the target category and localization box, without the need to design the feature extraction network and the target localization network separately, thus realizing an end-to-end target detection model. Attached Figure Description
[0051] Figure 1 This is the road target detection flowchart provided in this application.
[0052] Figure 2 This is the network structure diagram of the YOLOv3-focus model provided in this application.
[0053] Figure 3 This is a schematic diagram of the feature map clipping module provided in this application.
[0054] Figure 4This is a structural diagram of the channel and spatial attention module provided in this application.
[0055] Figure 5 This is a comparison chart of the detection results of YOLOv3-focus and YOLOv3-ultralytics provided in this application. Detailed Implementation
[0056] The specific embodiments of the present invention will be further described below with reference to the accompanying drawings.
[0057] like Figure 1 As shown, this embodiment provides a multi-scale road target detection method based on region focusing. The method includes: acquiring road images obtained by intelligent vehicle cameras, and normalizing the pixel values after uniformly scaling the image size; dividing the dataset; constructing a YOLOv3-focus model, adding an additional detection branch, and designing a feature map cropping module and adding a channel and spatial attention module on this branch to achieve network focusing on major road regions; inputting training set samples (images) into the improved YOLOv3-focus model for training; and finally outputting the trained network model for road target detection.
[0058] like Figure 2 As shown, the YOLOv3-focus model mainly consists of a feature extraction network (i.e., backbone network), a feature fusion network, and a detection head. The backbone network uses the Darknet53 network, containing 53 convolutional layers (Conv). Each Conv is followed by a batch normalization (BN) layer and a LeakyReLU activation function; these three are combined to form the DBL module. Residual connections are used, similar to ResNet50, to avoid gradient vanishing. The conventional SPP module performs pooling with various receptive field sizes (5*5, 9*9, 13*13) on the features, then concatenates the features to fuse feature information at different scales, improving the network's representation performance. However, the SPPF module used in this application employs an equivalent pooling method, replacing 9*9 and 13*13 pooling with multiple 5*5 pooling operations, reducing computational cost while achieving the same effect. Its specific structure is shown in [link to specific structure]. Figure 2 Where Maxpool represents a 5x5 max pooling layer. Four detection branches are added after the backbone network, corresponding to the final four detection heads, which perform detection on feature maps of 64x64, 32x32, 16x16, and 8x8 respectively. Larger feature maps tend to detect smaller objects, while smaller feature maps tend to detect larger objects. This application incorporates a feature map cropping module and a channel and spatial attention (CBAM) module into the detection branch that detects feature maps scaled down by a factor of 4. A schematic diagram of the feature map cropping module is shown below. Figure 3As shown, it directly removes the background area and easily detectable areas (secondary areas) and uniformly fills them with 0 values, forcing the network to focus on the main road area. The clipping condition is as follows:
[0059]
[0060] Where, h , w Represents the width and height of the image. and Representatives and operations or Represents or operates; with the top left corner of the image as the vertex of the coordinate axis, vertically downwards is... x The positive direction of the axis is horizontal to the right. y In the positive direction of the axis, then Let the coordinates be the coordinates of a certain position on the feature map; if the coordinates of a certain position meet the following conditions... x If so, the feature map at that position in all channels will be filled with 0.
[0061] like Figure 4 As shown, the CBAM module includes two sub-modules: channel attention and spatial attention. The CBAM module is responsible for improving the network's attention to road targets. After the model is trained, inputting the road image into the YOLOv3-focus model will output the road target category and the predicted bounding box.
[0062] To demonstrate the effectiveness of this application's "Road Object Detection Based on YOLOv3-focus," this example uses the publicly available KITTI autonomous driving dataset. The data acquisition equipment primarily includes grayscale cameras, color cameras, Edmund optics lenses, rotating 3D laser scanners, and inertial and GPS navigation systems. The KITTI dataset covers scenes including rural areas, cities, and highways, and primarily involves detecting cars, trucks, pedestrians, and cyclists. Some targets, due to their distance from the camera or significant overlap, are labeled "Undetermined." These labels are neither input into the network training nor included in the prediction results. A single image in the dataset contains a maximum of 15 vehicles and 30 pedestrians. The official dataset includes both training and test sets. However, since the labels on the test set are not publicly available, the effectiveness of this invention cannot be verified. Therefore, the 7481 training images are divided into training and test sets in a 4:1 ratio, with 6000 training samples and 1481 test samples. In this embodiment, targets with a pixel area smaller than 32*32 in the image after being reduced to a specified ratio are defined as small targets, targets larger than 96*96 are defined as large targets, and the rest are medium targets. The KITTI official test set contains a total of 36,876 targets, of which there are 5,901 small targets, 16,964 medium targets, and 14,012 large targets.
[0063] A YOLOv3-focus model was constructed. Pre-trained weights were loaded and frozen onto the Darknet53 backbone network, and the parameters of the feature fusion network and the detection head were initialized. The training sample set was input into the YOLOv3-focus network for training. Each batch used 32 samples during training, with an initial learning rate of 0.001 and a final learning rate of 0.000001, varying over half a cosine cycle. During training, four images were randomly stitched together to enhance the network's ability to distinguish foreground from background. Every 10 iterations, the input image size was randomly changed from 67% to 150% of its original size, with 600 iterations.
[0064] After training, the model's detection performance was validated using a test set. Furthermore, to verify the superiority of this application in road object detection, YOLOv3-focus was compared with several other models. Each method was trained using the same training set and tested using the same test set. The evaluation metrics for the test results were the mean accuracy (mAP) for large, medium, and small objects, and the detection time per image (including prediction and post-processing). The test results are shown in Table 1, where mAP@0.50 represents an IOU threshold of 0.50.
[0065] Table 1 Evaluation metrics for detection results of each algorithm
[0066]
[0067] As shown in Table 1, the method provided in this application has a certain advantage in detection accuracy when detecting large and medium-sized targets, but its accuracy is worse than that of the two-stage detection network Faster-RCNN and the single-stage network RetinaNet with more detector heads when detecting small targets. Compared with the YOLOv3-ultralytics network, the performance in detecting small objects is improved by 3.09%, indicating that adding a detector head significantly improves the network's ability to detect small objects. In terms of detection speed, compared with the YOLOv3-ultralytics network, the addition of a detector head and some modules to YOLOv3-focus has a smaller impact on the number of images detected per second, and it has a significant advantage over the two-stage network Faster-RCNN.
[0068] To more clearly demonstrate the performance advantage of the proposed method compared to the benchmark network YOLOv3-ultralytics, tests were conducted on some images, such as... Figure 5As shown, the three images on the left are the detection results after the network input is fed into YOLOv3-focus, and the three images on the right are the detection results after the network input is fed into YOLOv3-ultralytics. The comparison shows that the YOLOv3-focus algorithm performs better in detecting small targets and reduces missed detections even when targets overlap significantly. This indicates that the proposed method has strong cross-scale detection capabilities and can handle complex road conditions.
[0069] The YOLOv3-focus model provided in this application not only improves the network structure but also makes some improvements to the prior method. The model makes its final predictions based on the anchor box sizes obtained by the prior method. The original prior method uses k-means clustering based on the IOU distance to obtain all prior anchor box sizes from all ground truth bounding boxes in the training set. Since the aspect ratios of some ground truth bounding boxes differ significantly from the prior anchor boxes, the original prior method is not conducive to the network's prediction of these bounding boxes. Therefore, an improved clustering distance, GIOU (Generalized Intersection Over Union), i.e., k-means-GIOU, is adopted to narrow the size gap between extreme samples and prior anchor boxes. The specific algorithm flow of the k-means-GIOU proposed in this embodiment is shown in Table 2. The clustering algorithm iteratively generates 12 prior anchor boxes; the iteration stops if the anchor boxes generated in two consecutive iterations are completely identical.
[0070] Table 2. k-means-GIOU clustering algorithm flowchart
[0071]
[0072] The anchor box sizes generated according to different prior methods are shown in Table 3. In the table, k represents the number of anchor boxes generated. k=9 means that 9 anchor boxes are generated for the original YOLOv3 model with only 3 detection branches, and k=12 means that 12 anchor boxes are generated for the YOLOv3-focus model with 1 additional detection branch.
[0073] Table 3 Anchor frame sizes generated by different clustering methods
[0074]
[0075] As can be seen from Table 3, the aspect ratio of the anchor boxes generated by the improved GIOU distance-based prior method is slightly larger than that of the anchor boxes generated by the original prior method. This indicates that the improved prior method significantly improves the problem of unreasonable aspect ratio of the prior anchor boxes, which is beneficial to reducing the difficulty of subsequent model training and improving the convergence speed.
[0076] In summary, the YOLOv3-focus model provided in this application improves the performance of samples with extreme aspect ratios by using GIOU distance to generate prior anchor boxes. The use of the Darknet53 network as the backbone enhances the network's feature extraction capabilities, ensuring a solid foundation for subsequent predictions. Adding a detection branch and designing a feature map cropping module, along with channel and spatial attention modules, strengthens the network's perception of major road areas and improves its detection accuracy for small objects. Furthermore, compared to other object detectors, it achieves high-efficiency detection while maintaining high accuracy, making it suitable for road object detection scenarios.
[0077] The above descriptions are merely preferred embodiments of this application, and the present invention is not limited to the above embodiments. It is understood that other improvements and variations directly derived or conceived by those skilled in the art without departing from the spirit and concept of the present invention should be considered to be included within the protection scope of the present invention.
Claims
1. A multi-scale road target detection method based on region focusing, characterized in that, The method includes: Step 1: Obtain road images from different scenarios, scale all road images uniformly, and normalize the pixel values to create a dataset; Step 2: Divide the dataset into training and test sets according to a predetermined ratio. Apply an improved k-means-GIOU algorithm to the samples in the training set, performing k-means clustering on all ground truth bounding boxes to iteratively generate 12 prior anchor boxes. The improved k-means-GIOU algorithm adds a term to the original IOU to obtain the GIOU distance as the clustering distance, expressed as: (1) Where, A and B These represent the areas of the ground truth bounding box and the predicted bounding box, respectively. This represents the area of the intersection of the two frames. This represents the area of the union of the two frames. C This represents the area of the smallest closed region formed by the two frames; Step 3: Construct the YOLOv3-focus model, which includes a feature extraction network, a feature fusion network, and a detection head; wherein: The feature extraction network uses the Darknet53 network, which contains 53 convolutional layers and uses residual connections to overcome the gradient vanishing problem; the feature fusion network uses a feature pyramid network to fully fuse high- and low-dimensional features. The YOLOv3-focus model contains four detection heads. First, to enhance the network's cross-scale detection capability, detection is performed on feature maps scaled down by 4, 8, 16, and 32 times, respectively. In the detection branch that detects feature maps scaled down by 4 times, a channel and spatial attention module and a feature map cropping module are added, which helps the network focus on targets in major road areas and improves the detection capability for these targets. The feature map cropping module is used to selectively crop feature maps for certain regions, and the cropping condition expression is: (2) Where, h , w Represents the width and height of the image. and Representatives and operations or Represents or operates; with the top left corner of the image as the vertex of the coordinate axis, vertically downwards is... x The positive direction of the axis is horizontal to the right. y In the positive direction of the axis, then Let the coordinates be the coordinates of a certain position on the feature map; if the coordinates of a certain position meet the following conditions... x If so, the feature map at that position in all channels will be filled with 0; Secondly, three prior anchor boxes are used for regression output in each detection head. For each anchor box, the confidence score, predicted bounding box location information, and score of each category are output respectively. Finally, the predicted bounding boxes are scaled back to the original image size according to the feature map size reduction, and then all predicted bounding boxes are processed by non-maximum suppression to obtain the final prediction result. Step 4: Input the training set samples into the YOLOv3-focus model for training, including: Load the pre-trained weights of the feature extraction network, fix the weights of darknet53, initialize the parameters of the feature fusion network and the detection head, and then input the training set samples into the YOLOv3-focus model in batches. The prior anchor boxes generated by k-means clustering are assigned to the corresponding detection heads. The feature maps on each detection head are divided into cells. Then, it is determined whether each cell contains the target. Regression prediction is then performed on each cell based on the size of the prior anchor boxes. The predicted bounding boxes output by regression prediction are scaled proportionally, and then a dynamic allocation algorithm is used to allocate the corresponding number of positive samples to each ground truth box. by The loss function value is calculated and the weights of the unfrozen network parts are updated. The step of loading the pre-trained weights of the feature extraction network is re-executed until the set number of iterations is reached. To improve the network training efficiency, a cosine annealing learning rate is used for training. The learning rate value increases linearly from the final learning rate value to the initial learning rate value between batches during the first training process. Thereafter, it changes according to the number of training iterations. At the same number of training iterations, the learning rate no longer changes between batches. The learning rate changes smoothly according to a cosine curve with the total number of training iterations as half a cycle. Step 5: Output the trained network model for road object detection, including: The training set is trained according to the training method in step four; after training, the test set is used for testing to obtain the average accuracy, recall, and number of detections per second, ultimately achieving cross-scale detection of road targets.
2. The multi-scale road target detection method based on region focusing according to claim 1, characterized in that, The loss function of the YOLOv3-focus model consists of three parts: localization loss, localization loss, and localization loss. Confidence loss and classification loss Each item has a balance coefficient. , and The expression is: (3) The positioning loss Only positive samples are counted. The parameters representing network predictions, The parameters representing the true bounding box include four specific parameters: the center point of the box, and offset factors for width and height. , The positioning loss The expression is: (4) Where, , , , , Represents the total number of positive samples. This represents the coordinates of the top-left corner of the cell after the feature map has been divided into cells. Represents the width and height of the prior anchor frame. CIOU The calculation formula is as follows: (5) Where, IOU This represents the ratio of the intersection area to the union area of the two frames. gt Represents the true frame. The Euclidean distance between the center points of the predicted bounding box and the ground truth bounding box is... This represents the diagonal distance of the smallest closure region that can simultaneously contain both the predicted and ground truth boxes. , ; The target confidence score is the probability that a target exists within the predicted bounding box output by the network, calculated using the binary cross-entropy loss function. The confidence score loss... The expression is: (6) (7) In the formula, Representing the One predicted bounding box, {0, 1}, A value of 1 indicates the presence of a real target within the predicted bounding box, while a value of 0 indicates the absence of a real target. It is the confidence score output by the network; The YOLOv3 network outputs a probability for each category. The loss is calculated using the binary cross-entropy loss function, but only for positive samples. The classification loss... The expression is: (8) (9) In the formula, Representing the One predicted bounding box, O ij {0, 1}, O ij An equal value of 1 indicates that the prediction box contains the first... A class target equal to 0 indicates that there is no real target. It is the first output of the network The probability of the class existing.
3. The multi-scale road target detection method based on region focusing according to claim 1, characterized in that, The method of using a dynamic allocation algorithm to assign a corresponding number of positive samples to each ground truth bounding box includes: Place a 5*5 square box in the center of all ground truth boxes, and take positive samples whose center point falls into the box or the ground truth box as candidate positive samples. Calculate the cost function between all candidate positive samples and each ground truth bounding box, expressed as: (10) Where, Represents positioning loss, The loss represents the category loss. If the center point of a candidate positive sample falls within a 5x5 square frame, a penalty term is set. punish It is 0 if it is not 1 otherwise; Next, calculate the IOU value between all candidate positive samples and each ground truth bounding box, sum the IOU values between each ground truth bounding box and all candidate positive samples, and round down to obtain the result. N That is, the first i Each real-world frame corresponds to one N i Finally, the cost function values are sorted from smallest to largest, with the top min(10, ...) values being the lowest. ) positive samples are assigned to the first i There are 100 true bounding boxes; if the same candidate positive sample is assigned to multiple true bounding boxes at the same time, it will only be assigned to the true bounding box with the smallest corresponding cost function value.
Citation Information
Patent Citations
Road multi-target detection method based on improved multistage YOLOv3
CN111401148A
YOLOv3-SPP-based road environment target detection method
CN111709381A