Target detection method and network based on feature enhancement and global attention
Through the target detection method of feature enhancement and global attention, the problem of weak and small target detection in infrared images is solved, the detection accuracy is improved, and the accurate identification of weak and small targets is achieved.
Patent Information
- Application Number
- CN202311061934.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-22
- Publication Date
- 2024-09-13
AI Technical Summary
Weak and small targets in infrared images are difficult to detect accurately, resulting in reduced application accuracy of infrared remote sensing detection systems.
The target detection method based on feature enhancement and global attention is used to process the infrared image through the feature extraction sub-network, precise global attention sub-network and target center point coordinate estimation sub-network to obtain the center point coordinates and confidence of weak and small targets.
The detection accuracy of weak and small targets in infrared images is improved, allowing the target detection network to more effectively extract key information of weak and small targets from the infrared background and output accurate center point coordinates and confidence.
Smart Images

Figure CN118644757A
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of infrared image target detection, and more specifically, to a target detection method and network based on feature enhancement and global attention. Background Art
[0002] Infrared images are converted into infrared grayscale images by infrared equipment. Target detection technology is to identify the target of the infrared image that has been pre-processed, so as to obtain the movement of the target.
[0003] However, in order to maximize the advantages of infrared remote sensing detection systems, the infrared detection distance is often relatively far, which causes the infrared radiation of the detected target to show the characteristics of a weak target, and it is difficult to accurately detect weak targets in infrared images, which leads to a decrease in the accuracy of infrared image applications. It should be noted that according to the definition of the International Society for Optical Engineering, targets with a pixel size of ≤9×9 are considered weak targets, and small targets with a local signal-to-clutter ratio of ≤9dB (7.94) are considered weak targets.
[0004] In summary, how to accurately detect small targets in infrared images is a problem that needs to be solved urgently by those skilled in the art. Summary of the invention
[0005] The purpose of this application is to provide a target detection method based on feature enhancement and global attention, which can solve the technical problem of how to accurately detect weak targets in infrared images to a certain extent. This application also provides a target detection network based on feature enhancement and global attention.
[0006] In order to achieve the above objectives, this application provides the following technical solutions:
[0007] A target detection method based on feature enhancement and global attention, comprising:
[0008] Acquire the original infrared image to be detected;
[0009] Performing feature pre-extraction on the original infrared image to obtain feature enhancement data;
[0010] Transmitting the original infrared image and the feature enhancement data to a pre-trained target detection network;
[0011] Obtaining the center point coordinates and confidence in the original infrared image output by the target detection network;
[0012] Among them, the target detection network includes a feature extraction subnetwork, a precise global attention subnetwork, and a target center point coordinate estimation subnetwork; the feature extraction subnetwork is used to perform feature processing on the original infrared image and the feature enhancement data to obtain a target feature image; the precise global attention subnetwork is used to process the target feature image based on a cascaded precise channel attention mechanism and a precise spatial attention mechanism to obtain a precise global attention feature map; the target center point coordinate estimation subnetwork is used to convolve the precise global attention feature map to obtain the center point coordinates and confidence.
[0013] Preferably, the feature extraction subnetwork is used to: perform feature extraction on the original infrared image and the feature enhancement data respectively to obtain a first feature and a second feature; fuse the first feature and the second feature to obtain a third feature; perform feature extraction on the third feature to obtain a first-scale feature image, a second-scale feature image and a third-scale feature image, and use the first-scale feature image, the second-scale feature image and the third-scale feature image as the target feature image.
[0014] Preferably, the precise global attention subnetwork is used to: for any target scale feature image in the target feature map, convert the channel dimension of the target scale feature image to the time dimension based on the precise channel attention mechanism to obtain a converted feature map, use a single-channel global convolution and activation function to output the channel attention weight of the converted feature map, delete the time dimension in the channel attention weight to obtain precise channel attention, perform dot multiplication of the precise channel attention with the target scale feature image, and obtain a corresponding precise channel attention feature map.
[0015] Preferably, the precise global attention subnetwork is used for: for each of the precise channel attention feature maps, performing point convolution on the precise channel attention feature map based on the precise spatial attention mechanism to obtain channel statistical information with an output channel number of 1, activating the channel statistical information through an activation function to obtain spatial attention weights, and performing point multiplication of the spatial attention weights with the precise channel attention feature map to obtain the corresponding precise global attention feature map.
[0016] Preferably, the target center point coordinate estimation subnetwork includes three channels, each of which is used to output the center point coordinates and the confidence of the corresponding precise global attention feature map.
[0017] Preferably, the feature extraction subnetwork includes YOLOv3, and the YOLOv3 includes a first extraction layer, a Concat layer, and a second extraction layer connected in sequence;
[0018] The first extraction layer is used to perform feature extraction on the original infrared image and the feature enhancement data respectively to obtain the first feature and the second feature, and the first extraction layer includes a first input end, a first convolution layer connected to the first input end, n first DarkBlocks connected to the first convolution layer, a second input end, a second convolution layer connected to the second input end, and n second DarkBlocks connected to the second convolution layer, where n is greater than or equal to 0;
[0019] The Concat layer is used to merge the first feature and the second feature to obtain the third feature;
[0020] The second extraction layer is used to extract the third feature to obtain the target feature image. The second extraction layer includes m third DarkBlocks connected in sequence, a fourth DarkBlock and a fifth DarkBlock connected in sequence to the last third DarkBlock, and m is greater than or equal to 0.
[0021] Preferably, the pre-extracting features of the original infrared image to obtain feature enhancement data includes:
[0022] The original infrared image is subjected to feature pre-extraction to obtain the feature enhancement data, wherein the feature pre-extraction includes top-hat transformation processing, and / or three-layer template local difference measurement processing, and / or local signal-to-clutter ratio processing, and / or gradient vector field processing.
[0023] An object detection network, comprising:
[0024] A feature extraction subnetwork, used for performing feature processing on the input original infrared image and feature enhancement data to obtain a target feature image; the feature enhancement data includes data obtained after feature pre-extraction on the original infrared image;
[0025] A precise global attention subnetwork connected to the feature extraction subnetwork, for processing the target feature image based on a cascaded precise channel attention mechanism and a precise spatial attention mechanism to obtain a precise global attention feature map;
[0026] The target center point coordinate estimation subnetwork connected to the precise global attention subnetwork is used to convolve the precise global attention feature map to obtain the center point coordinates and confidence.
[0027] The present application provides a target detection method based on feature enhancement and global attention, which comprises the following steps: obtaining an original infrared image to be detected; pre-extracting features of the original infrared image to obtain feature enhancement data; transmitting the original infrared image and the feature enhancement data to a pre-trained target detection network; obtaining the center point coordinates and confidence in the original infrared image output by the target detection network; wherein the target detection network comprises a feature extraction subnetwork, a precise global attention subnetwork, and a target center point coordinate estimation subnetwork; the feature extraction subnetwork is used to perform feature processing on the original infrared image and the feature enhancement data to obtain a target feature image; the precise global attention subnetwork is used to process the target feature image based on a cascaded precise channel attention mechanism and a precise spatial attention mechanism to obtain a precise global attention feature map; the target center point coordinate estimation subnetwork is used to perform convolution on the precise global attention feature map to obtain the center point coordinates and confidence. This application performs feature pre-extraction on the original infrared image, so that small targets can be detected from the infrared background, and the obtained feature enhancement data can effectively help the target detection network to mine the key information of small targets. In addition, the target detection network can highlight the key information of detecting small targets with the help of the precise global attention sub-network, and then accurately output the center point coordinates and confidence of small targets. The target detection network based on feature enhancement and global attention provided by this application also solves the corresponding technical problems. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.
[0029] Figure 1 A flowchart of a target detection method based on feature enhancement and global attention provided in an embodiment of the present application;
[0030] Figure 2 This is a schematic diagram of the structure of the precise global attention sub-network;
[0031] Figure 3 The data flow diagram of the target detection method based on feature enhancement and global attention of this application;
[0032] Figure 4 This is a schematic diagram of the DarkBasic structure;
[0033] Figure 5 Schematic diagram of the structure of the target detection network in this application;
[0034] Figure 6It is a schematic diagram of the feature extraction sub-network based on feature level-2 fusion;
[0035] Figure 7 A schematic diagram of the structure of an object detection system based on feature enhancement and global attention provided in an embodiment of the present application;
[0036] Figure 8 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application;
[0037] Fig. 9 Another structural schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0038] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0039] See also Figure 1 , Figure 1 A flowchart of a target detection method based on feature enhancement and global attention provided in an embodiment of the present application.
[0040] An object detection method based on feature enhancement and global attention provided in an embodiment of the present application may include the following steps:
[0041] Step S101: Acquire an original infrared image to be detected.
[0042] In practical applications, the original infrared image to be used for target detection may be obtained first. The method for generating the original infrared image may be determined according to the application scenario, and this application does not make any specific limitation thereto.
[0043] Step S102: pre-extracting features of the original infrared image to obtain feature enhancement data.
[0044] In practical applications, after obtaining the original infrared image to be detected, considering that one of the reasons why weak targets are difficult to detect accurately is the lack of semantic information, the present application can perform feature pre-extraction on the original infrared image to obtain feature enhancement data that can detect weak targets from the infrared background, so as to help the deep learning network capture key information more effectively and improve the detection performance of weak targets.
[0045] In specific application scenarios, the method of pre-extracting features of the original infrared image can be determined according to actual needs. For example, the original infrared image can be pre-extracted to obtain feature enhancement data. The feature pre-extraction includes top-hat transformation processing, and / or three-layer template local difference measurement processing, and / or local signal-to-clutter ratio processing, and / or gradient vector field processing, etc.
[0046] Among them, the top-hat transform is a morphological tool that distinguishes the target from the background. Morphology is an image analysis method based on geometry that removes irrelevant structures through set operations and maintains the shape characteristics of the image. Specifically, it extracts the structural information in the image by continuously moving and calculating a structural operator in the image. Generally speaking, the size of the structural operator needs to be slightly larger than the target size. The top-hat transform uses a structural operator to open the original image to remove the bright spots in the image, and then subtracts the original image from the image after the opening operation to obtain the small target in the image. Its calculation formula is: Among them, Ori is the original infrared image, se is the structure operator, and TopHat is the image after top hat transformation. It represents the opening operation, that is, the image is first eroded and then expanded.
[0047] Among them, the local difference measurement processing of the three-layer template is based on the differences in grayscale distribution among the three-layer templates. This method combines the grayscale difference measurement and variance difference measurement, and proposes a three-layer template local difference measurement to enhance the target while suppressing the background; the gradient vector field is composed of the gradient in the horizontal direction and the gradient in the vertical direction of the image.
[0048] Among them, local signal-to-clutter ratio processing, that is, calculating the signal-to-clutter ratio of each pixel in the original infrared image relative to its local background, is the local signal-to-clutter ratio image SCR, and the calculation formula is as follows:
[0049]
[0050] Among them, Ori represents the original infrared image, μ LB and σ LB are the mean and standard deviation of the local background at point (x, y) in the original infrared image.
[0051] Step S103: Transmitting the original infrared image and feature enhancement data to a pre-trained target detection network.
[0052] Step S104: Obtain the center point coordinates and confidence in the original infrared image output by the target detection network; wherein the target detection network includes a feature extraction subnetwork, a precise global attention subnetwork, and a target center point coordinate estimation subnetwork; the feature extraction subnetwork is used to perform feature processing on the original infrared image and feature enhancement data to obtain a target feature image; the precise global attention subnetwork is used to process the target feature image based on a cascaded precise channel attention mechanism and a precise spatial attention mechanism to obtain a precise global attention feature map; the target center point coordinate estimation subnetwork is used to perform convolution on the precise global attention feature map to obtain the center point coordinates and confidence.
[0053] In practical applications, after obtaining the original infrared image and feature enhancement data, the original infrared image and feature enhancement data can be transmitted to a pre-trained target detection network, and the center point coordinates and confidence of the detected object in the original infrared image output by the target detection network can be obtained, and the target detection network can be a deep learning network.
[0054] It should be noted that, considering that the deep learning detection box and intersection-over-union ratio of conventional target detection tasks are difficult to apply to weak targets, the detection accuracy of weak targets is relatively poor. Therefore, in order to further improve the detection accuracy of weak targets, the target detection network in this application includes a feature extraction subnetwork, a precise global attention subnetwork, and a target center point coordinate estimation subnetwork; the feature extraction subnetwork is used to perform feature processing on the original infrared image and feature enhancement data, such as feature extraction, fusion, etc., to obtain a target feature image; the precise global attention subnetwork is an attention mechanism of a deep learning network model, which highlights the key information for detecting weak targets by applying channel and spatial weights to the feature map. It is used to process the target feature image based on the cascaded precise channel attention mechanism and the precise spatial attention mechanism to obtain a precise global attention feature map to highlight the key information for detecting weak targets; the target center point coordinate estimation subnetwork is used to convolve the precise global attention feature map to obtain the center point coordinates (x, y) and confidence p.
[0055] The present application provides a target detection method based on feature enhancement and global attention, which comprises the following steps: obtaining an original infrared image to be detected; pre-extracting features of the original infrared image to obtain feature enhancement data; transmitting the original infrared image and the feature enhancement data to a pre-trained target detection network; obtaining the center point coordinates and confidence in the original infrared image output by the target detection network; wherein the target detection network comprises a feature extraction subnetwork, a precise global attention subnetwork, and a target center point coordinate estimation subnetwork; the feature extraction subnetwork is used to perform feature processing on the original infrared image and the feature enhancement data to obtain a target feature image; the precise global attention subnetwork is used to process the target feature image based on a cascaded precise channel attention mechanism and a precise spatial attention mechanism to obtain a precise global attention feature map; the target center point coordinate estimation subnetwork is used to perform convolution on the precise global attention feature map to obtain the center point coordinates and confidence. This application performs feature pre-extraction on the original infrared image so that small targets can be detected from the infrared background, and the obtained feature enhancement data can effectively help the target detection network to mine the key information of small targets. In addition, the target detection network can highlight the key information for detecting small targets with the help of the precise global attention sub-network, and then can accurately output the center point coordinates and confidence of the small targets.
[0056] On the basis of the foregoing embodiments, the embodiment of the present application provides a method for target detection based on feature enhancement and global attention, in which the feature extraction subnetwork can be specifically used to: extract features from the original infrared image and the feature enhancement data respectively, such as extracting features through the first convolutional layer to obtain the first feature and the second feature; fuse the first feature and the second feature to obtain the third feature; extract features from the third feature, such as extracting features through the second convolutional layer to obtain feature images of three scales, namely, the first scale feature image, the second scale feature image and the third scale feature image, wherein the dimension C and the size (H*W, i.e., height*width) are different, and the first scale feature image, the second scale feature image and the third scale feature image are used as the target feature image. It should be noted that the number of scale feature images in the target feature image may not be limited to three, and can be flexibly determined according to actual application requirements.
[0057] Correspondingly, the precise global attention subnetwork can be specifically used for: for any target scale feature image in the target feature map (N×C×H×W, where N represents the number of channels of the image), based on the precise channel attention mechanism, the channel dimension (C) of the target scale feature image is converted to the time dimension (D) to obtain the conversion feature map [N×1×C(D)×H×W)], and the channel attention weight (N×1×C×1×1) of the conversion feature map is output by single-channel global convolution and activation function, and the time dimension in the channel attention weight is deleted to obtain the precise channel attention (N×C×1×1), and the precise channel attention is dot-multiplied with the target scale feature image to obtain the corresponding precise channel attention feature map. It should be noted that the single-channel global convolution is to use the same global convolution kernel on each channel to establish The explicit relationship between channel weights and the importance of each channel information is as follows: each channel uses the same convolution kernel and performs convolution independently. Furthermore, single-channel global convolution can be achieved by increasing and transforming dimensions and using a 3D convolution kernel with a time dimension of 1. The precise global attention subnetwork can be specifically used for: for each precise channel attention feature map, point convolution is performed on the precise channel attention feature map based on the precise spatial attention mechanism to obtain channel statistics with an output channel number of 1. The channel statistics are activated through an activation function to obtain spatial attention weights (N×1×H×W). The spatial attention weights are point-multiplied with the precise channel attention feature map to obtain the corresponding precise global attention feature map. That is, there are several scale feature images, and several precise global attention feature maps are obtained. Among them, the activation function can be a sigmoid activation function. At this time, the structure of the precise global attention subnetwork can be as follows: Figure 2 shown.
[0058] Correspondingly, the target center point coordinate estimation subnetwork may include three channels, each channel is used to output the center point coordinates and confidence of the corresponding precise global attention feature map, that is, one precise global attention feature map corresponds to one channel. And the size of the three channels can be determined according to actual needs, for example, the size of the three channels can be 8×8, 16×16 and 32×32 respectively, that is, the number of center point estimates at the three output ends is 64, 256 and 1024 respectively.
[0059] For specific application scenarios, please refer to Figure 3 , the feature extraction subnetwork in the target detection network of the present application can be YOLOv3, and specifically can use Darknet53 in YOLOv3, Darknet53 is composed of DarkBlock, DarkBlock is composed of a downsampling 3×3 convolution with a step size of 2 and several DarkBasics, and DarkBasic is a residual unit composed of 1×1 convolution and 3×3 convolution, such as Figure 4As shown, DarkBlock(N)=3×3Conv(stride=2)+N×DarkBasic. In this process, the architecture of YOLOv3 can be adjusted as needed. For example, YOLOv3 may include a first extraction layer, a Concat layer, and a second extraction layer connected in sequence; the first extraction layer is used to extract features from the original infrared image and the feature enhancement data, respectively, to obtain a first feature and a second feature. The first extraction layer includes a first input terminal, a first convolutional layer connected to the first input terminal, n first DarkBlocks connected to the first convolutional layer, a second input terminal, a second convolutional layer connected to the second input terminal, and n second DarkBl connected to the second convolutional layer. ock, n is greater than or equal to 0; the Concat layer is used to fuse the first feature and the second feature to obtain the third feature; the second extraction layer is used to extract the third feature to obtain the target feature image, and the second extraction layer includes m third DarkBlocks connected in sequence, and the fourth DarkBlock and the fifth DarkBlock connected in sequence with the last third DarkBlock, m is greater than or equal to 0, and the values of m and n can be determined according to actual needs, for example, the values of m and n can be determined according to the restriction condition of m+n=3, and when the value of m is 0, there is no third DarkBlock at this time, and the fourth DarkBlock is directly connected to the Concat layer.
[0060] For ease of understanding, assume that the structure of the target detection network in this application is as follows Figure 5 As shown, the parameters of each layer can be shown in the figure, where the precise global attention mechanism is placed after the feature map output by YoloBlock to help the network better capture the key information for detecting weak targets, where YoloBlock(C)=2×1[1×1Conv(C)+3×3Conv(2C)]+1×1Conv(C), C represents channels; if the input layer is set to pixel level, Figure 5 The output of the first convolutional layer is defined as feature level-1, the output of the first DarkBlock is defined as feature level-2, the output of the second DarkBlock is defined as feature level-3, and the output of the third DarkBlock is defined as feature level-4. In the feature enhancement based on pixel-level fusion, the original infrared image and the feature enhancement data are constructed into multi-channel data as input. In the feature enhancement based on the fusion of feature level-1, feature level-2, feature level-3, and feature level-4, the network before feature fusion is split into multiple parallel networks to extract features from the original infrared image and feature enhancement data respectively. The sum of the number of channels of the convolutional layers of the parallel networks is equal to the number of channels of the corresponding layers of the network before the split, such as Figure 6As shown, it is a schematic diagram of single feature enhancement based on feature level-2 fusion. At this time, n=1, m=2, the first DarkBlock and the second DarkBlock are both DarkBlock(1), the third DarkBlock is DarkBlock(2) and DarkBlock(8), the fourth DarkBlock is DarkBlock(8), and the fifth DarkBlock is DarkBlock(4). Of course, the fusion can also be started from feature level-1, feature level-3 or feature level-4. At this time, it is only necessary to adjust the number of DarkBlocks in the first extraction layer and the second extraction layer according to this framework.
[0061] See also Figure 7 , Figure 7 A schematic diagram of the structure of a target detection system based on feature enhancement and global attention provided in an embodiment of the present application.
[0062] An object detection system based on feature enhancement and global attention provided in an embodiment of the present application may include:
[0063] The original infrared image acquisition module 101 is used to acquire the original infrared image to be detected;
[0064] The pre-extraction module 102 is used to perform feature pre-extraction on the original infrared image to obtain feature enhancement data;
[0065] A transmission module 103 is used to transmit the original infrared image and feature enhancement data to a pre-trained target detection network;
[0066] The detection result acquisition module 104 is used to obtain the center point coordinates and confidence level in the original infrared image output by the target detection network;
[0067] Among them, the target detection network includes a feature extraction subnetwork, a precise global attention subnetwork, and a target center point coordinate estimation subnetwork; the feature extraction subnetwork is used to perform feature processing on the original infrared image and feature enhancement data to obtain the target feature image; the precise global attention subnetwork is used to process the target feature image based on the cascaded precise channel attention mechanism and the precise spatial attention mechanism to obtain the precise global attention feature map; the target center point coordinate estimation subnetwork is used to convolve the precise global attention feature map to obtain the center point coordinates and confidence.
[0068] An embodiment of the present application provides a target detection system based on feature enhancement and global attention, wherein the feature extraction subnetwork is used to: perform feature extraction on the original infrared image and the feature enhancement data respectively to obtain a first feature and a second feature; fuse the first feature and the second feature to obtain a third feature; perform feature extraction on the third feature to obtain a first-scale feature image, a second-scale feature image, and a third-scale feature image, and use the first-scale feature image, the second-scale feature image, and the third-scale feature image as a target feature image.
[0069] An embodiment of the present application provides a target detection system based on feature enhancement and global attention, and a precise global attention subnetwork is used to: for any target scale feature image in a target feature map, convert the channel dimension of the target scale feature image to the time dimension based on a precise channel attention mechanism to obtain a converted feature map, use a single-channel global convolution and activation function to output the channel attention weight of the converted feature map, delete the time dimension in the channel attention weight, obtain precise channel attention, and perform dot multiplication of the precise channel attention with the target scale feature image to obtain a corresponding precise channel attention feature map.
[0070] An embodiment of the present application provides a target detection system based on feature enhancement and global attention, and the precise global attention subnetwork is used to: for each precise channel attention feature map, perform point convolution on the precise channel attention feature map based on the precise spatial attention mechanism to obtain channel statistical information with an output channel number of 1, activate the channel statistical information through an activation function to obtain a spatial attention weight, perform point multiplication of the spatial attention weight with the precise channel attention feature map, and obtain a corresponding precise global attention feature map.
[0071] An embodiment of the present application provides a target detection system based on feature enhancement and global attention, wherein the target center point coordinate estimation subnetwork includes three channels, each channel being used to output the center point coordinates and confidence of a corresponding precise global attention feature map.
[0072] An embodiment of the present application provides a target detection system based on feature enhancement and global attention, wherein the feature extraction subnetwork includes YOLOv3, and YOLOv3 includes a first extraction layer, a Concat layer, and a second extraction layer connected in sequence; the first extraction layer is used to perform feature extraction on the original infrared image and the feature enhancement data respectively to obtain a first feature and a second feature, and the first extraction layer includes a first input end, a first convolutional layer connected to the first input end, n first DarkBlocks connected to the first convolutional layer, a second input end, a second convolutional layer connected to the second input end, and n second DarkBlocks connected to the second convolutional layer, where n is greater than or equal to 0; the Concat layer is used to fuse the first feature and the second feature to obtain a third feature; the second extraction layer is used to perform feature extraction on the third feature to obtain a target feature image, and the second extraction layer includes m third DarkBlocks connected in sequence, a fourth DarkBlock and a fifth DarkBlock connected in sequence to the last third DarkBlock, where m is greater than or equal to 0.
[0073] An embodiment of the present application provides a target detection system based on feature enhancement and global attention, and the pre-extraction module can be specifically used to: perform feature pre-extraction on the original infrared image to obtain feature enhancement data, and the feature pre-extraction includes top-hat transformation processing, and / or three-layer template local difference measurement processing, and / or local signal-to-clutter ratio processing, and / or gradient vector field processing.
[0074] The present application also provides a target detection network, including:
[0075] The feature extraction subnetwork is used to perform feature processing on the input original infrared image and feature enhancement data to obtain a target feature image; the feature enhancement data includes data obtained after feature pre-extraction on the original infrared image;
[0076] The precise global attention sub-network connected to the feature extraction sub-network is used to process the target feature image based on the cascaded precise channel attention mechanism and the precise spatial attention mechanism to obtain a precise global attention feature map;
[0077] The target center point coordinate estimation subnetwork connected to the precise global attention subnetwork is used to convolve the precise global attention feature map to obtain the center point coordinates and confidence.
[0078] The corresponding description of a target detection network provided in an embodiment of the present application can be found in the above embodiment and will not be repeated here.
[0079] The present application also provides an electronic device and a computer-readable storage medium, both of which have the corresponding effects of the target detection method based on feature enhancement and global attention provided in the embodiment of the present application. Figure 8 , Figure 8 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application.
[0080] An electronic device provided in an embodiment of the present application includes a memory 201 and a processor 202. The memory 201 stores a computer program. When the processor 202 executes the computer program, the steps of the target detection method based on feature enhancement and global attention as described in any of the above embodiments are implemented.
[0081] See also Fig. 9 , another electronic device provided in the embodiment of the present application may also include: an input port 203 connected to the processor 202, for transmitting commands input from the outside to the processor 202; a display unit 204 connected to the processor 202, for displaying the processing results of the processor 202 to the outside; a communication module 205 connected to the processor 202, for realizing communication between the electronic device and the outside. The display unit 204 can be a display panel, a laser scanning display, etc.; the communication mode adopted by the communication module 205 includes but is not limited to mobile high-definition link technology (MHL), universal serial bus (USB), high-definition multimedia interface (HDMI), wireless connection: wireless fidelity technology (WiFi), Bluetooth communication technology, low-power Bluetooth communication technology, and communication technology based on IEEE802.11s.
[0082] An embodiment of the present application provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the steps of the target detection method based on feature enhancement and global attention as described in any of the above embodiments are implemented.
[0083] The computer-readable storage medium involved in the present application includes random access memory (RAM), internal memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disks, removable disks, CD-ROMs, or any other form of storage medium known in the technical field.
[0084] For the description of the relevant parts of the target detection system based on feature enhancement and global attention, the electronic device, the computer-readable storage medium, and the target detection network provided in the embodiments of the present application, please refer to the detailed description of the corresponding parts in the target detection method based on feature enhancement and global attention provided in the embodiments of the present application, which will not be repeated here. In addition, the parts of the above-mentioned technical solutions provided in the embodiments of the present application that are consistent with the implementation principles of the corresponding technical solutions in the prior art are not described in detail to avoid excessive elaboration.
[0085] It should also be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0086] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A target detection method based on feature enhancement and global attention, characterized in that: include: Acquire the original infrared image to be detected; Performing feature pre-extraction on the original infrared image to obtain feature enhancement data; Transmitting the original infrared image and the feature enhancement data to a pre-trained target detection network; Obtaining the center point coordinates and confidence in the original infrared image output by the target detection network; Among them, the target detection network includes a feature extraction subnetwork, a precise global attention subnetwork, and a target center point coordinate estimation subnetwork; the feature extraction subnetwork is used to perform feature processing on the original infrared image and the feature enhancement data to obtain a target feature image; the precise global attention subnetwork is used to process the target feature image based on a cascaded precise channel attention mechanism and a precise spatial attention mechanism to obtain a precise global attention feature map; the target center point coordinate estimation subnetwork is used to convolve the precise global attention feature map to obtain the center point coordinates and confidence.
2. The method according to claim 1, characterized in that The feature extraction subnetwork is used to: perform feature extraction on the original infrared image and the feature enhancement data respectively to obtain a first feature and a second feature; fuse the first feature and the second feature to obtain a third feature; perform feature extraction on the third feature to obtain a first scale feature image, a second scale feature image and a third scale feature image, and use the first scale feature image, the second scale feature image and the third scale feature image as the target feature image.
3. The method according to claim 2, characterized in that The precise global attention subnetwork is used to: for any target scale feature image in the target feature map, convert the channel dimension of the target scale feature image to the time dimension based on the precise channel attention mechanism to obtain a converted feature map, use a single-channel global convolution and activation function to output the channel attention weight of the converted feature map, delete the time dimension in the channel attention weight to obtain precise channel attention, and perform dot multiplication of the precise channel attention with the target scale feature image to obtain a corresponding precise channel attention feature map.
4. The method according to claim 3, characterized in that The precise global attention subnetwork is used to: for each of the precise channel attention feature maps, perform point convolution on the precise channel attention feature map based on the precise spatial attention mechanism to obtain channel statistics with an output channel number of 1, activate the channel statistics through an activation function to obtain spatial attention weights, perform point multiplication of the spatial attention weights with the precise channel attention feature map to obtain the corresponding precise global attention feature map.
5. The method according to claim 4, characterized in that The target center point coordinate estimation subnetwork includes three channels, each of which is used to output the center point coordinates and the confidence of the corresponding precise global attention feature map.
6. The method according to claim 2, characterized in that The feature extraction subnetwork includes YOLOv3, and the YOLOv3 includes a first extraction layer, a Concat layer, and a second extraction layer connected in sequence; The first extraction layer is used to perform feature extraction on the original infrared image and the feature enhancement data respectively to obtain the first feature and the second feature, and the first extraction layer includes a first input end, a first convolution layer connected to the first input end, n first DarkBlocks connected to the first convolution layer, a second input end, a second convolution layer connected to the second input end, and n second DarkBlocks connected to the second convolution layer, where n is greater than or equal to 0; The Concat layer is used to merge the first feature and the second feature to obtain the third feature; The second extraction layer is used to extract the third feature to obtain the target feature image. The second extraction layer includes m third DarkBlocks connected in sequence, a fourth DarkBlock and a fifth DarkBlock connected in sequence to the last third DarkBlock, and m is greater than or equal to 0.
7. The method according to any one of claims 1 to 6, characterized in that: The pre-extracting of features of the original infrared image to obtain feature enhancement data includes: The original infrared image is subjected to feature pre-extraction to obtain the feature enhancement data, wherein the feature pre-extraction includes top-hat transformation processing, and / or three-layer template local difference measurement processing, and / or local signal-to-clutter ratio processing, and / or gradient vector field processing.
8. A target detection network, characterized in that: include: The feature extraction sub-network is used to perform feature processing on the input original infrared image and feature enhancement data to obtain the target feature image; The feature enhancement data includes data obtained after pre-extracting features of the original infrared image; A precise global attention subnetwork connected to the feature extraction subnetwork, for processing the target feature image based on a cascaded precise channel attention mechanism and a precise spatial attention mechanism to obtain a precise global attention feature map; The target center point coordinate estimation subnetwork connected to the precise global attention subnetwork is used to convolve the precise global attention feature map to obtain the center point coordinates and confidence.
Citation Information
Cited By
Infrared unmanned aerial vehicle detection method based on local and global attention adaptive selection
CN120431486A
Infrared unmanned aerial vehicle detection method based on local and global attention adaptive selection
CN120431486B
