Target detection method based on fine-grained features
By introducing the SPD-Conv module, channel attention and multi-scale feature fusion module in the YOLOv8s network, the problems of low detection accuracy and slow speed of small objects in ground scenarios are solved, and higher detection accuracy and real-time performance are achieved.
Patent Information
- Application Number
- CN202410775859.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-17
- Publication Date
- 2024-11-01
Smart Images

Figure CN118887378A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of autonomous driving technology, and in particular to a target detection method based on fine-grained features. Background Art
[0002] Automatic target detection is a core technology in autonomous driving and drone applications, which can ensure the safe and stable operation of autonomous driving and the accurate information acquisition of drone technology. Early autonomous driving systems mainly rely on sensors to collect surrounding environmental information, and then use rule-based algorithms for environmental modeling, path planning and vehicle control. However, these algorithms rely heavily on the subjective settings of technicians, and the systems are relatively simple, with limited adaptability to complex environments and poor performance in dealing with emergencies.
[0003] The development of drones from ordinary shooting platforms or play tools to the backbone of reconnaissance and surveillance also requires the support of target detection technology. The progress of deep learning and computer vision technology has promoted the rapid development of autonomous driving and drone technology. The target detection system can instantly capture and analyze information about the surrounding environment, and then perceive and understand the surrounding environment, and assist in making accurate decisions.
[0004] Many scholars have studied target detection technology, which can more accurately identify objects on the road and provide richer environmental information, helping to improve vehicle decision-making and behavior. However, this method requires increased computational complexity and system cost, requires a larger data set for training, and has high requirements for the real-time performance of the algorithm.
[0005] The continuously improved target detection algorithms show stronger performance. A large number of experiments have proved that hierarchical feature fusion and powerful backbone networks are crucial to improving the performance of target detection. In tasks such as autonomous driving and drone reconnaissance, target detection needs to run in real-time performance, which places high demands on the speed and accuracy of detectors to ensure that vehicles and drones can respond and make decisions in a timely and accurate manner. To this end, this paper proposes a multi-scale target detection model for ground scenes. Summary of the invention
[0006] The invention discloses a target detection method based on fine-grained features, aiming to solve the technical problems of low detection accuracy and slow detection speed of small targets in ground scenes.
[0007] In order to achieve the above object, the present invention adopts the following technical solutions:
[0008] A target detection method based on fine-grained features includes the following specific steps:
[0009] S1: Network model design: Design a network model based on YOLOv8s as a template. On the basis of retaining the core design modules such as loss function and positive and negative sample allocation strategy, a more powerful backbone network is used for feature extraction.
[0010] S2: Downsampling module: The SPD-Conv module is used in the downsampling operation of the MRT-YOLO backbone network, where the SPD-Conv module consists of a space-to-depth (SPD) layer followed by a non-strided convolution (Conv) layer;
[0011] S3: Channel attention mechanism: The channel attention mechanism is introduced into the MRT-YOLO algorithm to integrate the information of the entire feature map to calculate the importance weight of each channel, and the channel attention is added after the C2f module;
[0012] S4: Backbone multi-scale feature fusion module: YOLOV8s generates five feature maps after the backbone network feature extraction, where {C1, C2, C3, C4, C5} represent the feature information of objects of different scales, and on this basis, a feature map {C6} generated by the multi-scale feature fusion module MFL is added;
[0013] S5: Multi-scale small target detection structure: The Neck part of the YOLOv8 algorithm integrates the FPN and PAN structures, adding an extra edge between the original input and output nodes to integrate more functions without increasing the cost;
[0014] S6: MRT-YOLO network structure: SPD-Conv module is used for downsampling. C2f module is used for feature extraction in YOLOv8. Compared with C3 module, it has more cross connections and additional Split operations. At the same time, channel attention module is added after feature extraction of C2f module. The algorithm forms feature map {C6} by fusing feature maps {C2, C3, C4, C5 layers} extracted by backbone network. The generated {C6} contains richer semantic information of different scales. {C6} is passed into the network for feature information exchange. SPPF structure is used to generate feature map {C5}, and the original parallel structure of SPP is changed to serial structure.
[0015] In a preferred solution, in S2, specifically for the feature X with a dimension of C1×S×S, X is first sliced in equal proportions to obtain four sub-features, each of which has a dimension of C×S / 2×S / 2. The feature map size becomes half of X, and the number of channels remains unchanged. The four sub-features are then concatenated along their respective channel dimensions to obtain an intermediate feature X1, and the dimension of the intermediate feature X1 is 4C1×S / 2×S / 2. Finally, the intermediate feature X1 is subjected to a non-stride convolution to obtain a downsampled output feature X2. The non-stride convolution can retain all fine-grained feature information as much as possible, and the dimension of X2 is C2×S / 2×S / 2.
[0016] In a preferred solution, the specific operation in S4 is: downsampling the original feature maps {C2, C3, C4, C5} respectively, unifying the height and width of the feature maps, and unifying them to the size of the feature map {C5} by default, so as to facilitate feature fusion with the feature map {C5}, and then splicing the unified four feature maps {C2, C3, C4, C5} along the channel dimension, and obtaining the intermediate feature X through a convolution operation after the splicing. This convolution changes the number of channels to reduce the subsequent calculation amount. The feature X combines semantic information of different scales together. In order to further enhance the information interaction between features of objects of different scales, the feature X is passed through N consecutive convolution layers, and the SiLU activation function is used in each convolution layer to generate a feature stack, and finally the feature extractor is used to learn the information in the feature stack;
[0017] The specific algorithm of S4 is as follows:
[0018]
[0019]
[0020] Among them, X k represents the kth feature pushed into the stack, X represents the intermediate feature that combines semantic information of different scales, Conv k and δ represent the kth Conv layer and activation function respectively.
[0021] In a preferred solution, in S5, the FPN is mainly composed of two paths, bottom-up and top-down. The bottom-up path is composed of a convolutional neural network, which is used to extract high-resolution features from the input image. The top-down path obtains finer but lower-resolution features from high-level semantic features through upsampling or interpolation operations, thus forming a feature pyramid of multiple scales. At the same time, the YOLOv8s algorithm obtains the feature maps {C1, C2, C3, C4, C5} from the backbone network from the bottom to the top, and then concatenates {C3, C4, C5} with the upsampled features through the FPN structure to obtain the feature pyramid {P3, P4, P5} to generate a multi-level feature representation. The feature pyramid generated by the FPN is then input into the PAN structure, wherein the PAN structure further optimizes the feature representation through the bottom-up path and feature aggregation mechanism.
[0022] In a preferred solution, in S5, the feature maps {C6} and {C5} mentioned above are spliced, the size of the C6 feature map is 20*20, the same as the C5 layer, and then the feature map {C2} is also added to the feature fusion, the size of the feature map {C2} is 160*160, and a horizontal connection from the bottom feature map to the high-level feature map is added in the external network, and the bottom feature map {C3, C4, C5} is spliced with the fused high-level feature map.
[0023] In a preferred solution, in S6, the algorithm is specifically:
[0024]
[0025] Among them, this algorithm adds a new detection head, and the corresponding detection feature map size is 160*160, which is responsible for detecting targets larger than 4*4. It is obtained by step-by-step feature fusion of the underlying features {C2} extracted from the backbone network. In addition, the algorithm allows different detection heads to share convolutional layers. At the same time, this algorithm adds a spanning horizontal connection in the network to fuse the shallower location information with the deep features.
[0026] In a preferred solution, in S6, YOLOv8 adopts a decoupled-head structure to separate the heads of target classification and recognition tasks. In the loss calculation process, the following two main aspects are comprehensively considered, specifically: the loss function of the target recognition detection head includes two parts: CIoUloss and DistributionFocalloss (DFL), and the loss function used for the target classification detection head adopts BCEL (BinaryCross-EntropyLoss). These three losses are weighted averaged according to a certain weight ratio to obtain the final loss value.
[0027] In a preferred solution, the algorithm in S6 is as follows:
[0028] LOSS=λ2L CIOU +λ2DFL+λ3BCEL
[0029]
[0030] Where IoU is the intersection over union ratio between the predicted box and the real box, α is the weight parameter, v is used to measure the similarity of aspect ratio, b and b gt is the Euclidean distance between the center points of the two boxes, and c is the diagonal length of the minimum circumscribed rectangle of the two boxes;
[0031] DFL(S i , S i+1 )=((y i+1 -y)log(S i )+(yy i )log(S i+1 ))
[0032] Among them, the DFL loss function uses the cross entropy loss function to force the network to focus more on the correct label value, which makes the network's prediction probability more concentrated near the label value;
[0033]
[0034] Where N is the number of samples, y i is the true label (0 or 1) of the i-th sample, x i is the model prediction value of the i-th sample, usually a probability value between 0 and 1.
[0035] Compared with the prior art, the present invention provides a target detection method based on fine-grained features, which has the following beneficial effects:
[0036] 1. This object detection method based on fine-grained features makes the network more sensitive to low-resolution images and small objects by using the SPD-Conv module in the backbone network for feature downsampling; secondly, the present invention improves the C2f module in yolov8 and adds channel self-attention inside the module to effectively interact and integrate features; then, using the proposed MFL module and the improved BiFPN structure, the present invention fuses the feature maps {C2, C3, C4, C5}4 in the backbone network to generate a new feature map {C6}, which increases the cross-connection between the underlying features and the high-level features; finally, a multi-scale small target detection structure is designed to improve the recognition sensitivity of dense small targets.
[0037] 2. This object detection method based on fine-grained features extracts richer multi-scale features from the intermediate feature X, then concatenates the fused multi-scale features, and finally obtains the feature map {C6} after the C2f module and channel attention. The feature map {C6} not only contains semantic information of different scales (such as pedestrians and trucks), but also contains the difference in semantic information between objects of different scales, which can effectively help the network distinguish objects of different scales, more accurately determine the position and bounding box of the object, and improve the accuracy and robustness of object positioning.
[0038] 3. This target detection method based on fine-grained features can improve the accuracy of small target detection by designing a feature fusion structure that is friendly to small targets, while enhancing the information flow between multi-scale features and better handling targets of different scales and sizes.
[0039] As can be seen from the above, a target detection method based on fine-grained features includes the following specific steps: S1: Network model design: A network model is designed based on YOLOv8s as a template. On the basis of retaining the core design modules such as loss function and positive and negative sample allocation strategy, a more powerful backbone network is used for feature extraction; S2: Downsampling module: The SPD-Conv module is used in the downsampling operation of the MRT-YOLO backbone network, where the SPD-Conv module consists of a space-to-depth (SPD) layer followed by a non-strided convolution (Conv) layer;
[0040] S3: Channel attention mechanism: The channel attention mechanism is introduced into the MRT-YOLO algorithm to integrate the information of the entire feature map to calculate the importance weight of each channel, and the channel attention is added after the C2f module; S4: Backbone multi-scale feature fusion module: YOLOV8s generates five feature maps after the backbone network feature extraction, where {C1, C2, C3, C4, C5} represent the feature information of objects of different scales, and on this basis, a feature map {C6} generated by the multi-scale feature fusion module MFL is added; S5: Multi-scale small target detection structure: The Neck part of the YOLOv8 algorithm integrates the FPN and PAN structures, and adds an extra edge between the original input and output nodes to increase the detection accuracy without increasing the original input and output nodes. Integrate more functions at an increased cost; S6: MRT-YOLO network structure: Use SPD-Conv module for downsampling, C2f module is used in YOLOv8 for feature extraction, compared with C3 module, there are more cross-connections and additional Split operations, and a channel attention module is added after the C2f module feature extraction, and the algorithm forms a feature map {C6} by fusing the feature map {C2, C3, C4, C5 layer} extracted by the backbone network, and the generated {C6} contains richer semantic information of different scales, and {C6} is used to pass into the network for feature information exchange, and the SPPF structure is used when generating the feature map {C5}, and the original parallel structure of SPP is changed to a serial structure. A target detection method based on fine-grained features provided by the present invention has the technical effect of enhancing the feature extraction capability of the backbone network and improving the performance of the network in detecting small targets. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] Figure 1 This is a specific flow chart of a target detection method based on fine-grained features proposed in the present invention.
[0042] Figure 2 This is a structural diagram of the SPD-Conv module of the target detection method based on fine-grained features proposed in the present invention.
[0043] Figure 3 This is a structural diagram of the channel attention module of the target detection method based on fine-grained features proposed in the present invention.
[0044] Figure 4 This is a comparison diagram of the backbone network of the target detection method based on fine-grained features proposed in the present invention.
[0045] Figure 5 Neck structure diagram of the MRT-YOLO algorithm for a target detection method based on fine-grained features proposed in the present invention.
[0046] Figure 6This is the MRT-YOLO network architecture diagram of the target detection method based on fine-grained features proposed in the present invention.
[0047] Figure 7 This is a quantitative graph of each category in the VisDrone dataset for the target detection method based on fine-grained features proposed in this invention.
[0048] Figure 8 This is a quantitative graph of each category in the BDD100K dataset for the object detection method based on fine-grained features proposed in the present invention.
[0049] Fig. 9 This is an example image of the VisDrone dataset for the target detection method based on fine-grained features proposed in this invention.
[0050] Fig.10 This is an example image of the BDD100K dataset for the target detection method based on fine-grained features proposed in this invention.
[0051] Fig.11 This is a PR curve comparison diagram of the target detection method based on fine-grained features proposed in the present invention.
[0052] Fig.12 This is a confusion matrix diagram of the MRT-YOLO network model of the target detection method based on fine-grained features proposed in the present invention.
[0053] Fig.13 This is a confusion matrix diagram of the YOLOv8s network model for a target detection method based on fine-grained features proposed in the present invention. DETAILED DESCRIPTION
[0054] The technical solutions in the embodiments of the present invention will be described clearly and completely below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments.
[0055] The present invention discloses a target detection method based on fine-grained features, which is mainly used in the scenario of autonomous driving target detection.
[0056] Reference Figure 1-Figure 5 , a target detection method based on fine-grained features, comprising the following specific steps:
[0057] S1: Network model design: A network model is designed with YOLOv8s as a template. On the basis of retaining the core design modules such as loss function and positive and negative sample allocation strategy, a more powerful backbone network is used for feature extraction. Different from previous work, the algorithm forms a new feature map {C6} by fusing the feature maps {C1, C2, C3, C4, C5} extracted by the backbone network. The feature map {C6} contains richer semantic information of different scales. Passing the feature map {C6} into the network for multi-scale feature fusion will improve the network's perception of multi-scale targets. At the same time, the algorithm also strengthens the Neck part of feature fusion, horizontally linking the underlying features with the deep features, so that semantic information of more scales can be integrated without increasing too much computational cost.
[0058] S2: Downsampling module: The SPD-Conv module is used in the downsampling operation of the MRT-YOLO backbone network. The SPD-Conv module consists of a space-to-depth (SPD) layer followed by a non-stride convolution (Conv) layer. The SPD layer reduces the spatial dimension of the input feature map to the channel dimension while retaining all the information in the channel dimension, achieving downsampling of the spatial dimension without losing information within the channel. Compared with traditional CNN convolution, the SPD-Conv module has better performance in small target detection and low-resolution images. It avoids the fixed stride and pooling operations in traditional convolution, allowing the network to process low-resolution images and small objects more effectively. Figure 2 The specific steps of the SPD-Conv module operation are shown;
[0059] S3: Channel attention mechanism: The channel attention mechanism is introduced in the MRT-YOLO algorithm to integrate the information of the entire feature map to calculate the importance weight of each channel, and the channel attention is added after the C2f module; the main purpose is to enhance the network's attention to different channels (channels of the feature map) to improve the performance of the model in detecting small targets. The channel attention mechanism calculates the importance weight of each channel by integrating the information of the entire feature map through global information aggregation, such as Figure 3As shown. This is usually achieved through GlobalAveragePooling, which averages the feature values of each channel to obtain a global channel importance distribution. By learning global information, a learning parameter is introduced. The channel attention mechanism calculates the weight of each channel. These weights represent the importance of each channel to the current task, that is, the contribution of the features found in the channel to the task. The calculated channel weights are used to perform weighted fusion on the original feature maps, emphasizing channels that are important to the task and suppressing channels that are irrelevant to the task. This weighted fusion method allows the network to pay more attention to the extraction of key information in subsequent layers, which helps drive the network to pay attention to small objects and objects with blurred feature information, and improve the representation ability of the model. We add channel attention after the C2f module to make the model more flexible and adaptable.
[0060] S4: Backbone multi-scale feature fusion module: The sizes and types of objects in ground scenes vary, which requires the model to be able to understand the differences between objects of different scales. This difference contains information about the size and shape of the object. By learning these differences, the neural network can better distinguish the features of objects of different scales in the image, thereby improving the accuracy of recognition and positioning. Figure 3 As shown in Figure 1, YOLOV8s generates five feature maps after the backbone network feature extraction, where {C1, C2, C3, C4, C5} represent the feature information of objects of different scales, and on this basis, a feature map {C6} generated by the multi-scale feature fusion module MFL is added. The specific structure of MFL is as follows Figure 3 As shown;
[0061] S5: Multi-scale small target detection structure: The Neck part of the YOLOv8 algorithm integrates the FPN and PAN structures, adding an extra edge between the original input and output nodes to integrate more functions without increasing the cost;
[0062] S6: MRT-YOLO network structure: The overall structure of the MRT-YOLO network is as follows Figure 5As shown in the figure, the SPD-Conv module is used for downsampling, and the C2f module is used for feature extraction in YOLOv8. Compared with the C3 module, it has more cross connections and additional Split operations, which can obtain richer gradient flow information. The features of different channels represent different semantic information. The rich channel information can provide more context and semantic associations, which helps the model to better understand and distinguish different types of targets. At the same time, the channel attention module is added after the C2f module feature extraction to strengthen the influence of important channels, help the model better adapt to complex ground environments, and improve the accuracy and robustness of small target and feature fuzzy object detection. The algorithm forms a feature map {C6} by fusing the feature maps {C2, C3, C4, C5 layers} extracted by the backbone network. The generated {C6} contains richer semantic information of different scales. Using {C6} to pass into the network for feature information exchange can allow the network to obtain more extensive context information, which helps to understand the overall scene. This provides a more global context for processing multi-scale targets. The SPPF structure is used when generating the feature map {C5}, and the original parallel structure of SPP is changed to a serial structure, which reduces the amount of calculation.
[0063] Reference Figure 1 In a preferred embodiment, in S2, specifically for the feature X with a dimension of C1×S×S, X is first sliced in equal proportions to obtain four sub-features with a dimension of C×S / 2×S / 2. The feature map size becomes half of X, and the number of channels remains unchanged. Then, the four sub-features are concatenated along their respective channel dimensions to obtain an intermediate feature X1 with a dimension of 4C1×S / 2×S / 2. This step achieves downsampling of the spatial dimension without losing information within the channel. Finally, the intermediate feature X1 is subjected to a non-stride convolution to obtain a downsampled output feature X2. Non-stride convolution can retain all fine-grained feature information as much as possible, and the dimension of X2 is C2×S / 2×S / 2.
[0064] Reference Figure 1 and Figure 3In a preferred embodiment, the specific operation in S4 is: downsampling the original feature maps {C2, C3, C4, C5} respectively, unifying the height and width of the feature maps, and unifying them to the size of the feature map {C5} by default, so as to facilitate feature fusion with the feature map {C5} later, and then splicing the unified four feature maps {C2, C3, C4, C5} along the channel dimension. The spliced features are subjected to a convolution operation to obtain an intermediate feature X. This convolution step changes the number of channels to reduce the subsequent calculation amount. Feature X combines semantic information of different scales together. In order to further enhance the information interaction of features between objects of different scales, feature X is passed through N consecutive convolution layers, and the SiLU activation function is used in each convolution layer to generate a feature stack. Finally, the feature extractor is used to learn the information in the feature stack, such as Figure 3 As shown in the figure, this design effectively promotes the fusion of multi-scale features. The characteristic of this feature stack is that it has the nature of task interaction, which means that when calculating these features, the network structure can capture the relationship between different tasks;
[0065] The specific algorithm of S4 is as follows:
[0066]
[0067]
[0068] Among them, X k represents the kth feature pushed into the stack, X represents the intermediate feature that combines semantic information of different scales, Conv k and δ represent the kth Conv layer and activation function, respectively. Therefore, we extract richer multi-scale features from the intermediate feature X, and then concatenate the fused multi-scale features. Finally, after the C2f module and channel attention, we obtain the feature map {C6}. The feature map {C6} contains not only the semantic information of different scales (such as pedestrians and trucks), but also the difference in semantic information between objects of different scales, which can effectively help the network distinguish objects of different scales, determine the position and bounding box of objects more accurately, and improve the accuracy and robustness of object positioning.
[0069] Reference Figure 1In a preferred embodiment, in S5, FPN is mainly composed of two paths, bottom-up and top-down. The bottom-up path is composed of a convolutional neural network, which is used to extract high-resolution features from the input image. The top-down path obtains finer but lower-resolution features from high-level semantic features through upsampling or interpolation operations, thus forming a feature pyramid of multiple scales. At the same time, the YOLOv8s algorithm obtains the feature maps {C1, C2, C3, C4, C5} from the backbone network from the bottom to the top, and then concatenates {C3, C4, C5} with the upsampled features through the FPN structure to obtain the feature pyramid {P3, P4, P5} to generate a multi-level feature representation. The feature pyramid generated by FPN is then input into the PAN structure, wherein the PAN structure further optimizes the feature representation through the bottom-up path and feature aggregation mechanism.
[0070] Reference Figure 1 , Figure 4-6 In a preferred embodiment, in S5, in order to improve the accuracy of small target detection and enhance the information flow between multi-scale features, and better handle targets of different scales and sizes, we design a feature fusion structure that is friendly to small targets, such as Figure 5 As shown by the arrow in the middle, the feature maps {C6} and {C5} mentioned above are spliced at the same time. The size of the C6 feature map is 20*20, the same as the C5 layer, and can be directly spliced with the C5 layer without upsampling. The C6 layer containing feature information of different scales is involved in the information exchange without increasing the amount of calculation. In order to increase the feature information of small target objects in the network, the feature map {C2} is also added to the feature fusion. The size of the feature map {C2} is 160*160. Its receptive field is smaller than that of the feature map {C3}, and it is more suitable for processing local features and small target objects. In addition, a horizontal connection from the bottom feature map to the high-level feature map is added in the network, such as Figure 4 As shown by the dotted arrows, the underlying feature maps {C3, C4, C5} are concatenated with the fused high-level feature maps to fuse more scale semantic information without increasing too much computational cost and better integrate global and local information.
[0071] Reference Figure 1 and Figure 3 In a preferred embodiment, in S6, the algorithm is specifically:
[0072]
[0073] Among them, this algorithm adds a new detection head, and the corresponding detection feature map size is 160*160, which is responsible for detecting targets larger than 4*4. It is obtained by step-by-step feature fusion of the underlying features {C2} extracted from the backbone network. In addition, the algorithm allows different detection heads to share convolution layers, such as letting the four detection heads responsible for predicting the detection frame task share a set of convolutions, and the heads responsible for predicting the classification task share a layer of convolutions, while BatchNormalization (BN) is calculated independently. This design can reduce the number of parameters and complexity of the model, while maintaining the independence of each detection head as much as possible, so as to better adapt to targets of different sizes or feature distributions; in order to introduce more position information in the deep features, thereby improving the accuracy of the target detection model for the position, this algorithm also adds a cross-lateral connection in the network to fuse the shallower position information with the deep features, such as Figure 6 As indicated by the arrow.
[0074] Reference Figure 1 In a preferred embodiment, in S6, YOL0v8 adopts a decoupled-head structure to separate the heads of target classification and recognition tasks. In the loss calculation process, the following two main aspects are comprehensively considered, specifically: the loss function of the target recognition detection head includes two parts: CIoUloss and DistributionFocalloss (DFL), and the loss function used for the target classification detection head adopts BCEL (BinaryCross-EntropyLoss). These three losses are weighted averaged according to a certain weight ratio to obtain the final loss value.
[0075] Reference Figure 1 In a preferred embodiment, the algorithm in S6 is as follows:
[0076] LOSS=λ2L CIOU +λ2DFL+λ3BCEL
[0077]
[0078] Where IoU is the intersection over union ratio between the predicted box and the real box, α is the weight parameter, v is used to measure the similarity of aspect ratio, b and b gt is the Euclidean distance between the center points of the two boxes, and c is the diagonal length of the minimum circumscribed rectangle of the two boxes;
[0079] DFL(S i , S i+1 )=((y i+1 -y)log(S i )+(yy i )log(Si+1 ))
[0080] Among them, the DFL loss function uses the cross entropy loss function to force the network to focus more on the correct label value, which makes the network's prediction probability more concentrated near the label value; improves the network's accuracy and focus on the real label;
[0081]
[0082] Where N is the number of samples, y i is the true label (0 or 1) of the i-th sample, x i is the model prediction value of the i-th sample, usually a probability value between 0 and 1.
[0083] Example:
[0084] The test results are tested, including the following steps:
[0085] 1. Datasets. This paper uses the public datasets VisDrone and BDD100K, which are widely used in target detection tasks. These two datasets contain a rich variety of scenes and target categories, such as urban streets, rural areas, highways, etc., as well as different types of targets such as pedestrians, vehicles, and bicycles. In addition, these images were taken under different weather conditions and contain a variety of complex scenes and challenges, such as occlusion, bad weather conditions, and changes in lighting, which makes the datasets suitable for evaluating the robustness and generalization ability of the model;
[0086] The VisDrone dataset consists of drone images in multiple scenes, including thousands of images and millions of labeled target instances, providing large enough data for the training and evaluation of deep learning models. The BDD100K dataset mainly consists of road environment images in autonomous driving, including more than 100,000 high-resolution images. In order to verify the effect of each module, 20,000 unlabeled images in the BDD100K dataset were removed, and the remaining images were re-divided at a ratio of 7:1, with 70,000 training sets and 10,000 test sets. At the same time, in order to better verify the performance of the model, this algorithm was tested on the VisDrone dataset. The experiment divided the VisDrone dataset into 6471 training sets, 548 validation sets, and 1610 test sets. Figure 7 , 8 The number of each category in the VisDrone and BDD100K datasets is shown. Fig. 9 , 10 A sample image is shown;
[0087] 2. Test environment
[0088] The experiment of the present invention is carried out in the environment of Ubuntu22.04, the CPU model is Intel Xeon Silver 4314. The GPU model is 2×NVIDIA TESLA T4, the programming language is Python 3.10.12, and the deep learning framework is Pytorch2.0.0;
[0089] 3. Ablation Experiment Analysis
[0090] In order to deeply evaluate the impact of each component of the algorithm, we conducted an ablation experiment of the MRT-YOLO algorithm on the test set of the BDD100K dataset. In Table 1, we list the use of various improvements and modular methods and show the corresponding experimental results. In the table, the "√" symbol indicates that a specific module or improvement is adopted in the corresponding experiment. All experiments of the present invention are uniformly trained for 200 epochs with a batch size of 64.
[0091] Solution 0 is the result of yolov8s on the test set of the BDD100K dataset. The experimental results show that each improvement point in the MRT-YOLO algorithm has been improved to a certain extent. From the perspective of adding improvement points separately;
[0092] In scheme 1, the SPD-Conv module is used instead of the convolution operation for downsampling, and the mAP@.5 is improved by 0.4% and the recall rate is improved by 0.4%;
[0093] In solution 2, the channel attention mechanism is introduced, and the mAP@.5 and recall rate are increased by 0.3% and 0.5% respectively. The network pays more attention to the area of small objects when processing images, thereby detecting small objects more accurately.
[0094] In solution 3, we added a feature fusion module MFL to the backbone network. The test results showed that mAP@.5 increased by 1.3% and the recall rate increased by 2.6%. This means that the model's perception of objects of different sizes has been improved, reducing information loss.
[0095] In solution 4, we combined the small object detection layer with multi-scale feature fusion, and the mAP@.5 was improved by 2.2% and the recall rate was improved by 3.7%. Although the model complexity and computational effort were increased, the detection performance was significantly improved, so adding a multi-scale small object detection structure is a reasonable choice.
[0096] Table 1. Ablation experiment results of the MRT-YOLO algorithm on the test set of the BDD100K dataset
[0097]
[0098] 4. Algorithm performance analysis
[0099] We further verified the algorithm of the present invention using the VisDrone dataset. The test results show that the mAP@.5 of the MRT-YOLO algorithm is 47.8% and the recall is 42.6%. Under the same experimental environment, the mAP@.5 of the MRT-YOLO algorithm is 2.6% higher than that of YOLOv8s, and the recall rate is 5.6%. This shows that the MRT-TOLO algorithm achieves higher accuracy in detection tasks, performs better in small target detection, and can meet the requirements of real-time detection.
[0100] Fig.11 The comparison of PR curves between the MRT-YOLO algorithm, YOLOv8s, and YOLOv5s algorithms is shown. It can be seen that the MRT-YOLO algorithm performs better across the entire recall range. Fig.12 shows the confusion matrix obtained by the MRT-YOLO algorithm on the test set, Fig.13 The confusion matrix obtained by the YOLOv8s algorithm on the test set is shown. It can be seen that the overall accuracy of the MRT-YOLO algorithm is higher, and the false detection rate of the vehicle target category is reduced. In addition, the Precision and Recall of the people and motor categories are significantly improved, which shows that the MRT-YOLO algorithm better realizes the detection of small targets. Table 2 shows the experimental results of different algorithm models on the VisDrone dataset test set.
[0101] Table 2 Performance comparison of different target detection algorithms on the VisDrone dataset
[0102]
[0103] Working principle: In order to enhance the feature extraction capability of the backbone network, we use the SPD-Conv module in the backbone network instead of convolution for downsampling. We introduce the channel attention mechanism to enhance the expression of features. In order to enhance the fusion of global context information and enable the network model to better understand the differences between objects of different scales, we add a multi-scale feature fusion MFL module to the backbone network. In order to enhance the accuracy of the network for small target detection, we design a multi-scale small target detection structure. Experiments show that the MRT-YOLO algorithm we proposed is significantly better than the YOLOV8s algorithm in detecting objects in ground environments. The average detection accuracy on the BDD100K dataset test set reaches 56.2%, an increase of 3.3%. In real scenarios, we can increase the frames per second (FPS) to 92, which is significantly improved compared with other mainstream algorithms in detection accuracy and processing speed.
[0104] The above description is only a preferred specific implementation manner of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can make equivalent replacements or changes according to the technical scheme and inventive concept of the present invention within the technical scope disclosed by the present invention, which should be covered by the protection scope of the present invention.
Claims
1. A target detection method based on fine-grained features, characterized in that: The specific steps include: S1: Network model design: Design a network model based on YOLOv8s as a template. On the basis of retaining the core design modules such as loss function and positive and negative sample allocation strategy, a more powerful backbone network is used for feature extraction. S2: Downsampling module: The SPD-Conv module is used in the downsampling operation of the MRT-YOLO backbone network, where the SPD-Conv module consists of a spatial-to-depth (SPD) layer followed by a non-strided convolution (Conv) layer; S3: Channel attention mechanism: The channel attention mechanism is introduced into the MRT-YOLO algorithm to integrate the information of the entire feature map to calculate the importance weight of each channel, and the channel attention is added after the C2f module; S4: Backbone multi-scale feature fusion module: YOLOV8s generates five feature maps after the backbone network feature extraction, where {C1, C2, C3, C4, C5} represent the feature information of objects of different scales, and on this basis, a feature map {C6} generated by the multi-scale feature fusion module MFL is added; S5: Multi-scale small target detection structure: The Neck part of the YOLOv8 algorithm integrates the FPN and PAN structures, adding an extra edge between the original input and output nodes to integrate more functions without increasing the cost; S6: MRT-YOLO network structure: SPD-Conv module is used for downsampling. C2f module is used for feature extraction in YOLOv8. Compared with C3 module, it has more cross connections and additional Split operations. At the same time, channel attention module is added after feature extraction of C2f module. The algorithm forms feature map {C6} by fusing feature maps {C2, C3, C4, C5 layers} extracted by backbone network. The generated {C6} contains richer semantic information of different scales. {C6} is passed into the network for feature information exchange. SPPF structure is used to generate feature map {C5}, and the original parallel structure of SPP is changed to serial structure.
2. The target detection method based on fine-grained features according to claim 1, characterized in that: In S2, specifically for the feature X of dimension C1×S×S, X is first sliced in equal proportions to obtain four sub-features, the dimensions of which are C×S / 2×S / 2, the feature map size becomes half of X, the number of channels remains unchanged, and then the four sub-features are concatenated along their respective channel dimensions to obtain an intermediate feature X1, the dimension of which is 4C1×S / 2×S / 2, and finally the intermediate feature X1 is subjected to a non-stride convolution to obtain the downsampled output feature X2, which can retain all fine-grained feature information as much as possible, and the dimension of X2 is C2×S / 2×S / 2.
3. The target detection method based on fine-grained features according to claim 1, characterized in that: The specific operation in S4 is: downsampling the original feature maps {C2, C3, C4, C5} respectively, unifying the height and width of the feature maps, and unifying them to the size of the feature map {C5} by default, so as to facilitate feature fusion with the feature map {C5} later, and then splicing the unified four feature maps {C2, C3, C4, C5} along the channel dimension, and obtaining the intermediate feature X through a convolution operation after the splicing. This convolution changes the number of channels to reduce the subsequent calculation amount. The feature X combines the semantic information of different scales together. In order to further enhance the information interaction between the features of objects of different scales, the feature X is passed through N consecutive convolution layers, and the SiLU activation function is used in each convolution layer to generate a feature stack, and finally the feature extractor is used to learn the information in the feature stack; The specific algorithm of S4 is as follows: Among them, X k represents the kth feature pushed into the stack, X represents the intermediate feature that combines semantic information of different scales, Conv k and δ represent the kth Conv layer and activation function respectively.
4. The target detection method based on fine-grained features according to claim 1, characterized in that: In the S5, FPN is mainly composed of two paths, bottom-up and top-down. The bottom-up path is composed of a convolutional neural network, which is used to extract high-resolution features from the input image. The top-down path obtains finer but lower-resolution features from high-level semantic features through upsampling or interpolation operations, thus forming a feature pyramid of multiple scales. At the same time, the YOLOv8s algorithm obtains the feature maps {C1, C2, C3, C4, C5} from the backbone network from the bottom to the top, and then concatenates {C3, C4, C5} with the upsampled features through the FPN structure to obtain the feature pyramid {P3, P4, P5} to generate a multi-level feature representation. The feature pyramid generated by FPN is then input into the PAN structure, wherein the PAN structure further optimizes the feature representation through the bottom-up path and feature aggregation mechanism.
5. The target detection method based on fine-grained features according to claim 4 is characterized in that: In S5, the feature maps {C6} and {C5} mentioned above are spliced, and the size of the C6 feature map is 20*20, the same as the C5 layer. The feature map {C2} is also added to the feature fusion, and the size of the feature map {C2} is 160*160. A horizontal connection from the bottom feature map to the high-level feature map is added in the external network, and the bottom feature map {C3, C4, C5} is spliced with the fused high-level feature map.
6. The target detection method based on fine-grained features according to claim 1, characterized in that: In S6, the algorithm is specifically: Among them, this algorithm adds a new detection head, and the corresponding detection feature map size is 160*160, which is responsible for detecting targets larger than 4*4. It is obtained by step-by-step feature fusion of the underlying features {C2} extracted from the backbone network. In addition, the algorithm allows different detection heads to share convolutional layers. At the same time, this algorithm adds a spanning horizontal connection in the network to fuse the shallower location information with the deep features.
7. The target detection method based on fine-grained features according to claim 6, characterized in that: In S6, YOLOv8 adopts a decoupled-head structure to separate the heads of target classification and recognition tasks. In the loss calculation process, the following two main aspects are comprehensively considered, specifically: the loss function of the target recognition detection head includes CIoUloss and DistributionFocalloss (DFL), and the loss function used for the target classification detection head adopts BCEL (BinaryCross-EntropyLoss). These three losses are weighted averaged according to a certain weight ratio to obtain the final loss value.
8. The target detection method based on fine-grained features according to claim 7, characterized in that: The algorithm in S6 is as follows: LOSS=λ2L CIOU +λ2DFL+λ3BCEL Where IoU is the intersection over union ratio between the predicted box and the real box, α is the weight parameter, v is used to measure the similarity of aspect ratio, b and b gt is the Euclidean distance between the center points of the two boxes, and c is the diagonal length of the minimum circumscribed rectangle of the two boxes; DFL(S i ,S i+1 )=((y i+1 -y)log(S i )+(y-y i )log(S i+1 )) Among them, the DFL loss function uses the cross entropy loss function to force the network to focus more on the correct label value, which makes the network's prediction probability more concentrated near the label value; Where N is the number of samples, y i is the true label (0 or 1) of the i-th sample, x i is the model prediction value of the i-th sample, usually a probability value between 0 and 1.
Citation Information
Cited By
Real-time blood cell detection method based on improved blood cell extraction and multi-scale attention
CN119559636A
A real-time blood cell detection method based on improved blood cell extraction and multi-scale attention
CN119559636B
Fine-grained teaching behavior identification method for smart classroom
CN119942640A
Underwater target image detection method and device
CN120032118A
Traditional Chinese medicine particle detection method, device and equipment, storage medium and program product
CN120656166A
