Lightweight target detection method based on local space mixed attention mechanism
By introducing a lightweight object detection method with a local space hybrid attention mechanism in the autonomous driving system, the problems of insufficient detection accuracy and high computing burden in the prior art are solved, and efficient and accurate object detection performance is achieved.
Patent Information
- Application Number
- CN202411712277.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-27
- Publication Date
- 2025-03-14
AI Technical Summary
In autonomous driving systems, existing lightweight object detection algorithms are insufficient in detection of complex backgrounds, small targets and diverse objects, and the introduction of attention mechanisms increases computational burden, resulting in performance bottlenecks.
A lightweight object detection method based on local spatial hybrid attention mechanism (LSMA) is proposed. Combined with local average pooling, delocal average pooling and deep convolution techniques, it adaptively focuses on local and global features in the image, and is integrated into the YOLOv8 detection framework.
Without increasing model parameters and calculation complexity, detection accuracy and robustness are significantly improved, adapting to the real-time and high-precision detection requirements of autonomous driving scenarios.
Smart Images

Figure CN119625687A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of autonomous driving technology, and in particular to a lightweight target detection method based on a local spatial mixed attention mechanism, and in particular to a lightweight target detection method based on a local spatial mixed attention mechanism (LSMA). Background Art
[0002] In autonomous driving systems, object detection algorithms are one of the core technologies to ensure driving safety and user experience. Although advances in deep learning have significantly improved the performance of object detection, there is still a trade-off between computing resource limitations, latency, and detection accuracy. Autonomous driving systems not only need to accurately identify diverse objects in complex traffic scenarios, but also must quickly process large amounts of perception data to ensure real-time performance and decision accuracy. However, when computing resources are limited, the deviation between perception output and real-world states may cause perception delays, which in turn affects the accuracy and safety of subsequent planning and execution modules.
[0003] To address these challenges, lightweight target detection algorithms can be used to shorten data processing time and reduce the computational burden of the system. This approach helps narrow the gap between inferred values and true values by reducing model complexity, thereby improving system response speed. However, lightweight models often face the problem of reduced detection performance, especially in autonomous driving scenarios, where complex backgrounds, small targets, and diverse objects place higher demands on model accuracy. With the development of deep learning technology, attention mechanisms have been introduced into target detection tasks. By adaptively weighting input features, the model's attention to key features is increased, thereby improving detection efficiency and accuracy. However, the introduction of attention mechanisms often increases the computational burden, especially in resource-limited autonomous driving systems, which may become a performance bottleneck.
[0004] To solve this problem, researchers have proposed introducing lightweight attention mechanisms, such as SE (Squeeze and Excitation Networks) and ECA (Efficient Channel Attention), which effectively encode the relationship between channels and reduce the use of computing resources. However, these methods mainly focus on channel attention and do not fully utilize the spatial information in the image, which is crucial for target detection in autonomous driving scenarios. In addition, although CBAM (Convolutional Block Attention Module) combines channel and spatial attention, there is a channel compression problem when applying spatial attention, which leads to the loss of some spatial information and affects the accurate recognition of feature maps.
[0005] Therefore, how to make full use of spatial and channel information while keeping the model lightweight has become an important topic in the research of target detection algorithms. Developing a new lightweight attention mechanism that can adaptively focus on local and global features in the image to meet the dual requirements of autonomous driving systems for real-time and high-precision detection is a key research direction. Summary of the invention
[0006] In response to the problem in the prior art of how to make full use of spatial and channel information while keeping the model lightweight, the present invention provides a lightweight target detection method based on a local spatial mixed attention mechanism, which is a lightweight target detection method based on a local spatial mixed attention mechanism (LSMA), and applies it to the YOLOv8 detection framework, aiming to improve the real-time detection performance of the model in autonomous driving scenarios.
[0007] The technical solution of the present invention is as follows:
[0008] The present invention constructs a lightweight target detection method, and the specific steps are as follows:
[0009] (1) A local spatial hybrid attention mechanism (LSMA) is proposed, which combines local average pooling (LAP), unlocal average pooling (UNLAP) and depthwise convolution (DWConv) techniques to finely process local areas of the input feature map. This mechanism can adaptively focus on key objects and areas in the image and enhance the ability to capture important spatial information. In the channel attention and spatial attention branches, global average pooling (GAP) and deep convolution are applied respectively to strengthen feature learning, while local information is restored through UNLAP, thereby achieving efficient processing of feature maps. LSMA achieves a lightweight design of the model by reducing the number of parameters and computational overhead of standard convolution;
[0010] (2) Integrate LSMA into the YOLOv8 detection framework, build the YOLOv8_Att network architecture, replace the original YOLOv8 C2f module with the C2f_Att module, and add the LSMA mechanism. This model effectively addresses the problems of small target detection and background interference in complex autonomous driving scenarios by generating feature maps of different scales step by step and performing bidirectional feature fusion;
[0011] (3) The performance of the original YOLOv8 is compared with that of YOLOv8_Att, which integrates SE (Squeeze and Excitation Networks), CBAM (Convolutional Block Attention Module), ECA (Efficient Channel Attention), and LSMA on multiple public datasets. The verification results show that LSMA performs well in the field of general object detection and can adapt to the needs of autonomous driving scenarios.
[0012] The purpose of the present invention is achieved through the following technical solutions:
[0013] A lightweight target detection method based on local spatial hybrid attention mechanism includes the following steps:
[0014] S1. Select a public object detection dataset for training and testing.
[0015] S2. Combining Global Average Pooling (GAP), Local Average Pooling (LAP), Unlocal Average Pooling (UNLAP) and Depthwise Convolution (DWConv) to build a local spatial hybrid attention mechanism (LSMA), specifically:
[0016] S2-1. In the initial stage of processing the input feature map, LSMA first performs a local average pooling (LAP) operation to convert the original input feature map into a more compact local feature map in the form of (C, ks, ks), where C is the number of channels of the feature map and ks is the size after local pooling. After local pooling, LSMA splits the feature map into two branches to calculate channel attention and spatial attention respectively, thereby refining and strengthening feature representation.
[0017] S2-2, channel attention branch first uses global average pooling (GAP) to convert local feature maps into one-dimensional vectors, and uses one-dimensional convolution (Conv1d) to consider the interaction between each channel and its k nearest neighbors to control the model complexity; where the convolution kernel size k is proportional to the number of channels C, determined by formula (1):
[0018]
[0019] Among them, k is the size of the convolution kernel, C is the number of channels, γ and b are hyperparameters, and the default value is 2, |·| odd represents the odd number closest to x;
[0020] S2-3, the spatial attention branch uses depthwise convolution (DWConv) to perform channel-by-channel group convolution on the extracted local feature map to obtain the feature representation of local spatial attention information;
[0021] S2-4. The specific operation of LSMA can be expressed by formulas (2) to (5):
[0022] x loc =LAP(x) (2)
[0023] A c =Conv1d(GAP(x loc )) (3)
[0024] A s =UNLAP(DWConv(x loc )) (4)
[0025] y lsma =x×A c ×A s (5)
[0026] Among them, x loc is the feature map after LAP change. LAP, GAP, UNLAP, Conv1d and DWConv are the corresponding feature transformation operations. c is the channel attention branch output, A s is the output of the spatial attention branch, y lsma It is the feature map of LSMA original feature map after the attention feature transformation;
[0027] S3. Improve the YOL0v8 backbone network structure and build the YOL0v8_Att detector. Replace the original C2f module with the C2f_Att module with an integrated attention mechanism to enhance the feature extraction capability. Specifically:
[0028] S3-1,YOL0v8_Att is built based on the YOL0v8 detection framework and consists of three parts: backbone network, neck layer and detection head;
[0029] S3-2. The backbone network includes the Convolution-BatchNorm-SiLU (CBS) layer and the C2f_Att layer. The CBS layer implements the downsampling of the feature map, while the C2f Att layer integrates the attention mechanism and focuses on feature extraction. The significant difference between the C2f_Att layer and the ordinary C2f layer is that the attention mechanism is added after the last CBS layer.
[0030] S3-3, after the data is processed by the backbone network, three sets of feature maps of different scales are generated. These feature maps carry rich hierarchical information and are then passed to the neck layer for bidirectional feature fusion;
[0031] S3-4, the detection head adopts the mainstream decoupled structure, separating the classification and bounding box regression detection heads to improve detection performance;
[0032] S4. Use the original YOLOv8 network model and the YOLOv8_Att detector with Squeeze and Excitation Networks (SE), Convolutional Block Attention Module (CBAM), Efficient Channel Attention (ECA) and Local Spatial Hybrid Attention Mechanism (LSMA) added to train on multiple datasets, compare the experimental results and analyze them, specifically:
[0033] S4-1. In the detection head part of the YOLOv8_Att model, the mainstream decoupled head structure is adopted to separate the classification (cls) and bounding box regression (bbox) detection heads, and omit the target foreground / background branches; by combining the complete intersection over Union Loss (CIoU) and the distribution focal loss (DFL), the overall loss function of YOLOv8_Att is optimized;
[0034] S4-2, the original YOLOv8 model and the YOLOv8_Att model with Squeeze and Excitation Networks (SE), Convolutional Block Attention Module (CBAM), Efficient Channel Attention (ECA) and Local Space Hybrid Attention Mechanism (LSMA) added are trained on the training dataset processed in step S1; most of the hyperparameters of the training use the default configuration of YOLOv8 v8.1 version, and the Nano version of YOLOv8_Att detector is used; the PascalVOC, BDD100K and Udacity datasets used in the training are trained from scratch, while the MSCOCO dataset is trained based on the official pre-trained weights of YOLOv8;
[0035] S4-3, set the input image size, batch size and training period to appropriate values, and introduce an early termination mechanism to optimize the training process; in the hyperparameters of LSMA, the scaling size of LAP and UNLAP operations is set to 5;
[0036] S4-4. Compare and analyze the training results to verify the effectiveness of LSMA.
[0037] Furthermore, the selection of a public target detection dataset for training and testing described in step S1 is to select and divide a public target detection dataset and an autonomous driving target detection dataset for training and testing to ensure that a variety of object categories, complex scenes and changing environments are covered to improve the evaluation criteria for target detection performance.
[0038] Compared with the prior art, the present invention has the following advantages:
[0039] 1. The lightweight target detection method based on the local spatial hybrid attention mechanism described in the present invention aims at the trade-off challenge between computing resources, delay and detection accuracy in autonomous driving target detection technology. This method combines local average pooling (LAP), unlocal average pooling (UNLAP) and depthwise convolution (DWConv), and adaptively focuses on key objects and areas in the image by finely processing the local area of the input feature map, thereby significantly enhancing the model's ability to capture important spatial information. This method adaptively learns channel attention and spatial attention without significantly increasing model parameters and computational complexity, improving detection accuracy and convergence speed. This method is integrated into the YOLOv8 framework, effectively improving the accuracy and robustness of target detection while maintaining high frame rate real-time performance. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] Figure 1 It is a LSMA module structure diagram of a lightweight target detection method based on a local space hybrid attention mechanism described in the present invention;
[0041] Figure 2 It is a YOLOv8_Att model architecture diagram of a lightweight target detection method based on a local space hybrid attention mechanism described in the present invention;
[0042] Figure 3 This is the C2f and C2f_att architecture diagram of a lightweight target detection method based on a local spatial hybrid attention mechanism described in the present invention. DETAILED DESCRIPTION
[0043] The specific implementation modes of the present invention are further described below in conjunction with examples.
[0044] Example:
[0045] A lightweight target detection method based on local spatial hybrid attention mechanism includes the following steps:
[0046] The technical solution in the embodiment of the present invention will be further described in detail below in conjunction with the accompanying drawings in the embodiment of the present invention. The specific steps are as follows:
[0047] Step 1: Select the public object detection datasets MSCOCO and Pascal VOC, as well as the autonomous driving datasets BDD100K and Udacity, and divide them into training sets and test sets; MSCOCO and Pascal VOC are general image datasets, widely used in tasks such as object detection and image classification, and can provide a variety of object categories and complex scene backgrounds; BDD100K and Udacity are datasets in the field of autonomous driving, containing a variety of important target categories in autonomous driving scenarios, such as vehicles, pedestrians, and traffic lights;
[0048] Step 2: Use Global Average Pooling (GAP), Local Average Pooling (LAP), Unlocal Average Pooling (UNLAP) and Depthwise Convolution (DWConv) techniques to build a local spatial hybrid attention mechanism (LSMA); Figure 1 Explain the working principle of Local Spatial Mixed Attention Mechanism (LSMA);
[0049] For step 2, it specifically includes:
[0050] (2.1) In the initial stage of processing the input feature map, LSMA first performs a local average pooling operation (LAP), which converts the original input feature map into a more compact local feature map in the form of (C, ks, ks), where C is the number of channels of the feature map and ks is the size after local pooling. After local pooling, LSMA further splits the feature map into two independent branches, which are used to calculate channel attention and spatial attention respectively. The specific operation of LSMA is shown in formulas (6) to (9):
[0051] x loc =LAP(x) (6)
[0052] A c =Conv1d(GAP(x loc )) (7)
[0053] A s =UNLAP(DWConv(x loc )) (8)
[0054] y lsma =x×A c ×A s (9)
[0055] Among them, x locis the feature map after LAP change. LAP, GAP, UNLAP, Conv1d and DWConv are the corresponding feature transformation operations. c is the channel attention branch output, A s is the output of the spatial attention branch, y lsma It is the feature map after the original LSMA feature map is transformed by the attention feature;
[0056] (2.2) The channel attention branch of LSMA converts the local feature map into a one-dimensional vector containing global information through the global average pooling operation (Global Average Pooling, GAP); then, the one-dimensional vector is processed using one-dimensional convolution (Convld). Conv1d can effectively reduce the model complexity while retaining important feature interaction information by considering the direct interaction between each channel and its k nearest neighbor channels; among them, the convolution kernel size k is proportional to the channel dimension C; the selection of k is determined by formula (10):
[0057]
[0058] Among them, C is the number of channels, k is the size of the convolution kernel, γ and b are hyperparameters with a default value of 2, |·| odd represents the odd number closest to x;
[0059] (2.3) The spatial attention branch of LSMA uses depthwise convolution (DWConv) to perform channel-by-channel group convolution on the extracted local feature maps to obtain feature representations containing local spatial attention information; in the spatial attention module of LSMA, the input channel C of DWConv is in With output channel C out The size is C; DWConv divides the input local feature map into C groups of channels, each with C in / C, that is, 1 channel, and each group uses only one convolution kernel; therefore, each convolution kernel only performs convolution calculations with a single channel of the corresponding group; this method reduces the total number of parameters to 1 / C times of ordinary convolution, and also reduces the computational overhead; in this way, LSMA ensures the efficiency of the operation while providing local spatial attention, so that the model can effectively capture local spatial information while maintaining efficiency; in addition, the independent operation of DWConv ensures that the feature information of each channel does not interfere with each other, allowing the model to learn spatial correlation independently in each channel;
[0060] Step 3: Improve the YOLOv8 backbone network structure and build the YOLOv8 Att detector; the overall architecture of YOLOv8_Att is as follows Figure 2 As shown, it consists of three parts: backbone network, neck layer and detection head;
[0061] For step 3, it specifically includes:
[0062] (3.1) The main structure of the backbone network consists of the CBS layer and the C2f_Att layer. The CBS layer includes a 3x3 convolution kernel, a step size of 2, a padding of 1, a batch normalization layer (BN) for normalization processing, and an activation function SiLU, which is used to downsample the feature map. The detailed architecture of the C2f_Att layer is shown in Figure 3 on the right; for the input feature map, the feature conversion is first performed through the CBS layer of the 1x1 convolution kernel, and then the Split layer divides the feature into two branches; one branch continuously passes through several stacked Bottleneck layers, and a residual connection branch is separated before each entry into the Bottleneck layer; the features processed by all the Bottleneck layers are concat-operated with the other branch of the Split layer; then, the concatenated features are reduced to the target output dimension through the CBS layer of the 1x1 convolution kernel; the C2f_Att layer is similar to the ordinary C2f layer ( Figure 3 The most significant difference is that the attention mechanism is added after the last CBS layer; the specific structure of the Bottleneck layer is as follows Figure 3 As shown in the middle, there are two types according to whether shortcut connections are included. One type includes shortcut connections that directly connect input and output, and the other type does not include such connections.
[0063] (3.2) After the data is processed by the backbone network, three sets of feature maps of different scales will be generated. These feature maps carry rich hierarchical information and will be transferred to the neck layer for bidirectional feature fusion. The design of the neck layer refers to the principle of path aggregation network, aiming to build an efficient feature pyramid. This feature pyramid structure includes a top-down path, which gradually upsamples the deep feature map and splices it with the shallow feature map of the corresponding level, and then realizes the layer-by-layer deepening and semantic refinement of the features through the C2f layer. At the same time, the bottom-up path realizes the transmission of feature information from the shallow layer to the deep layer through the downsampling operation of the CBS layer, and combines it with the feature information transmitted from the top-down path through lateral connections, and further enhances the semantic richness of the feature map through the C2f layer.
[0064] (3.3) The detection head uses a decoupled head structure to separate the classification and bounding box regression detection heads. The classification detection head uses a binary cross entropy loss function. The bounding box regression detection head consists of a complete intersection-over-union loss function and a distribution focus loss function.
[0065] Step 4: Experimental verification is performed on the dataset using the original YOLOv8 network model and the YOLOv8_Att detector with SE (Squeeze and Excitation Networks), CBAM (Convolutional Block Attention Module), ECA (Efficient Channel Attention) and Local Spatial Hybrid Attention Mechanism (LSMA) added respectively;
[0066] For step 4, it specifically includes:
[0067] (4.1) YOLOv8_Att model loss function setting: In the detection head part of the YOLOv8_Att model, a decoupled-head structure is used to separate the classification (cls) and bounding box regression (bbox) detection heads, without the target foreground / background branches commonly seen in previous loss functions; the classification detection head uses a binary cross entropy loss function (BCE), as shown in (11):
[0068]
[0069] Among them, N represents the number of predicted categories, y i is the binary indicator of the true category, p i The probability of the model's corresponding prediction is used to determine whether each category is of this type.
[0070] The bounding box regression detection head consists of two parts: Complete Intersection over Union Loss (CIoU) and Distribution Focal Loss (DFL). The formula of CIoU is shown in (12) to (13):
[0071]
[0072] Among them, the IoU part is the intersection over union ratio, which is an indicator used to measure the degree of overlap between two bounding boxes (A and B), and ρ is the difference between the predicted box b and the real box bgt The Euclidean distance between the center points, c represents the diagonal distance of the minimum enclosing area that can contain both the predicted box and the true box, and v is a measure of the similarity of the aspect ratio between the predicted box and the true box. The calculation formula of v is shown in (14):
[0073]
[0074] Among them, w and h represent the width and height of the prediction box respectively; w gt and h gt are the width and height of the true box, respectively. α is the weight coefficient of v to ensure that when the IoU between the predicted box and the true box is too high, the influence of v will not dominate the total loss. The calculation formula of α is shown in (15):
[0075]
[0076] α ensures that when IoU is close to 1 (i.e., the predicted box and the true box are highly overlapped), the loss proportion of the aspect ratio term v increases; when IoU is low, the main focus is on improving IoU; this trade-off strategy provides an elegant way to evaluate the accuracy of the predicted box. It allows the model to focus more on adjusting the shape of the predicted box by adjusting the aspect ratio to further improve the accuracy when the IoU value is high (i.e., when the predicted box already has a high overlap with the true box), rather than simply increasing the overlapping area between the predicted box and the true box; the target recognition loss uses the distribution focal loss function (DFL). The core idea of DFL is to use the cross entropy function to optimize the predicted probability distribution of the two positions near the label. The formulas are shown in (16) to (18):
[0077]
[0078] L DFL =((y i+1 -y)log(S i )+(yy i )log(S i+1 )) (18)
[0079] Among them, y is the true label value of the border, y i and i+1 The left and right predicted values of label y (y i ≤y≤y i+1 ), S i With S i+1 is the corresponding probability; the goal of DFL is to expand the value around the target y (i.e. y i and i+1 ) probability, so that the output distribution of the network can be more concentrated near the label value;
[0080] From the above loss function formula, we can get the loss function L of the classification and bounding box regression detection head respectively: cls With L bbox , so that the overall loss function L of YOLOv8_Att can be obtained all , the relevant formulas can be expressed as formulas (19) to (21):
[0081] L cls =λ1L BCE (19)
[0082] L bbox =λ2L CIoU +λ3L DFL (20)
[0083] L all =L cls +L bbox (twenty one)
[0084] In L cls With L bbox In the formula, λ1, λ2, and λ3 represent the weight coefficients of the three loss functions. These weights are hyperparameters and can be adjusted according to specific circumstances before training.
[0085] (4.2) Experimental verification: For the Pascal VOC, BDD100K, and Udacity datasets, training is performed from scratch; for the MSCOCO dataset, training is performed based on the official pre-trained weights of YOLOv8; during the training process, all other configurations remain the same; evaluation is performed using four performance indicators: precision, recall, mAP50, and mAP50-95.
[0086] The results show that on the MSCOCO dataset and Pascal VOC dataset, the YOLOv8_Att model using the LSMA attention mechanism outperforms YOLOv8 and other YOLOv8_Att models that integrate SE, CMAB, and ECA attention mechanisms in terms of comprehensive performance; especially in terms of the two key performance indicators, mAP50 and mAP50-95, the YOLOv8_Att model using the LSMA method performs best, verifying the effectiveness of the LSMA method in general target detection scenarios; on the two autonomous driving datasets, BDD100K and Udacity, the model combined with LSMA shows the best performance on both datasets, verifying the effectiveness and adaptability of LSMA in different autonomous driving target detection tasks.
[0087] The above content is only one embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A lightweight target detection method based on local spatial hybrid attention mechanism, characterized by: The steps include: S1. Select a public object detection dataset for training and testing. S2. Combining global average pooling GAP, local average pooling LAP, unlocal average pooling UNLAP and deep convolution DWConv, a local spatial hybrid attention mechanism LSMA is constructed. Specifically: S2-1. In the initial stage of processing the input feature map, LSMA first performs a local average pooling operation LAP to convert the original input feature map into a more compact local feature map in the form of C, ks, ks, where C is the number of channels of the feature map and ks is the size after local pooling. After local pooling, LSMA splits the feature map into two branches to calculate channel attention and spatial attention respectively, thereby refining and strengthening feature representation. S2-2, channel attention branch first uses the global average pooling operation GAP to convert the local feature map into a one-dimensional vector, and uses the one-dimensional convolution Conv1d to consider the interaction between each channel and its k nearest neighbors to control the model complexity; where the convolution kernel size k is proportional to the number of channels C, determined by formula (1): Among them, k is the size of the convolution kernel, C is the number of channels, γ and b are hyperparameters, and the default value is 2, |·| odd represents the odd number closest to x; S2-3, the spatial attention branch uses deep convolution DWConv to perform channel-by-channel group convolution on the extracted local feature map to obtain the feature representation of local spatial attention information; S2-4. The specific operation of LSMA can be expressed by formulas (2) to (5): x loc =LAP(x) (2) A c =Conv1d(GAP(x loc )) (3) A s =UNLAP(DWConv(x loc )) (4) and lsma =x×A c ×A s (5) Among them, x loc is the feature map after LAP change. LAP, GAP, UNLAP, Convld and DWConv are the corresponding feature transformation operations. c is the channel attention branch output, A s is the output of the spatial attention branch, y lsma It is the feature map of LSMA original feature map after the attention feature transformation; S3. Improve the YOLOv8 backbone network structure and build the YOLOv8_Att detector. Replace the original C2f module with the C2f_Att module with an integrated attention mechanism to enhance the feature extraction capability. Specifically: S3-1, YOLOv8_Att is built based on the YOLOv8 detection framework and consists of three parts: backbone network, neck layer and detection head; S3-2. The backbone network includes the "Convolution-Batch Normalization-SiLU Activation" CBS layer and the C2f_Att layer. The CBS layer implements the downsampling of the feature map, while the C2f_Att layer integrates the attention mechanism and focuses on feature extraction. The significant difference between the C2f_Att layer and the ordinary C2f layer is that the attention mechanism is added after the last CBS layer. S3-3, after the data is processed by the backbone network, three sets of feature maps of different scales are generated. These feature maps carry rich hierarchical information and are then passed to the neck layer for bidirectional feature fusion; S3-4, the detection head adopts the mainstream decoupled structure, separating the classification and bounding box regression detection heads to improve detection performance; S4. Use the original YOLOv8 network model and the YOLOv8_Att detector with compression and excitation network SE, convolutional block attention module CBAM, efficient channel attention ECA and local spatial hybrid attention mechanism LSMA to train on multiple data sets, compare the experimental results and analyze them, specifically: S4-1. In the detection head part of the YOLOv8_Att model, the mainstream decoupled head structure is adopted to separate the classification cls and bounding box regression bbox detection heads, and the target foreground / background branches are omitted; by combining the complete intersection-over-union loss function CIoU and the distribution focus loss function DFL, the overall loss function of YOLOv8_Att is optimized; S4-2, the original YOLOv8 model and the YOLOv8_Att model with compression and excitation network SE, convolutional block attention module CBAM, efficient channel attention ECA and local spatial hybrid attention mechanism LSMA are trained on the training data set processed in step S1; most of the hyperparameters of the training use the default configuration of YOLOv8 v8.1 version, and the Nano version of YOLOv8_Att detector is used; the Pascal VOC, BDD100K and Udacity datasets used in the training are trained from scratch, while the MSCOCO dataset is trained based on the official pre-trained weights of YOLOv8; S4-3, set the input image size, batch size and training period to appropriate values, and introduce an early termination mechanism to optimize the training process; in the hyperparameters of LSMA, the scaling size of LAP and UNLAP operations is set to 5; S4-4. Compare and analyze the training results to verify the effectiveness of LSMA.
2. According to claim 1, a lightweight target detection method based on local spatial hybrid attention mechanism is characterized in that: The step S1 of selecting a public target detection dataset for training and testing is to select and divide a public target detection dataset and an autonomous driving target detection dataset for training and testing to ensure that a variety of object categories, complex scenes and changing environments are covered to improve the evaluation criteria for target detection performance.
Citation Information
Cited By
Lightweight traffic target detection method and device based on LM-YOLO and medium
CN120689676A
Lightweight traffic target detection method and device based on LM-YOLO and medium
CN120689676B