Multi-scale edge information enhanced target detection method based on CSP structure
By using a multi-scale edge information enhancement method based on CSP structure, the detection problem of small targets and complex backgrounds in the prior art is solved, the accuracy and real-time performance of target detection are improved, and the detection needs of targets of different sizes are adapted.
Patent Information
- Application Number
- CN202510975495.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-15
- Publication Date
- 2025-11-21
AI Technical Summary
Existing target detection algorithms based on the Transformer structure have reduced detection capabilities when faced with small targets or complex backgrounds, leading to missed or false detections. Furthermore, single-scale feature extraction is difficult to adapt to the detection needs of targets of different sizes.
A multi-scale edge information enhancement method based on CSP structure is adopted. Through adaptive average pooling, depthwise separable convolution and edge enhancement module, multi-scale edge features of the image are extracted and enhanced. Combined with hybrid encoder, intra-scale interaction and cross-scale fusion are performed to generate target detection results.
It significantly improves the accuracy and completeness of target detection, especially the detection capability of small targets and complex backgrounds, reduces the false negative rate and false positive rate, and meets the needs of real-time detection.
Smart Images

Figure CN120997476A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of computer vision and artificial intelligence, and in particular, relates to a target detection method based on multi-scale edge information enhancement of CSP structure. BACKGROUND
[0002] Target detection is an important research direction in the field of computer vision, aiming to identify the location and category of specific targets from images or videos. In recent years, with the rapid development of deep learning technology, target detection algorithms based on convolutional neural networks (CNN) and Transformer structure have made significant progress. Especially the Transformer structure, due to its strong global modeling ability, has been gradually applied to the target detection task, forming an end-to-end detection framework, simplifying the complex preprocessing and post-processing steps in the traditional detection process.
[0003] Currently, among the target detection algorithms based on Transformer structure, DETR (DEtection TRansformer) is the first algorithm to propose an end-to-end target detection framework. DETR abandons the complex steps such as anchor generation and NMS (Non-Maximum Suppression) in traditional detection algorithms, simplifying the detection process. However, DETR has the problems of slow convergence speed, long training time, and low inference efficiency, making it difficult to meet the demand of real-time detection.
[0004] In view of the shortcomings of DETR, researchers have proposed RT-DETR (Real-time Object Detection TRansformer). RT-DETR, based on the advantages of the DETR architecture, significantly improves the convergence speed and inference efficiency of the model by optimizing the network structure and training strategy, and also makes great progress in the accuracy of small target detection. RT-DETR achieves a better balance between real-time performance and detection accuracy, becoming one of the important technical solutions in the current target detection field.
[0005] Although RT-DETR performs well in real-time target detection tasks, there are still some deficiencies in practical applications. Specifically, when RT-DETR faces detection objects with unclear features, such as small targets or objects highly similar to the background, its detection ability decreases significantly. This is mainly due to the large step downsampling operation adopted by RT-DETR in the feature extraction stage. Although it reduces the computational complexity and expands the receptive field, it also causes the image to lose key detail features during dimension reduction. The lack of these detail features makes the model prone to missed detection or false detection when identifying targets, affecting the integrity and accuracy of the detection. In addition, the traditional single-scale feature extraction method cannot effectively adapt to the detection needs of targets of different sizes, further limiting the detection performance of RT-DETR in complex scenes.
[0006] Therefore, there is an urgent need to propose a new target detection algorithm that can effectively enhance the edge features of targets and improve the detection ability of the model for small targets and targets in complex backgrounds to meet the needs of high-precision target detection tasks. SUMMARY
[0007] According to the above technical problems, a target detection method based on multi-scale edge information enhancement of CSP structure is provided. The present application strengthens the edge features of the target by constructing a multi-scale edge information enhancement module, and improves the detection ability of the model for small targets and targets in complex backgrounds. Specifically, the algorithm extracts and enhances the multi-scale edge features of the image through adaptive average pooling, depth separable convolution and edge enhancement module, effectively solving the problems of detail feature loss caused by downsampling and single-scale feature extraction that cannot adapt to the detection needs of targets of different sizes in the prior art, thereby significantly improving the accuracy and integrity of target detection.
[0008] The technical means adopted by the present application are as follows: A target detection method based on multi-scale edge information enhancement of CSP structure, comprising: preprocessing the input image, including size adjustment and normalization processing, outputting the image , ; performing two-step convolution on the preprocessed image to obtain a shallow feature map , wherein, B denotes the batch size, C is the number of channels, H and W are the width and height of the input feature map, respectively; constructing a multi-scale edge information enhancement unit based on the CSP structure, and inputting the shallow feature map Multi-scale feature extraction and edge information enhancement are performed to obtain the enhanced feature map. , ; The enhanced feature map is input into the hybrid encoder to perform intra-scale interaction and cross-scale fusion to generate an image feature sequence. The object is selected from the image feature sequence, input into the decoder for iterative optimization, and the target detection result is output.
[0009] Furthermore, the multi-scale edge information enhancement unit includes: The first branch focuses on shallow feature maps. Perform a 3×3 convolution, and the output is , ; The second branch takes a shallow feature map as input. Shallow feature map The output sequentially passes through the first adaptive average pooling module, the first 1×1 convolution module, the first depthwise separable convolution module, the first edge enhancement module, and the first bilinear interpolation upsampling module, and is: , ; The third branch takes a shallow feature map as input. Shallow feature map The output sequentially passes through the second adaptive average pooling module, the second 1×1 convolution module, the second depthwise separable convolution module, the second edge enhancement module, and the second bilinear interpolation upsampling module, and is: , ; The fourth branch takes a shallow feature map as input. Shallow feature map The output sequentially passes through the third adaptive average pooling module, the third 1×1 convolution module, the third depthwise separable convolution module, the third edge enhancement module, and the third bilinear interpolation upsampling module, and is: , ; The fifth branch takes a shallow feature map as input. Shallow feature map The output sequentially passes through the fourth adaptive average pooling module, the fourth 1×1 convolution module, the fourth depthwise separable convolution module, the fourth edge enhancement module, and the fourth bilinear interpolation upsampling module, and is: , ; The concatenation module is used to concatenate the output feature maps of the first, second, third, fourth, and fifth branches along the channel dimension, as shown in the following formula:
[0010] in, ; The 1×1 convolution module is used to integrate cross-channel information from the concatenated feature maps, as shown in the following formula:
[0011] in, To output the feature map, Here is the weight matrix, and the dimensions of the weight matrix are... , This is the input feature map.
[0012] Furthermore, the processing procedures of the first adaptive average pooling module, the second adaptive average pooling module, the third adaptive average pooling module, and the fourth adaptive average pooling module for the shallow feature map are as follows: The size of the output feature map is determined based on the input parameters; The stride of each pooling window is calculated based on the input and output dimensions; The input feature map is divided into multiple small blocks, and the average value of each block is calculated. The calculated average values are used as the values at the corresponding positions in the output feature map; where: The parameters of the first adaptive average pooling module are set to... , To output the width and height of the feature map , The output is , ; The parameters of the second adaptive average pooling module are set to... , To output the width and height of the feature map , The output is , ; The parameters of the third adaptive average pooling module are set to... , To output the width and height of the feature map , The output is , ; The parameters of the fourth adaptive average pooling module are set to , To output the width and height of the feature map , The output is , .
[0013] Furthermore, the first 1×1 convolutional module, the second 1×1 convolutional module, the third 1×1 convolutional module, and the fourth 1×1 convolutional module are all... , Input the number of channels. The number of output channels, and ,in, The number of pooling scales is 1×1, and the kernel size is 1×1; where: The input to the first 1×1 convolutional module is The output will be , ; The input to the second 1×1 convolutional module is The output will be , ; The input to the third 1×1 convolutional module is The output will be , ; The input to the fourth 1×1 convolutional module is The output will be , .
[0014] Furthermore, the first depthwise separable convolutional module, the second depthwise separable convolutional module, the third depthwise separable convolutional module, and the fourth depthwise separable convolutional module are all... , Input the number of channels. To determine the number of output channels, the convolution kernel size is 3×3. g The number of groups; where: The input to the first depthwise separable convolutional module is the output of the first 1×1 convolutional module. The output is , ; The input to the second depthwise separable convolutional module is the output of the second 1×1 convolutional module. The output is , ; The input to the first depthwise separable convolutional module is the output of the third 1×1 convolutional module. The output is , ; The input to the first depthwise separable convolutional module is the output of the fourth 1×1 convolutional module. The output is , .
[0015] Furthermore, the processing procedures of the first edge enhancement module, the second edge enhancement module, the third edge enhancement module, and the fourth edge enhancement module are as follows: First edge enhancement module: The formula for performing average pooling to blur high-frequency information is as follows:
[0016] in, Given the input feature map, the function For average pooling, the input feature map passes through a 3×3 average pooling layer with a stride of 1 and a padding of 1. Pooling blurs the image while preserving low-frequency information, resulting in a blurred feature map. , ; The marginal residual is calculated using the following formula:
[0017] in, Represents high-frequency information. ; The formula for processing edge information is as follows:
[0018] in, For the operation of generating a mask using the sigmoid activation function, Perform a convolution operation with the number of output channels remaining unchanged, then apply the sigmoid function for weighting, giving higher weight to important edges, to obtain... , ; Edge enhancement is performed using the following formula:
[0019] in, This represents the enhanced image output by the first edge enhancement module. , ; Second edge enhancement module: The formula for performing average pooling to blur high-frequency information is as follows:
[0020] in, Given the input feature map, the function For average pooling, the input feature map passes through a 3×3 average pooling layer with a stride of 1 and a padding of 1. Pooling blurs the image while preserving low-frequency information, resulting in a blurred feature map. , ; The marginal residual is calculated using the following formula:
[0021] in, Represents high-frequency information. ; The formula for processing edge information is as follows:
[0022] in, For the operation of generating a mask using the sigmoid activation function, Perform a convolution operation with the number of output channels remaining unchanged, then apply the sigmoid function for weighting, giving higher weight to important edges, to obtain... , ; Edge enhancement is performed using the following formula:
[0023] in, This represents the enhanced image output by the first edge enhancement module. , ; The third edge enhancement module: The formula for performing average pooling to blur high-frequency information is as follows:
[0024] in, Given the input feature map, the function For average pooling, the input feature map passes through a 3×3 average pooling layer with a stride of 1 and a padding of 1. Pooling blurs the image while preserving low-frequency information, resulting in a blurred feature map. , ; The marginal residual is calculated using the following formula:
[0025] in, Represents high-frequency information. ; The formula for processing edge information is as follows:
[0026] in, For the operation of generating a mask using the sigmoid activation function, Perform a convolution operation with the number of output channels remaining unchanged, then apply the sigmoid function for weighting, giving higher weight to important edges, to obtain... , ; Edge enhancement is performed using the following formula:
[0027] in, This represents the enhanced image output by the first edge enhancement module. , ; The fourth edge enhancement module: The formula for performing average pooling to blur high-frequency information is as follows:
[0028] in, Given the input feature map, the function For average pooling, the input feature map passes through a 3×3 average pooling layer with a stride of 1 and a padding of 1. Pooling blurs the image while preserving low-frequency information, resulting in a blurred feature map. , ; The marginal residual is calculated using the following formula:
[0029] in, Represents high-frequency information. ; The formula for processing edge information is as follows:
[0030] in, For the operation of generating a mask using the sigmoid activation function, Perform a convolution operation with the number of output channels remaining unchanged, then apply the sigmoid function for weighting, giving higher weight to important edges, to obtain... , ; Edge enhancement is performed using the following formula:
[0031] in, This represents the enhanced image output by the first edge enhancement module. , .
[0032] Furthermore, the first bilinear interpolation upsampling module, the second bilinear interpolation upsampling module, the third bilinear interpolation upsampling module, and the fourth bilinear interpolation upsampling module are used to process the enhanced image output by the first edge enhancement module, the second edge enhancement module, the third edge enhancement module, and the fourth edge enhancement module. , , and Width and height bin Transform into the size of the input feature map, output , , and .
[0033] Furthermore, the hybrid encoder transforms multi-scale features into a series of image features through intra-scale interaction and cross-scale fusion, selects a certain number of image features from the output sequence as object queries for the decoder, and outputs the result. The first four dimensions are the bounding box coordinates, and the latter... Dimension represents the class probability.
[0034] Compared with the prior art, the present invention has the following advantages: 1. The present invention is a multi-scale edge information enhancement module based on the CSP structure. Through the cross-stage feature fusion method of the CSP structure, the expressive ability of target edge features is effectively enhanced, and the model’s ability to perceive target edge details is significantly improved.
[0035] 2. This invention dynamically adjusts the feature map size through an adaptive average pooling module, combined with the efficient feature extraction capability of depthwise separable convolution, to achieve flexible extraction of multi-scale features. This multi-scale feature extraction method can effectively adapt to the detection needs of targets of different sizes, especially the detection of small targets, significantly improving the model's detection accuracy and robustness for multi-scale targets.
[0036] 3. The edge enhancement module proposed in this invention blurs low-frequency information through average pooling, utilizes the residual calculation between the original input and the blurred feature map to highlight high-frequency edge information, and generates an edge weight mask through the Sigmoid function to further enhance important edge features. This edge enhancement mechanism effectively improves the model's ability to distinguish targets under complex background conditions, significantly reduces the false negative and false positive rates, and improves the accuracy and completeness of target detection.
[0037] 4. This invention employs a hybrid encoder to perform intra-scale interaction and cross-scale fusion on features enhanced at multiple scales, effectively integrating feature information from different scales and further improving the richness and accuracy of feature representation. Simultaneously, the hybrid encoder, through an efficient feature fusion mechanism, reduces redundant computation, improves the overall detection efficiency of the model, and meets the requirements of real-time detection.
[0038] 5. The algorithm framework proposed in this invention can be directly trained end-to-end using labeled datasets, eliminating the need for complex preprocessing and post-processing steps, thus significantly simplifying the training process. Simultaneously, the algorithm enhances the model's generalization ability through multi-scale edge information enhancement and efficient feature fusion, enabling it to demonstrate excellent detection performance in various application scenarios such as UAV aerial image analysis, industrial defect detection, road crack detection, and medical image analysis.
[0039] In summary, the technical solution of this invention effectively solves the problems of loss of detailed features, insufficient single-scale feature extraction, and low detection accuracy in complex backgrounds that exist in the prior art. It significantly improves the accuracy, completeness, and real-time performance of target detection, and has broad application prospects and important practical value. Attached Figure Description
[0040] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0041] Figure 1 This is a flowchart of the method of the present invention.
[0042] Figure 2 This is a flowchart of the main network of the present invention.
[0043] Figure 3 This is a structural diagram of the multi-scale edge information enhancement module based on the CSP structure of the present invention.
[0044] Figure 4 This is a flowchart of the adaptive average pooling process of the present invention.
[0045] Figure 5 This is a flowchart of the depth-separable convolution process of the present invention.
[0046] Figure 6 This is a structural diagram of the edge information enhancement module of the present invention.
[0047] Figure 7 The image shows the target detection results provided in an embodiment of the present invention. Detailed Implementation
[0048] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0049] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0050] This invention provides a target detection method based on a CSP structure with multi-scale edge information enhancement, designed to effectively identify objects with subtle features. This module is suitable for small target detection and tasks requiring high-precision edge information, such as UAV aerial image analysis, industrial defect detection, road crack detection, and medical imaging. Figure 1 As shown, the method of the present invention includes: The input image is preprocessed, including resizing and normalization, and the output image is... , ; like Figure 2 As shown, the preprocessed image Perform two convolution steps to obtain shallow feature maps. , ,in, B Indicates batch size. C For the number of channels, H and W These are the width and height of the input feature map, respectively; Multi-scale edge information enhancement units are constructed based on the CSP structure to enhance shallow feature maps. Multi-scale feature extraction and edge information enhancement are performed to obtain the enhanced feature map. , ;like Figure 3 The diagram shown is a structural diagram of a multi-scale edge information enhancement module based on the CSP structure.
[0051] The enhanced feature map is input into the hybrid encoder to perform intra-scale interaction and cross-scale fusion to generate an image feature sequence. The object is selected from the image feature sequence, input into the decoder for iterative optimization, and the target detection result is output.
[0052] In specific implementation, as a preferred embodiment of the present invention, such as Figure 3 As shown, the multi-scale edge information enhancement unit includes: The first branch focuses on shallow feature maps. Perform a 3×3 convolution, and the output is , ; The second branch takes a shallow feature map as input. Shallow feature map The output sequentially passes through the first adaptive average pooling module, the first 1×1 convolution module, the first depthwise separable convolution module, the first edge enhancement module, and the first bilinear interpolation upsampling module, and is: , ; The third branch takes a shallow feature map as input. Shallow feature map The output sequentially passes through the second adaptive average pooling module, the second 1×1 convolution module, the second depthwise separable convolution module, the second edge enhancement module, and the second bilinear interpolation upsampling module, and is: , ; The fourth branch takes a shallow feature map as input. Shallow feature map The output sequentially passes through the third adaptive average pooling module, the third 1×1 convolution module, the third depthwise separable convolution module, the third edge enhancement module, and the third bilinear interpolation upsampling module, and is: , ; The fifth branch takes a shallow feature map as input. Shallow feature map The output sequentially passes through the fourth adaptive average pooling module, the fourth 1×1 convolution module, the fourth depthwise separable convolution module, the fourth edge enhancement module, and the fourth bilinear interpolation upsampling module, and is: , ; The concatenation module is used to concatenate the output feature maps of the first, second, third, fourth, and fifth branches along the channel dimension, as shown in the following formula:
[0053] in, ; The 1×1 convolution module is used to integrate cross-channel information from the concatenated feature maps, as shown in the following formula:
[0054] in, To output the feature map, Here is the weight matrix, and the dimensions of the weight matrix are... , This is the input feature map.
[0055] In specific implementation, as a preferred embodiment of the present invention, such as Figure 4 As shown, the processing procedures of the first, second, third, and fourth adaptive average pooling modules for the shallow feature map are as follows: The size of the output feature map is determined based on the input parameters; The stride of each pooling window is calculated based on the input and output dimensions; The input feature map is divided into multiple small blocks, and the average value of each block is calculated. The calculated average values are used as the values at the corresponding positions in the output feature map; where: The parameters of the first adaptive average pooling module are set to... , To output the width and height of the feature map , The output is , ; The parameters of the second adaptive average pooling module are set to... , To output the width and height of the feature map , The output is , ; The parameters of the third adaptive average pooling module are set to... , To output the width and height of the feature map , The output is , ; The parameters of the fourth adaptive average pooling module are set to , To output the width and height of the feature map , The output is , .
[0056] In a specific implementation, as a preferred embodiment of the present invention, the first 1×1 convolutional module, the second 1×1 convolutional module, the third 1×1 convolutional module, and the fourth 1×1 convolutional module are all... , Input the number of channels. The number of output channels, and ,in, The number of pooling scales is 1×1, and the kernel size is 1×1; where: The input to the first 1×1 convolutional module is The output will be , ; The input to the second 1×1 convolutional module is The output will be , ; The input to the third 1×1 convolutional module is The output will be , ; The input to the fourth 1×1 convolutional module is The output will be , .
[0057] In specific implementation, as a preferred embodiment of the present invention, such as Figure 5 As shown, the first depthwise separable convolutional module, the second depthwise separable convolutional module, the third depthwise separable convolutional module, and the fourth depthwise separable convolutional module are all... , Input the number of channels. To determine the number of output channels, the convolution kernel size is 3×3. g The number of groups; where: The input to the first depthwise separable convolutional module is the output of the first 1×1 convolutional module. The output is , ; The input to the second depthwise separable convolutional module is the output of the second 1×1 convolutional module. The output is , ; The input to the first depthwise separable convolutional module is the output of the third 1×1 convolutional module. The output is , ; The input to the first depthwise separable convolutional module is the output of the fourth 1×1 convolutional module. The output is , .
[0058] In this embodiment, the first, second, third, and fourth depthwise separable convolutional modules first convolve each input channel with a convolutional kernel, then normalize the convolution results using batch normalization; finally, they are activated by the SiLU activation function. In this embodiment, the SiLU activation function behaves as a linear function when the input is greater than 0; when it is less than 0, the output is close to 0, thus improving training efficiency and model performance.
[0059] In specific implementation, as a preferred embodiment of the present invention, such as Figure 6 As shown, the processing procedures of the first edge enhancement module, the second edge enhancement module, the third edge enhancement module, and the fourth edge enhancement module are as follows: First edge enhancement module: The formula for performing average pooling to blur high-frequency information is as follows:
[0060] in, Given the input feature map, the function For average pooling, the input feature map passes through a 3×3 average pooling layer with a stride of 1 and a padding of 1. Pooling blurs the image while preserving low-frequency information, resulting in a blurred feature map. , ; The marginal residual is calculated using the following formula:
[0061] in, Represents high-frequency information. ; The formula for processing edge information is as follows:
[0062] in, For the operation of generating a mask using the sigmoid activation function, Perform a convolution operation with the number of output channels remaining unchanged, then apply the sigmoid function for weighting, giving higher weight to important edges, to obtain... , ; Edge enhancement is performed using the following formula:
[0063] in, This represents the enhanced image output by the first edge enhancement module. , ; Second edge enhancement module: The formula for performing average pooling to blur high-frequency information is as follows:
[0064] in, Given the input feature map, the function For average pooling, the input feature map passes through a 3×3 average pooling layer with a stride of 1 and a padding of 1. Pooling blurs the image while preserving low-frequency information, resulting in a blurred feature map. , ; The marginal residual is calculated using the following formula:
[0065] in, Represents high-frequency information. ; The formula for processing edge information is as follows:
[0066] in, For the operation of generating a mask using the sigmoid activation function, Perform a convolution operation with the number of output channels remaining unchanged, then apply the sigmoid function for weighting, giving higher weight to important edges, to obtain... , ; Edge enhancement is performed using the following formula:
[0067] in, This represents the enhanced image output by the first edge enhancement module. , ; The third edge enhancement module: The formula for performing average pooling to blur high-frequency information is as follows:
[0068] in, Given the input feature map, the function For average pooling, the input feature map passes through a 3×3 average pooling layer with a stride of 1 and a padding of 1. Pooling blurs the image while preserving low-frequency information, resulting in a blurred feature map. , ; The marginal residual is calculated using the following formula:
[0069] in, Represents high-frequency information. ; The formula for processing edge information is as follows:
[0070] in, For the operation of generating a mask using the sigmoid activation function, Perform a convolution operation with the number of output channels remaining unchanged, then apply the sigmoid function for weighting, giving higher weight to important edges, to obtain... , ; Edge enhancement is performed using the following formula:
[0071] in, This represents the enhanced image output by the first edge enhancement module. , ; The fourth edge enhancement module: The formula for performing average pooling to blur high-frequency information is as follows:
[0072] in, Given the input feature map, the function For average pooling, the input feature map passes through a 3×3 average pooling layer with a stride of 1 and a padding of 1. Pooling blurs the image while preserving low-frequency information, resulting in a blurred feature map. , ; The marginal residual is calculated using the following formula:
[0073] in, Represents high-frequency information. ; The formula for processing edge information is as follows:
[0074] in, For the operation of generating a mask using the sigmoid activation function, Perform a convolution operation with the number of output channels remaining unchanged, then apply the sigmoid function for weighting, giving higher weight to important edges, to obtain... , In this embodiment, the Sigmoid function maps the input real number to... Interval.
[0075] Edge enhancement is performed using the following formula:
[0076] in, This represents the enhanced image output by the first edge enhancement module. , .
[0077] In a specific implementation, as a preferred embodiment of the present invention, the first bilinear interpolation upsampling module, the second bilinear interpolation upsampling module, the third bilinear interpolation upsampling module, and the fourth bilinear interpolation upsampling module are used to process the enhanced image output by the first edge enhancement module, the second edge enhancement module, the third edge enhancement module, and the fourth edge enhancement module. , , and Width and height bin Transform into the size of the input feature map, output , , and .
[0078] In a specific implementation, as a preferred embodiment of the present invention, the hybrid encoder transforms multi-scale features into a series of image features through intra-scale interaction and cross-scale fusion, selects a certain number of image features from the output sequence as object queries for the decoder, and outputs... The first four dimensions are the bounding box coordinates, and the latter... Dimension represents the class probability.
[0079] Example In scenarios requiring high precision, the proposed multi-scale edge information enhancement algorithm can effectively detect target objects. Taking road cracks as an example, the results are as follows: Figure 7 As shown, in addition, the method of this invention only requires training the labeled dataset directly to obtain the object detection inference model of this method.
[0080] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A target detection method based on CSP structure with multi-scale edge information enhancement, characterized in that, include: The input image is preprocessed, including resizing and normalization, and the output image is... , ; Preprocessed image Perform two convolution steps to obtain shallow feature maps. , ,in, B Indicates batch size. C For the number of channels, H and W These are the width and height of the input feature map, respectively; Multi-scale edge information enhancement units are constructed based on the CSP structure to enhance shallow feature maps. Multi-scale feature extraction and edge information enhancement are performed to obtain the enhanced feature map. , ; The enhanced feature map is input into the hybrid encoder to perform intra-scale interaction and cross-scale fusion to generate an image feature sequence. The object is selected from the image feature sequence, input into the decoder for iterative optimization, and the target detection result is output.
2. The target detection method based on CSP structure with multi-scale edge information enhancement according to claim 1, characterized in that, The multi-scale edge information enhancement unit includes: The first branch focuses on shallow feature maps. Perform a 3×3 convolution, and the output is , ; The second branch takes a shallow feature map as input. Shallow feature map The output sequentially passes through the first adaptive average pooling module, the first 1×1 convolution module, the first depthwise separable convolution module, the first edge enhancement module, and the first bilinear interpolation upsampling module, and is: , ; The third branch takes a shallow feature map as input. Shallow feature map The output sequentially passes through the second adaptive average pooling module, the second 1×1 convolution module, the second depthwise separable convolution module, the second edge enhancement module, and the second bilinear interpolation upsampling module, and is: , ; The fourth branch takes a shallow feature map as input. Shallow feature map The output sequentially passes through the third adaptive average pooling module, the third 1×1 convolution module, the third depthwise separable convolution module, the third edge enhancement module, and the third bilinear interpolation upsampling module, and is: , ; The fifth branch takes a shallow feature map as input. Shallow feature map The output sequentially passes through the fourth adaptive average pooling module, the fourth 1×1 convolution module, the fourth depthwise separable convolution module, the fourth edge enhancement module, and the fourth bilinear interpolation upsampling module, and is: , ; The concatenation module is used to concatenate the output feature maps of the first, second, third, fourth, and fifth branches along the channel dimension, as shown in the following formula: in, ; The 1×1 convolution module is used to integrate cross-channel information from the concatenated feature maps, as shown in the following formula: in, To output the feature map, Here is the weight matrix, and the dimensions of the weight matrix are... , This is the input feature map.
3. The target detection method based on CSP structure with multi-scale edge information enhancement according to claim 2, characterized in that, The processing procedures of the first, second, third, and fourth adaptive average pooling modules for the shallow feature map are as follows: The size of the output feature map is determined based on the input parameters; The stride of each pooling window is calculated based on the input and output dimensions; The input feature map is divided into multiple small blocks, and the average value of each block is calculated. The calculated average values are used as the values at the corresponding positions in the output feature map; where: The parameters of the first adaptive average pooling module are set to... , To output the width and height of the feature map , The output is , ; The parameters of the second adaptive average pooling module are set to... , To output the width and height of the feature map , The output is , ; The parameters of the third adaptive average pooling module are set to... , To output the width and height of the feature map , The output is , ; The parameters of the fourth adaptive average pooling module are set to , To output the width and height of the feature map , The output is , .
4. The target detection method based on CSP structure with multi-scale edge information enhancement according to claim 2, characterized in that, The first 1×1 convolutional module, the second 1×1 convolutional module, the third 1×1 convolutional module, and the fourth 1×1 convolutional module are all , Input the number of channels. The number of output channels, and ,in, The number of pooling scales is 1×1, and the kernel size is 1×1; where: The input to the first 1×1 convolutional module is The output will be , ; The input to the second 1×1 convolutional module is The output will be , ; The input to the third 1×1 convolutional module is The output will be , ; The input to the fourth 1×1 convolutional module is The output will be , .
5. The target detection method based on CSP structure with multi-scale edge information enhancement according to claim 2, characterized in that, The first depthwise separable convolution module, the second depthwise separable convolution module, the third depthwise separable convolution module, and the fourth depthwise separable convolution module are all , Input the number of channels. To determine the number of output channels, the convolution kernel size is 3×3. g The number of groups; where: The input to the first depthwise separable convolutional module is the output of the first 1×1 convolutional module. The output is , ; The input to the second depthwise separable convolutional module is the output of the second 1×1 convolutional module. The output is , ; The input to the first depthwise separable convolutional module is the output of the third 1×1 convolutional module. The output is , ; The input to the first depthwise separable convolutional module is the output of the fourth 1×1 convolutional module. The output is , .
6. The target detection method based on CSP structure with multi-scale edge information enhancement according to claim 2, characterized in that, The processing procedures of the first edge enhancement module, the second edge enhancement module, the third edge enhancement module, and the fourth edge enhancement module are as follows: First edge enhancement module: The formula for performing average pooling to blur high-frequency information is as follows: in, Given the input feature map, the function For average pooling, the input feature map passes through a 3×3 average pooling layer with a stride of 1 and a padding of 1. Pooling blurs the image while preserving low-frequency information, resulting in a blurred feature map. , ; The marginal residual is calculated using the following formula: in, Represents high-frequency information. ; The formula for processing edge information is as follows: in, For the operation of generating a mask using the sigmoid activation function, Perform a convolution operation with the number of output channels remaining unchanged, then apply the sigmoid function for weighting, giving higher weight to important edges, to obtain... , ; Edge enhancement is performed using the following formula: in, This represents the enhanced image output by the first edge enhancement module. , ; Second edge enhancement module: The formula for performing average pooling to blur high-frequency information is as follows: in, Given the input feature map, the function For average pooling, the input feature map passes through a 3×3 average pooling layer with a stride of 1 and a padding of 1. Pooling blurs the image while preserving low-frequency information, resulting in a blurred feature map. , ; The marginal residual is calculated using the following formula: in, Represents high-frequency information. ; The formula for processing edge information is as follows: in, For the operation of generating a mask using the sigmoid activation function, Perform a convolution operation with the number of output channels remaining unchanged, then apply the sigmoid function for weighting, giving higher weight to important edges, to obtain... , ; Edge enhancement is performed using the following formula: in, This represents the enhanced image output by the first edge enhancement module. , ; The third edge enhancement module: The formula for performing average pooling to blur high-frequency information is as follows: in, Given the input feature map, the function For average pooling, the input feature map passes through a 3×3 average pooling layer with a stride of 1 and a padding of 1. Pooling blurs the image while preserving low-frequency information, resulting in a blurred feature map. , ; The marginal residual is calculated using the following formula: in, Represents high-frequency information. ; The formula for processing edge information is as follows: in, For the operation of generating a mask using the sigmoid activation function, Perform a convolution operation with the number of output channels remaining unchanged, then apply the sigmoid function for weighting, giving higher weight to important edges, to obtain... , ; Edge enhancement is performed using the following formula: in, This represents the enhanced image output by the first edge enhancement module. , ; The fourth edge enhancement module: The formula for performing average pooling to blur high-frequency information is as follows: in, Given the input feature map, the function For average pooling, the input feature map passes through a 3×3 average pooling layer with a stride of 1 and a padding of 1. Pooling blurs the image while preserving low-frequency information, resulting in a blurred feature map. , ; The marginal residual is calculated using the following formula: in, Represents high-frequency information. ; The formula for processing edge information is as follows: in, For the operation of generating a mask using the sigmoid activation function, Perform a convolution operation with the number of output channels remaining unchanged, then apply the sigmoid function for weighting, giving higher weight to important edges, to obtain... , ; Edge enhancement is performed using the following formula: in, This represents the enhanced image output by the first edge enhancement module. , .
7. The target detection method based on CSP structure with multi-scale edge information enhancement according to claim 2, characterized in that, The first bilinear interpolation upsampling module, the second bilinear interpolation upsampling module, the third bilinear interpolation upsampling module, and the fourth bilinear interpolation upsampling module are used to process the enhanced image output by the first edge enhancement module, the second edge enhancement module, the third edge enhancement module, and the fourth edge enhancement module. , , and Width and height bin Transform into the size of the input feature map, output , , and .
8. The target detection method based on CSP structure with multi-scale edge information enhancement according to claim 1, characterized in that, The hybrid encoder transforms multi-scale features into a series of image features through intra-scale interaction and cross-scale fusion. It selects a certain number of image features from the output sequence as object queries for the decoder, and the output is... The first four dimensions are the bounding box coordinates, and the latter... Dimension represents the class probability.