Infrared low, small and slow target detection method, computer equipment and storage medium

By using teacher network and student network in infrared low small and slow target detection technology, combined with residual attention module and bidirectional cross-scale connection, and using knowledge distillation technology, the problems of large calculation amount and low efficiency in the existing technology are solved and achieved High-precision, high-speed infrared low, small and slow target detection.

CN117218512BActive Publication Date: 2024-10-11UNIV OF ELECTRONIC SCI & TECH OF CHINA CHONGQING INST OF MICROELECTRONICS IND TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311172320.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-09-11
Publication Date
2024-10-11
Estimated Expiration
2043-09-11

AI Technical Summary

Technical Problem

Among the existing infrared low, small and slow target detection technologies, the semantic segmentation algorithm has a large amount of calculation and low calculation efficiency, which cannot meet the needs of real-time detection.

Method used

An infrared low small slow target detection network is used, including a teacher network and a student network. Through image enhancement and shape feature extraction, combined with the residual attention module and bidirectional cross-scale connection, the network structure is optimized, and knowledge distillation technology is used to reduce the amount of calculation. At the same time Improve detection accuracy.

Benefits of technology

Without increasing the amount of calculation, the accuracy and segmentation accuracy of infrared low, small and slow target detection are improved, making it possible to achieve high-precision and high-speed detection on edge devices.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117218512B_ABST
    Figure CN117218512B_ABST
Patent Text Reader

Abstract

The present invention provides an infrared low, small and slow target detection method, a computer device and a storage medium. The method comprises: constructing an infrared low, small and slow target detection network including a loss function; training a teacher network in the infrared low, small and slow target detection network by a back propagation algorithm based on a training sample image set, and obtaining a deep teacher network after minimizing the loss function; training a student network in the infrared low, small and slow target detection network by a back propagation algorithm based on a training sample image set, and optimizing the student network based on an output result of the deep teacher network to obtain a target detection network; the model obtained by the present invention by means of knowledge distillation makes the model smaller and reduces the amount of calculation without losing detection accuracy, making it possible to run a high-precision and high-speed infrared low, small and slow target detection model on an edge device.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of data generation, and in particular to an infrared low, small and slow target detection method, a computer device and a storage medium. Background Art

[0002] With the continuous development of infrared low, small and slow target detection technology, there is a demand for infrared low, small and slow target information such as shape and boundary information. In addition, since infrared low, small and slow targets include various types of flying objects such as drones and balloons, there is no distinction between whether they are of a certain category during detection, and they can all be judged as low, small and slow targets. At present, semantic segmentation algorithms are usually used to detect infrared low, small and slow targets. However, the semantic segmentation algorithm has a large number of parameters and high redundancy, and has the problems of large computational complexity and low computational efficiency, which cannot meet the real-time detection needs of infrared low, small and slow targets. Summary of the invention

[0003] In view of the deficiencies in the prior art, the present invention provides an infrared low, small and slow target detection method, computer equipment and storage medium, which solve the problems of large computational complexity and low computational efficiency in the prior art infrared low, small and slow target detection method.

[0004] In a first aspect, the present invention provides an infrared low, small and slow target detection method, the method comprising: performing image enhancement and shape feature extraction on an initial data sample including a low, small and slow target to obtain a training sample image set; constructing an infrared low, small and slow target detection network including a loss function; wherein the infrared low, small and slow target detection network comprises a teacher network and a student network; training the teacher network in the infrared low, small and slow target detection network by a back propagation algorithm based on the training sample image set, and obtaining a deep teacher network after minimizing the loss function; training the student network in the infrared low, small and slow target detection network by a back propagation algorithm based on the training sample image set, and optimizing the student network based on the output result of the deep teacher network to obtain a target detection network; inputting an image to be identified into the target detection network, and outputting an infrared low, small and slow target detection result.

[0005] Optionally, the infrared low, small and slow target detection network includes: in the encoding stage of the encoding layer, a residual attention module is used as a feature extraction module, combined with bidirectional cross-scale connections, to extract multi-scale features of infrared low, small and slow targets; in the decoding stage of the decoding layer, a residual attention module is used as a feature reconstruction module, and feature maps of different scales of each layer are fused through parameter-shared residual attention blocks to enhance the features of infrared low, small and slow targets; wherein the residual attention module in the teacher network is stacked to three layers, and the residual attention module in the student network is a single layer.

[0006] Optionally, the residual attention block includes: a first convolution block, a first batch of normalization layers, a first activation layer, a second convolution block, a second batch of normalization layers, a channel attention block, a spatial attention block, a residual connection layer, and a second activation layer connected in sequence; the formula expression is:

[0007] Y=RELU(X+Spatial(Cannnel(BN2(Conv2 3x3 (RELU(BN1(Conv1 3x3 (X))))))))

[0008] Among them, X and Y are input and output, RELU() represents the RELU activation function, BN1() and BN2() are batch normalization, Conv1() and Conv2() are convolution operations, Spatial() and Cannnel() are spatial attention blocks and channel attention blocks respectively, and the channel attention block formula is X and Y are input and output, σ() is the sigmoid activation function, P avg () and P max () are average pooling and maximum pooling operations respectively, MLP() is a multi-layer perceptron, is element-by-element multiplication; the spatial attention formula is: X and Y are input and output, σ() is the sigmoid activation function, P avg () and P max () are average pooling and maximum pooling operations respectively, and [;] are channel concatenation operations.

[0009] Optionally, the input of the residual attention module is the concatenation of the output of the previous layer and the output of the same layer on the channel:

[0010] Y i = RAM([Conv 3×3 (up(X i-1 ));X i ])

[0011] Among them, X i With Y i is the input and output of the i-th layer, RAM() is the residual attention module, [;] is the channel concatenation operation, Conv 3×3 is a 3×3 convolution operation, and up() is a (2, 2) upsampling operation.

[0012] Optionally, the target shape of the decoding stage of the decoding layer fuses the five outputs obtained from each layer of the decoding layer, converts the five outputs into feature maps of the same size and number of channels by upsampling of different sizes and 1x1 convolution, and then splices them with the target shape image. After the 1×1 convolution operation, the formula for obtaining the final target shape output is:

[0013] Y = Conv([X shape ;X fuse ]);

[0014] X fuse =[X 1 ; up 2 (X 2 ); up 4 (X 3 ); up 8 (X 4 ); up 16 (X 5 )];

[0015] Among them, X shape With X fuse They are the output after target shape extraction and the result of fusion of each layer of the decoding layer, X 1 -X 5 is the output of each decoding layer, up 2 -up 16 is an upsampling of size (2, 2)-(16, 16), Y is the target shape output, and Conv() is the convolution module operation.

[0016] Optionally, the teacher network in the infrared low, small and slow target detection network is trained by a back-propagation algorithm based on a training sample image set, and a deep teacher network is obtained after minimizing the loss function, including: based on the training sample image set, the network is trained by a back-propagation algorithm based on mini-batch gradient descent to generate an image intersection-over-union (IoU) ratio in the training sample image set; wherein the input is a sample image in the training sample image set, and the output is a binary mask image; the loss function of the network is calculated according to the image intersection-over-union (IoU) ratio, and when the loss function is minimized, an optimized deep teacher network is obtained.

[0017] Optionally, a student network in the infrared low, small and slow target detection network is trained by a back-propagation algorithm based on a training sample image set, and the student network is optimized based on an output result of a deep teacher network to obtain a target detection network, including: inputting the training sample image set into the student network for training, and calculating a distillation loss based on the output result obtained by inputting the training sample image set into the deep teacher network; obtaining a loss function of the student network based on the distillation loss, and optimizing the loss function by a back-propagation algorithm to obtain the target detection network.

[0018] Optionally, shape feature extraction is performed on the initial data sample, including: performing convolution operations on the initial data sample with multiple template images respectively to obtain an initial gradient image; wherein the multiple template images include template images in four directions of horizontal, vertical, 45° and 135° of the center point of the image window; performing local edge gradient screening and enhancement on the initial gradient image according to the local gradient mean to obtain a preprocessed gradient image; performing edge extraction and refinement on the preprocessed gradient image to obtain a refined gradient image; performing image binarization on the refined gradient image to obtain a training sample image including shape features.

[0019] In a second aspect, the present invention provides a computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the following steps when executing the computer program: performing image enhancement and shape feature extraction on an initial data sample including low, small, and slow targets to obtain a training sample image set; constructing an infrared low, small, and slow target detection network including a loss function; wherein the infrared low, small, and slow target detection network comprises a teacher network and a student network; training the teacher network in the infrared low, small, and slow target detection network by a back propagation algorithm based on the training sample image set, and obtaining a deep teacher network after minimizing the loss function; training the student network in the infrared low, small, and slow target detection network by a back propagation algorithm based on the training sample image set, and optimizing the student network based on the output result of the deep teacher network to obtain a target detection network; inputting the image to be identified into the target detection network, and outputting the infrared low, small, and slow target detection result.

[0020] In a third aspect, the present invention provides a readable storage medium having a computer program stored thereon, wherein the computer program implements the following steps when executed by a processor: performing image enhancement and shape feature extraction on an initial data sample including low, small and slow targets to obtain a training sample image set; constructing an infrared low, small and slow target detection network including a loss function; wherein the infrared low, small and slow target detection network includes a teacher network and a student network; training the teacher network in the infrared low, small and slow target detection network by a back propagation algorithm based on the training sample image set, and obtaining a deep teacher network after minimizing the loss function; training the student network in the infrared low, small and slow target detection network by a back propagation algorithm based on the training sample image set, and optimizing the student network based on the output result of the deep teacher network to obtain a target detection network; inputting the image to be identified into the target detection network, and outputting the infrared low, small and slow target detection result.

[0021] Compared with the prior art, the present invention has the following beneficial effects:

[0022] The present invention adopts U-net as the backbone network with a clear structure and less computation. It is divided into two parts, encoding and decoding. After combining with BiFPN, it has a stronger expression ability for small targets. The fusion of target shapes can enable the model to obtain results that can better restore the shapes of infrared low, small and slow targets, thereby improving the detection accuracy and segmentation accuracy without increasing the amount of computation. Furthermore, the model obtained by the present invention adopts the knowledge distillation method, which makes the model smaller and less computationally intensive without losing detection accuracy. In addition, the present invention first uses a deeper network training to obtain a high-precision model, and then uses a shallower network to learn a high-precision model, so as to obtain a model with similar accuracy and less computational complexity, making it possible to run a high-precision, high-speed infrared low, small and slow target detection model on edge devices. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] Figure 1 FIG. 1 is a flow chart of a method for detecting low, small and slow infrared targets provided by an embodiment of the present invention;

[0024] Figure 2 FIG. 1 is a schematic diagram of the structure of a student network model provided by an embodiment of the present invention;

[0025] Figure 3 FIG. 1 is a schematic diagram of the structure of a residual attention module provided by an embodiment of the present invention;

[0026] Figure 4 Shown is a schematic diagram of a knowledge distillation process provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0027] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are 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 making creative work are within the scope of protection of this application.

[0028] In a first aspect, the present invention provides an infrared low, small and slow target detection method, which specifically includes the following embodiments:

[0029] Figure 1 FIG. 1 is a flow chart of a method for detecting a low, small and slow infrared target provided by an embodiment of the present invention. Figure 1 As shown, the specific steps include:

[0030] Step S101, performing image enhancement and shape feature extraction on initial data samples including low, small and slow targets to obtain a training sample image set;

[0031] It should be noted that an initial data sample data set including low, small and slow targets is collected, and the initial sample data set is expanded in combination with a public data set. The obtained fused data set is divided into a training set, a validation set and a test set in a ratio of 5:3:2.

[0032] In this embodiment, performing image enhancement on the initial sample data includes the following methods:

[0033] (1) Random horizontal flipping: Use a random number generator to generate a random number between 0 and 1. If the random number is less than 0.5, the image and mask are flipped horizontally, that is, flipped left and right; Where Y is the output image, x is the output image, F() is the image horizontal flip function, n is a random number, and random() is the random number generation function.

[0034] (2) Random scale transformation: According to the predefined base_size (base size is 256), the target size is randomly generated, and then the image and mask are proportionally scaled to the target size. This can increase the adaptability of the model to targets of different scales, that is, Y = F(x, s1, s2), s2 = random(), where F() is the image scaling function, s1 is the width and height of the input image x, s2 is the randomly generated width and height, and random() is a function that generates random numbers of size 128-512.

[0035] (3) Random padding: If the scaled image is small (length or width is less than 256), fill the image with 0s to make its size equal to 256, thus ensuring that the image size meets the requirements; that is, F() is the zero filling function, and s is the maximum value of length and width.

[0036] (4) Random cropping: Randomly crop a region of size 256 from the scaled image to obtain the final image and mask. This allows the model to see image regions at different locations, improving the robustness of the model. F() is the cropping function, and s is the maximum value of length and width.

[0037] (5) Gaussian blur: The image is Gaussian blurred with a probability of 0.5. Gaussian blur can simulate some blur effects in real scenes, thereby increasing the generalization ability of the model, that is, G() is the Gaussian filter function, n is a random number, and random() is the random number generation function.

[0038] In this embodiment, the Sobel operator and the Prewitt operator are used to extract shape features from the data samples after image enhancement. The two operators respectively obtain edge images in the horizontal and vertical directions through convolution operations. The final shape feature is obtained by combining the edge images extracted by the two operators. The formula is: Among them, S() is the convolution operation performed by the Sobel operator, P() is the convolution operation performed by the Prewitt operator, and Y is the final shape feature.

[0039] After the above enhanced image operation, the initial input image and the mask true value image (binary mask image), the target shape true value image (that is, the shape feature Y), and the target shape mask image (binary mask image) are obtained.

[0040] Step S102, constructing an infrared low-light, small, and slow target detection network including a loss function; wherein the infrared low-light, small, and slow target detection network includes a teacher network and a student network;

[0041] In this embodiment, the infrared low, small and slow target detection network includes: in the encoding stage of the encoding layer, a residual attention module is used as a feature extraction module, combined with a bidirectional cross-scale connection, to extract multi-scale features of infrared low, small and slow targets; in the decoding stage of the decoding layer, a residual attention module is used as a feature reconstruction module, and feature maps of different scales of each layer are fused through a parameter-shared residual attention block to enhance the features of infrared low, small and slow targets; wherein the residual attention module in the teacher network is stacked to three layers, and the residual attention module in the student network is a single layer.

[0042] like Figure 2 As shown, the encoding stage of the encoding layer uses a residual attention block as a feature extraction module to extract multi-scale features of infrared low-small and slow targets, so as to achieve similar or better results with lower computational complexity than other semantic segmentation models. The attention module efficiently extracts features of infrared low-small and slow targets, and uses the maximum pooling operation as downsampling. The pooling operation and the residual attention block continuously reduce the size of the feature map and increase the number of channels, and multiply it with the weight of this layer to obtain the input of the next layer; the encoding stage in this embodiment includes five layers, with U-net as the backbone network, combined with the bidirectional cross-scale connection of the BiFPN network, to extract multi-scale features of infrared low-small and slow targets, so as to achieve similar or better results with lower computational complexity than other semantic segmentation models.

[0043] This embodiment uses the residual attention module to replace the bottleneck layer in the original U-net, such as Figure 3 As shown, the residual attention block includes: a first convolution block, a first batch of normalization layers, a first activation layer, a second convolution block, a second batch of normalization layers, a channel attention block, a spatial attention block, a residual connection layer, and a second activation layer connected in sequence; the formula is:

[0044] Y=RELU(X+Spatial(Cannnel(BN2(Conv2 3x3 (RELU(BN1(Conv1 3x3 (X)))))))); where X and Y are input and output, RELU() represents the RELU activation function, BN1() and BN2() are batch normalization, Conv1() and Conv2() are convolution operations, the 3x3 in the upper left corner is the convolution kernel size, Spatial() and Cannnel() are spatial attention blocks and channel attention blocks respectively, and the channel attention block formula is X and Y are input and output, σ() is the sigmoid activation function, Pavg() and Pmax() are average pooling and maximum pooling operations respectively, MLP() is a multi-layer perceptron, is element-by-element multiplication; the spatial attention formula is: X and Y are input and output, σ() is the sigmoid activation function, Pavg() and Pmax() are average pooling and maximum pooling operations respectively, [;] is the channel concatenation operation, and Conv3x3() is a 3x3 convolution operation. The output of the shallow coding layer is multiplied by the weight of the layer to obtain the input of the next layer, which ensures robust feature extraction and implements a new method of using residual attention modules at each decoder stage, improving the performance of multi-scale feature fusion.

[0045] The bidirectional cross-scale connection replaces the jump connection in the original U-net. The connection consists of a residual attention module and a residual connection, such as Figure 1 The middle connection part of the network diagram, where the input of the residual attention module is the concatenation of the output of the previous layer and the output of the same layer on the channel. The formula is Y i = RAM([Conv 3×3 (up(X i-1 ));X i ]). Where X i With Y i is the input and output of the i-th layer, RAM() is the residual attention module, [;] is the channel concatenation operation, Conv 3×3 is a 3×3 convolution operation, and up() is a (2,2) upsampling operation. Each bidirectional (multi-scale feature: top-down and bottom-up) path is regarded as a feature network layer, and the same layer is repeated multiple times to enable more advanced feature fusion.

[0046] In the decoding stage of the decoding layer of this embodiment, the residual attention module is still used as the feature reconstruction module, in which the channel attention module and the spatial attention module effectively emphasize or compress the extracted infrared low-speed small and slow target features. The feature maps input to each layer are upsampled and subjected to 1x1 convolution blocks so that the outputs of each layer have the same size and number of channels, and are spliced ​​at the channel level. The feature maps of different scales of each layer are fused through the residual attention block with parameter sharing, thereby enhancing the features of infrared low-speed small and slow targets.

[0047] The decoding layers are similar to the encoding layers, but downsampling is replaced by upsampling, and the output of the bidirectional cross-scale connection and the output of the encoding layer are received. After upsampling and 1x1 convolution, the output of the same size and number of channels is obtained, and the input of the residual attention block of the decoding layer is obtained by splicing on the channel. The output of the residual attention block of each layer of the decoding layer and the product of the weight of the layer are the final five feature maps, and the formula is Y i = RAM(X i ). i With Y i are the input and output of the i-th layer respectively, and RAM is the residual attention module.

[0048] The target shape in the decoding stage is fused with the five outputs obtained from each layer of the decoding layer. The five outputs are converted into feature maps of the same size and number of channels by upsampling and 1x1 convolution of different sizes, and then spliced ​​with the target shape image. After a 1×1 convolution operation, the final target shape output is obtained. The formula is:

[0049] Y = Conv([X shape ;X fuse ]);X fuse =[X 1 ; up 2 (X 2 ); up 4 (X 3 ); up 8 (X 4 ); up 16 (X 5 )].

[0050] Where X shape With X fuse They are the output after target shape extraction and the result of fusion of each layer of the decoding layer, X 1 -X 5 is the output of each decoding layer, up 2 -up 16 is an upsampling of size (2,2)-(16,16), Y is the target shape output, Conv() is a convolution module operation, including 1×1 convolution, batch normalization, RELU, and [;] is a channel splicing operation.

[0051] Step S103, training the teacher network in the infrared low-light, small and slow target detection network by back propagation algorithm based on the training sample image set, and obtaining a deep teacher network after minimizing the loss function;

[0052] In this embodiment, based on the data training set, the network is trained by a back propagation algorithm based on mini-batch gradient descent. The input is an image in the data training set, and the output is a binary mask image. The image intersection over union (IoU) in the data training set is generated. During the training process, the loss function of the network is calculated by the back propagation algorithm. When the loss function is minimized, an optimized infrared low, small and slow target detection network is obtained.

[0053] The loss obtained during the training process is calculated by calculating the loss of the mask true value image and the loss of the target shape true value image from the six outputs obtained by the network. The loss function formula is: L = L Mask +λ×L Shape Where λ is a hyperparameter that balances the two losses. L, LMask and LShape are the overall loss, target loss and target shape loss respectively. The definition is: L = 1-IoU. IoU means the ratio of the intersection and union of the binary mask image output by the model and the binary mask true value image. It is defined here as: Among them, TP is the positive sample predicted by the model as the positive class, FP is the negative sample predicted by the model as the positive class, and FN is the positive sample predicted by the model as the negative class.

[0054] Step S104, training the student network in the infrared low-light, small and slow target detection network by back propagation algorithm based on the training sample image set, and optimizing the student network based on the output result of the deep teacher network to obtain the target detection network;

[0055] In this embodiment, based on the data training set, the network is trained by a back propagation algorithm based on mini-batch gradient descent. The input is an image in the data training set, and the output is a binary mask image. The image intersection over union (IoU) in the data training set is generated. During the training process, the loss function of the network is calculated by the back propagation algorithm. When the loss function is minimized, an optimized infrared low, small and slow target detection network is obtained.

[0056] The loss obtained during the training process is calculated by calculating the loss of the mask true value image and the loss of the target shape true value image from the six outputs obtained by the network. The loss function formula is: L = L Mask +λ×L shapeAmong them, λ is a hyperparameter to balance the two losses, L, LMask and LShape are the overall loss, target loss and target shape loss respectively, and are defined as: L = 1-IoU, where IoU means the ratio of the intersection and union of the binary mask image output by the model and the binary mask true value image. Here it is defined as: Among them, TP is the positive sample predicted by the model as the positive class, FP is the negative sample predicted by the model as the positive class, and FN is the positive sample predicted by the model as the negative class.

[0057] Step S105, input the image to be identified into the target detection network, and output the infrared low, small and slow target detection result.

[0058] In this embodiment, if Figure 4 As shown in Figure 2, when using a data set to train a student neural network, the data set is input into the teacher neural network to obtain the corresponding output results, the corresponding distillation loss is calculated, and then the overall loss function L of the student neural network is calculated. 学生网络 =L 原任务 +λ×L 蒸馏 . The back propagation algorithm is used to optimize the student network. Since the input and output layers are designed the same, only the knowledge in the middle layer is distilled and the distillation loss is calculated. The original task L is the same as the network loss definition in step 3, and L distillation is the absolute value difference between the output results of the student network and the teacher network, that is, the similarity of knowledge. It is defined as L 蒸馏 =||F(x 教师网络 )+F(x 学生网络 )||, where F() is a dimension transformation function that maps the output results of the two to the same dimension (one-dimensional convolution), and then performs knowledge distillation and calculation loss in the middle layer.

[0059] Compared with the prior art, this embodiment has the following beneficial effects:

[0060] The present invention adopts U-net as the backbone network with a clear structure and less computation. It is divided into two parts, encoding and decoding. After combining with BiFPN, it has a stronger expression ability for small targets. The fusion of target shapes can enable the model to obtain results that can better restore the shapes of infrared low, small and slow targets, thereby improving the detection accuracy and segmentation accuracy without increasing the amount of computation. Furthermore, the model obtained by the present invention adopts the knowledge distillation method, which makes the model smaller and less computationally intensive without losing detection accuracy. In addition, the present invention first uses a deeper network training to obtain a high-precision model, and then uses a shallower network to learn a high-precision model, so as to obtain a model with similar accuracy and less computational complexity, making it possible to run a high-precision, high-speed infrared low, small and slow target detection model on edge devices.

[0061] In another embodiment of the present invention, shape feature extraction is performed on an initial data sample, including: performing convolution operations on the initial data sample with multiple template images respectively to obtain an initial gradient image; wherein the multiple template images include template images in four directions of horizontal, vertical, 45° and 135° of the center point of the image window; performing local edge gradient screening and enhancement on the initial gradient image according to the local gradient mean to obtain a preprocessed gradient image; performing edge extraction and refinement on the preprocessed gradient image to obtain a refined gradient image; performing image binarization on the refined gradient image to obtain a training sample image including shape features.

[0062] It should be noted that the original image (i.e., the initial data sample) is convolved with the four directional templates (i.e., multiple template images), and the operation results respectively represent the gradient values ​​of the four directions of the center point of the image window. The gradient image can be obtained using the formula G=(G0)2+(G90)2+(G45)2+(G135)212, where G0, G90, G45 and G135 represent the gradient values ​​of the center point of the image window in the horizontal, vertical, 45° and 135° directions, respectively. The calculation result G refers to the initial gradient image obtained.

[0063] Furthermore, image enhancement refers to enhancing the useful information in the image, which can be a distortion process. The purpose of image enhancement is to improve the visual effect of the image and to emphasize the overall or local features of the image for a given image application. Image enhancement can make the image clear or emphasize certain features of interest, can expand the differences between the features of different objects in the image, suppress features of no interest, can enhance the image quality, enrich the amount of information, strengthen the image interpretation and recognition effect, and can meet the needs of certain special analysis; this embodiment uses the local gradient mean to perform local edge gradient screening and enhancement on the gradient image. According to the formula G'=G(i,j)G(i,j)>mean(G(i,j)), the enhanced gradient image can be obtained, where G is the initial gradient image, G' is the gradient image after threshold processing, and mean(G(i,j)) is the average value of the gradient value in the 3x3 detection window in the initial gradient image G.

[0064] Furthermore, edge detection is a basic problem in image processing and computer vision. Edge detection mainly identifies points in digital images where brightness changes significantly. Image edge detection greatly reduces the amount of data, removes information that can be considered irrelevant, and retains important structural properties of the image. In this embodiment, the gradient image G' is first median filtered, and then the local edge extraction and refinement of the gradient image are performed according to the formula G'1 = max(i, j)G(i, j)>a Xmax(i, j)Oothers, and the refined gradient image is G'1, where G'1 refers to the refined gradient image, max(i, j) is the maximum value of the gradient in the area of ​​the center point 8 in the window, and a is the control parameter.

[0065] Furthermore, a binary image refers to an image in which each pixel has only two grayscale levels. The binarization of an image refers to setting the grayscale value of the pixel on the image to 0 or 255, that is, presenting the entire image with a visual effect of only black and white. The gradient image G'1 obtained in the previous step is subjected to boundary tracing and then image binarization is performed using the formula H=255ifG'1>TOothers to obtain the extracted edge image H, where T represents the threshold value when the image is binarized, and H represents the obtained edge image, that is, the training sample image including shape features.

[0066] In a second aspect, an embodiment of the present invention provides a computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the following steps when executing the computer program: performing image enhancement and shape feature extraction on an initial data sample including low, small, and slow targets to obtain a training sample image set; constructing an infrared low, small, and slow target detection network including a loss function; wherein the infrared low, small, and slow target detection network comprises a teacher network and a student network; training the teacher network in the infrared low, small, and slow target detection network by a back propagation algorithm based on the training sample image set, and obtaining a deep teacher network after minimizing the loss function; training the student network in the infrared low, small, and slow target detection network by a back propagation algorithm based on the training sample image set, and optimizing the student network based on the output result of the deep teacher network to obtain a target detection network; inputting the image to be identified into the target detection network, and outputting the infrared low, small, and slow target detection result.

[0067] In a third aspect, an embodiment of the present invention provides a readable storage medium having a computer program stored thereon, wherein the computer program implements the following steps when executed by a processor: performing image enhancement and shape feature extraction on an initial data sample including low, small and slow targets to obtain a training sample image set; constructing an infrared low, small and slow target detection network including a loss function; wherein the infrared low, small and slow target detection network includes a teacher network and a student network; training the teacher network in the infrared low, small and slow target detection network by a back propagation algorithm based on the training sample image set, and obtaining a deep teacher network after minimizing the loss function; training the student network in the infrared low, small and slow target detection network by a back propagation algorithm based on the training sample image set, and optimizing the student network based on the output result of the deep teacher network to obtain a target detection network; inputting the image to be identified into the target detection network, and outputting the infrared low, small and slow target detection result.

[0068] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the program can be stored in a non-volatile computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).

[0069] It should be noted that, in this article, relational terms such as "first" and "second" 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 existence of other identical elements in the process, method, article or device including the elements.

Claims

1. A method for detecting low, small and slow infrared targets, characterized in that: The method comprises: Perform image enhancement and shape feature extraction on the initial data samples including low, small and slow targets to obtain a training sample image set; Perform shape feature extraction on the initial data sample, including: Convolution operations are performed on the initial data samples with multiple template images to obtain initial gradient images; wherein the multiple template images include template images in four directions: horizontal, vertical, 45° and 135° of the center point of the image window; Performing local edge gradient screening and enhancement on the initial gradient image according to the local gradient mean to obtain a preprocessed gradient image; Performing edge extraction and thinning on the preprocessed gradient image to obtain a thinned gradient image; Binarizing the refined gradient image to obtain a training sample image including shape features; Constructing an infrared low-light, small, and slow target detection network including a loss function; wherein the infrared low-light, small, and slow target detection network includes a teacher network and a student network; Based on the training sample image set, the teacher network in the infrared low-level small and slow target detection network is trained by a back propagation algorithm, and a deep teacher network is obtained after minimizing the loss function; Based on the training sample image set, a student network in the infrared low-level small and slow target detection network is trained by a back propagation algorithm, and the student network is optimized based on the output result of the deep teacher network to obtain a target detection network; Input the image to be identified into the target detection network, and output the infrared low, small and slow target detection result; The infrared low, small and slow target detection network includes: In the encoding stage of the encoding layer, the residual attention module is used as the feature extraction module, combined with bidirectional cross-scale connections to extract multi-scale features of infrared low-speed, small and slow targets; In the decoding stage of the decoding layer, the residual attention module is used as the feature reconstruction module. The feature maps of different scales of each layer are fused through the parameter-sharing residual attention block to enhance the features of infrared low-speed, small and slow targets. The residual attention module in the teacher network is stacked to three layers, and the residual attention module in the student network is a single layer; The target shape of the decoding stage of the decoding layer is fused with the five outputs obtained from each layer of the decoding layer. The five outputs are converted into feature maps of the same size and number of channels by upsampling of different sizes and 1x1 convolution, and then spliced ​​with the target shape image. After the 1x1 convolution operation, the formula for obtaining the final target shape output is: Y=Conv([X shape ;X fuse ]); X fuse =[X 1 ;up 2 (X 2 );up 4 (X 3 );up 8 (X 4 );up 16 (X 5 )]; Among them, X shape With X fuse They are the output after target shape extraction and the fusion results of each layer of the decoding layer. X 1 -X 5 is the output of each decoding layer, up 2 -up 16 is an upsampling of size (2,2)-(16,16), Y is the target shape output, and Conv() is the convolution module operation.

2. The infrared low, small and slow target detection method according to claim 1, characterized in that: The residual attention block includes: a first convolution block, a first batch of normalization layers, a first activation layer, a second convolution block, a second batch of normalization layers, a channel attention block, a spatial attention block, a residual connection layer and a second activation layer connected in sequence; the formula expression is: Y=RELU(X+Spatial(Cannnel(BN2(Conv2 3x3 (RELU(BN1(Conv1 3x3 (X)))))))) Among them, X and Y are input and output, RELU() represents the RELU activation function, BN1() and BN2() are batch normalization, Conv1() and Conv2() are convolution operations, Spatial() and Cannnel() are spatial attention blocks and channel attention blocks respectively, and the channel attention block formula is X and Y are input and output, σ() is the sigmoid activation function, P avg () and P max () are average pooling and maximum pooling operations respectively, MLP() is a multi-layer perceptron, is element-by-element multiplication; the spatial attention formula is: X and Y are input and output, σ() is the sigmoid activation function, P avg () and P max () are average pooling and maximum pooling operations respectively, and [;] are channel concatenation operations.

3. The infrared low, small and slow target detection method as claimed in claim 2, characterized in that: The input of the residual attention module is the concatenation of the output of the previous layer and the output of the same layer on the channel: Y i =RAM([Conv 3×3 (up(X i-1 ));X i ]) Among them, X i With Y i is the input and output of the i-th layer, RAM() is the residual attention module, [;] is the channel concatenation operation, Conv 3×3 is a 3×3 convolution operation, and up() is a (2,2) upsampling operation.

4. The infrared low, small and slow target detection method according to claim 1, characterized in that: The teacher network in the infrared low-speed small and slow target detection network is trained based on the training sample image set by back propagation algorithm, and the deep teacher network is obtained by minimizing the loss function, including: Based on the training sample image set, the network is trained by a back propagation algorithm based on mini-batch gradient descent to generate the image intersection over union (IoU) ratio in the training sample image set; wherein the input is a sample image in the training sample image set, and the output is a binary mask image; The loss function of the network is calculated according to the image intersection over union (IoU), and when the loss function is minimized, an optimized deep teacher network is obtained.

5. The infrared low, small and slow target detection method according to claim 1, characterized in that: The student network in the infrared low-level small and slow target detection network is trained by a back propagation algorithm based on a training sample image set, and the student network is optimized based on the output result of a deep teacher network to obtain a target detection network, including: Inputting the training sample image set into the student network for training, and calculating the distillation loss according to the output result obtained by inputting the training sample image set into the deep teacher network; The loss function of the student network is obtained according to the distillation loss, and the loss function is optimized by a back propagation algorithm to obtain the target detection network.

6. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 5 are implemented.

7. A readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 5 are implemented.