Lightweight detection method, device and medium for road small target recognition scene

CN122618352APending Publication Date: 2026-08-21HEFEI UNIV OF TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611089548.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-22
Publication Date
2026-08-21

AI Technical Summary

Technical Problem

[0004]然而,在实际道路图像中,井盖、坑洼、减速带等目标受拍摄距离、安装视角及目标实际尺寸的影响,通常在图像中占据的像素区域较小,目标轮廓和纹理信息较为有限

Benefits of technology

1、本发明通过在道路小目标检测网络的骨干网络中设置SPD-Conv模块,利用空间切分和通道重排操作将输入特征图中的不同空间位置特征重新排列至通道维度,并采用非跨步卷积完成特征提取和通道调整,避免了直接采用跨步卷积进行下采样时部分像素信息被跳过的问题,从而减少了井盖、坑洼及减速带等道路小目标的边缘、轮廓和位置特征在下采样过程中的损失,提高了骨干网络对道路小目标细节特征的保留能力。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122618352A_ABST
    Figure CN122618352A_ABST
Patent Text Reader

Abstract

The application discloses a kind of lightweight detection methods, equipment and medium for road small target identification scene, belong to computer vision and intelligent transportation technical field, the method includes:1. collection and annotation road image;2. input road image into road small target detection network, obtain multi-scale feature by spatial-to-depth convolution and bidirectional feature fusion, and obtain class and bounding box prediction result by detection head;3. construct normalized wasserstein distance loss, and with classification loss, distribution focusing loss form total loss, for obtaining the trained road small target detection model, to process the road image to be detected, and output target class, confidence and bounding box position.The application can reduce small target feature loss, thereby can improve the recognition and positioning accuracy, suitable for vehicle embedded platform real-time detection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of computer vision and intelligent transportation technology, specifically a lightweight detection method, device and medium for small target recognition scenarios on roads. Background Technology

[0002] With the development of intelligent transportation systems, driver assistance systems, and autonomous driving technologies, higher demands are being placed on vehicles' real-time perception capabilities of road environment information. Road targets such as manhole covers, potholes, speed bumps, and road obstacles not only affect the smoothness and safety of vehicle driving but also provide crucial information for vehicle route planning, driving status adjustment, and road maintenance management. Therefore, the automatic identification and localization of targets in road images using onboard vision equipment has become an important research area in the field of road environment perception.

[0003] Currently, road target detection primarily employs deep learning-based target detection methods. Compared to traditional manual feature extraction methods, deep learning-based target detection methods can automatically extract semantic features from images through convolutional neural networks and complete target category recognition and bounding box localization through multi-layer network structures. Among these, single-stage target detection networks have been widely applied in vehicle-mounted road target detection scenarios due to their fast detection speed and relatively compact structure.

[0004] However, in real road images, targets such as manhole covers, potholes, and speed bumps typically occupy a small pixel area in the image due to factors such as shooting distance, installation angle, and actual target size, resulting in limited target contour and texture information. Existing target detection networks, when performing continuous downsampling, are prone to losing detailed features such as the edges, shape, and position of small targets, weakening the expressive power of small target features in deep networks. Especially when the road background is complex, lighting conditions vary, the target is partially occluded, or the target's color is similar to the road surface, small target features are easily interfered with by background information, leading to missed detections, false detections, or localization errors.

[0005] Furthermore, different road targets vary significantly in size within images, and existing multi-scale feature fusion methods may still suffer from insufficient utilization of features at different scales when fusing shallow detail features with deep semantic features. Simultaneously, small target bounding boxes are small in size, and even slight positional shifts in the predicted bounding boxes can significantly alter their overlap and localization evaluation results, making the model highly sensitive to errors in the position of small targets. While some existing detection networks can improve detection accuracy by increasing network depth, width, or computational complexity, this also increases the number of model parameters and computational overhead, making it difficult to simultaneously meet the requirements of automotive embedded devices for detection accuracy, operating speed, and computational resources. Summary of the Invention

[0006] This invention aims to address the shortcomings of existing technologies by proposing a lightweight detection method, device, and medium for small target recognition scenarios on roads. The goal is to reduce the loss of small target features during downsampling, enhance multi-scale feature fusion capabilities, thereby improving target recognition and positioning accuracy, and making it suitable for real-time detection on vehicle-mounted embedded platforms.

[0007] To achieve the above-mentioned objectives, the present invention adopts the following technical solution: The lightweight detection method for small target recognition scenarios on roads, as described in this invention, is characterized by the following steps: Step 1: Obtain the preprocessed first... Zhang Road Image and their corresponding real tags ; Step 2: Construct a road small target detection network, including: a backbone feature extraction network, a bidirectional feature fusion module, and a detection head, and then... Processing is performed to obtain Corresponding prediction results ; Step 3: According to and Construct a system that includes classification loss Distribution Focused Loss and normalized Wasserstein distance loss Total loss function ;in, It is based on The normalization factor for the road target calculated from the width and height of the true bounding box of the road target, and... The second-order Wasserstein distance between the predicted Gaussian distribution of the predicted bounding box and the true Gaussian distribution of the true bounding box is obtained. Step 4: Utilize Backpropagation and parameter updates are performed on the road small target detection network until... The convergence process yields the trained road small object detection model, which is used to process the road image to be detected, outputting the category, confidence score, and bounding box location information of the road small objects.

[0008] The lightweight detection method for small target recognition scenarios on roads, as described in this invention, is characterized in that step 1 includes: Construct a preprocessed road small object detection dataset ,in, Indicates the first preprocessed step Zhang's road image, and They represent Height and width, express The number of channels; Represents the total number of road images; let The corresponding real label is ,in, express The number of small road targets in the middle. express The first in Category labels for small road goals. express The first in The true bounding box of each road's small target, and ,in, and express The center coordinates, and They represent Width and height.

[0009] Furthermore, step 2 includes: Step 2.1: [The text appears to be incomplete and contains several grammatical errors. A more accurate translation would require The input is processed in the backbone feature extraction network to obtain... The corresponding multi-scale backbone feature map set ,in, Indicates the first A skeleton feature map at various scales. Indicates the number of scales in the backbone feature map; Step 2.2: The bidirectional feature fusion module... Processing is performed to obtain Corresponding multi-scale fusion feature map ; Step 2.3: [The text appears to be incomplete and contains several grammatical errors. A more accurate translation would require the full context.] The input is processed in the detection head to obtain... Corresponding prediction results This includes: category prediction results and bounding box prediction results .

[0010] Furthermore, the backbone feature extraction network in step 2.1 includes: an initial convolutional layer, One SPD-Conv module and One C2f feature extraction module; Initial convolutional layer pairs Perform convolution processing to obtain the first... Initial feature maps ; when At that time, the first Initial feature maps As the first Individual backbone feature map Enter the first Spatial segmentation, channel rearrangement, and non-stepping convolution are performed in the SPD-Conv module to obtain the first... Downsampled feature maps at various scales ; Will Enter the first The feature extraction module processes the data to obtain the first C2f feature extraction module. Backbone feature map at various scales ; when At that time, the first Backbone feature map at various scales Enter the numbers in sequence The SPD-Conv module and the first The feature extraction module processes the data to obtain the first C2f feature extraction module. Downsampled feature maps at various scales Thus, by the first The output of the C2f feature extraction module is the first... Backbone feature map at various scales .

[0011] Furthermore, the first Each SPD-Conv module includes: a spatial partitioning unit, a channel rearrangement unit, and a non-stride convolutional unit, and is obtained according to the following steps. ; Step 2.1.1: When At that time, the spatial division unit is based on the scale factor. , for the Initial feature maps Perform periodic sampling to obtain the first Each scale Each sub-feature map, where let the first... The first scale Line number The sub-feature graph of the column is denoted as , ; Step 2.1.2: The channel rearrangement unit will... Each sub-feature map is concatenated along the channel dimension to obtain Corresponding rearranged feature map ,in, Indicates a splicing operation; Step 2.1.3: Non-stepping convolutional unit pairs Perform a convolution with a stride of 1 to obtain the first... Downsampled feature maps at various scales .

[0012] Furthermore, the bidirectional feature fusion module in step 2.2 includes: a channel adjustment unit, a top-down fusion unit, a bottom-up fusion unit, and a fusion output unit. Step 2.2.1: Extraction of Channel Adjustment Unit Superficial skeletal features in Mid-level backbone feature diagram and deep skeletal feature map and conduct separately Convolution processing adjusts the number of channels to the same number. , obtained the Channel adjustment feature map at each scale , ; Step 2.2.2: Top-down fusion unit adjusts feature map with deep channels As a deep intermediate feature map And using equation (1) to and Processing is performed to obtain Corresponding intermediate feature map : (1) In equation (1), Indicates an upsampling operation. This indicates a normalized weighted summation operation. This represents the convolutional processing of the fusion feature corresponding to the 4th scale in the top-down fusion unit; The top-down fusion unit utilizes equation (2) to and Processing is performed to obtain Corresponding shallow intermediate feature map : (2) In equation (2), Convolutional processing to represent the fused features at the third scale; Step 2.2.3: Bottom-up fusion unit merges shallow intermediate feature maps As a shallow fusion feature map And use equation (3) to , as well as Processing is performed to obtain Corresponding mid-layer fusion feature map : (3) In equation (3), This indicates a downsampling operation. This represents the convolutional processing of the fusion feature corresponding to the 4th scale in the bottom-up fusion unit; Bottom-up fusion unit utilizes formula (4) to , Processing is performed to obtain Corresponding deep fusion feature map : (4) In equation (4), Convolutional processing to represent the fused features at the 5th scale; Step 2.2.4: The fusion output unit will... , and composition Corresponding multi-scale fusion feature map .

[0013] Furthermore, step 3 includes: Step 3.1: Predict the bounding box results Decode to obtain the first A set of candidate predicted bounding boxes ,in, express The number of candidate predicted bounding boxes, express The Middle There are candidate predicted bounding boxes, and ,in, and express The center coordinates, and They represent Width and height; Step 3.2: Predict based on category results Candidate predicted bounding box set and real labels The predicted bounding boxes of positive samples participating in the loss calculation are determined according to the preset positive sample allocation rules, as well as the true class and true bounding box corresponding to each predicted bounding box of positive samples. Step 3.3: Establish the first... Predicted bounding boxes for positive samples Predicted Gaussian distribution and the A real bounding box True Gaussian distribution ,in, and They represent The predicted mean vector and covariance matrix of the Gaussian distribution. and They represent The mean vector and covariance matrix of the true Gaussian distribution are given, and: (5) (6) Step 3.4: Calculate the second-order Wasserstein distance between the predicted Gaussian distribution and the true Gaussian distribution using equation (7). : (7) Step 3.5: Calculate using equation (8) The Middle The scale of small road goals Thus, by using equation (9), we can obtain The Middle Normalization factor for individual road goals : (8) (9) In equation (9), This represents the scale sensitivity adjustment coefficient; Step 3.6: Construct using equation (10) and Normalized Wasserstein distance loss between : (10) Step 3.7: Construct the normalized Wasserstein distance loss using equation (11) : (11) In equation (11), This represents the set of positive sample correspondences. Indicates the number of positive samples. Indicates the first Zhang Road Image The Middle Predicted bounding boxes for positive samples With the j A real bounding box A set of positive sample correspondences established between them; Step 3.8: Based on the predicted category and the true category, calculate the classification loss using binary cross-entropy loss. : Step 3.9: Based on the predicted bounding box and the actual bounding box, calculate the distributed focusing loss using the distributed focusing loss method. ; Step 3.10: Construct the total loss function using equation (12) : (12) In equation (12), , and They represent , and The weight.

[0014] The present invention provides an electronic device, including a memory and a processor, characterized in that the memory is used to store a program that supports the processor in executing the lightweight detection method for small target recognition scenarios on roads, and the processor is configured to execute the program stored in the memory.

[0015] The present invention provides a computer-readable storage medium storing a computer program, characterized in that the computer program, when executed by a processor, performs the steps of the lightweight detection method for small target recognition scenarios on roads.

[0016] Compared with the prior art, the beneficial effects of the present invention are as follows: 1. This invention sets up an SPD-Conv module in the backbone network of the road small target detection network. It uses spatial segmentation and channel rearrangement operations to rearrange the different spatial location features in the input feature map to the channel dimension. It also uses non-staggered convolution to complete feature extraction and channel adjustment, avoiding the problem of some pixel information being skipped when using staggered convolution for downsampling. This reduces the loss of edge, contour and position features of road small targets such as manhole covers, potholes and speed bumps during downsampling, and improves the backbone network's ability to preserve the detailed features of road small targets.

[0017] 2. This invention establishes a bidirectional feature fusion module comprising a channel adjustment unit, a top-down fusion unit, and a bottom-up fusion unit. This module performs bidirectional transmission and fusion of shallow, mid-level, and deep backbone feature maps. Furthermore, it utilizes learnable normalized fusion weights to adjust the contribution of different input feature maps during the fusion process. This ensures that shallow features containing spatial details and deep features containing semantic information are fully utilized, thereby enhancing the feature representation capability of road targets at different scales and reducing the impact of complex road backgrounds, target size differences, and unclear target features on the detection results.

[0018] 3. This invention represents the predicted bounding box and the true bounding box as Gaussian distributions, and measures the position and size difference between them based on the second-order Wasserstein distance. At the same time, it constructs a normalization factor based on the size of the real road target, so that the bounding box localization loss can be adjusted to adjust the prediction error in combination with the target scale. This reduces the influence of the traditional overlap evaluation method being too sensitive to the positional offset of small-sized bounding boxes, enhances the network's ability to learn the center position, width and height of small road targets, and improves the bounding box localization accuracy of small road targets.

[0019] 4. This invention combines the small target sensitive normalized Wasserstein distance loss with the classification loss and distribution focusing loss to form the total loss function, and uses the total loss function to jointly train the road small target detection network. This enables the network to learn the category information, bounding box position and boundary distribution features of road targets at the same time, thereby taking into account both the category recognition and location localization of road small targets and reducing missed detections, false detections and bounding box localization errors.

[0020] 5. Based on a lightweight target detection network, this invention synergistically improves the downsampling method, multi-scale feature fusion method, and bounding box localization loss. It does not require simply increasing the network depth or width to improve detection capabilities. It can improve the performance of small road target detection while controlling the number of model parameters and computational overhead. It is easy to deploy on vehicle-mounted embedded devices with limited computing and storage resources, and meets the application requirements of real-time road environment perception. Attached Figure Description

[0021] Figure 1 This is a schematic diagram of the overall process of the lightweight detection method for small target recognition scenarios on roads according to the present invention; Figure 2 This is a schematic diagram of the overall structure of the road small target detection network of the present invention; Figure 3 This is a schematic diagram of the spatial segmentation, channel rearrangement, and non-stepping convolution processing flow of the SPD-Conv module of the present invention; Figure 4 This is a schematic diagram of the top-down and bottom-up fusion paths of the bidirectional feature fusion module of the present invention. Detailed Implementation

[0022] This embodiment describes a lightweight detection method for small road targets, using manhole covers and speed bumps in a vehicle-mounted forward-looking road image as detection objects, and based on the YOLOv8n lightweight network. Manhole covers and speed bumps are just specific examples of small road targets; this invention can also be applied to potholes, road debris, damaged areas, and other road targets with a small pixel footprint in the image. The method sequentially completes the construction of a small road target detection dataset, the construction of a small road target detection network, the construction of a total loss function, model training, and online inference output, forming a complete implementation chain from data and model to engineering applications. Specifically, as... Figure 1 As shown, it includes the following steps: Step 1: Construct the preprocessed road small object detection dataset ,in, Indicates the first Zhang's road image, and They represent Height and width, express The number of channels; Represents the total number of road images; let The corresponding real label is ,in, express The number of small road targets in the middle. express The first in Category labels for small road goals. express The first in The true bounding box of each road's small target, and ,in, and express The center coordinates, and They represent Width and height.

[0023] In practice, a vehicle-mounted forward-facing camera and a handheld device are used to collect road videos containing manhole covers and speed bumps. Image frames are then extracted at fixed time intervals using a Python program. This fixed-time frame extraction reduces the high correlation between adjacent video frames, preventing a large number of similar images from being repeatedly used in training. The extracted images are then manually screened, retaining samples from different shooting distances, lighting conditions, road backgrounds, and target scales, while removing images that are significantly blurry, severely occluded, or have excessive information redundancy. This processing ensures that the road small target detection dataset covers the scale evolution process from far to near when a vehicle approaches the target, improving the model's generalization ability in real-world road scenarios.

[0024] The filtered road images are labeled with rectangular bounding boxes, with category labels including manhole covers and speed bumps. Each ground truth bounding box is represented by its center coordinates, width, and height, and together with its corresponding category label, constitutes the ground truth label.

[0025] In this embodiment, the input road image is uniformly adjusted to 640×640 pixels, and the pixel values ​​are normalized to the range of 0 to 1. During the training phase, Mosaic data augmentation and horizontal flipping strategies are used to increase the diversity of the combination of target quantity, target scale, and road background in the same batch. For specific road signs that are not suitable for flipping, horizontal flipping can also be turned off. The input size can also be adjusted to other sizes according to the camera resolution and the computing power of the embedded platform, but it should be ensured that the downsampling scale of the network can be divided evenly by the input size.

[0026] Table 1. Composition of the road small target detection dataset in this embodiment.

[0027] As shown in Table 1, this embodiment used a total of 2000 road images, including 1600 for training and 400 for validation. Further statistics show that targets with a relative area less than 1% of the image area account for 5.16%, and targets with a relative area less than 2% account for 16.26%, with an average aspect ratio of 3.09. This distribution indicates that the dataset does indeed contain a large number of road targets with low pixel percentages and flat shapes, making it suitable for validating the improvement effects of the SPD-Conv module, the bidirectional feature fusion module, and the normalized Wasserstein distance loss on small road targets.

[0028] Step 2: Construct a road small target detection network, including: a backbone feature extraction network, a bidirectional feature fusion module, and a detection head, and then... Processing is performed to obtain Corresponding prediction results ; like Figure 2 As shown, the road small target detection network adopts a single-stage detection structure, where the input road image only needs to undergo one forward propagation to simultaneously obtain the category prediction result and the bounding box prediction result. In this embodiment, YOLOv8n is chosen as the base network because it has a small number of parameters, a compact detection process, and is suitable for running on an in-vehicle embedded platform.

[0029] Step 2.1: [The text appears to be incomplete and contains several grammatical errors. A more accurate translation would require The input is processed in the backbone feature extraction network to obtain... The corresponding multi-scale backbone feature map set ,in, Indicates the first A skeleton feature map at various scales. This indicates the number of scales in the backbone feature map.

[0030] The backbone feature extraction network includes: an initial convolutional layer, an SPD-Conv module, and a C2f feature extraction module; when At that time, the first Initial feature maps As the first Individual backbone feature map Enter the first Spatial segmentation, channel rearrangement, and non-stepping convolution are performed in the SPD-Conv module to obtain the first... Downsampled feature maps at various scales ; Will Enter the first The feature extraction module processes the data to obtain the first C2f feature extraction module. Backbone feature map at various scales ; when At that time, the first Backbone feature map at various scales Enter the numbers in sequence The SPD-Conv module and the first The feature extraction module processes the data to obtain the first C2f feature extraction module. Downsampled feature maps at various scales Thus, by the first The output of the C2f feature extraction module is the first... Backbone feature map at various scales .

[0031] like Figure 3 As shown, for the first Each SPD-Conv module includes: a spatial partitioning unit, a channel rearrangement unit, and a non-staggered convolutional unit. Step 2.1.1: When At that time, the spatial division unit is based on the scale factor. , for the Initial feature maps Perform periodic sampling to obtain the first Each scale Each sub-feature map, where let the first... The first scale Line number The sub-feature graph of the column is denoted as , ; Step 2.1.2: The channel rearrangement unit will... Each sub-feature map is concatenated along the channel dimension to obtain Corresponding rearranged feature map ,in, This indicates a splicing operation.

[0032] Step 2.1.3: Non-stepping convolutional unit pairs Perform a convolution with a stride of 1 to obtain... Corresponding to the Downsampled feature maps at various scales Thus, by the first The output of the C2f feature extraction module is the first... Backbone feature map at various scales Non-stretching convolutional units use convolutions with a stride of 1 to perform feature fusion and channel compression on the rearranged feature maps, thereby reducing the spatial size through rearrangement. Subsequent convolutions no longer undertake spatial downsampling tasks, thus avoiding skipping pixels again.

[0033] The downsampled feature maps of each SPD-Conv module are then input into the corresponding C2f feature extraction module to complete local feature reuse and deep semantic extraction. This connection method makes the spatial resolution decrease step by step as the network deepens, while the number of channels and semantic expression capabilities are gradually enhanced.

[0034] The backbone feature extraction network is used to extract road target features stepwise from low-level texture to high-level semantics. Manhole covers and speed bumps at a distance occupy fewer pixels in the image; if stride convolutions or pooling operations with a stride greater than 1 are directly applied, some key pixels may be skipped during sampling. Therefore, this embodiment sets up SPD-Conv modules at multiple downsampling locations in the backbone feature extraction network, replacing the downsampling method of directly discarding pixels with spatial segmentation and channel rearrangement. Subsequent feature learning is then performed through the C2f feature extraction module to obtain... The corresponding multi-scale backbone feature map set .

[0035] Step 2.2: As Figure 4 As shown, the bidirectional feature fusion module includes: a channel adjustment unit, a top-down fusion unit, a bottom-up fusion unit, and a fusion output unit, and performs [further functions / functions]. Processing is performed to obtain Corresponding multi-scale fusion feature map ; The bidirectional feature fusion module does not simply concatenate all features at once, but rather establishes a repeatable information flow through channel adjustment units, top-down fusion units, bottom-up fusion units, and fusion output units. The top-down fusion path is used to supplement deep semantics to high-resolution features, while the bottom-up fusion path is used to supplement shallow localization information to low-resolution features; normalized weighted summation enables the network to automatically adjust the contribution of each input feature based on the training results.

[0036] Step 2.2.1: Extraction of Channel Adjustment Unit Superficial skeletal features in Mid-level backbone feature diagram and deep skeletal feature map and conduct separately Convolution processing adjusts the number of channels to the same number. , obtained the Channel adjustment feature map at each scale , .

[0037] Step 2.2.2: Top-down fusion unit adjusts feature map with deep channels As a deep intermediate feature map And using equation (1) to and Processing is performed to obtain Corresponding intermediate feature map : (1) In equation (1), Indicates an upsampling operation. This indicates a normalized weighted summation operation. This represents the convolutional processing of the fusion feature corresponding to the 4th scale in the top-down fusion unit; in Equation (1), the deep intermediate feature map is first upsampled to the same spatial size as the middle channel adjusted feature map, and then normalized, weighted, summed, and convolved. This process transfers the road target category semantics in the deep features to the middle layer, enabling the middle layer features to obtain stronger category discrimination ability while preserving positional details.

[0038] The top-down fusion unit utilizes equation (2) to and Processing is performed to obtain Corresponding shallow intermediate feature map : (2) In equation (2), Equation (2) represents the convolutional processing of the fusion features at the third scale; Equation (2) further upsamples the intermediate feature map and fuses it with the shallow channel adjustment feature map to form a shallow intermediate feature map. The shallow intermediate feature map has high spatial resolution and is suitable for describing the edge and center positions of distant manhole covers and speed bumps; the injection of deep semantics can reduce false detections caused by road textures, shadows and similar backgrounds.

[0039] Step 2.2.3: Bottom-up fusion unit merges shallow intermediate feature maps As a shallow fusion feature map And use equation (3) to , as well as Processing is performed to obtain Corresponding mid-layer fusion feature map : (3) In equation (3), This indicates a downsampling operation. This represents the convolutional processing of the fusion features corresponding to the 4th scale in the bottom-up fusion unit; and the shallow fusion feature map, after downsampling, participates in the fusion together with the mid-layer channel adjustment feature map and the mid-layer intermediate feature map. Compared to using only the top-down path, adding this bottom-up path can transfer the boundaries and geometric positions in the high-resolution features to the mid-layer again, reducing the information dilution caused by multiple upsampling or downsampling.

[0040] Bottom-up fusion unit utilizes formula (4) to , as well as Processing is performed to obtain Corresponding deep fusion feature map : (4) In equation (4), This represents the convolutional processing of the fused features at the 5th scale.

[0041] Step 2.2.4: The fusion output unit will... , and composition Corresponding multi-scale fusion feature map The three detection branches corresponding to the detection head are input separately. Outputting in set form can maintain the correspondence between the three scales, which facilitates the detection head to complete classification and bounding box regression on grids of different scales.

[0042] The bidirectional feature fusion module enables bidirectional interaction between backbone feature maps of different depths. Shallow backbone feature maps have high spatial resolution, containing target edges, contours, and location details; deep backbone feature maps have stronger category semantics but lower spatial resolution. By using a top-down fusion path to pass deep semantics to the shallow layer, and then using a bottom-up fusion path to feed back shallow localization information to the deep layer, feature fragmentation caused by target scale changes can be reduced, and the detection head can simultaneously obtain detailed and semantic information.

[0043] Step 2.3: [The text appears to be incomplete and contains several grammatical errors. A more accurate translation would require the full context.] The input is processed in the detection head to obtain... Corresponding prediction results This includes: category prediction results and bounding box prediction results .

[0044] Step 3: According to and its corresponding Construct a system that includes classification loss Distribution Focused Loss and normalized Wasserstein distance loss Total loss function .

[0045] In this embodiment, the bounding box prediction results of the detection head are first decoded into candidate predicted bounding boxes, and then the correspondence between the candidate predicted bounding boxes and the real bounding boxes is established according to the preset positive sample allocation rules. Subsequently, the two types of bounding boxes are modeled as Gaussian distributions, the second-order Wasserstein distance is calculated, and the normalized Wasserstein distance loss is obtained through a normalization factor related to the scale of the real target.

[0046] Step 3.1: Predict the bounding box results Decode to obtain the first n A set of candidate predicted bounding boxes ,in, express The number of candidate predicted bounding boxes, express The Middle There are candidate predicted bounding boxes, and ,in, and express The center coordinates, and They represent The width and height of the bounding box are determined; bounding box decoding is used to convert the discrete distance distribution or coordinate offset output by the detector head into the center coordinates, width, and height in the image coordinate system. The number of candidate predicted bounding boxes is usually greater than the number of real targets. Only predicted bounding boxes that have been assigned positive samples and established a correspondence with real targets participate in the subsequent localization loss calculation, thereby avoiding interference from a large number of background candidate boxes in bounding box regression.

[0047] Step 3.2: Predict based on category results Candidate predicted bounding box set and real labels The predicted bounding boxes of positive samples participating in the loss calculation are determined according to the preset positive sample allocation rules, as well as the true class and true bounding box corresponding to each predicted bounding box of positive samples. Step 3.3: Establish the first... Predicted bounding boxes for positive samples Predicted Gaussian distribution and the j A real bounding box True Gaussian distribution ,in, and Let A, B, C, D, and E represent the mean vector and covariance matrix of the predicted Gaussian distribution, respectively. and Let represent the mean vector and covariance matrix of the true Gaussian distribution, respectively, and we have: (5) (6) In equations (5) and (6), the center coordinates of the bounding box form the mean vector of a Gaussian distribution, and the squares of the width and height of the bounding box, after being scaled proportionally, form the diagonal covariance matrix. After adopting this mapping, the central region of the bounding box has a higher distribution weight, and the weight of the region near the boundary gradually decreases. Therefore, the comparison between the predicted box and the true box no longer depends solely on whether there is an overlapping region, but also considers the continuous differences in center position, width, and height.

[0048] Step 3.4: Calculate the second-order Wasserstein distance between the predicted Gaussian distribution and the true Gaussian distribution using equation (7). : (7) Step 3.5: Calculate using equation (8) The Middle The scale of small road goals Thus, by using equation (9), we can obtain The Middle Normalization factor for individual road goals : (8) (9) Equation (8) uses the square root of the product of the width and height of the true bounding box as the target scale. The geometric mean is a linear scale, which is symmetrical when the width and height are exchanged, and the square root of the quadratic growth of the area is compressed, which can reduce the risk that large-scale targets occupy too high loss weights in training.

[0049] In equation (9), The scale sensitivity adjustment coefficient is represented by equation (9). The scale sensitivity adjustment coefficient is used to control the overall size of the normalization factor. The scale sensitivity adjustment coefficient can be adjusted on the validation set to balance the sensitivity of small target localization and training stability.

[0050] Step 3.6: Construct using equation (10) and Normalized Wasserstein distance loss between : (10) Step 3.7: Construct the normalized Wasserstein distance loss using equation (11) : (11) In equation (11), This represents the set of positive sample correspondences. Indicates the number of positive samples; Indicates the first The first road image Predicted bounding boxes for each positive sample With the j The true bounding box of each road's small objective A set of positive sample correspondences is established between them.

[0051] Step 3.8: Based on the predicted category and the true category, calculate the classification loss using binary cross-entropy loss. ; Step 3.9: Based on the predicted bounding box and the actual bounding box, calculate the distributed focusing loss using the distributed focusing loss method. ; Step 3.10: Construct the total loss function using equation (12) : (12) In equation (12), , and They represent , and The weights are used to balance the three optimization objectives of classification, boundary distribution, and normalized Wasserstein distance. If the weights are too large, the corresponding loss may dominate the training, while if the weights are too small, the technical feature may not be fully utilized. Therefore, they can be adjusted based on the precision, recall, and mean precision of the validation set.

[0052] Step 4: Utilize the total loss function Backpropagation and parameter updates are performed on the road small target detection network until the total loss function is reached. The model converges, resulting in a successfully trained small road target detection model.

[0053] Step 5: Input the road image to be detected into the trained road small target detection model for processing to obtain the category prediction results and bounding box prediction results of the road small targets. After confidence filtering and non-maximum suppression processing, the category, confidence and bounding box location information of the road small targets are output.

[0054] In this embodiment, an electronic device includes a memory and a processor. The memory stores a program that supports the processor in executing the above-described method, and the processor is configured to execute the program stored in the memory.

[0055] In this embodiment, a computer-readable storage medium stores a computer program, which is executed by a processor to perform the steps of the above method.

[0056] In this embodiment, training was performed on an NVIDIA GeForce RTX 4080 graphics processor, using Python 3.10, PyTorch 2.1.1, CUDA 11.8, and cuDNN 8. To ensure fair comparison of different network structures, no pre-trained weights were loaded during training. The training epochs were set to 200, and the optimization algorithm employed stochastic gradient descent with an initial learning rate of 0.01 and a batch size of 16. Mosaic data augmentation, horizontal flipping, and label smoothing were also used. The above parameters are the actual settings for this embodiment and do not constitute a limitation of the present invention.

[0057] In each training round, the training set samples are input into the network in batches. The total loss function is calculated according to Equation (12) and the network parameters are updated. After each training round, precision, recall, mAP@0.5 and mAP@[0.5:0.95] are calculated on the validation set. Precision represents the correctness of the prediction results, recall represents the completeness of the target being correctly detected, mAP@0.5 represents the average detection accuracy when the cross-union threshold is 0.5, and mAP@[0.5:0.95] represents the comprehensive average detection accuracy when the cross-union threshold is in the range of 0.5 to 0.95.

[0058] Table 2 Ablation Experiment Results of This Example

[0059] As shown in Table 2, adding the SPD-Conv module improved the recall from 0.801 to 0.816 and the mAP@0.5 from 0.850 to 0.876, indicating that spatial segmentation and channel rearrangement can reduce feature loss of small road targets during the downsampling stage. Adding the bidirectional feature fusion module improved the precision to 0.914, indicating that bidirectional cross-scale information transmission helps reduce false detections caused by complex road backgrounds. Adding the normalized Wasserstein distance loss alone improved the precision to 0.933 and the mAP@0.5 to 0.869, indicating that this loss can improve the localization feedback of small targets. The mAP@[0.5:0.95] of the complete model reached 0.482, the highest value in the ablation experiment, indicating that the three improvements have a synergistic effect under rigorous localization evaluation.

[0060] To verify the detection performance of the complete model of this invention, YOLOv5, YOLOv8n, YOLOv8s, and RT-DETR were selected as comparison models. YOLOv5 is a single-stage object detection model; YOLOv8n and YOLOv8s are lightweight and miniaturized models of the YOLOv8 series, respectively; and RT-DETR is a real-time object detection model based on the Transformer architecture. All models were trained and tested under the same dataset, training strategy, and testing conditions. The results are shown in Table 3.

[0061] Table 3 Performance comparison of this embodiment with other detection models

[0062] As shown in Table 3, the accuracy of the complete model of this invention reaches 0.932, and the mAP@0.5 reaches 0.872, both higher than the compared YOLOv5, YOLOv8n, YOLOv8s, and RT-DETR. Its parameter count is 6.26 M, and its computational cost is 18.2 GFLOPs, which, while higher than the basic YOLOv8n, is significantly lower than YOLOv8s and RT-DETR. Therefore, this invention does not achieve detection performance by simply increasing the network size, but rather improves the detection effect of small road targets by utilizing the SPD-Conv module, the bidirectional feature fusion module, and the normalized Wasserstein distance loss while maintaining a relatively lightweight approach.

Claims

1. A lightweight detection method for small target recognition scenarios on roads, characterized in that, Includes the following steps: Step 1: Obtain the preprocessed first... Zhang Road Image and their corresponding real tags ; Step 2: Construct a road small target detection network, including: a backbone feature extraction network, a bidirectional feature fusion module, and a detection head, and then... Processing is performed to obtain Corresponding prediction results ; Step 3: According to and Construct a system that includes classification loss Distribution Focused Loss and normalized Wasserstein distance loss Total loss function ;in, It is based on The normalization factor for the road target calculated from the width and height of the true bounding box of the road target, and... The second-order Wasserstein distance between the predicted Gaussian distribution of the predicted bounding box and the true Gaussian distribution of the true bounding box is obtained. Step 4: Utilize Backpropagation and parameter updates are performed on the road small target detection network until... The convergence process yields the trained road small object detection model, which is used to process the road image to be detected, outputting the category, confidence score, and bounding box location information of the road small objects.

2. The lightweight detection method for small target recognition scenarios on roads according to claim 1, characterized in that, Step 1 includes: Construct a preprocessed road small object detection dataset ,in, Indicates the first preprocessed step Zhang's road image, and They represent Height and width, express The number of channels; Represents the total number of road images; let The corresponding real label is ,in, express The number of small road targets in the middle. express The first in Category labels for small road goals. express The first in The true bounding box of each road's small target, and ,in, and express The center coordinates, and They represent Width and height.

3. The lightweight detection method for small target recognition scenarios on roads according to claim 2, characterized in that, Step 2 includes: Step 2.1: [The text appears to be incomplete and contains several grammatical errors. A more accurate translation would require The input is processed in the backbone feature extraction network to obtain... The corresponding multi-scale backbone feature map set ,in, Indicates the first A skeleton feature map at various scales. Indicates the number of scales in the backbone feature map; Step 2.2: The bidirectional feature fusion module... Processing is performed to obtain Corresponding multi-scale fusion feature map ; Step 2.3: [The text appears to be incomplete and contains several grammatical errors. A more accurate translation would require the full context.] The input is processed in the detection head to obtain... Corresponding prediction results This includes: category prediction results and bounding box prediction results .

4. The lightweight detection method for small target recognition scenarios on roads according to claim 3, characterized in that, The backbone feature extraction network in step 2.1 includes: an initial convolutional layer, One SPD-Conv module and One C2f feature extraction module; Initial convolutional layer pairs Perform convolution processing to obtain the first... Initial feature maps ; when At that time, the first Initial feature maps As the first Individual backbone feature map Enter the first Spatial segmentation, channel rearrangement, and non-stepping convolution are performed in the SPD-Conv module to obtain the first... Downsampled feature maps at various scales ; Will Enter the first The feature extraction module processes the data to obtain the first C2f feature extraction module. Backbone feature map at various scales ; when At that time, the first Backbone feature map at various scales Enter the numbers in sequence The SPD-Conv module and the first The feature extraction module processes the data to obtain the first C2f feature extraction module. Downsampled feature maps at various scales Thus, by the first The output of the C2f feature extraction module is the first... Backbone feature map at various scales .

5. The lightweight detection method for small target recognition scenarios on roads according to claim 4, the first... Each SPD-Conv module includes: Spatial partitioning units, channel rearrangement units, and non-stride convolution units are obtained, and the following steps are followed: ; Step 2.1.1: When At that time, the spatial division unit is based on the scale factor. , for the Initial feature maps Perform periodic sampling to obtain the first Each scale Each sub-feature map, where let the first... The first scale Line number The sub-feature graph of the column is denoted as , ; Step 2.1.2: The channel rearrangement unit will... Each sub-feature map is concatenated along the channel dimension to obtain Corresponding rearranged feature map ,in, Indicates a splicing operation; Step 2.1.3: Non-stepping convolutional unit pairs Perform a convolution with a stride of 1 to obtain the first... Downsampled feature maps at various scales .

6. The lightweight detection method for small target recognition scenarios on roads according to claim 5, characterized in that, The bidirectional feature fusion module in step 2.2 includes: a channel adjustment unit, a top-down fusion unit, a bottom-up fusion unit, and a fusion output unit. Step 2.2.1: Extraction of Channel Adjustment Unit Superficial skeletal features in Mid-level backbone feature diagram and deep skeletal feature map and conduct separately Convolution processing adjusts the number of channels to the same number. , obtained the Channel adjustment feature map at each scale , ; Step 2.2.2: Top-down fusion unit adjusts feature map with deep channels As a deep intermediate feature map And using equation (1) to and Processing is performed to obtain Corresponding intermediate feature map : (1) In equation (1), Indicates an upsampling operation. This indicates a normalized weighted summation operation. This represents the convolutional processing of the fusion feature corresponding to the 4th scale in the top-down fusion unit; The top-down fusion unit utilizes equation (2) to and Processing is performed to obtain Corresponding shallow intermediate feature map : (2) In equation (2), Convolutional processing to represent the fused features at the third scale; Step 2.2.3: Bottom-up fusion unit merges shallow intermediate feature maps As a shallow fusion feature map And use equation (3) to , as well as Processing is performed to obtain Corresponding mid-layer fusion feature map : (3) In equation (3), This indicates a downsampling operation. This represents the convolutional processing of the fusion feature corresponding to the 4th scale in the bottom-up fusion unit; Bottom-up fusion unit utilizes formula (4) to , Processing is performed to obtain Corresponding deep fusion feature map : (4) In equation (4), Convolutional processing to represent the fused features at the 5th scale; Step 2.2.4: The fusion output unit will... , and composition Corresponding multi-scale fusion feature map .

7. The lightweight detection method for small target recognition scenarios on roads according to claim 3, characterized in that, Step 3 includes: Step 3.1: Predict the bounding box results Decode to obtain the first n A set of candidate predicted bounding boxes ,in, express The number of candidate predicted bounding boxes, express The Middle There are candidate predicted bounding boxes, and ,in, and express The center coordinates, and They represent Width and height; Step 3.2: Predict based on category results Candidate predicted bounding box set and real labels The predicted bounding boxes of positive samples participating in the loss calculation are determined according to the preset positive sample allocation rules, as well as the true class and true bounding box corresponding to each predicted bounding box of positive samples. Step 3.3: Establish the first... Predicted bounding boxes for positive samples Predicted Gaussian distribution and the A real bounding box True Gaussian distribution ,in, and They represent The predicted mean vector and covariance matrix of the Gaussian distribution. and They represent The mean vector and covariance matrix of the true Gaussian distribution are given, and: (5) (6) Step 3.4: Calculate the second-order Wasserstein distance between the predicted Gaussian distribution and the true Gaussian distribution using equation (7). : (7) Step 3.5: Calculate using equation (8) The Middle The scale of small road goals Thus, by using equation (9), we can obtain The Middle Normalization factor for individual road goals : (8) (9) In equation (9), This represents the scale sensitivity adjustment coefficient; Step 3.6: Construct using equation (10) and Normalized Wasserstein distance loss between : (10) Step 3.7: Construct the normalized Wasserstein distance loss using equation (11) : (11) In equation (11), This represents the set of positive sample correspondences. Indicates the number of positive samples. Indicates the first Zhang Road Image The Middle Predicted bounding boxes for positive samples With the j A real bounding box A set of positive sample correspondences established between them; Step 3.8: Based on the predicted category and the true category, calculate the classification loss using binary cross-entropy loss. : Step 3.9: Based on the predicted bounding box and the actual bounding box, calculate the distributed focusing loss using the distributed focusing loss method. ; Step 3.10: Construct the total loss function using equation (12) : (12) In equation (12), , and They represent , and The weight.

8. An electronic device, comprising a memory and a processor, characterized in that, The memory is used to store a program that supports the processor in executing the lightweight detection method for small road target recognition scenarios according to any one of claims 1-7, and the processor is configured to execute the program stored in the memory.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is run by the processor, it performs the steps of the lightweight detection method for small target recognition scenarios on roads as described in any one of claims 1-7.