Shielding target detection method based on YOLOv5s

By introducing dynamic snake convolution and sparse attention mechanisms into the YOLOv5s model, the problem of low accuracy in occluded target detection in autonomous driving is solved, achieving higher detection accuracy and efficiency.

CN121746684APending Publication Date: 2026-03-27XIAMEN UNIV OF TECH
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-23
Publication Date
2026-03-27

AI Technical Summary

Technical Problem

In autonomous driving scenarios, especially on urban roads, target occlusion leads to a decrease in detection accuracy, and existing models are prone to missed detections and false detections.

Method used

The YOLOv5s model is optimized using dynamic snake convolution (DSConv) and dynamic sparse attention (DSA). Dynamic snake convolution fits the shape of the occluded target, while dynamic sparse attention focuses on the occluded region, thereby enhancing the model's ability to detect occluded targets.

Benefits of technology

It improves the detection accuracy of occluded targets, reduces missed detections and false detections, and enhances detection performance in complex scenarios, especially in scenarios with small target occlusion and multiple vehicle occlusions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121746684A_ABST
    Figure CN121746684A_ABST
Patent Text Reader

Abstract

The invention discloses an occlusion target detection method based on YOLOv5s, and the method specifically comprises the steps: constructing a C3DSConv module formed by fusing a dynamic snakelike convolution DSConv module and a C3 module, and embedding the C3DSConv module into a backbone network of the YOLOv5s; constructing a dynamic sparse attention DSA module and embedding the DSA module into the tail end of the backbone network to obtain an optimized occlusion target detection model; and inputting the preprocessed data set into the occlusion target detection model for training and detection. According to the method, the appearance of the sheltered target is fitted through DSConv, DSA focuses on the sheltered area, the detection precision of the sheltered target in a complex scene is improved, and missing detection and error detection are reduced.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The application relates to the technical field of automatic driving target detection, in particular to a YOLOv5s-based occluded target detection method, which improves the detection capability of occluded targets through a dynamic snake convolution and a dynamic sparse attention optimization model. BACKGROUND

[0002] In the automatic driving scene, compared with provincial roads, viaducts and other roads, the situation of urban roads is more complex. Not only the number of targets to be detected on the road increases, but also the targets gather to cause mutual occlusion between the targets. Due to the occlusion of the targets, the target features are incomplete, which causes the model to miss detection and mis-detect the targets, thereby reducing the detection accuracy of the model in complex scenes. SUMMARY

[0003] In view of the above problems, in order to adapt to the deformation of the target, the deformable convolution can be used to adapt to the non-rigid transformation of the target, thereby improving the accuracy of the occluded target detection. Meanwhile, in order to make the model pay more attention to the occluded target itself and reduce the interference of the surrounding targets and the background, the application adds an attention mechanism in the Backbone to enrich the detailed features of the model and pay attention to the occluded target. The specific steps include: a C3_DSConv module of a dynamic snake convolution DSConv module and a C3 module is constructed and embedded into a backbone network of a YOLOv5s; a dynamic sparse attention DSA module is constructed and embedded into the end of the backbone network, so as to obtain an optimized occluded target detection model; a preprocessed data set is input into the occluded target detection model for training and detection.

[0004] The above method fits the shape of the occluded target through the DSConv, focuses on the occluded area through the DSA, improves the detection accuracy of the occluded target in the complex scene, and reduces the missed detection and mis-detection.

[0005] The constraint deformation mechanism of the C3_DSConv module: the DSConv is used to improve the traditional C3 module, and when the DSConv stretches and deforms the convolution kernel in the x-axis and y-axis directions, the cumulative constraint of the offset ∈[-1,1] is used to make the convolution kernel maintain a linear structure and avoid the deviation of the receptive field from the target. For example, a 3x3 convolution kernel can cover a 9x9 range after being deformed by the DSConv, and adapt to an elongated occluded target (such as a pedestrian profile occluded by a power pole). Experiments show that, compared with the traditional deformable convolution, the DSConv can effectively control the receptive field within the target range in the small target occlusion scene, and the Recall of the small target occlusion is improved by 2.2%.

[0006] In a specific implementation, DSConv calculates non-integer coordinate feature values through bilinear interpolation to ensure the feature extraction accuracy of the deformed convolution kernel, and solves the problem of too large receptive field of traditional deformable convolution in small target occlusion scenarios. In actual application scenarios, such as city street monitoring, small traffic sign detection occluded by branches, the sign contour can be accurately located, key features can be extracted, and false positives and missed detections can be avoided.

[0007] The double-layer routing attention mechanism of the DSA module: the input feature map (HxWxC) is divided into SxS regions (such as 16x16), and query Q, key K, and value V are generated through linear mapping to calculate the region affinity matrix , and the key regions are filtered through the top-k operation. This mechanism discards the traditional full calculation method when calculating the region correlation, and only focuses on the key regions, greatly reducing the calculation amount, while ensuring the performance of the model and improving the calculation efficiency.

[0008] The local context enhancement term LCE(V) is introduced, which extracts neighborhood features through 3x3 convolution to enhance the local feature representation of the occluded target. Compared with traditional attention mechanisms such as SE and CBMA, the calculation amount is reduced by 40%, and the mAP50 is improved by 0.5%. In complex scene images, it can quickly focus on the occluded target region, highlight the target features, and suppress background interference. For example, in the multi-vehicle occlusion scene of a parking lot, it can accurately identify the brand and model of the partially occluded vehicle.

[0009] Cooperative optimization design of Backbone: In the Bottleneck of the C3 module, the first ConvBnSiLU layer is replaced by DSConv to form the C3_DSConv module: the input feature map first extracts the basic features through ConvBnSiLU, and then extracts the deformation features through DSConv. After the fusion of the two paths, the feature integrity of the occluded target is improved. In the case of large target occluding small targets, the overall features of large targets and the local deformation features of small targets can be captured simultaneously, improving the detection accuracy. Compared with the original C3 module, the detection accuracy of the combined scene of large and small targets is improved by 1.5%.

[0010] Embedding the DSA module before the SPPF module, the feature map is screened in coarse-grained regions and interacts with fine-grained tokens, dynamically focusing on the occluded region. Compared with the original model, the detection accuracy of Car, Pedestrian, and Cyclist is improved by 0.6%, 1.1%, and 1.3%, respectively. In actual road scenarios, whether it is a car with part of the body occluded by a building, a pedestrian occluded by a crowd, or a bicycle occluded by another vehicle, the target features can be captured more sensitively, improving the detection performance.

[0011] According to a second aspect of the present application, a computer program product is provided, on which one or more computer programs are stored, which, when executed by a computer processor, implement the method described above.

[0012] The one or more technical solutions described above in the embodiments of the present application have at least one of the following technical effects: Multi-scale occluded target adaptability: the constraint deformation mechanism of DSConv effectively fits the linear features of small occluded targets, and the Recall of small occluded targets on the KITTI dataset is improved by 2.2%; in various complex scene tests, the detection accuracy of different scale occluded targets is higher than that of similar models, such as in the small target dense occluded urban alley scene, the detection accuracy is 12% higher than that of traditional methods.

[0013] Attention focusing efficiency: DSA reduces background interference through dynamic sparse calculation, and the Precision is improved by 0.7% and the parameter amount is reduced by 35%; in large scene monitoring images, it can quickly filter out irrelevant background information and focus attention on the occluded target, and compared with the traditional attention mechanism, the processing speed is improved by 30%.

[0014] Model performance improvement: ablation experiments show that the cooperation of C3_DSConv and DSA makes mAP50 reach 91.7%, which is better than existing models such as YOLOv7, and the missed detection rate is reduced by 18%. In practical application deployment, on the edge device with limited resources, it can still maintain efficient and accurate detection performance, meeting the strict requirements of real-time and accuracy in the fields of autonomous driving, security monitoring, etc. BRIEF DESCRIPTION OF DRAWINGS

[0015] The accompanying drawings are included to provide a further understanding of embodiments and are incorporated in and constitute a part of this specification. The drawings illustrate embodiments and, together with the description, serve to explain the principles of the present application. Other embodiments and many of the intended advantages of the present application will be readily appreciated as the same becomes better understood by reference to the following detailed description when considered in connection with the accompanying drawings. The elements of the drawings are not necessarily to scale relative to each other. Like reference numerals designate corresponding similar parts.

[0016] Figure 1 is a flowchart of a YOLOv5s-based occluded target detection method according to an embodiment of the present application; Figure 2 is a DSA dynamic sparse attention mechanism structure diagram of a YOLOv5s-based occluded target detection method according to an embodiment of the present application; Figure 3is a structural diagram of a blocked target detection model YOLOv5s-C3_DSConv-DSA of a blocked target detection method based on YOLOv5s according to an embodiment of the present application; Figure 4 is a C3_DSConv and C3 comparison structural diagram of a blocked target detection method based on YOLOv5s according to an embodiment of the present application; Figure 5 is a detection performance difference comparison diagram of a blocked target detection method based on YOLOv5s and the original model YOLOv5s according to an embodiment of the present application; Figure 6 is a structural schematic diagram of a computer system of an electronic device suitable for implementing an embodiment of the present application. DETAILED DESCRIPTION

[0017] The present application will be further described below in conjunction with the drawings and embodiments. It can be understood that the specific embodiments described herein are only used to explain the related application, and not to limit the application. In addition, it should be noted that only the parts related to the application are shown in the drawings for ease of description.

[0018] It should be noted that the embodiments in the present application and the features in the embodiments can be combined with each other without conflict. The present application will be described in detail below with reference to the drawings and in conjunction with the embodiments.

[0019] As shown in Figures 1 to 3 , a blocked target detection method based on YOLOv5s, characterized in that it comprises the following steps: S1, constructing a C3_DSConv module of a dynamic snake convolution DSConv module and a C3 module fusion, and embedding the main network of YOLOv5s; S2, constructing a dynamic sparse attention DSA module embedded at the end of the main network to obtain an optimized blocked target detection model; S3, inputting the preprocessed data set into the blocked target detection model for training and detection.

[0020] In step S2, the dynamic snake convolution (DSConv) is improved based on the traditional snake convolution to solve the problems of non-rigid deformation and feature deficiency of the blocked target as follows: The dynamic offset constraint mechanism is to avoid the convolution kernel from deviating too much from the residual features of the blocked target. The DSConv introduces a "blocked perception factor " ( ∈[0.5,1]) whose value is calculated from the pixel ratio of the target blocked area (the more serious the blocking is, the The smaller the value, the better the convolution kernel can identify occluded parts of the target by dynamically adjusting the deformation range. Specifically, in the case of slight occlusion, the convolution kernel deforms moderately to capture the complete target outline; while in the case of severe occlusion, the deformation amplitude of the convolution kernel is reduced, focusing on the remaining features in the occluded area, avoiding confusion caused by excessive deformation. This mechanism enables DSConv to better handle the situation when the target is occluded, reducing the feature loss problem caused by excessive convolution kernel deformation, thereby improving the target recognition performance in severely occluded scenes.

[0021] offset The scope is from Dynamic adjustment: when ≥0.8 (slight occlusion): ∈[-1,1], the convolution kernel is moderately deformed to capture the complete outline of the target (such as the partially occluded side of a vehicle); when <0.8 (severe occlusion): ∈[- , The deformation range is narrowed to focus on residual features (such as the head contour of an occluded pedestrian). The above threshold determination solves the feature confusion problem caused by the excessively large receptive field in traditional serpentine convolution under severe occlusion. Experiments show that the recall of small objects is improved by 3.1% in severely occluded scenarios.

[0022] Multi-directional deformation fusion addresses the potential oblique features of occluded targets (such as pedestrian limbs obscured by oblique railings). DSConv adds 45° and 135° oblique deformation dimensions to better capture obliquely occluded target features. The coordinate calculation is as follows: 45° direction: The coordinates of the (i+c)th grid are ( + ), and This represents the coordinates of the current convolution kernel, where c is a constant factor of the offset, representing the displacement of the convolution kernel in that direction. and They represent respectively The components of the unit direction vectors along the x-axis and y-axis. Indicates in The dynamic offset calculated in the direction represents the offset adjusted according to the target occlusion situation (such as target deformation, degree of occlusion, etc.).

[0023] 135° direction: The coordinates of the (j+c)th grid are ( ),in, and For the diagonal offset, its weight is dynamically assigned by the region importance score output by the DSA module (the diagonal occlusion region weight is raised to 0.6).

[0024] In many real-world scenarios, the occluder is not always completely horizontal or vertical, but appears at a certain diagonal angle. The selection and can effectively capture the common diagonal occlusion mode. Moreover, and are symmetric angles. In two-dimensional space, these two cover most of the possibilities of diagonal occlusion. pointing to the upper right, while pointing to the upper left, can well capture the target deformation caused by the occluder (such as diagonal railings, walls, etc.).

[0025] The deformation range of DSConv is limited by the "occlusion region heat map" output by the DSA module in conjunction with the attention mechanism: only in the region where the heat map value is greater than or equal to 0.5, the offset is calculated , avoiding invalid deformation on background regions such as trees and buildings. This linkage mechanism reduces the false detection rate caused by background interference by 8%, and improves the model inference speed by 15%.

[0026] The coordinate calculation of DSConv is still based on a 3x3 convolution kernel, and the center coordinate is The deformation formula in the x-axis and y-axis directions is integrated into the original basis with dynamic constraints, and finally through bilinear interpolation , ensuring the feature accuracy of non-integer coordinates.

[0027] The implementation process of DSConv is as follows: First, the coordinate calculation of DSConv, given the standard 2D convolution coordinates K, the center coordinate is . A convolution kernel with a dilation rate of 1 The coordinate calculation method is shown in the following formula: ; Then in the x-axis direction, the position of each grid in the convolution kernel S can be expressed as: , where ={0,1,2,3,4} represents the horizontal distance from the center grid. The selection of the position of each grid in the convolution kernel S is a cumulative process, starting from the center position , the position away from the center grid depends on the position of the previous grid: An offset is added relative to Therefore, the offset needs to be summed ∑, so as to ensure that the convolution kernel meets the linear morphological structure. The calculation in the x-axis direction is shown in the following formula: ; Then in the y-axis direction, the position of each grid in the convolution kernel S can be expressed as: where {0, 1, 2, 3, 4} represents the vertical distance from the center grid. The selection of the position of each grid in the convolution kernel S is also a cumulative process, starting from the center position , the position away from the center grid depends on the position of the previous grid: relative to an offset is added. Therefore, the offset also needs to be summed ∑, so as to ensure that the convolution kernel meets the linear morphological structure. The calculation in the y-axis direction is shown in the following formula: ; Since the offset ∆ is usually a decimal number, bilinear interpolation is needed to calculate the position of the convolution kernel: ; S represents the decimal position, S' represents the enumeration of all integer space positions, B represents the bilinear interpolation kernel, which is decomposed into two one-dimensional kernels. The calculation is shown as follows: ; The Backbone of YOLOv5s adopts an improved CSPDarknet53. Among them, the C3 (CSPC3) module is its main innovation, which is composed of three ConvBnSiLU modules and a Bottleneck module. The ConvBnSiLU module has the same basic structure, including convolution layer, BN layer and SiLU activation function, only the size and number of channels of the convolution kernel are different. In the design of the C3 module, the initial step is to decompose the input feature map into two parallel paths. One path contains a single ConvBnSiLU (convolution-batch normalization-SiLU activation function) module, while the other path contains a series of ConvBnSiLU modules and Bottleneck modules. The adoption of such decomposition and cascading operation aims to effectively reduce information loss and improve the expression ability of features. In the Bottleneck module, dimension reduction is first performed by convolution, and then Convolution to extract high-level feature representation. At the same time, the residual module is introduced in the bottleneck to effectively fuse the original features and enhance the stability of the training process. Then, the output feature maps of the two parallel paths are Contacted, and they are spliced into a new feature map. Finally, the fused feature map is input into the ConvBnSiLU module for further processing of the feature map to adapt it to the needs of the target detection task.

[0028] Although the C3 structure in the Backbone of YOLOv5s performs well in improving the accuracy of target detection, it still has problems in dealing with occluded targets. The Bottleneck module in the C3 structure can only operate on one feature map and cannot handle multiple feature maps simultaneously. In addition, it uses a normal convolution kernel as the standard convolution kernel, which cannot adapt to the target deformation. Especially when small targets far away are occluded, the receptive field is larger than the target. To solve this problem, the present application uses dynamic snake convolution instead of the original convolution, so that the C3 structure can better handle occluded targets. As shown in Figure 4 .

[0029] According to Figure 4 , the adjustment of the present application is mainly concentrated in the Bottleneck part of the C3 module. The present application replaces the original first ConvBnSiLU layer with a DSConv module to enhance the ability of the C3 module in extracting the features of occluded targets. Specifically, when the output feature map of the previous layer passes through the Bottleneck module, it first passes through a basic ConvBnSiLU module for feature extraction, and then passes through a DSConv module to extract the features of the target shape in the image, which helps to better adapt to the deformed target. Through such adjustment, the ability of the Backbone in extracting the features of occluded targets can be improved, thereby providing a more reliable basis for detecting occluded targets in downstream tasks.

[0030] The dynamic sparse attention DSA module constructed in step S2 receives the feature map of the previous layer, divides the feature map into grids of equal size, and obtains the features of each region from the grids, generates query tensors, key tensors and value tensors through linear mapping, and the specific formula is as follows: ; Where Q represents the query tensor, K represents the key tensor, V represents the value tensor, X represents the received feature map of the previous layer, represents the local features after region division, , and These represent the linear transformation matrices of the three tensors, respectively.

[0031] The correlation matrix between regions is calculated using the query tensor, key tensor, and value tensor; further, a top-k operation is performed on the correlation matrix to obtain the routing index matrix. And according to the routing index matrix The formula for filtering out the top n regions with the highest related value is as follows: ; ; in, Represents the regional affinity matrix. This represents a regionalized query tensor. Representing the regionalized bond tensor, the topkIndex() function represents the expression for the matrix. For each row, perform a top-k selection and return the indexes of the k elements with the largest values ​​in each row.

[0032] Using the routing index matrix Dynamic sparse self-attention computation is performed to obtain features containing attention, and local context enhancement terms are also introduced. The specific steps include: According to the routing index matrix Perform on K tensor and V tensor The data collection operation only yields data from the routing area. and , Q tensor, tensor and The tensors are used to perform dot product calculations, and then the softmax activation function is applied to obtain features that include attention. At the same time, a local context enhancement term LCE(V) is introduced to enhance the local context of the feature vector at each position. The specific formula is expressed as follows: ; ; in, and represents the key and value of the key region filtered by index, respectively; O represents the final output feature that combines sparse attention features and local context enhancement; Attention represents attention calculation; and LCE(V) represents local context enhancement.

[0033] In order to enhance the attention of the model to the occluded target and reduce the interference of background information, the application adds a DSA (Dynamic Sparse Attention) dynamic sparse attention mechanism in the Backbone. This makes the model pay more attention to the features of the occluded target and enhances the existence of the occluded target features. Through the DSA dynamic sparse attention mechanism, the target detection model can filter out the key-value pairs irrelevant to the query at the coarse-grained region level, thereby improving the attention ability to the occluded target. This improvement not only integrates the advantages of global self-attention, but also balances the dynamic sparsity between computational efficiency and model performance. Overall, this improvement provides more sensitive information and feature fusion for the model when dealing with occluded targets, and improves the performance of the occluded target detection model.

[0034] In the improved Backbone structure, the application embeds the DSA module before the SPPF module. When the feature map of the previous layer is input into the DSA module, the DSA module first divides the feature map into equal-sized grids to obtain the features of each region. Then, query (Q), key (K) and value (V) tensors are generated through linear mapping, which are used to calculate the correlation degree matrix between regions. Then, top-k operation is performed on the correlation degree matrix, and the first region with the maximum value related to it is selected according to the routing index. Finally, dynamic sparse self-attention calculation is performed to obtain the features containing attention, and a local context enhancement term is introduced to improve the model performance.

[0035] In step S3, the specific method of obtaining the data set is as follows: Data acquisition scene: collect image / video data containing complex traffic environments such as urban roads, parking lots, and highways, focusing on covering scenes such as mutual occlusion of targets, small target occlusion (such as distant vehicles being occluded by buildings), and dense occlusion (such as pedestrians in traffic). Take the KITTI dataset as an example, which contains 7481 training images and 7518 test images, covering target categories such as cars, pedestrians, and cyclists.

[0036] Data labeling specification: use tools such as LabelImg to label targets, and the labeling content includes: Target category (such as Car, Pedestrian, Cyclist); Bounding box coordinates (xmin, ymin, xmax, ymax); Occlusion degree label (such as no occlusion, partial occlusion, and severe occlusion); Target size label (small target: area < 32x32 pixels, medium target: 32x32-96x96 pixels, large target > 96x96 pixels).

[0037] Dataset division: divided into training set, validation set and test set in the ratio of 7:1.5:1.5, and the distribution of occlusion scenes in each set is balanced.

[0038] According to a preferred embodiment of the present application, as shown in Figure 3 The data input size is a RGB color image of Bx3xHxW, which is sent to the Backbone after normalization or preprocessing; the Backbone feature extraction part is that the image enters the first convolution module Conv, and the basic low-level features (size reduction and channel number increase) are output, and then a Conv+C3 module is used to output the feature map with enhanced local spatial details.

[0039] A Conv+C3_DSConv module is used to output the medium resolution medium semantic feature map, at this time the module uses depth separable convolution to extract medium-level semantic features; then a Conv+C3_DSConv module is used to further extract semantic features, and a feature map with further reduced resolution and stronger semantics is output; The feature map enters the Conv+C3_DSConv module again to output the features close to high-order semantics but still maintaining part of the spatial structure, and a DSA module is used to output a feature map with stronger semantics, larger receptive field and more accurate position, and finally the Backbone network outputs the feature map as a deep semantic feature input to the Neck network.

[0040] In the Neck network, the deep feature map enters a Conv convolution module for channel reduction or feature shape adjustment, and then is up-sampled; the up-sampled feature map is spliced (Contact) with the medium-level feature map of the previous layer of DSA to form a fusion map with high semantics and medium spatial details; a C3 module is further used for feature fusion to output the fused feature map.

[0041] The fused feature map enters a Conv to adjust the channel and continue to be up-sampled, and is spliced (Contact) with the feature map of the shallower Backbone, and then enters a C3 module for fusion to output a high-resolution feature map with weak semantics but rich details; The high-resolution fused feature map is down-sampled, spliced again with the fused feature of the previous layer, further fused and supplemented with semantic information by a C3 module, and then down-sampled and spliced again with the original deep feature, and finally enters a C3 module for fusion.

[0042] The three outputs in the Neck network enter the Detect detection head respectively, and each Detect module outputs the target frame prediction, center position (x, y), size (w, h), confidence conf and class probability cls on each anchor.

[0043] According to another preferred embodiment of the present application, the present application is compared with YOLOv5s, YOLOv5s+SE and YOLOv5s+CBMA in experiments, and the experimental data are shown in Table 1: Table 1 Comparison of performance of existing advanced models

[0044] In Table 1, the experimental results show that: YOLOv5s-C3_DSConv-DSA is significantly superior to the traditional attention module and the baseline model in multiple indicators: mAP50 indicator: after introducing C3_DSConv and DSA, the model mAP50 reaches 91.7%, which is 1.0% higher than YOLOv5s, 1.6% higher than YOLOv5s+SE, and 1.0% higher than YOLOv5s+CBMA.

[0045] As shown in Figure 6 , the visual analysis shows that: The left YOLOv5s model misses the detection of the pedestrian blocked by the electric pole, while the right YOLOv5s-C3_DSConv-DSA successfully detects the target, and the detection frame is more closely fitted to the target outline. This is due to: The C3_DSConv module fits the linear features of the blocked target (such as the leg lines of the pedestrian) through constraint deformation, avoiding the deviation of the receptive field; The DSA module dynamically focuses on the blocked area, and the target response intensity in the heat map is 23% higher than that of the SE module, effectively suppressing background interference.

[0046] Combining the experimental data and the visual results, YOLOv5s-C3_DSConv-DSA has significant advantages in occluded target detection, especially in small target occlusion scenes (such as vehicles blocked by buildings in the distance).

[0047] Reference will now be made to Figure 6 , which shows a structural schematic diagram of a computer system 600 of an electronic device suitable for implementing embodiments of the present application. Figure 6 The electronic device shown is merely an example and should not impose any limitation on the functions and use range of embodiments of the present application.

[0048] As shown in Figure 6As shown, the computer system 600 includes a central processing unit (CPU) 601 which can perform various appropriate actions and processes in accordance with programs stored in a read only memory (ROM) 602 or loaded into a random access memory (RAM) 603 from a storage section 608. In the RAM 603, various programs and data required for the operation of the system 600 are also stored. The CPU 601, the ROM 602, and the RAM 603 are connected to each other through a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.

[0049] Connected to the I / O interface 605 are an input section 606 including a keyboard, a mouse, etc.; an output section 607 including a display such as a liquid crystal display (LCD), and a speaker, etc.; a storage section 608 including a hard disk, etc.; and a communication section 609 including a network interface card such as a LAN card, a modem, etc. The communication section 609 performs communication processing via a network such as the Internet. A drive 610 is also connected to the I / O interface 605 as required. A removable recording medium 611 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, and the like is attached to the drive 610 as required, so that a computer program read therefrom is installed into the storage section 608 as required.

[0050] In particular, the processes described above with reference to the flow charts can be implemented as a computer software program according to embodiments of the present disclosure. For example, embodiments of the present disclosure include a computer program product comprising a computer program carried on a computer readable storage medium, the computer program comprising program code for performing the methods illustrated by the flow charts. In such embodiments, the computer program can be downloaded and installed from a network via the communication section 609, and / or installed from the removable media 611. When the computer program is executed by the central processing unit (CPU) 601, the above-described functions defined in the methods of the present disclosure are performed. Note that the computer readable storage medium of the present disclosure can be either a computer readable signal medium or a computer readable storage medium or any combination of the two. The computer readable storage medium may, for example, be - but is not limited to - an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus or device, or any suitable combination of the foregoing. More specific examples of the computer readable storage medium can include, but are not limited to, an electrical connection having one or more wires, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present disclosure, the computer readable storage medium can be any tangible medium that contains or stores a program used by or in connection with an instruction execution system, apparatus or device. In the present disclosure, the computer readable signal medium can include a data signal carried by a baseband or as part of a carrier wave transporting the program code. Such a propagated data signal can take any of a variety of forms, including but not limited to electro-magnetic, optical, or any suitable combination thereof. Computer readable signal medium can be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate or transport program for use by or in connection with an instruction execution system, apparatus, or device. Program code contained on the computer readable storage medium can be transmitted as program code signals using any suitable medium, including but not limited to wireless, wire line, optical fiber cable, RF, etc., or any suitable combination of the foregoing.

[0051] Computer program code for carrying out operations of the present application can be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Python, C++, or conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code can execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer, or entirely on the remote computer or server. In the latter scenario, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or the connection can be made to an external computer (for example, through the Internet using an Internet Service Provider).

[0052] The flow diagrams and the block diagrams in the drawings are illustrations of architectures, functionalities, and operations of possible implementations of systems, methods, and computer program products according to various embodiments of the present application. In this regard, each block in the flow diagrams or block diagrams can represent a module, a segment, or a portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that in some alternative implementations, the functions noted in the blocks can occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently or the blocks may

[0053] The modules involved in the embodiments of the present application can be implemented in the form of software or in the form of hardware.

[0054] As another aspect, the present application also provides a computer readable storage medium, which can be included in the electronic device described in the above embodiments, or can exist separately and not be assembled into the electronic device. The above computer readable storage medium carries one or more programs, when the one or more programs are executed by the electronic device, the electronic device is caused to: construct a C3_DSConv module which is a fusion of a dynamic snake convolution DSConv module and a C3 module, and embed the C3_DSConv module into a backbone network of a YOLOv5s; construct a dynamic sparse attention DSA module embedded into a tail end of the backbone network to obtain an optimized occlusion target detection model; and input a preprocessed data set into the occlusion target detection model for training and detection.

[0055] The above description is only the preferred embodiment of the present application and the explanation of the applied technical principles. It should be understood by those skilled in the art that the inventive scope involved in the present application is not limited to the technical solutions formed by the specific combination of the technical features described above, and should also cover other technical solutions formed by the combination of the technical features described above or their equivalent features without departing from the inventive concept described above. For example, the technical solutions formed by the mutual replacement of the features described above and the technical features disclosed in the present application (but not limited to) with similar functions.

Claims

1. An occlusion target detection method based on YOLOv5s, characterized in that, include: Construct a C3_DSConv module that merges the dynamic snake-shaped convolution DSConv module and the C3 module, and embed it into the YOLOv5s backbone network; A dynamic sparse attention DSA module is constructed and embedded at the end of the backbone network to obtain an optimized occluded target detection model; The preprocessed dataset is input into the occluded target detection model for training and detection.

2. The occlusion target detection method according to claim 1, characterized in that, The C3_DSConv module incorporates a dynamic serpentine convolution DSConv module in its Bottleneck portion. When the output feature map from the previous layer passes through the Bottleneck module, it first undergoes feature extraction via the ConvBnSiLU module, and then the dynamic serpentine convolution DSConv module extracts the features of the target shape in the image.

3. The occlusion target detection method according to claim 2, characterized in that, The Bottleneck module first reduces dimensionality through convolution, and then uses convolution to extract high-level feature representations; at the same time, a residual module is introduced into the Bottleneck module to fuse the original features.

4. The occlusion target detection method according to claim 1, characterized in that, The C3 module decomposes the input feature map into two parallel paths. One path contains a single ConvBnSiLU module, and the other path contains a concatenation of the ConvBnSiLU module and the Bottleneck module. The module then connects the output feature maps of the two parallel paths to form a new feature map.

5. The occlusion target detection method according to claim 1, characterized in that, When the dynamic sparse attention DSA module receives the feature map from the previous layer, it divides the feature map into equal-sized grids and extracts the features of each region from them. The query tensor, key tensor, and value tensor are generated through linear mapping, as shown in the following formula: ; Where Q represents the query tensor, K represents the key tensor, V represents the value tensor, and X represents the received feature map from the previous layer. Indicates local features after region division. , and These represent the linear transformation matrices of the three tensors, respectively.

6. The occlusion target detection method according to claim 5, characterized in that, The correlation matrix between regions is calculated using the query tensor, key tensor, and value tensor; further, a top-k operation is performed on the correlation matrix to obtain the routing index matrix. And according to the routing index matrix The formula for filtering out the top n regions with the highest related value is as follows: ; ; in, Represents the region affinity matrix. This represents a regionalized query tensor. Representing the regionalized bond tensor, the topkIndex() function represents the expression for the matrix. For each row, perform a top-k selection and return the indexes of the k elements with the largest values ​​in each row.

7. The occlusion target detection method according to claim 6, characterized in that, Using the routing index matrix Dynamic sparse self-attention computation is performed to obtain features containing attention, and local context enhancement terms are also introduced. The specific steps include: According to the routing index matrix Perform on K tensor and V tensor The data collection operation only yields data from the routing area. and , Q tensor, tensor and The tensors are used to perform dot product calculations, and then the softmax activation function is applied to obtain features that include attention. At the same time, a local context enhancement term LCE(V) is introduced to enhance the local context of the feature vector at each position. The specific formula is expressed as follows: ; ; in, and represents the key and value of the key region filtered by index, respectively; O represents the final output feature that combines sparse attention features and local context enhancement; Attention represents attention calculation; and LCE(V) represents local context enhancement.

8. The occlusion target detection method according to claim 1, characterized in that, The specific steps of embedding the dynamic sparse attention DSA module at the end of the backbone network include: embedding the dynamic sparse attention DSA module before the SPPF module at the end of the backbone network.

9. A computing system, characterized in that, It includes a processor and a memory, the processor being configured to perform the method as described in any one of claims 1-8.

10. A computer program product, characterized in that, It stores a computer program that, when executed by a processor, implements the method as described in any one of claims 1-8.