A method, device and storage medium for target detection
By performing edge detection and use of feature pyramid networks on the detected images, combined with the non-local mean algorithm processing of the feature noise reduction module, the existing object detection solutions have solved the shortcomings in robustness and feature interpretability, and significantly improved the performance of object detection.
Patent Information
- Application Number
- CN202111628161.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-28
- Publication Date
- 2025-04-11
- Estimated Expiration
- 2041-12-28
AI Technical Summary
The existing object detection schemes have shortcomings in terms of robustness and feature interpretability, especially the features extracted by deep learning-based methods lack interpretability and are noise-free, which affects the detection accuracy.
A target detection method is proposed. By performing edge detection processing on the image to be detected, using the feature pyramid network to extract and enhance edge features, and introducing feature noise reduction modules into the feature extraction network, and performing noise reduction processing based on the non-local mean algorithm, and finally input the processed feature to the target detection network for object detection.
It significantly improves the feature extraction and object detection capabilities based on deep learning neural networks, especially in detecting vehicle performance, and improves the robustness of detection and interpretability of features.
Smart Images

Figure CN114445436B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of computer vision, pattern recognition and target detection, and in particular to a method, device and storage medium for target detection. Background Art
[0002] Traditional target detection schemes are based on manual feature extraction, which has strong interpretability but poor generalization ability. In recent years, target detection schemes that have achieved good performance, such as Mask RCNN and YOLO, are all based on deep learning methods. The target detection scheme based on deep learning uses convolutional neural network (CNN) for feature extraction, which can achieve good detection performance. However, the features extracted by CNN usually lack interpretability, and the extracted features may contain noise, which will have a negative impact on the detection performance.
[0003] As mentioned above, the main disadvantages of existing target detection solutions are:
[0004] 1. The robustness of traditional target detection schemes is poor;
[0005] 2. The features extracted by the target detection scheme designed using CNN lack interpretability and contain noise, which will affect the accuracy of detection. Summary of the invention
[0006] In order to overcome the above technical problems, the present invention proposes a method for target detection, and the technical solution of the method is as follows:
[0007] S1, obtaining the image to be detected;
[0008] S2, performing edge detection processing on the image to be detected to obtain a first image;
[0009] S3, processing the image to be detected by a preset feature extraction network to obtain a second image of the image to be detected, and using the first image to process the second image to enhance edge features of the second image;
[0010] S4, the preset feature extraction network includes a feature denoising module, and the feature denoising module is used to perform denoising processing on the second image with enhanced edge features;
[0011] S5, using the preset feature extraction network to process the second image after the denoising process to obtain image features, and inputting the image features into a preset target detection network to obtain a target category and a target frame.
[0012] Furthermore, performing edge detection on the image to be detected to obtain the first image specifically includes: performing edge detection on the image to be detected using a Sobel operator to obtain the first image.
[0013] Furthermore, the edge detection formula of the Sobel operator is as follows:
[0014]
[0015] Where, I is the image to be detected, E x is the vertical edge image of the image to be detected, E y is the horizontal edge image of the image to be detected, and E is the first image.
[0016] Furthermore, the preset feature extraction network is implemented using a feature pyramid network.
[0017] Furthermore, the step S3 is specifically as follows: outputting the second image in the downsampling part of the feature pyramid network, downsampling and convolving the first image to generate an attention image, and using the attention image to enhance edge features of the second image.
[0018] Furthermore, in step S5, the preset feature extraction network is used to process the second image after denoising to obtain image features, specifically: a feature image is output in the upsampling part of the feature pyramid network, the feature image is spliced using the second image after denoising, and the spliced feature image is processed to obtain the image features.
[0019] Furthermore, the feature denoising module is implemented based on a non-local means algorithm.
[0020] Furthermore, the preset target detection network is implemented in one of the following ways: RCNN, FastRCNN, Faster RCNN, Mask RCNN.
[0021] The present invention further provides a target detection device, wherein the target detection device stores computer instructions; the computer instructions execute the target detection method as described in any one of the above items in the target detection device.
[0022] The present invention also proposes a computer-readable storage medium, wherein the computer-readable storage medium stores computer instructions, and the computer instructions enable the computer to execute the target detection method as described in any one of the above items.
[0023] The beneficial effects brought by the technical solution provided by the present invention are:
[0024] A method and device for target detection of the present invention can improve the feature extraction capability of a feature extraction network based on a deep learning neural network, as well as the target detection capability of a target detection network, and further, can significantly improve the performance of detecting vehicles. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] Figure 1 A flow chart of target detection according to an embodiment of the present invention;
[0026] Figure 2 A framework structure diagram of a method for realizing target detection using a feature extraction network according to an embodiment of the present invention;
[0027] Figure 3 A structural schematic diagram of a feature denoising module using a non-local means algorithm according to an embodiment of the present invention;
[0028] Figure 4 A schematic diagram of the structure of a target detection device involved in an embodiment of the present invention. DETAILED DESCRIPTION
[0029] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0030] Embodiment 1:
[0031] like Figure 1 FIG. 1 is a flow chart of a target detection method according to an embodiment of the present invention, showing specific implementation steps of the method, including:
[0032] S1, obtaining the image to be detected;
[0033] S2, performing edge detection processing on the image to be detected to obtain a first image;
[0034] S3, processing the image to be detected by a preset feature extraction network to obtain a second image of the image to be detected, and using the first image to process the second image to enhance edge features of the second image;
[0035] S4, the preset feature extraction network includes a feature denoising module, and the feature denoising module is used to perform denoising processing on the second image with enhanced edge features;
[0036] S5, using the preset feature extraction network to process the second image after the denoising process to obtain image features, and inputting the image features into a preset target detection network to obtain a target category and a target frame.
[0037] Specifically, performing edge detection on the image to be detected to obtain the first image specifically includes: performing edge detection on the image to be detected using a Sobel operator to obtain the first image.
[0038] Specifically, the edge detection formula of the Sobel operator is as follows:
[0039]
[0040] Where, I is the image to be detected, E x is the vertical edge image of the image to be detected, E y is the horizontal edge image of the image to be detected, and E is the first image.
[0041] Specifically, the preset feature extraction network is implemented using a feature pyramid network.
[0042] Specifically, the step S3 is as follows: outputting the second image in the downsampling part of the feature pyramid network, downsampling and convolving the first image to generate an attention image, and using the attention image to enhance the edge features of the second image.
[0043] Specifically, in step S5, the preset feature extraction network is used to process the second image after denoising to obtain image features, specifically: a feature image is output in the upsampling part of the feature pyramid network, the feature image is spliced using the second image after denoising, and the spliced feature image is processed to obtain the image features.
[0044] Specifically, the feature denoising module is implemented based on a non-local means algorithm.
[0045] Specifically, the preset target detection network is implemented in one of the following ways: RCNN, Fast RCNN, Faster RCNN, Mask RCNN.
[0046] Embodiment 2:
[0047] This embodiment introduces an application example of the present invention based on a target detection method in the first embodiment.
[0048] like Figure 2FIG. 1 is a structural diagram of a framework for realizing target detection using a feature extraction network according to an embodiment of the present invention, and shows the specific steps of the present embodiment: first, an image I is used as an image to be detected, and edge enhancement is performed on the image to be detected to obtain an edge image E; downsampling and convolution operations are performed on the edge image E to obtain an attention image; a feature pyramid network is used to obtain an attention image. A feature extraction network is implemented by using a FPN (Frequency Prediction Network), wherein the feature extraction network includes network modules such as a convolutional layer, a residual layer, downsampling and upsampling; an image to be detected is input; the downsampling part of the feature extraction network outputs a feature image of the image to be detected, and the edge features of the feature image are enhanced by using an attention image before each downsampling, and the feature image after the edge features are enhanced is input into the residual layer of the downsampling part; a feature denoising module is added to the lateral connection part of the feature extraction network, and the feature denoising module is used to suppress the noise of the feature image output by the lateral connection part of the feature extraction network; the feature image after noise suppression is spliced with the feature image output by the upsampling part of the feature extraction network, and the spliced feature image is input into the residual layer of the upsampling part, and the residual layer of the upsampling part outputs the image features of the image to be detected; the image features of the image to be detected are input into a target detection network to obtain a target category and a target frame.
[0049] The specific method of performing edge enhancement on the image to be detected and obtaining the edge image E is to use the Sobel operator to perform longitudinal and transverse edge detection on the image to be detected. The edge detection formula of the Sobel operator is as follows:
[0050]
[0051] Among them, I is the image to be detected, E x is the vertical edge image of the image to be detected, E y is the horizontal edge image of the image to be detected, and E is the edge image of the image to be detected.
[0052] The feature denoising module is implemented using the non-local means (NL-means) algorithm. Figure 3A structural schematic diagram of a feature denoising module using a non-local mean algorithm is shown. The denoising process of the feature denoising module on the input feature is specifically as follows: the input feature is H*W*C, the input feature H*W*C is first converted into a vector to obtain a first vector HW*C, a second vector HW*C, and a third vector HW*C, the second vector HW*C is transposed to obtain a fourth vector C*HW, the first vector HW*C and the fourth vector C*HW are matrix-multiplied to obtain a first matrix HW*HW, and the first matrix HW*HW is further processed , and multiply it with the third vector HW*C to obtain the fifth vector HW*C, convert the fifth vector HW*C into a second matrix H*W*C, perform 1*1 convolution on the second matrix H*W*C, and then add the pixels with the input feature H*W*C to obtain the output feature H*W*C after noise reduction processing; wherein H is the height of the input feature, W is the width of the input feature, and C is the number of channels. One way to further process the first matrix HW*HW is to use the Softmax function to calculate the first matrix HW*HW.
[0053] The object detection network is implemented using one of the following methods: R-CNN, Fast R-CNN, Faster R-CNN, Mask RCNN.
[0054] It should be noted that the implementation of the above target detection network is not intended to be a limitation of the present invention, and in other embodiments, different implementations may be selected.
[0055] Embodiment three:
[0056] The present invention also provides a device for target detection, such as Figure 4 As shown, the device includes a processor 401, a memory 402, a bus 403, and a computer program stored in the memory 402 and executable on the processor 401. The processor 401 includes one or more processing cores. The memory 402 is connected to the processor 401 via the bus 403. The memory 402 is used to store program instructions. When the processor executes the computer program, the steps in the above method embodiment of the present invention are implemented.
[0057] Further, as an executable solution, the target detection device can be a computing device such as a desktop computer, a notebook, a PDA, and a cloud server. The system / electronic device may include, but is not limited to, a processor and a memory. Those skilled in the art will understand that the composition structure of the above-mentioned system / electronic device is only an example of the system / electronic device and does not constitute a limitation on the system / electronic device. It may include more or less components than the above, or a combination of certain components, or different components. For example, the system / electronic device may also include input and output devices, network access devices, buses, etc., which are not limited in the embodiments of the present invention.
[0058] Further, as an executable solution, the processor may be a central processing unit (CPU), other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc. The processor is the control center of the system / electronic device, and uses various interfaces and lines to connect various parts of the entire system / electronic device.
[0059] The memory can be used to store the computer program and / or module, and the processor realizes various functions of the system / electronic device by running or executing the computer program and / or module stored in the memory, and calling the data stored in the memory. The memory can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system and an application required for at least one function; the data storage area can store data created according to the use of the mobile phone, etc. In addition, the memory can include a high-speed random access memory, and can also include a non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (SecureDigital, SD) card, a flash card (Flash Card), at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.
[0060] Embodiment 4:
[0061] The present invention also provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the above method in the embodiment of the present invention are implemented.
[0062] If the module / unit integrated in the system / electronic device is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present invention implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM, Read-Onny Memory), random access memory (RAM, Random Access Memory) and software distribution medium, etc. It should be noted that the content contained in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction.
[0063] Although the present invention has been specifically shown and described in conjunction with the preferred embodiments, it should be understood by those skilled in the art that various changes may be made to the present invention in form and details without departing from the spirit and scope of the present invention as defined by the appended claims, all of which are within the scope of protection of the present invention.
Claims
1. A method for target detection, characterized in that: include: S1, obtaining the image to be detected; S2, performing edge detection processing on the image to be detected to obtain a first image; S3, processing the image to be detected by a preset feature extraction network to obtain a second image of the image to be detected, and using the first image to process the second image to enhance edge features of the second image; Wherein, the preset feature extraction network is implemented using a feature pyramid network; The step S3 specifically includes: outputting the second image in the downsampling part of the feature pyramid network, downsampling and convolving the first image to generate an attention image, and using the attention image to enhance the edge features of the second image; S4, the preset feature extraction network includes a feature denoising module, and the feature denoising module is used to perform denoising processing on the second image with enhanced edge features; S5, using the preset feature extraction network to process the second image after the denoising process to obtain image features, and inputting the image features into a preset target detection network to obtain a target category and a target frame.
2. The method according to claim 1, characterized in that The edge detection process is performed on the image to be detected to obtain the first image, specifically: edge detection is performed on the image to be detected using a Sobel operator to obtain the first image.
3. The method according to claim 2, characterized in that The edge detection formula of the Sobel operator is as follows: Where, I is the image to be detected, E x is the vertical edge image of the image to be detected, E y is the horizontal edge image of the image to be detected, and E is the first image.
4. The method according to claim 1, characterized in that: In step S5, the second image after denoising is processed using the preset feature extraction network to obtain image features, specifically, a feature image is output in the upsampling part of the feature pyramid network, the feature image is spliced using the second image after denoising, and the spliced feature image is processed to obtain the image features.
5. The method according to claim 1, characterized in that The feature denoising module is implemented based on a non-local means algorithm.
6. The method according to claim 1, characterized in that The preset target detection network is implemented in one of the following ways: RCNN, Fast RCNN, Faster RCNN, Mask RCNN.
7. A target detection device, characterized in that: The method comprises a memory and a processor, wherein the memory stores at least one program, and the at least one program is executed by the processor to implement the target detection method according to any one of claims 1 to 6.
8. A computer-readable storage medium, characterized in that: The storage medium stores at least one program, and the at least one program is executed by a processor to implement the target detection method according to any one of claims 1 to 6.
Citation Information
Patent Citations
X-Ray picture femoral shaft fracture detection method based on non-local separation attention mechanism
CN113129278A