Target detection method and device, computer device and storage medium
By enhancing the C3k2-AGConv module and the multi-dilated shared convolution module of the hybrid model, and combining attention enhancement and cross-channel fusion, the problem of insufficient target detection accuracy under hazy weather conditions is solved, and high real-time and high-precision target detection is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- ZHEJIANG NORMAL UNIV
- Filing Date
- 2025-12-31
- Publication Date
- 2026-06-02
AI Technical Summary
Under low visibility weather conditions such as fog and haze, existing target detection algorithms, while maintaining high real-time performance, have insufficient detection accuracy, making it difficult to effectively distinguish between blurred targets and complex backgrounds. Furthermore, they have poor multi-scale adaptability, resulting in a high rate of missed detection for small targets and inefficient feature fusion mechanisms.
An enhanced hybrid model is adopted, which uses the C3k2-AGConv module for channel expansion and attention enhancement, combines a multi-dilated shared convolution module to capture multi-scale contextual features, and optimizes feature fusion through a cross-channel fusion module to generate a target fusion feature map. Finally, the output layer determines the target category and location.
While maintaining high real-time performance, it significantly improves target detection accuracy in hazy scenarios, adapts to the detection needs of targets of different sizes, suppresses background noise, and improves detection accuracy and stability.
Smart Images

Figure CN122135308A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of target detection technology, and in particular to a target detection method, apparatus, computer equipment, and storage medium. Background Technology
[0002] With the widespread adoption of intelligent transportation systems, computer vision-based traffic target detection plays a crucial role in road traffic safety. However, in low-visibility weather conditions such as fog and haze, images captured by monitoring systems face challenges such as significant scale variations, rich background noise, and flexible viewing angles, leading to insufficient detection accuracy and limited real-time performance of existing target detection algorithms. Most target detection models rely on convolutional neural networks for feature extraction, but their ability to capture global information is limited. Two-stage detection algorithms are widely used for real-time traffic detection, but they exhibit weak feature extraction capabilities in foggy scenarios. The original convolutional modules lack the ability to distinguish between blurred targets and complex backgrounds, making it difficult to capture effective contextual information. Furthermore, they suffer from poor multi-scale adaptability; the target scale varies greatly in traffic scenarios, resulting in insufficient robustness to scale changes, high false negative rates for small targets, and inefficient feature fusion mechanisms that struggle to adaptively emphasize key vector features and suppress background noise. Therefore, effectively improving target detection accuracy in foggy and hazy scenarios while maintaining high real-time performance is an urgent problem to be solved. Summary of the Invention
[0003] Therefore, it is necessary to provide a target detection method, device, computer equipment, and storage medium that can effectively improve the target detection accuracy in hazy scenarios while maintaining high real-time performance, in order to address the above-mentioned technical problems.
[0004] Firstly, this application provides a target detection method, the method comprising:
[0005] Acquire traffic scene images and extract features from the traffic scene images using an enhanced hybrid model to determine an initial feature map;
[0006] The initial feature map is channel-expanded using the C3k2-AGConv module of the enhanced hybrid model to determine the expanded feature map;
[0007] The extended feature map is split to determine channel split features, and the channel split features are enhanced by the attention gate convolution module in the C3k2-AGConv module to determine the enhanced feature map; the attention gate convolution module includes a convolutional additive self-attention module and a convolutional gated linear unit module;
[0008] The enhanced feature map is subjected to context feature extraction by the multi-dilated shared convolution module of the enhanced hybrid model to determine multi-scale context features;
[0009] The multi-scale context feature map is fused using the cross-channel fusion module of the enhanced hybrid model to determine the target fused feature map.
[0010] The category and location information of target objects in the traffic scene image are determined by the output layer of the enhanced hybrid model based on the target fusion feature map.
[0011] In one embodiment, the channel splitting features are enhanced using the attention-gated convolutional module in the C3k2-AGConv module to determine the enhanced feature map, including:
[0012] The C3k2-AGConv module is used to segment the channel splitting features into blocks, determine the sub-feature maps, and generate the query vector, key vector, and value vector of the sub-feature maps.
[0013] Calculate the spatial similarity matrix between the query vector and the key vector, and determine the first attention weight based on the spatial similarity matrix;
[0014] Based on the first attention weight, determine the spatial attention weight map and the channel attention weight vector;
[0015] The sub-feature map is enhanced by using the spatial attention weight map and the channel attention weight vector to determine the enhanced feature map.
[0016] In one embodiment, determining the spatial attention weight map and the channel attention weight vector based on the first attention weight includes:
[0017] The first attention weight is dimensionally reshaped to determine the reshaped attention weight, and the reshaped attention weight is spliced together according to the original spatial position to determine the spatial attention weight map;
[0018] Perform global flat pooling on the channel dimension of the query vector and the channel dimension of the key vector to determine the feature statistics of the channel dimension of the query vector and the channel dimension of the key vector.
[0019] The channel attention weight vector is determined based on the aforementioned feature statistics.
[0020] In one embodiment, the sub-feature map is enhanced using the spatial attention weight map and the channel attention weight vector to determine the enhanced feature map, including:
[0021] The spatial attention weight map and the sub-feature map are multiplied element-wise to determine a single-dimensional weighted feature map.
[0022] The channel attention weight vector and the single-dimensional weighted feature map are multiplied element-wise to determine the two-dimensional weighted feature map.
[0023] The two-dimensional weighted feature maps are concatenated to determine the enhanced feature map.
[0024] In one embodiment, the multi-scale context feature map is fused using the cross-channel fusion module of the enhanced hybrid model to determine the target fused feature map, including:
[0025] Based on the multi-scale contextual feature map, the backbone network feature map and the neck network feature map are determined;
[0026] The backbone network feature map and the neck network feature map are added element by element to determine the initial fused feature map;
[0027] Global average pooling and point convolution are performed on the initial fused feature map to determine the second attention weights;
[0028] The backbone network feature map and the neck network feature map are weighted using the second attention weight, and the weighted backbone network feature map and the weighted neck network feature map are then concatenated to determine the target fusion feature map.
[0029] In one embodiment, feature extraction of the traffic scene image is performed using an enhanced hybrid model to determine an initial feature map, including:
[0030] The traffic scene images are standardized to determine standardized images;
[0031] The pixel information of the normalized image is converted into feature information through the base convolutional layer of the enhanced hybrid model to generate an initial feature map.
[0032] In one embodiment, the above-described target detection method further includes:
[0033] The original C3k2 module in the backbone network of the YOLOv11n architecture was replaced with the C3k2-AGConv module, and a multi-dilated shared convolution module was introduced into the SPPF layer of the YOLOv11n architecture. In addition, a cross-channel fusion module was added to the path aggregation network of the YOLOv11n architecture to determine the enhanced hybrid model.
[0034] Secondly, this application also provides a target detection device, the device comprising:
[0035] An initial feature map determination module is used to acquire traffic scene images and extract features from the traffic scene images through an enhanced hybrid model to determine an initial feature map;
[0036] An extended feature map determination module is used to perform channel expansion on the initial feature map through the C3k2-AGConv module of the enhanced hybrid model to determine the extended feature map;
[0037] The enhanced feature map determination module is used to split the extended feature map, determine the channel split features, and enhance the channel split features through the attention gate convolution module in the C3k2-AGConv module to determine the enhanced feature map; the attention gate convolution module includes a convolutional additive self-attention module and a convolutional gated linear unit module;
[0038] The context feature determination module is used to extract context features from the enhanced feature map through the multi-dilated shared convolution module of the enhanced hybrid model, and determine multi-scale context features;
[0039] The fusion feature determination module is used to perform fusion processing on the multi-scale context feature map through the cross-channel fusion module of the enhanced hybrid model to determine the target fusion feature map;
[0040] The target detection module is used to determine the category and location information of target objects in the traffic scene image based on the target fusion feature map through the output layer of the enhanced hybrid model.
[0041] Thirdly, this application also provides a computer device, the computer device including a memory and a processor, the memory storing a computer program, and the processor executing the computer program to perform the following steps:
[0042] Acquire traffic scene images and extract features from the traffic scene images using an enhanced hybrid model to determine an initial feature map;
[0043] The initial feature map is channel-expanded using the C3k2-AGConv module of the enhanced hybrid model to determine the expanded feature map;
[0044] The extended feature map is split to determine channel split features, and the channel split features are enhanced by the attention gate convolution module in the C3k2-AGConv module to determine the enhanced feature map; the attention gate convolution module includes a convolutional additive self-attention module and a convolutional gated linear unit module;
[0045] The enhanced feature map is subjected to context feature extraction by the multi-dilated shared convolution module of the enhanced hybrid model to determine multi-scale context features;
[0046] The multi-scale context feature map is fused using the cross-channel fusion module of the enhanced hybrid model to determine the target fused feature map.
[0047] The category and location information of target objects in the traffic scene image are determined by the output layer of the enhanced hybrid model based on the target fusion feature map.
[0048] Fourthly, this application also provides a computer-readable storage medium having a computer program stored thereon, the computer program performing the following steps when executed by a processor:
[0049] Acquire traffic scene images and extract features from the traffic scene images using an enhanced hybrid model to determine an initial feature map;
[0050] The initial feature map is channel-expanded using the C3k2-AGConv module of the enhanced hybrid model to determine the expanded feature map;
[0051] The extended feature map is split to determine channel split features, and the channel split features are enhanced by the attention gate convolution module in the C3k2-AGConv module to determine the enhanced feature map; the attention gate convolution module includes a convolutional additive self-attention module and a convolutional gated linear unit module;
[0052] The enhanced feature map is subjected to context feature extraction by the multi-dilated shared convolution module of the enhanced hybrid model to determine multi-scale context features;
[0053] The multi-scale context feature map is fused using the cross-channel fusion module of the enhanced hybrid model to determine the target fused feature map.
[0054] The category and location information of target objects in the traffic scene image are determined by the output layer of the enhanced hybrid model based on the target fusion feature map.
[0055] The aforementioned target detection method, apparatus, computer equipment, and storage medium acquire traffic scene images and extract features from the traffic scene images using an enhanced hybrid model to determine an initial feature map. The initial feature map is then channel-expanded using the C3k2-AGConv module of the enhanced hybrid model to determine an expanded feature map. The expanded feature map is then split to determine channel-splitting features, and these features are enhanced using the attention-gated convolution module within the C3k2-AGConv module to determine an enhanced feature map. The attention-gated convolution module includes a convolutional additive self-attention module and a convolutional gated linear unit module. The enhanced feature map is then used to extract contextual features using a multi-dilation shared convolution module of the enhanced hybrid model to determine multi-scale contextual features. The multi-scale contextual feature map is then fused using a cross-channel fusion module of the enhanced hybrid model to determine a target fusion feature map. Finally, the output layer of the enhanced hybrid model determines the category and location information of the target objects in the traffic scene image based on the target fusion feature map. This solution addresses the challenges posed by monitoring systems in low-visibility weather conditions such as fog and haze, where images exhibit significant scale variations, rich background noise, and flexible viewing angles, leading to insufficient accuracy and limited real-time performance of existing object detection algorithms. The proposed scheme first acquires traffic scene images and extracts initial feature maps using an enhanced hybrid model. Then, a C3k2-AGConv module performs channel expansion. The split channel features are enhanced using an attention-gated convolutional module containing both additive self-attention and convolutionally gated linear units to obtain enhanced feature maps. Subsequently, a multi-dilation shared convolutional module captures multi-scale contextual features, which are then integrated and optimized by a cross-channel fusion module to generate a target fusion feature map. Finally, the model's output layer uses this feature map to determine the category and location information of target objects in the traffic scene image. The above scheme, through channel expansion and attention enhancement of the C3k2-AGConv module, combined with the dual effects of the convolutional additive self-attention module and the convolutional gated linear unit module, can accurately enhance target features and suppress background interference. The multi-dilated shared convolution module can determine multi-scale contextual features, adapting to the detection needs of targets of different sizes in traffic scenarios. The cross-channel fusion module completes the integration and optimization of features, and the output target fusion feature map has both rich detail and semantic relevance. Finally, the output layer accurately determines the target category and location, which can effectively improve the target detection accuracy in hazy scenarios while maintaining high real-time performance. Attached Figure Description
[0056] Figure 1 This is a diagram illustrating the application environment of a target detection method in one embodiment;
[0057] Figure 2 This is a flowchart illustrating a target detection method in one embodiment;
[0058] Figure 3 This is a schematic diagram of the effective receptive field of the expanded convolutional kernel under different dilation rates in one embodiment;
[0059] Figure 4 This is a flowchart illustrating an enhanced feature map determination method in one embodiment;
[0060] Figure 5 This is a flowchart illustrating a target fusion feature map determination method in one embodiment;
[0061] Figure 6 This is an example of a comparison of target detection results between the YOLOv11n model and the enhanced hybrid model in one embodiment;
[0062] Figure 7 This is a flowchart illustrating the target detection method in another embodiment;
[0063] Figure 8 This is a structural block diagram of a target detection device in one embodiment;
[0064] Figure 9 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation
[0065] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0066] The target detection method provided in this application embodiment can be applied to, for example... Figure 1In the application environment shown, terminal 102 communicates with server 104 via a network. A data storage system can store the data that server 104 needs to process. The data storage system can be integrated onto server 104, or it can be located in the cloud or on another network server. Server 104 acquires traffic scene images and extracts features from the traffic scene images using an enhanced hybrid model to determine an initial feature map. The initial feature map is then channel-expanded using the C3k2-AGConv module of the enhanced hybrid model to determine an expanded feature map. The expanded feature map is then split to determine channel-splitting features, and these channel-splitting features are enhanced using the attention-gated convolution module in the C3k2-AGConv module to determine an enhanced feature map. The attention-gated convolution module includes a convolutional additive self-attention module and a convolutional gated linear unit module. The enhanced feature map is then used for context feature extraction using the multi-dilation shared convolution module of the enhanced hybrid model to determine multi-scale context features. The multi-scale context feature map is then fused using the cross-channel fusion module of the enhanced hybrid model to determine a target fused feature map. Finally, based on the target fused feature map, the enhanced hybrid model determines the category and location information of target objects in the traffic scene image and sends this information to terminal 102 via a communication network. The terminal 102 can be, but is not limited to, various personal computers, laptops, smartphones, tablets, IoT devices, and portable wearable devices. IoT devices can include smart speakers, smart TVs, smart air conditioners, and smart in-vehicle systems. Portable wearable devices can include smartwatches, smart bracelets, and head-mounted devices. The server 104 can be implemented using a standalone server or a server cluster consisting of multiple servers.
[0067] In one embodiment, such as Figure 2 As shown, a target detection method is provided. This embodiment illustrates the method applied to a terminal. It is understood that this method can also be applied to a server, and further to a system including both a terminal and a server, and implemented through interaction between the terminal and the server. In this embodiment, the method includes the following steps:
[0068] S210. Acquire traffic scene images and extract features from the traffic scene images using an enhanced hybrid model to determine the initial feature map.
[0069] The traffic scene images refer to traffic scene images under hazy weather conditions. The enhanced hybrid model is AMC-YOLO (Attention-Gate Convolution & Multi-dilation Sharing Convolution & Cross-channel Fusion Module YOLO), an object detection algorithm that introduces attention-gate convolution, multi-dilation shared convolution, and cross-channel fusion modules. The AMC-YOLO model includes the C3k2-AGConv module, the multi-dilation shared convolution module MDSC, and the cross-channel fusion module CCFM. The C3k2-AGConv module is a composite feature enhancement module that combines the efficient C3k2 feature extraction structure with the AGConv (Adaptive Graph Convolution) mechanism. It is commonly found in the backbone networks of object detection models such as the YOLO (You Only Look Once, a single-stage object detection algorithm) series. Its core function is to improve feature extraction efficiency while accurately capturing the complex feature associations of the target, adapting to the object detection needs in complex environments such as traffic scenes. C3k2 is the core module in the YOLO series models for efficient feature extraction. It uses variable convolutional kernels combined with a channel separation strategy to extract shallow detail features and global contextual information from the input image, supporting subsequent object detection tasks. The multi-dilation shared convolution module is a feature enhancement module that combines multi-scale feature capture capabilities with lightweight advantages. Through a collaborative mechanism of parallel multi-dilation rates and shared convolutional kernels, it expands the receptive field and accurately captures multi-scale contextual information while reducing computational redundancy. The cross-channel fusion module is the core module in the object detection model for feature fusion optimization. It uses an adaptive mechanism to mine the correlation information between different feature channels, performing cross-channel integration and redundancy filtering of multi-source features. YOLO is a single-stage object detection algorithm that completes object localization and classification tasks in one go using a single neural network model, without the need to generate candidate regions first. It features fast detection speed and strong real-time performance, making it suitable for scenarios such as real-time traffic detection and autonomous driving. AGConv is a feature enhancement module composed of a convolutional additive self-attention module and a convolutional gated linear unit module. Through feature segmentation, attention weight calculation, and spatial channel attention fusion, it enhances feature extraction capabilities and reduces computational redundancy.
[0070] For example, the method for determining the enhanced hybrid model includes: replacing the original C3k2 module in the backbone network of the YOLOv11n architecture with the C3k2-AGConv module, introducing a multi-dilated shared convolution module in the SPPF layer of the YOLOv11n architecture, and adding a cross-channel fusion module in the path aggregation network of the YOLOv11n architecture to determine the enhanced hybrid model.
[0071] Among them, the SPPF (Spatial Pyramid Pooling Fast Layer) layer is a component used for feature enhancement in object detection models such as the YOLO series and the enhanced hybrid model in this document. It can improve the ability to capture multi-scale contextual information of feature maps while reducing computational complexity through structural optimization, thus adapting to real-time detection requirements. YOLOv11n is a lightweight version of the YOLOv11 series. Its core architecture consists of four parts: an input layer, a backbone network, a neck network, and an output layer, adapted to real-time traffic scene detection needs. The input layer handles preprocessing such as image resizing and normalization. The backbone network is based on CSPDarknet and integrates efficient feature extraction modules such as C3k2, achieving accurate extraction from low-level edge textures to high-level semantic features. The neck network uses an improved FPN (Feature Pyramid Network) and PAN (Path Aggregation Network) structure, combined with the SPPF fast spatial pyramid pooling module to enhance multi-scale feature fusion capabilities. The output layer, the detection head unit, contains parallel classification and regression branches to predict the target category and location. Its lightweight design significantly reduces the number of parameters and computational cost, making it suitable for resource-constrained deployment scenarios. After training, the AMC-YOLO model can be deployed on electronic devices including memory and processors.
[0072] Specifically, the original C3k2 module in the backbone network of the YOLOv11n architecture is replaced with the C3k2-AGConv module, thereby enhancing the feature extraction capability and robustness of the YOLOv11n architecture while reducing computational complexity. A multi-dilated shared convolution module (MDSC) is introduced into the SPPF layer of the YOLOv11n architecture. This module uses shared 3×3 convolutions with dilation rates of 1, 3, and 5 to progressively expand the receptive field while minimizing computational redundancy, thus effectively capturing multi-scale contextual information. A cross-channel fusion module (CCFM) is used in the path aggregation network (PAN) of the AMC-YOLO model. This module optimizes feature fusion through adaptive feature reorganization, emphasizing discriminative elements, suppressing less relevant features, and improving the representational power of the feature maps. For example, Figure 3 This diagram illustrates the effective receptive field of the expanded convolutional kernel under different expansion rates.
[0073] The above scheme replaces the original C3k2 module in the backbone network with the C3k2-AGConv module. While retaining the advantages of C3k2's lightweight and efficient feature extraction, it leverages the dynamic kernel generation characteristics of AGConv's adaptive graph convolution to improve feature extraction accuracy. The introduction of a multi-dilation shared convolution module in the SPPF layer balances multi-scale processing effectiveness with computational efficiency. Furthermore, the addition of a cross-channel fusion module in the path aggregation network effectively mines the correlation information between different feature channels, filters and enhances effective target features, and suppresses haze noise and redundant background features, thereby improving the feature map quality of subsequent input and output layers.
[0074] For example, the initial feature map is determined by: standardizing the traffic scene image to determine a standardized image; and by enhancing the base convolutional layer of the hybrid model, converting the pixel information of the standardized image into feature information to generate the initial feature map.
[0075] The standardization process includes size normalization, pixel value normalization, and filtering.
[0076] The above scheme eliminates interference from lighting and scale differences in traffic scene images through standardization processing, improves the stability of feature extraction, and then uses the base convolutional layer of the enhanced hybrid model to transform pixel information into highly recognizable initial feature information, which can ensure the accuracy and reliability of the overall detection chain.
[0077] S220. The initial feature map is expanded by channel extension of the C3k2-AGConv module of the enhanced hybrid model to determine the expanded feature map.
[0078] Specifically, the initial feature map is expanded using the C3k2-AGConv module of the enhanced hybrid model. This involves doubling the number of channels in the initial feature map through a 1×1 convolution, resulting in an expanded feature map. The expanded feature map is a 128-channel feature map.
[0079] S230. The extended feature map is split to determine the channel split features, and the channel split features are enhanced by the attention gate convolution module in the C3k2-AGConv module to determine the enhanced feature map.
[0080] The attention-gated convolutional module includes an additive self-attention convolutional module and a convolution-gated linear unit module.
[0081] Among them, the attention-gated convolutional module AGConv is an adaptive convolutional module that integrates attention mechanisms and graph convolution characteristics. It can dynamically generate convolutional kernels based on input features, rather than using fixed kernels, thereby accurately capturing the complex features and semantic relationships of the target. The convolutional additive self-attention module CAS can achieve a balance between global context capture and computational efficiency in resource-constrained scenarios.
[0082] Specifically, the extended feature map is split into two parallel processing branches, namely two channel-splitting features. These channel-splitting features are then processed separately using an attention-gated convolutional module to determine the two enhanced feature maps.
[0083] For example, a 128-channel extended feature map can be split equally according to the number of channels, such as into two 64-channel feature maps, thus forming two parallel processing branches, which is called channel splitting feature map.
[0084] For example, such as Figure 4 As shown, the channel splitting features are enhanced using the attention-gated convolution module in the C3k2-AGConv module to determine the enhanced feature map, including:
[0085] S2301. Using the C3k2-AGConv module, the channel splitting features are processed into blocks to determine the sub-feature maps and generate the query vector, key vector, and value vector of the sub-feature maps.
[0086] Here, the query vector represents the feature vector to be processed, which is used to retrieve matching information in the attention calculation; the key vector represents the reference feature vector used for matching, which is used to calculate the similarity with the query and generate attention weights; the value vector represents the feature vector that needs to be weighted and aggregated. Finally, the value is weighted and summed according to the weights calculated by the query and key to obtain the attention output.
[0087] Specifically, the C3k2-AGConv module is used to segment the channel splitting features into blocks, dividing them into several non-overlapping sub-feature maps according to a preset splitting size. For each sub-feature map, a three-dimensional tensor is generated, which serves as the query vector, key vector, and value vector, respectively.
[0088] S2302. Calculate the spatial similarity matrix between the query vector and the key vector, and determine the first attention weight based on the spatial similarity matrix.
[0089] Specifically, the spatial similarity matrix between the query vector and the key vector is calculated. The formula for calculating the spatial similarity matrix is shown in formula (1):
[0090] (1).
[0091] in, Here, Q is the spatial similarity matrix; Q is the query vector; and K is the key vector. This represents the context mapping function. The spatial similarity matrix is normalized using the Softmax normalization function, mapping the values of each element in the spatial similarity matrix to the interval 0-1, thus determining the attention weight matrix, i.e., the first attention weight.
[0092] S2303. Based on the first attention weight, determine the spatial attention weight map and the channel attention weight vector.
[0093] For example, the determination of the spatial attention weight map and the channel attention weight vector includes: reshaping the dimensions of the first attention weight to determine the reshaped attention weight, and concatenating the reshaped attention weight according to the original spatial position to determine the spatial attention weight map; performing global average pooling operation on the channel dimension of the query vector and the channel dimension of the key vector to determine the feature statistics of the channel dimension of the query vector and the channel dimension of the key vector; and determining the channel attention weight vector based on the feature statistics.
[0094] Specifically, the first attention weights of each sub-feature map are dimensionally reshaped to match the size of the sub-feature map, thus determining the weight sub-graph. The reshaped weight sub-graphs corresponding to all sub-feature maps are then concatenated according to their original spatial positions to obtain a spatial attention weight map with the same spatial dimensions as the input feature map. Global average pooling is performed on the channel dimensions of the query vector and key vector respectively to extract the feature statistics of each channel. The similarity of the feature statistics is calculated, and then normalized to determine the channel attention weight vector.
[0095] The above scheme, by reshaping the first attention weight and splicing it according to the original spatial position, generates a spatial attention weight map that can accurately locate the spatial position of the target in the traffic scene, strengthen the target area features and suppress the background redundant areas; by performing global average pooling on the channel dimensions of the query vector and key vector to obtain feature statistics, the generated channel attention weight vector can effectively filter out channel features that contribute highly to target detection and weaken the interference of invalid channels.
[0096] S2304. Enhance the sub-feature map by using the spatial attention weight map and the channel attention weight vector to determine the enhanced feature map.
[0097] For example, the method for determining the enhanced feature map includes: multiplying the spatial attention weight map and the sub-feature map element-wise to determine the single-dimensional weighted feature map; multiplying the channel attention weight vector and the single-dimensional weighted feature map element-wise to determine the double-dimensional weighted feature map; and concatenating the double-dimensional weighted feature maps to determine the enhanced feature map.
[0098] Specifically, the spatial attention weight map is first multiplied element-wise with the corresponding sub-feature map to amplify the features of the target region and suppress background noise from haze, thus determining a single-dimensional weighted feature map. Next, the channel attention weight vector is multiplied element-wise with the single-dimensional weighted feature map to strengthen effective feature channels and weaken noise channels, thus determining a two-dimensional weighted feature map. Finally, the two-dimensional weighted feature maps are concatenated according to their original spatial positions to determine the enhanced feature map.
[0099] The above scheme performs element-wise multiplication of the spatial attention weight map with the corresponding sub-feature map, which can amplify the features of the target area and suppress background noise of haze. Performing element-wise multiplication of the channel attention weight vector with the single-dimensional weighted feature map can strengthen the effective feature channels and weaken the noise channels.
[0100] S240. By enhancing the multi-dilation shared convolution module of the hybrid model, contextual features are extracted from the enhanced feature map to determine multi-scale contextual features.
[0101] Specifically, the enhanced hybrid model's multi-dilation shared convolutional module is configured with three structurally identical 3×3 convolutional kernels. These three kernels employ a weight-sharing mechanism, sharing the same set of convolutional weight parameters to avoid parameter redundancy caused by independent configuration of multiple kernels. Dilation rates of 1, 3, and 5 are set for the three shared-weight 3×3 convolutional kernels to cover the feature capture requirements of traffic targets at different scales. The enhanced feature map is simultaneously input into the three shared-weight 3×3 convolutional kernels with different dilation rates, and parallel convolution operations are performed. Local detail features of traffic targets in the input feature map are extracted through the differentiated receptive fields of the convolutional kernels with different dilation rates. The three single-scale feature maps are concatenated along the channel dimension to obtain a concatenated feature map, which is then convolved to obtain an intermediate feature map. Finally, a convolution operation is performed on the intermediate feature map to achieve deep fusion of features at different scales and determine multi-scale contextual features.
[0102] S250. By enhancing the cross-channel fusion module of the hybrid model, the multi-scale context feature maps are fused to determine the target fused feature map.
[0103] For example, such as Figure 5 As shown, the methods for determining the target fusion feature map include:
[0104] S2501. Based on the multi-scale contextual feature map, determine the backbone network feature map and the neck network feature map.
[0105] Specifically, the multi-scale contextual feature maps are classified according to semantic hierarchy. The features extracted by the backbone network of the enhanced hybrid model, which include low-level edge textures and mid-level target contours, are used as backbone network feature maps. The backbone network feature maps are then subjected to multi-scale fusion processing. The receptive field is expanded through the SPPF layer of the neck network, and the PAN structure completes cross-channel and cross-scale feature aggregation. The fused features, which combine deep semantics and multi-scale correlation information, are determined as neck network feature maps.
[0106] S2502. Add the backbone network feature map and the neck network feature map element by element to determine the initial fused feature map.
[0107] For example, the initial fused feature map is determined as shown in formula (2):
[0108] (2).
[0109] in, For backbone network feature maps, This is a feature map of the neck network.
[0110] S2503. Perform global average pooling and point convolution on the initial fused feature map to determine the second attention weights.
[0111] For example, the second attention weight is determined as shown in formula (3):
[0112] (3).
[0113] in, This represents n concatenated point convolutional layers; This indicates a global average pooling operation.
[0114] This is the second attention weight.
[0115] S2504. The backbone network feature map and the neck network feature map are weighted by the second attention weight, and the weighted backbone network feature map and the weighted neck network feature map are spliced together to determine the target fusion feature map.
[0116] Specifically, the backbone network feature map and the neck network feature map are weighted by the second attention weight, and the weighted backbone network feature map and the weighted neck network feature map are concatenated. The target fusion feature map is determined by using the sigmoid activation function based on the concatenated weighted backbone network feature map and the weighted neck network feature map.
[0117] For example, using right and We perform weighting to obtain the weighted backbone network feature map. Weighted neck network feature map The specific calculation formulas are shown in formulas (4) and (5).
[0118] (4).
[0119] (5).
[0120] The target fusion feature map W is determined as shown in formula (6):
[0121] (6).
[0122] in, This indicates element-wise addition. This indicates element-wise multiplication. This represents the Sigmoid activation function.
[0123] The above scheme uses a cross-channel fusion module to perform size alignment, adaptive channel weighting, cross-channel recombination, and 1×1 convolution fusion processing on multi-scale contextual feature maps, resulting in an optimized target fusion feature map with enhanced target discriminative elements, suppressed redundant noise, and complementary multi-scale information. This improves the accuracy and stability of target detection in complex traffic scenarios.
[0124] S260. By enhancing the output layer of the hybrid model, the category information and location information of the target object in the traffic scene image are determined based on the target fusion feature map.
[0125] Specifically, the target fusion feature map is input into the model's output layer. The output layer first matches the target fusion feature map with preset anchor boxes. Using the enhanced traffic target discriminative elements in the image, the classification branch calculates the probability that the target belongs to each category, such as pedestrian, car, and truck, and selects the category with the highest probability as the target object's category information. Simultaneously, the regression branch predicts the anchor box offset parameters, and combines the original anchor box position to calculate the actual coordinates of the target object in the traffic scene image. Finally, the detection result containing both category and location information is output. Target discriminative elements can be the contour and texture features of targets at different scales. For example, Figure 6 A comparison of the detection results of the YOLOv11n model and the enhanced hybrid model for object detection in traffic scene images.
[0126] In the above target detection method, a traffic scene image is acquired, and features are extracted from the traffic scene image using an enhanced hybrid model to determine an initial feature map. The initial feature map is then expanded using the C3k2-AGConv module of the enhanced hybrid model to determine an expanded feature map. The expanded feature map is then split to determine channel-splitting features, and these channel-splitting features are enhanced using the attention-gated convolution module in the C3k2-AGConv module to determine an enhanced feature map. The attention-gated convolution module includes a convolutional additive self-attention module and a convolutional gated linear unit module. Contextual features are extracted from the enhanced feature map using the multi-dilation shared convolution module of the enhanced hybrid model to determine multi-scale contextual features. The multi-channel fusion module of the enhanced hybrid model fuses the multi-scale contextual feature maps to determine a target fusion feature map. Finally, the output layer of the enhanced hybrid model determines the category and location information of the target object in the traffic scene image based on the target fusion feature map. This solution addresses the challenges posed by monitoring systems in low-visibility weather conditions such as fog and haze, where images exhibit significant scale variations, rich background noise, and flexible viewing angles, leading to insufficient accuracy and limited real-time performance of existing object detection algorithms. The proposed scheme first acquires traffic scene images and extracts initial feature maps using an enhanced hybrid model. Then, a C3k2-AGConv module performs channel expansion. The split channel features are enhanced using an attention-gated convolutional module containing both additive self-attention and convolutionally gated linear units to obtain enhanced feature maps. Subsequently, a multi-dilation shared convolutional module captures multi-scale contextual features, which are then integrated and optimized by a cross-channel fusion module to generate a target fusion feature map. Finally, the model's output layer uses this feature map to determine the category and location information of target objects in the traffic scene image. The above scheme, through channel expansion and attention enhancement of the C3k2-AGConv module, combined with the dual effects of the convolutional additive self-attention module and the convolutional gated linear unit module, can accurately enhance target features and suppress background interference. The multi-dilated shared convolution module can determine multi-scale contextual features, adapting to the detection needs of targets of different sizes in traffic scenarios. The cross-channel fusion module completes the integration and optimization of features, and the output target fusion feature map has both rich detail and semantic relevance. Finally, the output layer accurately determines the target category and location, which can effectively improve the target detection accuracy in hazy scenarios while maintaining high real-time performance.
[0127] For example, such as Figure 7 As shown, based on the above embodiments, the target detection method includes:
[0128] The original C3k2 module in the backbone network of the YOLOv11n architecture is replaced with the C3k2-AGConv module, thereby enhancing the feature extraction capability and robustness of the YOLOv11n architecture while reducing computational complexity. A multi-dilated shared convolutional module (MDSC) is introduced into the SPPF layer of the YOLOv11n architecture. This module uses shared 3×3 convolutions with dilation rates of 1, 3, and 5 to progressively expand the receptive field while minimizing computational redundancy, thus effectively capturing multi-scale contextual information. The cross-channel fusion module CCFM is used in the path aggregation network PAN of the AMC-YOLO model. It optimizes feature fusion through adaptive feature reorganization, emphasizing discriminative elements, suppressing less relevant features, and improving the representational power of the feature maps.
[0129] Traffic scene images are standardized to determine standardized images; by enhancing the base convolutional layer of the hybrid model, the pixel information of the standardized images is converted into feature information to generate an initial feature map.
[0130] The initial feature map is expanded using the C3k2-AGConv module of the enhanced hybrid model. Specifically, the number of channels in the initial feature map is doubled through a 1×1 convolution, resulting in an expanded feature map with 128 channels.
[0131] The extended feature map is split into two parallel processing branches, namely two channel-splitting features. The C3k2-AGConv module is used to divide the channel-splitting features into blocks, dividing them into several non-overlapping sub-feature maps according to a preset splitting size. For each sub-feature map, a three-dimensional tensor is generated, which serves as the query vector, key vector, and value vector, respectively. The spatial similarity matrix between the query vector and the key vector is calculated, and the first attention weight is determined based on the spatial similarity matrix.
[0132] The first attention weights of each sub-feature map are dimensionally reshaped to match the dimensions of the sub-feature map, thus determining the weight sub-graph. The reshaped weight sub-graphs corresponding to all sub-feature maps are then concatenated according to their original spatial positions to obtain a spatial attention weight map with the same spatial dimensions as the input feature map. Global average pooling is performed on the channel dimensions of the query vector and key vector respectively to extract the feature statistics of each channel. The similarity of the feature statistics is calculated, and then normalized to determine the channel attention weight vector.
[0133] First, the spatial attention weight map is multiplied element-wise with the corresponding sub-feature map to amplify the features of the target region and suppress background noise from haze, thus determining a single-dimensional weighted feature map. Next, the channel attention weight vector is multiplied element-wise with the single-dimensional weighted feature map to strengthen effective feature channels and weaken noise channels, thus determining a two-dimensional weighted feature map. Finally, the two-dimensional weighted feature maps are concatenated according to their original spatial positions to determine the enhanced feature map.
[0134] The enhanced hybrid model employs a multi-dilation shared convolutional module with three structurally identical 3×3 convolutional kernels. These kernels share a weight mechanism, meaning they utilize the same set of convolutional weight parameters, avoiding parameter redundancy caused by independent kernel configurations. Dilation rates of 1, 3, and 5 are set for the three shared-weight 3×3 convolutional kernels to cover the feature capture requirements of traffic targets at different scales. The enhanced feature map is simultaneously input into the three shared-weight 3×3 convolutional kernels with different dilation rates, and parallel convolution operations are performed. Local detail features of traffic targets in the input feature map are extracted through the differentiated receptive fields of the kernels with different dilation rates. The three single-scale feature maps are concatenated along the channel dimension to obtain a concatenated feature map, which is then convolved to obtain an intermediate feature map. Further convolution operations are performed on the intermediate feature map to achieve deep fusion of features at different scales, determining multi-scale contextual features.
[0135] Multi-scale contextual feature maps are classified according to semantic hierarchy. Features containing low-level edge textures and mid-level target contours extracted by the backbone network of the enhanced hybrid model are used as backbone network feature maps. Multi-scale fusion processing is performed on the backbone network feature maps. The receptive field is expanded through the SPPF layer of the neck network, and the PAN structure completes cross-channel and cross-scale feature aggregation. The fused features that have both deep semantic and multi-scale correlation information are determined as neck network feature maps.
[0136] The backbone network feature map and the neck network feature map are element-wise summed to determine the initial fused feature map. Global average pooling and point convolution are then applied to the initial fused feature map to determine the second attention weights. These second attention weights are then used to weight the backbone network feature map and the neck network feature map. The weighted backbone network feature map and the weighted neck network feature map are then concatenated. Using the sigmoid activation function, the target fused feature map is determined based on the concatenated weighted backbone network feature map and the weighted neck network feature map.
[0137] The target fusion feature map is input into the output layer of the model. The output layer first matches the target fusion feature map with a preset anchor box. Using the enhanced traffic target distinguishability elements in the image, the classification branch calculates the probability that the target belongs to each category, such as pedestrian, car, and truck, and selects the category with the highest probability as the category information of the target object. At the same time, the regression branch predicts the offset parameters of the anchor box, and calculates the actual coordinates of the target object in the traffic scene image by combining the original position of the anchor box. Finally, the detection result containing category information and location information is output.
[0138] In the above target detection method, a traffic scene image is acquired, and features are extracted from the traffic scene image using an enhanced hybrid model to determine an initial feature map. The initial feature map is then expanded using the C3k2-AGConv module of the enhanced hybrid model to determine an expanded feature map. The expanded feature map is then split to determine channel-splitting features, and these channel-splitting features are enhanced using the attention-gated convolution module in the C3k2-AGConv module to determine an enhanced feature map. The attention-gated convolution module includes a convolutional additive self-attention module and a convolutional gated linear unit module. Contextual features are extracted from the enhanced feature map using the multi-dilation shared convolution module of the enhanced hybrid model to determine multi-scale contextual features. The multi-channel fusion module of the enhanced hybrid model fuses the multi-scale contextual feature maps to determine a target fusion feature map. Finally, the output layer of the enhanced hybrid model determines the category and location information of the target object in the traffic scene image based on the target fusion feature map. This solution addresses the challenges posed by monitoring systems in low-visibility weather conditions such as fog and haze, where images exhibit significant scale variations, rich background noise, and flexible viewing angles, leading to insufficient accuracy and limited real-time performance of existing object detection algorithms. The proposed scheme first acquires traffic scene images and extracts initial feature maps using an enhanced hybrid model. Then, a C3k2-AGConv module performs channel expansion. The split channel features are enhanced using an attention-gated convolutional module containing both additive self-attention and convolutionally gated linear units to obtain enhanced feature maps. Subsequently, a multi-dilation shared convolutional module captures multi-scale contextual features, which are then integrated and optimized by a cross-channel fusion module to generate a target fusion feature map. Finally, the model's output layer uses this feature map to determine the category and location information of target objects in the traffic scene image. The above scheme, through channel expansion and attention enhancement of the C3k2-AGConv module, combined with the dual effects of the convolutional additive self-attention module and the convolutional gated linear unit module, can accurately enhance target features and suppress background interference. The multi-dilated shared convolution module can determine multi-scale contextual features, adapting to the detection needs of targets of different sizes in traffic scenarios. The cross-channel fusion module completes the integration and optimization of features, and the output target fusion feature map has both rich detail and semantic relevance. Finally, the output layer accurately determines the target category and location, which can effectively improve the target detection accuracy in hazy scenarios while maintaining high real-time performance.
[0139] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.
[0140] Based on the same inventive concept, this application also provides a target detection apparatus for implementing the target detection method described above. The solution provided by this apparatus is similar to the implementation scheme described in the above method; therefore, the specific limitations in one or more target detection apparatus embodiments provided below can be found in the limitations of the target detection method described above, and will not be repeated here.
[0141] In one embodiment, such as Figure 8 As shown, a target detection device is provided, including: an initial feature map determination module 801, an extended feature map determination module 802, an enhanced feature map determination module 803, a context feature determination module 804, a fused feature determination module 805, and a target detection module 806, wherein:
[0142] The initial feature map determination module 801 is used to acquire traffic scene images and extract features from the traffic scene images through an enhanced hybrid model to determine the initial feature map;
[0143] The extended feature map determination module 802 is used to perform channel expansion on the initial feature map through the C3k2-AGConv module of the enhanced hybrid model to determine the extended feature map;
[0144] The enhanced feature map determination module 803 is used to split the extended feature map, determine the channel split features, and enhance the channel split features through the attention gate convolution module in the C3k2-AGConv module to determine the enhanced feature map; the attention gate convolution module includes a convolutional additive self-attention module and a convolutional gated linear unit module;
[0145] The context feature determination module 804 is used to extract context features from the enhanced feature map through the multi-dilated shared convolution module of the enhanced hybrid model, and determine multi-scale context features;
[0146] The fusion feature determination module 805 is used to perform fusion processing on the multi-scale context feature map through the cross-channel fusion module of the enhanced hybrid model to determine the target fusion feature map;
[0147] The target detection module 806 is used to determine the category information and location information of the target object in the traffic scene image based on the target fusion feature map through the output layer of the enhanced hybrid model.
[0148] For example, the enhanced feature map determination module 803 is specifically used for:
[0149] The C3k2-AGConv module is used to segment the channel splitting features into blocks, determine the sub-feature maps, and generate the query vector, key vector, and value vector of the sub-feature maps.
[0150] Calculate the spatial similarity matrix between the query vector and the key vector, and determine the first attention weight based on the spatial similarity matrix;
[0151] Based on the first attention weight, determine the spatial attention weight map and the channel attention weight vector;
[0152] The sub-feature map is enhanced by using the spatial attention weight map and the channel attention weight vector to determine the enhanced feature map.
[0153] For example, the enhanced feature map determination module 803 is also specifically used for:
[0154] The first attention weight is dimensionally reshaped to determine the reshaped attention weight, and the reshaped attention weight is spliced together according to the original spatial position to determine the spatial attention weight map;
[0155] Perform global flat pooling on the channel dimension of the query vector and the channel dimension of the key vector to determine the feature statistics of the channel dimension of the query vector and the channel dimension of the key vector.
[0156] The channel attention weight vector is determined based on the aforementioned feature statistics.
[0157] For example, the enhanced feature map determination module 803 is also specifically used for:
[0158] The spatial attention weight map and the sub-feature map are multiplied element-wise to determine a single-dimensional weighted feature map.
[0159] The channel attention weight vector and the single-dimensional weighted feature map are multiplied element-wise to determine the two-dimensional weighted feature map.
[0160] The two-dimensional weighted feature maps are concatenated to determine the enhanced feature map.
[0161] For example, the fusion feature determination module 805 is specifically used for:
[0162] Based on the multi-scale contextual feature map, the backbone network feature map and the neck network feature map are determined;
[0163] The backbone network feature map and the neck network feature map are added element by element to determine the initial fused feature map;
[0164] Global average pooling and point convolution are performed on the initial fused feature map to determine the second attention weights;
[0165] The backbone network feature map and the neck network feature map are weighted using the second attention weight, and the weighted backbone network feature map and the weighted neck network feature map are then concatenated to determine the target fusion feature map.
[0166] For example, the initial feature map determination module 801 is specifically used for:
[0167] The traffic scene images are standardized to determine standardized images;
[0168] The pixel information of the normalized image is converted into feature information through the base convolutional layer of the enhanced hybrid model to generate an initial feature map.
[0169] For example, the above-mentioned target detection device further includes:
[0170] The model building module is used to replace the original C3k2 module in the backbone network of the YOLOv11n architecture with the C3k2-AGConv module, introduce a multi-dilated shared convolution module in the SPPF layer of the YOLOv11n architecture, and add a cross-channel fusion module in the path aggregation network of the YOLOv11n architecture to determine the enhanced hybrid model.
[0171] Each module in the aforementioned target detection device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can call and execute the operations corresponding to each module.
[0172] In one embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as follows: Figure 9As shown, the computer device includes a processor, memory, input / output interface, communication interface, display unit, and input device. The processor, memory, and input / output interface are connected via a system bus, and the communication interface, display unit, and input device are also connected to the system bus via the input / output interface. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The input / output interface is used for exchanging information between the processor and external devices. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, mobile cellular networks, NFC (Near Field Communication), or other technologies. When the computer program is executed by the processor, it implements a target detection method. The display unit is used to form a visually visible image and can be a display screen, projection device, or virtual reality imaging device. The display screen can be an LCD screen or an e-ink screen. The input device of the computer device can be a touch layer covering the display screen, or a key vector, trackball, or touchpad set on the computer device casing, or an external key vector disk, touchpad, or mouse, etc.
[0173] Those skilled in the art will understand that Figure 9 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0174] In one embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to perform the following steps:
[0175] Step 1: Acquire traffic scene images and extract features from the traffic scene images using an enhanced hybrid model to determine the initial feature map;
[0176] Step 2: Expand the channels of the initial feature map using the C3k2-AGConv module of the enhanced hybrid model to determine the expanded feature map;
[0177] Step 3: Decompose the extended feature map to determine the channel splitting features, and enhance the channel splitting features through the attention gate convolution module in the C3k2-AGConv module to determine the enhanced feature map; the attention gate convolution module includes a convolutional additive self-attention module and a convolutional gated linear unit module;
[0178] Step 4: Extract contextual features from the enhanced feature map using the multi-dilated shared convolution module of the enhanced hybrid model to determine multi-scale contextual features;
[0179] Step 5: Through the cross-channel fusion module of the enhanced hybrid model, the multi-scale context feature map is fused to determine the target fused feature map;
[0180] Step 6: Using the output layer of the enhanced hybrid model, determine the category and location information of the target objects in the traffic scene image based on the target fusion feature map.
[0181] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, the computer program performing the following steps when executed by a processor:
[0182] Step 1: Acquire traffic scene images and extract features from the traffic scene images using an enhanced hybrid model to determine the initial feature map;
[0183] Step 2: Expand the channels of the initial feature map using the C3k2-AGConv module of the enhanced hybrid model to determine the expanded feature map;
[0184] Step 3: Decompose the extended feature map to determine the channel splitting features, and enhance the channel splitting features through the attention gate convolution module in the C3k2-AGConv module to determine the enhanced feature map; the attention gate convolution module includes a convolutional additive self-attention module and a convolutional gated linear unit module;
[0185] Step 4: Extract contextual features from the enhanced feature map using the multi-dilated shared convolution module of the enhanced hybrid model to determine multi-scale contextual features;
[0186] Step 5: Through the cross-channel fusion module of the enhanced hybrid model, the multi-scale context feature map is fused to determine the target fused feature map;
[0187] Step 6: Using the output layer of the enhanced hybrid model, determine the category and location information of the target objects in the traffic scene image based on the target fusion feature map.
[0188] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, performs the following steps:
[0189] Step 1: Acquire traffic scene images and extract features from the traffic scene images using an enhanced hybrid model to determine the initial feature map;
[0190] Step 2: Expand the channels of the initial feature map using the C3k2-AGConv module of the enhanced hybrid model to determine the expanded feature map;
[0191] Step 3: Decompose the extended feature map to determine the channel splitting features, and enhance the channel splitting features through the attention gate convolution module in the C3k2-AGConv module to determine the enhanced feature map; the attention gate convolution module includes a convolutional additive self-attention module and a convolutional gated linear unit module;
[0192] Step 4: Extract contextual features from the enhanced feature map using the multi-dilated shared convolution module of the enhanced hybrid model to determine multi-scale contextual features;
[0193] Step 5: Through the cross-channel fusion module of the enhanced hybrid model, the multi-scale context feature map is fused to determine the target fused feature map;
[0194] Step 6: Using the output layer of the enhanced hybrid model, determine the category and location information of the target objects in the traffic scene image based on the target fusion feature map.
[0195] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant countries and regions.
[0196] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments described above. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.
[0197] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0198] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A target detection method, characterized in that, include: Acquire traffic scene images and extract features from the traffic scene images using an enhanced hybrid model to determine an initial feature map; The initial feature map is channel-expanded using the C3k2-AGConv module of the enhanced hybrid model to determine the expanded feature map; The extended feature map is split to determine channel split features, and the channel split features are enhanced by the attention gate convolution module in the C3k2-AGConv module to determine the enhanced feature map; the attention gate convolution module includes a convolutional additive self-attention module and a convolutional gated linear unit module; The enhanced feature map is subjected to context feature extraction by the multi-dilated shared convolution module of the enhanced hybrid model to determine multi-scale context features; The multi-scale context feature map is fused using the cross-channel fusion module of the enhanced hybrid model to determine the target fused feature map. The category and location information of target objects in the traffic scene image are determined by the output layer of the enhanced hybrid model based on the target fusion feature map.
2. The method according to claim 1, characterized in that, The enhancement process for the channel splitting features, performed using the attention-gated convolutional module in the C3k2-AGConv module, to determine the enhanced feature map includes: The C3k2-AGConv module is used to segment the channel splitting features into blocks, determine the sub-feature maps, and generate the query vector, key vector, and value vector of the sub-feature maps. Calculate the spatial similarity matrix between the query vector and the key vector, and determine the first attention weight based on the spatial similarity matrix; Based on the first attention weight, determine the spatial attention weight map and the channel attention weight vector; The sub-feature map is enhanced by using the spatial attention weight map and the channel attention weight vector to determine the enhanced feature map.
3. The method according to claim 2, characterized in that, The step of determining the spatial attention weight map and the channel attention weight vector based on the first attention weight includes: The first attention weight is dimensionally reshaped to determine the reshaped attention weight, and the reshaped attention weight is spliced together according to the original spatial position to determine the spatial attention weight map; Perform global flat pooling on the channel dimension of the query vector and the channel dimension of the key vector to determine the feature statistics of the channel dimension of the query vector and the channel dimension of the key vector. The channel attention weight vector is determined based on the aforementioned feature statistics.
4. The method according to claim 2, characterized in that, The step of enhancing the sub-feature map using the spatial attention weight map and the channel attention weight vector to determine the enhanced feature map includes: The spatial attention weight map and the sub-feature map are multiplied element-wise to determine a single-dimensional weighted feature map. The channel attention weight vector and the single-dimensional weighted feature map are multiplied element-wise to determine the two-dimensional weighted feature map. The two-dimensional weighted feature maps are concatenated to determine the enhanced feature map.
5. The method according to claim 1, characterized in that, The cross-channel fusion module of the enhanced hybrid model performs fusion processing on the multi-scale context feature maps to determine the target fused feature map, including: Based on the multi-scale contextual feature map, the backbone network feature map and the neck network feature map are determined; The backbone network feature map and the neck network feature map are added element by element to determine the initial fused feature map; Global average pooling and point convolution are performed on the initial fused feature map to determine the second attention weights; The backbone network feature map and the neck network feature map are weighted using the second attention weight, and the weighted backbone network feature map and the weighted neck network feature map are then concatenated to determine the target fusion feature map.
6. The method according to claim 1, characterized in that, The step of extracting features from the traffic scene image using an enhanced hybrid model to determine the initial feature map includes: The traffic scene images are standardized to determine standardized images; The pixel information of the normalized image is converted into feature information through the base convolutional layer of the enhanced hybrid model to generate an initial feature map.
7. The method according to claim 1, characterized in that, Also includes: The original C3k2 module in the backbone network of the YOLOv11n architecture was replaced with the C3k2-AGConv module, and a multi-dilated shared convolution module was introduced into the SPPF layer of the YOLOv11n architecture. In addition, a cross-channel fusion module was added to the path aggregation network of the YOLOv11n architecture to determine the enhanced hybrid model.
8. A target detection device, characterized in that, The target detection device includes: An initial feature map determination module is used to acquire traffic scene images and extract features from the traffic scene images through an enhanced hybrid model to determine an initial feature map; An extended feature map determination module is used to perform channel expansion on the initial feature map through the C3k2-AGConv module of the enhanced hybrid model to determine the extended feature map; The enhanced feature map determination module is used to split the extended feature map, determine the channel split features, and enhance the channel split features through the attention gate convolution module in the C3k2-AGConv module to determine the enhanced feature map; the attention gate convolution module includes a convolutional additive self-attention module and a convolutional gated linear unit module; The context feature determination module is used to extract context features from the enhanced feature map through the multi-dilated shared convolution module of the enhanced hybrid model, and determine multi-scale context features; The fusion feature determination module is used to perform fusion processing on the multi-scale context feature map through the cross-channel fusion module of the enhanced hybrid model to determine the target fusion feature map; The target detection module is used to determine the category and location information of target objects in the traffic scene image based on the target fusion feature map through the output layer of the enhanced hybrid model.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 7.